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

Unified Diff: LayoutTests/inspector-protocol/dom/dom-focus.html

Issue 26149002: Don't dispatch blur/focus events if the element's page is not focused. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Revert to original approach, update test. Created 7 years, 2 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/inspector-protocol/dom/dom-focus-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/inspector-protocol/dom/dom-focus.html
diff --git a/LayoutTests/inspector-protocol/dom/dom-focus.html b/LayoutTests/inspector-protocol/dom/dom-focus.html
index 834272c9a6231a08dc0783309701d48933477971..571d7835d165c83218590c3398a37d0981cc7ba9 100644
--- a/LayoutTests/inspector-protocol/dom/dom-focus.html
+++ b/LayoutTests/inspector-protocol/dom/dom-focus.html
@@ -3,16 +3,15 @@
<script type="text/javascript" src="../../http/tests/inspector-protocol/resources/protocol-test.js"></script>
<script>
-window.addEventListener("load", function() {
- document.querySelector("#second").addEventListener("focus", onFocus);
-
- function onFocus() {
- log("focused");
- }
-});
+function logActiveElement() {
+ var el = document.activeElement;
+ log(el ? (el.id || el.tagName) : "(none)");
+}
function test()
{
+ InspectorTest.sendCommand("Runtime.evaluate", { "expression": "logActiveElement()" });
+
InspectorTest.sendCommand("DOM.getDocument", {}, onGotDocument);
function onGotDocument(msg) {
@@ -38,6 +37,8 @@ function test()
function onFocus(msg) {
if (msg.error)
InspectorTest.log(msg.error);
+
+ InspectorTest.sendCommand("Runtime.evaluate", { expression: 'logActiveElement()' });
InspectorTest.completeTest();
}
}
« no previous file with comments | « no previous file | LayoutTests/inspector-protocol/dom/dom-focus-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698