Bug 11570 - REGRESSION (r16122): min/max widths incorrectly calculated for contentEditable text
Summary: REGRESSION (r16122): min/max widths incorrectly calculated for contentEditabl...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Graham Dennis
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-11-11 02:53 PST by Graham Dennis
Modified: 2006-11-11 04:40 PST (History)
2 users (show)

See Also:


Attachments
patch (105.74 KB, patch)
2006-11-11 03:03 PST, Graham Dennis
hyatt: review-
Details | Formatted Diff | Diff
patch 2 (59.71 KB, patch)
2006-11-11 03:47 PST, Graham Dennis
mitz: review+
Details | Formatted Diff | Diff
followup patch (2.72 KB, patch)
2006-11-11 04:29 PST, Graham Dennis
hyatt: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Graham Dennis 2006-11-11 02:53:35 PST
In revision r16122, all spaces in editable text nodes were changed to be non-breaking spaces instead of space/non-breaking space pairs as necessary. However, RenderText calculates its min/max widths assuming that non-breaking spaces cannot be broken independent of -webkit-nbsp-mode. This causes a problem when a contentEditable div is absolutely positioned to the right, then as text is typed into the div, once the amount of text inserted is longer than one line, there will be a run of characters which RenderText thinks cannot be broken, and so the width of the editable div will increase.

Patch forthcoming.
Comment 1 Graham Dennis 2006-11-11 03:03:01 PST
Created attachment 11479 [details]
patch

Patch.
I don't really like the huge number of editing delegate messages generated by the layout test for this bug, but I couldn't reproduce the bug by replacing the typeCharacterCommand()'s by a single document.execCommand('InsertText', ...).

All other layout tests pass.
Comment 2 Graham Dennis 2006-11-11 03:47:21 PST
Created attachment 11480 [details]
patch 2

Patch 2.

Testcase no longer uses editing code, and hence has been moved to fast/text/whitespace/nbsp-mode-and-linewraps.html.
Comment 3 mitz 2006-11-11 04:00:39 PST
Comment on attachment 11480 [details]
patch 2

r=me
Comment 4 Graham Dennis 2006-11-11 04:13:57 PST
Committed in r17724.
Comment 5 Dave Hyatt 2006-11-11 04:15:13 PST
Comment on attachment 11479 [details]
patch

RenderStyle is not an appropriate spot for an isSpace helper like this.
Comment 6 Graham Dennis 2006-11-11 04:29:23 PST
Created attachment 11482 [details]
followup patch

Follow patch to remove the helper function from RenderStyle
Comment 7 Dave Hyatt 2006-11-11 04:40:40 PST
Comment on attachment 11482 [details]
followup patch

r=me

Thanks!