Opened 14 years ago

Last modified 13 years ago

#7984 confirmed Bug

AutoGrow fails on Firefox with document that has quirks mode Doctype

Reported by: Dan Lee Owned by: Garry Yao
Priority: Normal Milestone:
Component: General Version: 3.4
Keywords: IBM Cc: satya_minnekanti@…

Description (last modified by Wiktor Walc)

Steps:

  1. Grab latest nightly. (I used Revision number: 7007).
  2. Add config.fullPage = true; to the config
  3. Open the Autogrow sample in Firefox 4.
  4. Click on Source on the default configuration autogrow sample.
  5. Add the following Doctype above the html element: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  6. Click Source again to go back to WYSIWYG mode.
  7. Enter several newlines to make the document taller than the contents.

Results: Autogrow fails. The height of the document is not adjusted.

Removal of the Doctype appears to fix the problem. Also appears to occur in Chrome on Mac.

Attachments (5)

7984.patch (1010 bytes) - added by Sa'ar Zac Elias 14 years ago.
7984_2.patch (2.2 KB) - added by Garry Yao 14 years ago.
7984_3.patch (2.2 KB) - added by Garry Yao 14 years ago.
7984_4.patch (2.5 KB) - added by Garry Yao 14 years ago.
7984_5.patch (2.8 KB) - added by Garry Yao 14 years ago.

Download all attachments as: .zip

Change History (30)

comment:1 Changed 14 years ago by Wiktor Walc

Description: modified (diff)

comment:2 Changed 14 years ago by Wiktor Walc

Status: newconfirmed

Confirmed in FF 4.0.1/XP using the following source:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<title></title>
	</head>
	<body>
		<p>
			This is some <strong>sample text</strong>. You are using <a href="http://ckeditor.com/">CKEditor</a>.</p>
	</body>
</html>

Note that in CKEditor 3.6 the result was even more strange, the autogrow plugin "worked", but the calculated size of the editing area was totally wrong and was increasing with each typed letter.

Last edited 14 years ago by Wiktor Walc (previous) (diff)

comment:3 Changed 14 years ago by Jakub Ś

Confirmed for Opera, Webkit, IE6-8 from rev [6921]

Firefox behaves the same as other browsers but from CKEditor 3.4.2 till rev [6921] it had different problem described by @Wiktor in previous comment.

This issue seems to work on IE9.

comment:4 Changed 14 years ago by Wiktor Walc

What makes the original bug report more important is that the autogrow plugin stopped working were it used to work, for example in IE8 in the default mode (when fullPage is turned off).

To confirm this, simply enable the autogrow plugin in config.js and check the replacebyclass sample with doctype set to <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> (or without doctype at all).

comment:5 Changed 14 years ago by Wiktor Walc

Milestone: CKEditor 3.6.1

Changed 14 years ago by Sa'ar Zac Elias

Attachment: 7984.patch added

comment:6 Changed 14 years ago by Sa'ar Zac Elias

Owner: set to Sa'ar Zac Elias
Status: confirmedreview

Quirks still requires the dirty 24px hack.

comment:7 Changed 14 years ago by Dan Lee

This looks good in Firefox, Chrome, and IE9. I am still able to reproduce the problem in IE8 and IE7 though. I added the patch to my local nightly, made fullPage=true, and added the same doctype to the top of the HTML: <!DOCTYPE HTML PUBLIC "-W3CDTD HTML 4.01 TransitionalEN">

IE8 and IE7 do not grow when typing multiple newlines.

comment:8 Changed 14 years ago by Garry Yao

Status: reviewreview_failed

We need to avoid hard coded magic number, it depends on, e.g. margin from the document styles.

Changed 14 years ago by Garry Yao

Attachment: 7984_2.patch added

comment:9 Changed 14 years ago by Satya Minnekanti

Cc: satya_minnekanti@… added

comment:10 Changed 14 years ago by Garry Yao

Owner: changed from Sa'ar Zac Elias to Garry Yao
Status: review_failedreview

comment:11 Changed 14 years ago by Sa'ar Zac Elias

Status: reviewreview_failed
  • In IE, using a Quirks document and a Quirks host page, autogrow doesn't work.
  • In Opera and Chrome (didn't test Safari), using a Quirks document, the editor size is not reduced back when removing newly created lines.

Changed 14 years ago by Garry Yao

Attachment: 7984_3.patch added

comment:12 Changed 14 years ago by Garry Yao

Status: review_failedreview

In IE, using a Quirks document and a Quirks host page, autogrow doesn't work.

Some older IEs need a small timeout after altering the editor size.

In Opera and Chrome (didn't test Safari), using a Quirks document, the editor size is not reduced back when removing newly created lines.

Unfortunately we had this limitation in quirks mode of Webkit and Opera where the actual content height cannot be figured out by looking at box model, how about live with it now (as it's not a regression).

comment:13 Changed 14 years ago by Sa'ar Zac Elias

Status: reviewreview_passed

comment:14 Changed 14 years ago by Garry Yao

Resolution: fixed
Status: review_passedclosed

Fixed with [7018].

comment:15 Changed 14 years ago by Dan Lee

I pulled in the latest from trunk and ran the same test. (Change config to fullPage=true;, open the autogrow sample, add this doctype to the top: <!DOCTYPE HTML PUBLIC "-W3CDTD HTML 4.01 TransitionalEN">

Things look good in IE7 and IE8, but I am seeing some strange behavior in IE9 where the document grows on any keystroke. Just me?

comment:16 Changed 14 years ago by Dan Lee

Did a little digging too.... With the quirks mode doctype in the autogrow sample in IE9, line 30 of the autogrow plugin indicates an increase on all events.

It looks like scrollable.scrollHeight and scrollable.clientHeight are different in cases where they should be the same. (I'm seeing a 16pixel difference, resulting in 'increase' being 16 on each and every keystroke, regardless of whether this keystroke should cause a grow).

Last edited 14 years ago by Dan Lee (previous) (diff)

comment:17 Changed 14 years ago by Garry Yao

Resolution: fixed
Status: closedreopened

I've just figured out a better approach to shape it better, so requires another review, the new patch is supposed to be working in all browsers.

Last edited 14 years ago by Garry Yao (previous) (diff)

Changed 14 years ago by Garry Yao

Attachment: 7984_4.patch added

comment:18 Changed 14 years ago by Garry Yao

Status: reopenedreview

comment:19 Changed 14 years ago by Sa'ar Zac Elias

Status: reviewreview_failed

Fails in Webkit with enterMode=BR, after hitting ENTER enough times to create scrollbars.

Changed 14 years ago by Garry Yao

Attachment: 7984_5.patch added

comment:20 Changed 14 years ago by Garry Yao

Status: review_failedreview

An idea shared by Saar to use marker node for measurement when last element is not available.

comment:21 Changed 14 years ago by Sa'ar Zac Elias

Status: reviewreview_passed

comment:22 Changed 14 years ago by Garry Yao

Resolution: fixed
Status: review_passedclosed

Fixed with [7032], thanks for very participants.

comment:23 Changed 14 years ago by Wiktor Walc

Milestone: CKEditor 3.6.1
Resolution: fixed
Status: closedreopened
Version: 3.6.1 (SVN - trunk)

[6921] and all further changes to the autogrow plugin were reverted with [7056].

comment:24 Changed 14 years ago by Satya Minnekanti

Keywords: IBM added

comment:25 Changed 13 years ago by Jakub Ś

Status: reopenedconfirmed
Version: 3.4

After reverting the changes, @wwalc TC is still applicable but the result is a little different.

If you set config.fullPage = true; , open autogrow sample and paste the below code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<title></title>
	</head>
	<body>
		<p>
			This is some <strong>sample text</strong>. You are using <a href="http://ckeditor.com/">CKEditor</a>.</p>
	</body>
</html>

You will see that with every letter typed editor grows.

Reproducible in Firefox (3.6-5) from CKEditor 3.4.2 and in IE9 from CKEditor 3.4

In Webkit - enlarging editor works fine but if you delete part or whole of its contents it will not get smaller. I have reported this issue here #8133

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy