https://codereview.chromium.org/1154853007/diff/20001/Source/core/layout/svg/LayoutSVGResourceClipper.cpp File Source/core/layout/svg/LayoutSVGResourceClipper.cpp (right): https://codereview.chromium.org/1154853007/diff/20001/Source/core/layout/svg/LayoutSVGResourceClipper.cpp#newcode87 Source/core/layout/svg/LayoutSVGResourceClipper.cpp:87: SVGGeometryElement* styled = toSVGGeometryElement(childElement); Because this element can be ...
4 years, 10 months ago
(2015-06-09 05:15:59 UTC)
#4
https://codereview.chromium.org/1154853007/diff/20001/Source/core/layout/svg/...
File Source/core/layout/svg/LayoutSVGResourceClipper.cpp (right):
https://codereview.chromium.org/1154853007/diff/20001/Source/core/layout/svg/...
Source/core/layout/svg/LayoutSVGResourceClipper.cpp:87: SVGGeometryElement*
styled = toSVGGeometryElement(childElement);
Because this element can be an SVGUseElement, we'll need to leave this as
toSVGGraphicsElement. We can rename styled to something better though, such as
childGraphicsElement.
https://codereview.chromium.org/1154853007/diff/20001/Source/core/svg/SVGUseE...
File Source/core/svg/SVGUseElement.h (right):
https://codereview.chromium.org/1154853007/diff/20001/Source/core/svg/SVGUseE...
Source/core/svg/SVGUseElement.h:47: SVGGeometryElement*
layoutObjectClipChild(Path&) const;
Sadness... the original code is worse than I expected and has real bugs. This
may require many patches and I understand if you'd like to work on something
else. If you're up for it, I'll sketch out a good first patch below:
SVGClipPainter::applyClippingToContext has two "modes":
1) A "path-only" approach (tryPathOnlyClipping) which calls
SVGUseElement::toClipPath
2) A mask approach (drawClipMaskContent) which ends up calling
SVGUseElement::layoutObjectClipChild
Our goal is to unify these so they use the same code. The following might be a
good design:
const SVGGraphicsElement* SVGUseElement::targetGraphicsElementForClipping();
You should write a comment in the header file describing what we are returning
and why. You may want to reference the spec, particularly this part: "If a <use>
element is a child of a clipPath element, it must directly reference <path>,
<text> or basic shapes elements." You probably want to actually check for the
allowed references too... something like isSVGTextElement() || isSVGTSpanElement
|| isSVGGeometryElement. You may also want to mention how we will return null if
an allowed element is not available.
Lets leave SVGUseElement::toClipPath for now, but make it non-virtual. Also
change the implementation to call our new targetGraphicsElementForClipping
function, but make sure to check isSVGGeometryElement because path-only clipping
doesn't work for text.
hyunjunekim2
Thank you for your advice. https://codereview.chromium.org/1154853007/diff/20001/Source/core/layout/svg/LayoutSVGResourceClipper.cpp File Source/core/layout/svg/LayoutSVGResourceClipper.cpp (right): https://codereview.chromium.org/1154853007/diff/20001/Source/core/layout/svg/LayoutSVGResourceClipper.cpp#newcode87 Source/core/layout/svg/LayoutSVGResourceClipper.cpp:87: SVGGeometryElement* styled = toSVGGeometryElement(childElement); ...
4 years, 10 months ago
(2015-06-10 14:00:42 UTC)
#5
4 years, 10 months ago
(2015-06-19 14:35:31 UTC)
#8
pdr,
Could you check PS14? Thank you.
fs
https://codereview.chromium.org/1154853007/diff/240001/Source/core/layout/svg/LayoutSVGResourceClipper.cpp File Source/core/layout/svg/LayoutSVGResourceClipper.cpp (right): https://codereview.chromium.org/1154853007/diff/240001/Source/core/layout/svg/LayoutSVGResourceClipper.cpp#newcode90 Source/core/layout/svg/LayoutSVGResourceClipper.cpp:90: SVGGraphicsElement* styled = toSVGGraphicsElement(childElement); Could drop this variable, and ...
4 years, 10 months ago
(2015-06-22 10:57:44 UTC)
#9
Issue 1154853007: Move toClipPath to SVGGeometryElement.
(Closed)
Created 4 years, 11 months ago by hyunjunekim2
Modified 4 years, 10 months ago
Reviewers: pdr., f(malita), fs
Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Comments: 13