| 2024 | Shared<CSSDocument> ViewNode::getCSSDocument() const { |
| 2025 | return _cssAttributesManager.getCSSDocument(); |
| 2026 | } |
| 2027 | |
| 2028 | Ref<ValueMap> ViewNode::getDebugDescriptionMap() const { |
| 2029 | auto out = makeShared<ValueMap>(); |
| 2030 | |
| 2031 | static StringBox viewClassKey = STRING_LITERAL("viewClass"); |
| 2032 | static StringBox nodeTagKey = STRING_LITERAL("nodeTag"); |
| 2033 | static StringBox idKey = STRING_LITERAL("id"); |
| 2034 | static StringBox idsKey = STRING_LITERAL("ids"); |
| 2035 | static StringBox rawIdKey = STRING_LITERAL("rawId"); |
| 2036 | static StringBox moduleNameKey = STRING_LITERAL("moduleName"); |
| 2037 | static StringBox documentPathKey = STRING_LITERAL("documentPath"); |
| 2038 | static StringBox attributesKey = STRING_LITERAL("attributes"); |
| 2039 | static StringBox frameKey = STRING_LITERAL("frame"); |
| 2040 | static StringBox childrenKey = STRING_LITERAL("children"); |
| 2041 | |
| 2042 | (*out)[rawIdKey] = Valdi::Value(getRawId()); |
| 2043 | (*out)[moduleNameKey] = Valdi::Value(getModuleName()); |
| 2044 | (*out)[viewClassKey] = Valdi::Value(getViewClassName()); |
| 2045 | |
| 2046 | (*out)[attributesKey] = Valdi::Value(_attributesApplier.dumpResolvedAttributes()); |
| 2047 | (*out)[frameKey] = Valdi::Value(getCalculatedFrame().toMap()); |
| 2048 | |
| 2049 | ValueArrayBuilder children; |
| 2050 | |
| 2051 | for (ViewNode* child : *this) { |
| 2052 | children.emplace(child->getDebugDescriptionMap()); |
| 2053 | } |
| 2054 | |
| 2055 | (*out)[childrenKey] = Valdi::Value(children.build()); |
| 2056 | |
| 2057 | return out; |
| 2058 | } |
| 2059 | |
| 2060 | AttributesApplier& ViewNode::getAttributesApplier() { |
| 2061 | return _attributesApplier; |
| 2062 | } |
| 2063 | |
| 2064 | YGNode* ViewNode::getYogaNode() const { |
| 2065 | return _yogaNode; |
| 2066 | } |
| 2067 | |
| 2068 | SharedViewNode ViewNode::getParent() const { |
| 2069 | return _parent.lock(); |
| 2070 | } |
| 2071 | |
| 2072 | bool ViewNode::hasParent() const { |
| 2073 | return _flags[kHasParent]; |
| 2074 | } |
| 2075 | |
| 2076 | void ViewNode::setHasParent(bool hasParent) { |
| 2077 | if (_flags[kHasParent] != hasParent) { |
| 2078 | _flags[kHasParent] = hasParent; |
| 2079 | updateYogaMeasureFunc(); |
| 2080 | } |