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

Unified Diff: Source/core/layout/TracedLayoutObject.cpp

Issue 1305043007: Don't trace LayoutObject geometry prior to running layout. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 3 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
« Source/core/frame/FrameView.cpp ('K') | « Source/core/layout/TracedLayoutObject.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/TracedLayoutObject.cpp
diff --git a/Source/core/layout/TracedLayoutObject.cpp b/Source/core/layout/TracedLayoutObject.cpp
index 68f5281b12a3a960c08690bfdbd5d7605bf8c6d5..ee60df3dcdedfef88bb996b50d8a887137531a8c 100644
--- a/Source/core/layout/TracedLayoutObject.cpp
+++ b/Source/core/layout/TracedLayoutObject.cpp
@@ -13,9 +13,9 @@
namespace blink {
-PassRefPtr<TraceEvent::ConvertableToTraceFormat> TracedLayoutObject::create(const LayoutView& view)
+PassRefPtr<TraceEvent::ConvertableToTraceFormat> TracedLayoutObject::create(const LayoutView& view, bool traceGeometry)
{
- return adoptRef(new TracedLayoutObject(view));
+ return adoptRef(new TracedLayoutObject(view, traceGeometry));
}
String TracedLayoutObject::asTraceFormat() const
@@ -26,7 +26,7 @@ String TracedLayoutObject::asTraceFormat() const
return builder.toString();
}
-TracedLayoutObject::TracedLayoutObject(const LayoutObject& object)
+TracedLayoutObject::TracedLayoutObject(const LayoutObject& object, bool traceGeometry)
: m_address((unsigned long) &object)
, m_isAnonymous(object.isAnonymous())
, m_isPositioned(object.isOutOfFlowPositioned())
@@ -39,7 +39,7 @@ TracedLayoutObject::TracedLayoutObject(const LayoutObject& object)
, m_posChildNeeds(object.posChildNeedsLayout())
, m_isTableCell(object.isTableCell())
, m_name(String(object.name()).isolatedCopy())
- , m_absRect(object.absoluteBoundingBoxRect())
+ , m_absRect(traceGeometry ? object.absoluteBoundingBoxRect() : IntRect())
{
if (Node* node = object.node()) {
m_tag = String(node->nodeName()).isolatedCopy();
@@ -58,12 +58,14 @@ TracedLayoutObject::TracedLayoutObject(const LayoutObject& object)
// FIXME: When the fixmes in LayoutTreeAsText::writeLayoutObject() are
// fixed, deduplicate it with this.
- if (object.isText()) {
- m_rect = LayoutRect(toLayoutText(object).linesBoundingBox());
- } else if (object.isLayoutInline()) {
- m_rect = LayoutRect(toLayoutInline(object).linesBoundingBox());
- } else if (object.isBox()) {
- m_rect = toLayoutBox(&object)->frameRect();
+ if (traceGeometry) {
+ if (object.isText()) {
+ m_rect = LayoutRect(toLayoutText(object).linesBoundingBox());
+ } else if (object.isLayoutInline()) {
+ m_rect = LayoutRect(toLayoutInline(object).linesBoundingBox());
+ } else if (object.isBox()) {
+ m_rect = toLayoutBox(&object)->frameRect();
+ }
}
if (m_isTableCell) {
@@ -78,7 +80,7 @@ TracedLayoutObject::TracedLayoutObject(const LayoutObject& object)
}
for (LayoutObject* child = object.slowFirstChild(); child; child = child->nextSibling()) {
- m_children.append(adoptRef(new TracedLayoutObject(*child)));
+ m_children.append(adoptRef(new TracedLayoutObject(*child, traceGeometry)));
}
}
« Source/core/frame/FrameView.cpp ('K') | « Source/core/layout/TracedLayoutObject.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698