Title: [225497] trunk
Revision
225497
Author
[email protected]
Date
2017-12-04 14:52:26 -0800 (Mon, 04 Dec 2017)

Log Message

REGRESSION (r211531): Text flow changes and overlaps other text after double-click selecting paragraph
https://bugs.webkit.org/show_bug.cgi?id=180377
<rdar://problem/34337967>

Reviewed by Antti Koivisto.

Source/WebCore:

Take floats into account when computing the available width for a certain vertical position.

Test: fast/block/float/simple-line-layout-float-shrink-line.html

* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::updateLineConstrains):

LayoutTests:

* fast/block/float/simple-line-layout-float-shrink-line-expected.html: Added.
* fast/block/float/simple-line-layout-float-shrink-line.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (225496 => 225497)


--- trunk/LayoutTests/ChangeLog	2017-12-04 22:51:13 UTC (rev 225496)
+++ trunk/LayoutTests/ChangeLog	2017-12-04 22:52:26 UTC (rev 225497)
@@ -1,3 +1,14 @@
+2017-12-04  Zalan Bujtas  <[email protected]>
+
+        REGRESSION (r211531): Text flow changes and overlaps other text after double-click selecting paragraph
+        https://bugs.webkit.org/show_bug.cgi?id=180377
+        <rdar://problem/34337967>
+
+        Reviewed by Antti Koivisto.
+
+        * fast/block/float/simple-line-layout-float-shrink-line-expected.html: Added.
+        * fast/block/float/simple-line-layout-float-shrink-line.html: Added.
+
 2017-12-04  Antoine Quint  <[email protected]>
 
         <video> and scale() transforms yield shrunk small or clipped controls

Added: trunk/LayoutTests/fast/block/float/simple-line-layout-float-shrink-line-expected.html (0 => 225497)


--- trunk/LayoutTests/fast/block/float/simple-line-layout-float-shrink-line-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/block/float/simple-line-layout-float-shrink-line-expected.html	2017-12-04 22:52:26 UTC (rev 225497)
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+.floating {
+    width: 40px;
+    height: 10px;
+    border: 1px solid blue;
+}
+
+.container { 
+    width: 150px;
+}
+</style>
+<script>
+if (window.internals)
+    internals.settings.setSimpleLineLayoutEnabled(false);
+</script>
+</head>
+<body>
+<div class=container>
+  <div class=floating style="float: left"></div>
+  <div class=floating style="float: right; clear: left"></div>
+  <div>Pass if "this" wraps to the second line.</div>
+</div>
+</body>
+</html>

Added: trunk/LayoutTests/fast/block/float/simple-line-layout-float-shrink-line.html (0 => 225497)


--- trunk/LayoutTests/fast/block/float/simple-line-layout-float-shrink-line.html	                        (rev 0)
+++ trunk/LayoutTests/fast/block/float/simple-line-layout-float-shrink-line.html	2017-12-04 22:52:26 UTC (rev 225497)
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+.floating {
+    width: 40px;
+    height: 10px;
+    border: 1px solid blue;
+}
+
+.container { 
+    width: 150px;
+}
+</style>
+</head>
+<body>
+<div class=container>
+  <div class=floating style="float: left"></div>
+  <div class=floating style="float: right; clear: left"></div>
+  <div>Pass if "this" wraps to the second line.</div>
+</div>
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (225496 => 225497)


--- trunk/Source/WebCore/ChangeLog	2017-12-04 22:51:13 UTC (rev 225496)
+++ trunk/Source/WebCore/ChangeLog	2017-12-04 22:52:26 UTC (rev 225497)
@@ -1,3 +1,18 @@
+2017-12-04  Zalan Bujtas  <[email protected]>
+
+        REGRESSION (r211531): Text flow changes and overlaps other text after double-click selecting paragraph
+        https://bugs.webkit.org/show_bug.cgi?id=180377
+        <rdar://problem/34337967>
+
+        Reviewed by Antti Koivisto.
+
+        Take floats into account when computing the available width for a certain vertical position.
+
+        Test: fast/block/float/simple-line-layout-float-shrink-line.html
+
+        * rendering/SimpleLineLayout.cpp:
+        (WebCore::SimpleLineLayout::updateLineConstrains):
+
 2017-12-04  Antoine Quint  <[email protected]>
 
         <video> and scale() transforms yield shrunk small or clipped controls

Modified: trunk/Source/WebCore/rendering/SimpleLineLayout.cpp (225496 => 225497)


--- trunk/Source/WebCore/rendering/SimpleLineLayout.cpp	2017-12-04 22:51:13 UTC (rev 225496)
+++ trunk/Source/WebCore/rendering/SimpleLineLayout.cpp	2017-12-04 22:52:26 UTC (rev 225497)
@@ -601,8 +601,9 @@
 {
     bool shouldApplyTextIndent = !flow.isAnonymous() || flow.parent()->firstChild() == &flow;
     LayoutUnit height = flow.logicalHeight();
-    line.setLogicalLeftOffset(flow.logicalLeftOffsetForLine(height, DoNotIndentText) + (shouldApplyTextIndent && isFirstLine ? flow.textIndentOffset() : LayoutUnit(0)));
-    float logicalRightOffset = flow.logicalRightOffsetForLine(height, DoNotIndentText);
+    LayoutUnit logicalHeight = flow.minLineHeightForReplacedRenderer(false, 0);
+    line.setLogicalLeftOffset(flow.logicalLeftOffsetForLine(height, DoNotIndentText, logicalHeight) + (shouldApplyTextIndent && isFirstLine ? flow.textIndentOffset() : LayoutUnit(0)));
+    float logicalRightOffset = flow.logicalRightOffsetForLine(height, DoNotIndentText, logicalHeight);
     line.setAvailableWidth(std::max<float>(0, logicalRightOffset - line.logicalLeftOffset()));
     if (style.textAlign == JUSTIFY)
         line.setNeedsAllFragments();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to