Alter layout engine to conform closer to W3C spec #185
4
dist/css-layout.h
vendored
4
dist/css-layout.h
vendored
@@ -883,9 +883,9 @@ static void layoutNodeImpl(css_node_t* node, float availableWidth, float availab
|
|||||||
// Don't bother sizing the text if both dimensions are already defined.
|
// Don't bother sizing the text if both dimensions are already defined.
|
||||||
node->layout.measured_dimensions[CSS_WIDTH] = boundAxis(node, CSS_FLEX_DIRECTION_ROW, availableWidth - marginAxisRow);
|
node->layout.measured_dimensions[CSS_WIDTH] = boundAxis(node, CSS_FLEX_DIRECTION_ROW, availableWidth - marginAxisRow);
|
||||||
node->layout.measured_dimensions[CSS_HEIGHT] = boundAxis(node, CSS_FLEX_DIRECTION_COLUMN, availableHeight - marginAxisColumn);
|
node->layout.measured_dimensions[CSS_HEIGHT] = boundAxis(node, CSS_FLEX_DIRECTION_COLUMN, availableHeight - marginAxisColumn);
|
||||||
} else if (innerWidth <= 0) {
|
} else if (innerWidth <= 0 || innerHeight <= 0) {
|
||||||
|
|
||||||
// Don't bother sizing the text if there's no horizontal space.
|
// Don't bother sizing the text if there's no horizontal or vertical space.
|
||||||
node->layout.measured_dimensions[CSS_WIDTH] = boundAxis(node, CSS_FLEX_DIRECTION_ROW, 0);
|
node->layout.measured_dimensions[CSS_WIDTH] = boundAxis(node, CSS_FLEX_DIRECTION_ROW, 0);
|
||||||
node->layout.measured_dimensions[CSS_HEIGHT] = boundAxis(node, CSS_FLEX_DIRECTION_COLUMN, 0);
|
node->layout.measured_dimensions[CSS_HEIGHT] = boundAxis(node, CSS_FLEX_DIRECTION_COLUMN, 0);
|
||||||
} else {
|
} else {
|
||||||
|
BIN
dist/css-layout.jar
vendored
BIN
dist/css-layout.jar
vendored
Binary file not shown.
4
dist/css-layout.js
vendored
4
dist/css-layout.js
vendored
@@ -647,9 +647,9 @@ var computeLayout = (function() {
|
|||||||
// Don't bother sizing the text if both dimensions are already defined.
|
// Don't bother sizing the text if both dimensions are already defined.
|
||||||
node.layout.measuredWidth = boundAxis(node, CSS_FLEX_DIRECTION_ROW, availableWidth - marginAxisRow);
|
node.layout.measuredWidth = boundAxis(node, CSS_FLEX_DIRECTION_ROW, availableWidth - marginAxisRow);
|
||||||
node.layout.measuredHeight = boundAxis(node, CSS_FLEX_DIRECTION_COLUMN, availableHeight - marginAxisColumn);
|
node.layout.measuredHeight = boundAxis(node, CSS_FLEX_DIRECTION_COLUMN, availableHeight - marginAxisColumn);
|
||||||
} else if (innerWidth <= 0) {
|
} else if (innerWidth <= 0 || innerHeight <= 0) {
|
||||||
|
|
||||||
// Don't bother sizing the text if there's no horizontal space.
|
// Don't bother sizing the text if there's no horizontal or vertical space.
|
||||||
node.layout.measuredWidth = boundAxis(node, CSS_FLEX_DIRECTION_ROW, 0);
|
node.layout.measuredWidth = boundAxis(node, CSS_FLEX_DIRECTION_ROW, 0);
|
||||||
node.layout.measuredHeight = boundAxis(node, CSS_FLEX_DIRECTION_COLUMN, 0);
|
node.layout.measuredHeight = boundAxis(node, CSS_FLEX_DIRECTION_COLUMN, 0);
|
||||||
} else {
|
} else {
|
||||||
|
2
dist/css-layout.min.js
vendored
2
dist/css-layout.min.js
vendored
File diff suppressed because one or more lines are too long
2
dist/css-layout.min.js.map
vendored
2
dist/css-layout.min.js.map
vendored
File diff suppressed because one or more lines are too long
@@ -678,9 +678,9 @@ static void layoutNodeImpl(css_node_t* node, float availableWidth, float availab
|
|||||||
// Don't bother sizing the text if both dimensions are already defined.
|
// Don't bother sizing the text if both dimensions are already defined.
|
||||||
node->layout.measured_dimensions[CSS_WIDTH] = boundAxis(node, CSS_FLEX_DIRECTION_ROW, availableWidth - marginAxisRow);
|
node->layout.measured_dimensions[CSS_WIDTH] = boundAxis(node, CSS_FLEX_DIRECTION_ROW, availableWidth - marginAxisRow);
|
||||||
node->layout.measured_dimensions[CSS_HEIGHT] = boundAxis(node, CSS_FLEX_DIRECTION_COLUMN, availableHeight - marginAxisColumn);
|
node->layout.measured_dimensions[CSS_HEIGHT] = boundAxis(node, CSS_FLEX_DIRECTION_COLUMN, availableHeight - marginAxisColumn);
|
||||||
} else if (innerWidth <= 0) {
|
} else if (innerWidth <= 0 || innerHeight <= 0) {
|
||||||
|
|
||||||
// Don't bother sizing the text if there's no horizontal space.
|
// Don't bother sizing the text if there's no horizontal or vertical space.
|
||||||
node->layout.measured_dimensions[CSS_WIDTH] = boundAxis(node, CSS_FLEX_DIRECTION_ROW, 0);
|
node->layout.measured_dimensions[CSS_WIDTH] = boundAxis(node, CSS_FLEX_DIRECTION_ROW, 0);
|
||||||
node->layout.measured_dimensions[CSS_HEIGHT] = boundAxis(node, CSS_FLEX_DIRECTION_COLUMN, 0);
|
node->layout.measured_dimensions[CSS_HEIGHT] = boundAxis(node, CSS_FLEX_DIRECTION_COLUMN, 0);
|
||||||
} else {
|
} else {
|
||||||
|
@@ -628,9 +628,9 @@ var computeLayout = (function() {
|
|||||||
// Don't bother sizing the text if both dimensions are already defined.
|
// Don't bother sizing the text if both dimensions are already defined.
|
||||||
node.layout.measuredWidth = boundAxis(node, CSS_FLEX_DIRECTION_ROW, availableWidth - marginAxisRow);
|
node.layout.measuredWidth = boundAxis(node, CSS_FLEX_DIRECTION_ROW, availableWidth - marginAxisRow);
|
||||||
node.layout.measuredHeight = boundAxis(node, CSS_FLEX_DIRECTION_COLUMN, availableHeight - marginAxisColumn);
|
node.layout.measuredHeight = boundAxis(node, CSS_FLEX_DIRECTION_COLUMN, availableHeight - marginAxisColumn);
|
||||||
} else if (innerWidth <= 0) {
|
} else if (innerWidth <= 0 || innerHeight <= 0) {
|
||||||
|
|
||||||
// Don't bother sizing the text if there's no horizontal space.
|
// Don't bother sizing the text if there's no horizontal or vertical space.
|
||||||
node.layout.measuredWidth = boundAxis(node, CSS_FLEX_DIRECTION_ROW, 0);
|
node.layout.measuredWidth = boundAxis(node, CSS_FLEX_DIRECTION_ROW, 0);
|
||||||
node.layout.measuredHeight = boundAxis(node, CSS_FLEX_DIRECTION_COLUMN, 0);
|
node.layout.measuredHeight = boundAxis(node, CSS_FLEX_DIRECTION_COLUMN, 0);
|
||||||
} else {
|
} else {
|
||||||
|
@@ -562,9 +562,9 @@ namespace Facebook.CSSLayout
|
|||||||
// Don't bother sizing the text if both dimensions are already defined.
|
// Don't bother sizing the text if both dimensions are already defined.
|
||||||
node.layout.measuredDimensions[DIMENSION_WIDTH] = boundAxis(node, CSS_FLEX_DIRECTION_ROW, availableWidth - marginAxisRow);
|
node.layout.measuredDimensions[DIMENSION_WIDTH] = boundAxis(node, CSS_FLEX_DIRECTION_ROW, availableWidth - marginAxisRow);
|
||||||
node.layout.measuredDimensions[DIMENSION_HEIGHT] = boundAxis(node, CSS_FLEX_DIRECTION_COLUMN, availableHeight - marginAxisColumn);
|
node.layout.measuredDimensions[DIMENSION_HEIGHT] = boundAxis(node, CSS_FLEX_DIRECTION_COLUMN, availableHeight - marginAxisColumn);
|
||||||
} else if (innerWidth <= 0) {
|
} else if (innerWidth <= 0 || innerHeight <= 0) {
|
||||||
|
|
||||||
// Don't bother sizing the text if there's no horizontal space.
|
// Don't bother sizing the text if there's no horizontal or vertical space.
|
||||||
node.layout.measuredDimensions[DIMENSION_WIDTH] = boundAxis(node, CSS_FLEX_DIRECTION_ROW, 0);
|
node.layout.measuredDimensions[DIMENSION_WIDTH] = boundAxis(node, CSS_FLEX_DIRECTION_ROW, 0);
|
||||||
node.layout.measuredDimensions[DIMENSION_HEIGHT] = boundAxis(node, CSS_FLEX_DIRECTION_COLUMN, 0);
|
node.layout.measuredDimensions[DIMENSION_HEIGHT] = boundAxis(node, CSS_FLEX_DIRECTION_COLUMN, 0);
|
||||||
} else {
|
} else {
|
||||||
|
@@ -518,9 +518,9 @@ public class LayoutEngine {
|
|||||||
// Don't bother sizing the text if both dimensions are already defined.
|
// Don't bother sizing the text if both dimensions are already defined.
|
||||||
node.layout.measuredDimensions[DIMENSION_WIDTH] = boundAxis(node, CSS_FLEX_DIRECTION_ROW, availableWidth - marginAxisRow);
|
node.layout.measuredDimensions[DIMENSION_WIDTH] = boundAxis(node, CSS_FLEX_DIRECTION_ROW, availableWidth - marginAxisRow);
|
||||||
node.layout.measuredDimensions[DIMENSION_HEIGHT] = boundAxis(node, CSS_FLEX_DIRECTION_COLUMN, availableHeight - marginAxisColumn);
|
node.layout.measuredDimensions[DIMENSION_HEIGHT] = boundAxis(node, CSS_FLEX_DIRECTION_COLUMN, availableHeight - marginAxisColumn);
|
||||||
} else if (innerWidth <= 0) {
|
} else if (innerWidth <= 0 || innerHeight <= 0) {
|
||||||
|
|
||||||
// Don't bother sizing the text if there's no horizontal space.
|
// Don't bother sizing the text if there's no horizontal or vertical space.
|
||||||
node.layout.measuredDimensions[DIMENSION_WIDTH] = boundAxis(node, CSS_FLEX_DIRECTION_ROW, 0);
|
node.layout.measuredDimensions[DIMENSION_WIDTH] = boundAxis(node, CSS_FLEX_DIRECTION_ROW, 0);
|
||||||
node.layout.measuredDimensions[DIMENSION_HEIGHT] = boundAxis(node, CSS_FLEX_DIRECTION_COLUMN, 0);
|
node.layout.measuredDimensions[DIMENSION_HEIGHT] = boundAxis(node, CSS_FLEX_DIRECTION_COLUMN, 0);
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user