Event region computation should respect transforms
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 14 May 2019 18:28:11 +0000 (18:28 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 14 May 2019 18:28:11 +0000 (18:28 +0000)
commit2a0acd3ee564dea411771bf3ceb71662961ca48f
tree321dc1cb66faa759aa763a1899e2621c15949533
parent81f80973384c475fb843e6588ef7d56f51ce1721
Event region computation should respect transforms
https://bugs.webkit.org/show_bug.cgi?id=197836
<rdar://problem/50762971>

Reviewed by Darin Adler.

Source/WebCore:

* platform/graphics/transforms/AffineTransform.cpp:
(WebCore::AffineTransform::mapRegion const):

Add support for transforming regions. Non-rectlinear results use enclosing rects.

* platform/graphics/transforms/AffineTransform.h:
* rendering/EventRegion.cpp:
(WebCore::EventRegionContext::EventRegionContext):
(WebCore::EventRegionContext::pushTransform):
(WebCore::EventRegionContext::popTransform):
(WebCore::EventRegionContext::unite):
(WebCore::EventRegionContext::contains const):

Add a context object that holds the current transform.

* rendering/EventRegion.h:
(WebCore::EventRegion::makeContext):
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paint):
* rendering/PaintInfo.h:

Replace the region object with the context.

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::paintObject):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::paintLayerByApplyingTransform):

Apply transforms to regions if needed.

(WebCore::RenderLayer::collectEventRegionForFragments):
* rendering/RenderLayer.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateEventRegion):
* rendering/SimpleLineLayoutFunctions.cpp:
(WebCore::SimpleLineLayout::paintFlow):

LayoutTests:

* fast/scrolling/ios/event-region-scale-transform-shared-expected.txt:
* fast/scrolling/ios/event-region-translate-transform-shared-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@245293 268f45cc-cd09-0410-ab3c-d52691b4dbfc
15 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/scrolling/ios/event-region-scale-transform-shared-expected.txt
LayoutTests/fast/scrolling/ios/event-region-translate-transform-shared-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/transforms/AffineTransform.cpp
Source/WebCore/platform/graphics/transforms/AffineTransform.h
Source/WebCore/rendering/EventRegion.cpp
Source/WebCore/rendering/EventRegion.h
Source/WebCore/rendering/InlineTextBox.cpp
Source/WebCore/rendering/PaintInfo.h
Source/WebCore/rendering/RenderBlock.cpp
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/RenderLayer.h
Source/WebCore/rendering/RenderLayerBacking.cpp
Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp