Title: [243488] trunk
Revision
243488
Author
[email protected]
Date
2019-03-26 00:12:47 -0700 (Tue, 26 Mar 2019)

Log Message

Hit-testing on layers overlapping scrollers should hit-test on text boxes
https://bugs.webkit.org/show_bug.cgi?id=195373
<rdar://problem/48649865>

Reviewed by Simon Fraser.

Source/WebCore:

* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::paint):
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paint):

Collect event region for overflowing line boxes.

* rendering/SimpleLineLayoutFunctions.cpp:
(WebCore::SimpleLineLayout::paintFlow):

Collect event region for overflowing simple lines.

LayoutTests:

* fast/scrolling/ios/overflow-scroll-overlap-3.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (243487 => 243488)


--- trunk/LayoutTests/ChangeLog	2019-03-26 06:12:55 UTC (rev 243487)
+++ trunk/LayoutTests/ChangeLog	2019-03-26 07:12:47 UTC (rev 243488)
@@ -1,3 +1,13 @@
+2019-03-26  Antti Koivisto  <[email protected]>
+
+        Hit-testing on layers overlapping scrollers should hit-test on text boxes
+        https://bugs.webkit.org/show_bug.cgi?id=195373
+        <rdar://problem/48649865>
+
+        Reviewed by Simon Fraser.
+
+        * fast/scrolling/ios/overflow-scroll-overlap-3.html:
+
 2019-03-25  Fujii Hironori  <[email protected]>
 
         Unreviewed, rolling out r243450.

Modified: trunk/LayoutTests/fast/scrolling/ios/overflow-scroll-overlap-3-expected.txt (243487 => 243488)


--- trunk/LayoutTests/fast/scrolling/ios/overflow-scroll-overlap-3-expected.txt	2019-03-26 06:12:55 UTC (rev 243487)
+++ trunk/LayoutTests/fast/scrolling/ios/overflow-scroll-overlap-3-expected.txt	2019-03-26 07:12:47 UTC (rev 243488)
@@ -1,5 +1,11 @@
 Test that scrollable areas with text overlap are correctly targeted.
 
-case 1: Scrollable 1 
+case 1: 
 case 2: Scrollable 2 
+case 3: Scrollable 3 
+case 4: 
+case 5: Scrollable 5 
+case 6: Scrollable 6 
+case 7: 
+case 8: Scrollable 8 
 

Modified: trunk/LayoutTests/fast/scrolling/ios/overflow-scroll-overlap-3.html (243487 => 243488)


--- trunk/LayoutTests/fast/scrolling/ios/overflow-scroll-overlap-3.html	2019-03-26 06:12:55 UTC (rev 243487)
+++ trunk/LayoutTests/fast/scrolling/ios/overflow-scroll-overlap-3.html	2019-03-26 07:12:47 UTC (rev 243488)
@@ -71,6 +71,75 @@
     </div>
 </div>
 
+<div class="case">
+    <div class="overflowscroll target">
+        <div class="scrollcontent"></div>
+    </div>
+    <div class="overlapping" style="top:-60px; pointer-events:none">
+    Text text text text text text text text text text text text text text text text text text text text text text
+    </div>
+</div>
+
+<div class="case">
+    <div class="overflowscroll target">
+        <div class="scrollcontent"></div>
+    </div>
+    <div class="overlapping" style="top:-60px">
+        <b>
+            Text text text text text text text text text text text text
+            <i>text text text text text text text text text text</i>
+        </b>
+    </div>
+</div>
+
+<div class="case">
+    <div class="overflowscroll target">
+        <div class="scrollcontent"></div>
+    </div>
+    <div class="overlapping" style="top:-60px; padding-left:40px">
+        <b>
+            Text text text text text text text text text text text text
+            <i>text text text text text text text text text text</i>
+        </b>
+    </div>
+</div>
+
+<div class="case">
+    <div class="overflowscroll target">
+        <div class="scrollcontent"></div>
+    </div>
+    <div class="overlapping" style="top:-60px; pointer-events:none">
+        <b>
+            Text text text text text text text text text text text text
+            <i>text text text text text text text text text text</i>
+        </b>
+    </div>
+</div>
+
+<div class="case">
+    <div class="overflowscroll target">
+        <div class="scrollcontent"></div>
+    </div>
+    <div class="overlapping" style="top:-60px; visibility:hidden">
+        <b style="visibility:visible">
+            Text text text text text text text text text text text text
+            <i>text text text text text text text text text text</i>
+        </b>
+    </div>
+</div>
+
+<div class="case">
+    <div class="overflowscroll target">
+        <div class="scrollcontent"></div>
+    </div>
+    <div class="overlapping" style="top:-60px; visibility:hidden">
+        <b style="visibility:visible">
+            Text text text text text text text text text text text text
+            <i style="visibility:hidden">text text text text text text text text text text</i>
+        </b>
+    </div>
+</div>
+
 <div id=log></div>
 
 </body>

Modified: trunk/Source/WebCore/ChangeLog (243487 => 243488)


--- trunk/Source/WebCore/ChangeLog	2019-03-26 06:12:55 UTC (rev 243487)
+++ trunk/Source/WebCore/ChangeLog	2019-03-26 07:12:47 UTC (rev 243488)
@@ -1,3 +1,23 @@
+2019-03-26  Antti Koivisto  <[email protected]>
+
+        Hit-testing on layers overlapping scrollers should hit-test on text boxes
+        https://bugs.webkit.org/show_bug.cgi?id=195373
+        <rdar://problem/48649865>
+
+        Reviewed by Simon Fraser.
+
+        * rendering/InlineFlowBox.cpp:
+        (WebCore::InlineFlowBox::paint):
+        * rendering/InlineTextBox.cpp:
+        (WebCore::InlineTextBox::paint):
+
+        Collect event region for overflowing line boxes.
+
+        * rendering/SimpleLineLayoutFunctions.cpp:
+        (WebCore::SimpleLineLayout::paintFlow):
+
+        Collect event region for overflowing simple lines.
+
 2019-03-25  Alex Christensen  <[email protected]>
 
         Expected shouldn't assume its contained types are copyable

Modified: trunk/Source/WebCore/rendering/InlineFlowBox.cpp (243487 => 243488)


--- trunk/Source/WebCore/rendering/InlineFlowBox.cpp	2019-03-26 06:12:55 UTC (rev 243487)
+++ trunk/Source/WebCore/rendering/InlineFlowBox.cpp	2019-03-26 07:12:47 UTC (rev 243488)
@@ -1150,7 +1150,7 @@
 
 void InlineFlowBox::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset, LayoutUnit lineTop, LayoutUnit lineBottom)
 {
-    if (paintInfo.phase != PaintPhase::Foreground && paintInfo.phase != PaintPhase::Selection && paintInfo.phase != PaintPhase::Outline && paintInfo.phase != PaintPhase::SelfOutline && paintInfo.phase != PaintPhase::ChildOutlines && paintInfo.phase != PaintPhase::TextClip && paintInfo.phase != PaintPhase::Mask)
+    if (paintInfo.phase != PaintPhase::Foreground && paintInfo.phase != PaintPhase::Selection && paintInfo.phase != PaintPhase::Outline && paintInfo.phase != PaintPhase::SelfOutline && paintInfo.phase != PaintPhase::ChildOutlines && paintInfo.phase != PaintPhase::TextClip && paintInfo.phase != PaintPhase::Mask && paintInfo.phase != PaintPhase::EventRegion)
         return;
 
     LayoutRect overflowRect(visualOverflowRect(lineTop, lineBottom));

Modified: trunk/Source/WebCore/rendering/InlineTextBox.cpp (243487 => 243488)


--- trunk/Source/WebCore/rendering/InlineTextBox.cpp	2019-03-26 06:12:55 UTC (rev 243487)
+++ trunk/Source/WebCore/rendering/InlineTextBox.cpp	2019-03-26 07:12:47 UTC (rev 243488)
@@ -502,6 +502,12 @@
     boxOrigin.moveBy(localPaintOffset);
     FloatRect boxRect(boxOrigin, FloatSize(logicalWidth(), logicalHeight()));
 
+    if (paintInfo.phase == PaintPhase::EventRegion) {
+        if (visibleToHitTesting())
+            paintInfo.eventRegion->unite(enclosingIntRect(boxRect));
+        return;
+    }
+
     auto* combinedText = this->combinedText();
 
     bool shouldRotate = !isHorizontal() && !combinedText;

Modified: trunk/Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp (243487 => 243488)


--- trunk/Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp	2019-03-26 06:12:55 UTC (rev 243487)
+++ trunk/Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp	2019-03-26 07:12:47 UTC (rev 243488)
@@ -76,6 +76,18 @@
 
 void paintFlow(const RenderBlockFlow& flow, const Layout& layout, PaintInfo& paintInfo, const LayoutPoint& paintOffset)
 {
+    if (paintInfo.phase == PaintPhase::EventRegion) {
+        if (!flow.visibleToHitTesting())
+            return;
+        auto paintRect = paintInfo.rect;
+        paintRect.moveBy(-paintOffset);
+        for (auto run : layout.runResolver().rangeForRect(paintRect)) {
+            FloatRect visualOverflowRect = computeOverflow(flow, run.rect());
+            paintInfo.eventRegion->unite(enclosingIntRect(visualOverflowRect));
+        }
+        return;
+    }
+
     if (paintInfo.phase != PaintPhase::Foreground)
         return;
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to