提交 10cda2fe 编写于 作者: H Hixie

Include DETACHED, NEEDS-LAYOUT, and relayoutSubtreeRoot info in the debug...

Include DETACHED, NEEDS-LAYOUT, and relayoutSubtreeRoot info in the debug output for the render tree

R=chinmaygarde@google.com

Review URL: https://codereview.chromium.org/1149083011
上级 c5c3f31a
......@@ -222,9 +222,22 @@ abstract class RenderObject extends AbstractNode {
String toString([String prefix = '']) {
String header = '${runtimeType}\n';
String header = '${runtimeType}';
if (_relayoutSubtreeRoot != null && _relayoutSubtreeRoot != this) {
int count = 1;
RenderObject target = parent;
while (target != null && target != _relayoutSubtreeRoot) {
target = target.parent as RenderObject;
count += 1;
}
header += ' relayoutSubtreeRoot=up$count';
}
if (_needsLayout)
header += ' NEEDS-LAYOUT';
if (!attached)
header += ' DETACHED';
prefix += ' ';
return '${header}${debugDescribeSettings(prefix)}${debugDescribeChildren(prefix)}';
return '${header}\n${debugDescribeSettings(prefix)}${debugDescribeChildren(prefix)}';
}
String debugDescribeSettings(String prefix) => '${prefix}parentData: ${parentData}\n';
String debugDescribeChildren(String prefix) => '';
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册