mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-08 17:46:35 +08:00
Import latest css-layout
Summary: Import latest master from css-layout. This includes the following pull requests: https://github.com/facebook/css-layout/pull/192 https://github.com/facebook/css-layout/pull/193 https://github.com/facebook/css-layout/pull/195 https://github.com/facebook/css-layout/pull/196 Reviewed By: javache Differential Revision: D3411535 fbshipit-source-id: 95bee9bd0282f98f6fafa15335b910b644395ad3
This commit is contained in:
committed by
Facebook Github Bot 2
parent
97cfacb5ba
commit
8afcaa36e6
@@ -7,7 +7,7 @@
|
||||
*/
|
||||
|
||||
// NOTE: this file is auto-copied from https://github.com/facebook/css-layout
|
||||
// @generated SignedSource<<67fbba6df7c2472877c7b04327fb1863>>
|
||||
// @generated SignedSource<<da35a9f6c5a59af0d73da3e46ee60a9a>>
|
||||
|
||||
package com.facebook.csslayout;
|
||||
|
||||
@@ -67,11 +67,12 @@ public class CSSNode {
|
||||
public int lineIndex = 0;
|
||||
|
||||
/*package*/ CSSNode nextChild;
|
||||
|
||||
|
||||
private @Nullable ArrayList<CSSNode> mChildren;
|
||||
private @Nullable CSSNode mParent;
|
||||
private @Nullable MeasureFunction mMeasureFunction = null;
|
||||
private LayoutState mLayoutState = LayoutState.DIRTY;
|
||||
private boolean mIsTextNode = false;
|
||||
|
||||
public int getChildCount() {
|
||||
return mChildren == null ? 0 : mChildren.size();
|
||||
@@ -127,6 +128,14 @@ public class CSSNode {
|
||||
return mMeasureFunction != null;
|
||||
}
|
||||
|
||||
public void setIsTextNode(boolean isTextNode) {
|
||||
mIsTextNode = isTextNode;
|
||||
}
|
||||
|
||||
public boolean isTextNode() {
|
||||
return mIsTextNode;
|
||||
}
|
||||
|
||||
/*package*/ MeasureOutput measure(MeasureOutput measureOutput, float width, CSSMeasureMode widthMode, float height, CSSMeasureMode heightMode) {
|
||||
if (!isMeasureDefined()) {
|
||||
throw new RuntimeException("Measure function isn't defined!");
|
||||
@@ -450,6 +459,62 @@ public class CSSNode {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get this node's max width, as defined in the style
|
||||
*/
|
||||
public float getStyleMaxWidth() {
|
||||
return style.maxWidth;
|
||||
}
|
||||
|
||||
public void setStyleMaxWidth(float maxWidth) {
|
||||
if (!valuesEqual(style.maxWidth, maxWidth)) {
|
||||
style.maxWidth = maxWidth;
|
||||
dirty();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get this node's min width, as defined in the style
|
||||
*/
|
||||
public float getStyleMinWidth() {
|
||||
return style.minWidth;
|
||||
}
|
||||
|
||||
public void setStyleMinWidth(float minWidth) {
|
||||
if (!valuesEqual(style.minWidth, minWidth)) {
|
||||
style.minWidth = minWidth;
|
||||
dirty();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get this node's max height, as defined in the style
|
||||
*/
|
||||
public float getStyleMaxHeight() {
|
||||
return style.maxHeight;
|
||||
}
|
||||
|
||||
public void setStyleMaxHeight(float maxHeight) {
|
||||
if (!valuesEqual(style.maxHeight, maxHeight)) {
|
||||
style.maxHeight = maxHeight;
|
||||
dirty();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get this node's min height, as defined in the style
|
||||
*/
|
||||
public float getStyleMinHeight() {
|
||||
return style.minHeight;
|
||||
}
|
||||
|
||||
public void setStyleMinHeight(float minHeight) {
|
||||
if (!valuesEqual(style.minHeight, minHeight)) {
|
||||
style.minHeight = minHeight;
|
||||
dirty();
|
||||
}
|
||||
}
|
||||
|
||||
public float getLayoutX() {
|
||||
return layout.position[POSITION_LEFT];
|
||||
}
|
||||
@@ -479,6 +544,20 @@ public class CSSNode {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get this node's overflow property, as defined in the style
|
||||
*/
|
||||
public CSSOverflow getOverflow() {
|
||||
return style.overflow;
|
||||
}
|
||||
|
||||
public void setOverflow(CSSOverflow overflow) {
|
||||
if (style.overflow != overflow) {
|
||||
style.overflow = overflow;
|
||||
dirty();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Resets this instance to its default state. This method is meant to be used when
|
||||
* recycling {@link CSSNode} instances.
|
||||
|
||||
Reference in New Issue
Block a user