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

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

Issue 2696283003: Revert of Don't create layout objects for children of display-none iframes. (Closed)
Patch Set: 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
Index: third_party/WebKit/Source/web/tests/WebFrameTest.cpp
diff --git a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
index efce3b5bbb192bc5e9d1773687d8b184c755ac76..509ce8f86163e0ec8cd3ac7de8d234f4e3b38783 100644
--- a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
+++ b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
@@ -145,9 +145,6 @@
#include "web/WebRemoteFrameImpl.h"
#include "web/WebViewImpl.h"
#include "web/tests/FrameTestHelpers.h"
-#include "web/tests/sim/SimDisplayItemList.h"
-#include "web/tests/sim/SimRequest.h"
-#include "web/tests/sim/SimTest.h"
#include "wtf/Forward.h"
#include "wtf/PtrUtil.h"
#include "wtf/dtoa/utils.h"
@@ -11305,63 +11302,6 @@
EXPECT_EQ(10u, names.size());
}
-class WebFrameSimTest : public SimTest {};
-
-TEST_F(WebFrameSimTest, DisplayNoneIFrameHasNoLayoutObjects) {
- SimRequest mainResource("https://example.com/test.html", "text/html");
- SimRequest frameResource("https://example.com/frame.html", "text/html");
-
- loadURL("https://example.com/test.html");
- mainResource.complete(
- "<!DOCTYPE html>"
- "<iframe src=frame.html style='display: none'></iframe>");
- frameResource.complete(
- "<!DOCTYPE html>"
- "<html><body>This is a visible iframe.</body></html>");
-
- Element* element = document().querySelector("iframe");
- HTMLFrameOwnerElement* frameOwnerElement = toHTMLFrameOwnerElement(element);
- Document* iframeDoc = frameOwnerElement->contentDocument();
- EXPECT_FALSE(iframeDoc->documentElement()->layoutObject());
-
- // Changing the display from 'none' -> 'block' should cause layout objects to
- // appear.
- element->setInlineStyleProperty(CSSPropertyDisplay, CSSValueBlock);
- compositor().beginFrame();
- EXPECT_TRUE(iframeDoc->documentElement()->layoutObject());
-
- // Changing the display from 'block' -> 'none' should cause layout objects to
- // disappear.
- element->setInlineStyleProperty(CSSPropertyDisplay, CSSValueNone);
-
- compositor().beginFrame();
- EXPECT_FALSE(iframeDoc->documentElement()->layoutObject());
-}
-
-TEST_F(WebFrameSimTest, NormalIFrameHasLayoutObjects) {
- SimRequest mainResource("https://example.com/test.html", "text/html");
- SimRequest frameResource("https://example.com/frame.html", "text/html");
-
- loadURL("https://example.com/test.html");
- mainResource.complete(
- "<!DOCTYPE html>"
- "<iframe src=frame.html style='display: block'></iframe>");
- frameResource.complete(
- "<!DOCTYPE html>"
- "<html><body>This is a visible iframe.</body></html>");
-
- Element* element = document().querySelector("iframe");
- HTMLFrameOwnerElement* frameOwnerElement = toHTMLFrameOwnerElement(element);
- Document* iframeDoc = frameOwnerElement->contentDocument();
- EXPECT_TRUE(iframeDoc->documentElement()->layoutObject());
-
- // Changing the display from 'block' -> 'none' should cause layout objects to
- // disappear.
- element->setInlineStyleProperty(CSSPropertyDisplay, CSSValueNone);
- compositor().beginFrame();
- EXPECT_FALSE(iframeDoc->documentElement()->layoutObject());
-}
-
TEST_F(WebFrameTest, NoLoadingCompletionCallbacksInDetach) {
class LoadingObserverFrameClient
: public FrameTestHelpers::TestWebFrameClient {
« no previous file with comments | « third_party/WebKit/Source/web/WebLocalFrameImpl.cpp ('k') | third_party/WebKit/public/web/WebFrameOwnerProperties.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698