зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
760b286776
Коммит
7947adb06f
|
@ -38,6 +38,7 @@ function testElementType(allowed, nochildren, elementType, mode, delegatesFocus)
|
|||
// TODO(masonfreed): Add a check for ElementInternals.shadowRoot once that exists.
|
||||
assert_true(!!element.shadowRoot, 'Shadow root should be present');
|
||||
assert_equals(element.shadowRoot.innerHTML, shadowContent, 'Correct shadow content');
|
||||
assert_equals(element.shadowRoot.delegatesFocus,delegatesFocus,'Correct delegatesFocus')
|
||||
originalShadowRoot = element.shadowRoot;
|
||||
}
|
||||
|
||||
|
|
|
@ -20,7 +20,8 @@ function testElementType(allowsShadowDom, elementType, mode, delegatesFocus) {
|
|||
|
||||
const isOpen = mode === 'open';
|
||||
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 shadowRoot = element.attachShadow({mode: mode, delegatesFocus: delegatesFocus});
|
||||
shadowRoot.appendChild(document.createElement('slot'));
|
||||
|
|
Загрузка…
Ссылка в новой задаче