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

Unified Diff: third_party/WebKit/LayoutTests/external/wpt/dom/nodes/ParentNode-querySelector-All-xht.xht

Issue 2821243002: [dom] Fix flakiness of ParentNode-querySelector-All*.*. (Closed)
Patch Set: rebaseline of ParentNode-querySelector-All-xht.xht Created 3 years, 8 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: third_party/WebKit/LayoutTests/external/wpt/dom/nodes/ParentNode-querySelector-All-xht.xht
diff --git a/third_party/WebKit/LayoutTests/external/wpt/dom/nodes/ParentNode-querySelector-All-xht.xht b/third_party/WebKit/LayoutTests/external/wpt/dom/nodes/ParentNode-querySelector-All-xht.xht
index 7a673202b95a0721fcff1c1f2090b0709aeb10ea..3915aee42cffeff4cedcafc14a9caf1cf8d30276 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/dom/nodes/ParentNode-querySelector-All-xht.xht
+++ b/third_party/WebKit/LayoutTests/external/wpt/dom/nodes/ParentNode-querySelector-All-xht.xht
@@ -14,12 +14,18 @@
<script><![CDATA[
async_test(function() {
var frame = document.createElement("iframe");
- frame.onload = this.step_func_done(init);
+ var self = this;
+ frame.onload = function() {
+ // :target doesn't work before a page rendering on some browsers. We run
+ // tests after an animation frame because it may be later than the first
+ // page rendering.
+ requestAnimationFrame(self.step_func_done(init.bind(self, frame)));
+ };
frame.src = "ParentNode-querySelector-All-content.xht#target";
document.body.appendChild(frame);
})
-function init(e) {
+function init(target) {
/*
* This test suite tests Selectors API methods in 4 different contexts:
* 1. Document node
@@ -58,7 +64,7 @@ function init(e) {
var docType = "xhtml"; // Only run tests suitable for XHTML
// Prepare the nodes for testing
- var doc = e.target.contentDocument; // Document Node tests
+ var doc = target.contentDocument; // Document Node tests
var element = doc.getElementById("root"); // In-document Element Node tests

Powered by Google App Engine
This is Rietveld 408576698