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

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

Issue 2632633006: Implement NavigationThrottle::BLOCK_REQUEST_AND_COLLAPSE. (Closed)
Patch Set: Remove surplus semicolon. Created 3 years, 11 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 6f13781c84c15f403811150eaae2479a0c74c964..077963821b50075ca116e06f7283d3061d1c59ef 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_shouldCollapse(false),
m_sandbox(HTMLIFrameElementSandbox::create(this)),
m_referrerPolicy(ReferrerPolicyDefault) {}
@@ -53,6 +54,17 @@ DEFINE_TRACE(HTMLIFrameElement) {
HTMLIFrameElement::~HTMLIFrameElement() {}
+void HTMLIFrameElement::setShouldCollapse(bool collapse) {
+ if (m_shouldCollapse == collapse)
+ return;
+
+ m_shouldCollapse = collapse;
+ if (document().inStyleRecalc())
+ reattachLayoutTree();
+ else
+ lazyReattachIfAttached();
+}
+
DOMTokenList* HTMLIFrameElement::sandbox() const {
return m_sandbox.get();
}
@@ -154,7 +166,8 @@ void HTMLIFrameElement::parseAttribute(
}
bool HTMLIFrameElement::layoutObjectIsNeeded(const ComputedStyle& style) {
- return contentFrame() && HTMLElement::layoutObjectIsNeeded(style);
+ return contentFrame() && !m_shouldCollapse &&
+ HTMLFrameElementBase::layoutObjectIsNeeded(style);
}
LayoutObject* HTMLIFrameElement::createLayoutObject(const ComputedStyle&) {

Powered by Google App Engine
This is Rietveld 408576698