mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-22 09:12:13 -05:00
LibWeb: Make SVGSVGElement.getElementById() return Element? (nullable)
This is wrong in the spec, and there's already a bug open.
This commit is contained in:
parent
8b097b38dd
commit
96e074b38f
Notes:
github-actions[bot]
2025-01-21 01:07:31 +00:00
Author: https://github.com/awesomekling Commit: https://github.com/LadybirdBrowser/ladybird/commit/96e074b38f4 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3329 Reviewed-by: https://github.com/gmta ✅
3 changed files with 11 additions and 1 deletions
|
@ -29,7 +29,8 @@ interface SVGSVGElement : SVGGraphicsElement {
|
||||||
SVGTransform createSVGTransform();
|
SVGTransform createSVGTransform();
|
||||||
[FIXME] SVGTransform createSVGTransformFromMatrix(optional DOMMatrix2DInit matrix = {});
|
[FIXME] SVGTransform createSVGTransformFromMatrix(optional DOMMatrix2DInit matrix = {});
|
||||||
|
|
||||||
Element getElementById(DOMString elementId);
|
// NOTE: The spec says this returns `Element` but that's a bug: https://github.com/w3c/svgwg/issues/923
|
||||||
|
Element? getElementById(DOMString elementId);
|
||||||
|
|
||||||
// Deprecated methods that have no effect when called,
|
// Deprecated methods that have no effect when called,
|
||||||
// but which are kept for compatibility reasons.
|
// but which are kept for compatibility reasons.
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
PASS: true
|
8
Tests/LibWeb/Text/input/SVG/svg-svg-getElementById.html
Normal file
8
Tests/LibWeb/Text/input/SVG/svg-svg-getElementById.html
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
<script src="../include.js"></script>
|
||||||
|
<svg id="svgRoot"></svg>
|
||||||
|
<script>
|
||||||
|
test(() => {
|
||||||
|
const x = svgRoot.getElementById("x");
|
||||||
|
println(`PASS: ${x === null}`);
|
||||||
|
});
|
||||||
|
</script>
|
Loading…
Reference in a new issue