Skip to content

Commit

Permalink
HTML parser: remove support for layer and nolayer
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=254915
rdar://107554605

Reviewed by Alexey Proskuryakov.

Matches the HTML Standard and Firefox.

* LayoutTests/fast/dom/wrapper-classes-expected.txt:
* LayoutTests/fast/dom/wrapper-classes.html:
* LayoutTests/imported/w3c/web-platform-tests/html/dom/elements/elements-in-the-dom/unknown-element-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/dom/elements/elements-in-the-dom/unknown-element.html:
* LayoutTests/imported/w3c/web-platform-tests/html/dom/historical-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/dom/historical.html:

Upstreamed via web-platform-tests/wpt#39332.

* Source/WebCore/html/HTMLTagNames.in:

Canonical link: https://commits.webkit.org/262553@main
  • Loading branch information
annevk authored and aproskuryakov committed Apr 4, 2023
1 parent 951180b commit 02fabda
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 19 deletions.
6 changes: 0 additions & 6 deletions LayoutTests/fast/dom/wrapper-classes-expected.txt
Expand Up @@ -317,9 +317,6 @@ PASS tagJSWrapperConstructorClass('keygen') is 'Function'
PASS tagJSWrapperClass('label') is 'HTMLLabelElement'
PASS tagJSWrapperPrototypeClass('label') is 'HTMLLabelElement'
PASS tagJSWrapperConstructorClass('label') is 'Function'
PASS tagJSWrapperClass('layer') is 'HTMLElement'
PASS tagJSWrapperPrototypeClass('layer') is 'HTMLElement'
PASS tagJSWrapperConstructorClass('layer') is 'Function'
PASS tagJSWrapperClass('legend') is 'HTMLLegendElement'
PASS tagJSWrapperPrototypeClass('legend') is 'HTMLLegendElement'
PASS tagJSWrapperConstructorClass('legend') is 'Function'
Expand Down Expand Up @@ -359,9 +356,6 @@ PASS tagJSWrapperConstructorClass('noembed') is 'Function'
PASS tagJSWrapperClass('noframes') is 'HTMLElement'
PASS tagJSWrapperPrototypeClass('noframes') is 'HTMLElement'
PASS tagJSWrapperConstructorClass('noframes') is 'Function'
PASS tagJSWrapperClass('nolayer') is 'HTMLElement'
PASS tagJSWrapperPrototypeClass('nolayer') is 'HTMLElement'
PASS tagJSWrapperConstructorClass('nolayer') is 'Function'
PASS tagJSWrapperClass('noscript') is 'HTMLElement'
PASS tagJSWrapperPrototypeClass('noscript') is 'HTMLElement'
PASS tagJSWrapperConstructorClass('noscript') is 'Function'
Expand Down
2 changes: 0 additions & 2 deletions LayoutTests/fast/dom/wrapper-classes.html
Expand Up @@ -196,7 +196,6 @@
testTag("kbd", "HTMLElement");
testTag("keygen", "HTMLUnknownElement");
testTag("label", "HTMLLabelElement");
testTag("layer", "HTMLElement");
testTag("legend", "HTMLLegendElement");
testTag("li", "HTMLLIElement");
testTag("link", "HTMLLinkElement");
Expand All @@ -210,7 +209,6 @@
testTag("nobr", "HTMLElement");
testTag("noembed", "HTMLElement");
testTag("noframes", "HTMLElement");
testTag("nolayer", "HTMLElement");
testTag("noscript", "HTMLElement");
testTag("object", "HTMLObjectElement");
testTag("ol", "HTMLOListElement");
Expand Down
@@ -1,3 +1,7 @@

PASS HTMLUnknownElement
PASS <applet> is an HTMLUnknownElement
PASS <attachment> is an HTMLUnknownElement
PASS <layer> is an HTMLUnknownElement
PASS <nolayer> is an HTMLUnknownElement
PASS <xxx> is an HTMLUnknownElement

Expand Up @@ -6,11 +6,17 @@
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
test(function() {
var elt = document.createElement("xxx");
assert_true(window.HTMLUnknownElement && elt instanceof HTMLUnknownElement,
"not an instance of HTMLUnknownElement");
assert_true(window.HTMLSpanElement && !(elt instanceof HTMLSpanElement),
"an instance of HTMLSpanElement");
[
"applet",
"attachment",
"layer",
"nolayer",
"xxx"
].forEach(name => {
test(() => {
const elt = document.createElement("xxx");
assert_true(window.HTMLUnknownElement && elt instanceof HTMLUnknownElement, "not an instance of HTMLUnknownElement");
assert_true(window.HTMLSpanElement && !(elt instanceof HTMLSpanElement), "an instance of HTMLSpanElement");
}, `<${name}> is an HTMLUnknownElement`);
});
</script>
@@ -1,5 +1,9 @@

PASS document.applets is always empty
PASS <attachment> is HTMLUnknownElement
PASS <applet> is HTMLUnknownElement
PASS <layer> is HTMLUnknownElement
PASS <nolayer> is HTMLUnknownElement
PASS HTMLAppletElement is no more
PASS document.all cannot find applet
PASS document cannot find applet
Expand Down
Expand Up @@ -3,16 +3,29 @@
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<div id=log></div>
<attachment></attachment>
<applet name=war align=left></applet>
<layer></layer>
<nolayer></nolayer>
<script>
test(() => {
assert_array_equals(document.applets, []);
}, "document.applets is always empty");

[
"attachment",
"applet",
"layer",
"nolayer"
].forEach(name => {
test(() => {
const ap = document.getElementsByTagName(name)[0];
assert_true(ap instanceof window.HTMLUnknownElement);
}, `<${name}> is HTMLUnknownElement`);
});

test(() => {
const ap = document.getElementsByTagName("applet")[0];
assert_equals(self.HTMLAppletElement, undefined);
assert_true(ap instanceof window.HTMLUnknownElement);
}, "HTMLAppletElement is no more")

test(() => {
Expand Down
2 changes: 0 additions & 2 deletions Source/WebCore/html/HTMLTagNames.in
Expand Up @@ -73,7 +73,6 @@ ins interfaceName=HTMLModElement
kbd interfaceName=HTMLElement
keygen interfaceName=HTMLUnknownElement
label
layer interfaceName=HTMLElement
legend
li interfaceName=HTMLLIElement
link constructorNeedsCreatedByParser
Expand All @@ -91,7 +90,6 @@ nav interfaceName=HTMLElement
nobr interfaceName=HTMLElement
noembed interfaceName=HTMLElement
noframes interfaceName=HTMLElement
nolayer interfaceName=HTMLElement
object constructorNeedsFormElement
ol interfaceName=HTMLOListElement
optgroup interfaceName=HTMLOptGroupElement
Expand Down

0 comments on commit 02fabda

Please sign in to comment.