OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2009 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
8 * | 8 * |
9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 return; | 102 return; |
103 } | 103 } |
104 widgetNewParentMap().set(child, parent); | 104 widgetNewParentMap().set(child, parent); |
105 } | 105 } |
106 | 106 |
107 HTMLFrameOwnerElement::HTMLFrameOwnerElement(const QualifiedName& tagName, Docum
ent& document) | 107 HTMLFrameOwnerElement::HTMLFrameOwnerElement(const QualifiedName& tagName, Docum
ent& document) |
108 : HTMLElement(tagName, document) | 108 : HTMLElement(tagName, document) |
109 , m_contentFrame(nullptr) | 109 , m_contentFrame(nullptr) |
110 , m_widget(nullptr) | 110 , m_widget(nullptr) |
111 , m_sandboxFlags(SandboxNone) | 111 , m_sandboxFlags(SandboxNone) |
| 112 , m_scrollingMode(ScrollbarAuto) |
| 113 , m_marginWidth(-1) |
| 114 , m_marginHeight(-1) |
112 { | 115 { |
113 } | 116 } |
114 | 117 |
115 LayoutPart* HTMLFrameOwnerElement::layoutPart() const | 118 LayoutPart* HTMLFrameOwnerElement::layoutPart() const |
116 { | 119 { |
117 // HTMLObjectElement and HTMLEmbedElement may return arbitrary layoutObjects | 120 // HTMLObjectElement and HTMLEmbedElement may return arbitrary layoutObjects |
118 // when using fallback content. | 121 // when using fallback content. |
119 if (!layoutObject() || !layoutObject()->isLayoutPart()) | 122 if (!layoutObject() || !layoutObject()->isLayoutPart()) |
120 return nullptr; | 123 return nullptr; |
121 return toLayoutPart(layoutObject()); | 124 return toLayoutPart(layoutObject()); |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 | 187 |
185 void HTMLFrameOwnerElement::setSandboxFlags(SandboxFlags flags) | 188 void HTMLFrameOwnerElement::setSandboxFlags(SandboxFlags flags) |
186 { | 189 { |
187 m_sandboxFlags = flags; | 190 m_sandboxFlags = flags; |
188 // Don't notify about updates if contentFrame() is null, for example when | 191 // Don't notify about updates if contentFrame() is null, for example when |
189 // the subframe hasn't been created yet. | 192 // the subframe hasn't been created yet. |
190 if (contentFrame()) | 193 if (contentFrame()) |
191 document().frame()->loader().client()->didChangeSandboxFlags(contentFram
e(), flags); | 194 document().frame()->loader().client()->didChangeSandboxFlags(contentFram
e(), flags); |
192 } | 195 } |
193 | 196 |
| 197 void HTMLFrameOwnerElement::setScrollingMode(ScrollbarMode scrollbarMode) |
| 198 { |
| 199 m_scrollingMode = scrollbarMode; |
| 200 if (isPluginElement()) |
| 201 return; |
| 202 |
| 203 frameOwnerPropertiesChanged(); |
| 204 } |
| 205 |
| 206 void HTMLFrameOwnerElement::setMarginWidth(int marginWidth) |
| 207 { |
| 208 m_marginWidth = marginWidth; |
| 209 if (isPluginElement()) |
| 210 return; |
| 211 |
| 212 frameOwnerPropertiesChanged(); |
| 213 } |
| 214 |
| 215 void HTMLFrameOwnerElement::setMarginHeight(int marginHeight) |
| 216 { |
| 217 m_marginHeight = marginHeight; |
| 218 if (isPluginElement()) |
| 219 return; |
| 220 |
| 221 frameOwnerPropertiesChanged(); |
| 222 } |
| 223 |
194 bool HTMLFrameOwnerElement::isKeyboardFocusable() const | 224 bool HTMLFrameOwnerElement::isKeyboardFocusable() const |
195 { | 225 { |
196 return m_contentFrame && HTMLElement::isKeyboardFocusable(); | 226 return m_contentFrame && HTMLElement::isKeyboardFocusable(); |
197 } | 227 } |
198 | 228 |
| 229 void HTMLFrameOwnerElement::frameOwnerPropertiesChanged() |
| 230 { |
| 231 // Don't notify about updates if contentFrame() is null, for example when |
| 232 // the subframe hasn't been created yet. |
| 233 if (contentFrame()) |
| 234 document().frame()->loader().client()->didChangeFrameOwnerProperties(con
tentFrame(), m_scrollingMode, m_marginWidth, m_marginHeight); |
| 235 } |
| 236 |
199 void HTMLFrameOwnerElement::dispatchLoad() | 237 void HTMLFrameOwnerElement::dispatchLoad() |
200 { | 238 { |
201 dispatchEvent(Event::create(EventTypeNames::load)); | 239 dispatchEvent(Event::create(EventTypeNames::load)); |
202 } | 240 } |
203 | 241 |
204 Document* HTMLFrameOwnerElement::getSVGDocument(ExceptionState& exceptionState)
const | 242 Document* HTMLFrameOwnerElement::getSVGDocument(ExceptionState& exceptionState)
const |
205 { | 243 { |
206 Document* doc = contentDocument(); | 244 Document* doc = contentDocument(); |
207 if (doc && doc->isSVGDocument()) | 245 if (doc && doc->isSVGDocument()) |
208 return doc; | 246 return doc; |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 DEFINE_TRACE(HTMLFrameOwnerElement) | 314 DEFINE_TRACE(HTMLFrameOwnerElement) |
277 { | 315 { |
278 visitor->trace(m_contentFrame); | 316 visitor->trace(m_contentFrame); |
279 visitor->trace(m_widget); | 317 visitor->trace(m_widget); |
280 HTMLElement::trace(visitor); | 318 HTMLElement::trace(visitor); |
281 FrameOwner::trace(visitor); | 319 FrameOwner::trace(visitor); |
282 } | 320 } |
283 | 321 |
284 | 322 |
285 } // namespace blink | 323 } // namespace blink |
OLD | NEW |