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

Unified Diff: third_party/WebKit/Source/core/html/HTMLIFrameElement.cpp

Issue 2632633006: Implement NavigationThrottle::BLOCK_REQUEST_AND_COLLAPSE. (Closed)
Patch Set: Addressed comments, made redirect response PlzNavigate-only. 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/Source/core/html/HTMLIFrameElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLIFrameElement.cpp b/third_party/WebKit/Source/core/html/HTMLIFrameElement.cpp
index 3d8de52059e3a13e54c599edfd384fcbefb73f52..aeef63b01177705137268808906e124ca98f2234 100644
--- a/third_party/WebKit/Source/core/html/HTMLIFrameElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLIFrameElement.cpp
@@ -39,6 +39,7 @@ using namespace HTMLNames;
inline HTMLIFrameElement::HTMLIFrameElement(Document& document)
: HTMLFrameElementBase(iframeTag, document),
did_load_non_empty_document_(false),
+ collapsedByClient(false),
sandbox_(HTMLIFrameElementSandbox::Create(this)),
allow_(HTMLIFrameElementAllow::Create(this)),
referrer_policy_(kReferrerPolicyDefault) {}
@@ -54,6 +55,17 @@ DEFINE_TRACE(HTMLIFrameElement) {
HTMLIFrameElement::~HTMLIFrameElement() {}
+void HTMLIFrameElement::SetCollapsedByClient(bool collapse) {
+ if (collapsedByClient == collapse)
+ return;
+
+ collapsedByClient = collapse;
+ if (GetDocument().InStyleRecalc())
+ ReattachLayoutTree();
+ else
+ LazyReattachIfAttached();
+}
+
DOMTokenList* HTMLIFrameElement::sandbox() const {
return sandbox_.Get();
}
@@ -165,7 +177,8 @@ void HTMLIFrameElement::ParseAttribute(
}
bool HTMLIFrameElement::LayoutObjectIsNeeded(const ComputedStyle& style) {
- return ContentFrame() && HTMLElement::LayoutObjectIsNeeded(style);
+ return ContentFrame() && !collapsedByClient &&
+ HTMLElement::LayoutObjectIsNeeded(style);
}
LayoutObject* HTMLIFrameElement::CreateLayoutObject(const ComputedStyle&) {

Powered by Google App Engine
This is Rietveld 408576698