haikuwebkit/LayoutTests/svg/clip-path/clip-path-line-use-before-d...

47 lines
1.5 KiB
XML
Raw Permalink Normal View History

<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
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. Canonical link: https://commits.webkit.org/160055@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@180643 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-02-25 23:05:20 +00:00
<defs>
<style>
line, path {
stroke: black;
stroke-width: 3;
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. Canonical link: https://commits.webkit.org/160055@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@180643 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-02-25 23:05:20 +00:00
}
</style>
<g id="circle-in-rect">
<rect x="0" y="0" width="150" height="150" fill="lime"/>
<rect x="0" y="0" width="150" height="150" fill="white" clip-path="url(#clip-circle)"/>
</g>
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. Canonical link: https://commits.webkit.org/160055@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@180643 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-02-25 23:05:20 +00:00
</defs>
<use xlink:href="#circle-in-rect" transform="translate(10, 10)">
<!-- center lines -->
<path d="M0 75 L150 75" clip-path="url(#clip-circle)"/>
<line x1="75" y1="0" x2="75" y2="150" clip-path="url(#clip-circle)"/>
</use>
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. Canonical link: https://commits.webkit.org/160055@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@180643 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-02-25 23:05:20 +00:00
<use xlink:href="#circle-in-rect" transform="translate(170, 10)">
<!-- diagonal lines -->
<path d="M0 0 L150 150" clip-path="url(#clip-circle)"/>
<line x1="0" y1="150" x2="150" y2="0" clip-path="url(#clip-circle)"/>
</use>
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. Canonical link: https://commits.webkit.org/160055@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@180643 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-02-25 23:05:20 +00:00
<use xlink:href="#circle-in-rect" transform="translate(330, 10)">
<!-- top and left lines -->
<path d="M0 50 L150 50" clip-path="url(#clip-circle)"/>
<line x1="50" y1="0" x2="50" y2="150" clip-path="url(#clip-circle)"/>
<g clip-path="url(#clip-circle)">
<!-- bottom and right lines -->
<path d="M0 100 L150 100"/>
<line x1="100" y1="0" x2="100" y2="150"/>
</g>
</use>
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. Canonical link: https://commits.webkit.org/160055@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@180643 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-02-25 23:05:20 +00:00
<defs>
<clipPath id="clip-circle">
<circle cx="75" cy="75" r="75" clip-path="url(#clip-small-circle)"/>
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. Canonical link: https://commits.webkit.org/160055@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@180643 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-02-25 23:05:20 +00:00
</clipPath>
<clipPath id="clip-small-circle">
<circle cx="75" cy="75" r="50"/>
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. Canonical link: https://commits.webkit.org/160055@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@180643 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-02-25 23:05:20 +00:00
</clipPath>
</defs>
</svg>