Introduce CSSNodeCopyStyle
Reviewed By: emilsjolander Differential Revision: D4188514 fbshipit-source-id: af8d7fb5e8688c64aea05ce7ad23fff9233fb441
This commit is contained in:
parent
c5f6e864f9
commit
39a59caac1
|
@ -341,6 +341,13 @@ bool CSSNodeIsDirty(const CSSNodeRef node) {
|
|||
return node->isDirty;
|
||||
}
|
||||
|
||||
void CSSNodeCopyStyle(const CSSNodeRef dstNode, const CSSNodeRef srcNode) {
|
||||
if (memcmp(&dstNode->style, &srcNode->style, sizeof(CSSStyle)) != 0) {
|
||||
memcpy(&dstNode->style, &srcNode->style, sizeof(CSSStyle));
|
||||
_CSSNodeMarkDirty(dstNode);
|
||||
}
|
||||
}
|
||||
|
||||
inline float CSSNodeStyleGetFlexGrow(CSSNodeRef node) {
|
||||
if (!CSSValueIsUndefined(node->style.flexGrow)) {
|
||||
return node->style.flexGrow;
|
||||
|
|
|
@ -98,6 +98,8 @@ WIN_EXPORT bool CSSNodeCanUseCachedMeasurement(const CSSMeasureMode widthMode,
|
|||
const float marginRow,
|
||||
const float marginColumn);
|
||||
|
||||
WIN_EXPORT void CSSNodeCopyStyle(const CSSNodeRef dstNode, const CSSNodeRef srcNode);
|
||||
|
||||
#define CSS_NODE_PROPERTY(type, name, paramName) \
|
||||
WIN_EXPORT void CSSNodeSet##name(const CSSNodeRef node, type paramName); \
|
||||
WIN_EXPORT type CSSNodeGet##name(const CSSNodeRef node);
|
||||
|
|
|
@ -341,6 +341,13 @@ bool CSSNodeIsDirty(const CSSNodeRef node) {
|
|||
return node->isDirty;
|
||||
}
|
||||
|
||||
void CSSNodeCopyStyle(const CSSNodeRef dstNode, const CSSNodeRef srcNode) {
|
||||
if (memcmp(&dstNode->style, &srcNode->style, sizeof(CSSStyle)) != 0) {
|
||||
memcpy(&dstNode->style, &srcNode->style, sizeof(CSSStyle));
|
||||
_CSSNodeMarkDirty(dstNode);
|
||||
}
|
||||
}
|
||||
|
||||
inline float CSSNodeStyleGetFlexGrow(CSSNodeRef node) {
|
||||
if (!CSSValueIsUndefined(node->style.flexGrow)) {
|
||||
return node->style.flexGrow;
|
||||
|
|
|
@ -98,6 +98,8 @@ WIN_EXPORT bool CSSNodeCanUseCachedMeasurement(const CSSMeasureMode widthMode,
|
|||
const float marginRow,
|
||||
const float marginColumn);
|
||||
|
||||
WIN_EXPORT void CSSNodeCopyStyle(const CSSNodeRef dstNode, const CSSNodeRef srcNode);
|
||||
|
||||
#define CSS_NODE_PROPERTY(type, name, paramName) \
|
||||
WIN_EXPORT void CSSNodeSet##name(const CSSNodeRef node, type paramName); \
|
||||
WIN_EXPORT type CSSNodeGet##name(const CSSNodeRef node);
|
||||
|
|
Loading…
Reference in New Issue