diff --git a/shadow-dom/declarative/gethtml.tentative.html b/shadow-dom/declarative/gethtml.tentative.html
new file mode 100644
index 00000000000000..5b517ba9f5cadd
--- /dev/null
+++ b/shadow-dom/declarative/gethtml.tentative.html
@@ -0,0 +1,101 @@
+
+
getHTML behavior
+
+
+
+
+
+
+
+
+
diff --git a/shadow-dom/declarative/getinnerhtml.tentative.html b/shadow-dom/declarative/getinnerhtml.tentative.html
index ad7734d51e692f..139cba2a517f66 100644
--- a/shadow-dom/declarative/getinnerhtml.tentative.html
+++ b/shadow-dom/declarative/getinnerhtml.tentative.html
@@ -31,6 +31,7 @@
const delegatesAttr = delegatesFocus ? ' shadowrootdelegatesfocus=""' : '';
const correctShadowHtml = ``;
const correctHtml = `<${elementType}>${correctShadowHtml}${elementType}>`;
+ const emptyElement = `<${elementType}>${elementType}>`;
const shadowRoot = element.attachShadow({mode: mode, delegatesFocus: delegatesFocus});
shadowRoot.appendChild(document.createElement('slot'));
if (isOpen) {
@@ -38,11 +39,12 @@
assert_equals(wrapper.getInnerHTML(),correctHtml,'The default for includeShadowRoots should be true');
} else {
// Closed shadow roots should not be returned unless closedRoots contains the shadow root:
- const emptyElement = `<${elementType}>${elementType}>`;
assert_equals(wrapper.getInnerHTML({includeShadowRoots: true}), emptyElement);
assert_equals(wrapper.getInnerHTML({includeShadowRoots: true, closedRoots: []}), emptyElement);
}
assert_equals(wrapper.getInnerHTML({includeShadowRoots: true, closedRoots: [shadowRoot]}),correctHtml);
+ // ClosedRoots are not included if includeShadowRoots is false:
+ assert_equals(wrapper.getInnerHTML({includeShadowRoots: false, closedRoots: [shadowRoot]}),emptyElement);
} else {
// For non-shadow hosts, getInnerHTML() should also match .innerHTML
assert_equals(wrapper.getInnerHTML({includeShadowRoots: true}),wrapper.innerHTML);