Merge pull request #203 from emilsjolander/at-most-root-js
Add missing js implementation for PR #200
This commit is contained in:
9
TestResult.xml
Normal file
9
TestResult.xml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||||
|
<!--This file represents the results of running a test suite-->
|
||||||
|
<test-results name="src/csharp/Facebook.CSSLayout.Tests/bin/Release/Facebook.CSSLayout.Tests.dll" total="0" failures="0" not-run="0" date="2016-07-08" time="14:42:41">
|
||||||
|
<environment nunit-version="2.4.8.0" clr-version="4.0.30319.17020" os-version="Unix 15.5.0.0" platform="Unix" cwd="/Volumes/Source/css-layout" machine-name="emilsj-pro" user="emilsj" user-domain="emilsj-pro" />
|
||||||
|
<culture-info current-culture="en-US" current-uiculture="en-US" />
|
||||||
|
<test-suite name="src/csharp/Facebook.CSSLayout.Tests/bin/Release/Facebook.CSSLayout.Tests.dll" success="True" time="0.001" asserts="0">
|
||||||
|
<results />
|
||||||
|
</test-suite>
|
||||||
|
</test-results>
|
BIN
dist/css-layout.jar
vendored
BIN
dist/css-layout.jar
vendored
Binary file not shown.
27
dist/css-layout.js
vendored
27
dist/css-layout.js
vendored
@@ -1683,17 +1683,28 @@ var computeLayout = (function() {
|
|||||||
// parameters don't change.
|
// parameters don't change.
|
||||||
gCurrentGenerationCount++;
|
gCurrentGenerationCount++;
|
||||||
|
|
||||||
// If the caller didn't specify a height/width, use the dimensions
|
var widthMeasureMode = CSS_MEASURE_MODE_UNDEFINED;
|
||||||
// specified in the style.
|
var heightMeasureMode = CSS_MEASURE_MODE_UNDEFINED;
|
||||||
if (isUndefined(availableWidth) && isStyleDimDefined(node, CSS_FLEX_DIRECTION_ROW)) {
|
|
||||||
|
if (!isUndefined(availableWidth)) {
|
||||||
|
widthMeasureMode = CSS_MEASURE_MODE_EXACTLY;
|
||||||
|
} else if (isStyleDimDefined(node, CSS_FLEX_DIRECTION_ROW)) {
|
||||||
availableWidth = node.style.width + getMarginAxis(node, CSS_FLEX_DIRECTION_ROW);
|
availableWidth = node.style.width + getMarginAxis(node, CSS_FLEX_DIRECTION_ROW);
|
||||||
}
|
widthMeasureMode = CSS_MEASURE_MODE_EXACTLY;
|
||||||
if (isUndefined(availableHeight) && isStyleDimDefined(node, CSS_FLEX_DIRECTION_COLUMN)) {
|
} else if (node.style.maxWidth >= 0.0) {
|
||||||
availableHeight = node.style.height + getMarginAxis(node, CSS_FLEX_DIRECTION_COLUMN);
|
availableWidth = node.style.maxWidth;
|
||||||
|
widthMeasureMode = CSS_MEASURE_MODE_AT_MOST;
|
||||||
}
|
}
|
||||||
|
|
||||||
var widthMeasureMode = isUndefined(availableWidth) ? CSS_MEASURE_MODE_UNDEFINED : CSS_MEASURE_MODE_EXACTLY;
|
if (!isUndefined(availableHeight)) {
|
||||||
var heightMeasureMode = isUndefined(availableHeight) ? CSS_MEASURE_MODE_UNDEFINED : CSS_MEASURE_MODE_EXACTLY;
|
heightMeasureMode = CSS_MEASURE_MODE_EXACTLY;
|
||||||
|
} else if (isStyleDimDefined(node, CSS_FLEX_DIRECTION_COLUMN)) {
|
||||||
|
availableHeight = node.style.height + getMarginAxis(node, CSS_FLEX_DIRECTION_COLUMN);
|
||||||
|
heightMeasureMode = CSS_MEASURE_MODE_EXACTLY;
|
||||||
|
} else if (node.style.maxHeight >= 0.0) {
|
||||||
|
availableHeight = node.style.maxHeight;
|
||||||
|
heightMeasureMode = CSS_MEASURE_MODE_AT_MOST;
|
||||||
|
}
|
||||||
|
|
||||||
if (layoutNodeInternal(node, availableWidth, availableHeight, parentDirection, widthMeasureMode, heightMeasureMode, true, 'initial')) {
|
if (layoutNodeInternal(node, availableWidth, availableHeight, parentDirection, widthMeasureMode, heightMeasureMode, true, 'initial')) {
|
||||||
setPosition(node, node.layout.direction);
|
setPosition(node, node.layout.direction);
|
||||||
|
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
@@ -1664,17 +1664,28 @@ var computeLayout = (function() {
|
|||||||
// parameters don't change.
|
// parameters don't change.
|
||||||
gCurrentGenerationCount++;
|
gCurrentGenerationCount++;
|
||||||
|
|
||||||
// If the caller didn't specify a height/width, use the dimensions
|
var widthMeasureMode = CSS_MEASURE_MODE_UNDEFINED;
|
||||||
// specified in the style.
|
var heightMeasureMode = CSS_MEASURE_MODE_UNDEFINED;
|
||||||
if (isUndefined(availableWidth) && isStyleDimDefined(node, CSS_FLEX_DIRECTION_ROW)) {
|
|
||||||
|
if (!isUndefined(availableWidth)) {
|
||||||
|
widthMeasureMode = CSS_MEASURE_MODE_EXACTLY;
|
||||||
|
} else if (isStyleDimDefined(node, CSS_FLEX_DIRECTION_ROW)) {
|
||||||
availableWidth = node.style.width + getMarginAxis(node, CSS_FLEX_DIRECTION_ROW);
|
availableWidth = node.style.width + getMarginAxis(node, CSS_FLEX_DIRECTION_ROW);
|
||||||
}
|
widthMeasureMode = CSS_MEASURE_MODE_EXACTLY;
|
||||||
if (isUndefined(availableHeight) && isStyleDimDefined(node, CSS_FLEX_DIRECTION_COLUMN)) {
|
} else if (node.style.maxWidth >= 0.0) {
|
||||||
availableHeight = node.style.height + getMarginAxis(node, CSS_FLEX_DIRECTION_COLUMN);
|
availableWidth = node.style.maxWidth;
|
||||||
|
widthMeasureMode = CSS_MEASURE_MODE_AT_MOST;
|
||||||
}
|
}
|
||||||
|
|
||||||
var widthMeasureMode = isUndefined(availableWidth) ? CSS_MEASURE_MODE_UNDEFINED : CSS_MEASURE_MODE_EXACTLY;
|
if (!isUndefined(availableHeight)) {
|
||||||
var heightMeasureMode = isUndefined(availableHeight) ? CSS_MEASURE_MODE_UNDEFINED : CSS_MEASURE_MODE_EXACTLY;
|
heightMeasureMode = CSS_MEASURE_MODE_EXACTLY;
|
||||||
|
} else if (isStyleDimDefined(node, CSS_FLEX_DIRECTION_COLUMN)) {
|
||||||
|
availableHeight = node.style.height + getMarginAxis(node, CSS_FLEX_DIRECTION_COLUMN);
|
||||||
|
heightMeasureMode = CSS_MEASURE_MODE_EXACTLY;
|
||||||
|
} else if (node.style.maxHeight >= 0.0) {
|
||||||
|
availableHeight = node.style.maxHeight;
|
||||||
|
heightMeasureMode = CSS_MEASURE_MODE_AT_MOST;
|
||||||
|
}
|
||||||
|
|
||||||
if (layoutNodeInternal(node, availableWidth, availableHeight, parentDirection, widthMeasureMode, heightMeasureMode, true, 'initial')) {
|
if (layoutNodeInternal(node, availableWidth, availableHeight, parentDirection, widthMeasureMode, heightMeasureMode, true, 'initial')) {
|
||||||
setPosition(node, node.layout.direction);
|
setPosition(node, node.layout.direction);
|
||||||
|
Reference in New Issue
Block a user