diff --git a/Libraries/LibWeb/SVG/SVGUseElement.cpp b/Libraries/LibWeb/SVG/SVGUseElement.cpp index b012767c19c..49a426afcf2 100644 --- a/Libraries/LibWeb/SVG/SVGUseElement.cpp +++ b/Libraries/LibWeb/SVG/SVGUseElement.cpp @@ -36,8 +36,10 @@ void SVGUseElement::initialize(JS::Realm& realm) WEB_SET_PROTOTYPE_FOR_INTERFACE(SVGUseElement); Base::initialize(realm); - // The shadow tree is open (inspectable by script), but read-only. - auto shadow_root = realm.create(document(), *this, Bindings::ShadowRootMode::Open); + // NOTE: The spec says "The shadow tree is open (inspectable by script), but read-only." + // This doesn't actually match other browsers, and there's a spec issue to change it. + // Spec bug: https://github.com/w3c/svgwg/issues/875 + auto shadow_root = realm.create(document(), *this, Bindings::ShadowRootMode::Closed); // The user agent must create a use-element shadow tree whose host is the ‘use’ element itself set_shadow_root(shadow_root); diff --git a/Tests/LibWeb/Text/expected/SVG/use-shadowRoot-closed.txt b/Tests/LibWeb/Text/expected/SVG/use-shadowRoot-closed.txt new file mode 100644 index 00000000000..75acec5f8bd --- /dev/null +++ b/Tests/LibWeb/Text/expected/SVG/use-shadowRoot-closed.txt @@ -0,0 +1,2 @@ +null +[object ShadowRoot] diff --git a/Tests/LibWeb/Text/input/SVG/use-shadowRoot-closed.html b/Tests/LibWeb/Text/input/SVG/use-shadowRoot-closed.html new file mode 100644 index 00000000000..1894ded968b --- /dev/null +++ b/Tests/LibWeb/Text/input/SVG/use-shadowRoot-closed.html @@ -0,0 +1,10 @@ + + + + +