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

Unified Diff: LayoutTests/fast/dom/HTMLDialogElement/modal-dialog-blocks-mouse-events.html

Issue 133393002: Make ancestors of modal <dialog> inert (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: save a tree walk if able Created 6 years, 11 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
Index: LayoutTests/fast/dom/HTMLDialogElement/modal-dialog-blocks-mouse-events.html
diff --git a/LayoutTests/fast/dom/HTMLDialogElement/modal-dialog-blocks-mouse-events.html b/LayoutTests/fast/dom/HTMLDialogElement/modal-dialog-blocks-mouse-events.html
index 2d1ec448391803cd3861469ab821cbfb315eae3f..d715f2e95f1163a39a68fe184e7d84de0210ef08 100644
--- a/LayoutTests/fast/dom/HTMLDialogElement/modal-dialog-blocks-mouse-events.html
+++ b/LayoutTests/fast/dom/HTMLDialogElement/modal-dialog-blocks-mouse-events.html
@@ -77,24 +77,24 @@ eventFiredOnDialog = function(event) {
dialogDiv.style.backgroundColor = 'green';
};
-body = document.body;
-body.firedOnEvents = {};
-eventFiredOnBody = function(event) {
- body.firedOnEvents[event.type] = true;
- if (Object.keys(body.firedOnEvents).length == events.length && !inertDiv.firedOn)
+document.firedOnEvents = {};
+document.expectedEventCount = events.length - 1; // document won't get 'mouseout'
esprehn 2014/01/14 01:43:29 Why are you storing these properties on the docume
falken 2014/01/14 01:50:48 Seemed a bit nicer to say document.expectedEventCo
+eventFiredOnDocument = function(event) {
+ document.firedOnEvents[event.type] = true;
+ if (Object.keys(document.firedOnEvents).length == document.expectedEventCount && !inertDiv.firedOn)
inertDiv.style.backgroundColor = 'green';
};
for (var i = 0; i < events.length; ++i) {
inertDiv.addEventListener(events[i], eventFiredOnInertNode);
dialogDiv.addEventListener(events[i], eventFiredOnDialog);
- document.body.addEventListener(events[i], eventFiredOnBody);
+ document.addEventListener(events[i], eventFiredOnDocument);
}
debug('Clicking on inert box');
clickOn(inertDiv);
shouldBeFalse('inertDiv.firedOn');
-shouldBe('Object.keys(body.firedOnEvents).length', 'events.length');
+shouldBe('Object.keys(document.firedOnEvents).length', 'document.expectedEventCount');
debug('Clicking on non-inert box');
clickOn(dialogDiv);

Powered by Google App Engine
This is Rietveld 408576698