Hit-testing of boxes over scrollers should account for border-radius
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 30 Mar 2019 08:28:07 +0000 (08:28 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 30 Mar 2019 08:28:07 +0000 (08:28 +0000)
https://bugs.webkit.org/show_bug.cgi?id=195374
<rdar://problem/48649993>

Reviewed by Simon Fraser.

Source/WebCore:

Test: fast/scrolling/ios/border-radious-event-region.html

* page/Frame.h:
* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::dumpProperties const):

Testing support.

* platform/graphics/GraphicsLayerClient.h:
* platform/graphics/RoundedRect.cpp:
(WebCore::approximateAsRegion):

Add a function to approximate RoundedRects as Regions.
It cuts away rectangles from the corners following the corner shapes.
More rectangles are cut for larger radii.

* platform/graphics/RoundedRect.h:
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::paintObject):

Use the new interface to get rounded corners right.
In rectangle case this takes optimized paths.

* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::layerTreeAsText):
* testing/Internals.cpp:
(WebCore::toLayerTreeFlags):
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

* fast/scrolling/ios/border-radius-event-region-expected.txt: Added.
* fast/scrolling/ios/border-radius-event-region.html: Added.
* fast/scrolling/ios/overflow-scroll-overlap-2-expected.txt:

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

17 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/scrolling/ios/border-radius-event-region-expected.txt [new file with mode: 0644]
LayoutTests/fast/scrolling/ios/border-radius-event-region.html [new file with mode: 0644]
LayoutTests/fast/scrolling/ios/overflow-scroll-overlap-2-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/page/Frame.h
Source/WebCore/platform/graphics/GraphicsLayer.cpp
Source/WebCore/platform/graphics/GraphicsLayerClient.h
Source/WebCore/platform/graphics/Region.cpp
Source/WebCore/platform/graphics/Region.h
Source/WebCore/platform/graphics/RoundedRect.cpp
Source/WebCore/platform/graphics/RoundedRect.h
Source/WebCore/rendering/RenderBlock.cpp
Source/WebCore/rendering/RenderLayerCompositor.cpp
Source/WebCore/testing/Internals.cpp
Source/WebCore/testing/Internals.h
Source/WebCore/testing/Internals.idl

index ba4bfa8..ae57ec3 100644 (file)
@@ -1,3 +1,15 @@
+2019-03-30  Antti Koivisto  <antti@apple.com>
+
+        Hit-testing of boxes over scrollers should account for border-radius
+        https://bugs.webkit.org/show_bug.cgi?id=195374
+        <rdar://problem/48649993>
+
+        Reviewed by Simon Fraser.
+
+        * fast/scrolling/ios/border-radius-event-region-expected.txt: Added.
+        * fast/scrolling/ios/border-radius-event-region.html: Added.
+        * fast/scrolling/ios/overflow-scroll-overlap-2-expected.txt:
+
 2019-03-29  Zalan Bujtas  <zalan@apple.com>
 
         [ContentChangeObserver] Expand DOM timer observation to 350ms
diff --git a/LayoutTests/fast/scrolling/ios/border-radius-event-region-expected.txt b/LayoutTests/fast/scrolling/ios/border-radius-event-region-expected.txt
new file mode 100644 (file)
index 0000000..c028a1c
--- /dev/null
@@ -0,0 +1,273 @@
+(GraphicsLayer
+  (anchor 0.00 0.00)
+  (bounds 800.00 1616.00)
+  (children 1
+    (GraphicsLayer
+      (bounds 800.00 1616.00)
+      (contentsOpaque 1)
+      (children 24
+        (GraphicsLayer
+          (position 8.00 8.00)
+          (bounds 200.00 200.00)
+          (drawsContent 1)
+          (event region
+            (rect (0,0) width=200 height=200)
+          )
+        )
+        (GraphicsLayer
+          (position 208.00 8.00)
+          (bounds 200.00 200.00)
+          (drawsContent 1)
+          (event region
+            (rect (6,0) width=194 height=6)
+            (rect (0,6) width=200 height=194)
+          )
+        )
+        (GraphicsLayer
+          (position 408.00 8.00)
+          (bounds 200.00 200.00)
+          (drawsContent 1)
+          (event region
+            (rect (31,0) width=169 height=4)
+            (rect (15,4) width=185 height=11)
+            (rect (4,15) width=196 height=16)
+            (rect (0,31) width=200 height=169)
+          )
+        )
+        (GraphicsLayer
+          (position 8.00 208.00)
+          (bounds 200.00 200.00)
+          (drawsContent 1)
+          (event region
+            (rect (172,0) width=28 height=3)
+            (rect (144,3) width=56 height=6)
+            (rect (117,9) width=83 height=10)
+            (rect (92,19) width=108 height=13)
+            (rect (70,32) width=130 height=17)
+            (rect (49,49) width=151 height=21)
+            (rect (32,70) width=168 height=22)
+            (rect (19,92) width=181 height=25)
+            (rect (9,117) width=191 height=27)
+            (rect (3,144) width=197 height=28)
+            (rect (0,172) width=200 height=28)
+          )
+        )
+        (GraphicsLayer
+          (position 208.00 208.00)
+          (bounds 200.00 200.00)
+          (drawsContent 1)
+          (event region
+            (rect (20,0) width=180 height=21)
+            (rect (6,21) width=194 height=55)
+            (rect (0,76) width=200 height=124)
+          )
+        )
+        (GraphicsLayer
+          (position 408.00 208.00)
+          (bounds 200.00 200.00)
+          (drawsContent 1)
+          (event region
+            (rect (15,0) width=185 height=6)
+            (rect (0,6) width=200 height=194)
+          )
+        )
+        (GraphicsLayer
+          (position 8.00 408.00)
+          (bounds 200.00 200.00)
+          (drawsContent 1)
+          (event region
+            (rect (0,0) width=200 height=200)
+          )
+        )
+        (GraphicsLayer
+          (position 208.00 408.00)
+          (bounds 200.00 200.00)
+          (drawsContent 1)
+          (event region
+            (rect (0,0) width=194 height=6)
+            (rect (0,6) width=200 height=194)
+          )
+        )
+        (GraphicsLayer
+          (position 408.00 408.00)
+          (bounds 200.00 200.00)
+          (drawsContent 1)
+          (event region
+            (rect (0,0) width=169 height=4)
+            (rect (0,4) width=185 height=11)
+            (rect (0,15) width=196 height=16)
+            (rect (0,31) width=200 height=169)
+          )
+        )
+        (GraphicsLayer
+          (position 8.00 608.00)
+          (bounds 200.00 200.00)
+          (drawsContent 1)
+          (event region
+            (rect (0,0) width=28 height=3)
+            (rect (0,3) width=56 height=6)
+            (rect (0,9) width=83 height=10)
+            (rect (0,19) width=108 height=13)
+            (rect (0,32) width=130 height=17)
+            (rect (0,49) width=151 height=21)
+            (rect (0,70) width=168 height=22)
+            (rect (0,92) width=181 height=25)
+            (rect (0,117) width=191 height=27)
+            (rect (0,144) width=197 height=28)
+            (rect (0,172) width=200 height=28)
+          )
+        )
+        (GraphicsLayer
+          (position 208.00 608.00)
+          (bounds 200.00 200.00)
+          (drawsContent 1)
+          (event region
+            (rect (0,0) width=180 height=21)
+            (rect (0,21) width=194 height=54)
+            (rect (0,75) width=200 height=125)
+          )
+        )
+        (GraphicsLayer
+          (position 408.00 608.00)
+          (bounds 200.00 200.00)
+          (drawsContent 1)
+          (event region
+            (rect (0,0) width=185 height=6)
+            (rect (0,6) width=200 height=194)
+          )
+        )
+        (GraphicsLayer
+          (position 8.00 808.00)
+          (bounds 200.00 200.00)
+          (drawsContent 1)
+          (event region
+            (rect (0,0) width=200 height=200)
+          )
+        )
+        (GraphicsLayer
+          (position 208.00 808.00)
+          (bounds 200.00 200.00)
+          (drawsContent 1)
+          (event region
+            (rect (0,0) width=200 height=194)
+            (rect (6,194) width=194 height=6)
+          )
+        )
+        (GraphicsLayer
+          (position 408.00 808.00)
+          (bounds 200.00 200.00)
+          (drawsContent 1)
+          (event region
+            (rect (0,0) width=200 height=169)
+            (rect (4,169) width=196 height=16)
+            (rect (15,185) width=185 height=11)
+            (rect (31,196) width=169 height=4)
+          )
+        )
+        (GraphicsLayer
+          (position 8.00 1008.00)
+          (bounds 200.00 200.00)
+          (drawsContent 1)
+          (event region
+            (rect (0,0) width=200 height=28)
+            (rect (3,28) width=197 height=28)
+            (rect (9,56) width=191 height=27)
+            (rect (19,83) width=181 height=25)
+            (rect (32,108) width=168 height=22)
+            (rect (49,130) width=151 height=21)
+            (rect (70,151) width=130 height=17)
+            (rect (92,168) width=108 height=13)
+            (rect (117,181) width=83 height=10)
+            (rect (144,191) width=56 height=6)
+            (rect (172,197) width=28 height=3)
+          )
+        )
+        (GraphicsLayer
+          (position 208.00 1008.00)
+          (bounds 200.00 200.00)
+          (drawsContent 1)
+          (event region
+            (rect (0,0) width=200 height=125)
+            (rect (6,125) width=194 height=54)
+            (rect (21,179) width=179 height=21)
+          )
+        )
+        (GraphicsLayer
+          (position 408.00 1008.00)
+          (bounds 200.00 200.00)
+          (drawsContent 1)
+          (event region
+            (rect (0,0) width=200 height=194)
+            (rect (15,194) width=185 height=6)
+          )
+        )
+        (GraphicsLayer
+          (position 8.00 1208.00)
+          (bounds 200.00 200.00)
+          (drawsContent 1)
+          (event region
+            (rect (0,0) width=200 height=200)
+          )
+        )
+        (GraphicsLayer
+          (position 208.00 1208.00)
+          (bounds 200.00 200.00)
+          (drawsContent 1)
+          (event region
+            (rect (0,0) width=200 height=194)
+            (rect (0,194) width=194 height=6)
+          )
+        )
+        (GraphicsLayer
+          (position 408.00 1208.00)
+          (bounds 200.00 200.00)
+          (drawsContent 1)
+          (event region
+            (rect (0,0) width=200 height=169)
+            (rect (0,169) width=196 height=16)
+            (rect (0,185) width=185 height=11)
+            (rect (0,196) width=169 height=4)
+          )
+        )
+        (GraphicsLayer
+          (position 8.00 1408.00)
+          (bounds 200.00 200.00)
+          (drawsContent 1)
+          (event region
+            (rect (0,0) width=200 height=28)
+            (rect (0,28) width=197 height=28)
+            (rect (0,56) width=191 height=27)
+            (rect (0,83) width=181 height=25)
+            (rect (0,108) width=168 height=22)
+            (rect (0,130) width=151 height=21)
+            (rect (0,151) width=130 height=17)
+            (rect (0,168) width=108 height=13)
+            (rect (0,181) width=83 height=10)
+            (rect (0,191) width=56 height=6)
+            (rect (0,197) width=28 height=3)
+          )
+        )
+        (GraphicsLayer
+          (position 208.00 1408.00)
+          (bounds 200.00 200.00)
+          (drawsContent 1)
+          (event region
+            (rect (0,0) width=200 height=124)
+            (rect (0,124) width=194 height=55)
+            (rect (0,179) width=180 height=21)
+          )
+        )
+        (GraphicsLayer
+          (position 408.00 1408.00)
+          (bounds 200.00 200.00)
+          (drawsContent 1)
+          (event region
+            (rect (0,0) width=200 height=194)
+            (rect (0,194) width=185 height=6)
+          )
+        )
+      )
+    )
+  )
+)
+
diff --git a/LayoutTests/fast/scrolling/ios/border-radius-event-region.html b/LayoutTests/fast/scrolling/ios/border-radius-event-region.html
new file mode 100644 (file)
index 0000000..febd464
--- /dev/null
@@ -0,0 +1,39 @@
+<html>
+<style>
+.testdiv {
+    display: inline-block;
+    box-sizing: border-box;
+    border: 2px solid blue;
+    position: relative;
+    height: 200px;
+    width: 200px;
+    will-change: transform;
+}
+
+</style>
+<script>
+window.onload = function () {
+    if (window.testRunner)
+        testRunner.dumpAsText();
+
+    const properties = [ 'border-top-left-radius', 'border-top-right-radius', 'border-bottom-left-radius', 'border-bottom-right-radius' ];
+    const values = [ '5px', '20px', '50px', '200px', '40px 150px', '50px 20px'];
+
+    for (const property of properties) {
+        for (const value of values) {
+            const div = document.createElement("div");
+            div.setAttribute("class", "testdiv");
+            div.setAttribute("style", property + ": " + value);
+            document.body.appendChild(div);
+        }
+    }
+
+    if (window.internals)
+        results.innerText = internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_EVENT_REGION);
+}
+</script>
+<body>
+<pre id="results"></pre>
+</body>
+</html>
+
index 30e6f22..a8015f1 100644 (file)
@@ -1,3 +1,41 @@
+2019-03-30  Antti Koivisto  <antti@apple.com>
+
+        Hit-testing of boxes over scrollers should account for border-radius
+        https://bugs.webkit.org/show_bug.cgi?id=195374
+        <rdar://problem/48649993>
+
+        Reviewed by Simon Fraser.
+
+        Test: fast/scrolling/ios/border-radious-event-region.html
+
+        * page/Frame.h:
+        * platform/graphics/GraphicsLayer.cpp:
+        (WebCore::GraphicsLayer::dumpProperties const):
+
+        Testing support.
+
+        * platform/graphics/GraphicsLayerClient.h:
+        * platform/graphics/RoundedRect.cpp:
+        (WebCore::approximateAsRegion):
+
+        Add a function to approximate RoundedRects as Regions.
+        It cuts away rectangles from the corners following the corner shapes.
+        More rectangles are cut for larger radii.
+
+        * platform/graphics/RoundedRect.h:
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::paintObject):
+
+        Use the new interface to get rounded corners right.
+        In rectangle case this takes optimized paths.
+
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::layerTreeAsText):
+        * testing/Internals.cpp:
+        (WebCore::toLayerTreeFlags):
+        * testing/Internals.h:
+        * testing/Internals.idl:
+
 2019-03-29  Zalan Bujtas  <zalan@apple.com>
 
         [ContentChangeObserver] Expand DOM timer observation to 350ms
index 6c0d84a..dd71d8d 100644 (file)
@@ -106,15 +106,16 @@ using NodeQualifier = Function<Node* (const HitTestResult&, Node* terminationNod
 #endif
 
 enum {
-    LayerTreeFlagsIncludeDebugInfo = 1 << 0,
-    LayerTreeFlagsIncludeVisibleRects = 1 << 1,
-    LayerTreeFlagsIncludeTileCaches = 1 << 2,
-    LayerTreeFlagsIncludeRepaintRects = 1 << 3,
-    LayerTreeFlagsIncludePaintingPhases = 1 << 4,
-    LayerTreeFlagsIncludeContentLayers = 1 << 5,
-    LayerTreeFlagsIncludeAcceleratesDrawing = 1 << 6,
-    LayerTreeFlagsIncludeBackingStoreAttached = 1 << 7,
-    LayerTreeFlagsIncludeRootLayerProperties = 1 << 8,
+    LayerTreeFlagsIncludeDebugInfo              = 1 << 0,
+    LayerTreeFlagsIncludeVisibleRects           = 1 << 1,
+    LayerTreeFlagsIncludeTileCaches             = 1 << 2,
+    LayerTreeFlagsIncludeRepaintRects           = 1 << 3,
+    LayerTreeFlagsIncludePaintingPhases         = 1 << 4,
+    LayerTreeFlagsIncludeContentLayers          = 1 << 5,
+    LayerTreeFlagsIncludeAcceleratesDrawing     = 1 << 6,
+    LayerTreeFlagsIncludeBackingStoreAttached   = 1 << 7,
+    LayerTreeFlagsIncludeRootLayerProperties    = 1 << 8,
+    LayerTreeFlagsIncludeEventRegion            = 1 << 9,
 };
 typedef unsigned LayerTreeFlags;
 
index 00c24ba..602d54d 100644 (file)
@@ -926,6 +926,9 @@ void GraphicsLayer::dumpProperties(TextStream& ts, LayerTreeAsTextBehavior behav
         ts << indent << ")\n";
     }
 
+    if (behavior & LayerTreeAsTextIncludeEventRegion && !m_eventRegion.isEmpty())
+        ts << indent << "(event region" << m_eventRegion << ")\n";
+
     if (behavior & LayerTreeAsTextIncludePaintingPhases && paintingPhase()) {
         ts << indent << "(paintingPhases\n";
         TextStream::IndentScope indentScope(ts);
index 63fd9ed..8672d0f 100644 (file)
@@ -73,6 +73,7 @@ enum LayerTreeAsTextBehaviorFlags {
     LayerTreeAsTextIncludeAcceleratesDrawing    = 1 << 7,
     LayerTreeAsTextIncludeBackingStoreAttached  = 1 << 8,
     LayerTreeAsTextIncludeRootLayerProperties   = 1 << 9,
+    LayerTreeAsTextIncludeEventRegion           = 1 << 10,
     LayerTreeAsTextShowAll                      = 0xFFFF
 };
 typedef unsigned LayerTreeAsTextBehavior;
index e464b32..2120729 100644 (file)
@@ -650,5 +650,17 @@ void Region::setShape(Shape&& shape)
         *m_shape = WTFMove(shape);
 }
 
+TextStream& operator<<(TextStream& ts, const Region& region)
+{
+    ts << "\n";
+    {
+        TextStream::IndentScope indentScope(ts);
+        for (auto& rect : region.rects())
+            ts << indent << "(rect " << rect << ")\n";
+    }
+    ts << indent;
+
+    return ts;
+}
 
 } // namespace WebCore
index 6292187..79633fd 100644 (file)
@@ -208,6 +208,8 @@ inline bool operator!=(const Region::Span& a, const Region::Span& b)
     return !(a == b);
 }
 
+WEBCORE_EXPORT WTF::TextStream& operator<<(WTF::TextStream&, const Region&);
+
 template<class Encoder>
 void Region::Span::encode(Encoder& encoder) const
 {
index 471d4b3..932602d 100644 (file)
@@ -32,6 +32,7 @@
 #include "GeometryUtilities.h"
 #include "LayoutRect.h"
 #include "LayoutUnit.h"
+#include "Region.h"
 
 #include <algorithm>
 
@@ -305,4 +306,69 @@ FloatRoundedRect RoundedRect::pixelSnappedRoundedRectForPainting(float deviceSca
     return snappedRoundedRect;
 }
 
+Region approximateAsRegion(const RoundedRect& roundedRect, unsigned stepLength)
+{
+    Region region;
+
+    auto& rect = roundedRect.rect();
+    region.unite(enclosingIntRect(rect));
+
+    if (!roundedRect.isRounded())
+        return region;
+
+    auto& radii = roundedRect.radii();
+
+    auto makeIntRect = [] (LayoutPoint a, LayoutPoint b) {
+        return enclosingIntRect(LayoutRect {
+            LayoutPoint { std::min(a.x(), b.x()), std::min(a.y(), b.y()) },
+            LayoutPoint { std::max(a.x(), b.x()), std::max(a.y(), b.y()) }
+        });
+    };
+
+    auto subtractCornerRects = [&] (LayoutPoint corner, LayoutPoint ellipsisCenter, LayoutSize axes, double fromAngle) {
+        double toAngle = fromAngle + M_PI / 2;
+
+        // Substract more rects for longer, more rounded arcs.
+        auto arcLengthFactor = roundToInt(std::min(axes.width(), axes.height()));
+        auto count = (arcLengthFactor + (stepLength / 2)) / stepLength;
+
+        for (auto i = 0u; i < count; ++i) {
+            auto angle = fromAngle + (i + 1) * (toAngle - fromAngle) / (count + 1);
+            auto ellipsisPoint = LayoutPoint { axes.width() * cos(angle), axes.height() * sin(angle) };
+            auto cornerRect = makeIntRect(corner, ellipsisCenter + ellipsisPoint);
+            region.subtract(cornerRect);
+        }
+    };
+
+    {
+        auto corner = rect.maxXMaxYCorner();
+        auto axes = radii.bottomRight();
+        auto ellipsisCenter = LayoutPoint(corner.x() - axes.width(), corner.y() - axes.height());
+        subtractCornerRects(corner, ellipsisCenter, axes, 0);
+    }
+
+    {
+        auto corner = rect.minXMaxYCorner();
+        auto axes = radii.bottomLeft();
+        auto ellipsisCenter = LayoutPoint(corner.x() + axes.width(), corner.y() - axes.height());
+        subtractCornerRects(corner, ellipsisCenter, axes, M_PI / 2);
+    }
+
+    {
+        auto corner = rect.minXMinYCorner();
+        auto axes = radii.topLeft();
+        auto ellipsisCenter = LayoutPoint(corner.x() + axes.width(), corner.y() + axes.height());
+        subtractCornerRects(corner, ellipsisCenter, axes, M_PI);
+    }
+
+    {
+        auto corner = rect.maxXMinYCorner();
+        auto axes = radii.topRight();
+        auto ellipsisCenter = LayoutPoint(corner.x() - axes.width(), corner.y() + axes.height());
+        subtractCornerRects(corner, ellipsisCenter, axes, M_PI * 3 / 2);
+    }
+
+    return region;
+}
+
 } // namespace WebCore
index a2852eb..ad8207c 100644 (file)
@@ -35,6 +35,7 @@ namespace WebCore {
 
 class FloatRoundedRect;
 class LayoutUnit;
+class Region;
 
 class RoundedRect {
 public:
@@ -78,7 +79,7 @@ public:
         LayoutSize m_bottomRight;
     };
 
-    explicit RoundedRect(const LayoutRect&, const Radii& = Radii());
+    WEBCORE_EXPORT explicit RoundedRect(const LayoutRect&, const Radii& = Radii());
     RoundedRect(const LayoutUnit&, const LayoutUnit&, const LayoutUnit& width, const LayoutUnit& height);
     WEBCORE_EXPORT RoundedRect(const LayoutRect&, const LayoutSize& topLeft, const LayoutSize& topRight, const LayoutSize& bottomLeft, const LayoutSize& bottomRight);
 
@@ -127,6 +128,8 @@ inline bool operator==(const RoundedRect& a, const RoundedRect& b)
     return a.rect() == b.rect() && a.radii() == b.radii();
 }
 
+// Snip away rectangles from corners, roughly one per step length of arc.
+WEBCORE_EXPORT Region approximateAsRegion(const RoundedRect&, unsigned stepLength = 20);
 
 } // namespace WebCore
 
index b3a7378..2a1b0b2 100644 (file)
@@ -1241,10 +1241,12 @@ void RenderBlock::paintObject(PaintInfo& paintInfo, const LayoutPoint& paintOffs
         return;
 
     if (paintPhase == PaintPhase::EventRegion) {
-        // FIXME: Handle inlines, lineboxes, SVG too.
-        // FIXME: Transforms?
-        if (visibleToHitTesting())
-            paintInfo.eventRegion->unite(enclosingIntRect(LayoutRect(paintOffset, size())));
+        auto borderRect = LayoutRect(paintOffset, size());
+
+        if (visibleToHitTesting()) {
+            auto borderRegion = approximateAsRegion(style().getRoundedBorderFor(borderRect));
+            paintInfo.eventRegion->unite(borderRegion);
+        }
 
         // No need to check descendants if we don't have overflow.
         if (!hasVisualOverflow())
index cc78435..0eae619 100644 (file)
@@ -1943,6 +1943,8 @@ String RenderLayerCompositor::layerTreeAsText(LayerTreeFlags flags)
         layerTreeBehavior |= LayerTreeAsTextIncludeBackingStoreAttached;
     if (flags & LayerTreeFlagsIncludeRootLayerProperties)
         layerTreeBehavior |= LayerTreeAsTextIncludeRootLayerProperties;
+    if (flags & LayerTreeFlagsIncludeEventRegion)
+        layerTreeBehavior |= LayerTreeAsTextIncludeEventRegion;
 
     // We skip dumping the scroll and clip layers to keep layerTreeAsText output
     // similar between platforms.
index c39f1fd..5da62f0 100644 (file)
@@ -2518,6 +2518,8 @@ static LayerTreeFlags toLayerTreeFlags(unsigned short flags)
         layerTreeFlags |= LayerTreeFlagsIncludeBackingStoreAttached;
     if (flags & Internals::LAYER_TREE_INCLUDES_ROOT_LAYER_PROPERTIES)
         layerTreeFlags |= LayerTreeFlagsIncludeRootLayerProperties;
+    if (flags & Internals::LAYER_TREE_INCLUDES_EVENT_REGION)
+        layerTreeFlags |= LayerTreeFlagsIncludeEventRegion;
 
     return layerTreeFlags;
 }
index 5212839..79af3c0 100644 (file)
@@ -347,6 +347,7 @@ public:
         LAYER_TREE_INCLUDES_ACCELERATES_DRAWING = 32,
         LAYER_TREE_INCLUDES_BACKING_STORE_ATTACHED = 64,
         LAYER_TREE_INCLUDES_ROOT_LAYER_PROPERTIES = 128,
+        LAYER_TREE_INCLUDES_EVENT_REGION = 256,
     };
     ExceptionOr<String> layerTreeAsText(Document&, unsigned short flags) const;
     ExceptionOr<uint64_t> layerIDForElement(Element&);
index a2f8c6a..99d5dc9 100644 (file)
@@ -372,6 +372,7 @@ enum CompositingPolicy {
     const unsigned short LAYER_TREE_INCLUDES_ACCELERATES_DRAWING = 32;
     const unsigned short LAYER_TREE_INCLUDES_BACKING_STORE_ATTACHED = 64;
     const unsigned short LAYER_TREE_INCLUDES_ROOT_LAYER_PROPERTIES = 128;
+    const unsigned short LAYER_TREE_INCLUDES_EVENT_REGION = 256;
     [MayThrowException] DOMString layerTreeAsText(Document document, optional unsigned short flags = 0);
 
     [MayThrowException] unsigned long long layerIDForElement(Element element);