| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "config.h" | 5 #include "config.h" |
| 6 #include "core/layout/TracedLayoutObject.h" | 6 #include "core/layout/TracedLayoutObject.h" |
| 7 | 7 |
| 8 #include "core/layout/LayoutInline.h" | 8 #include "core/layout/LayoutInline.h" |
| 9 #include "core/layout/LayoutTableCell.h" | 9 #include "core/layout/LayoutTableCell.h" |
| 10 #include "core/layout/LayoutText.h" | 10 #include "core/layout/LayoutText.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 RefPtr<JSONObject> json(toJSON()); | 24 RefPtr<JSONObject> json(toJSON()); |
| 25 json->writeJSON(&builder); | 25 json->writeJSON(&builder); |
| 26 return builder.toString(); | 26 return builder.toString(); |
| 27 } | 27 } |
| 28 | 28 |
| 29 TracedLayoutObject::TracedLayoutObject(const LayoutObject& object) | 29 TracedLayoutObject::TracedLayoutObject(const LayoutObject& object) |
| 30 : m_address((unsigned long) &object) | 30 : m_address((unsigned long) &object) |
| 31 , m_isAnonymous(object.isAnonymous()) | 31 , m_isAnonymous(object.isAnonymous()) |
| 32 , m_isPositioned(object.isOutOfFlowPositioned()) | 32 , m_isPositioned(object.isOutOfFlowPositioned()) |
| 33 , m_isRelPositioned(object.isRelPositioned()) | 33 , m_isRelPositioned(object.isRelPositioned()) |
| 34 , m_isStickyPositioned(object.isStickyPositioned()) |
| 34 , m_isFloating(object.isFloating()) | 35 , m_isFloating(object.isFloating()) |
| 35 , m_selfNeeds(object.selfNeedsLayout()) | 36 , m_selfNeeds(object.selfNeedsLayout()) |
| 36 , m_positionedMovement(object.needsPositionedMovementLayout()) | 37 , m_positionedMovement(object.needsPositionedMovementLayout()) |
| 37 , m_childNeeds(object.normalChildNeedsLayout()) | 38 , m_childNeeds(object.normalChildNeedsLayout()) |
| 38 , m_posChildNeeds(object.posChildNeedsLayout()) | 39 , m_posChildNeeds(object.posChildNeedsLayout()) |
| 39 , m_isTableCell(object.isTableCell()) | 40 , m_isTableCell(object.isTableCell()) |
| 40 , m_name(String(object.name()).isolatedCopy()) | 41 , m_name(String(object.name()).isolatedCopy()) |
| 41 , m_absRect(object.absoluteBoundingBoxRect()) | 42 , m_absRect(object.absoluteBoundingBoxRect()) |
| 42 { | 43 { |
| 43 if (Node* node = object.node()) { | 44 if (Node* node = object.node()) { |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 json->setNumber("col", m_col); | 119 json->setNumber("col", m_col); |
| 119 if (m_rowSpan != 1) | 120 if (m_rowSpan != 1) |
| 120 json->setNumber("rowSpan", m_rowSpan); | 121 json->setNumber("rowSpan", m_rowSpan); |
| 121 if (m_colSpan != 1) | 122 if (m_colSpan != 1) |
| 122 json->setNumber("colSpan", m_colSpan); | 123 json->setNumber("colSpan", m_colSpan); |
| 123 } | 124 } |
| 124 if (m_isAnonymous) | 125 if (m_isAnonymous) |
| 125 json->setBoolean("anonymous", m_isAnonymous); | 126 json->setBoolean("anonymous", m_isAnonymous); |
| 126 if (m_isRelPositioned) | 127 if (m_isRelPositioned) |
| 127 json->setBoolean("relativePositioned", m_isRelPositioned); | 128 json->setBoolean("relativePositioned", m_isRelPositioned); |
| 129 if (m_isStickyPositioned) |
| 130 json->setBoolean("stickyPositioned", m_isStickyPositioned); |
| 128 if (m_isFloating) | 131 if (m_isFloating) |
| 129 json->setBoolean("float", m_isFloating); | 132 json->setBoolean("float", m_isFloating); |
| 130 if (m_children.size()) { | 133 if (m_children.size()) { |
| 131 RefPtr<JSONArray> children(JSONArray::create()); | 134 RefPtr<JSONArray> children(JSONArray::create()); |
| 132 for (const auto& child : m_children) { | 135 for (const auto& child : m_children) { |
| 133 children->pushObject(child->toJSON()); | 136 children->pushObject(child->toJSON()); |
| 134 } | 137 } |
| 135 json->setArray("children", children); | 138 json->setArray("children", children); |
| 136 } | 139 } |
| 137 return json.release(); | 140 return json.release(); |
| 138 } | 141 } |
| 139 | 142 |
| 140 } // namespace blink | 143 } // namespace blink |
| OLD | NEW |