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

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

Issue 13937017: Implement lazy block layout prototype behind a runtime flag. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 8 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
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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 #include "core/platform/graphics/FontCache.h" 61 #include "core/platform/graphics/FontCache.h"
62 #include "core/platform/graphics/GraphicsContext.h" 62 #include "core/platform/graphics/GraphicsContext.h"
63 #include "core/platform/text/TextStream.h" 63 #include "core/platform/text/TextStream.h"
64 #include "core/rendering/RenderArena.h" 64 #include "core/rendering/RenderArena.h"
65 #include "core/rendering/RenderEmbeddedObject.h" 65 #include "core/rendering/RenderEmbeddedObject.h"
66 #include "core/rendering/RenderFullScreen.h" 66 #include "core/rendering/RenderFullScreen.h"
67 #include "core/rendering/RenderIFrame.h" 67 #include "core/rendering/RenderIFrame.h"
68 #include "core/rendering/RenderLayer.h" 68 #include "core/rendering/RenderLayer.h"
69 #include "core/rendering/RenderLayerBacking.h" 69 #include "core/rendering/RenderLayerBacking.h"
70 #include "core/rendering/RenderLayerCompositor.h" 70 #include "core/rendering/RenderLayerCompositor.h"
71 #include "core/rendering/RenderLazyBlock.h"
71 #include "core/rendering/RenderPart.h" 72 #include "core/rendering/RenderPart.h"
72 #include "core/rendering/RenderScrollbar.h" 73 #include "core/rendering/RenderScrollbar.h"
73 #include "core/rendering/RenderScrollbarPart.h" 74 #include "core/rendering/RenderScrollbarPart.h"
74 #include "core/rendering/RenderTheme.h" 75 #include "core/rendering/RenderTheme.h"
75 #include "core/rendering/RenderView.h" 76 #include "core/rendering/RenderView.h"
76 #include "core/rendering/TextAutosizer.h" 77 #include "core/rendering/TextAutosizer.h"
77 #include "core/rendering/style/RenderStyle.h" 78 #include "core/rendering/style/RenderStyle.h"
78 79
79 #include <wtf/CurrentTime.h> 80 #include <wtf/CurrentTime.h>
80 #include <wtf/TemporaryChange.h> 81 #include <wtf/TemporaryChange.h>
(...skipping 1031 matching lines...) Expand 10 before | Expand all | Expand 10 after
1112 endDeferredRepaints(); 1113 endDeferredRepaints();
1113 1114
1114 updateCompositingLayersAfterLayout(); 1115 updateCompositingLayersAfterLayout();
1115 1116
1116 m_layoutCount++; 1117 m_layoutCount++;
1117 1118
1118 if (AXObjectCache* cache = root->document()->existingAXObjectCache()) 1119 if (AXObjectCache* cache = root->document()->existingAXObjectCache())
1119 cache->postNotification(root, AXObjectCache::AXLayoutComplete, true); 1120 cache->postNotification(root, AXObjectCache::AXLayoutComplete, true);
1120 updateAnnotatedRegions(); 1121 updateAnnotatedRegions();
1121 1122
1123 layoutLazyBlocks();
1124
1122 ASSERT(!root->needsLayout()); 1125 ASSERT(!root->needsLayout());
1123 1126
1124 updateCanBlitOnScrollRecursively(); 1127 updateCanBlitOnScrollRecursively();
1125 1128
1126 if (document->hasListenerType(Document::OVERFLOWCHANGED_LISTENER)) 1129 if (document->hasListenerType(Document::OVERFLOWCHANGED_LISTENER))
1127 updateOverflowStatus(layoutWidth() < contentsWidth(), 1130 updateOverflowStatus(layoutWidth() < contentsWidth(),
1128 layoutHeight() < contentsHeight()); 1131 layoutHeight() < contentsHeight());
1129 1132
1130 if (!m_postLayoutTasksTimer.isActive()) { 1133 if (!m_postLayoutTasksTimer.isActive()) {
1131 if (!m_inSynchronousPostLayout) { 1134 if (!m_inSynchronousPostLayout) {
(...skipping 29 matching lines...) Expand all
1161 if (m_nestedLayoutCount) 1164 if (m_nestedLayoutCount)
1162 return; 1165 return;
1163 1166
1164 Page* page = frame() ? frame()->page() : 0; 1167 Page* page = frame() ? frame()->page() : 0;
1165 if (!page) 1168 if (!page)
1166 return; 1169 return;
1167 1170
1168 page->chrome()->client()->layoutUpdated(frame()); 1171 page->chrome()->client()->layoutUpdated(frame());
1169 } 1172 }
1170 1173
1174 void FrameView::layoutLazyBlocks()
1175 {
1176 // FIXME: This infinite recursion protection would seem to break plugins
1177 // doing things that require lazy blocks to layout.
1178 if (m_nestedLayoutCount != 1)
1179 return;
1180
1181 if (!renderView()->firstLazyBlock())
eseidel 2013/04/27 09:09:34 Is this expensive?
1182 return;
1183
1184 // First mark all lazy blocks as needing layout and perform another layout.
1185 for (RenderLazyBlock* block = renderView()->firstLazyBlock(); block; block = block->next())
1186 block->markForNestedLayout();
1187
1188 layout();
1189
1190 // FIXME: This is pretty awful if you start nesting lazy blocks, we should
1191 // signal to the nested blocks to avoid doing work until the second pass.
1192
1193 // Next walk all lazy blocks and find nested ones, these need another layout
1194 // since the first one would not have placed them correctly inside the viewp ort.
1195 for (RenderLazyBlock* block = renderView()->firstLazyBlock(); block; block = block->next()) {
1196 if (!block->isNested())
1197 continue;
1198 block->setNeedsLayout(true);
1199 layout();
1200 }
1201 }
1202
1171 RenderBox* FrameView::embeddedContentBox() const 1203 RenderBox* FrameView::embeddedContentBox() const
1172 { 1204 {
1173 #if ENABLE(SVG) 1205 #if ENABLE(SVG)
1174 RenderView* renderView = this->renderView(); 1206 RenderView* renderView = this->renderView();
1175 if (!renderView) 1207 if (!renderView)
1176 return 0; 1208 return 0;
1177 1209
1178 RenderObject* firstChild = renderView->firstChild(); 1210 RenderObject* firstChild = renderView->firstChild();
1179 if (!firstChild || !firstChild->isBox()) 1211 if (!firstChild || !firstChild->isBox())
1180 return 0; 1212 return 0;
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after
1637 1669
1638 1670
1639 void FrameView::scrollPositionChanged() 1671 void FrameView::scrollPositionChanged()
1640 { 1672 {
1641 frame()->eventHandler()->sendScrollEvent(); 1673 frame()->eventHandler()->sendScrollEvent();
1642 frame()->eventHandler()->dispatchFakeMouseMoveEventSoon(); 1674 frame()->eventHandler()->dispatchFakeMouseMoveEventSoon();
1643 1675
1644 if (RenderView* renderView = this->renderView()) { 1676 if (RenderView* renderView = this->renderView()) {
1645 if (renderView->usesCompositing()) 1677 if (renderView->usesCompositing())
1646 renderView->compositor()->frameViewDidScroll(); 1678 renderView->compositor()->frameViewDidScroll();
1679
1680 renderView->markLazyBlocksForLayout();
1647 } 1681 }
1648 } 1682 }
1649 1683
1650 void FrameView::repaintFixedElementsAfterScrolling() 1684 void FrameView::repaintFixedElementsAfterScrolling()
1651 { 1685 {
1652 // For fixed position elements, update widget positions and compositing laye rs after scrolling, 1686 // For fixed position elements, update widget positions and compositing laye rs after scrolling,
1653 // but only if we're not inside of layout. 1687 // but only if we're not inside of layout.
1654 if (!m_nestedLayoutCount && hasViewportConstrainedObjects()) { 1688 if (!m_nestedLayoutCount && hasViewportConstrainedObjects()) {
1655 if (RenderView* renderView = this->renderView()) { 1689 if (RenderView* renderView = this->renderView()) {
1656 renderView->updateWidgetPositions(); 1690 renderView->updateWidgetPositions();
(...skipping 1888 matching lines...) Expand 10 before | Expand all | Expand 10 after
3545 } 3579 }
3546 3580
3547 AXObjectCache* FrameView::axObjectCache() const 3581 AXObjectCache* FrameView::axObjectCache() const
3548 { 3582 {
3549 if (frame() && frame()->document()) 3583 if (frame() && frame()->document())
3550 return frame()->document()->existingAXObjectCache(); 3584 return frame()->document()->existingAXObjectCache();
3551 return 0; 3585 return 0;
3552 } 3586 }
3553 3587
3554 } // namespace WebCore 3588 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698