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

Unified Diff: tracing/tracing/extras/chrome/layout_tree.html

Issue 1911603002: LayoutTree machinery (Closed) Base URL: https://chromium.googlesource.com/external/github.com/catapult-project/catapult.git@master
Patch Set: oops Created 4 years, 7 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
« no previous file with comments | « tracing/tracing/extras/chrome/layout_object.html ('k') | tracing/tracing/extras/chrome/render_frame.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tracing/tracing/extras/chrome/layout_tree.html
diff --git a/tracing/tracing/extras/chrome/layout_tree.html b/tracing/tracing/extras/chrome/layout_tree.html
index 98e8f14e09925e20e9ba4ab7943bf4b677bc7b92..bf57f69fcaa3ef9b69d337b138eb903bd09f10a0 100644
--- a/tracing/tracing/extras/chrome/layout_tree.html
+++ b/tracing/tracing/extras/chrome/layout_tree.html
@@ -5,6 +5,7 @@ Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
+<link rel="import" href="/tracing/extras/chrome/layout_object.html">
<link rel="import" href="/tracing/model/event_registry.html">
<link rel="import" href="/tracing/model/object_instance.html">
@@ -27,11 +28,48 @@ tr.exportTo('tr.e.chrome', function() {
function LayoutTreeSnapshot() {
ObjectSnapshot.apply(this, arguments);
- this.rootLayoutObject = new tr.e.chrome.LayoutObject(this, this.args);
+
+ // If this LayoutTree is a subframe like an iframe, then this is the
+ // LayoutObject that contains it:
+ this.parentLayoutObject_ = undefined;
+
+ // The LocalFrame should be 1:1 with a RenderFrame object, which should be
+ // 1:1 with a FrameTreeNode object.
}
LayoutTreeSnapshot.prototype = {
__proto__: ObjectSnapshot.prototype,
+
+ initialize: function() {
+ this.rootLayoutObject = new tr.e.chrome.LayoutObject(this, this.args);
+ },
+
+ get parentLayoutObject() {
+ return this.parentLayoutObject_;
+ },
+
+ get parentLayoutTreeSnapshot() {
+ if (this.parentLayoutObject)
+ return this.parentLayoutObject.snapshot;
+ return undefined;
+ },
+
+ get rootLayoutTreeSnapshot() {
+ var o = this;
+ while (o.parentLayoutObject && o.parentLayoutObject.snapshot) {
+ o = o.parentLayoutObject.snapshot;
+ }
+ return o;
+ },
+
+ set parentLayoutObject(o) {
+ if (this.parentLayoutObject_) {
+ console.warn('Duplicate parentLayoutObject: ' +
+ 'TODO split LayoutTreeSnapshot ',
+ this.parentLayoutObject, o);
+ }
+ this.parentLayoutObject_ = o;
+ }
};
ObjectSnapshot.register(LayoutTreeSnapshot, {typeName: 'LayoutTree'});
« no previous file with comments | « tracing/tracing/extras/chrome/layout_object.html ('k') | tracing/tracing/extras/chrome/render_frame.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698