OLD | NEW |
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 Loading... |
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 collapsedByClient(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 (collapsedByClient == collapse) |
| 60 return; |
| 61 |
| 62 collapsedByClient = 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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 name == allowAttr) { | 170 name == allowAttr) { |
159 allow_->setValue(value); | 171 allow_->setValue(value); |
160 } else { | 172 } else { |
161 if (name == srcAttr) | 173 if (name == srcAttr) |
162 LogUpdateAttributeIfIsolatedWorldAndInDocument("iframe", params); | 174 LogUpdateAttributeIfIsolatedWorldAndInDocument("iframe", params); |
163 HTMLFrameElementBase::ParseAttribute(params); | 175 HTMLFrameElementBase::ParseAttribute(params); |
164 } | 176 } |
165 } | 177 } |
166 | 178 |
167 bool HTMLIFrameElement::LayoutObjectIsNeeded(const ComputedStyle& style) { | 179 bool HTMLIFrameElement::LayoutObjectIsNeeded(const ComputedStyle& style) { |
168 return ContentFrame() && HTMLElement::LayoutObjectIsNeeded(style); | 180 return ContentFrame() && !collapsedByClient && |
| 181 HTMLElement::LayoutObjectIsNeeded(style); |
169 } | 182 } |
170 | 183 |
171 LayoutObject* HTMLIFrameElement::CreateLayoutObject(const ComputedStyle&) { | 184 LayoutObject* HTMLIFrameElement::CreateLayoutObject(const ComputedStyle&) { |
172 return new LayoutIFrame(this); | 185 return new LayoutIFrame(this); |
173 } | 186 } |
174 | 187 |
175 Node::InsertionNotificationRequest HTMLIFrameElement::InsertedInto( | 188 Node::InsertionNotificationRequest HTMLIFrameElement::InsertedInto( |
176 ContainerNode* insertion_point) { | 189 ContainerNode* insertion_point) { |
177 InsertionNotificationRequest result = | 190 InsertionNotificationRequest result = |
178 HTMLFrameElementBase::InsertedInto(insertion_point); | 191 HTMLFrameElementBase::InsertedInto(insertion_point); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 } | 227 } |
215 SetSynchronizedLazyAttribute(allowAttr, allow_->value()); | 228 SetSynchronizedLazyAttribute(allowAttr, allow_->value()); |
216 FrameOwnerPropertiesChanged(); | 229 FrameOwnerPropertiesChanged(); |
217 } | 230 } |
218 | 231 |
219 ReferrerPolicy HTMLIFrameElement::ReferrerPolicyAttribute() { | 232 ReferrerPolicy HTMLIFrameElement::ReferrerPolicyAttribute() { |
220 return referrer_policy_; | 233 return referrer_policy_; |
221 } | 234 } |
222 | 235 |
223 } // namespace blink | 236 } // namespace blink |
OLD | NEW |