Changeset 243962 in webkit
- Timestamp:
- Apr 6, 2019, 9:48:58 AM (7 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 1 deleted
- 30 edited
- 1 moved
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/pointerevents/ios/touch-action-region-basic-expected.txt (modified) (1 diff)
-
LayoutTests/pointerevents/ios/touch-action-region-layers-expected.txt (modified) (5 diffs)
-
LayoutTests/pointerevents/ios/touch-action-region-pan-x-y-expected.txt (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/Sources.txt (modified) (2 diffs)
-
Source/WebCore/WebCore.xcodeproj/project.pbxproj (modified) (6 diffs)
-
Source/WebCore/platform/graphics/GraphicsLayer.cpp (modified) (2 diffs)
-
Source/WebCore/platform/graphics/GraphicsLayer.h (modified) (4 diffs)
-
Source/WebCore/platform/graphics/Region.cpp (modified) (1 diff)
-
Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp (modified) (2 diffs)
-
Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h (modified) (1 diff)
-
Source/WebCore/platform/graphics/ca/PlatformCALayer.h (modified) (1 diff)
-
Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.h (modified) (1 diff)
-
Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.h (modified) (1 diff)
-
Source/WebCore/rendering/EventRegion.cpp (moved) (moved from trunk/Source/WebCore/rendering/TouchActionRegion.cpp ) (6 diffs)
-
Source/WebCore/rendering/EventRegion.h (added)
-
Source/WebCore/rendering/InlineTextBox.cpp (modified) (2 diffs)
-
Source/WebCore/rendering/PaintInfo.h (modified) (3 diffs)
-
Source/WebCore/rendering/RenderBlock.cpp (modified) (3 diffs)
-
Source/WebCore/rendering/RenderLayer.cpp (modified) (1 diff)
-
Source/WebCore/rendering/RenderLayer.h (modified) (3 diffs)
-
Source/WebCore/rendering/RenderLayerBacking.cpp (modified) (4 diffs)
-
Source/WebCore/rendering/RenderLayerModelObject.cpp (modified) (1 diff)
-
Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp (modified) (2 diffs)
-
Source/WebCore/rendering/TouchActionRegion.h (deleted)
-
Source/WebKit/ChangeLog (modified) (1 diff)
-
Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h (modified) (1 diff)
-
Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm (modified) (2 diffs)
-
Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeNode.h (modified) (2 diffs)
-
Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeNode.mm (modified) (1 diff)
-
Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp (modified) (2 diffs)
-
Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r243961 r243962 1 2019-04-06 Antti Koivisto <antti@apple.com> 2 3 Combine event and touch action regions into a single class 4 https://bugs.webkit.org/show_bug.cgi?id=196644 5 <rdar://problem/49643614> 6 7 Reviewed by Darin Adler. 8 9 * pointerevents/ios/touch-action-region-basic-expected.txt: 10 * pointerevents/ios/touch-action-region-layers-expected.txt: 11 * pointerevents/ios/touch-action-region-pan-x-y-expected.txt: 12 1 13 2019-04-05 Yongjun Zhang <yongjun_zhang@apple.com> 2 14 -
trunk/LayoutTests/pointerevents/ios/touch-action-region-basic-expected.txt
r243893 r243962 10 10 (event region 11 11 (rect (0,0) width=800 height=621) 12 )13 (touch-action region14 (none15 (rect (8,8) width=100 height=100)16 (rect (8,208) width=200 height=25)17 (rect (8,233) width=100 height=75)18 (rect (8,408) width=100 height=50)19 (rect (8,458) width=50 height=50)12 (touch-action 13 (none 14 (rect (8,8) width=100 height=100) 15 (rect (8,208) width=200 height=25) 16 (rect (8,233) width=100 height=75) 17 (rect (8,408) width=100 height=50) 18 (rect (8,458) width=50 height=50) 19 ) 20 20 ) 21 21 ) -
trunk/LayoutTests/pointerevents/ios/touch-action-region-layers-expected.txt
r243893 r243962 18 18 (event region 19 19 (rect (0,0) width=100 height=100) 20 )21 (touch-action region22 (none23 (rect (0,0) width=100 height=100)20 (touch-action 21 (none 22 (rect (0,0) width=100 height=100) 23 ) 24 24 ) 25 25 ) … … 32 32 (rect (0,0) width=200 height=25) 33 33 (rect (0,25) width=100 height=75) 34 )35 (touch-action region36 (none37 (rect (0,0) width=200 height=25)38 (rect (0,25) width=100 height=75)34 (touch-action 35 (none 36 (rect (0,0) width=200 height=25) 37 (rect (0,25) width=100 height=75) 38 ) 39 39 ) 40 40 ) … … 46 46 (event region 47 47 (rect (0,0) width=100 height=100) 48 )49 (touch-action region50 (none51 (rect (0,0) width=100 height=100)48 (touch-action 49 (none 50 (rect (0,0) width=100 height=100) 51 ) 52 52 ) 53 53 ) … … 70 70 (rect (0,50) width=150 height=50) 71 71 (rect (50,100) width=100 height=50) 72 )73 (touch-action region74 (none75 (rect (0,0) width=100 height=50)76 (rect (0,50) width=150 height=50)77 (rect (50,100) width=100 height=50)72 (touch-action 73 (none 74 (rect (0,0) width=100 height=50) 75 (rect (0,50) width=150 height=50) 76 (rect (50,100) width=100 height=50) 77 ) 78 78 ) 79 79 ) … … 89 89 (event region 90 90 (rect (0,0) width=100 height=100) 91 )92 (touch-action region93 (none94 (rect (0,0) width=100 height=100)91 (touch-action 92 (none 93 (rect (0,0) width=100 height=100) 94 ) 95 95 ) 96 96 ) -
trunk/LayoutTests/pointerevents/ios/touch-action-region-pan-x-y-expected.txt
r243893 r243962 10 10 (event region 11 11 (rect (0,0) width=800 height=1021) 12 )13 (touch-action region14 (none15 (rect (8,808) width=100 height=100)16 )17 (pan-x18 (rect (8,8) width=100 height=100)19 (rect (8,208) width=200 height=25)20 (rect (8,233) width=100 height=75)21 (rect (108,408) width=100 height=25)22 (rect (8,608) width=200 height=25)23 (rect (8,633) width=100 height=75)24 (rect (108,808) width=100 height=25)25 )26 (pan-y27 (rect (8,408) width=200 height=25)28 (rect (8,433) width=100 height=75)12 (touch-action 13 (none 14 (rect (8,808) width=100 height=100) 15 ) 16 (pan-x 17 (rect (8,8) width=100 height=100) 18 (rect (8,208) width=200 height=25) 19 (rect (8,233) width=100 height=75) 20 (rect (108,408) width=100 height=25) 21 (rect (8,608) width=200 height=25) 22 (rect (8,633) width=100 height=75) 23 (rect (108,808) width=100 height=25) 24 ) 25 (pan-y 26 (rect (8,408) width=200 height=25) 27 (rect (8,433) width=100 height=75) 28 ) 29 29 ) 30 30 ) -
trunk/Source/WebCore/ChangeLog
r243961 r243962 1 2019-04-06 Antti Koivisto <antti@apple.com> 2 3 Combine event and touch action regions into a single class 4 https://bugs.webkit.org/show_bug.cgi?id=196644 5 <rdar://problem/49643614> 6 7 Reviewed by Darin Adler. 8 9 This patch replaces the existing TouchActionRegion class with the more general EventRegion class. 10 It collects both the overall event region and the touch action regions. This avoids duplication 11 and simplifies the code. 12 13 The patch also adds serialization support for EventRegion, so touch-action regions gets passed 14 to the UI process too. 15 16 * Sources.txt: 17 * WebCore.xcodeproj/project.pbxproj: 18 * platform/graphics/GraphicsLayer.cpp: 19 (WebCore::GraphicsLayer::setEventRegion): 20 (WebCore::GraphicsLayer::dumpProperties const): 21 (WebCore::GraphicsLayer::setTouchActionRegion): Deleted. 22 * platform/graphics/GraphicsLayer.h: 23 (WebCore::GraphicsLayer::eventRegion const): 24 (WebCore::GraphicsLayer::touchActionRegion const): Deleted. 25 * platform/graphics/Region.cpp: 26 (WebCore::operator<<): 27 * platform/graphics/ca/GraphicsLayerCA.cpp: 28 (WebCore::GraphicsLayerCA::setEventRegion): 29 (WebCore::GraphicsLayerCA::setTouchActionRegion): Deleted. 30 * platform/graphics/ca/GraphicsLayerCA.h: 31 * platform/graphics/ca/PlatformCALayer.h: 32 * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h: 33 * rendering/EventRegion.cpp: Copied from Source/WebCore/rendering/TouchActionRegion.cpp. 34 (WebCore::EventRegion::operator== const): 35 (WebCore::EventRegion::unite): 36 (WebCore::EventRegion::translate): 37 (WebCore::EventRegion::uniteTouchActions): 38 (WebCore::EventRegion::touchActionsForPoint const): 39 (WebCore::operator<<): 40 (WebCore::TouchActionRegion::unite): Deleted. 41 (WebCore::TouchActionRegion::actionsForPoint const): Deleted. 42 (WebCore::TouchActionRegion::translate): Deleted. 43 * rendering/EventRegion.h: Copied from Source/WebCore/rendering/TouchActionRegion.h. 44 (WebCore::EventRegion::isEmpty const): 45 (WebCore::EventRegion::contains const): 46 (WebCore::EventRegion::hasTouchActions const): 47 (WebCore::EventRegion::encode const): 48 (WebCore::EventRegion::decode): 49 (WebCore::TouchActionRegion::isEmpty const): Deleted. 50 (WebCore::TouchActionRegion::operator== const): Deleted. 51 * rendering/InlineTextBox.cpp: 52 (WebCore::InlineTextBox::paint): 53 * rendering/PaintInfo.h: 54 * rendering/RenderBlock.cpp: 55 (WebCore::RenderBlock::paintObject): 56 * rendering/RenderLayer.cpp: 57 (WebCore::RenderLayer::collectEventRegionForFragments): 58 * rendering/RenderLayer.h: 59 * rendering/RenderLayerBacking.cpp: 60 (WebCore::RenderLayerBacking::updateEventRegion): 61 * rendering/RenderLayerModelObject.cpp: 62 * rendering/SimpleLineLayoutFunctions.cpp: 63 (WebCore::SimpleLineLayout::paintFlow): 64 * rendering/TouchActionRegion.cpp: Removed. 65 * rendering/TouchActionRegion.h: Removed. 66 1 67 2019-04-05 Yongjun Zhang <yongjun_zhang@apple.com> 2 68 -
trunk/Source/WebCore/Sources.txt
r243893 r243962 1951 1951 rendering/CounterNode.cpp 1952 1952 rendering/EllipsisBox.cpp 1953 rendering/EventRegion.cpp 1953 1954 rendering/FlexibleBoxAlgorithm.cpp 1954 1955 rendering/FixedTableLayout.cpp … … 2069 2070 rendering/TextPaintStyle.cpp 2070 2071 rendering/TextPainter.cpp 2071 rendering/TouchActionRegion.cpp2072 2072 rendering/TrailingFloatsRootInlineBox.cpp 2073 2073 -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r243893 r243962 4823 4823 E4A814DA1C70E10D00BF85AC /* AttributeChangeInvalidation.h in Headers */ = {isa = PBXBuildFile; fileRef = E4A814D91C70E10D00BF85AC /* AttributeChangeInvalidation.h */; }; 4824 4824 E4A814E01C7338EB00BF85AC /* IdChangeInvalidation.h in Headers */ = {isa = PBXBuildFile; fileRef = E4A814DF1C7338EB00BF85AC /* IdChangeInvalidation.h */; }; 4825 E4A8D21 022538FD200A8463C /* TouchActionRegion.h in Headers */ = {isa = PBXBuildFile; fileRef = E4A8D20F22538FD100A8463C /* TouchActionRegion.h */; settings = {ATTRIBUTES = (Private, ); }; };4825 E4A8D21622578DB700A8463C /* EventRegion.h in Headers */ = {isa = PBXBuildFile; fileRef = E4A8D21422578DA000A8463C /* EventRegion.h */; settings = {ATTRIBUTES = (Private, ); }; }; 4826 4826 E4AE7C1617D1BB950009FB31 /* ElementIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = E4AE7C1517D1BB950009FB31 /* ElementIterator.h */; settings = {ATTRIBUTES = (Private, ); }; }; 4827 4827 E4AE7C1A17D232350009FB31 /* ElementAncestorIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = E4AE7C1917D232350009FB31 /* ElementAncestorIterator.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 14885 14885 E4A814DD1C7338D100BF85AC /* IdChangeInvalidation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IdChangeInvalidation.cpp; sourceTree = "<group>"; }; 14886 14886 E4A814DF1C7338EB00BF85AC /* IdChangeInvalidation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IdChangeInvalidation.h; sourceTree = "<group>"; }; 14887 E4A8D2 0C22538FC700A8463C /* TouchActionRegion.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TouchActionRegion.cpp; sourceTree = "<group>"; };14888 E4A8D2 0F22538FD100A8463C /* TouchActionRegion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TouchActionRegion.h; sourceTree = "<group>"; };14887 E4A8D21422578DA000A8463C /* EventRegion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EventRegion.h; sourceTree = "<group>"; }; 14888 E4A8D21522578DA000A8463C /* EventRegion.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EventRegion.cpp; sourceTree = "<group>"; }; 14889 14889 E4AE7C1517D1BB950009FB31 /* ElementIterator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ElementIterator.h; sourceTree = "<group>"; }; 14890 14890 E4AE7C1917D232350009FB31 /* ElementAncestorIterator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ElementAncestorIterator.h; sourceTree = "<group>"; }; … … 26802 26802 A8CFF6CA0A1561CD000A4234 /* EllipsisBox.cpp */, 26803 26803 A8CFF6BD0A156118000A4234 /* EllipsisBox.h */, 26804 E4A8D21522578DA000A8463C /* EventRegion.cpp */, 26805 E4A8D21422578DA000A8463C /* EventRegion.h */, 26804 26806 A8CFF0480A154F09000A4234 /* FixedTableLayout.cpp */, 26805 26807 A8CFF04A0A154F09000A4234 /* FixedTableLayout.h */, … … 27058 27060 E4C91A0F1802343900A17F6D /* TextPaintStyle.cpp */, 27059 27061 E4C91A0D1802343100A17F6D /* TextPaintStyle.h */, 27060 E4A8D20C22538FC700A8463C /* TouchActionRegion.cpp */,27061 E4A8D20F22538FD100A8463C /* TouchActionRegion.h */,27062 27062 1100FC6E1FDB3C4D00DD961B /* TrailingFloatsRootInlineBox.cpp */, 27063 27063 37FC96DA1104ED71003E1FAD /* TrailingFloatsRootInlineBox.h */, … … 29501 29501 FDA15EAE12B03EE1003A583A /* JSAudioListener.h in Headers */, 29502 29502 FDA15EB012B03EE1003A583A /* JSAudioNode.h in Headers */, 29503 E4A8D21022538FD200A8463C /* TouchActionRegion.h in Headers */,29504 29503 FDA15EB412B03EE1003A583A /* JSAudioParam.h in Headers */, 29505 29504 FDA15EB612B03EE1003A583A /* JSAudioProcessingEvent.h in Headers */, … … 29787 29786 1AE2AE5C0A1D26F200B42B25 /* JSHTMLMenuElement.h in Headers */, 29788 29787 A80E7A180A19C3D6007FB8C5 /* JSHTMLMetaElement.h in Headers */, 29788 E4A8D21622578DB700A8463C /* EventRegion.h in Headers */, 29789 29789 A7BBE26711AFB3F20005EA03 /* JSHTMLMeterElement.h in Headers */, 29790 29790 1AE2AB2A0A1CE63B00B42B25 /* JSHTMLModElement.h in Headers */, -
trunk/Source/WebCore/platform/graphics/GraphicsLayer.cpp
r243893 r243962 412 412 } 413 413 414 void GraphicsLayer::setEventRegion( Region&& eventRegion)414 void GraphicsLayer::setEventRegion(EventRegion&& eventRegion) 415 415 { 416 416 m_eventRegion = WTFMove(eventRegion); 417 417 } 418 419 #if ENABLE(POINTER_EVENTS)420 void GraphicsLayer::setTouchActionRegion(TouchActionRegion&& touchActionRegion)421 {422 m_touchActionRegion = WTFMove(touchActionRegion);423 }424 #endif425 418 426 419 void GraphicsLayer::noteDeviceOrPageScaleFactorChangedIncludingDescendants() … … 934 927 } 935 928 936 if (behavior & LayerTreeAsTextIncludeEventRegion) { 937 if (!m_eventRegion.isEmpty()) 938 ts << indent << "(event region" << m_eventRegion << ")\n"; 939 #if ENABLE(POINTER_EVENTS) 940 if (!m_touchActionRegion.isEmpty()) 941 ts << indent << "(touch-action region" << m_touchActionRegion << ")\n"; 942 #endif 929 if (behavior & LayerTreeAsTextIncludeEventRegion && !m_eventRegion.isEmpty()) { 930 ts << indent << "(event region" << m_eventRegion; 931 ts << indent << ")\n"; 943 932 } 944 933 -
trunk/Source/WebCore/platform/graphics/GraphicsLayer.h
r243893 r243962 28 28 #include "Animation.h" 29 29 #include "Color.h" 30 #include "EventRegion.h" 30 31 #include "FilterOperations.h" 31 32 #include "FloatPoint.h" … … 38 39 #include "Region.h" 39 40 #include "ScrollableArea.h" 40 #include "TouchActionRegion.h"41 41 #include "TransformOperations.h" 42 42 #include "WindRule.h" … … 455 455 virtual void setShapeLayerWindRule(WindRule); 456 456 457 const Region& eventRegion() const { return m_eventRegion; } 458 virtual void setEventRegion(Region&&); 459 #if ENABLE(POINTER_EVENTS) 460 const TouchActionRegion& touchActionRegion() const { return m_touchActionRegion; } 461 virtual void setTouchActionRegion(TouchActionRegion&&); 462 #endif 457 const EventRegion& eventRegion() const { return m_eventRegion; } 458 virtual void setEventRegion(EventRegion&&); 459 463 460 // Transitions are identified by a special animation name that cannot clash with a keyframe identifier. 464 461 static String animationNameForTransition(AnimatedPropertyID); … … 735 732 Optional<FloatRect> m_animationExtent; 736 733 737 Region m_eventRegion; 738 #if ENABLE(POINTER_EVENTS) 739 TouchActionRegion m_touchActionRegion; 740 #endif 734 EventRegion m_eventRegion; 741 735 #if USE(CA) 742 736 WindRule m_shapeLayerWindRule { WindRule::NonZero }; -
trunk/Source/WebCore/platform/graphics/Region.cpp
r243675 r243962 660 660 ts << indent << "(rect " << rect << ")\n"; 661 661 } 662 ts << indent;663 662 664 663 return ts; -
trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
r243893 r243962 985 985 } 986 986 987 void GraphicsLayerCA::setEventRegion( Region&& eventRegion)987 void GraphicsLayerCA::setEventRegion(EventRegion&& eventRegion) 988 988 { 989 989 if (eventRegion == m_eventRegion) … … 993 993 noteLayerPropertyChanged(EventRegionChanged, m_isCommittingChanges ? DontScheduleFlush : ScheduleFlush); 994 994 } 995 996 #if ENABLE(POINTER_EVENTS)997 void GraphicsLayerCA::setTouchActionRegion(TouchActionRegion&& touchActionRegion)998 {999 if (touchActionRegion == m_touchActionRegion)1000 return;1001 1002 GraphicsLayer::setTouchActionRegion(WTFMove(touchActionRegion));1003 // FIXME: Invalidate and pass to platform layer.1004 }1005 #endif1006 995 1007 996 bool GraphicsLayerCA::shouldRepaintOnSizeChange() const -
trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h
r243893 r243962 125 125 WEBCORE_EXPORT void setShapeLayerWindRule(WindRule) override; 126 126 127 WEBCORE_EXPORT void setEventRegion(Region&&) override; 128 #if ENABLE(POINTER_EVENTS) 129 WEBCORE_EXPORT void setTouchActionRegion(TouchActionRegion&&) override; 130 #endif 127 WEBCORE_EXPORT void setEventRegion(EventRegion&&) override; 128 131 129 WEBCORE_EXPORT void suspendAnimations(MonotonicTime) override; 132 130 WEBCORE_EXPORT void resumeAnimations() override; -
trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.h
r243007 r243962 235 235 virtual void setShapeWindRule(WindRule) = 0; 236 236 237 virtual void setEventRegion(const Region&) = 0;237 virtual void setEventRegion(const EventRegion&) = 0; 238 238 239 239 virtual GraphicsLayer::CustomAppearance customAppearance() const = 0; -
trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.h
r243007 r243962 169 169 void updateCustomAppearance(GraphicsLayer::CustomAppearance) override; 170 170 171 void setEventRegion(const Region&) override { }171 void setEventRegion(const EventRegion&) override { } 172 172 173 173 GraphicsLayer::EmbeddedViewID embeddedViewID() const override; -
trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.h
r243007 r243962 158 158 void updateCustomAppearance(GraphicsLayer::CustomAppearance customAppearance) override { m_customAppearance = customAppearance; } 159 159 160 void setEventRegion(const Region&) override { }160 void setEventRegion(const EventRegion&) override { } 161 161 162 162 GraphicsLayer::EmbeddedViewID embeddedViewID() const override; -
trunk/Source/WebCore/rendering/EventRegion.cpp
r243961 r243962 25 25 26 26 #include "config.h" 27 #include "TouchActionRegion.h" 27 #include "EventRegion.h" 28 29 #include "RenderStyle.h" 30 31 namespace WebCore { 32 33 EventRegion::EventRegion() = default; 34 35 bool EventRegion::operator==(const EventRegion& other) const 36 { 37 #if ENABLE(POINTER_EVENTS) 38 if (m_touchActionRegions != other.m_touchActionRegions) 39 return false; 40 #endif 41 return m_region == other.m_region; 42 } 43 44 void EventRegion::unite(const Region& region, const RenderStyle& style) 45 { 46 m_region.unite(region); 28 47 29 48 #if ENABLE(POINTER_EVENTS) 49 uniteTouchActions(region, style.effectiveTouchActions()); 50 #else 51 UNUSED_PARAM(style); 52 #endif 53 } 30 54 31 namespace WebCore { 55 void EventRegion::translate(const IntSize& offset) 56 { 57 m_region.translate(offset); 58 59 #if ENABLE(POINTER_EVENTS) 60 for (auto& touchActionRegion : m_touchActionRegions) 61 touchActionRegion.translate(offset); 62 #endif 63 } 64 65 #if ENABLE(POINTER_EVENTS) 32 66 33 67 constexpr unsigned toIndex(TouchAction touchAction) … … 71 105 } 72 106 73 TouchActionRegion::TouchActionRegion() = default; 74 75 void TouchActionRegion::unite(const Region& touchRegion, OptionSet<TouchAction> touchActions) 107 void EventRegion::uniteTouchActions(const Region& touchRegion, OptionSet<TouchAction> touchActions) 76 108 { 77 109 for (auto touchAction : touchActions) { … … 79 111 break; 80 112 auto index = toIndex(touchAction); 81 if (m_ regions.size() < index + 1)82 m_ regions.grow(index + 1);113 if (m_touchActionRegions.size() < index + 1) 114 m_touchActionRegions.grow(index + 1); 83 115 } 84 116 85 for (unsigned i = 0; i < m_ regions.size(); ++i) {117 for (unsigned i = 0; i < m_touchActionRegions.size(); ++i) { 86 118 auto regionTouchAction = toTouchAction(i); 87 119 if (touchActions.contains(regionTouchAction)) 88 m_ regions[i].unite(touchRegion);120 m_touchActionRegions[i].unite(touchRegion); 89 121 else 90 m_ regions[i].subtract(touchRegion);122 m_touchActionRegions[i].subtract(touchRegion); 91 123 } 92 124 } 93 125 94 OptionSet<TouchAction> TouchActionRegion::actionsForPoint(const IntPoint& point) const126 OptionSet<TouchAction> EventRegion::touchActionsForPoint(const IntPoint& point) const 95 127 { 96 128 OptionSet<TouchAction> actions; 97 129 98 for (unsigned i = 0; i < m_ regions.size(); ++i) {99 if (m_ regions[i].contains(point)) {130 for (unsigned i = 0; i < m_touchActionRegions.size(); ++i) { 131 if (m_touchActionRegions[i].contains(point)) { 100 132 auto action = toTouchAction(i); 101 133 actions.add(action); … … 106 138 107 139 return actions; 108 }109 110 void TouchActionRegion::translate(const IntSize& offset)111 {112 for (auto& region : m_regions)113 region.translate(offset);114 140 } 115 141 … … 134 160 } 135 161 136 TextStream& operator<<(TextStream& ts, const TouchActionRegion& touchActionRegion) 162 #endif 163 164 TextStream& operator<<(TextStream& ts, const EventRegion& eventRegion) 137 165 { 138 ts << "\n"; 139 { 140 for (unsigned i = 0; i < touchActionRegion.m_regions.size(); ++i) { 141 if (touchActionRegion.m_regions[i].isEmpty()) 166 ts << eventRegion.m_region; 167 168 #if ENABLE(POINTER_EVENTS) 169 if (!eventRegion.m_touchActionRegions.isEmpty()) { 170 TextStream::IndentScope indentScope(ts); 171 ts << indent << "(touch-action\n"; 172 for (unsigned i = 0; i < eventRegion.m_touchActionRegions.size(); ++i) { 173 if (eventRegion.m_touchActionRegions[i].isEmpty()) 142 174 continue; 143 175 TextStream::IndentScope indentScope(ts); 144 176 ts << indent << "(" << toTouchAction(i); 145 ts << indent << touchActionRegion.m_regions[i] << ")\n"; 177 ts << indent << eventRegion.m_touchActionRegions[i]; 178 ts << indent << ")\n"; 146 179 } 180 ts << indent << ")\n"; 147 181 } 148 ts << indent; 182 #endif 149 183 150 184 return ts; … … 152 186 153 187 } 154 155 #endif -
trunk/Source/WebCore/rendering/InlineTextBox.cpp
r243488 r243962 30 30 #include "Editor.h" 31 31 #include "EllipsisBox.h" 32 #include "EventRegion.h" 32 33 #include "Frame.h" 33 34 #include "GraphicsContext.h" … … 505 506 if (paintInfo.phase == PaintPhase::EventRegion) { 506 507 if (visibleToHitTesting()) 507 paintInfo.eventRegion->unite(enclosingIntRect(boxRect) );508 paintInfo.eventRegion->unite(enclosingIntRect(boxRect), renderer().style()); 508 509 return; 509 510 } -
trunk/Source/WebCore/rendering/PaintInfo.h
r243893 r243962 38 38 namespace WebCore { 39 39 40 class EventRegion; 40 41 class OverlapTestRequestClient; 41 class Region;42 42 class RenderInline; 43 43 class RenderLayer; … … 45 45 class RenderObject; 46 46 47 #if ENABLE(POINTER_EVENTS)48 class TouchActionRegion;49 #endif50 51 47 typedef HashMap<OverlapTestRequestClient*, IntRect> OverlapTestRequestMap; 52 48 … … 135 131 bool requireSecurityOriginAccessForWidgets { false }; 136 132 const RenderLayer* m_enclosingSelfPaintingLayer { nullptr }; 137 Region* eventRegion { nullptr }; // For PaintPhase::EventRegion. 138 #if ENABLE(POINTER_EVENTS) 139 TouchActionRegion* touchActionRegion { nullptr }; 140 #endif 133 EventRegion* eventRegion { nullptr }; // For PaintPhase::EventRegion. 141 134 private: 142 135 GraphicsContext* m_context; -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r243893 r243962 29 29 #include "Editor.h" 30 30 #include "Element.h" 31 #include "EventRegion.h" 31 32 #include "FloatQuad.h" 32 33 #include "Frame.h" … … 71 72 #include "ShadowRoot.h" 72 73 #include "ShapeOutsideInfo.h" 73 #include "TouchActionRegion.h"74 74 #include "TransformState.h" 75 75 #include <wtf/IsoMallocInlines.h> … … 1247 1247 if (visibleToHitTesting()) { 1248 1248 auto borderRegion = approximateAsRegion(style().getRoundedBorderFor(borderRect)); 1249 paintInfo.eventRegion->unite(borderRegion); 1250 #if ENABLE(POINTER_EVENTS) 1251 if (paintInfo.touchActionRegion) 1252 paintInfo.touchActionRegion->unite(borderRegion, style().effectiveTouchActions()); 1253 #endif 1249 paintInfo.eventRegion->unite(borderRegion, style()); 1254 1250 } 1255 1251 1256 1252 // No need to check descendants if we don't have overflow and the area is already covered. 1257 1253 bool needsTraverseDescendants = hasVisualOverflow() || !paintInfo.eventRegion->contains(enclosingIntRect(borderRect)); 1258 #if ENABLE(POINTER_EVENTS)1259 needsTraverseDescendants = needsTraverseDescendants || paintInfo.touchActionRegion;1254 #if PLATFORM(IOS_FAMILY) && ENABLE(POINTER_EVENTS) 1255 needsTraverseDescendants = needsTraverseDescendants || document().touchActionElements(); 1260 1256 #endif 1261 1257 if (!needsTraverseDescendants) -
trunk/Source/WebCore/rendering/RenderLayer.cpp
r243926 r243962 4892 4892 PaintInfo paintInfo(context, fragment.foregroundRect.rect(), PaintPhase::EventRegion, { }); 4893 4893 paintInfo.eventRegion = localPaintingInfo.eventRegion; 4894 #if ENABLE(POINTER_EVENTS)4895 paintInfo.touchActionRegion = localPaintingInfo.touchActionRegion;4896 #endif4897 4894 renderer().paint(paintInfo, toLayoutPoint(fragment.layerBounds.location() - renderBoxLocation() + localPaintingInfo.subpixelOffset)); 4898 4895 } -
trunk/Source/WebCore/rendering/RenderLayer.h
r243926 r243962 64 64 class ClipRects; 65 65 class ClipRectsCache; 66 class EventRegion; 66 67 class HitTestRequest; 67 68 class HitTestResult; … … 80 81 class Scrollbar; 81 82 class TransformationMatrix; 82 83 #if ENABLE(POINTER_EVENTS)84 class TouchActionRegion;85 #endif86 83 87 84 enum BorderRadiusClippingRule { IncludeSelfForBorderRadius, DoNotIncludeSelfForBorderRadius }; … … 917 914 bool requireSecurityOriginAccessForWidgets; 918 915 bool clipToDirtyRect { true }; 919 Region* eventRegion { nullptr }; 920 #if ENABLE(POINTER_EVENTS) 921 TouchActionRegion* touchActionRegion { nullptr }; 922 #endif 916 EventRegion* eventRegion { nullptr }; 923 917 }; 924 918 -
trunk/Source/WebCore/rendering/RenderLayerBacking.cpp
r243919 r243962 35 35 #include "Chrome.h" 36 36 #include "DocumentTimeline.h" 37 #include "EventRegion.h" 37 38 #include "Frame.h" 38 39 #include "FrameView.h" … … 52 53 #include "PluginViewBase.h" 53 54 #include "ProgressTracker.h" 54 #include "Region.h"55 55 #include "RenderFragmentContainer.h" 56 56 #include "RenderFragmentedFlow.h" … … 1450 1450 RenderLayer::LayerPaintingInfo paintingInfo(&m_owningLayer, compositedBounds(), { }, LayoutSize()); 1451 1451 1452 Region eventRegion;1452 EventRegion eventRegion; 1453 1453 paintingInfo.eventRegion = &eventRegion; 1454 1455 #if ENABLE(POINTER_EVENTS)1456 TouchActionRegion touchActionRegion;1457 if (hasTouchActionElements)1458 paintingInfo.touchActionRegion = &touchActionRegion;1459 #endif1460 1454 1461 1455 auto paintFlags = RenderLayer::paintLayerPaintingCompositingAllPhasesFlags() | RenderLayer::PaintLayerCollectingEventRegion; … … 1466 1460 m_graphicsLayer->setEventRegion(WTFMove(eventRegion)); 1467 1461 1468 #if ENABLE(POINTER_EVENTS)1469 touchActionRegion.translate(contentOffset);1470 m_graphicsLayer->setTouchActionRegion(WTFMove(touchActionRegion));1471 #endif1472 1462 #endif 1473 1463 } -
trunk/Source/WebCore/rendering/RenderLayerModelObject.cpp
r243151 r243962 27 27 28 28 #include "RenderLayer.h" 29 #include "RenderLayerBacking.h" 29 30 #include "RenderLayerCompositor.h" 30 31 #include "RenderView.h" -
trunk/Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp
r243660 r243962 29 29 #include "BidiRun.h" 30 30 #include "BidiRunList.h" 31 #include "EventRegion.h" 31 32 #include "FontCache.h" 32 33 #include "Frame.h" … … 84 85 for (auto run : layout.runResolver().rangeForRect(paintRect)) { 85 86 FloatRect visualOverflowRect = computeOverflow(flow, run.rect()); 86 paintInfo.eventRegion->unite(enclosingIntRect(visualOverflowRect) );87 paintInfo.eventRegion->unite(enclosingIntRect(visualOverflowRect), flow.style()); 87 88 } 88 89 return; -
trunk/Source/WebKit/ChangeLog
r243961 r243962 1 2019-04-06 Antti Koivisto <antti@apple.com> 2 3 Combine event and touch action regions into a single class 4 https://bugs.webkit.org/show_bug.cgi?id=196644 5 <rdar://problem/49643614> 6 7 Reviewed by Darin Adler. 8 9 * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h: 10 * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm: 11 (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode): 12 * UIProcess/RemoteLayerTree/RemoteLayerTreeNode.h: 13 (WebKit::RemoteLayerTreeNode::eventRegion const): 14 * UIProcess/RemoteLayerTree/RemoteLayerTreeNode.mm: 15 (WebKit::RemoteLayerTreeNode::setEventRegion): 16 * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp: 17 (WebKit::PlatformCALayerRemote::setEventRegion): 18 * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.h: 19 1 20 2019-04-05 Yongjun Zhang <yongjun_zhang@apple.com> 2 21 -
trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h
r243460 r243962 171 171 bool contentsHidden; 172 172 bool userInteractionEnabled; 173 WebCore:: Region eventRegion;173 WebCore::EventRegion eventRegion; 174 174 }; 175 175 -
trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm
r243460 r243962 32 32 #import "WebCoreArgumentCoders.h" 33 33 #import <QuartzCore/QuartzCore.h> 34 #import <WebCore/EventRegion.h> 34 35 #import <WebCore/LengthFunctions.h> 35 #import <WebCore/Region.h>36 36 #import <WebCore/TimingFunction.h> 37 37 #import <wtf/text/CString.h> … … 509 509 510 510 if (result.changedProperties & EventRegionChanged) { 511 Optional<WebCore:: Region> eventRegion;511 Optional<WebCore::EventRegion> eventRegion; 512 512 decoder >> eventRegion; 513 513 if (!eventRegion) -
trunk/Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeNode.h
r243380 r243962 57 57 WebCore::GraphicsLayer::PlatformLayerID layerID() const { return m_layerID; } 58 58 59 const WebCore:: Region& eventRegion() const { return m_eventRegion; }60 void setEventRegion(const WebCore:: Region&);59 const WebCore::EventRegion& eventRegion() const { return m_eventRegion; } 60 void setEventRegion(const WebCore::EventRegion&); 61 61 62 62 // If empty the layer is scrolled normally by an ancestor scroller. … … 82 82 #endif 83 83 84 WebCore:: Region m_eventRegion;84 WebCore::EventRegion m_eventRegion; 85 85 86 86 Vector<WebCore::GraphicsLayer::PlatformLayerID> m_relatedScrollContainerIDs; -
trunk/Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeNode.mm
r243380 r243962 88 88 } 89 89 90 void RemoteLayerTreeNode::setEventRegion(const WebCore:: Region& eventRegion)90 void RemoteLayerTreeNode::setEventRegion(const WebCore::EventRegion& eventRegion) 91 91 { 92 92 m_eventRegion = eventRegion; -
trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp
r243007 r243962 33 33 #import "RemoteLayerTreePropertyApplier.h" 34 34 #import <WebCore/AnimationUtilities.h> 35 #import <WebCore/EventRegion.h> 35 36 #import <WebCore/GraphicsContext.h> 36 37 #import <WebCore/GraphicsLayerCA.h> … … 872 873 } 873 874 874 void PlatformCALayerRemote::setEventRegion(const WebCore:: Region& eventRegion)875 void PlatformCALayerRemote::setEventRegion(const WebCore::EventRegion& eventRegion) 875 876 { 876 877 if (m_properties.eventRegion == eventRegion) -
trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.h
r243007 r243962 175 175 void updateCustomAppearance(WebCore::GraphicsLayer::CustomAppearance) override; 176 176 177 void setEventRegion(const WebCore:: Region&) override;177 void setEventRegion(const WebCore::EventRegion&) override; 178 178 179 179 WebCore::GraphicsLayer::EmbeddedViewID embeddedViewID() const override;
Note:
See TracChangeset
for help on using the changeset viewer.