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

Unified Diff: third_party/WebKit/Source/web/tests/DocumentLoadingRenderingTest.cpp

Issue 2729493002: 'haveImportsLoaded' shouldn't block rendering, if ignoringPendingStylesheets. (Closed)
Patch Set: call EXPECT_TRUE twice Created 3 years, 10 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 | « third_party/WebKit/Source/core/dom/Document.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/web/tests/DocumentLoadingRenderingTest.cpp
diff --git a/third_party/WebKit/Source/web/tests/DocumentLoadingRenderingTest.cpp b/third_party/WebKit/Source/web/tests/DocumentLoadingRenderingTest.cpp
index 9fdbe5e6c2bef7918ffc9de0700aec46f5e943f8..3a7abbe0e6913cb0c16d6f73f3a4bbc0172568bc 100644
--- a/third_party/WebKit/Source/web/tests/DocumentLoadingRenderingTest.cpp
+++ b/third_party/WebKit/Source/web/tests/DocumentLoadingRenderingTest.cpp
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "core/dom/ClientRect.h"
#include "core/dom/Document.h"
#include "core/dom/FrameRequestCallback.h"
#include "core/html/HTMLIFrameElement.h"
@@ -380,4 +381,43 @@ TEST_F(DocumentLoadingRenderingTest,
EXPECT_TRUE(document().isRenderingReady());
}
+TEST_F(DocumentLoadingRenderingTest,
+ returnBoundingClientRectCorrectlyWhileLoadingImport) {
+ SimRequest mainResource("https://example.com/test.html", "text/html");
+ SimRequest importResource("https://example.com/import.css", "text/css");
+
+ loadURL("https://example.com/test.html");
+
+ webView().resize(WebSize(800, 600));
+
+ mainResource.start();
+
+ mainResource.write(
+ "<html><body>"
+ " <div id='test' style='font-size: 16px'>test</div>"
+ " <script>"
+ " var link = document.createElement('link');"
+ " link.rel = 'import';"
+ " link.href = 'import.css';"
+ " document.head.appendChild(link);"
+ " </script>");
+ importResource.start();
+
+ // Import loader isn't finish, shoudn't paint.
+ EXPECT_FALSE(document().isRenderingReady());
+
+ // If ignoringPendingStylesheets==true, element should get non-empty rect.
+ Element* element = document().getElementById("test");
+ ClientRect* rect = element->getBoundingClientRect();
+ EXPECT_TRUE(rect->width() > 0.f);
+ EXPECT_TRUE(rect->height() > 0.f);
+
+ // After reset ignoringPendingStylesheets, we should block rendering again.
+ EXPECT_FALSE(document().isRenderingReady());
+
+ importResource.write("div { color: red; }");
+ importResource.finish();
+ mainResource.finish();
+}
+
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698