Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The InteractionRegion layers' order should match the paint order #11332

Merged
merged 1 commit into from Mar 13, 2023

Conversation

etiennesegonzac
Copy link
Contributor

@etiennesegonzac etiennesegonzac commented Mar 9, 2023

c370b1b

The InteractionRegion layers' order should match the paint order
https://bugs.webkit.org/show_bug.cgi?id=253678
<rdar://105700167>

Reviewed by Tim Horton.

Propagate the Interaction Regions creation's order (which matches the
paint order) all the way to the RemoteLayerTree.
The content process is now in charge of ordering/deduping the regions.
And we don't do per-element region uniting anymore.

* Source/WebCore/rendering/EventRegion.h:
Remove the InteractionRegionByElement HashMap.
Add HashSets to dedupe regions by bounds.
* Source/WebCore/rendering/EventRegion.cpp:
(WebCore::EventRegionContext::uniteInteractionRegions):
(WebCore::EventRegionContext::copyInteractionRegionsToEventRegion):
Use a vector to accumulate interaction regions in order.
Prevent duplicated bounds.
(WebCore::EventRegion::dump const):
Remove the test-only ordering code so existing tests cover the actual order.

* Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeInteractionRegionLayers.mm:
(WebKit::insertInteractionRegionLayersForLayer):
Break when the first non-InteractionRegion-layer is encountered.
(They always come first.)
(WebKit::updateLayersForInteractionRegions):
Update the sublayers while maintaining the order we get from the event
region. Reuse existing layers when the bounds match.

* LayoutTests/interaction-region/overlap-expected.txt: Added.
* LayoutTests/interaction-region/overlap.html: Added.
Add a test covering the content-side deduplication.
* LayoutTests/interaction-region/split-inline-link-expected.txt:
* LayoutTests/interaction-region/wrapped-inline-link-expected.txt:
Update test after the per-element uniting removal.

Canonical link: https://commits.webkit.org/261578@main

d62cfd6

Misc iOS, tvOS & watchOS macOS Linux Windows
βœ… πŸ§ͺ style βœ… πŸ›  ios βœ… πŸ›  mac βœ… πŸ›  wpe βœ… πŸ›  wincairo
βœ… πŸ§ͺ bindings βœ… πŸ›  ios-sim βœ… πŸ›  mac-AS-debug βœ… πŸ§ͺ wpe-wk2
βœ… πŸ§ͺ webkitperl βœ… πŸ§ͺ ios-wk2 βœ… πŸ§ͺ api-mac βœ… πŸ›  gtk
βœ… πŸ§ͺ api-ios βœ… πŸ§ͺ mac-wk1 βœ… πŸ§ͺ gtk-wk2
βœ… πŸ›  tv βœ… πŸ§ͺ mac-wk2   πŸ§ͺ api-gtk
βœ… πŸ›  tv-sim βœ… πŸ§ͺ mac-AS-debug-wk2
βœ… πŸ›  watch βœ… πŸ§ͺ mac-wk2-stress
βœ… πŸ›  πŸ§ͺ merge βœ… πŸ›  watch-sim

@etiennesegonzac etiennesegonzac self-assigned this Mar 9, 2023
@etiennesegonzac etiennesegonzac added the Layout and Rendering For bugs with layout and rendering of Web pages. label Mar 9, 2023
@etiennesegonzac etiennesegonzac added the merge-queue Applied to send a pull request to merge-queue label Mar 13, 2023
https://bugs.webkit.org/show_bug.cgi?id=253678
<rdar://105700167>

Reviewed by Tim Horton.

Propagate the Interaction Regions creation's order (which matches the
paint order) all the way to the RemoteLayerTree.
The content process is now in charge of ordering/deduping the regions.
And we don't do per-element region uniting anymore.

* Source/WebCore/rendering/EventRegion.h:
Remove the InteractionRegionByElement HashMap.
Add HashSets to dedupe regions by bounds.
* Source/WebCore/rendering/EventRegion.cpp:
(WebCore::EventRegionContext::uniteInteractionRegions):
(WebCore::EventRegionContext::copyInteractionRegionsToEventRegion):
Use a vector to accumulate interaction regions in order.
Prevent duplicated bounds.
(WebCore::EventRegion::dump const):
Remove the test-only ordering code so existing tests cover the actual order.

* Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeInteractionRegionLayers.mm:
(WebKit::insertInteractionRegionLayersForLayer):
Break when the first non-InteractionRegion-layer is encountered.
(They always come first.)
(WebKit::updateLayersForInteractionRegions):
Update the sublayers while maintaining the order we get from the event
region. Reuse existing layers when the bounds match.

* LayoutTests/interaction-region/overlap-expected.txt: Added.
* LayoutTests/interaction-region/overlap.html: Added.
Add a test covering the content-side deduplication.
* LayoutTests/interaction-region/split-inline-link-expected.txt:
* LayoutTests/interaction-region/wrapped-inline-link-expected.txt:
Update test after the per-element uniting removal.

Canonical link: https://commits.webkit.org/261578@main
@webkit-commit-queue
Copy link
Collaborator

Committed 261578@main (c370b1b): https://commits.webkit.org/261578@main

Reviewed commits have been landed. Closing PR #11332 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit c370b1b into WebKit:main Mar 13, 2023
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Mar 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Layout and Rendering For bugs with layout and rendering of Web pages.
Projects
None yet
4 participants