Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Unified Diff: LayoutTests/fast/dom/shadow/focus-shadowhost-display-none.html

Issue 1148293010: Listen to focus change events instead of assuming they happen at next rAF (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/dom/shadow/focus-shadowhost-display-none.html
diff --git a/LayoutTests/fast/dom/shadow/focus-shadowhost-display-none.html b/LayoutTests/fast/dom/shadow/focus-shadowhost-display-none.html
index 94c7857cae6f14ba93a103895c70aab12c5cd69e..36034aa47718dfb1feffc21b59e43fcc349bccda 100644
--- a/LayoutTests/fast/dom/shadow/focus-shadowhost-display-none.html
+++ b/LayoutTests/fast/dom/shadow/focus-shadowhost-display-none.html
@@ -22,12 +22,15 @@ function testFocusShadowHost() {
shouldBeEqualToString('window.getComputedStyle(host).display', 'none');
shouldBe('document.activeElement', 'host');
shouldBeNull('root.activeElement');
- window.requestAnimationFrame(function() {
+
+ function onBlur() {
shouldBeEqualToString('window.getComputedStyle(host).display', 'block');
shouldBe('document.activeElement', 'document.body');
shouldBeNull('root.activeElement');
+ host.removeEventListener('blur', onBlur);
resolve();
- });
+ }
+ host.addEventListener('blur', onBlur);
});
}
@@ -41,12 +44,14 @@ function testFocusInsideShadowRoot() {
shouldBe('document.activeElement', 'host');
shouldBe('root.activeElement', 'input');
- window.requestAnimationFrame(function() {
+ function onBlur() {
shouldBeEqualToString('window.getComputedStyle(host).display', 'block');
shouldBe('document.activeElement', 'document.body');
shouldBeNull('root.activeElement');
+ input.removeEventListener('blur', onBlur);
resolve();
- });
+ }
+ input.addEventListener('blur', onBlur);
});
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698