@@ -451,8 +451,6 @@ print_css_node_rec(const CSSNodeRef node, const CSSPrintOptions options, const u
451451 printf ("overflow: 'hidden', " );
452452 } else if (node -> style .overflow == CSSOverflowVisible ) {
453453 printf ("overflow: 'visible', " );
454- } else if (node -> style .overflow == CSSOverflowScroll ) {
455- printf ("overflow: 'scroll', " );
456454 }
457455
458456 if (four_equal (node -> style .margin )) {
@@ -557,23 +555,26 @@ static bool isColumnDirection(const CSSFlexDirection flexDirection) {
557555}
558556
559557static float getLeadingMargin (const CSSNodeRef node , const CSSFlexDirection axis ) {
560- if (isRowDirection (axis ) && !CSSValueIsUndefined (node -> style .margin [CSSEdgeStart ])) {
558+ if (isRowDirection (axis ) &&
559+ !CSSValueIsUndefined (node -> style .margin [CSSEdgeStart ])) {
561560 return node -> style .margin [CSSEdgeStart ];
562561 }
563562
564563 return computedEdgeValue (node -> style .margin , leading [axis ], 0 );
565564}
566565
567566static float getTrailingMargin (const CSSNodeRef node , const CSSFlexDirection axis ) {
568- if (isRowDirection (axis ) && !CSSValueIsUndefined (node -> style .margin [CSSEdgeEnd ])) {
567+ if (isRowDirection (axis ) &&
568+ !CSSValueIsUndefined (node -> style .margin [CSSEdgeEnd ])) {
569569 return node -> style .margin [CSSEdgeEnd ];
570570 }
571571
572572 return computedEdgeValue (node -> style .margin , trailing [axis ], 0 );
573573}
574574
575575static float getLeadingPadding (const CSSNodeRef node , const CSSFlexDirection axis ) {
576- if (isRowDirection (axis ) && !CSSValueIsUndefined (node -> style .padding [CSSEdgeStart ]) &&
576+ if (isRowDirection (axis ) &&
577+ !CSSValueIsUndefined (node -> style .padding [CSSEdgeStart ]) &&
577578 node -> style .padding [CSSEdgeStart ] >= 0 ) {
578579 return node -> style .padding [CSSEdgeStart ];
579580 }
@@ -586,7 +587,8 @@ static float getLeadingPadding(const CSSNodeRef node, const CSSFlexDirection axi
586587}
587588
588589static float getTrailingPadding (const CSSNodeRef node , const CSSFlexDirection axis ) {
589- if (isRowDirection (axis ) && !CSSValueIsUndefined (node -> style .padding [CSSEdgeEnd ]) &&
590+ if (isRowDirection (axis ) &&
591+ !CSSValueIsUndefined (node -> style .padding [CSSEdgeEnd ]) &&
590592 node -> style .padding [CSSEdgeEnd ] >= 0 ) {
591593 return node -> style .padding [CSSEdgeEnd ];
592594 }
@@ -599,7 +601,8 @@ static float getTrailingPadding(const CSSNodeRef node, const CSSFlexDirection ax
599601}
600602
601603static float getLeadingBorder (const CSSNodeRef node , const CSSFlexDirection axis ) {
602- if (isRowDirection (axis ) && !CSSValueIsUndefined (node -> style .border [CSSEdgeStart ]) &&
604+ if (isRowDirection (axis ) &&
605+ !CSSValueIsUndefined (node -> style .border [CSSEdgeStart ]) &&
603606 node -> style .border [CSSEdgeStart ] >= 0 ) {
604607 return node -> style .border [CSSEdgeStart ];
605608 }
@@ -612,7 +615,8 @@ static float getLeadingBorder(const CSSNodeRef node, const CSSFlexDirection axis
612615}
613616
614617static float getTrailingBorder (const CSSNodeRef node , const CSSFlexDirection axis ) {
615- if (isRowDirection (axis ) && !CSSValueIsUndefined (node -> style .border [CSSEdgeEnd ]) &&
618+ if (isRowDirection (axis ) &&
619+ !CSSValueIsUndefined (node -> style .border [CSSEdgeEnd ]) &&
616620 node -> style .border [CSSEdgeEnd ] >= 0 ) {
617621 return node -> style .border [CSSEdgeEnd ];
618622 }
@@ -1136,17 +1140,21 @@ static void layoutNodeImpl(const CSSNodeRef node,
11361140 childHeightMeasureMode = CSSMeasureModeExactly ;
11371141 }
11381142
1139- // The W3C spec doesn't say anything about the 'overflow' property,
1140- // but all major browsers appear to implement the following logic.
1141- if ((!isMainAxisRow && node -> style .overflow == CSSOverflowScroll ) || node -> style .overflow != CSSOverflowScroll ) {
1142- if (CSSValueIsUndefined (childWidth ) && !CSSValueIsUndefined (availableInnerWidth )) {
1143- childWidth = availableInnerWidth ;
1144- childWidthMeasureMode = CSSMeasureModeAtMost ;
1145- }
1143+ // According to the spec, if the main size is not definite and the
1144+ // child's inline axis is parallel to the main axis (i.e. it's
1145+ // horizontal), the child should be sized using "UNDEFINED" in
1146+ // the main size. Otherwise use "AT_MOST" in the cross axis.
1147+ if (!isMainAxisRow && CSSValueIsUndefined (childWidth ) &&
1148+ !CSSValueIsUndefined (availableInnerWidth )) {
1149+ childWidth = availableInnerWidth ;
1150+ childWidthMeasureMode = CSSMeasureModeAtMost ;
11461151 }
11471152
1148- if ((isMainAxisRow && node -> style .overflow == CSSOverflowScroll ) || node -> style .overflow != CSSOverflowScroll ) {
1149- if (CSSValueIsUndefined (childHeight ) && !CSSValueIsUndefined (availableInnerHeight )) {
1153+ // The W3C spec doesn't say anything about the 'overflow' property,
1154+ // but all major browsers appear to implement the following logic.
1155+ if (node -> style .overflow == CSSOverflowHidden ) {
1156+ if (isMainAxisRow && CSSValueIsUndefined (childHeight ) &&
1157+ !CSSValueIsUndefined (availableInnerHeight )) {
11501158 childHeight = availableInnerHeight ;
11511159 childHeightMeasureMode = CSSMeasureModeAtMost ;
11521160 }
0 commit comments