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

Unified Diff: third_party/WebKit/Source/core/layout/svg/SVGLayoutTreeAsText.cpp

Issue 2521473002: Change SVG layout tree output to be more meaningful and consistent (Closed)
Patch Set: - Created 4 years, 1 month 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
« no previous file with comments | « third_party/WebKit/LayoutTests/svg/zoom/page/zoom-svg-as-object-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/svg/SVGLayoutTreeAsText.cpp
diff --git a/third_party/WebKit/Source/core/layout/svg/SVGLayoutTreeAsText.cpp b/third_party/WebKit/Source/core/layout/svg/SVGLayoutTreeAsText.cpp
index c5ba080d627aa0e127cdb465ef0e9ed995d7596f..59881ff7beba50391dd2fa57aa7cf822a2284380 100644
--- a/third_party/WebKit/Source/core/layout/svg/SVGLayoutTreeAsText.cpp
+++ b/third_party/WebKit/Source/core/layout/svg/SVGLayoutTreeAsText.cpp
@@ -327,8 +327,7 @@ static void writeStyle(TextStream& ts, const LayoutObject& object) {
static TextStream& writePositionAndStyle(TextStream& ts,
const LayoutObject& object) {
- ts << " " << enclosingIntRect(
- const_cast<LayoutObject&>(object).absoluteVisualRect());
+ ts << " " << object.objectBoundingBox();
writeStyle(ts, object);
return ts;
}
@@ -394,7 +393,9 @@ static TextStream& operator<<(TextStream& ts, const LayoutSVGShape& shape) {
}
static TextStream& operator<<(TextStream& ts, const LayoutSVGRoot& root) {
- return writePositionAndStyle(ts, root);
+ ts << " " << root.frameRect();
+ writeStyle(ts, root);
+ return ts;
}
static void writeLayoutSVGTextBox(TextStream& ts, const LayoutSVGText& text) {
@@ -402,19 +403,16 @@ static void writeLayoutSVGTextBox(TextStream& ts, const LayoutSVGText& text) {
if (!box)
return;
- ts << " " << enclosingIntRect(LayoutRect(
- LayoutPoint(text.location()),
- LayoutSize(box->logicalWidth(), box->logicalHeight())));
-
// FIXME: Remove this hack, once the new text layout engine is completly
// landed. We want to preserve the old layout test results for now.
ts << " contains 1 chunk(s)";
if (text.parent() && (text.parent()->resolveColor(CSSPropertyColor) !=
- text.resolveColor(CSSPropertyColor)))
+ text.resolveColor(CSSPropertyColor))) {
writeNameValuePair(
ts, "color",
text.resolveColor(CSSPropertyColor).nameForLayoutTreeAsText());
+ }
}
static inline void writeSVGInlineTextBox(TextStream& ts,
@@ -655,6 +653,7 @@ void write(TextStream& ts, const LayoutSVGRoot& root, int indent) {
void writeSVGText(TextStream& ts, const LayoutSVGText& text, int indent) {
writeStandardPrefix(ts, text, indent);
+ writePositionAndStyle(ts, text);
writeLayoutSVGTextBox(ts, text);
ts << "\n";
writeResources(ts, text, indent);
@@ -665,9 +664,8 @@ void writeSVGInlineText(TextStream& ts,
const LayoutSVGInlineText& text,
int indent) {
writeStandardPrefix(ts, text, indent);
- ts << " " << enclosingIntRect(FloatRect(text.firstRunOrigin(),
- text.floatLinesBoundingBox().size()))
- << "\n";
+ writePositionAndStyle(ts, text);
+ ts << "\n";
writeResources(ts, text, indent);
writeSVGInlineTextBoxes(ts, text, indent);
}
« no previous file with comments | « third_party/WebKit/LayoutTests/svg/zoom/page/zoom-svg-as-object-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698