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..f5165d748096cae185c122d9e71cfd991e24867c 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), |
+ collapsed_by_client_(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 (collapsed_by_client_ == collapse) |
+ return; |
+ |
+ collapsed_by_client_ = collapse; |
+ if (GetDocument().InStyleRecalc()) |
dcheng
2017/04/18 07:01:36
Can you help me understand why this would be calle
engedy
2017/04/20 11:45:43
I was just trying to be defensive here. While I ha
|
+ 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() && !collapsed_by_client_ && |
+ HTMLElement::LayoutObjectIsNeeded(style); |
} |
LayoutObject* HTMLIFrameElement::CreateLayoutObject(const ComputedStyle&) { |