Changeset 176470 in webkit
- Timestamp:
- Nov 21, 2014, 1:08:55 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/text/simple-line-text-measuring-with-trailing-space-expected.html (added)
-
LayoutTests/fast/text/simple-line-text-measuring-with-trailing-space.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/rendering/SimpleLineLayoutFlowContents.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r176458 r176470 1 2014-11-21 Zalan Bujtas <zalan@apple.com> 2 3 REGRESSION(r175259) Simple line layout text measuring behavior changed. 4 https://bugs.webkit.org/show_bug.cgi?id=138947 5 rdar://problem/19050653 6 7 Reviewed by Antti Koivisto. 8 9 In certain cases, when block flow needs to compute the preferred width of a particular text 10 renderer, we use the non-simple line layout text measuring. 11 However, the same text renderer might end up at simple line layout later. 12 Complex line layout measures text including the trailing space and it subtracts 13 (the constant value of) space width afterwards, while simple line layout measures 14 runs without the extra space. 15 In such cases, this may result different word widths and produce unexpected line breaking. (preferred width != final width) 16 In long term, any text renderer qualified for simple line layout should go through the simple 17 text measuring code path. (https://bugs.webkit.org/show_bug.cgi?id=138973) 18 For now, just copy complex line layout behaviour. This also matches the previous simple line layout line breaking implementation. 19 20 * fast/text/simple-line-text-measuring-with-trailing-space-expected.html: Added. 21 * fast/text/simple-line-text-measuring-with-trailing-space.html: Added. 22 1 23 2014-11-21 Chris Dumez <cdumez@apple.com> 2 24 -
trunk/Source/WebCore/ChangeLog
r176466 r176470 1 2014-11-21 Zalan Bujtas <zalan@apple.com> 2 3 REGRESSION(r175259) Simple line layout text measuring behavior changed. 4 https://bugs.webkit.org/show_bug.cgi?id=138947 5 rdar://problem/19050653 6 7 Reviewed by Antti Koivisto. 8 9 In certain cases, when block flow needs to compute the preferred width of a particular text 10 renderer, we use the non-simple line layout text measuring. 11 However, the same text renderer might end up at simple line layout later. 12 Complex line layout measures text including the trailing space and it subtracts 13 (the constant value of) space width afterwards, while simple line layout measures 14 runs without the extra space. 15 In such cases, this may result different word widths and produce unexpected line breaking. (preferred width != final width) 16 In long term, any text renderer qualified for simple line layout should go through the simple 17 text measuring code path. (https://bugs.webkit.org/show_bug.cgi?id=138973) 18 For now, just copy complex line layout behaviour. This also matches the previous simple line layout line breaking implementation. 19 20 Test: fast/text/simple-line-text-measuring-with-trailing-space.html 21 22 * rendering/SimpleLineLayoutFlowContents.cpp: 23 (WebCore::SimpleLineLayout::FlowContents::textWidth): 24 1 25 2014-11-21 Anders Carlsson <andersca@apple.com> 2 26 -
trunk/Source/WebCore/rendering/SimpleLineLayoutFlowContents.cpp
r176401 r176470 181 181 ASSERT(from < to); 182 182 String string = renderer.text(); 183 bool measureWithEndSpace = m_style.collapseWhitespace && to < string.length() && string[to] == ' '; 184 if (measureWithEndSpace) 185 ++to; 183 186 TextRun run(string.characters8() + from, to - from); 184 187 run.setXPos(xPosition); 185 188 run.setTabSize(!!m_style.tabWidth, m_style.tabWidth); 186 return m_style.font.width(run); 189 float width = m_style.font.width(run); 190 if (measureWithEndSpace) 191 width -= m_style.spaceWidth; 192 return width; 187 193 } 188 194
Note:
See TracChangeset
for help on using the changeset viewer.