WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
REOPENED
138348
Some words are placed on top of each other in complex text layout
https://bugs.webkit.org/show_bug.cgi?id=138348
Summary
Some words are placed on top of each other in complex text layout
Myles C. Maxfield
Reported
2014-11-03 20:48:02 PST
[OSX] Some words are placed on top of each other in complex text layout
Attachments
Patch
(674.93 KB, patch)
2014-11-03 20:56 PST
,
Myles C. Maxfield
no flags
Details
Formatted Diff
Diff
Archive of layout-test-results from webkit-ews-09 for mac-mountainlion-wk2
(722.74 KB, application/zip)
2014-11-03 22:05 PST
,
Build Bot
no flags
Details
Archive of layout-test-results from webkit-ews-07 for mac-mountainlion
(735.06 KB, application/zip)
2014-11-03 22:36 PST
,
Build Bot
no flags
Details
Updated for older OS X
(794.96 KB, patch)
2014-11-04 11:29 PST
,
Myles C. Maxfield
no flags
Details
Formatted Diff
Diff
Updated for older OS X
(924.59 KB, patch)
2014-11-04 11:38 PST
,
Myles C. Maxfield
no flags
Details
Formatted Diff
Diff
WIP
(2.26 KB, patch)
2015-05-05 18:23 PDT
,
Myles C. Maxfield
no flags
Details
Formatted Diff
Diff
Reduction
(200 bytes, text/html)
2015-05-05 18:26 PDT
,
Myles C. Maxfield
no flags
Details
WIP
(22.42 KB, patch)
2015-05-06 22:29 PDT
,
Myles C. Maxfield
no flags
Details
Formatted Diff
Diff
WIP
(23.44 KB, patch)
2015-05-07 00:42 PDT
,
Myles C. Maxfield
no flags
Details
Formatted Diff
Diff
Patch
(28.12 KB, patch)
2015-05-07 19:12 PDT
,
Myles C. Maxfield
no flags
Details
Formatted Diff
Diff
Patch
(28.16 KB, patch)
2015-05-07 19:16 PDT
,
Myles C. Maxfield
no flags
Details
Formatted Diff
Diff
Patch
(65.34 KB, patch)
2015-05-10 20:06 PDT
,
Myles C. Maxfield
no flags
Details
Formatted Diff
Diff
Show Obsolete
(10)
View All
Add attachment
proposed patch, testcase, etc.
Myles C. Maxfield
Comment 1
2014-11-03 20:56:12 PST
Created
attachment 240909
[details]
Patch
Build Bot
Comment 2
2014-11-03 22:05:12 PST
Created
attachment 240911
[details]
Archive of layout-test-results from webkit-ews-09 for mac-mountainlion-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: webkit-ews-09 Port: mac-mountainlion-wk2 Platform: Mac OS X 10.8.5
Build Bot
Comment 3
2014-11-03 22:36:48 PST
Created
attachment 240912
[details]
Archive of layout-test-results from webkit-ews-07 for mac-mountainlion The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: webkit-ews-07 Port: mac-mountainlion Platform: Mac OS X 10.8.5
Myles C. Maxfield
Comment 4
2014-11-04 09:42:18 PST
<
rdar://problem/18797255
>
Myles C. Maxfield
Comment 5
2014-11-04 11:29:58 PST
Created
attachment 240934
[details]
Updated for older OS X
Myles C. Maxfield
Comment 6
2014-11-04 11:38:21 PST
Created
attachment 240935
[details]
Updated for older OS X
mitz
Comment 7
2014-11-04 11:56:06 PST
Comment on
attachment 240935
[details]
Updated for older OS X View in context:
https://bugs.webkit.org/attachment.cgi?id=240935&action=review
> Source/WebCore/platform/graphics/mac/ComplexTextController.cpp:620 > + CGSize advance = advances[i];
Last time we tried something like this was in
http://trac.webkit.org/r129176
, and we had to revert it in
http://trac.webkit.org/r129389
. Is this different?
Myles C. Maxfield
Comment 8
2014-11-04 13:10:33 PST
I'm not going to submit this until I make sure that line breaking and max width works correctly (or fix them)
Myles C. Maxfield
Comment 9
2014-11-10 10:40:41 PST
1. I found some problems with width calculations, but these problems are present both with and without this patch. Fixing these seems to be a part of
https://bugs.webkit.org/show_bug.cgi?id=138213
2. I looked at the code which calculates max-width and line breaking, and couldn't find anything wrong from inspection. I think the combination of these two things is enough to land this, keeping in mind that we can easily roll it out if we discover a reason to. Also, if this occurs, I'll create a test showing the incorrect behavior.
Myles C. Maxfield
Comment 10
2014-11-10 10:55:41 PST
http://trac.webkit.org/changeset/175813
Myles C. Maxfield
Comment 11
2014-11-10 10:58:41 PST
<
rdar://problem/18928367
>
mitz
Comment 12
2014-11-10 11:58:26 PST
(In reply to
comment #9
)
> 1. I found some problems with width calculations, but these problems are > present both with and without this patch. Fixing these seems to be a part of >
https://bugs.webkit.org/show_bug.cgi?id=138213
> > 2. I looked at the code which calculates max-width and line breaking, and > couldn't find anything wrong from inspection. > > I think the combination of these two things is enough to land this, keeping > in mind that we can easily roll it out if we discover a reason to. Also, if > this occurs, I'll create a test showing the incorrect behavior.
There are actually two problems with the patch you landed, and this test case demonstrates both: <style> div { font-size: 36px; font-family: times; border-right: solid black; float: left; clear: both; } </style> <div> Woè Woe Woe Woe Woe Woe Woe Woe Woe Woe Woe Woe Woe Woe </div> <div> Woè Woe Woe Woe Woe Woe Woe Woe Woe Woe Woe Woe Woe Woe </div> 1. The patch introduced a discrepancy between the complex code path and the simple code path. We need to maintain the invariant that whenever something that can be rendered with the simple path is rendered with the complex path, it remains the same. 2. The patch introduced a mismatch in the complex code path between actual width and computed max-width. I think you should revert your change for now.
Simon Fraser (smfr)
Comment 13
2014-11-10 12:11:32 PST
(In reply to
comment #12
)
> 1. The patch introduced a discrepancy between the complex code path and the > simple code path. We need to maintain the invariant that whenever something > that can be rendered with the simple path is rendered with the complex path, > it remains the same. > 2. The patch introduced a mismatch in the complex code path between actual > width and computed max-width.
Are there no tests that detect these issues?
WebKit Commit Bot
Comment 14
2014-11-10 12:27:32 PST
Re-opened since this is blocked by
bug 138573
Myles C. Maxfield
Comment 15
2014-11-10 14:52:04 PST
This is because RenderText::computePreferredLogicalWidths() is completely broken. When this function tries to calculate the width of “word1 word2“ it first calculates the width of a space by itself, and then will add up the following measurements: “word1 “ minus the width of the space alone “ “ “word2“ Similarly, stripTrailingSpace() subtracts a space width from the total width, which is not correct (since the space width is measured in isolation)
Myles C. Maxfield
Comment 16
2014-11-10 22:08:51 PST
https://bugs.webkit.org/show_bug.cgi?id=138581
Myles C. Maxfield
Comment 17
2015-05-05 18:23:10 PDT
Created
attachment 252430
[details]
WIP
Myles C. Maxfield
Comment 18
2015-05-05 18:26:42 PDT
Created
attachment 252431
[details]
Reduction
Myles C. Maxfield
Comment 19
2015-05-05 19:02:21 PDT
In addition to RenderText::computePreferredLogicalWidths(), TextFragmentIterator in SimpleLineLayout must be updated.
Myles C. Maxfield
Comment 20
2015-05-05 19:20:46 PDT
TextFragmentIterator: spaceWidth(font.width(TextRun(&space, 1))) if (startPosition < nextPosition) width = m_style.spaceWidth;
Myles C. Maxfield
Comment 21
2015-05-06 20:47:53 PDT
BreakingContext::handleText() also needs to be updated.
Myles C. Maxfield
Comment 22
2015-05-06 20:49:19 PDT
Man, the code inside RenderText::computePreferredLogicalWidths() and BreakingContext::handleText() really have to be unified some day.
Myles C. Maxfield
Comment 23
2015-05-06 21:38:56 PDT
BreakingContext::handleText() actually already includes 1 character of prior whitespace
Myles C. Maxfield
Comment 24
2015-05-06 22:29:01 PDT
Created
attachment 252570
[details]
WIP
Myles C. Maxfield
Comment 25
2015-05-07 00:13:33 PDT
(In reply to
comment #23
)
> BreakingContext::handleText() actually already includes 1 character of prior > whitespace
... except if the previous run of spaces is longer than 1 character. We try to include a single prior space in every word. However, if there are two spaces in a row, we will add the leftmost space alone, and ignore spaces from here on until we hit a non-space. The next word we hit, we will not include a prior space (but we'll pick up doing this afterwards)
Myles C. Maxfield
Comment 26
2015-05-07 00:34:29 PDT
RenderText::computePreferredLogicalWidths() measures each character individually for CJK text. :(
Myles C. Maxfield
Comment 27
2015-05-07 00:42:09 PDT
Created
attachment 252578
[details]
WIP
Myles C. Maxfield
Comment 28
2015-05-07 19:12:02 PDT
Created
attachment 252673
[details]
Patch
Myles C. Maxfield
Comment 29
2015-05-07 19:16:57 PDT
Created
attachment 252674
[details]
Patch
Myles C. Maxfield
Comment 30
2015-05-10 12:34:33 PDT
stripTrailingSpace() in RenderBlockFlow also needs to be updated
Myles C. Maxfield
Comment 31
2015-05-10 12:40:23 PDT
Also RenderText::trimmedPrefWidths()
Myles C. Maxfield
Comment 32
2015-05-10 12:44:28 PDT
Callers of SVGInlineTextBox::constructTextRun() as well
Myles C. Maxfield
Comment 33
2015-05-10 12:46:30 PDT
.... along with SVGTextMetrics::constructTextRun
Myles C. Maxfield
Comment 34
2015-05-10 20:06:02 PDT
Created
attachment 252838
[details]
Patch
Myles C. Maxfield
Comment 35
2015-05-11 17:38:17 PDT
And Font::widthForGlyph()
Csaba Osztrogonác
Comment 36
2015-09-14 11:18:01 PDT
Comment on
attachment 240909
[details]
Patch Cleared Simon Fraser's review+ from obsolete
attachment 240909
[details]
so that this bug does not appear in
http://webkit.org/pending-commit
.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug