| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> | 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> |
| 3 * 1999 Lars Knoll <knoll@kde.org> | 3 * 1999 Lars Knoll <knoll@kde.org> |
| 4 * 1999 Antti Koivisto <koivisto@kde.org> | 4 * 1999 Antti Koivisto <koivisto@kde.org> |
| 5 * 2000 Dirk Mueller <mueller@kde.org> | 5 * 2000 Dirk Mueller <mueller@kde.org> |
| 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
| 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) | 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) |
| 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) | 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) |
| 9 * Copyright (C) 2009 Google Inc. All rights reserved. | 9 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 10 * | 10 * |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 #include "core/frame/FrameHost.h" | 42 #include "core/frame/FrameHost.h" |
| 43 #include "core/frame/LocalFrame.h" | 43 #include "core/frame/LocalFrame.h" |
| 44 #include "core/frame/Settings.h" | 44 #include "core/frame/Settings.h" |
| 45 #include "core/html/HTMLFrameElement.h" | 45 #include "core/html/HTMLFrameElement.h" |
| 46 #include "core/html/HTMLPlugInElement.h" | 46 #include "core/html/HTMLPlugInElement.h" |
| 47 #include "core/html/parser/TextResourceDecoder.h" | 47 #include "core/html/parser/TextResourceDecoder.h" |
| 48 #include "core/inspector/InspectorInstrumentation.h" | 48 #include "core/inspector/InspectorInstrumentation.h" |
| 49 #include "core/inspector/InspectorTraceEvents.h" | 49 #include "core/inspector/InspectorTraceEvents.h" |
| 50 #include "core/layout/Layer.h" | 50 #include "core/layout/Layer.h" |
| 51 #include "core/layout/LayoutCounter.h" | 51 #include "core/layout/LayoutCounter.h" |
| 52 #include "core/layout/LayoutEmbeddedObject.h" |
| 52 #include "core/layout/LayoutPart.h" | 53 #include "core/layout/LayoutPart.h" |
| 53 #include "core/layout/LayoutTheme.h" | 54 #include "core/layout/LayoutTheme.h" |
| 54 #include "core/layout/TextAutosizer.h" | 55 #include "core/layout/TextAutosizer.h" |
| 55 #include "core/layout/compositing/CompositedLayerMapping.h" | 56 #include "core/layout/compositing/CompositedLayerMapping.h" |
| 56 #include "core/layout/compositing/CompositedSelectionBound.h" | 57 #include "core/layout/compositing/CompositedSelectionBound.h" |
| 57 #include "core/layout/compositing/LayerCompositor.h" | 58 #include "core/layout/compositing/LayerCompositor.h" |
| 58 #include "core/layout/style/LayoutStyle.h" | 59 #include "core/layout/style/LayoutStyle.h" |
| 59 #include "core/loader/FrameLoader.h" | 60 #include "core/loader/FrameLoader.h" |
| 60 #include "core/loader/FrameLoaderClient.h" | 61 #include "core/loader/FrameLoaderClient.h" |
| 61 #include "core/page/Chrome.h" | 62 #include "core/page/Chrome.h" |
| 62 #include "core/page/ChromeClient.h" | 63 #include "core/page/ChromeClient.h" |
| 63 #include "core/page/EventHandler.h" | 64 #include "core/page/EventHandler.h" |
| 64 #include "core/page/FocusController.h" | 65 #include "core/page/FocusController.h" |
| 65 #include "core/page/FrameTree.h" | 66 #include "core/page/FrameTree.h" |
| 66 #include "core/page/Page.h" | 67 #include "core/page/Page.h" |
| 67 #include "core/page/scrolling/ScrollingCoordinator.h" | 68 #include "core/page/scrolling/ScrollingCoordinator.h" |
| 68 #include "core/paint/FramePainter.h" | 69 #include "core/paint/FramePainter.h" |
| 69 #include "core/rendering/RenderEmbeddedObject.h" | |
| 70 #include "core/rendering/RenderListBox.h" | 70 #include "core/rendering/RenderListBox.h" |
| 71 #include "core/rendering/RenderScrollbar.h" | 71 #include "core/rendering/RenderScrollbar.h" |
| 72 #include "core/rendering/RenderScrollbarPart.h" | 72 #include "core/rendering/RenderScrollbarPart.h" |
| 73 #include "core/rendering/RenderView.h" | 73 #include "core/rendering/RenderView.h" |
| 74 #include "core/rendering/svg/RenderSVGRoot.h" | 74 #include "core/rendering/svg/RenderSVGRoot.h" |
| 75 #include "core/svg/SVGDocumentExtensions.h" | 75 #include "core/svg/SVGDocumentExtensions.h" |
| 76 #include "core/svg/SVGSVGElement.h" | 76 #include "core/svg/SVGSVGElement.h" |
| 77 #include "platform/HostWindow.h" | 77 #include "platform/HostWindow.h" |
| 78 #include "platform/RuntimeEnabledFeatures.h" | 78 #include "platform/RuntimeEnabledFeatures.h" |
| 79 #include "platform/ScriptForbiddenScope.h" | 79 #include "platform/ScriptForbiddenScope.h" |
| (...skipping 700 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 780 return; | 780 return; |
| 781 | 781 |
| 782 RenderSVGRoot* svgRoot = toRenderSVGRoot(contentBox); | 782 RenderSVGRoot* svgRoot = toRenderSVGRoot(contentBox); |
| 783 if (svgRoot->everHadLayout() && !svgRoot->needsLayout()) | 783 if (svgRoot->everHadLayout() && !svgRoot->needsLayout()) |
| 784 return; | 784 return; |
| 785 | 785 |
| 786 // If the embedded SVG document appears the first time, the ownerRenderer ha
s already finished | 786 // If the embedded SVG document appears the first time, the ownerRenderer ha
s already finished |
| 787 // layout without knowing about the existence of the embedded SVG document,
because LayoutReplaced | 787 // layout without knowing about the existence of the embedded SVG document,
because LayoutReplaced |
| 788 // embeddedContentBox() returns 0, as long as the embedded document isn't lo
aded yet. Before | 788 // embeddedContentBox() returns 0, as long as the embedded document isn't lo
aded yet. Before |
| 789 // bothering to lay out the SVG document, mark the ownerRenderer needing lay
out and ask its | 789 // bothering to lay out the SVG document, mark the ownerRenderer needing lay
out and ask its |
| 790 // FrameView for a layout. After that the RenderEmbeddedObject (ownerRendere
r) carries the | 790 // FrameView for a layout. After that the LayoutEmbeddedObject (ownerRendere
r) carries the |
| 791 // correct size, which RenderSVGRoot::computeReplacedLogicalWidth/Height rel
y on, when laying | 791 // correct size, which RenderSVGRoot::computeReplacedLogicalWidth/Height rel
y on, when laying |
| 792 // out for the first time, or when the RenderSVGRoot size has changed dynami
cally (eg. via <script>). | 792 // out for the first time, or when the RenderSVGRoot size has changed dynami
cally (eg. via <script>). |
| 793 RefPtrWillBeRawPtr<FrameView> frameView = ownerRenderer->frame()->view(); | 793 RefPtrWillBeRawPtr<FrameView> frameView = ownerRenderer->frame()->view(); |
| 794 | 794 |
| 795 // Mark the owner renderer as needing layout. | 795 // Mark the owner renderer as needing layout. |
| 796 ownerRenderer->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation(); | 796 ownerRenderer->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation(); |
| 797 | 797 |
| 798 // Synchronously enter layout, to layout the view containing the host object
/embed/iframe. | 798 // Synchronously enter layout, to layout the view containing the host object
/embed/iframe. |
| 799 ASSERT(frameView); | 799 ASSERT(frameView); |
| 800 frameView->layout(); | 800 frameView->layout(); |
| (...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1173 | 1173 |
| 1174 // Script or plugins could detach the frame so abort processing if that happ
ens. | 1174 // Script or plugins could detach the frame so abort processing if that happ
ens. |
| 1175 | 1175 |
| 1176 for (size_t i = 0; i < parts.size() && renderView(); ++i) | 1176 for (size_t i = 0; i < parts.size() && renderView(); ++i) |
| 1177 parts[i]->updateWidgetPosition(); | 1177 parts[i]->updateWidgetPosition(); |
| 1178 | 1178 |
| 1179 for (size_t i = 0; i < parts.size() && renderView(); ++i) | 1179 for (size_t i = 0; i < parts.size() && renderView(); ++i) |
| 1180 parts[i]->widgetPositionsUpdated(); | 1180 parts[i]->widgetPositionsUpdated(); |
| 1181 } | 1181 } |
| 1182 | 1182 |
| 1183 void FrameView::addPartToUpdate(RenderEmbeddedObject& object) | 1183 void FrameView::addPartToUpdate(LayoutEmbeddedObject& object) |
| 1184 { | 1184 { |
| 1185 ASSERT(isInPerformLayout()); | 1185 ASSERT(isInPerformLayout()); |
| 1186 // Tell the DOM element that it needs a widget update. | 1186 // Tell the DOM element that it needs a widget update. |
| 1187 Node* node = object.node(); | 1187 Node* node = object.node(); |
| 1188 ASSERT(node); | 1188 ASSERT(node); |
| 1189 if (isHTMLObjectElement(*node) || isHTMLEmbedElement(*node)) | 1189 if (isHTMLObjectElement(*node) || isHTMLEmbedElement(*node)) |
| 1190 toHTMLPlugInElement(node)->setNeedsWidgetUpdate(true); | 1190 toHTMLPlugInElement(node)->setNeedsWidgetUpdate(true); |
| 1191 | 1191 |
| 1192 m_partUpdateSet.add(&object); | 1192 m_partUpdateSet.add(&object); |
| 1193 } | 1193 } |
| (...skipping 821 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2015 // Thus I believe we can stop checking isEmpty here, and just ASSERT isEmpty
: | 2015 // Thus I believe we can stop checking isEmpty here, and just ASSERT isEmpty
: |
| 2016 // FIXME: This assert has been temporarily removed due to https://crbug.com/
430344 | 2016 // FIXME: This assert has been temporarily removed due to https://crbug.com/
430344 |
| 2017 if (m_nestedLayoutCount > 1 || m_partUpdateSet.isEmpty()) | 2017 if (m_nestedLayoutCount > 1 || m_partUpdateSet.isEmpty()) |
| 2018 return true; | 2018 return true; |
| 2019 | 2019 |
| 2020 // Need to swap because script will run inside the below loop and invalidate
the iterator. | 2020 // Need to swap because script will run inside the below loop and invalidate
the iterator. |
| 2021 EmbeddedObjectSet objects; | 2021 EmbeddedObjectSet objects; |
| 2022 objects.swap(m_partUpdateSet); | 2022 objects.swap(m_partUpdateSet); |
| 2023 | 2023 |
| 2024 for (const auto& embeddedObject : objects) { | 2024 for (const auto& embeddedObject : objects) { |
| 2025 RenderEmbeddedObject& object = *embeddedObject; | 2025 LayoutEmbeddedObject& object = *embeddedObject; |
| 2026 HTMLPlugInElement* element = toHTMLPlugInElement(object.node()); | 2026 HTMLPlugInElement* element = toHTMLPlugInElement(object.node()); |
| 2027 | 2027 |
| 2028 // The object may have already been destroyed (thus node cleared), | 2028 // The object may have already been destroyed (thus node cleared), |
| 2029 // but FrameView holds a manual ref, so it won't have been deleted. | 2029 // but FrameView holds a manual ref, so it won't have been deleted. |
| 2030 if (!element) | 2030 if (!element) |
| 2031 continue; | 2031 continue; |
| 2032 | 2032 |
| 2033 // No need to update if it's already crashed or known to be missing. | 2033 // No need to update if it's already crashed or known to be missing. |
| 2034 if (object.showsUnavailablePluginIndicator()) | 2034 if (object.showsUnavailablePluginIndicator()) |
| 2035 continue; | 2035 continue; |
| (...skipping 2015 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4051 { | 4051 { |
| 4052 Settings* settings = frame().settings(); | 4052 Settings* settings = frame().settings(); |
| 4053 if (!settings || !settings->rootLayerScrolls()) | 4053 if (!settings || !settings->rootLayerScrolls()) |
| 4054 return this; | 4054 return this; |
| 4055 | 4055 |
| 4056 RenderView* renderView = this->renderView(); | 4056 RenderView* renderView = this->renderView(); |
| 4057 return renderView ? renderView->scrollableArea() : nullptr; | 4057 return renderView ? renderView->scrollableArea() : nullptr; |
| 4058 } | 4058 } |
| 4059 | 4059 |
| 4060 } // namespace blink | 4060 } // namespace blink |
| OLD | NEW |