Changeset 89769 in webkit
- Timestamp:
- Jun 26, 2011 9:09:33 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r89768 r89769 1 2011-06-26 Dan Bernstein <mitz@apple.com> 2 3 Reviewed by Darin Adler. 4 5 With word-break: break-all, words do not break correctly before a surrogate pair 6 https://bugs.webkit.org/show_bug.cgi?id=63401 7 8 * fast/text/midword-break-before-surrogate-pair.html: Added. 9 1 10 2011-06-26 Adam Barth <abarth@webkit.org> 2 11 -
trunk/Source/WebCore/ChangeLog
r89766 r89769 1 2011-06-26 Dan Bernstein <mitz@apple.com> 2 3 Reviewed by Darin Adler. 4 5 With word-break: break-all, words do not break correctly before a surrogate pair 6 https://bugs.webkit.org/show_bug.cgi?id=63401 7 8 The code to check for mid-word breaks accumulates width one character at a time. It was actually 9 measuring the two parts of the surrogate pair individually, so they appeared to have zero width. 10 Fixed by checking for surrogate pairs and measuring the pair as one unit. 11 12 Test: fast/text/midword-break-before-surrogate-pair.html 13 14 * rendering/RenderBlockLineLayout.cpp: 15 (WebCore::RenderBlock::LineBreaker::nextLineBreak): 16 1 17 2011-06-26 Dirk Schulze <krit@webkit.org> 2 18 -
trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp
r89704 r89769 2103 2103 currentCharacterIsWS = currentCharacterIsSpace || (breakNBSP && c == noBreakSpace); 2104 2104 2105 bool midWordBreakIsBeforeSurrogatePair = false; 2105 2106 if ((breakAll || breakWords) && !midWordBreak) { 2106 2107 wrapW += charWidth; 2107 charWidth = textWidth(t, current.m_pos, 1, f, width.committedWidth() + wrapW, isFixedPitch, collapseWhiteSpace); 2108 midWordBreakIsBeforeSurrogatePair = U16_IS_LEAD(c) && current.m_pos + 1 < t->textLength() && U16_IS_TRAIL(t->characters()[current.m_pos + 1]); 2109 charWidth = textWidth(t, current.m_pos, midWordBreakIsBeforeSurrogatePair ? 2 : 1, f, width.committedWidth() + wrapW, isFixedPitch, collapseWhiteSpace); 2108 2110 midWordBreak = width.committedWidth() + wrapW + charWidth > width.availableWidth(); 2109 2111 } … … 2222 2224 lBreak.moveTo(current.m_obj, current.m_pos, current.m_nextBreakablePosition); 2223 2225 midWordBreak &= (breakWords || breakAll); 2226 if (midWordBreakIsBeforeSurrogatePair) 2227 current.fastIncrementInTextNode(); 2224 2228 } 2225 2229
Note: See TracChangeset
for help on using the changeset viewer.