Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 414ef157946ae3c45b268c4d7040006d69288eba
      
https://github.com/WebKit/WebKit/commit/414ef157946ae3c45b268c4d7040006d69288eba
  Author: Etienne Segonzac <s...@apple.com>
  Date:   2024-04-17 (Wed, 17 Apr 2024)

  Changed paths:
    M LayoutTests/interaction-region/consolidated-nested-regions-expected.txt
    M LayoutTests/interaction-region/consolidated-nested-regions.html
    M Source/WebCore/page/InteractionRegion.cpp
    M Source/WebCore/page/InteractionRegion.h
    M Source/WebCore/rendering/EventRegion.cpp
    M Source/WebCore/rendering/EventRegion.h

  Log Message:
  -----------
  [InteractionRegions] Consolidation rules from 266230@main can cause false 
positive
https://bugs.webkit.org/show_bug.cgi?id=272592
<rdar://123918512>

Reviewed by Mike Wyrzykowski.

The new consolidation rule introduced in 266230@main was too eager and
caused some missing regions.

Instead of using the presence of hover styles + axis alignment as a
heuristic, we now look at the element that was matched.
When we find an enclosing ancestor with a region that shares the same
ElementIdentifier we can safely consolidate.

This new heuristic is simpler: no need to inspect hover styles.
And more reliable: regions sharing a ElementIdentifier would be
configured as a group anyway on the UI-side.

This change doesn't regress the original bug, but the test had to be
updated to use an enclosing `<button>` instead of a hover style.

* Source/WebCore/page/InteractionRegion.h:
* Source/WebCore/page/InteractionRegion.cpp:
(WebCore::elementMatchesHoverRules):
No need to expose `elementMatchesHoverRules` anymore.

* Source/WebCore/rendering/EventRegion.h:
* Source/WebCore/rendering/EventRegion.cpp:
(WebCore::EventRegionContext::uniteInteractionRegions):
Prevent regions with a custom ContentHint from being consolidated. We
would otherwise regress the content hint test.
(WebCore::EventRegionContext::shouldConsolidateInteractionRegion):
Update the consolidation rule.

* LayoutTests/interaction-region/consolidated-nested-regions-expected.txt:
* LayoutTests/interaction-region/consolidated-nested-regions.html:
Update the test to cover the new rule and the scenario that was
originally missed (sub links / buttons).

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to