Feature hidden nodes #302

Closed
roxlu wants to merge 8 commits from feature-hidden-nodes into master
254 changed files with 22306 additions and 26360 deletions
Showing only changes of commit a048b6e4c7 - Show all commits

View File

@@ -89,6 +89,7 @@ typedef struct CSSNode {
CSSNodeRef parent;
CSSNodeListRef children;
bool isDirty;
bool isVisible;
struct CSSNode *nextChild;
@@ -198,6 +199,7 @@ void CSSNodeInit(const CSSNodeRef node) {
node->children = NULL;
node->hasNewLayout = true;
node->isDirty = false;
node->isVisible = true;
node->style.flex = CSSUndefined;
node->style.flexGrow = CSSUndefined;
@@ -287,6 +289,14 @@ bool CSSNodeIsDirty(const CSSNodeRef node) {
return node->isDirty;
}
void CSSNodeHide(const CSSNodeRef node) {
node->isVisible = false;
}
void CSSNodeShow(const CSSNodeRef node) {
node->isVisible = true;;
}
inline float CSSNodeStyleGetFlexGrow(CSSNodeRef node) {
if (!CSSValueIsUndefined(node->style.flexGrow)) {
return node->style.flexGrow;
@@ -1190,6 +1200,7 @@ static void layoutNodeImpl(const CSSNodeRef node,
const CSSMeasureMode widthMeasureMode,
const CSSMeasureMode heightMeasureMode,
const bool performLayout) {
CSS_ASSERT(CSSValueIsUndefined(availableWidth) ? widthMeasureMode == CSSMeasureModeUndefined
: true,
"availableWidth is indefinite so widthMeasureMode must be "

View File

@@ -157,6 +157,9 @@ WIN_EXPORT void CSSNodeCalculateLayout(const CSSNodeRef node,
WIN_EXPORT void CSSNodeMarkDirty(const CSSNodeRef node);
WIN_EXPORT bool CSSNodeIsDirty(const CSSNodeRef node);
WIN_EXPORT void CSSNodeHide(const CSSNodeRef node);
WIN_EXPORT void CSSNodeShow(const CSSNodeRef node);
WIN_EXPORT void CSSNodePrint(const CSSNodeRef node, const CSSPrintOptions options);
WIN_EXPORT bool CSSValueIsUndefined(const float value);