Elements with "display: inline-block" don't have a touch-action region
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 9 May 2019 09:41:37 +0000 (09:41 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 9 May 2019 09:41:37 +0000 (09:41 +0000)
https://bugs.webkit.org/show_bug.cgi?id=197281
<rdar://problem/50535081>

Reviewed by Antoine Quint.

Source/WebCore:

Test: pointerevents/ios/touch-action-region-inline-block.html

PaintPhase::EventRegion failed to traverse into inline boxes.

* rendering/InlineElementBox.cpp:
(WebCore::InlineElementBox::paint):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::paintAsInlineBlock):

LayoutTests:

* pointerevents/ios/touch-action-region-inline-block-expected.txt: Added.
* pointerevents/ios/touch-action-region-inline-block.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@245126 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/pointerevents/ios/touch-action-region-inline-block-expected.txt [new file with mode: 0644]
LayoutTests/pointerevents/ios/touch-action-region-inline-block.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/InlineElementBox.cpp
Source/WebCore/rendering/RenderElement.cpp

index 98e9a49..f6ed76b 100644 (file)
@@ -1,3 +1,14 @@
+2019-05-09  Antti Koivisto  <antti@apple.com>
+
+        Elements with "display: inline-block" don't have a touch-action region
+        https://bugs.webkit.org/show_bug.cgi?id=197281
+        <rdar://problem/50535081>
+
+        Reviewed by Antoine Quint.
+
+        * pointerevents/ios/touch-action-region-inline-block-expected.txt: Added.
+        * pointerevents/ios/touch-action-region-inline-block.html: Added.
+
 2019-05-08  Antoine Quint  <graouts@apple.com>
 
         [iOS] Correctly handle overlapping regions for elements with a touch-action property
diff --git a/LayoutTests/pointerevents/ios/touch-action-region-inline-block-expected.txt b/LayoutTests/pointerevents/ios/touch-action-region-inline-block-expected.txt
new file mode 100644 (file)
index 0000000..3dd6e03
--- /dev/null
@@ -0,0 +1,21 @@
+ (GraphicsLayer
+  (anchor 0.00 0.00)
+  (bounds 800.00 600.00)
+  (children 1
+    (GraphicsLayer
+      (bounds 800.00 600.00)
+      (contentsOpaque 1)
+      (drawsContent 1)
+      (backgroundColor #FFFFFF)
+      (event region
+        (rect (0,0) width=800 height=600)
+        (touch-action
+          (none          
+            (rect (8,8) width=100 height=100)
+          )
+        )
+      )
+    )
+  )
+)
+
diff --git a/LayoutTests/pointerevents/ios/touch-action-region-inline-block.html b/LayoutTests/pointerevents/ios/touch-action-region-inline-block.html
new file mode 100644 (file)
index 0000000..29d0907
--- /dev/null
@@ -0,0 +1,10 @@
+<body>
+<div style="touch-action: none; width: 100px; height: 100px; display: inline-block;"></div>
+<pre id="results"></pre>
+<script>
+if (window.testRunner)
+    testRunner.dumpAsText();
+if (window.internals)
+    results.innerText = internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_EVENT_REGION | internals.LAYER_TREE_INCLUDES_ROOT_LAYER_PROPERTIES);
+</script>
+</body>
index 5bc103e..31d3917 100644 (file)
@@ -1,3 +1,20 @@
+2019-05-09  Antti Koivisto  <antti@apple.com>
+
+        Elements with "display: inline-block" don't have a touch-action region
+        https://bugs.webkit.org/show_bug.cgi?id=197281
+        <rdar://problem/50535081>
+
+        Reviewed by Antoine Quint.
+
+        Test: pointerevents/ios/touch-action-region-inline-block.html
+
+        PaintPhase::EventRegion failed to traverse into inline boxes.
+
+        * rendering/InlineElementBox.cpp:
+        (WebCore::InlineElementBox::paint):
+        * rendering/RenderElement.cpp:
+        (WebCore::RenderElement::paintAsInlineBlock):
+
 2019-05-08  Carlos Garcia Campos  <cgarcia@igalia.com>
 
         REGRESSION(r239915): [FreeType] White space skipped when rendering plain text with noto CJK font
index b0d6c23..f7cb859 100644 (file)
@@ -71,7 +71,7 @@ void InlineElementBox::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffse
     if (!paintInfo.shouldPaintWithinRoot(renderer()))
         return;
 
-    if (paintInfo.phase != PaintPhase::Foreground && paintInfo.phase != PaintPhase::Selection)
+    if (paintInfo.phase != PaintPhase::Foreground && paintInfo.phase != PaintPhase::Selection && paintInfo.phase != PaintPhase::EventRegion)
         return;
 
     LayoutPoint childPoint = paintOffset;
index 49d5ec3..1a40fb2 100644 (file)
@@ -998,7 +998,7 @@ void RenderElement::paintAsInlineBlock(PaintInfo& paintInfo, const LayoutPoint&
     // (See Appendix E.2, section 6.4 on inline block/table/replaced elements in the CSS2.1 specification.)
     // This is also used by other elements (e.g. flex items and grid items).
     PaintPhase paintPhaseToUse = isExcludedAndPlacedInBorder() ? paintInfo.phase : PaintPhase::Foreground;
-    if (paintInfo.phase == PaintPhase::Selection)
+    if (paintInfo.phase == PaintPhase::Selection || paintInfo.phase == PaintPhase::EventRegion)
         paint(paintInfo, childPoint);
     else if (paintInfo.phase == paintPhaseToUse) {
         paintPhase(*this, PaintPhase::BlockBackground, paintInfo, childPoint);