Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge r180643 - Horizontal and vertical lines are clipped completely …
…if clip-path is included in the tag but the referenced element is defined later. https://bugs.webkit.org/show_bug.cgi?id=141776. Reviewed by Dean Jackson. Source/WebCore: Tests: svg/clip-path/clip-path-line-use-before-defined-expected.svg svg/clip-path/clip-path-line-use-before-defined.svg * rendering/svg/RenderSVGResourceClipper.cpp: (WebCore::RenderSVGResourceClipper::applyClippingToContext): Ensure the renderer is added to m_clipper if it does not exist. The same renderer might have been added to m_clipper in resourceBoundingBox(). (WebCore::RenderSVGResourceClipper::addRendererToClipper): Add the renderer to m_clipper if it does not exist. Return the associated ClipperData. (WebCore::RenderSVGResourceClipper::resourceBoundingBox): If the clipper is referenced before it is defined, add the renderer to m_clipper. While doing the layout() for the clipper, we can check if m_clipper has values or not. If it does have, we are going to mark the clipper for client invalidation which is done by the SVG root. * rendering/svg/RenderSVGResourceClipper.h: * rendering/svg/RenderSVGResourceContainer.h: (WebCore::RenderSVGResourceContainer::selfNeedsClientInvalidation): Define a new function selfNeedsClientInvalidation() which controls marking the clipper for client invalidation. In RenderSVGResourceClipper, override it so it checks m_clipper to force clients validation even if it the first time we do layout for this clipper. * rendering/svg/RenderSVGResourceContainer.cpp: (WebCore::RenderSVGResourceContainer::layout): Call the virtual function selfNeedsClientInvalidation() to check whether we need to mark the clipper for client invalidation. * svg/SVGElement.cpp: Delete unneeded header file. LayoutTests: New test cases for SVG lines which are clipped to a <clipPath>. The <clipPath> is referenced before it is defined. * svg/clip-path/clip-path-line-use-before-defined-expected.svg: Added. * svg/clip-path/clip-path-line-use-before-defined.svg: Added.
- Loading branch information
1 parent
8f6278a
commit cb51fa6
Showing
9 changed files
with
211 additions
and
33 deletions.
There are no files selected for viewing
This file contains 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
44 changes: 44 additions & 0 deletions
44
LayoutTests/svg/clip-path/clip-path-line-use-before-defined-expected.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 46 additions & 0 deletions
46
LayoutTests/svg/clip-path/clip-path-line-use-before-defined.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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