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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLIFrameElement.cpp

Issue 2632633006: Implement NavigationThrottle::BLOCK_REQUEST_AND_COLLAPSE. (Closed)
Patch Set: Addressed comments from csharrison@. Created 3 years, 7 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Simon Hausmann (hausmann@kde.org) 4 * (C) 2000 Simon Hausmann (hausmann@kde.org)
5 * (C) 2001 Dirk Mueller (mueller@kde.org) 5 * (C) 2001 Dirk Mueller (mueller@kde.org)
6 * Copyright (C) 2004, 2006, 2008, 2009 Apple Inc. All rights reserved. 6 * Copyright (C) 2004, 2006, 2008, 2009 Apple Inc. All rights reserved.
7 * Copyright (C) 2009 Ericsson AB. All rights reserved. 7 * Copyright (C) 2009 Ericsson AB. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 21 matching lines...) Expand all
32 #include "core/layout/LayoutIFrame.h" 32 #include "core/layout/LayoutIFrame.h"
33 #include "platform/RuntimeEnabledFeatures.h" 33 #include "platform/RuntimeEnabledFeatures.h"
34 34
35 namespace blink { 35 namespace blink {
36 36
37 using namespace HTMLNames; 37 using namespace HTMLNames;
38 38
39 inline HTMLIFrameElement::HTMLIFrameElement(Document& document) 39 inline HTMLIFrameElement::HTMLIFrameElement(Document& document)
40 : HTMLFrameElementBase(iframeTag, document), 40 : HTMLFrameElementBase(iframeTag, document),
41 did_load_non_empty_document_(false), 41 did_load_non_empty_document_(false),
42 collapsed_by_client_(false),
42 sandbox_(HTMLIFrameElementSandbox::Create(this)), 43 sandbox_(HTMLIFrameElementSandbox::Create(this)),
43 allow_(HTMLIFrameElementAllow::Create(this)), 44 allow_(HTMLIFrameElementAllow::Create(this)),
44 referrer_policy_(kReferrerPolicyDefault) {} 45 referrer_policy_(kReferrerPolicyDefault) {}
45 46
46 DEFINE_NODE_FACTORY(HTMLIFrameElement) 47 DEFINE_NODE_FACTORY(HTMLIFrameElement)
47 48
48 DEFINE_TRACE(HTMLIFrameElement) { 49 DEFINE_TRACE(HTMLIFrameElement) {
49 visitor->Trace(sandbox_); 50 visitor->Trace(sandbox_);
50 visitor->Trace(allow_); 51 visitor->Trace(allow_);
51 HTMLFrameElementBase::Trace(visitor); 52 HTMLFrameElementBase::Trace(visitor);
52 Supplementable<HTMLIFrameElement>::Trace(visitor); 53 Supplementable<HTMLIFrameElement>::Trace(visitor);
53 } 54 }
54 55
55 HTMLIFrameElement::~HTMLIFrameElement() {} 56 HTMLIFrameElement::~HTMLIFrameElement() {}
56 57
58 void HTMLIFrameElement::SetCollapsedByClient(bool collapse) {
59 if (collapsed_by_client_ == collapse)
60 return;
61
62 collapsed_by_client_ = collapse;
63 if (GetDocument().InStyleRecalc())
64 ReattachLayoutTree();
65 else
66 LazyReattachIfAttached();
67 }
68
57 DOMTokenList* HTMLIFrameElement::sandbox() const { 69 DOMTokenList* HTMLIFrameElement::sandbox() const {
58 return sandbox_.Get(); 70 return sandbox_.Get();
59 } 71 }
60 72
61 DOMTokenList* HTMLIFrameElement::allow() const { 73 DOMTokenList* HTMLIFrameElement::allow() const {
62 return allow_.Get(); 74 return allow_.Get();
63 } 75 }
64 76
65 bool HTMLIFrameElement::IsPresentationAttribute( 77 bool HTMLIFrameElement::IsPresentationAttribute(
66 const QualifiedName& name) const { 78 const QualifiedName& name) const {
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 name == allowAttr) { 173 name == allowAttr) {
162 allow_->setValue(value); 174 allow_->setValue(value);
163 } else { 175 } else {
164 if (name == srcAttr) 176 if (name == srcAttr)
165 LogUpdateAttributeIfIsolatedWorldAndInDocument("iframe", params); 177 LogUpdateAttributeIfIsolatedWorldAndInDocument("iframe", params);
166 HTMLFrameElementBase::ParseAttribute(params); 178 HTMLFrameElementBase::ParseAttribute(params);
167 } 179 }
168 } 180 }
169 181
170 bool HTMLIFrameElement::LayoutObjectIsNeeded(const ComputedStyle& style) { 182 bool HTMLIFrameElement::LayoutObjectIsNeeded(const ComputedStyle& style) {
171 return ContentFrame() && HTMLElement::LayoutObjectIsNeeded(style); 183 return ContentFrame() && !collapsed_by_client_ &&
184 HTMLElement::LayoutObjectIsNeeded(style);
172 } 185 }
173 186
174 LayoutObject* HTMLIFrameElement::CreateLayoutObject(const ComputedStyle&) { 187 LayoutObject* HTMLIFrameElement::CreateLayoutObject(const ComputedStyle&) {
175 return new LayoutIFrame(this); 188 return new LayoutIFrame(this);
176 } 189 }
177 190
178 Node::InsertionNotificationRequest HTMLIFrameElement::InsertedInto( 191 Node::InsertionNotificationRequest HTMLIFrameElement::InsertedInto(
179 ContainerNode* insertion_point) { 192 ContainerNode* insertion_point) {
180 InsertionNotificationRequest result = 193 InsertionNotificationRequest result =
181 HTMLFrameElementBase::InsertedInto(insertion_point); 194 HTMLFrameElementBase::InsertedInto(insertion_point);
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 SetSynchronizedLazyAttribute(allowAttr, allow_->value()); 231 SetSynchronizedLazyAttribute(allowAttr, allow_->value());
219 FrameOwnerPropertiesChanged(); 232 FrameOwnerPropertiesChanged();
220 UpdateContainerPolicy(); 233 UpdateContainerPolicy();
221 } 234 }
222 235
223 ReferrerPolicy HTMLIFrameElement::ReferrerPolicyAttribute() { 236 ReferrerPolicy HTMLIFrameElement::ReferrerPolicyAttribute() {
224 return referrer_policy_; 237 return referrer_policy_;
225 } 238 }
226 239
227 } // namespace blink 240 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698