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

Unified Diff: LayoutTests/fast/events/focus-querySelector-in-focus-event-handler.html

Issue 1312093002: Set focused flag earlier than dispatching focus events. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: remove body tag. Created 5 years, 4 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 | LayoutTests/fast/events/focus-querySelector-in-focus-event-handler-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/events/focus-querySelector-in-focus-event-handler.html
diff --git a/LayoutTests/fast/events/focus-querySelector-in-focus-event-handler.html b/LayoutTests/fast/events/focus-querySelector-in-focus-event-handler.html
new file mode 100644
index 0000000000000000000000000000000000000000..5b246d64196998d843e2b361bb20ce81c01215e6
--- /dev/null
+++ b/LayoutTests/fast/events/focus-querySelector-in-focus-event-handler.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<script src="../../resources/js-test.js"></script>
+<input type="text">
+<script>
+var input = document.querySelector('input');
+input.addEventListener('focus', function(e) {
+ var focused = document.querySelector(':focus');
+ if (e.target === focused) {
+ testPassed(":focus matches event.target");
+ } else {
+ testFailed(":focus doesn't match event.target");
+ }
+}, false);
+input.focus();
+</script>
« no previous file with comments | « no previous file | LayoutTests/fast/events/focus-querySelector-in-focus-event-handler-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698