Title: [153061] trunk
Revision
153061
Author
[email protected]
Date
2013-07-23 12:47:34 -0700 (Tue, 23 Jul 2013)

Log Message

REGRESSION(r152313): Links in certain twitter postings don't warp correctly on page
https://bugs.webkit.org/show_bug.cgi?id=118435

Reviewed by David Hyatt.

When we find an empty inline in the middle of the word, prefer breaking it before
instead of after to match other browsers' rendering.

Source/WebCore:

Test: fast/text/whitespace/inline-whitespace-wrapping-12.html

* rendering/RenderBlockLineLayout.cpp:
(WebCore::canBreakAtThisPosition):

LayoutTests:

* fast/text/whitespace/inline-whitespace-wrapping-12-expected.html: Added.
* fast/text/whitespace/inline-whitespace-wrapping-12.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (153060 => 153061)


--- trunk/LayoutTests/ChangeLog	2013-07-23 19:09:39 UTC (rev 153060)
+++ trunk/LayoutTests/ChangeLog	2013-07-23 19:47:34 UTC (rev 153061)
@@ -1,3 +1,16 @@
+2013-07-23  Zalan Bujtas  <[email protected]>
+
+        REGRESSION(r152313): Links in certain twitter postings don't warp correctly on page
+        https://bugs.webkit.org/show_bug.cgi?id=118435
+
+        Reviewed by David Hyatt.
+
+        When we find an empty inline in the middle of the word, prefer breaking it before 
+        instead of after to match other browsers' rendering.
+
+        * fast/text/whitespace/inline-whitespace-wrapping-12-expected.html: Added.
+        * fast/text/whitespace/inline-whitespace-wrapping-12.html: Added.
+
 2013-07-23  Alexey Proskuryakov  <[email protected]>
 
         Dictionary hotkey does not work on vertical text

Added: trunk/LayoutTests/fast/text/whitespace/inline-whitespace-wrapping-12-expected.html (0 => 153061)


--- trunk/LayoutTests/fast/text/whitespace/inline-whitespace-wrapping-12-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/whitespace/inline-whitespace-wrapping-12-expected.html	2013-07-23 19:47:34 UTC (rev 153061)
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+<head>
+  <style>
+    div {
+      width: 60px; 
+      border: 1px solid green;
+    }
+  </style>
+</head>
+<body>
+    <div>Text should&nbsp;wrap at the green border.</div>
+    <div>Text shouldwrap at the green border.</div>
+</body>
+</html>
\ No newline at end of file

Added: trunk/LayoutTests/fast/text/whitespace/inline-whitespace-wrapping-12.html (0 => 153061)


--- trunk/LayoutTests/fast/text/whitespace/inline-whitespace-wrapping-12.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/whitespace/inline-whitespace-wrapping-12.html	2013-07-23 19:47:34 UTC (rev 153061)
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+<head>
+  <style>
+    div {
+      width: 60px; 
+      border: 1px solid green;
+    }
+  </style>
+</head>
+<body>
+    <div>Text should<span></span><span>&nbsp;</span>wrap at the green border.</div>
+    <div>Text should<span></span>wrap at the green border.</div>
+</body>
+</html>
\ No newline at end of file

Modified: trunk/Source/WebCore/ChangeLog (153060 => 153061)


--- trunk/Source/WebCore/ChangeLog	2013-07-23 19:09:39 UTC (rev 153060)
+++ trunk/Source/WebCore/ChangeLog	2013-07-23 19:47:34 UTC (rev 153061)
@@ -1,3 +1,18 @@
+2013-07-23  Zalan Bujtas  <[email protected]>
+
+        REGRESSION(r152313): Links in certain twitter postings don't warp correctly on page
+        https://bugs.webkit.org/show_bug.cgi?id=118435
+
+        Reviewed by David Hyatt.
+
+        When we find an empty inline in the middle of the word, prefer breaking it before 
+        instead of after to match other browsers' rendering.
+
+        Test: fast/text/whitespace/inline-whitespace-wrapping-12.html
+
+        * rendering/RenderBlockLineLayout.cpp:
+        (WebCore::canBreakAtThisPosition):
+
 2013-07-23  Alexey Proskuryakov  <[email protected]>
 
         Dictionary hotkey does not work on vertical text

Modified: trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp (153060 => 153061)


--- trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp	2013-07-23 19:09:39 UTC (rev 153060)
+++ trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp	2013-07-23 19:47:34 UTC (rev 153061)
@@ -2907,11 +2907,7 @@
 
     bool canPlaceOnLine = width.fitsOnLine() || !autoWrapWasEverTrueOnLine;
 
-    // If we are an empty inline in the middle of a word and don't fit on the line then clear any line break we have and find
-    // one in the following text instead.
-    if (!canPlaceOnLine && !canBreakHere && isEmptyInline(current.m_obj))
-        lBreak.clear();
-    else if (canPlaceOnLine && canBreakHere)
+    if (canPlaceOnLine && canBreakHere)
         commitLineBreakAtCurrentWidth(width, lBreak, next);
 
     return canBreakHere;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to