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

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

Issue 898783003: Move rendering/RenderLayer* to layout/ (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/frame/Frame.cpp ('k') | Source/core/frame/LocalFrame.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 29 matching lines...) Expand all
40 #include "core/fetch/ResourceFetcher.h" 40 #include "core/fetch/ResourceFetcher.h"
41 #include "core/fetch/ResourceLoadPriorityOptimizer.h" 41 #include "core/fetch/ResourceLoadPriorityOptimizer.h"
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/LayoutCounter.h" 51 #include "core/layout/LayoutCounter.h"
51 #include "core/layout/LayoutTheme.h" 52 #include "core/layout/LayoutTheme.h"
52 #include "core/layout/compositing/CompositedLayerMapping.h" 53 #include "core/layout/compositing/CompositedLayerMapping.h"
53 #include "core/layout/compositing/CompositedSelectionBound.h" 54 #include "core/layout/compositing/CompositedSelectionBound.h"
54 #include "core/layout/compositing/RenderLayerCompositor.h" 55 #include "core/layout/compositing/LayerCompositor.h"
55 #include "core/loader/FrameLoader.h" 56 #include "core/loader/FrameLoader.h"
56 #include "core/loader/FrameLoaderClient.h" 57 #include "core/loader/FrameLoaderClient.h"
57 #include "core/page/Chrome.h" 58 #include "core/page/Chrome.h"
58 #include "core/page/ChromeClient.h" 59 #include "core/page/ChromeClient.h"
59 #include "core/page/EventHandler.h" 60 #include "core/page/EventHandler.h"
60 #include "core/page/FocusController.h" 61 #include "core/page/FocusController.h"
61 #include "core/page/FrameTree.h" 62 #include "core/page/FrameTree.h"
62 #include "core/page/Page.h" 63 #include "core/page/Page.h"
63 #include "core/page/scrolling/ScrollingCoordinator.h" 64 #include "core/page/scrolling/ScrollingCoordinator.h"
64 #include "core/paint/FramePainter.h" 65 #include "core/paint/FramePainter.h"
65 #include "core/rendering/RenderEmbeddedObject.h" 66 #include "core/rendering/RenderEmbeddedObject.h"
66 #include "core/rendering/RenderLayer.h"
67 #include "core/rendering/RenderListBox.h" 67 #include "core/rendering/RenderListBox.h"
68 #include "core/rendering/RenderPart.h" 68 #include "core/rendering/RenderPart.h"
69 #include "core/rendering/RenderScrollbar.h" 69 #include "core/rendering/RenderScrollbar.h"
70 #include "core/rendering/RenderScrollbarPart.h" 70 #include "core/rendering/RenderScrollbarPart.h"
71 #include "core/rendering/RenderView.h" 71 #include "core/rendering/RenderView.h"
72 #include "core/rendering/TextAutosizer.h" 72 #include "core/rendering/TextAutosizer.h"
73 #include "core/rendering/style/RenderStyle.h" 73 #include "core/rendering/style/RenderStyle.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"
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 setScrollbarsSuppressed(true); 378 setScrollbarsSuppressed(true);
379 } 379 }
380 380
381 bool FrameView::didFirstLayout() const 381 bool FrameView::didFirstLayout() const
382 { 382 {
383 return !m_firstLayout; 383 return !m_firstLayout;
384 } 384 }
385 385
386 void FrameView::invalidateRect(const IntRect& rect) 386 void FrameView::invalidateRect(const IntRect& rect)
387 { 387 {
388 // For querying RenderLayer::compositingState() when invalidating scrollbars . 388 // For querying Layer::compositingState() when invalidating scrollbars.
389 // FIXME: do all scrollbar invalidations after layout of all frames is compl ete. It's currently not recursively true. 389 // FIXME: do all scrollbar invalidations after layout of all frames is compl ete. It's currently not recursively true.
390 DisableCompositingQueryAsserts disabler; 390 DisableCompositingQueryAsserts disabler;
391 if (!parent()) { 391 if (!parent()) {
392 if (HostWindow* window = hostWindow()) 392 if (HostWindow* window = hostWindow())
393 window->invalidateRect(rect); 393 window->invalidateRect(rect);
394 return; 394 return;
395 } 395 }
396 396
397 RenderPart* renderer = m_frame->ownerRenderer(); 397 RenderPart* renderer = m_frame->ownerRenderer();
398 if (!renderer) 398 if (!renderer)
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after
934 Document* document = m_frame->document(); 934 Document* document = m_frame->document();
935 bool inSubtreeLayout = isSubtreeLayout(); 935 bool inSubtreeLayout = isSubtreeLayout();
936 RenderObject* rootForThisLayout = inSubtreeLayout ? m_layoutSubtreeRoot : do cument->renderView(); 936 RenderObject* rootForThisLayout = inSubtreeLayout ? m_layoutSubtreeRoot : do cument->renderView();
937 if (!rootForThisLayout) { 937 if (!rootForThisLayout) {
938 // FIXME: Do we need to set m_size here? 938 // FIXME: Do we need to set m_size here?
939 ASSERT_NOT_REACHED(); 939 ASSERT_NOT_REACHED();
940 return; 940 return;
941 } 941 }
942 942
943 FontCachePurgePreventer fontCachePurgePreventer; 943 FontCachePurgePreventer fontCachePurgePreventer;
944 RenderLayer* layer; 944 Layer* layer;
945 { 945 {
946 TemporaryChange<bool> changeSchedulingEnabled(m_layoutSchedulingEnabled, false); 946 TemporaryChange<bool> changeSchedulingEnabled(m_layoutSchedulingEnabled, false);
947 947
948 m_nestedLayoutCount++; 948 m_nestedLayoutCount++;
949 if (!inSubtreeLayout) { 949 if (!inSubtreeLayout) {
950 Document* document = m_frame->document(); 950 Document* document = m_frame->document();
951 Node* body = document->body(); 951 Node* body = document->body();
952 if (body && body->renderer()) { 952 if (body && body->renderer()) {
953 if (isHTMLFrameSetElement(*body)) { 953 if (isHTMLFrameSetElement(*body)) {
954 body->renderer()->setChildNeedsLayout(); 954 body->renderer()->setChildNeedsLayout();
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
1333 1333
1334 for (Frame* child = m_frame->tree().firstChild(); child; child = child->tree ().nextSibling()) { 1334 for (Frame* child = m_frame->tree().firstChild(); child; child = child->tree ().nextSibling()) {
1335 if (!child->isLocalFrame()) 1335 if (!child->isLocalFrame())
1336 continue; 1336 continue;
1337 if (FrameView* view = toLocalFrame(child)->view()) 1337 if (FrameView* view = toLocalFrame(child)->view())
1338 view->scrollContentsIfNeededRecursive(); 1338 view->scrollContentsIfNeededRecursive();
1339 } 1339 }
1340 } 1340 }
1341 1341
1342 // FIXME: If we had a flag to force invalidations in a whole subtree, we could g et rid of this function (crbug.com/410097). 1342 // FIXME: If we had a flag to force invalidations in a whole subtree, we could g et rid of this function (crbug.com/410097).
1343 static void setShouldDoFullPaintInvalidationIncludingNonCompositingDescendants(c onst RenderLayer* layer) 1343 static void setShouldDoFullPaintInvalidationIncludingNonCompositingDescendants(c onst Layer* layer)
1344 { 1344 {
1345 layer->renderer()->setShouldDoFullPaintInvalidation(); 1345 layer->renderer()->setShouldDoFullPaintInvalidation();
1346 1346
1347 for (RenderLayer* child = layer->firstChild(); child; child = child->nextSib ling()) { 1347 for (Layer* child = layer->firstChild(); child; child = child->nextSibling() ) {
1348 // Don't include paint invalidation rects for composited child layers; t hey will paint themselves and have a different origin. 1348 // Don't include paint invalidation rects for composited child layers; t hey will paint themselves and have a different origin.
1349 if (child->isPaintInvalidationContainer()) 1349 if (child->isPaintInvalidationContainer())
1350 continue; 1350 continue;
1351 1351
1352 setShouldDoFullPaintInvalidationIncludingNonCompositingDescendants(child ); 1352 setShouldDoFullPaintInvalidationIncludingNonCompositingDescendants(child );
1353 } 1353 }
1354 } 1354 }
1355 1355
1356 bool FrameView::scrollContentsFastPath(const IntSize& scrollDelta) 1356 bool FrameView::scrollContentsFastPath(const IntSize& scrollDelta)
1357 { 1357 {
1358 if (!contentsInCompositedLayer() || hasSlowRepaintObjects()) 1358 if (!contentsInCompositedLayer() || hasSlowRepaintObjects())
1359 return false; 1359 return false;
1360 1360
1361 if (!m_viewportConstrainedObjects || m_viewportConstrainedObjects->isEmpty() ) { 1361 if (!m_viewportConstrainedObjects || m_viewportConstrainedObjects->isEmpty() ) {
1362 InspectorInstrumentation::didScroll(m_frame.get()); 1362 InspectorInstrumentation::didScroll(m_frame.get());
1363 return true; 1363 return true;
1364 } 1364 }
1365 1365
1366 for (const auto& viewportConstrainedObject : *m_viewportConstrainedObjects) { 1366 for (const auto& viewportConstrainedObject : *m_viewportConstrainedObjects) {
1367 RenderObject* renderer = viewportConstrainedObject; 1367 RenderObject* renderer = viewportConstrainedObject;
1368 ASSERT(renderer->style()->hasViewportConstrainedPosition()); 1368 ASSERT(renderer->style()->hasViewportConstrainedPosition());
1369 ASSERT(renderer->hasLayer()); 1369 ASSERT(renderer->hasLayer());
1370 RenderLayer* layer = toRenderBoxModelObject(renderer)->layer(); 1370 Layer* layer = toRenderBoxModelObject(renderer)->layer();
1371 1371
1372 if (layer->isPaintInvalidationContainer()) 1372 if (layer->isPaintInvalidationContainer())
1373 continue; 1373 continue;
1374 1374
1375 if (layer->subtreeIsInvisible()) 1375 if (layer->subtreeIsInvisible())
1376 continue; 1376 continue;
1377 1377
1378 // If the fixed layer has a blur/drop-shadow filter applied on at least one of its parents, we cannot 1378 // If the fixed layer has a blur/drop-shadow filter applied on at least one of its parents, we cannot
1379 // scroll using the fast path, otherwise the outsets of the filter will be moved around the page. 1379 // scroll using the fast path, otherwise the outsets of the filter will be moved around the page.
1380 if (layer->hasAncestorWithFilterOutsets()) 1380 if (layer->hasAncestorWithFilterOutsets())
(...skipping 833 matching lines...) Expand 10 before | Expand all | Expand 10 after
2214 } 2214 }
2215 2215
2216 IntRect FrameView::windowClipRectForFrameOwner(const HTMLFrameOwnerElement* owne rElement) const 2216 IntRect FrameView::windowClipRectForFrameOwner(const HTMLFrameOwnerElement* owne rElement) const
2217 { 2217 {
2218 // The renderer can sometimes be null when style="display:none" interacts 2218 // The renderer can sometimes be null when style="display:none" interacts
2219 // with external content and plugins. 2219 // with external content and plugins.
2220 if (!ownerElement->renderer()) 2220 if (!ownerElement->renderer())
2221 return windowClipRect(); 2221 return windowClipRect();
2222 2222
2223 // If we have no layer, just return our window clip rect. 2223 // If we have no layer, just return our window clip rect.
2224 const RenderLayer* enclosingLayer = ownerElement->renderer()->enclosingLayer (); 2224 const Layer* enclosingLayer = ownerElement->renderer()->enclosingLayer();
2225 if (!enclosingLayer) 2225 if (!enclosingLayer)
2226 return windowClipRect(); 2226 return windowClipRect();
2227 2227
2228 // FIXME: childrenClipRect relies on compositingState, which is not necessar ily up to date. 2228 // FIXME: childrenClipRect relies on compositingState, which is not necessar ily up to date.
2229 // https://code.google.com/p/chromium/issues/detail?id=343769 2229 // https://code.google.com/p/chromium/issues/detail?id=343769
2230 DisableCompositingQueryAsserts disabler; 2230 DisableCompositingQueryAsserts disabler;
2231 2231
2232 // Apply the clip from the layer. 2232 // Apply the clip from the layer.
2233 IntRect clipRect = contentsToWindow(pixelSnappedIntRect(enclosingLayer->clip per().childrenClipRect())); 2233 IntRect clipRect = contentsToWindow(pixelSnappedIntRect(enclosingLayer->clip per().childrenClipRect()));
2234 return intersection(clipRect, windowClipRect()); 2234 return intersection(clipRect, windowClipRect());
(...skipping 1804 matching lines...) Expand 10 before | Expand all | Expand 10 after
4039 { 4039 {
4040 Settings* settings = frame().settings(); 4040 Settings* settings = frame().settings();
4041 if (!settings || !settings->rootLayerScrolls()) 4041 if (!settings || !settings->rootLayerScrolls())
4042 return this; 4042 return this;
4043 4043
4044 RenderView* renderView = this->renderView(); 4044 RenderView* renderView = this->renderView();
4045 return renderView ? renderView->scrollableArea() : nullptr; 4045 return renderView ? renderView->scrollableArea() : nullptr;
4046 } 4046 }
4047 4047
4048 } // namespace blink 4048 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/frame/Frame.cpp ('k') | Source/core/frame/LocalFrame.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698