Repository navigation
Conversation
…radius https://bugs.webkit.org/show_bug.cgi?id=328841 rdar://190954429 An outermost <svg> with border-radius is painted with rounded corners, but elementFromPoint() returns the <svg> for points in the cut-off corners. A <div> with the same size and border-radius returns its parent there. Chrome and Firefox return the parent for both. CSS Backgrounds says event handling follows the curves: other effects that clip painting or event handling to the border, padding, or content edge must clip to their respective curves. For example, [...] pointer events to the curved border edge, etc. https://drafts.csswg.org/css-backgrounds-3/#corner-clipping RenderBox::nodeAtPoint() and RenderBlock::nodeAtPoint() both call hitTestBorderRadius() before they record a hit on their own background. Both SVG root renderers replace nodeAtPoint() and only checked that the point is inside the border box rectangle. Add the same hitTestBorderRadius() check to the step that reports a hit on the <svg> element itself, in LegacyRenderSVGRoot and in RenderSVGRoot. SVG children are still tested first and are not affected by the root's border-radius, which matches what a <div> does. Test: imported/w3c/web-platform-tests/svg/interact/scripted/svg-root-border-radius.html * LayoutTests/imported/w3c/web-platform-tests/svg/interact/scripted/svg-root-border-radius-expected.txt: * Source/WebCore/rendering/svg/RenderSVGRoot.cpp: (WebCore::RenderSVGRoot::nodeAtPoint): * Source/WebCore/rendering/svg/legacy/LegacyRenderSVGRoot.cpp: (WebCore::LegacyRenderSVGRoot::nodeAtPoint):
Collaborator
|
EWS run on current version of this PR (hash b9e049c) Details
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🛠 mac-safer-cpp
b9e049c
b9e049c