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 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 return; | 112 return; |
113 if (!contentFrame() || scriptURL.isEmpty() || !contentFrame()->isLocalFrame()) | 113 if (!contentFrame() || scriptURL.isEmpty() || !contentFrame()->isLocalFrame()) |
114 return; | 114 return; |
115 if (contentFrame()->owner()->getSandboxFlags() & SandboxOrigin) | 115 if (contentFrame()->owner()->getSandboxFlags() & SandboxOrigin) |
116 return; | 116 return; |
117 toLocalFrame(contentFrame()) | 117 toLocalFrame(contentFrame()) |
118 ->script() | 118 ->script() |
119 .executeScriptIfJavaScriptURL(scriptURL, this); | 119 .executeScriptIfJavaScriptURL(scriptURL, this); |
120 } | 120 } |
121 | 121 |
122 void HTMLFrameElementBase::frameOwnerPropertiesChanged() { | |
123 // Don't notify about updates if contentFrame() is null, for example when | |
124 // the subframe hasn't been created yet. | |
125 if (contentFrame()) | |
126 document().frame()->loader().client()->didChangeFrameOwnerProperties(this); | |
127 } | |
128 | |
129 void HTMLFrameElementBase::parseAttribute( | 122 void HTMLFrameElementBase::parseAttribute( |
130 const AttributeModificationParams& params) { | 123 const AttributeModificationParams& params) { |
131 const QualifiedName& name = params.name; | 124 const QualifiedName& name = params.name; |
132 const AtomicString& value = params.newValue; | 125 const AtomicString& value = params.newValue; |
133 if (name == srcdocAttr) { | 126 if (name == srcdocAttr) { |
134 if (!value.isNull()) { | 127 if (!value.isNull()) { |
135 setLocation(srcdocURL().getString()); | 128 setLocation(srcdocURL().getString()); |
136 } else { | 129 } else { |
137 const AtomicString& srcValue = fastGetAttribute(srcAttr); | 130 const AtomicString& srcValue = fastGetAttribute(srcAttr); |
138 if (!srcValue.isNull()) | 131 if (!srcValue.isNull()) |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 return attribute.name() == srcdocAttr || | 237 return attribute.name() == srcdocAttr || |
245 HTMLFrameOwnerElement::isHTMLContentAttribute(attribute); | 238 HTMLFrameOwnerElement::isHTMLContentAttribute(attribute); |
246 } | 239 } |
247 | 240 |
248 void HTMLFrameElementBase::setScrollingMode(ScrollbarMode scrollbarMode) { | 241 void HTMLFrameElementBase::setScrollingMode(ScrollbarMode scrollbarMode) { |
249 if (m_scrollingMode == scrollbarMode) | 242 if (m_scrollingMode == scrollbarMode) |
250 return; | 243 return; |
251 | 244 |
252 if (contentDocument()) { | 245 if (contentDocument()) { |
253 contentDocument()->willChangeFrameOwnerProperties( | 246 contentDocument()->willChangeFrameOwnerProperties( |
254 m_marginWidth, m_marginHeight, scrollbarMode); | 247 m_marginWidth, m_marginHeight, scrollbarMode, isDisplayNone()); |
255 } | 248 } |
256 m_scrollingMode = scrollbarMode; | 249 m_scrollingMode = scrollbarMode; |
257 frameOwnerPropertiesChanged(); | 250 frameOwnerPropertiesChanged(); |
258 } | 251 } |
259 | 252 |
260 void HTMLFrameElementBase::setMarginWidth(int marginWidth) { | 253 void HTMLFrameElementBase::setMarginWidth(int marginWidth) { |
261 if (m_marginWidth == marginWidth) | 254 if (m_marginWidth == marginWidth) |
262 return; | 255 return; |
263 | 256 |
264 if (contentDocument()) { | 257 if (contentDocument()) { |
265 contentDocument()->willChangeFrameOwnerProperties( | 258 contentDocument()->willChangeFrameOwnerProperties( |
266 marginWidth, m_marginHeight, m_scrollingMode); | 259 marginWidth, m_marginHeight, m_scrollingMode, isDisplayNone()); |
267 } | 260 } |
268 m_marginWidth = marginWidth; | 261 m_marginWidth = marginWidth; |
269 frameOwnerPropertiesChanged(); | 262 frameOwnerPropertiesChanged(); |
270 } | 263 } |
271 | 264 |
272 void HTMLFrameElementBase::setMarginHeight(int marginHeight) { | 265 void HTMLFrameElementBase::setMarginHeight(int marginHeight) { |
273 if (m_marginHeight == marginHeight) | 266 if (m_marginHeight == marginHeight) |
274 return; | 267 return; |
275 | 268 |
276 if (contentDocument()) { | 269 if (contentDocument()) { |
277 contentDocument()->willChangeFrameOwnerProperties( | 270 contentDocument()->willChangeFrameOwnerProperties( |
278 m_marginWidth, marginHeight, m_scrollingMode); | 271 m_marginWidth, marginHeight, m_scrollingMode, isDisplayNone()); |
279 } | 272 } |
280 m_marginHeight = marginHeight; | 273 m_marginHeight = marginHeight; |
281 frameOwnerPropertiesChanged(); | 274 frameOwnerPropertiesChanged(); |
282 } | 275 } |
283 | 276 |
284 } // namespace blink | 277 } // namespace blink |
OLD | NEW |