Title: [91514] branches/safari-534.51-branch

Diff

Modified: branches/safari-534.51-branch/LayoutTests/ChangeLog (91513 => 91514)


--- branches/safari-534.51-branch/LayoutTests/ChangeLog	2011-07-21 21:59:09 UTC (rev 91513)
+++ branches/safari-534.51-branch/LayoutTests/ChangeLog	2011-07-21 22:01:07 UTC (rev 91514)
@@ -1,5 +1,18 @@
 2011-07-21  Lucas Forschler  <[email protected]>
 
+    Merged 89769.
+
+    2011-06-26  Dan Bernstein  <[email protected]>
+
+        Reviewed by Darin Adler.
+
+        With word-break: break-all, words do not break correctly before a surrogate pair
+        https://bugs.webkit.org/show_bug.cgi?id=63401
+
+        * fast/text/midword-break-before-surrogate-pair.html: Added.
+
+2011-07-21  Lucas Forschler  <[email protected]>
+
     Merged 89614.
 
     2011-06-23  Gavin Barraclough  <[email protected]>

Copied: branches/safari-534.51-branch/LayoutTests/fast/text/midword-break-before-surrogate-pair.html (from rev 89769, trunk/LayoutTests/fast/text/midword-break-before-surrogate-pair.html) (0 => 91514)


--- branches/safari-534.51-branch/LayoutTests/fast/text/midword-break-before-surrogate-pair.html	                        (rev 0)
+++ branches/safari-534.51-branch/LayoutTests/fast/text/midword-break-before-surrogate-pair.html	2011-07-21 22:01:07 UTC (rev 91514)
@@ -0,0 +1,3 @@
+<div style="word-break: break-all; border: solid blue; font-size: 36px; width: 5em;">
+    &#x1d110;&#x1d110;&#x1d110;&#x1d110;&#x1d110;&#x1d110;&#x1d110;&#x1d110;&#x1d110;&#x1d110;
+</div>

Copied: branches/safari-534.51-branch/LayoutTests/platform/mac/fast/text/midword-break-before-surrogate-pair-expected.png (from rev 89769, trunk/LayoutTests/platform/mac/fast/text/midword-break-before-surrogate-pair-expected.png)


(Binary files differ)

Copied: branches/safari-534.51-branch/LayoutTests/platform/mac/fast/text/midword-break-before-surrogate-pair-expected.txt (from rev 89769, trunk/LayoutTests/platform/mac/fast/text/midword-break-before-surrogate-pair-expected.txt) (0 => 91514)


--- branches/safari-534.51-branch/LayoutTests/platform/mac/fast/text/midword-break-before-surrogate-pair-expected.txt	                        (rev 0)
+++ branches/safari-534.51-branch/LayoutTests/platform/mac/fast/text/midword-break-before-surrogate-pair-expected.txt	2011-07-21 22:01:07 UTC (rev 91514)
@@ -0,0 +1,9 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x584
+      RenderBlock {DIV} at (0,0) size 186x92 [border: (3px solid #0000FF)]
+        RenderText {#text} at (3,3) size 168x84
+          text run at (3,3) width 168: "\x{D834}\x{DD10}\x{D834}\x{DD10}\x{D834}\x{DD10}\x{D834}\x{DD10}\x{D834}\x{DD10}\x{D834}\x{DD10}\x{D834}\x{DD10}"
+          text run at (3,46) width 72: "\x{D834}\x{DD10}\x{D834}\x{DD10}\x{D834}\x{DD10}"

Modified: branches/safari-534.51-branch/Source/WebCore/ChangeLog (91513 => 91514)


--- branches/safari-534.51-branch/Source/WebCore/ChangeLog	2011-07-21 21:59:09 UTC (rev 91513)
+++ branches/safari-534.51-branch/Source/WebCore/ChangeLog	2011-07-21 22:01:07 UTC (rev 91514)
@@ -1,5 +1,25 @@
 2011-07-21  Lucas Forschler  <[email protected]>
 
+    Merged 89769.
+
+    2011-06-26  Dan Bernstein  <[email protected]>
+
+        Reviewed by Darin Adler.
+
+        With word-break: break-all, words do not break correctly before a surrogate pair
+        https://bugs.webkit.org/show_bug.cgi?id=63401
+
+        The code to check for mid-word breaks accumulates width one character at a time. It was actually
+        measuring the two parts of the surrogate pair individually, so they appeared to have zero width.
+        Fixed by checking for surrogate pairs and measuring the pair as one unit.
+
+        Test: fast/text/midword-break-before-surrogate-pair.html
+
+        * rendering/RenderBlockLineLayout.cpp:
+        (WebCore::RenderBlock::LineBreaker::nextLineBreak):
+
+2011-07-21  Lucas Forschler  <[email protected]>
+
     Merged 89595.
 
     2011-06-23  Abhishek Arya  <[email protected]>

Modified: branches/safari-534.51-branch/Source/WebCore/rendering/RenderBlockLineLayout.cpp (91513 => 91514)


--- branches/safari-534.51-branch/Source/WebCore/rendering/RenderBlockLineLayout.cpp	2011-07-21 21:59:09 UTC (rev 91513)
+++ branches/safari-534.51-branch/Source/WebCore/rendering/RenderBlockLineLayout.cpp	2011-07-21 22:01:07 UTC (rev 91514)
@@ -2080,9 +2080,11 @@
 
                 currentCharacterIsWS = currentCharacterIsSpace || (breakNBSP && c == noBreakSpace);
 
+                bool midWordBreakIsBeforeSurrogatePair = false;
                 if ((breakAll || breakWords) && !midWordBreak) {
                     wrapW += charWidth;
-                    charWidth = textWidth(t, current.m_pos, 1, f, width.committedWidth() + wrapW, isFixedPitch, collapseWhiteSpace);
+                    midWordBreakIsBeforeSurrogatePair = U16_IS_LEAD(c) && current.m_pos + 1 < t->textLength() && U16_IS_TRAIL(t->characters()[current.m_pos + 1]);
+                    charWidth = textWidth(t, current.m_pos, midWordBreakIsBeforeSurrogatePair ? 2 : 1, f, width.committedWidth() + wrapW, isFixedPitch, collapseWhiteSpace);
                     midWordBreak = width.committedWidth() + wrapW + charWidth > width.availableWidth();
                 }
 
@@ -2199,6 +2201,8 @@
                         // adding the end width forces a break.
                         lBreak.moveTo(current.m_obj, current.m_pos, current.m_nextBreakablePosition);
                         midWordBreak &= (breakWords || breakAll);
+                        if (midWordBreakIsBeforeSurrogatePair)
+                            current.fastIncrementInTextNode();
                     }
 
                     if (betweenWords) {
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to