Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 16668679e31ce64c7c8cee5d7d64e2c4b7587400
https://github.com/WebKit/WebKit/commit/16668679e31ce64c7c8cee5d7d64e2c4b7587400
Author: Etienne Segonzac <[email protected]>
Date: 2024-06-09 (Sun, 09 Jun 2024)
Changed paths:
A LayoutTests/interaction-region/svg-luminance-expected.txt
A LayoutTests/interaction-region/svg-luminance.html
M Source/WebCore/page/InteractionRegion.cpp
M Source/WebCore/rendering/EventRegion.cpp
M Source/WebCore/rendering/EventRegion.h
M Source/WebCore/rendering/RenderLayerBacking.cpp
M Source/WebCore/rendering/RenderLayerCompositor.cpp
Log Message:
-----------
[InteractionRegions] Highlight container instead of shape when it can improve
visibility
https://bugs.webkit.org/show_bug.cgi?id=275208
<rdar://128509643>
Reviewed by Simon Fraser.
Detect cases where the highlight doesn't work well (small shapes with
very high or very low luminance) and fallback to highlighting their
containers instead.
In order to do so we go over Guards and convert them to Interactions if
the Interaction they're guarding doesn't exist.
* Source/WebCore/page/InteractionRegion.cpp:
(WebCore::usesFillColorWithExtremeLuminance):
New function to detect fill colors that won't work well.
(WebCore::interactionRegionForRenderedRegion):
Don't generate an Interaction when it won't be visible enough and a
container is available.
* Source/WebCore/rendering/EventRegion.h:
* Source/WebCore/rendering/EventRegion.cpp:
(WebCore::EventRegionContext::convertGuardContainersToInterationIfNeeded):
New method to convert Guards to Interactions when needed. It needs to
know the minimum corner radius to apply it.
Guards containers have "transparent" style so it's always safe to add.
(WebCore::EventRegionContext::copyInteractionRegionsToEventRegion):
Call the new method.
* Source/WebCore/rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateEventRegion):
* Source/WebCore/rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateScrollLayerClipping):
Pass the minimum corner radius setting down.
* LayoutTests/interaction-region/svg-luminance-expected.txt: Added.
* LayoutTests/interaction-region/svg-luminance.html: Added.
Add new tests to cover this change.
Canonical link: https://commits.webkit.org/279859@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes