MCPcopy Create free account
hub / github.com/Snapchat/Valdi / setAttribute

Method setAttribute

valdi/src/valdi/runtime/Context/ViewNode.cpp:2819–2825  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2817 std::max(0.0f, child->_stickyCachedParentH - child->_stickyCachedChildH - stickyCover);
2818 float distance = scrollY - child->_stickyCachedParentY + stickyOffset;
2819 float displacement = std::max(0.0f, std::min(distance, maxDisplacement));
2820
2821 // setAttribute so processAttributeChange fires both the C++ setter
2822 // (updates _translationY) and the platform transform binder (Android
2823 // View.setTranslationY) in one call. On iOS translationY is a composite
2824 // part of transformComposite -- setAttribute only marks the composite
2825 // dirty; flush() drains it to apply layer.transform same-frame.
2826 child->setAttribute(
2827 scope, DefaultAttributeTranslationY, owner, Value(static_cast<double>(displacement)), nullptr);
2828 child->getAttributesApplier().flush(scope);

Callers

nothing calls this directly

Calls 10

setElementTagMethod · 0.80
setCSSClassMethod · 0.80
applyMethod · 0.65
setAttributeMethod · 0.65
attributeChangedMethod · 0.65
setElementIdMethod · 0.45
toStringBoxMethod · 0.45
setCSSDocumentMethod · 0.45
toBoolMethod · 0.45

Tested by

no test coverage detected