Title: [200567] trunk
Revision
200567
Author
[email protected]
Date
2016-05-08 19:37:57 -0700 (Sun, 08 May 2016)

Log Message

iOS selection: Use inflow containing block for positioned <br>.
https://bugs.webkit.org/show_bug.cgi?id=157115
<rdar://problem/25969295>

Reviewed by Ryosuke Niwa.

Similarly to RenderText, we should just use the inflow containing block for
selected <br> even when it is positioned out of flow. This visually matches Mac OS X
behaviour (selection painting does not get extended to the positioned <br>).

Source/WebCore:

Test: fast/text/fixed-positioned-br-crash.html

* rendering/RenderLineBreak.cpp:
(WebCore::RenderLineBreak::collectSelectionRects):

LayoutTests:

* fast/text/fixed-positioned-br-crash-expected.txt: Added.
* fast/text/fixed-positioned-br-crash.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (200566 => 200567)


--- trunk/LayoutTests/ChangeLog	2016-05-08 23:57:44 UTC (rev 200566)
+++ trunk/LayoutTests/ChangeLog	2016-05-09 02:37:57 UTC (rev 200567)
@@ -1,3 +1,18 @@
+2016-05-08  Zalan Bujtas  <[email protected]>
+
+        iOS selection: Use inflow containing block for positioned <br>.
+        https://bugs.webkit.org/show_bug.cgi?id=157115
+        <rdar://problem/25969295>
+
+        Reviewed by Ryosuke Niwa.
+
+        Similarly to RenderText, we should just use the inflow containing block for
+        selected <br> even when it is positioned out of flow. This visually matches Mac OS X
+        behaviour (selection painting does not get extended to the positioned <br>).
+
+        * fast/text/fixed-positioned-br-crash-expected.txt: Added.
+        * fast/text/fixed-positioned-br-crash.html: Added.
+
 2016-05-08  Darin Adler  <[email protected]>
 
         Correct dictionary bindings handling of optional, null, and undefined

Added: trunk/LayoutTests/fast/text/fixed-positioned-br-crash-expected.txt (0 => 200567)


--- trunk/LayoutTests/fast/text/fixed-positioned-br-crash-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/text/fixed-positioned-br-crash-expected.txt	2016-05-09 02:37:57 UTC (rev 200567)
@@ -0,0 +1,2 @@
+PASS if no crash or ASSERT. 
+

Added: trunk/LayoutTests/fast/text/fixed-positioned-br-crash.html (0 => 200567)


--- trunk/LayoutTests/fast/text/fixed-positioned-br-crash.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/fixed-positioned-br-crash.html	2016-05-09 02:37:57 UTC (rev 200567)
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>This tests that we don't crash when the fixed positioned line break is selected.</title>
+<style>
+.positioned { 
+  position: fixed; 
+}
+.contentOpenQuote { 
+  content: open-quote; 
+}
+</style>
+</head>
+<body>
+PASS if no crash or ASSERT.
+<br id=foo class=contentOpenQuote>
+<wbr id=wfoo class=contentOpenQuote>
+<script>
+document.execCommand("SelectAll", false, "");
+document.getElementById("foo").className = "positioned";
+document.getElementById("wfoo").className = "positioned";
+if (window.testRunner)
+    testRunner.dumpAsText();
+</script>
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (200566 => 200567)


--- trunk/Source/WebCore/ChangeLog	2016-05-08 23:57:44 UTC (rev 200566)
+++ trunk/Source/WebCore/ChangeLog	2016-05-09 02:37:57 UTC (rev 200567)
@@ -1,3 +1,20 @@
+2016-05-08  Zalan Bujtas  <[email protected]>
+
+        iOS selection: Use inflow containing block for positioned <br>.
+        https://bugs.webkit.org/show_bug.cgi?id=157115
+        <rdar://problem/25969295>
+
+        Reviewed by Ryosuke Niwa.
+
+        Similarly to RenderText, we should just use the inflow containing block for
+        selected <br> even when it is positioned out of flow. This visually matches Mac OS X
+        behaviour (selection painting does not get extended to the positioned <br>).
+
+        Test: fast/text/fixed-positioned-br-crash.html
+
+        * rendering/RenderLineBreak.cpp:
+        (WebCore::RenderLineBreak::collectSelectionRects):
+
 2016-05-08  Myles C. Maxfield  <[email protected]>
 
         [iOS] Build fix after r200563

Modified: trunk/Source/WebCore/rendering/RenderLineBreak.cpp (200566 => 200567)


--- trunk/Source/WebCore/rendering/RenderLineBreak.cpp	2016-05-08 23:57:44 UTC (rev 200566)
+++ trunk/Source/WebCore/rendering/RenderLineBreak.cpp	2016-05-09 02:37:57 UTC (rev 200567)
@@ -241,7 +241,7 @@
             rect.shiftXEdgeTo(rootBox.lineTopWithLeading());
     }
 
-    RenderBlock* containingBlock = this->containingBlock();
+    auto* containingBlock = containingBlockForObjectInFlow(this);
     // Map rect, extended left to leftOffset, and right to rightOffset, through transforms to get minX and maxX.
     LogicalSelectionOffsetCaches cache(*containingBlock);
     LayoutUnit leftOffset = containingBlock->logicalLeftSelectionOffset(*containingBlock, box->logicalTop(), cache);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to