forked from LadybirdBrowser/ladybird
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LibWeb: Use right interface for custom SVG and MathML elements
The DOM spec gets overridden by both the SVG2 and MathML core specs in that unknown elements should not inherit DOM::Element, but SVG::SVGElement and MathML::MathMLElement respectively.
- Loading branch information
Showing
3 changed files
with
34 additions
and
17 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
Tests/LibWeb/Text/expected/DOM/Document-createElementNS-custom.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Element nodeName: FOO namespaceURI: http://www.w3.org/1999/xhtml __proto__: [object HTMLUnknownElement] | ||
Element nodeName: foo namespaceURI: http://www.w3.org/2000/svg __proto__: [object SVGElement] | ||
Element nodeName: foo namespaceURI: http://www.w3.org/1998/Math/MathML __proto__: [object MathMLElement] |
13 changes: 13 additions & 0 deletions
13
Tests/LibWeb/Text/input/DOM/Document-createElementNS-custom.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!doctype html> | ||
<script src="../include.js"></script> | ||
<script> | ||
test(() => { | ||
const printElement = (element) => { | ||
println(`Element nodeName: ${element.nodeName} namespaceURI: ${element.namespaceURI} __proto__: ${element.__proto__}`); | ||
}; | ||
|
||
printElement(document.createElementNS('http://www.w3.org/1999/xhtml', 'foo')); | ||
printElement(document.createElementNS('http://www.w3.org/2000/svg', 'foo')); | ||
printElement(document.createElementNS('http://www.w3.org/1998/Math/MathML', 'foo')); | ||
}); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters