| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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/LayoutEmbeddedObject.h" |
| 53 #include "core/layout/LayoutPart.h" | 53 #include "core/layout/LayoutPart.h" |
| 54 #include "core/layout/LayoutTheme.h" | 54 #include "core/layout/LayoutTheme.h" |
| 55 #include "core/layout/TextAutosizer.h" | 55 #include "core/layout/TextAutosizer.h" |
| 56 #include "core/layout/compositing/CompositedLayerMapping.h" | 56 #include "core/layout/compositing/CompositedLayerMapping.h" |
| 57 #include "core/layout/compositing/CompositedSelectionBound.h" | 57 #include "core/layout/compositing/CompositedSelectionBound.h" |
| 58 #include "core/layout/compositing/LayerCompositor.h" | 58 #include "core/layout/compositing/LayerCompositor.h" |
| 59 #include "core/layout/style/LayoutStyle.h" | 59 #include "core/layout/style/LayoutStyle.h" |
| 60 #include "core/layout/svg/LayoutSVGRoot.h" |
| 60 #include "core/loader/FrameLoader.h" | 61 #include "core/loader/FrameLoader.h" |
| 61 #include "core/loader/FrameLoaderClient.h" | 62 #include "core/loader/FrameLoaderClient.h" |
| 62 #include "core/page/Chrome.h" | 63 #include "core/page/Chrome.h" |
| 63 #include "core/page/ChromeClient.h" | 64 #include "core/page/ChromeClient.h" |
| 64 #include "core/page/EventHandler.h" | 65 #include "core/page/EventHandler.h" |
| 65 #include "core/page/FocusController.h" | 66 #include "core/page/FocusController.h" |
| 66 #include "core/page/FrameTree.h" | 67 #include "core/page/FrameTree.h" |
| 67 #include "core/page/Page.h" | 68 #include "core/page/Page.h" |
| 68 #include "core/page/scrolling/ScrollingCoordinator.h" | 69 #include "core/page/scrolling/ScrollingCoordinator.h" |
| 69 #include "core/paint/FramePainter.h" | 70 #include "core/paint/FramePainter.h" |
| 70 #include "core/rendering/RenderListBox.h" | 71 #include "core/rendering/RenderListBox.h" |
| 71 #include "core/rendering/RenderScrollbar.h" | 72 #include "core/rendering/RenderScrollbar.h" |
| 72 #include "core/rendering/RenderScrollbarPart.h" | 73 #include "core/rendering/RenderScrollbarPart.h" |
| 73 #include "core/rendering/RenderView.h" | 74 #include "core/rendering/RenderView.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" |
| 80 #include "platform/TraceEvent.h" | 80 #include "platform/TraceEvent.h" |
| 81 #include "platform/fonts/FontCache.h" | 81 #include "platform/fonts/FontCache.h" |
| 82 #include "platform/geometry/FloatRect.h" | 82 #include "platform/geometry/FloatRect.h" |
| 83 #include "platform/graphics/GraphicsContext.h" | 83 #include "platform/graphics/GraphicsContext.h" |
| 84 #include "platform/graphics/GraphicsContextStateSaver.h" | 84 #include "platform/graphics/GraphicsContextStateSaver.h" |
| (...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 581 // Handle the overflow:hidden/scroll case for the body/html elements. WinIE
treats | 581 // Handle the overflow:hidden/scroll case for the body/html elements. WinIE
treats |
| 582 // overflow:hidden and overflow:scroll on <body> as applying to the document
's | 582 // overflow:hidden and overflow:scroll on <body> as applying to the document
's |
| 583 // scrollbars. The CSS2.1 draft states that HTML UAs should use the <html>
or <body> element and XML/XHTML UAs should | 583 // scrollbars. The CSS2.1 draft states that HTML UAs should use the <html>
or <body> element and XML/XHTML UAs should |
| 584 // use the root element. | 584 // use the root element. |
| 585 | 585 |
| 586 EOverflow overflowX = o->style()->overflowX(); | 586 EOverflow overflowX = o->style()->overflowX(); |
| 587 EOverflow overflowY = o->style()->overflowY(); | 587 EOverflow overflowY = o->style()->overflowY(); |
| 588 | 588 |
| 589 if (o->isSVGRoot()) { | 589 if (o->isSVGRoot()) { |
| 590 // Don't allow overflow to affect <img> and css backgrounds | 590 // Don't allow overflow to affect <img> and css backgrounds |
| 591 if (toRenderSVGRoot(o)->isEmbeddedThroughSVGImage()) | 591 if (toLayoutSVGRoot(o)->isEmbeddedThroughSVGImage()) |
| 592 return; | 592 return; |
| 593 | 593 |
| 594 // FIXME: evaluate if we can allow overflow for these cases too. | 594 // FIXME: evaluate if we can allow overflow for these cases too. |
| 595 // Overflow is always hidden when stand-alone SVG documents are embedded
. | 595 // Overflow is always hidden when stand-alone SVG documents are embedded
. |
| 596 if (toRenderSVGRoot(o)->isEmbeddedThroughFrameContainingSVGDocument()) { | 596 if (toLayoutSVGRoot(o)->isEmbeddedThroughFrameContainingSVGDocument()) { |
| 597 overflowX = OHIDDEN; | 597 overflowX = OHIDDEN; |
| 598 overflowY = OHIDDEN; | 598 overflowY = OHIDDEN; |
| 599 } | 599 } |
| 600 } | 600 } |
| 601 | 601 |
| 602 bool ignoreOverflowHidden = false; | 602 bool ignoreOverflowHidden = false; |
| 603 if (m_frame->settings()->ignoreMainFrameOverflowHiddenQuirk() && m_frame->is
MainFrame()) | 603 if (m_frame->settings()->ignoreMainFrameOverflowHiddenQuirk() && m_frame->is
MainFrame()) |
| 604 ignoreOverflowHidden = true; | 604 ignoreOverflowHidden = true; |
| 605 | 605 |
| 606 switch (overflowX) { | 606 switch (overflowX) { |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 772 inline void FrameView::forceLayoutParentViewIfNeeded() | 772 inline void FrameView::forceLayoutParentViewIfNeeded() |
| 773 { | 773 { |
| 774 LayoutPart* ownerRenderer = m_frame->ownerRenderer(); | 774 LayoutPart* ownerRenderer = m_frame->ownerRenderer(); |
| 775 if (!ownerRenderer || !ownerRenderer->frame()) | 775 if (!ownerRenderer || !ownerRenderer->frame()) |
| 776 return; | 776 return; |
| 777 | 777 |
| 778 RenderBox* contentBox = embeddedContentBox(); | 778 RenderBox* contentBox = embeddedContentBox(); |
| 779 if (!contentBox) | 779 if (!contentBox) |
| 780 return; | 780 return; |
| 781 | 781 |
| 782 RenderSVGRoot* svgRoot = toRenderSVGRoot(contentBox); | 782 LayoutSVGRoot* svgRoot = toLayoutSVGRoot(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 LayoutEmbeddedObject (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 LayoutSVGRoot::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 LayoutSVGRoot 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(); |
| 801 } | 801 } |
| 802 | 802 |
| (...skipping 3248 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 |