diff options
Diffstat (limited to 'WebCore/rendering/RenderTreeAsText.cpp')
-rw-r--r-- | WebCore/rendering/RenderTreeAsText.cpp | 66 |
1 files changed, 32 insertions, 34 deletions
diff --git a/WebCore/rendering/RenderTreeAsText.cpp b/WebCore/rendering/RenderTreeAsText.cpp index cf7e027..2350491 100644 --- a/WebCore/rendering/RenderTreeAsText.cpp +++ b/WebCore/rendering/RenderTreeAsText.cpp @@ -170,13 +170,13 @@ static TextStream &operator<<(TextStream& ts, const RenderObject& o) if (o.style() && o.style()->zIndex()) ts << " zI: " << o.style()->zIndex(); - if (o.element()) { - String tagName = getTagName(o.element()); + if (o.node()) { + String tagName = getTagName(o.node()); if (!tagName.isEmpty()) { ts << " {" << tagName << "}"; // flag empty or unstyled AppleStyleSpan because we never // want to leave them in the DOM - if (isEmptyOrUnstyledAppleStyleSpan(o.element())) + if (isEmptyOrUnstyledAppleStyleSpan(o.node())) ts << " *empty or unstyled AppleStyleSpan*"; } } @@ -192,21 +192,19 @@ static TextStream &operator<<(TextStream& ts, const RenderObject& o) r = IntRect(text.firstRunX(), text.firstRunY(), linesBox.width(), linesBox.height()); if (adjustForTableCells && !text.firstTextBox()) adjustForTableCells = false; - } else if (o.isBox()) { - if (o.isRenderInline()) { - // FIXME: Would be better not to just dump 0, 0 as the x and y here. - const RenderInline& inlineFlow = static_cast<const RenderInline&>(o); - r = IntRect(0, 0, inlineFlow.linesBoundingBox().width(), inlineFlow.linesBoundingBox().height()); - adjustForTableCells = false; - } else if (o.isTableCell()) { - // FIXME: Deliberately dump the "inner" box of table cells, since that is what current results reflect. We'd like - // to clean up the results to dump both the outer box and the intrinsic padding so that both bits of information are - // captured by the results. - const RenderTableCell& cell = static_cast<const RenderTableCell&>(o); - r = IntRect(cell.x(), cell.y() + cell.intrinsicPaddingTop(), cell.width(), cell.height() - cell.intrinsicPaddingTop() - cell.intrinsicPaddingBottom()); - } else - r = toRenderBox(&o)->frameRect(); - } + } else if (o.isRenderInline()) { + // FIXME: Would be better not to just dump 0, 0 as the x and y here. + const RenderInline& inlineFlow = *toRenderInline(&o); + r = IntRect(0, 0, inlineFlow.linesBoundingBox().width(), inlineFlow.linesBoundingBox().height()); + adjustForTableCells = false; + } else if (o.isTableCell()) { + // FIXME: Deliberately dump the "inner" box of table cells, since that is what current results reflect. We'd like + // to clean up the results to dump both the outer box and the intrinsic padding so that both bits of information are + // captured by the results. + const RenderTableCell& cell = static_cast<const RenderTableCell&>(o); + r = IntRect(cell.x(), cell.y() + cell.intrinsicPaddingTop(), cell.width(), cell.height() - cell.intrinsicPaddingTop() - cell.intrinsicPaddingBottom()); + } else if (o.isBox()) + r = toRenderBox(&o)->frameRect(); // FIXME: Temporary in order to ensure compatibility with existing layout test results. if (adjustForTableCells) @@ -237,10 +235,10 @@ static TextStream &operator<<(TextStream& ts, const RenderObject& o) o.style()->textStrokeWidth() > 0) ts << " [textStrokeWidth=" << o.style()->textStrokeWidth() << "]"; - if (!o.isBox()) + if (!o.isBoxModelObject()) return ts; - const RenderBox& box = *toRenderBox(&o); + const RenderBoxModelObject& box = *toRenderBoxModelObject(&o); if (box.borderTop() || box.borderRight() || box.borderBottom() || box.borderLeft()) { ts << " [border:"; @@ -405,7 +403,7 @@ void write(TextStream& ts, const RenderObject& o, int indent) view->layout(); RenderLayer* l = root->layer(); if (l) - writeLayers(ts, l, l, IntRect(l->xPos(), l->yPos(), l->width(), l->height()), indent + 1); + writeLayers(ts, l, l, IntRect(l->x(), l->y(), l->width(), l->height()), indent + 1); } } } @@ -433,9 +431,9 @@ static void write(TextStream& ts, RenderLayer& l, ts << " scrollX " << l.scrollXOffset(); if (l.scrollYOffset()) ts << " scrollY " << l.scrollYOffset(); - if (l.renderer()->clientWidth() != l.scrollWidth()) + if (l.renderBox() && l.renderBox()->clientWidth() != l.scrollWidth()) ts << " scrollWidth " << l.scrollWidth(); - if (l.renderer()->clientHeight() != l.scrollHeight()) + if (l.renderBox() && l.renderBox()->clientHeight() != l.scrollHeight()) ts << " scrollHeight " << l.scrollHeight(); } @@ -459,7 +457,7 @@ static void writeLayers(TextStream& ts, const RenderLayer* rootLayer, RenderLaye // Ensure our lists are up-to-date. l->updateZOrderLists(); - l->updateOverflowList(); + l->updateNormalFlowList(); bool shouldPaint = l->intersectsDamageRect(layerBounds, damageRect, rootLayer); Vector<RenderLayer*>* negList = l->negZOrderList(); @@ -474,10 +472,10 @@ static void writeLayers(TextStream& ts, const RenderLayer* rootLayer, RenderLaye if (shouldPaint) write(ts, *l, layerBounds, damageRect, clipRectToApply, outlineRect, negList && negList->size() > 0, indent); - Vector<RenderLayer*>* overflowList = l->overflowList(); - if (overflowList) { - for (unsigned i = 0; i != overflowList->size(); ++i) - writeLayers(ts, rootLayer, overflowList->at(i), paintDirtyRect, indent); + Vector<RenderLayer*>* normalFlowList = l->normalFlowList(); + if (normalFlowList) { + for (unsigned i = 0; i != normalFlowList->size(); ++i) + writeLayers(ts, rootLayer, normalFlowList->at(i), paintDirtyRect, indent); } Vector<RenderLayer*>* posList = l->posZOrderList(); @@ -509,7 +507,7 @@ static String nodePosition(Node* node) static void writeSelection(TextStream& ts, const RenderObject* o) { - Node* n = o->element(); + Node* n = o->node(); if (!n || !n->isDocumentNode()) return; @@ -518,15 +516,15 @@ static void writeSelection(TextStream& ts, const RenderObject* o) if (!frame) return; - Selection selection = frame->selection()->selection(); + VisibleSelection selection = frame->selection()->selection(); if (selection.isCaret()) { - ts << "caret: position " << selection.start().offset() << " of " << nodePosition(selection.start().node()); + ts << "caret: position " << selection.start().m_offset << " of " << nodePosition(selection.start().node()); if (selection.affinity() == UPSTREAM) ts << " (upstream affinity)"; ts << "\n"; } else if (selection.isRange()) - ts << "selection start: position " << selection.start().offset() << " of " << nodePosition(selection.start().node()) << "\n" - << "selection end: position " << selection.end().offset() << " of " << nodePosition(selection.end().node()) << "\n"; + ts << "selection start: position " << selection.start().m_offset << " of " << nodePosition(selection.start().node()) << "\n" + << "selection end: position " << selection.end().m_offset << " of " << nodePosition(selection.end().node()) << "\n"; } String externalRepresentation(RenderObject* o) @@ -542,7 +540,7 @@ String externalRepresentation(RenderObject* o) o->view()->frameView()->layout(); if (o->hasLayer()) { RenderLayer* l = toRenderBox(o)->layer(); - writeLayers(ts, l, l, IntRect(l->xPos(), l->yPos(), l->width(), l->height())); + writeLayers(ts, l, l, IntRect(l->x(), l->y(), l->width(), l->height())); writeSelection(ts, o); } return ts.release(); |