Chromium Code Reviews| Index: Source/core/rendering/RenderTreeAsText.cpp |
| diff --git a/Source/core/rendering/RenderTreeAsText.cpp b/Source/core/rendering/RenderTreeAsText.cpp |
| index f416ac0e3650f7032625a97d5b0900492d095ea8..49bf100704c8e6fd35f3ea14064ed638fc579103 100644 |
| --- a/Source/core/rendering/RenderTreeAsText.cpp |
| +++ b/Source/core/rendering/RenderTreeAsText.cpp |
| @@ -477,12 +477,10 @@ void write(TextStream& ts, const RenderObject& o, int indent, RenderAsTextBehavi |
| } |
| // FIXME: temporary hack to avoid rebase of regions tests |
|
Julien - ping for review
2013/11/22 01:23:34
Shouldn't this FIXME be removed? If not, it should
|
| - if (!o.isRenderNamedFlowFragmentContainer()) { |
| - for (RenderObject* child = o.firstChild(); child; child = child->nextSibling()) { |
| - if (child->hasLayer()) |
| - continue; |
| - write(ts, *child, indent + 1, behavior); |
| - } |
| + for (RenderObject* child = o.firstChild(); child; child = child->nextSibling()) { |
| + if (child->hasLayer()) |
| + continue; |
| + write(ts, *child, indent + 1, behavior); |
| } |
| if (o.isWidget()) { |
| @@ -571,24 +569,43 @@ static void writeRenderRegionList(const RenderRegionList& flowThreadRegionList, |
| { |
| for (RenderRegionList::const_iterator itRR = flowThreadRegionList.begin(); itRR != flowThreadRegionList.end(); ++itRR) { |
| RenderRegion* renderRegion = *itRR; |
|
Julien - ping for review
2013/11/22 01:23:34
Any reason |renderRegion| is non-const?
|
| - writeIndent(ts, indent + 2); |
| - ts << "RenderRegion"; |
| + |
| + writeIndent(ts, indent); |
| + ts << static_cast<const RenderObject*>(renderRegion)->renderName(); |
|
Julien - ping for review
2013/11/22 01:23:34
That's just gross and unneeded, RenderRegion is al
|
| + |
| Node* generatingNodeForRegion = renderRegion->generatingNodeForRegion(); |
| if (generatingNodeForRegion) { |
| - String tagName = getTagName(generatingNodeForRegion); |
| - if (!tagName.isEmpty()) |
| - ts << " {" << tagName << "}"; |
| - if (generatingNodeForRegion->isElementNode() && generatingNodeForRegion->hasID()) { |
| - Element* element = toElement(generatingNodeForRegion); |
| - ts << " #" << element->idForStyleResolution(); |
| - } |
| if (renderRegion->hasCustomRegionStyle()) |
| ts << " region style: 1"; |
| if (renderRegion->hasAutoLogicalHeight()) |
| ts << " hasAutoLogicalHeight"; |
| + |
| + bool isRenderNamedFlowFragment = renderRegion->isRenderNamedFlowFragment(); |
| + if (isRenderNamedFlowFragment) |
| + ts << " (anonymous child of"; |
| + |
| + StringBuilder tagName; |
| + tagName.append(generatingNodeForRegion->nodeName()); |
| + |
| + Node* nodeForRegion = renderRegion->nodeForRegion(); |
| + if (nodeForRegion->isPseudoElement()) { |
| + if (nodeForRegion->isBeforePseudoElement()) |
| + tagName.append("::before"); |
| + else if (nodeForRegion->isAfterPseudoElement()) |
| + tagName.append("::after"); |
| + } |
| + |
| + ts << " {" << tagName.toString() << "}"; |
| + |
| + if (generatingNodeForRegion->isElementNode() && generatingNodeForRegion->hasID()) { |
| + Element* element = toElement(generatingNodeForRegion); |
| + ts << " #" << element->idForStyleResolution(); |
| + } |
| + |
| + if (isRenderNamedFlowFragment) |
| + ts << ")"; |
| } |
| - if (!renderRegion->isValid()) |
| - ts << " invalid"; |
|
Julien - ping for review
2013/11/22 01:23:34
Why are we removing this information? (it seems us
|
| + |
| ts << "\n"; |
| } |
| } |
| @@ -602,25 +619,30 @@ static void writeRenderNamedFlowThreads(TextStream& ts, RenderView* renderView, |
| const RenderNamedFlowThreadList* list = renderView->flowThreadController()->renderNamedFlowThreadList(); |
| writeIndent(ts, indent); |
| - ts << "Flow Threads\n"; |
| + ts << "Named flows\n"; |
| for (RenderNamedFlowThreadList::const_iterator iter = list->begin(); iter != list->end(); ++iter) { |
| const RenderNamedFlowThread* renderFlowThread = *iter; |
| writeIndent(ts, indent + 1); |
| - ts << "Thread with flow-name '" << renderFlowThread->flowThreadName() << "'\n"; |
| + ts << "Named flow '" << renderFlowThread->flowThreadName() << "'\n"; |
| RenderLayer* layer = renderFlowThread->layer(); |
| RenderTreeAsText::writeLayers(ts, rootLayer, layer, paintRect, indent + 2, behavior); |
| // Display the valid and invalid render regions attached to this flow thread. |
| const RenderRegionList& validRegionsList = renderFlowThread->renderRegionList(); |
| + if (!validRegionsList.isEmpty()) { |
| + writeIndent(ts, indent + 2); |
| + ts << "Regions for named flow '" << renderFlowThread->flowThreadName() << "'\n"; |
| + writeRenderRegionList(validRegionsList, ts, indent + 3); |
| + } |
| + |
| const RenderRegionList& invalidRegionsList = renderFlowThread->invalidRenderRegionList(); |
| - if (!validRegionsList.isEmpty() || !invalidRegionsList.isEmpty()) { |
| - writeIndent(ts, indent + 1); |
| - ts << "Regions for flow '"<< renderFlowThread->flowThreadName() << "'\n"; |
| - writeRenderRegionList(validRegionsList, ts, indent); |
| - writeRenderRegionList(invalidRegionsList, ts, indent); |
| + if (!invalidRegionsList.isEmpty()) { |
| + writeIndent(ts, indent + 2); |
| + ts << "Invalid regions for named flow '" << renderFlowThread->flowThreadName() << "'\n"; |
| + writeRenderRegionList(invalidRegionsList, ts, indent + 3); |
| } |
| } |
| } |