Bug 1651218 [wpt PR 24500] - Serialize delegatesFocus in getInnerHTML(), a=testonly

Automatic update from web-platform-tests
Serialize delegatesFocus in getInnerHTML()

Prior to this CL, the getInnerHTML() call with includeShadowRoots=true
would not return markup with the shadowrootdelegatesfocus attribute.
Now, it does, and testing has been added to verify this behavior.

Bug: 1042130
Change-Id: Ibd859af110328b965e4c9a0074095a5a1e5251b3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2285288
Commit-Queue: Mason Freed <masonfreed@chromium.org>
Auto-Submit: Mason Freed <masonfreed@chromium.org>
Reviewed-by: Kouhei Ueno <kouhei@chromium.org>
Cr-Commit-Position: refs/heads/master@{#786393}

--

wpt-commits: e4a45e87eb85d4659b3c4d98340cc0befa901858
wpt-pr: 24500
This commit is contained in:
Mason Freed 2020-07-09 14:18:46 +00:00 коммит произвёл moz-wptsync-bot
Родитель 760b286776
Коммит 7947adb06f
2 изменённых файлов: 3 добавлений и 1 удалений

Просмотреть файл

@ -38,6 +38,7 @@ function testElementType(allowed, nochildren, elementType, mode, delegatesFocus)
// TODO(masonfreed): Add a check for ElementInternals.shadowRoot once that exists. // TODO(masonfreed): Add a check for ElementInternals.shadowRoot once that exists.
assert_true(!!element.shadowRoot, 'Shadow root should be present'); assert_true(!!element.shadowRoot, 'Shadow root should be present');
assert_equals(element.shadowRoot.innerHTML, shadowContent, 'Correct shadow content'); assert_equals(element.shadowRoot.innerHTML, shadowContent, 'Correct shadow content');
assert_equals(element.shadowRoot.delegatesFocus,delegatesFocus,'Correct delegatesFocus')
originalShadowRoot = element.shadowRoot; originalShadowRoot = element.shadowRoot;
} }

Просмотреть файл

@ -20,7 +20,8 @@ function testElementType(allowsShadowDom, elementType, mode, delegatesFocus) {
const isOpen = mode === 'open'; const isOpen = mode === 'open';
if (allowsShadowDom) { if (allowsShadowDom) {
const correctShadowHtml = `<template shadowroot="${mode}"><slot></slot></template>`; const delegatesAttr = delegatesFocus ? ' shadowrootdelegatesfocus=""' : '';
const correctShadowHtml = `<template shadowroot="${mode}"${delegatesAttr}><slot></slot></template>`;
const correctHtml = `<${elementType}>${correctShadowHtml}</${elementType}>`; const correctHtml = `<${elementType}>${correctShadowHtml}</${elementType}>`;
const shadowRoot = element.attachShadow({mode: mode, delegatesFocus: delegatesFocus}); const shadowRoot = element.attachShadow({mode: mode, delegatesFocus: delegatesFocus});
shadowRoot.appendChild(document.createElement('slot')); shadowRoot.appendChild(document.createElement('slot'));