forked from LadybirdBrowser/ladybird
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LibWeb: Make
document.createElementNS()
case-sensitive
Previously, when creating a HTML element with `document.createElementNS()` we would convert the given local name to lowercase before deciding which element type to return. We now no longer perform this lower case conversion, so if an uppercase local name is provided, an element of type `HTMLUnknownElement` will be returned. This aligns our implementation with the specification. implementation with the specification.
- Loading branch information
Showing
3 changed files
with
84 additions
and
71 deletions.
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
Tests/LibWeb/Text/expected/DOM/Document-createElementNS-uppercase.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,2 @@ | ||
element named "DIV" is instance of HTMLUnknownElement: true | ||
element named "div" is instance of HTMLDivElement: true |
11 changes: 11 additions & 0 deletions
11
Tests/LibWeb/Text/input/DOM/Document-createElementNS-uppercase.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,11 @@ | ||
<!DOCTYPE html> | ||
<script src="../include.js"></script> | ||
<script> | ||
test(() => { | ||
const HTMLNS = "http://www.w3.org/1999/xhtml"; | ||
const uppercaseElement = document.createElementNS(HTMLNS, "DIV"); | ||
println(`element named "DIV" is instance of HTMLUnknownElement: ${uppercaseElement instanceof HTMLUnknownElement}`); | ||
const lowercaseElement = document.createElementNS(HTMLNS, "div"); | ||
println(`element named "div" is instance of HTMLDivElement: ${lowercaseElement instanceof HTMLDivElement}`); | ||
}); | ||
</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