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

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

Issue 2632633006: Implement NavigationThrottle::BLOCK_REQUEST_AND_COLLAPSE. (Closed)
Patch Set: Fix navigation transition type. Created 3 years, 6 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::SetCollapsed(bool collapse) {
59 if (collapsed_by_client_ == collapse)
60 return;
61
62 collapsed_by_client_ = collapse;
63
64 // This is always called in response to an IPC, so should not happen in the
65 // middle of a style recalc.
66 DCHECK(!GetDocument().InStyleRecalc());
67 LazyReattachIfAttached();
68 }
69
57 DOMTokenList* HTMLIFrameElement::sandbox() const { 70 DOMTokenList* HTMLIFrameElement::sandbox() const {
58 return sandbox_.Get(); 71 return sandbox_.Get();
59 } 72 }
60 73
61 DOMTokenList* HTMLIFrameElement::allow() const { 74 DOMTokenList* HTMLIFrameElement::allow() const {
62 return allow_.Get(); 75 return allow_.Get();
63 } 76 }
64 77
65 bool HTMLIFrameElement::IsPresentationAttribute( 78 bool HTMLIFrameElement::IsPresentationAttribute(
66 const QualifiedName& name) const { 79 const QualifiedName& name) const {
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 name == allowAttr) { 174 name == allowAttr) {
162 allow_->setValue(value); 175 allow_->setValue(value);
163 } else { 176 } else {
164 if (name == srcAttr) 177 if (name == srcAttr)
165 LogUpdateAttributeIfIsolatedWorldAndInDocument("iframe", params); 178 LogUpdateAttributeIfIsolatedWorldAndInDocument("iframe", params);
166 HTMLFrameElementBase::ParseAttribute(params); 179 HTMLFrameElementBase::ParseAttribute(params);
167 } 180 }
168 } 181 }
169 182
170 bool HTMLIFrameElement::LayoutObjectIsNeeded(const ComputedStyle& style) { 183 bool HTMLIFrameElement::LayoutObjectIsNeeded(const ComputedStyle& style) {
171 return ContentFrame() && HTMLElement::LayoutObjectIsNeeded(style); 184 return ContentFrame() && !collapsed_by_client_ &&
185 HTMLElement::LayoutObjectIsNeeded(style);
172 } 186 }
173 187
174 LayoutObject* HTMLIFrameElement::CreateLayoutObject(const ComputedStyle&) { 188 LayoutObject* HTMLIFrameElement::CreateLayoutObject(const ComputedStyle&) {
175 return new LayoutIFrame(this); 189 return new LayoutIFrame(this);
176 } 190 }
177 191
178 Node::InsertionNotificationRequest HTMLIFrameElement::InsertedInto( 192 Node::InsertionNotificationRequest HTMLIFrameElement::InsertedInto(
179 ContainerNode* insertion_point) { 193 ContainerNode* insertion_point) {
180 InsertionNotificationRequest result = 194 InsertionNotificationRequest result =
181 HTMLFrameElementBase::InsertedInto(insertion_point); 195 HTMLFrameElementBase::InsertedInto(insertion_point);
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 SetSynchronizedLazyAttribute(allowAttr, allow_->value()); 232 SetSynchronizedLazyAttribute(allowAttr, allow_->value());
219 FrameOwnerPropertiesChanged(); 233 FrameOwnerPropertiesChanged();
220 UpdateContainerPolicy(); 234 UpdateContainerPolicy();
221 } 235 }
222 236
223 ReferrerPolicy HTMLIFrameElement::ReferrerPolicyAttribute() { 237 ReferrerPolicy HTMLIFrameElement::ReferrerPolicyAttribute() {
224 return referrer_policy_; 238 return referrer_policy_;
225 } 239 }
226 240
227 } // namespace blink 241 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLIFrameElement.h ('k') | third_party/WebKit/Source/web/WebFrame.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698