[webkit-changes] [WebKit/WebKit] 969122: Use the presence of hover styles as a signal for I...

Etienne Segonzac noreply at github.com
Sat Jul 22 11:08:36 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 969122115609f420b20ac90102f61e4e934a0af3
      https://github.com/WebKit/WebKit/commit/969122115609f420b20ac90102f61e4e934a0af3
  Author: Etienne Segonzac <sgz at apple.com>
  Date:   2023-07-22 (Sat, 22 Jul 2023)

  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

  Log Message:
  -----------
  Use the presence of hover styles as a signal for InteractionRegion consolidation
https://bugs.webkit.org/show_bug.cgi?id=259398
<rdar://111551476>

Reviewed by Tim Horton.

Relax the consolidation rule when the ancestor has hover styles, so
that "buttons" with child spans get a single InteractionRegion.

* Source/WebCore/page/InteractionRegion.h:
* Source/WebCore/page/InteractionRegion.cpp:
(WebCore::elementMatchesHoverRules):
Export `elementMatchesHoverRules`.

* Source/WebCore/rendering/EventRegion.cpp:
(WebCore::EventRegionContext::shouldConsolidateInteractionRegion):
Allow consolidation if the ancestor has hover rules and the element is
centered in either axis.

* LayoutTests/interaction-region/consolidated-nested-regions-expected.txt:
* LayoutTests/interaction-region/consolidated-nested-regions.html:
Add a test covering the change.

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




More information about the webkit-changes mailing list