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 m_didLoadNonEmptyDocument(false), | 41 m_didLoadNonEmptyDocument(false), |
| 42 m_collapsedByClient(false), |
42 m_sandbox(HTMLIFrameElementSandbox::create(this)), | 43 m_sandbox(HTMLIFrameElementSandbox::create(this)), |
43 m_allow(HTMLIFrameElementAllow::create(this)), | 44 m_allow(HTMLIFrameElementAllow::create(this)), |
44 m_referrerPolicy(ReferrerPolicyDefault) {} | 45 m_referrerPolicy(ReferrerPolicyDefault) {} |
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(m_sandbox); | 50 visitor->trace(m_sandbox); |
50 visitor->trace(m_permissions); | 51 visitor->trace(m_permissions); |
51 visitor->trace(m_allow); | 52 visitor->trace(m_allow); |
52 HTMLFrameElementBase::trace(visitor); | 53 HTMLFrameElementBase::trace(visitor); |
53 Supplementable<HTMLIFrameElement>::trace(visitor); | 54 Supplementable<HTMLIFrameElement>::trace(visitor); |
54 } | 55 } |
55 | 56 |
56 HTMLIFrameElement::~HTMLIFrameElement() {} | 57 HTMLIFrameElement::~HTMLIFrameElement() {} |
57 | 58 |
| 59 void HTMLIFrameElement::setCollapsedByClient(bool collapse) { |
| 60 if (m_collapsedByClient == collapse) |
| 61 return; |
| 62 |
| 63 m_collapsedByClient = collapse; |
| 64 if (document().inStyleRecalc()) |
| 65 reattachLayoutTree(); |
| 66 else |
| 67 lazyReattachIfAttached(); |
| 68 } |
| 69 |
58 DOMTokenList* HTMLIFrameElement::sandbox() const { | 70 DOMTokenList* HTMLIFrameElement::sandbox() const { |
59 return m_sandbox.get(); | 71 return m_sandbox.get(); |
60 } | 72 } |
61 | 73 |
62 DOMTokenList* HTMLIFrameElement::permissions() const { | 74 DOMTokenList* HTMLIFrameElement::permissions() const { |
63 if (!const_cast<HTMLIFrameElement*>(this)->initializePermissionsAttribute()) | 75 if (!const_cast<HTMLIFrameElement*>(this)->initializePermissionsAttribute()) |
64 return nullptr; | 76 return nullptr; |
65 return m_permissions.get(); | 77 return m_permissions.get(); |
66 } | 78 } |
67 | 79 |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 name == allowAttr) { | 180 name == allowAttr) { |
169 m_allow->setValue(value); | 181 m_allow->setValue(value); |
170 } else { | 182 } else { |
171 if (name == srcAttr) | 183 if (name == srcAttr) |
172 logUpdateAttributeIfIsolatedWorldAndInDocument("iframe", params); | 184 logUpdateAttributeIfIsolatedWorldAndInDocument("iframe", params); |
173 HTMLFrameElementBase::parseAttribute(params); | 185 HTMLFrameElementBase::parseAttribute(params); |
174 } | 186 } |
175 } | 187 } |
176 | 188 |
177 bool HTMLIFrameElement::layoutObjectIsNeeded(const ComputedStyle& style) { | 189 bool HTMLIFrameElement::layoutObjectIsNeeded(const ComputedStyle& style) { |
178 return contentFrame() && HTMLElement::layoutObjectIsNeeded(style); | 190 return contentFrame() && !m_collapsedByClient && |
| 191 HTMLFrameElementBase::layoutObjectIsNeeded(style); |
179 } | 192 } |
180 | 193 |
181 LayoutObject* HTMLIFrameElement::createLayoutObject(const ComputedStyle&) { | 194 LayoutObject* HTMLIFrameElement::createLayoutObject(const ComputedStyle&) { |
182 return new LayoutIFrame(this); | 195 return new LayoutIFrame(this); |
183 } | 196 } |
184 | 197 |
185 Node::InsertionNotificationRequest HTMLIFrameElement::insertedInto( | 198 Node::InsertionNotificationRequest HTMLIFrameElement::insertedInto( |
186 ContainerNode* insertionPoint) { | 199 ContainerNode* insertionPoint) { |
187 InsertionNotificationRequest result = | 200 InsertionNotificationRequest result = |
188 HTMLFrameElementBase::insertedInto(insertionPoint); | 201 HTMLFrameElementBase::insertedInto(insertionPoint); |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 bool HTMLIFrameElement::initializePermissionsAttribute() { | 262 bool HTMLIFrameElement::initializePermissionsAttribute() { |
250 if (!RuntimeEnabledFeatures::permissionDelegationEnabled()) | 263 if (!RuntimeEnabledFeatures::permissionDelegationEnabled()) |
251 return false; | 264 return false; |
252 | 265 |
253 if (!m_permissions) | 266 if (!m_permissions) |
254 m_permissions = HTMLIFrameElementPermissions::create(this); | 267 m_permissions = HTMLIFrameElementPermissions::create(this); |
255 return true; | 268 return true; |
256 } | 269 } |
257 | 270 |
258 } // namespace blink | 271 } // namespace blink |
OLD | NEW |