From 90d75d1cf11c1f34997ce3d85475aa6aac49a3e3 Mon Sep 17 00:00:00 2001 From: Rakina Zata Amni Date: Wed, 25 Sep 2019 16:56:11 +0000 Subject: [PATCH] Bug 1561290 [wpt PR 17493] - CSS: :focus selector effects on shadow hosts, a=testonly Automatic update from web-platform-tests CSS: :focus selector effects on shadow hosts Follows https://github.com/whatwg/html/pull/4731. -- wpt-commits: 0693b81665fcc5a7258535e4403b748a810730ae wpt-pr: 17493 --- .../focus/focus-selector-delegatesFocus.html | 72 +++++++++++++++++++ .../focus/resources/shadow-utils.js | 5 +- 2 files changed, 75 insertions(+), 2 deletions(-) create mode 100644 testing/web-platform/tests/shadow-dom/focus/focus-selector-delegatesFocus.html diff --git a/testing/web-platform/tests/shadow-dom/focus/focus-selector-delegatesFocus.html b/testing/web-platform/tests/shadow-dom/focus/focus-selector-delegatesFocus.html new file mode 100644 index 0000000000000..386045258e043 --- /dev/null +++ b/testing/web-platform/tests/shadow-dom/focus/focus-selector-delegatesFocus.html @@ -0,0 +1,72 @@ + + + + + CSS Test (Selectors): :focus behavior with shadow hosts & delegatesFocus + + + + + + + + + + + + diff --git a/testing/web-platform/tests/shadow-dom/focus/resources/shadow-utils.js b/testing/web-platform/tests/shadow-dom/focus/resources/shadow-utils.js index 6ea372afdf180..8033ce0169f4a 100644 --- a/testing/web-platform/tests/shadow-dom/focus/resources/shadow-utils.js +++ b/testing/web-platform/tests/shadow-dom/focus/resources/shadow-utils.js @@ -60,8 +60,9 @@ function removeTabIndex(elements) { } } -function resetFocus() { - document.body.focus(); +function resetFocus(root = document) { + if (root.activeElement) + root.activeElement.blur(); } function navigateFocusForward() {