| 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 19 matching lines...) Expand all Loading... |
| 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_isFloating(object.isFloating()) | 34 , m_isFloating(object.isFloating()) |
| 35 , m_selfNeeds(object.selfNeedsLayout()) | 35 , m_selfNeeds(object.selfNeedsLayout()) |
| 36 , m_positionedMovement(object.needsPositionedMovementLayout()) | 36 , m_positionedMovement(object.needsPositionedMovementLayout()) |
| 37 , m_childNeeds(object.normalChildNeedsLayout()) | 37 , m_childNeeds(object.normalChildNeedsLayout()) |
| 38 , m_posChildNeeds(object.posChildNeedsLayout()) | 38 , m_posChildNeeds(object.posChildNeedsLayout()) |
| 39 , m_isTableCell(object.isTableCell()) | 39 , m_isTableCell(object.isTableCell()) |
| 40 , m_name(object.name()) | 40 , m_name(String(object.name()).isolatedCopy()) |
| 41 , m_absRect(object.absoluteBoundingBoxRect()) | 41 , m_absRect(object.absoluteBoundingBoxRect()) |
| 42 { | 42 { |
| 43 if (Node* node = object.node()) { | 43 if (Node* node = object.node()) { |
| 44 m_tag = node->nodeName(); | 44 m_tag = String(node->nodeName()).isolatedCopy(); |
| 45 if (node->isElementNode()) { | 45 if (node->isElementNode()) { |
| 46 Element& element = toElement(*node); | 46 Element& element = toElement(*node); |
| 47 if (element.hasID()) | 47 if (element.hasID()) |
| 48 m_id = element.getIdAttribute(); | 48 m_id = String(element.getIdAttribute()).isolatedCopy(); |
| 49 if (element.hasClass()) { | 49 if (element.hasClass()) { |
| 50 for (size_t i = 0; i < element.classNames().size(); ++i) { | 50 for (size_t i = 0; i < element.classNames().size(); ++i) { |
| 51 m_classNames.append(element.classNames()[i]); | 51 m_classNames.append( |
| 52 String(element.classNames()[i]).isolatedCopy()); |
| 52 } | 53 } |
| 53 } | 54 } |
| 54 } | 55 } |
| 55 } | 56 } |
| 56 | 57 |
| 57 // FIXME: When the fixmes in LayoutTreeAsText::writeLayoutObject() are | 58 // FIXME: When the fixmes in LayoutTreeAsText::writeLayoutObject() are |
| 58 // fixed, deduplicate it with this. | 59 // fixed, deduplicate it with this. |
| 59 if (object.isText()) { | 60 if (object.isText()) { |
| 60 m_rect = LayoutRect(toLayoutText(object).linesBoundingBox()); | 61 m_rect = LayoutRect(toLayoutText(object).linesBoundingBox()); |
| 61 } else if (object.isLayoutInline()) { | 62 } else if (object.isLayoutInline()) { |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 RefPtr<JSONArray> children(JSONArray::create()); | 131 RefPtr<JSONArray> children(JSONArray::create()); |
| 131 for (const auto& child : m_children) { | 132 for (const auto& child : m_children) { |
| 132 children->pushObject(child->toJSON()); | 133 children->pushObject(child->toJSON()); |
| 133 } | 134 } |
| 134 json->setArray("children", children); | 135 json->setArray("children", children); |
| 135 } | 136 } |
| 136 return json.release(); | 137 return json.release(); |
| 137 } | 138 } |
| 138 | 139 |
| 139 } // namespace blink | 140 } // namespace blink |
| OLD | NEW |