mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 19:04:45 +00:00
Bug 1551137 - <svg:mpath> should work in Shadow DOM. r=longsonr
Differential Revision: https://phabricator.services.mozilla.com/D30894 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
4e4121ea80
commit
ab3478ba32
@ -77,7 +77,7 @@ nsresult SVGMPathElement::BindToTree(Document* aDocument, nsIContent* aParent,
|
|||||||
SVGMPathElementBase::BindToTree(aDocument, aParent, aBindingParent);
|
SVGMPathElementBase::BindToTree(aDocument, aParent, aBindingParent);
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
if (aDocument) {
|
if (IsInComposedDoc()) {
|
||||||
const nsAttrValue* hrefAttrValue =
|
const nsAttrValue* hrefAttrValue =
|
||||||
HasAttr(kNameSpaceID_None, nsGkAtoms::href)
|
HasAttr(kNameSpaceID_None, nsGkAtoms::href)
|
||||||
? mAttrs.GetAttr(nsGkAtoms::href, kNameSpaceID_None)
|
? mAttrs.GetAttr(nsGkAtoms::href, kNameSpaceID_None)
|
||||||
@ -103,7 +103,7 @@ bool SVGMPathElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute,
|
|||||||
aNamespaceID, aAttribute, aValue, aMaybeScriptedPrincipal, aResult);
|
aNamespaceID, aAttribute, aValue, aMaybeScriptedPrincipal, aResult);
|
||||||
if ((aNamespaceID == kNameSpaceID_XLink ||
|
if ((aNamespaceID == kNameSpaceID_XLink ||
|
||||||
aNamespaceID == kNameSpaceID_None) &&
|
aNamespaceID == kNameSpaceID_None) &&
|
||||||
aAttribute == nsGkAtoms::href && IsInUncomposedDoc()) {
|
aAttribute == nsGkAtoms::href && IsInComposedDoc()) {
|
||||||
// Note: If we fail the IsInDoc call, it's ok -- we'll update the target
|
// Note: If we fail the IsInDoc call, it's ok -- we'll update the target
|
||||||
// on next BindToTree call.
|
// on next BindToTree call.
|
||||||
|
|
||||||
|
@ -0,0 +1,34 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:xlink="http://www.w3.org/1999/xlink" class="reftest-wait">
|
||||||
|
<title>Test that pathLength works inside a shadow tree</title>
|
||||||
|
<defs>
|
||||||
|
<path id="path" pathLength="100" d="M0,0 h400" />
|
||||||
|
<g id="content">
|
||||||
|
<rect width="100%" height="100%" fill="lime"/>
|
||||||
|
|
||||||
|
<!-- calcMode="linear" -->
|
||||||
|
<rect x="10" y="10" width="100" height="100" fill="red"/>
|
||||||
|
<rect x="-190" y="10" width="100" height="100" fill="lime">
|
||||||
|
<animateMotion begin="100s" dur="1s" keyPoints="0;1" keyTimes="0;1" calcMode="linear">
|
||||||
|
<mpath xlink:href="#path" />
|
||||||
|
</animateMotion>
|
||||||
|
</rect>
|
||||||
|
|
||||||
|
<!-- calcMode="paced" -->
|
||||||
|
<rect x="10" y="110" width="100" height="100" fill="red"/>
|
||||||
|
<rect x="-190" y="110" width="100" height="100" fill="lime">
|
||||||
|
<animateMotion begin="100s" dur="1s">
|
||||||
|
<mpath xlink:href="#path" />
|
||||||
|
</animateMotion>
|
||||||
|
</rect>
|
||||||
|
</g>
|
||||||
|
</defs>
|
||||||
|
<script xlink:href="../smil-util.js" type="text/javascript"/>
|
||||||
|
<script type="text/javascript">
|
||||||
|
function doTest() {
|
||||||
|
setTimeAndSnapshot(100.5, true);
|
||||||
|
}
|
||||||
|
window.addEventListener("MozReftestInvalidate", doTest, false);
|
||||||
|
</script>
|
||||||
|
<use xlink:href="#content"></use>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 1.2 KiB |
@ -19,3 +19,4 @@ fuzzy-if(skiaContent,0-1,0-30) == animateMotion-values-paced-1b.svg animateMotio
|
|||||||
== animateMotion-mpath-pathLength-1.svg lime.svg
|
== animateMotion-mpath-pathLength-1.svg lime.svg
|
||||||
== animateMotion-mpath-targetChange-1.svg lime.svg
|
== animateMotion-mpath-targetChange-1.svg lime.svg
|
||||||
== animateMotion-mpath-target-transform-1.svg lime.svg
|
== animateMotion-mpath-target-transform-1.svg lime.svg
|
||||||
|
== animateMotion-mpath-shadow.svg lime.svg
|
||||||
|
Loading…
Reference in New Issue
Block a user