Changeset 248604 in webkit
- Timestamp:
- Aug 13, 2019 12:26:22 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r248602 r248604 1 2019-08-13 Antti Koivisto <antti@apple.com> 2 3 Event regions collection should take clipping into account 4 https://bugs.webkit.org/show_bug.cgi?id=200668 5 <rdar://problem/53826561> 6 7 Reviewed by Simon Fraser. 8 9 * pointerevents/ios/touch-action-region-clip-and-transform-expected.txt: Added. 10 * pointerevents/ios/touch-action-region-clip-and-transform.html: Added. 11 1 12 2019-08-13 Devin Rousso <drousso@apple.com> 2 13 -
trunk/Source/WebCore/ChangeLog
r248602 r248604 1 2019-08-13 Antti Koivisto <antti@apple.com> 2 3 Event region collection should take clipping into account 4 https://bugs.webkit.org/show_bug.cgi?id=200668 5 <rdar://problem/53826561> 6 7 Reviewed by Simon Fraser. 8 9 Test: pointerevents/ios/touch-action-region-clip-and-transform.html 10 11 * rendering/EventRegion.cpp: 12 (WebCore::EventRegionContext::pushClip): 13 (WebCore::EventRegionContext::popClip): 14 15 Maintain clip rect stack. 16 17 (WebCore::EventRegionContext::unite): 18 19 Apply both transforms and clipping. 20 21 * rendering/EventRegion.h: 22 * rendering/RenderBlock.cpp: 23 * rendering/RenderBox.cpp: 24 (WebCore::RenderBox::pushContentsClip): 25 (WebCore::RenderBox::popContentsClip): 26 27 Update clip for non-self-painting layers. 28 29 * rendering/RenderLayer.cpp: 30 (WebCore::RenderLayer::clipToRect): 31 (WebCore::RenderLayer::restoreClip): 32 33 Update clip for self-painting layers. 34 1 35 2019-08-13 Devin Rousso <drousso@apple.com> 2 36 -
trunk/Source/WebCore/rendering/EventRegion.cpp
r246301 r248604 46 46 void EventRegionContext::popTransform() 47 47 { 48 if (m_transformStack.isEmpty()) { 49 ASSERT_NOT_REACHED(); 50 return; 51 } 48 52 m_transformStack.removeLast(); 49 53 } 50 54 55 void EventRegionContext::pushClip(const IntRect& clipRect) 56 { 57 auto transformedClip = m_transformStack.isEmpty() ? clipRect : m_transformStack.last().mapRect(clipRect); 58 59 if (m_clipStack.isEmpty()) 60 m_clipStack.append(transformedClip); 61 else 62 m_clipStack.append(intersection(m_clipStack.last(), transformedClip)); 63 } 64 65 void EventRegionContext::popClip() 66 { 67 if (m_clipStack.isEmpty()) { 68 ASSERT_NOT_REACHED(); 69 return; 70 } 71 m_clipStack.removeLast(); 72 } 73 51 74 void EventRegionContext::unite(const Region& region, const RenderStyle& style) 52 75 { 53 if (m_transformStack.isEmpty() )76 if (m_transformStack.isEmpty() && m_clipStack.isEmpty()) { 54 77 m_eventRegion.unite(region, style); 55 else 56 m_eventRegion.unite(m_transformStack.last().mapRegion(region), style); 78 return; 79 } 80 81 auto transformedAndClippedRegion = m_transformStack.isEmpty() ? region : m_transformStack.last().mapRegion(region); 82 83 if (!m_clipStack.isEmpty()) 84 transformedAndClippedRegion.intersect(m_clipStack.last()); 85 86 m_eventRegion.unite(transformedAndClippedRegion, style); 57 87 } 58 88 -
trunk/Source/WebCore/rendering/EventRegion.h
r246301 r248604 44 44 void popTransform(); 45 45 46 void pushClip(const IntRect&); 47 void popClip(); 48 46 49 void unite(const Region&, const RenderStyle&); 47 50 bool contains(const IntRect&) const; … … 50 53 EventRegion& m_eventRegion; 51 54 Vector<AffineTransform> m_transformStack; 55 Vector<IntRect> m_clipStack; 52 56 }; 53 57 -
trunk/Source/WebCore/rendering/RenderBox.cpp
r247256 r248604 1805 1805 paintInfo.context().clipRoundedRect(style().getRoundedInnerBorderFor(LayoutRect(accumulatedOffset, size())).pixelSnappedRoundedRectForPainting(deviceScaleFactor)); 1806 1806 paintInfo.context().clip(clipRect); 1807 1808 if (paintInfo.phase == PaintPhase::EventRegion) 1809 paintInfo.eventRegionContext->pushClip(enclosingIntRect(clipRect)); 1810 1807 1811 return true; 1808 1812 } … … 1811 1815 { 1812 1816 ASSERT(hasControlClip() || (hasOverflowClip() && !layer()->isSelfPaintingLayer())); 1817 1818 if (paintInfo.phase == PaintPhase::EventRegion) 1819 paintInfo.eventRegionContext->popClip(); 1813 1820 1814 1821 paintInfo.context().restore(); -
trunk/Source/WebCore/rendering/RenderLayer.cpp
r247912 r248604 4011 4011 LayoutRect adjustedClipRect = clipRect.rect(); 4012 4012 adjustedClipRect.move(paintingInfo.subpixelOffset); 4013 context.clip(snapRectToDevicePixels(adjustedClipRect, deviceScaleFactor)); 4013 auto snappedClipRect = snapRectToDevicePixels(adjustedClipRect, deviceScaleFactor); 4014 context.clip(snappedClipRect); 4015 4016 if (paintingInfo.eventRegionContext) 4017 paintingInfo.eventRegionContext->pushClip(enclosingIntRect(snappedClipRect)); 4014 4018 } 4015 4019 … … 4037 4041 void RenderLayer::restoreClip(GraphicsContext& context, const LayerPaintingInfo& paintingInfo, const ClipRect& clipRect) 4038 4042 { 4039 if ((!clipRect.isInfinite() && clipRect.rect() != paintingInfo.paintDirtyRect) || clipRect.affectedByRadius()) 4043 if ((!clipRect.isInfinite() && clipRect.rect() != paintingInfo.paintDirtyRect) || clipRect.affectedByRadius()) { 4040 4044 context.restore(); 4045 4046 if (paintingInfo.eventRegionContext) 4047 paintingInfo.eventRegionContext->popClip(); 4048 } 4041 4049 } 4042 4050
Note: See TracChangeset
for help on using the changeset viewer.