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

Unified Diff: Source/core/layout/LayoutTreeAsText.cpp

Issue 1188363002: Compute the normal flow list on the fly (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix reverse iterator (OOPS). Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/layout/LayoutTreeAsText.cpp
diff --git a/Source/core/layout/LayoutTreeAsText.cpp b/Source/core/layout/LayoutTreeAsText.cpp
index 7c213b27104ca8cb38f410b9ab44b4396a2a30ea..28110c706f27f951ef881c6598c24bdb5c07bcee 100644
--- a/Source/core/layout/LayoutTreeAsText.cpp
+++ b/Source/core/layout/LayoutTreeAsText.cpp
@@ -642,6 +642,15 @@ static void write(TextStream& ts, DeprecatedPaintLayer& layer,
write(ts, *layer.layoutObject(), indent + 1, behavior);
}
+static Vector<DeprecatedPaintLayerStackingNode*> normalFlowListFor(DeprecatedPaintLayerStackingNode* node)
+{
+ DeprecatedPaintLayerStackingNodeIterator it(*node, NormalFlowChildren);
+ Vector<DeprecatedPaintLayerStackingNode*> vector;
+ while (DeprecatedPaintLayerStackingNode* normalFlowChild = it.next())
+ vector.append(normalFlowChild);
+ return vector;
+}
+
void LayoutTreeAsText::writeLayers(TextStream& ts, const DeprecatedPaintLayer* rootLayer, DeprecatedPaintLayer* layer,
const LayoutRect& paintRect, int indent, LayoutAsTextBehavior behavior)
{
@@ -674,15 +683,16 @@ void LayoutTreeAsText::writeLayers(TextStream& ts, const DeprecatedPaintLayer* r
if (shouldPaint)
write(ts, *layer, layerBounds, damageRect.rect(), clipRectToApply.rect(), outlineRect.rect(), paintsBackgroundSeparately ? LayerPaintPhaseForeground : LayerPaintPhaseAll, indent, behavior);
- if (Vector<DeprecatedPaintLayerStackingNode*>* normalFlowList = layer->stackingNode()->normalFlowList()) {
+ Vector<DeprecatedPaintLayerStackingNode*> normalFlowList = normalFlowListFor(layer->stackingNode());
+ if (!normalFlowList.isEmpty()) {
int currIndent = indent;
if (behavior & LayoutAsTextShowLayerNesting) {
writeIndent(ts, indent);
- ts << " normal flow list(" << normalFlowList->size() << ")\n";
+ ts << " normal flow list(" << normalFlowList.size() << ")\n";
++currIndent;
}
- for (unsigned i = 0; i != normalFlowList->size(); ++i)
- writeLayers(ts, rootLayer, normalFlowList->at(i)->layer(), paintRect, currIndent, behavior);
+ for (unsigned i = 0; i != normalFlowList.size(); ++i)
+ writeLayers(ts, rootLayer, normalFlowList.at(i)->layer(), paintRect, currIndent, behavior);
}
if (Vector<DeprecatedPaintLayerStackingNode*>* posList = layer->stackingNode()->posZOrderList()) {
« no previous file with comments | « no previous file | Source/core/paint/DeprecatedPaintLayer.cpp » ('j') | Source/core/paint/DeprecatedPaintLayer.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698