| 3164 | bool ViewNode::handleCSSChange(bool cssChanged) { |
| 3165 | if (cssChanged) { |
| 3166 | setCSSNeedsUpdate(); |
| 3167 | } |
| 3168 | return cssChanged; |
| 3169 | } |
| 3170 | |
| 3171 | bool ViewNode::isHorizontal() { |
| 3172 | auto flexDirection = getYogaStyle(getYogaNodeForInsertingChildren()).flexDirection(); |
| 3173 | return flexDirection == facebook::yoga::FlexDirection::Row || |
| 3174 | flexDirection == facebook::yoga::FlexDirection::RowReverse; |
| 3175 | } |
| 3176 | |
| 3177 | bool ViewNode::setAttribute(ViewTransactionScope& viewTransactionScope, |
| 3178 | AttributeId attributeId, |
| 3179 | const AttributeOwner* attributeOwner, |
| 3180 | const Value& attributeValue, |
| 3181 | const Ref<Animator>& animator) { |
| 3182 | return setAttribute(viewTransactionScope, attributeId, attributeOwner, attributeValue, animator, false); |
| 3183 | } |
| 3184 | |
| 3185 | bool ViewNode::setAttribute(ViewTransactionScope& viewTransactionScope, |
| 3186 | AttributeId attributeId, |
| 3187 | const AttributeOwner* attributeOwner, |
| 3188 | const Value& attributeValue, |
| 3189 | const Ref<Animator>& animator, |
| 3190 | bool isOverridenFromParent) { |
| 3191 | if (attributeId == DefaultAttributeId) { |
| 3192 | return handleCSSChange( |
| 3193 | getCSSAttributesManager().setElementId(attributeValue.toStringBox(), isOverridenFromParent)); |
| 3194 | } else if (attributeId == DefaultAttributeElementTag) { |
| 3195 | return handleCSSChange( |
| 3196 | getCSSAttributesManager().setElementTag(attributeValue.toStringBox(), isOverridenFromParent)); |
| 3197 | } else if (attributeId == DefaultAttributeCSSDocument) { |
| 3198 | return handleCSSChange(getCSSAttributesManager().setCSSDocument(attributeValue, isOverridenFromParent)); |
| 3199 | } else if (attributeId == DefaultAttributeCSSClass) { |
| 3200 | return handleCSSChange(getCSSAttributesManager().setCSSClass(attributeValue, isOverridenFromParent)); |