| 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 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 } | 216 } |
| 217 | 217 |
| 218 void HTMLFrameOwnerElement::disposeWidgetSoon(FrameViewBase* frameViewBase) { | 218 void HTMLFrameOwnerElement::disposeWidgetSoon(FrameViewBase* frameViewBase) { |
| 219 if (s_updateSuspendCount) { | 219 if (s_updateSuspendCount) { |
| 220 widgetsPendingDispose().insert(frameViewBase); | 220 widgetsPendingDispose().insert(frameViewBase); |
| 221 return; | 221 return; |
| 222 } | 222 } |
| 223 frameViewBase->dispose(); | 223 frameViewBase->dispose(); |
| 224 } | 224 } |
| 225 | 225 |
| 226 void HTMLFrameOwnerElement::frameOwnerPropertiesChanged() { |
| 227 // Don't notify about updates if contentFrame() is null, for example when |
| 228 // the subframe hasn't been created yet. |
| 229 if (contentFrame()) |
| 230 document().frame()->loader().client()->didChangeFrameOwnerProperties(this); |
| 231 } |
| 232 |
| 226 void HTMLFrameOwnerElement::dispatchLoad() { | 233 void HTMLFrameOwnerElement::dispatchLoad() { |
| 227 dispatchScopedEvent(Event::create(EventTypeNames::load)); | 234 dispatchScopedEvent(Event::create(EventTypeNames::load)); |
| 228 } | 235 } |
| 229 | 236 |
| 230 const WebVector<mojom::blink::PermissionName>& | 237 const WebVector<mojom::blink::PermissionName>& |
| 231 HTMLFrameOwnerElement::delegatedPermissions() const { | 238 HTMLFrameOwnerElement::delegatedPermissions() const { |
| 232 DEFINE_STATIC_LOCAL(WebVector<mojom::blink::PermissionName>, permissions, ()); | 239 DEFINE_STATIC_LOCAL(WebVector<mojom::blink::PermissionName>, permissions, ()); |
| 233 return permissions; | 240 return permissions; |
| 234 } | 241 } |
| 235 | 242 |
| 236 const WebVector<WebFeaturePolicyFeature>& | 243 const WebVector<WebFeaturePolicyFeature>& |
| 237 HTMLFrameOwnerElement::allowedFeatures() const { | 244 HTMLFrameOwnerElement::allowedFeatures() const { |
| 238 DEFINE_STATIC_LOCAL(WebVector<WebFeaturePolicyFeature>, features, ()); | 245 DEFINE_STATIC_LOCAL(WebVector<WebFeaturePolicyFeature>, features, ()); |
| 239 return features; | 246 return features; |
| 240 } | 247 } |
| 241 | 248 |
| 242 Document* HTMLFrameOwnerElement::getSVGDocument( | 249 Document* HTMLFrameOwnerElement::getSVGDocument( |
| 243 ExceptionState& exceptionState) const { | 250 ExceptionState& exceptionState) const { |
| 244 Document* doc = contentDocument(); | 251 Document* doc = contentDocument(); |
| 245 if (doc && doc->isSVGDocument()) | 252 if (doc && doc->isSVGDocument()) |
| 246 return doc; | 253 return doc; |
| 247 return nullptr; | 254 return nullptr; |
| 248 } | 255 } |
| 249 | 256 |
| 250 void HTMLFrameOwnerElement::setWidget(FrameViewBase* frameViewBase) { | 257 void HTMLFrameOwnerElement::setWidget(FrameViewBase* frameViewBase) { |
| 251 if (frameViewBase == m_widget) | 258 if (frameViewBase == m_widget) |
| 252 return; | 259 return; |
| 253 | 260 |
| 261 Document* doc = contentDocument(); |
| 262 if (doc && doc->frame()) { |
| 263 bool willBeDisplayNone = !frameViewBase; |
| 264 if (isDisplayNone() != willBeDisplayNone) { |
| 265 doc->willChangeFrameOwnerProperties(marginWidth(), marginHeight(), |
| 266 scrollingMode(), willBeDisplayNone); |
| 267 } |
| 268 } |
| 269 |
| 254 if (m_widget) { | 270 if (m_widget) { |
| 255 if (m_widget->parent()) | 271 if (m_widget->parent()) |
| 256 moveWidgetToParentSoon(m_widget.get(), 0); | 272 moveWidgetToParentSoon(m_widget.get(), 0); |
| 257 m_widget = nullptr; | 273 m_widget = nullptr; |
| 258 } | 274 } |
| 259 | 275 |
| 260 m_widget = frameViewBase; | 276 m_widget = frameViewBase; |
| 277 frameOwnerPropertiesChanged(); |
| 261 | 278 |
| 262 LayoutPart* layoutPart = toLayoutPart(layoutObject()); | 279 LayoutPart* layoutPart = toLayoutPart(layoutObject()); |
| 263 LayoutPartItem layoutPartItem = LayoutPartItem(layoutPart); | 280 LayoutPartItem layoutPartItem = LayoutPartItem(layoutPart); |
| 264 if (layoutPartItem.isNull()) | 281 if (layoutPartItem.isNull()) |
| 265 return; | 282 return; |
| 266 | 283 |
| 267 if (m_widget) { | 284 if (m_widget) { |
| 268 layoutPartItem.updateOnWidgetChange(); | 285 layoutPartItem.updateOnWidgetChange(); |
| 269 | 286 |
| 270 DCHECK_EQ(document().view(), layoutPartItem.frameView()); | 287 DCHECK_EQ(document().view(), layoutPartItem.frameView()); |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 } | 347 } |
| 331 | 348 |
| 332 DEFINE_TRACE(HTMLFrameOwnerElement) { | 349 DEFINE_TRACE(HTMLFrameOwnerElement) { |
| 333 visitor->trace(m_contentFrame); | 350 visitor->trace(m_contentFrame); |
| 334 visitor->trace(m_widget); | 351 visitor->trace(m_widget); |
| 335 HTMLElement::trace(visitor); | 352 HTMLElement::trace(visitor); |
| 336 FrameOwner::trace(visitor); | 353 FrameOwner::trace(visitor); |
| 337 } | 354 } |
| 338 | 355 |
| 339 } // namespace blink | 356 } // namespace blink |
| OLD | NEW |