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

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

Issue 2632633006: Implement NavigationThrottle::BLOCK_REQUEST_AND_COLLAPSE. (Closed)
Patch Set: Extend tests, fix redirects. Non-PlzNavigate version still broken. 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/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 b95120597c5e8e93838348787c43b88cfcd63a15..97543f88f00f73bb9fb40b1134deed255a9e17cf 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),
m_didLoadNonEmptyDocument(false),
+ m_collapsedByClient(false),
m_sandbox(HTMLIFrameElementSandbox::create(this)),
m_allow(HTMLIFrameElementAllow::create(this)),
m_referrerPolicy(ReferrerPolicyDefault) {}
@@ -55,6 +56,17 @@ DEFINE_TRACE(HTMLIFrameElement) {
HTMLIFrameElement::~HTMLIFrameElement() {}
+void HTMLIFrameElement::setCollapsedByClient(bool collapse) {
+ if (m_collapsedByClient == collapse)
+ return;
+
+ m_collapsedByClient = collapse;
+ if (document().inStyleRecalc())
+ reattachLayoutTree();
+ else
+ lazyReattachIfAttached();
+}
+
DOMTokenList* HTMLIFrameElement::sandbox() const {
return m_sandbox.get();
}
@@ -175,7 +187,8 @@ void HTMLIFrameElement::parseAttribute(
}
bool HTMLIFrameElement::layoutObjectIsNeeded(const ComputedStyle& style) {
- return contentFrame() && HTMLElement::layoutObjectIsNeeded(style);
+ return contentFrame() && !m_collapsedByClient &&
+ HTMLFrameElementBase::layoutObjectIsNeeded(style);
}
LayoutObject* HTMLIFrameElement::createLayoutObject(const ComputedStyle&) {

Powered by Google App Engine
This is Rietveld 408576698