Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(184)

Side by Side Diff: third_party/WebKit/Source/core/frame/FrameView.cpp

Issue 1785123003: Rework embeddedContentBox into embeddedReplacedContent (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 717 matching lines...) Expand 10 before | Expand all | Expand 10 after
728 else 728 else
729 LayoutSubtreeRootList::countObjectsNeedingLayoutInRoot(layoutView(), nee dsLayoutObjects, totalObjects); 729 LayoutSubtreeRootList::countObjectsNeedingLayoutInRoot(layoutView(), nee dsLayoutObjects, totalObjects);
730 } 730 }
731 731
732 inline void FrameView::forceLayoutParentViewIfNeeded() 732 inline void FrameView::forceLayoutParentViewIfNeeded()
733 { 733 {
734 LayoutPart* ownerLayoutObject = m_frame->ownerLayoutObject(); 734 LayoutPart* ownerLayoutObject = m_frame->ownerLayoutObject();
735 if (!ownerLayoutObject || !ownerLayoutObject->frame()) 735 if (!ownerLayoutObject || !ownerLayoutObject->frame())
736 return; 736 return;
737 737
738 LayoutBox* contentBox = embeddedContentBox(); 738 LayoutReplaced* contentBox = embeddedReplacedContent();
739 if (!contentBox) 739 if (!contentBox)
740 return; 740 return;
741 741
742 LayoutSVGRoot* svgRoot = toLayoutSVGRoot(contentBox); 742 LayoutSVGRoot* svgRoot = toLayoutSVGRoot(contentBox);
743 if (svgRoot->everHadLayout() && !svgRoot->needsLayout()) 743 if (svgRoot->everHadLayout() && !svgRoot->needsLayout())
744 return; 744 return;
745 745
746 // If the embedded SVG document appears the first time, the ownerLayoutObjec t has already finished 746 // If the embedded SVG document appears the first time, the ownerLayoutObjec t has already finished
747 // layout without knowing about the existence of the embedded SVG document, because LayoutReplaced 747 // layout without knowing about the existence of the embedded SVG document, because LayoutReplaced
748 // embeddedContentBox() returns 0, as long as the embedded document isn't lo aded yet. Before 748 // embeddedReplacedContent() returns 0, as long as the embedded document isn 't loaded yet. Before
749 // bothering to lay out the SVG document, mark the ownerLayoutObject needing layout and ask its 749 // bothering to lay out the SVG document, mark the ownerLayoutObject needing layout and ask its
750 // FrameView for a layout. After that the LayoutEmbeddedObject (ownerLayoutO bject) carries the 750 // FrameView for a layout. After that the LayoutEmbeddedObject (ownerLayoutO bject) carries the
751 // correct size, which LayoutSVGRoot::computeReplacedLogicalWidth/Height rel y on, when laying 751 // correct size, which LayoutSVGRoot::computeReplacedLogicalWidth/Height rel y on, when laying
752 // out for the first time, or when the LayoutSVGRoot size has changed dynami cally (eg. via <script>). 752 // out for the first time, or when the LayoutSVGRoot size has changed dynami cally (eg. via <script>).
753 RefPtrWillBeRawPtr<FrameView> frameView = ownerLayoutObject->frame()->view() ; 753 RefPtrWillBeRawPtr<FrameView> frameView = ownerLayoutObject->frame()->view() ;
754 754
755 // Mark the owner layoutObject as needing layout. 755 // Mark the owner layoutObject as needing layout.
756 ownerLayoutObject->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation (LayoutInvalidationReason::Unknown); 756 ownerLayoutObject->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation (LayoutInvalidationReason::Unknown);
757 757
758 // Synchronously enter layout, to layout the view containing the host object /embed/iframe. 758 // Synchronously enter layout, to layout the view containing the host object /embed/iframe.
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
1165 1165
1166 size.scale(1 / zoom); 1166 size.scale(1 / zoom);
1167 return size; 1167 return size;
1168 } 1168 }
1169 1169
1170 DocumentLifecycle& FrameView::lifecycle() const 1170 DocumentLifecycle& FrameView::lifecycle() const
1171 { 1171 {
1172 return m_frame->document()->lifecycle(); 1172 return m_frame->document()->lifecycle();
1173 } 1173 }
1174 1174
1175 LayoutBox* FrameView::embeddedContentBox() const 1175 LayoutReplaced* FrameView::embeddedReplacedContent() const
1176 { 1176 {
1177 LayoutView* layoutView = this->layoutView(); 1177 LayoutView* layoutView = this->layoutView();
1178 if (!layoutView) 1178 if (!layoutView)
1179 return nullptr; 1179 return nullptr;
1180 1180
1181 LayoutObject* firstChild = layoutView->firstChild(); 1181 LayoutObject* firstChild = layoutView->firstChild();
1182 if (!firstChild || !firstChild->isBox()) 1182 if (!firstChild || !firstChild->isBox())
1183 return nullptr; 1183 return nullptr;
1184 1184
1185 // Curently only embedded SVG documents participate in the size-negotiation logic. 1185 // Currently only embedded SVG documents participate in the size-negotiation logic.
1186 if (firstChild->isSVGRoot()) 1186 if (firstChild->isSVGRoot())
1187 return toLayoutBox(firstChild); 1187 return toLayoutSVGRoot(firstChild);
1188 1188
1189 return nullptr; 1189 return nullptr;
1190 } 1190 }
1191 1191
1192 1192
1193 void FrameView::addPart(LayoutPart* object) 1193 void FrameView::addPart(LayoutPart* object)
1194 { 1194 {
1195 m_parts.add(object); 1195 m_parts.add(object);
1196 } 1196 }
1197 1197
(...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after
1844 // layout in that case. 1844 // layout in that case.
1845 1845
1846 LayoutView* layoutView = this->layoutView(); 1846 LayoutView* layoutView = this->layoutView();
1847 return layoutPending() 1847 return layoutPending()
1848 || (layoutView && layoutView->needsLayout()) 1848 || (layoutView && layoutView->needsLayout())
1849 || isSubtreeLayout(); 1849 || isSubtreeLayout();
1850 } 1850 }
1851 1851
1852 void FrameView::setNeedsLayout() 1852 void FrameView::setNeedsLayout()
1853 { 1853 {
1854 LayoutBox* box = embeddedContentBox(); 1854 LayoutReplaced* box = embeddedReplacedContent();
1855 // It's illegal to ask for layout changes during the layout compositing or p aint invalidation step. 1855 // It's illegal to ask for layout changes during the layout compositing or p aint invalidation step.
1856 // FIXME: the third conditional is a hack to support embedded SVG. See Frame View::forceLayoutParentViewIfNeeded and crbug.com/442939 1856 // FIXME: the third conditional is a hack to support embedded SVG. See Frame View::forceLayoutParentViewIfNeeded and crbug.com/442939
1857 RELEASE_ASSERT(!m_frame->document() || m_frame->document()->lifecycle().stat eAllowsLayoutInvalidation() || (box && box->isSVGRoot())); 1857 RELEASE_ASSERT(!m_frame->document() || m_frame->document()->lifecycle().stat eAllowsLayoutInvalidation() || (box && box->isSVGRoot()));
1858 1858
1859 if (LayoutView* layoutView = this->layoutView()) 1859 if (LayoutView* layoutView = this->layoutView())
1860 layoutView->setNeedsLayout(LayoutInvalidationReason::Unknown); 1860 layoutView->setNeedsLayout(LayoutInvalidationReason::Unknown);
1861 } 1861 }
1862 1862
1863 bool FrameView::isTransparent() const 1863 bool FrameView::isTransparent() const
1864 { 1864 {
(...skipping 2244 matching lines...) Expand 10 before | Expand all | Expand 10 after
4109 return m_hiddenForThrottling && m_crossOriginForThrottling; 4109 return m_hiddenForThrottling && m_crossOriginForThrottling;
4110 } 4110 }
4111 4111
4112 LayoutBox& FrameView::boxForScrollControlPaintInvalidation() const 4112 LayoutBox& FrameView::boxForScrollControlPaintInvalidation() const
4113 { 4113 {
4114 ASSERT(layoutView()); 4114 ASSERT(layoutView());
4115 return *layoutView(); 4115 return *layoutView();
4116 } 4116 }
4117 4117
4118 } // namespace blink 4118 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameView.h ('k') | third_party/WebKit/Source/core/layout/LayoutEmbeddedObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698