Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 3991417995d368c11e163508d7fcaf80bdb231d4
      
https://github.com/WebKit/WebKit/commit/3991417995d368c11e163508d7fcaf80bdb231d4
  Author: Etienne Segonzac <s...@apple.com>
  Date:   2023-11-29 (Wed, 29 Nov 2023)

  Changed paths:
    A LayoutTests/interaction-region/guard-overlap-expected.txt
    A LayoutTests/interaction-region/guard-overlap.html
    M LayoutTests/interaction-region/wrapped-inline-link-expected.txt
    M Source/WebCore/rendering/EventRegion.cpp
    M Source/WebCore/rendering/EventRegion.h

  Log Message:
  -----------
  InteractionRegions: guards should not interfere with other regions
https://bugs.webkit.org/show_bug.cgi?id=265200
<rdar://115893635>

Reviewed by Tim Horton.

When multiple small links are laid out in close proximity, the "guards"
regions we generate end up hurting more than they help.

At the end of the InteractionRegion generation process, filter out guards
that overlap with other regions too much.

* Source/WebCore/rendering/EventRegion.h:
* Source/WebCore/rendering/EventRegion.cpp:
(WebCore::EventRegionContext::copyInteractionRegionsToEventRegion):
(WebCore::EventRegionContext::removeSuperfluousInteractionRegions):
Extract the final `removeAllMatching` pass on InteractionRegions to its
own method and add the guards filtering logic.
A guard shouldn't overlap with any interaction too much except:
- the interaction it is guarding
- any container interaction that fully contains the guard itself.
(WebCore::EventRegionContext::uniteInteractionRegions):
Stop adding guards for multi-rect regions. They are easily targetable as
a whole.

* LayoutTests/interaction-region/wrapped-inline-link-expected.txt:
Update expectations now that multi-rect regions don't get guards.
* LayoutTests/interaction-region/guard-overlap-expected.txt: Added.
* LayoutTests/interaction-region/guard-overlap.html: Added.
Add a new test covering the guards filtering logic.

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


_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to