http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/2f8caedb/android/sdk/src/main/java/com/taobao/weex/dom/flex/CSSNode.java
----------------------------------------------------------------------
diff --git a/android/sdk/src/main/java/com/taobao/weex/dom/flex/CSSNode.java 
b/android/sdk/src/main/java/com/taobao/weex/dom/flex/CSSNode.java
deleted file mode 100755
index 9452fb6..0000000
--- a/android/sdk/src/main/java/com/taobao/weex/dom/flex/CSSNode.java
+++ /dev/null
@@ -1,642 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-/**
- * Copyright (c) 2014, Facebook, Inc. All rights reserved. <p/> This source 
code is licensed under
- * the BSD-cssstyle license found in the LICENSE file in the root directory of 
this source tree. An
- * additional grant of patent rights can be found in the PATENTS file in the 
same directory.
- */
-package com.taobao.weex.dom.flex;
-
-//import javax.annotation.Nullable;
-
-import android.support.annotation.NonNull;
-
-import com.taobao.weex.WXEnvironment;
-import com.taobao.weex.utils.WXLogUtils;
-
-import java.util.ArrayList;
-
-import static com.taobao.weex.dom.flex.CSSLayout.DIMENSION_HEIGHT;
-import static com.taobao.weex.dom.flex.CSSLayout.DIMENSION_WIDTH;
-import static com.taobao.weex.dom.flex.CSSLayout.POSITION_BOTTOM;
-import static com.taobao.weex.dom.flex.CSSLayout.POSITION_LEFT;
-import static com.taobao.weex.dom.flex.CSSLayout.POSITION_RIGHT;
-import static com.taobao.weex.dom.flex.CSSLayout.POSITION_TOP;
-
-//import com.facebook.infer.annotation.Assertions;
-
-/**
- * A CSS Node. It has a cssstyle object you can manipulate at {@link 
#cssstyle}. After calling
- * {@link #calculateLayout(CSSLayoutContext)}, {@link #csslayout} will be 
filled with the results of
- * the csslayout.
- */
-public class CSSNode {
-
-  // VisibleForTesting
-  /*package*/public final CSSStyle cssstyle = new CSSStyle();
-  /*package*/ public final CSSLayout csslayout = new CSSLayout();
-  /*package*/ final CachedCSSLayout lastLayout = new CachedCSSLayout();
-  public int lineIndex = 0;
-  /*package*/ CSSNode nextAbsoluteChild;
-  /*package*/ CSSNode nextFlexChild;
-  private ArrayList<CSSNode> mChildren;
-  private CSSNode mParent;
-  private MeasureFunction mMeasureFunction = null;
-  private LayoutState mLayoutState = LayoutState.DIRTY;
-  private boolean mShow = true;
-
-  private boolean mIsLayoutChanged = true;
-
-  public boolean isShow() {
-    return mShow;
-  }
-
-  public void setVisible(boolean isShow) {
-    if (!mShow && isShow) {
-      mLayoutState = LayoutState.UP_TO_DATE;
-    }
-    mShow = isShow;
-    dirty();
-  }
-
-  public void markLayoutStateUpdated(){
-     this.mLayoutState = LayoutState.UP_TO_DATE;
-  }
-
-  /**
-   * whether layout changed when {@link #updateLastLayout(CSSLayout)} invoked 
last time.
-   * @return
-     */
-  public boolean isLayoutChanged(){
-    return mIsLayoutChanged;
-  }
-
-  /**
-   * must invoke after every layout finished,even nothing changed.
-   * @param newLayout
-   * @return
-     */
-  public boolean updateLastLayout(CSSLayout newLayout){
-    mIsLayoutChanged = !lastLayout.equals(newLayout);
-    if(mIsLayoutChanged) {
-      lastLayout.copy(newLayout);
-    }
-    return mIsLayoutChanged;
-  }
-
-  public int getChildCount() {
-    return mChildren == null ? 0 : mChildren.size();
-  }
-
-  public CSSNode getChildAt(int i) {
-    //    Assertions.assertNotNull(mChildren);
-    return mChildren.get(i);
-  }
-
-  public void addChildAt(CSSNode child, int i) {
-    if (child.mParent != null) {
-      throw new IllegalStateException("Child already has a parent, it must be 
removed first.");
-    }
-    if (mChildren == null) {
-      // 4 is kinda arbitrary, but the default of 10 seems really high for an 
average View.
-      mChildren = new ArrayList<CSSNode>(4);
-    }
-
-    mChildren.add(i, child);
-    child.mParent = this;
-    dirty();
-  }
-
-  public CSSNode removeChildAt(int i) {
-    //    Assertions.assertNotNull(mChildren);
-    CSSNode removed = mChildren.remove(i);
-    removed.mParent = null;
-    dirty();
-    return removed;
-  }
-
-  public void setParentNull() {
-    mParent = null;
-  }
-
-  public CSSNode getParent() {
-    return mParent;
-  }
-
-  /**
-   * @return the index of the given child, or -1 if the child doesn't exist in 
this node.
-   */
-  public int indexOf(CSSNode child) {
-    //    Assertions.assertNotNull(mChildren);
-    return mChildren.indexOf(child);
-  }
-
-  public void setMeasureFunction(MeasureFunction measureFunction) {
-    if (mMeasureFunction != measureFunction) {
-      mMeasureFunction = measureFunction;
-      dirty();
-    }
-  }
-
-  /*package*/ MeasureOutput measure(MeasureOutput measureOutput, float width) {
-    if (!isMeasureDefined()) {
-      throw new RuntimeException("Measure function isn't defined!");
-    }
-    measureOutput.height = CSSConstants.UNDEFINED;
-    measureOutput.width = CSSConstants.UNDEFINED;
-    if (mMeasureFunction != null) {
-      mMeasureFunction.measure(this, width, measureOutput);
-    }
-    //    Assertions.assertNotNull(mMeasureFunction).measure(this, width, 
measureOutput);
-    return measureOutput;
-  }
-
-  public boolean isMeasureDefined() {
-    return mMeasureFunction != null;
-  }
-
-  /**
-   * Performs the actual csslayout and saves the results in {@link #csslayout}
-   */
-  public void calculateLayout(CSSLayoutContext layoutContext) {
-    csslayout.resetResult();
-    LayoutEngine.layoutNode(layoutContext, this, CSSConstants.UNDEFINED, null);
-  }
-
-  /**
-   * See {@link LayoutState#DIRTY}.
-   */
-  public boolean isDirty() {
-    return mLayoutState == LayoutState.DIRTY;
-  }
-
-  public void markDirty() {
-    try{
-      this.dirty();
-    }catch (Exception e){
-      WXLogUtils.e("markDirty",  e);
-    }
-  }
-
-  protected void dirty() {
-    if (mLayoutState == LayoutState.DIRTY) {
-      return;
-    } else if (mLayoutState == LayoutState.HAS_NEW_LAYOUT) {
-      if(WXEnvironment.isApkDebugable()){
-          WXLogUtils.d("Previous csslayout was ignored! markLayoutSeen() never 
called");
-      }
-      if(hasNewLayout()) {
-        markLayoutSeen();
-      }
-    }
-
-    mLayoutState = LayoutState.DIRTY;
-
-    if (mParent != null && !mParent.isDirty()) {
-      mParent.dirty();
-    }
-  }
-
-  /*package*/ void markHasNewLayout() {
-    mLayoutState = LayoutState.HAS_NEW_LAYOUT;
-  }
-
-  /**
-   * Tells the node that the current values in {@link #csslayout} have been 
seen. Subsequent calls
-   * to {@link #hasNewLayout()} will return false until this node is laid out 
with new parameters.
-   * You must call this each time the csslayout is generated if the node has a 
new csslayout.
-   */
-  public void markLayoutSeen() {
-    if (!hasNewLayout()) {
-      throw new IllegalStateException("Expected node to have a new csslayout 
to be seen!");
-    }
-
-    mLayoutState = LayoutState.UP_TO_DATE;
-  }
-
-  /**
-   * See {@link LayoutState#HAS_NEW_LAYOUT}.
-   */
-  public boolean hasNewLayout() {
-    return mLayoutState == LayoutState.HAS_NEW_LAYOUT;
-  }
-
-  private void toStringWithIndentation(StringBuilder result, int level) {
-    // Spaces and tabs are dropped by IntelliJ logcat integration, so rely on 
__ instead.
-    StringBuilder indentation = new StringBuilder();
-    for (int i = 0; i < level; ++i) {
-      indentation.append("__");
-    }
-
-    result.append(indentation.toString());
-    result.append(csslayout.toString());
-    result.append(cssstyle.toString());
-
-    if (getChildCount() == 0) {
-      return;
-    }
-
-    result.append(", children: [\n");
-    for (int i = 0; i < getChildCount(); i++) {
-      getChildAt(i).toStringWithIndentation(result, level + 1);
-      result.append("\n");
-    }
-    result.append(indentation + "]");
-  }
-
-  @Override
-  public String toString() {
-    StringBuilder sb = new StringBuilder();
-    this.toStringWithIndentation(sb, 0);
-    return sb.toString();
-  }
-
-  protected boolean valuesEqual(float f1, float f2) {
-    return FloatUtil.floatsEqual(f1, f2);
-  }
-
-  /**
-   * Get this node's direction, as defined in the cssstyle.
-   */
-  public CSSDirection getStyleDirection() {
-    return cssstyle.direction;
-  }
-
-  public void setDirection(CSSDirection direction) {
-    if (cssstyle.direction != direction) {
-      cssstyle.direction = direction;
-      dirty();
-    }
-  }
-
-  /**
-   * Get this node's flex direction, as defined by cssstyle.
-   */
-  public CSSFlexDirection getFlexDirection() {
-    return cssstyle.flexDirection;
-  }
-
-  public void setFlexDirection(CSSFlexDirection flexDirection) {
-    if (cssstyle.flexDirection != flexDirection) {
-      cssstyle.flexDirection = flexDirection;
-      dirty();
-    }
-  }
-
-  /**
-   * Get this node's justify content, as defined by cssstyle.
-   */
-  public CSSJustify getJustifyContent() {
-    return cssstyle.justifyContent;
-  }
-
-  public void setJustifyContent(CSSJustify justifyContent) {
-    if (cssstyle.justifyContent != justifyContent) {
-      cssstyle.justifyContent = justifyContent;
-      dirty();
-    }
-  }
-
-  /**
-   * Get this node's align items, as defined by cssstyle.
-   */
-  public CSSAlign getAlignItems() {
-    return cssstyle.alignItems;
-  }
-
-  public void setAlignItems(CSSAlign alignItems) {
-    if (cssstyle.alignItems != alignItems) {
-      cssstyle.alignItems = alignItems;
-      dirty();
-    }
-  }
-
-  /**
-   * Get this node's align items, as defined by cssstyle.
-   */
-  public CSSAlign getAlignSelf() {
-    return cssstyle.alignSelf;
-  }
-
-  public void setAlignSelf(CSSAlign alignSelf) {
-    if (cssstyle.alignSelf != alignSelf) {
-      cssstyle.alignSelf = alignSelf;
-      dirty();
-    }
-  }
-
-  /**
-   * Get this node's position type, as defined by cssstyle.
-   */
-  public CSSPositionType getPositionType() {
-    return cssstyle.positionType;
-  }
-
-  public void setPositionType(CSSPositionType positionType) {
-    if (cssstyle.positionType != positionType) {
-      cssstyle.positionType = positionType;
-      dirty();
-    }
-  }
-
-  public void setWrap(CSSWrap flexWrap) {
-    if (cssstyle.flexWrap != flexWrap) {
-      cssstyle.flexWrap = flexWrap;
-      dirty();
-    }
-  }
-
-  /**
-   * Get this node's flex, as defined by cssstyle.
-   */
-  public float getFlex() {
-    return cssstyle.flex;
-  }
-
-  public void setFlex(float flex) {
-    if (!valuesEqual(cssstyle.flex, flex)) {
-      cssstyle.flex = flex;
-      dirty();
-    }
-  }
-
-  /**
-   * Get this node's margin, as defined by cssstyle + default margin.
-   */
-  public @NonNull Spacing getMargin() {
-    return cssstyle.margin;
-  }
-
-  public void setMargin(int spacingType, float margin) {
-    if (cssstyle.margin.set(spacingType, margin)) {
-      dirty();
-    }
-  }
-
-  public void setMinWidth(float minWidth) {
-    if (!valuesEqual(cssstyle.minWidth, minWidth)) {
-      cssstyle.minWidth = minWidth;
-      dirty();
-    }
-  }
-
-  public void setMaxWidth(float maxWidth) {
-    if (!valuesEqual(cssstyle.maxWidth, maxWidth)) {
-      cssstyle.maxWidth = maxWidth;
-      dirty();
-    }
-  }
-
-  public void setMinHeight(float minHeight) {
-    if (!valuesEqual(cssstyle.minHeight, minHeight)) {
-      cssstyle.minHeight = minHeight;
-      dirty();
-    }
-  }
-
-  public void setMaxHeight(float maxHeight) {
-    if (!valuesEqual(cssstyle.maxHeight, maxHeight)) {
-      cssstyle.maxHeight = maxHeight;
-      dirty();
-    }
-  }
-
-  /**
-   * Get this node's padding, as defined by cssstyle + default padding.
-   */
-  public @NonNull Spacing getPadding() {
-    return cssstyle.padding;
-  }
-
-  public void setPadding(int spacingType, float padding) {
-    if (cssstyle.padding.set(spacingType, padding)) {
-      dirty();
-    }
-  }
-
-  /**
-   * Get this node's border, as defined by cssstyle.
-   */
-  public @NonNull Spacing getBorder() {
-    return cssstyle.border;
-  }
-
-  public void setBorder(int spacingType, float border) {
-    if (cssstyle.border.set(spacingType, border)) {
-      dirty();
-    }
-  }
-
-  /**
-   * Get this node's position top, as defined by cssstyle.
-   */
-  public float getPositionTop() {
-    return cssstyle.position[POSITION_TOP];
-  }
-
-  public void setPositionTop(float positionTop) {
-    if (!valuesEqual(cssstyle.position[POSITION_TOP], positionTop)) {
-      cssstyle.position[POSITION_TOP] = positionTop;
-      dirty();
-    }
-  }
-
-  /**
-   * Get this node's position bottom, as defined by cssstyle.
-   */
-  public float getPositionBottom() {
-    return cssstyle.position[POSITION_BOTTOM];
-  }
-
-  public void setPositionBottom(float positionBottom) {
-    if (!valuesEqual(cssstyle.position[POSITION_BOTTOM], positionBottom)) {
-      cssstyle.position[POSITION_BOTTOM] = positionBottom;
-      dirty();
-    }
-  }
-
-  /**
-   * Get this node's position left, as defined by cssstyle.
-   */
-  public float getPositionLeft() {
-    return cssstyle.position[POSITION_LEFT];
-  }
-
-  public void setPositionLeft(float positionLeft) {
-    if (!valuesEqual(cssstyle.position[POSITION_LEFT], positionLeft)) {
-      cssstyle.position[POSITION_LEFT] = positionLeft;
-      dirty();
-    }
-  }
-
-  /**
-   * Get this node's position right, as defined by cssstyle.
-   */
-  public float getPositionRight() {
-    return cssstyle.position[POSITION_RIGHT];
-  }
-
-  public void setPositionRight(float positionRight) {
-    if (!valuesEqual(cssstyle.position[POSITION_RIGHT], positionRight)) {
-      cssstyle.position[POSITION_RIGHT] = positionRight;
-      dirty();
-    }
-  }
-
-  /**
-   * Get this node's width, as defined in the cssstyle.
-   */
-  public float getStyleWidth() {
-    return cssstyle.dimensions[DIMENSION_WIDTH];
-  }
-
-  public void setStyleWidth(float width) {
-    if (!valuesEqual(cssstyle.dimensions[DIMENSION_WIDTH], width)) {
-      cssstyle.dimensions[DIMENSION_WIDTH] = width;
-      dirty();
-    }
-  }
-
-  /**
-   * Get this node's height, as defined in the cssstyle.
-   */
-  public float getStyleHeight() {
-    return cssstyle.dimensions[DIMENSION_HEIGHT];
-  }
-
-  public void setStyleHeight(float height) {
-    if (!valuesEqual(cssstyle.dimensions[DIMENSION_HEIGHT], height)) {
-      cssstyle.dimensions[DIMENSION_HEIGHT] = height;
-      dirty();
-    }
-  }
-
-  public float getLayoutX() {
-    return csslayout.position[POSITION_LEFT];
-  }
-
-  public void setLayoutX(float x) {
-    csslayout.position[POSITION_LEFT] = x;
-  }
-
-  public float getLayoutY() {
-    return csslayout.position[POSITION_TOP];
-  }
-
-  public void setLayoutY(float y) {
-    csslayout.position[POSITION_TOP] = y;
-  }
-
-  public float getLayoutWidth() {
-    return csslayout.dimensions[DIMENSION_WIDTH];
-  }
-
-  public void setLayoutWidth(float width) {
-    csslayout.dimensions[DIMENSION_WIDTH] = width;
-  }
-
-  public float getLayoutHeight() {
-    return csslayout.dimensions[DIMENSION_HEIGHT];
-  }
-
-  public void setLayoutHeight(float height) {
-    csslayout.dimensions[DIMENSION_HEIGHT] = height;
-  }
-
-  public CSSDirection getLayoutDirection() {
-    return csslayout.direction;
-  }
-
-  /**
-   * Set a default padding (left/top/right/bottom) for this node.
-   */
-  public void setDefaultPadding(int spacingType, float padding) {
-    if (cssstyle.padding.setDefault(spacingType, padding)) {
-      dirty();
-    }
-  }
-
-  /**
-   * Resets this instance to its default state. This method is meant to be 
used when recycling
-   * {@link CSSNode} instances.
-   */
-  public void reset() {
-    if (mParent != null || (mChildren != null && mChildren.size() > 0)) {
-      throw new IllegalStateException("You should not reset an attached 
CSSNode");
-    }
-
-    cssstyle.reset();
-    csslayout.resetResult();
-    lineIndex = 0;
-    mLayoutState = LayoutState.DIRTY;
-  }
-
-  private static enum LayoutState {
-    /**
-     * Some property of this node or its children has changes and the current 
values in {@link
-     * #csslayout} are not valid.
-     */
-    DIRTY,
-
-    /**
-     * This node has a new csslayout relative to the last time {@link 
#markLayoutSeen()} was
-     * called.
-     */
-    HAS_NEW_LAYOUT,
-
-    /**
-     * {@link #csslayout} is valid for the node's properties and this 
csslayout has been marked as
-     * having been seen.
-     */
-    UP_TO_DATE,
-  }
-
-  public static interface MeasureFunction {
-
-    /**
-     * Should measure the given node and put the result in the given 
MeasureOutput.
-     * NB: measure is NOT guaranteed to be threadsafe/re-entrant safe!
-     */
-    public void measure(CSSNode node, float width, MeasureOutput 
measureOutput);
-  }
-
-  public float getCSSLayoutHeight() {
-    return csslayout.dimensions[CSSLayout.DIMENSION_HEIGHT];
-  }
-
-  public float getCSSLayoutWidth() {
-    return csslayout.dimensions[CSSLayout.DIMENSION_WIDTH];
-  }
-
-  public float getCSSLayoutTop() {
-    return csslayout.position[CSSLayout.POSITION_TOP];
-  }
-
-  public float getCSSLayoutBottom() {
-    return csslayout.position[CSSLayout.POSITION_BOTTOM];
-  }
-
-  public float getCSSLayoutLeft() {
-    return csslayout.position[CSSLayout.POSITION_LEFT];
-  }
-
-  public float getCSSLayoutRight() {
-    return csslayout.position[CSSLayout.POSITION_RIGHT];
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/2f8caedb/android/sdk/src/main/java/com/taobao/weex/dom/flex/CSSPositionType.java
----------------------------------------------------------------------
diff --git 
a/android/sdk/src/main/java/com/taobao/weex/dom/flex/CSSPositionType.java 
b/android/sdk/src/main/java/com/taobao/weex/dom/flex/CSSPositionType.java
deleted file mode 100755
index 4e17dd9..0000000
--- a/android/sdk/src/main/java/com/taobao/weex/dom/flex/CSSPositionType.java
+++ /dev/null
@@ -1,11 +0,0 @@
-/**
- * Copyright (c) 2014, Facebook, Inc. All rights reserved. <p/> This source 
code is licensed under
- * the BSD-style license found in the LICENSE file in the root directory of 
this source tree. An
- * additional grant of patent rights can be found in the PATENTS file in the 
same directory.
- */
-package com.taobao.weex.dom.flex;
-
-public enum CSSPositionType {
-  RELATIVE,
-  ABSOLUTE,
-}

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/2f8caedb/android/sdk/src/main/java/com/taobao/weex/dom/flex/CSSStyle.java
----------------------------------------------------------------------
diff --git a/android/sdk/src/main/java/com/taobao/weex/dom/flex/CSSStyle.java 
b/android/sdk/src/main/java/com/taobao/weex/dom/flex/CSSStyle.java
deleted file mode 100755
index da39013..0000000
--- a/android/sdk/src/main/java/com/taobao/weex/dom/flex/CSSStyle.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/**
- * Copyright (c) 2014, Facebook, Inc. All rights reserved. <p/> This source 
code is licensed under
- * the BSD-style license found in the LICENSE file in the root directory of 
this source tree. An
- * additional grant of patent rights can be found in the PATENTS file in the 
same directory.
- */
-package com.taobao.weex.dom.flex;
-
-import java.util.Arrays;
-
-import static com.taobao.weex.dom.flex.CSSLayout.DIMENSION_HEIGHT;
-import static com.taobao.weex.dom.flex.CSSLayout.DIMENSION_WIDTH;
-import static com.taobao.weex.dom.flex.CSSLayout.POSITION_BOTTOM;
-import static com.taobao.weex.dom.flex.CSSLayout.POSITION_LEFT;
-import static com.taobao.weex.dom.flex.CSSLayout.POSITION_RIGHT;
-import static com.taobao.weex.dom.flex.CSSLayout.POSITION_TOP;
-
-/**
- * The CSS style definition for a {@link CSSNode}.
- */
-public class CSSStyle {
-
-  public CSSDirection direction;
-  public CSSFlexDirection flexDirection;
-  public CSSJustify justifyContent;
-  public CSSAlign alignContent;
-  public CSSAlign alignItems;
-  public CSSAlign alignSelf;
-  public CSSPositionType positionType;
-  public CSSWrap flexWrap;
-  public float flex;
-
-  public Spacing margin = new Spacing();
-  public Spacing padding = new Spacing();
-  public Spacing border = new Spacing();
-
-  public float[] position = new float[4];
-  public float[] dimensions = new float[2];
-
-  public float minWidth = CSSConstants.UNDEFINED;
-  public float minHeight = CSSConstants.UNDEFINED;
-
-  public float maxWidth = CSSConstants.UNDEFINED;
-  public float maxHeight = CSSConstants.UNDEFINED;
-
-  CSSStyle() {
-    reset();
-  }
-
-  void reset() {
-    direction = CSSDirection.INHERIT;
-    flexDirection = CSSFlexDirection.COLUMN;
-    justifyContent = CSSJustify.FLEX_START;
-    alignContent = CSSAlign.FLEX_START;
-    alignItems = CSSAlign.STRETCH;
-    alignSelf = CSSAlign.AUTO;
-    positionType = CSSPositionType.RELATIVE;
-    flexWrap = CSSWrap.NOWRAP;
-    flex = 0f;
-
-    margin.reset();
-    padding.reset();
-    border.reset();
-
-    Arrays.fill(position, CSSConstants.UNDEFINED);
-    Arrays.fill(dimensions, CSSConstants.UNDEFINED);
-
-    minWidth = CSSConstants.UNDEFINED;
-    minHeight = CSSConstants.UNDEFINED;
-
-    maxWidth = CSSConstants.UNDEFINED;
-    maxHeight = CSSConstants.UNDEFINED;
-  }
-
-  public void copy(CSSStyle cssStyle) {
-    direction = cssStyle.direction;
-    flexDirection = cssStyle.flexDirection;
-    justifyContent = cssStyle.justifyContent;
-    alignContent = cssStyle.alignContent;
-    alignItems = cssStyle.alignItems;
-    alignSelf = cssStyle.alignSelf;
-    positionType = cssStyle.positionType;
-    flexWrap = cssStyle.flexWrap;
-    flex = cssStyle.flex;
-    margin = cssStyle.margin;
-    padding = cssStyle.padding;
-    border = cssStyle.border;
-    position[POSITION_TOP] = cssStyle.position[POSITION_TOP];
-    position[POSITION_BOTTOM] = cssStyle.position[POSITION_BOTTOM];
-    position[POSITION_LEFT] = cssStyle.position[POSITION_LEFT];
-    position[POSITION_RIGHT] = cssStyle.position[POSITION_RIGHT];
-    dimensions[DIMENSION_WIDTH] = cssStyle.dimensions[DIMENSION_WIDTH];
-    dimensions[DIMENSION_HEIGHT] = cssStyle.dimensions[DIMENSION_HEIGHT];
-    minWidth = cssStyle.minWidth;
-    minHeight = cssStyle.minHeight;
-    maxWidth = cssStyle.maxWidth;
-    maxHeight = cssStyle.maxHeight;
-  }
-
-  public String toString() {
-    return "direction =" + direction + "\n"
-            + "flexDirection =" + flexDirection + "\n"
-            + "justifyContent=" + justifyContent + "\n"
-            + "alignContent =" + alignContent + "\n"
-            + "alignItems =" + alignItems + "\n"
-            + "alignSelf =" + alignSelf + "\n"
-            + "positionType =" + positionType + "\n"
-            + "flexWrap =" + flexWrap + "\n"
-            + "flex =" + flex + "\n"
-            + "margin =" + margin + "\n"
-            + "padding =" + padding + "\n"
-            + "border =" + border + "\n"
-            + "position[POSITION_TOP] =" + position[POSITION_TOP] + "\n"
-            + "position[POSITION_BOTTOM] =" + position[POSITION_BOTTOM] + "\n"
-            + "position[POSITION_LEFT] =" + position[POSITION_LEFT] + "\n"
-            + "position[POSITION_RIGHT] =" + position[POSITION_RIGHT] + "\n"
-            + "position[DIMENSION_WIDTH] =" + position[DIMENSION_WIDTH] + "\n"
-            + "position[DIMENSION_HEIGHT] =" + position[DIMENSION_HEIGHT] + 
"\n"
-            + "minWidth =" + minWidth + "\n"
-            + "minHeight =" + minHeight + "\n"
-            + "maxWidth =" + maxWidth + "\n"
-            + "maxHeight =" + maxHeight + "\n";
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/2f8caedb/android/sdk/src/main/java/com/taobao/weex/dom/flex/CSSWrap.java
----------------------------------------------------------------------
diff --git a/android/sdk/src/main/java/com/taobao/weex/dom/flex/CSSWrap.java 
b/android/sdk/src/main/java/com/taobao/weex/dom/flex/CSSWrap.java
deleted file mode 100755
index 8011ea9..0000000
--- a/android/sdk/src/main/java/com/taobao/weex/dom/flex/CSSWrap.java
+++ /dev/null
@@ -1,11 +0,0 @@
-/**
- * Copyright (c) 2014, Facebook, Inc. All rights reserved. <p/> This source 
code is licensed under
- * the BSD-style license found in the LICENSE file in the root directory of 
this source tree. An
- * additional grant of patent rights can be found in the PATENTS file in the 
same directory.
- */
-package com.taobao.weex.dom.flex;
-
-public enum CSSWrap {
-  NOWRAP,
-  WRAP,
-}

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/2f8caedb/android/sdk/src/main/java/com/taobao/weex/dom/flex/CachedCSSLayout.java
----------------------------------------------------------------------
diff --git 
a/android/sdk/src/main/java/com/taobao/weex/dom/flex/CachedCSSLayout.java 
b/android/sdk/src/main/java/com/taobao/weex/dom/flex/CachedCSSLayout.java
deleted file mode 100755
index 4cc74fd..0000000
--- a/android/sdk/src/main/java/com/taobao/weex/dom/flex/CachedCSSLayout.java
+++ /dev/null
@@ -1,18 +0,0 @@
-/**
- * Copyright (c) 2014, Facebook, Inc. All rights reserved. <p/> This source 
code is licensed under
- * the BSD-style license found in the LICENSE file in the root directory of 
this source tree. An
- * additional grant of patent rights can be found in the PATENTS file in the 
same directory.
- */
-package com.taobao.weex.dom.flex;
-
-/**
- * CSSLayout with additional information about the conditions under which it 
was generated.
- * {@link #requestedWidth} and {@link #requestedHeight} are the width and 
height the parent set on
- * this node before calling layout visited us.
- */
-public class CachedCSSLayout extends CSSLayout {
-
-  public float requestedWidth = CSSConstants.UNDEFINED;
-  public float requestedHeight = CSSConstants.UNDEFINED;
-  public float parentMaxWidth = CSSConstants.UNDEFINED;
-}

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/2f8caedb/android/sdk/src/main/java/com/taobao/weex/dom/flex/FloatUtil.java
----------------------------------------------------------------------
diff --git a/android/sdk/src/main/java/com/taobao/weex/dom/flex/FloatUtil.java 
b/android/sdk/src/main/java/com/taobao/weex/dom/flex/FloatUtil.java
deleted file mode 100755
index 5641f39..0000000
--- a/android/sdk/src/main/java/com/taobao/weex/dom/flex/FloatUtil.java
+++ /dev/null
@@ -1,18 +0,0 @@
-/**
- * Copyright (c) 2014, Facebook, Inc. All rights reserved. <p/> This source 
code is licensed under
- * the BSD-style license found in the LICENSE file in the root directory of 
this source tree. An
- * additional grant of patent rights can be found in the PATENTS file in the 
same directory.
- */
-package com.taobao.weex.dom.flex;
-
-public class FloatUtil {
-
-  private static final float EPSILON = .00001f;
-
-  public static boolean floatsEqual(float f1, float f2) {
-    if (Float.isNaN(f1) || Float.isNaN(f2)) {
-      return Float.isNaN(f1) && Float.isNaN(f2);
-    }
-    return Math.abs(f2 - f1) < EPSILON;
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/2f8caedb/android/sdk/src/main/java/com/taobao/weex/dom/flex/LayoutEngine.java
----------------------------------------------------------------------
diff --git 
a/android/sdk/src/main/java/com/taobao/weex/dom/flex/LayoutEngine.java 
b/android/sdk/src/main/java/com/taobao/weex/dom/flex/LayoutEngine.java
deleted file mode 100755
index 6c5eba0..0000000
--- a/android/sdk/src/main/java/com/taobao/weex/dom/flex/LayoutEngine.java
+++ /dev/null
@@ -1,934 +0,0 @@
-/**
- * Copyright (c) 2014, Facebook, Inc. All rights reserved. <p/> This source 
code is licensed under
- * the BSD-cssstyle license found in the LICENSE file in the root directory of 
this source tree. An
- * additional grant of patent rights can be found in the PATENTS file in the 
same directory.
- */
-package com.taobao.weex.dom.flex;
-
-import static com.taobao.weex.dom.flex.CSSLayout.DIMENSION_HEIGHT;
-import static com.taobao.weex.dom.flex.CSSLayout.DIMENSION_WIDTH;
-import static com.taobao.weex.dom.flex.CSSLayout.POSITION_BOTTOM;
-import static com.taobao.weex.dom.flex.CSSLayout.POSITION_LEFT;
-import static com.taobao.weex.dom.flex.CSSLayout.POSITION_RIGHT;
-import static com.taobao.weex.dom.flex.CSSLayout.POSITION_TOP;
-
-/**
- * Calculates layouts based on CSS cssstyle. See {@link 
#layoutNode(CSSLayoutContext, CSSNode,
- * float, CSSDirection)}.
- */
-public class LayoutEngine {
-
-  private static final int CSS_FLEX_DIRECTION_COLUMN =
-      CSSFlexDirection.COLUMN.ordinal();
-  private static final int CSS_FLEX_DIRECTION_COLUMN_REVERSE =
-      CSSFlexDirection.COLUMN_REVERSE.ordinal();
-  private static final int CSS_FLEX_DIRECTION_ROW =
-      CSSFlexDirection.ROW.ordinal();
-  private static final int CSS_FLEX_DIRECTION_ROW_REVERSE =
-      CSSFlexDirection.ROW_REVERSE.ordinal();
-
-  private static final int CSS_POSITION_RELATIVE = 
CSSPositionType.RELATIVE.ordinal();
-  private static final int CSS_POSITION_ABSOLUTE = 
CSSPositionType.ABSOLUTE.ordinal();
-
-  private static final int[] leading = {
-      POSITION_TOP,
-      POSITION_BOTTOM,
-      POSITION_LEFT,
-      POSITION_RIGHT,
-  };
-
-  private static final int[] trailing = {
-      POSITION_BOTTOM,
-      POSITION_TOP,
-      POSITION_RIGHT,
-      POSITION_LEFT,
-  };
-
-  private static final int[] pos = {
-      POSITION_TOP,
-      POSITION_BOTTOM,
-      POSITION_LEFT,
-      POSITION_RIGHT,
-  };
-
-  private static final int[] dim = {
-      DIMENSION_HEIGHT,
-      DIMENSION_HEIGHT,
-      DIMENSION_WIDTH,
-      DIMENSION_WIDTH,
-  };
-
-  private static final int[] leadingSpacing = {
-      Spacing.TOP,
-      Spacing.BOTTOM,
-      Spacing.START,
-      Spacing.START
-  };
-
-  private static final int[] trailingSpacing = {
-      Spacing.BOTTOM,
-      Spacing.TOP,
-      Spacing.END,
-      Spacing.END
-  };
-
-  private static float boundAxis(CSSNode node, int axis, float value) {
-    float min = CSSConstants.UNDEFINED;
-    float max = CSSConstants.UNDEFINED;
-
-    if (axis == CSS_FLEX_DIRECTION_COLUMN ||
-        axis == CSS_FLEX_DIRECTION_COLUMN_REVERSE) {
-      min = node.cssstyle.minHeight;
-      max = node.cssstyle.maxHeight;
-    } else if (axis == CSS_FLEX_DIRECTION_ROW ||
-               axis == CSS_FLEX_DIRECTION_ROW_REVERSE) {
-      min = node.cssstyle.minWidth;
-      max = node.cssstyle.maxWidth;
-    }
-
-    float boundValue = value;
-
-    if (!Float.isNaN(max) && max >= 0.0 && boundValue > max) {
-      boundValue = max;
-    }
-    if (!Float.isNaN(min) && min >= 0.0 && boundValue < min) {
-      boundValue = min;
-    }
-
-    return boundValue;
-  }
-
-  private static void setDimensionFromStyle(CSSNode node, int axis) {
-    // The parent already computed us a width or height. We just skip it
-    if (!Float.isNaN(node.csslayout.dimensions[dim[axis]])) {
-      return;
-    }
-    // We only run if there's a width or height defined
-    if (Float.isNaN(node.cssstyle.dimensions[dim[axis]]) ||
-        node.cssstyle.dimensions[dim[axis]] <= 0.0) {
-      return;
-    }
-
-    // The dimensions can never be smaller than the padding and border
-    float maxLayoutDimension = Math.max(
-        boundAxis(node, axis, node.cssstyle.dimensions[dim[axis]]),
-        node.cssstyle.padding.getWithFallback(leadingSpacing[axis], 
leading[axis]) +
-        node.cssstyle.padding.getWithFallback(trailingSpacing[axis], 
trailing[axis]) +
-        node.cssstyle.border.getWithFallback(leadingSpacing[axis], 
leading[axis]) +
-        node.cssstyle.border.getWithFallback(trailingSpacing[axis], 
trailing[axis]));
-    node.csslayout.dimensions[dim[axis]] = maxLayoutDimension;
-  }
-
-  private static float getRelativePosition(CSSNode node, int axis) {
-    float lead = node.cssstyle.position[leading[axis]];
-    if (!Float.isNaN(lead)) {
-      return lead;
-    }
-
-    float trailingPos = node.cssstyle.position[trailing[axis]];
-    return Float.isNaN(trailingPos) ? 0 : -trailingPos;
-  }
-
-  private static int resolveAxis(
-      int axis,
-      CSSDirection direction) {
-    if (direction == CSSDirection.RTL) {
-      if (axis == CSS_FLEX_DIRECTION_ROW) {
-        return CSS_FLEX_DIRECTION_ROW_REVERSE;
-      } else if (axis == CSS_FLEX_DIRECTION_ROW_REVERSE) {
-        return CSS_FLEX_DIRECTION_ROW;
-      }
-    }
-
-    return axis;
-  }
-
-  private static CSSDirection resolveDirection(CSSNode node, CSSDirection 
parentDirection) {
-    CSSDirection direction = node.cssstyle.direction;
-    if (direction == CSSDirection.INHERIT) {
-      direction = (parentDirection == null ? CSSDirection.LTR : 
parentDirection);
-    }
-
-    return direction;
-  }
-
-  private static int getFlexDirection(CSSNode node) {
-    return node.cssstyle.flexDirection.ordinal();
-  }
-
-  private static int getCrossFlexDirection(
-      int axis,
-      CSSDirection direction) {
-    if (axis == CSS_FLEX_DIRECTION_COLUMN ||
-        axis == CSS_FLEX_DIRECTION_COLUMN_REVERSE) {
-      return resolveAxis(CSS_FLEX_DIRECTION_ROW, direction);
-    } else {
-      return CSS_FLEX_DIRECTION_COLUMN;
-    }
-  }
-
-  private static CSSAlign getAlignItem(CSSNode node, CSSNode child) {
-    if (child.cssstyle.alignSelf != CSSAlign.AUTO) {
-      return child.cssstyle.alignSelf;
-    }
-    return node.cssstyle.alignItems;
-  }
-
-  private static boolean isMeasureDefined(CSSNode node) {
-    return node.isMeasureDefined();
-  }
-
-  static boolean needsRelayout(CSSNode node, float parentMaxWidth) {
-    return node.isDirty() ||
-           !FloatUtil.floatsEqual(
-               node.lastLayout.requestedHeight,
-               node.csslayout.dimensions[DIMENSION_HEIGHT]) ||
-           !FloatUtil.floatsEqual(
-               node.lastLayout.requestedWidth,
-               node.csslayout.dimensions[DIMENSION_WIDTH]) ||
-           !FloatUtil.floatsEqual(node.lastLayout.parentMaxWidth, 
parentMaxWidth);
-  }
-
-  /*package*/
-  static void layoutNode(
-      CSSLayoutContext layoutContext,
-      CSSNode node,
-      float parentMaxWidth,
-      CSSDirection parentDirection) {
-    if (needsRelayout(node, parentMaxWidth)) {
-      node.lastLayout.requestedWidth = 
node.csslayout.dimensions[DIMENSION_WIDTH];
-      node.lastLayout.requestedHeight = 
node.csslayout.dimensions[DIMENSION_HEIGHT];
-      node.lastLayout.parentMaxWidth = parentMaxWidth;
-
-      layoutNodeImpl(layoutContext, node, parentMaxWidth, parentDirection);
-      node.updateLastLayout(node.csslayout);
-    } else {
-      node.csslayout.copy(node.lastLayout);
-      node.updateLastLayout(node.lastLayout);//nothing changed
-    }
-
-    node.markHasNewLayout();
-  }
-
-  private static void layoutNodeImpl(
-      CSSLayoutContext layoutContext,
-      CSSNode node,
-      float parentMaxWidth,
-      CSSDirection parentDirection) {
-    for (int i = 0, childCount = node.getChildCount(); i < childCount; i++) {
-      node.getChildAt(i).csslayout.resetResult();
-    }
-    if (!node.isShow()) {
-      return;
-    }
-
-    /** START_GENERATED **/
-
-    CSSDirection direction = resolveDirection(node, parentDirection);
-    int mainAxis = resolveAxis(getFlexDirection(node), direction);
-    int crossAxis = getCrossFlexDirection(mainAxis, direction);
-    int resolvedRowAxis = resolveAxis(CSS_FLEX_DIRECTION_ROW, direction);
-
-    // Handle width and height cssstyle attributes
-    setDimensionFromStyle(node, mainAxis);
-    setDimensionFromStyle(node, crossAxis);
-
-    // Set the resolved resolution in the node's csslayout
-    node.csslayout.direction = direction;
-
-    // The position is set by the parent, but we need to complete it with a
-    // delta composed of the margin and left/top/right/bottom
-    node.csslayout.position[leading[mainAxis]] += 
node.cssstyle.margin.getWithFallback(leadingSpacing[mainAxis], 
leading[mainAxis]) +
-                                                  getRelativePosition(node, 
mainAxis);
-    node.csslayout.position[trailing[mainAxis]] += 
node.cssstyle.margin.getWithFallback(trailingSpacing[mainAxis], 
trailing[mainAxis]) +
-                                                   getRelativePosition(node, 
mainAxis);
-    node.csslayout.position[leading[crossAxis]] += 
node.cssstyle.margin.getWithFallback(leadingSpacing[crossAxis], 
leading[crossAxis]) +
-                                                   getRelativePosition(node, 
crossAxis);
-    node.csslayout.position[trailing[crossAxis]] += 
node.cssstyle.margin.getWithFallback(trailingSpacing[crossAxis], 
trailing[crossAxis]) +
-                                                    getRelativePosition(node, 
crossAxis);
-
-    // Inline immutable values from the target node to avoid excessive method
-    // invocations during the csslayout calculation.
-    int childCount = node.getChildCount();
-    float paddingAndBorderAxisResolvedRow = 
((node.cssstyle.padding.getWithFallback(leadingSpacing[resolvedRowAxis], 
leading[resolvedRowAxis]) +
-                                              
node.cssstyle.border.getWithFallback(leadingSpacing[resolvedRowAxis], 
leading[resolvedRowAxis])) +
-                                             
(node.cssstyle.padding.getWithFallback(trailingSpacing[resolvedRowAxis], 
trailing[resolvedRowAxis]) +
-                                              
node.cssstyle.border.getWithFallback(trailingSpacing[resolvedRowAxis], 
trailing[resolvedRowAxis])));
-
-    if (isMeasureDefined(node)) {
-      boolean isResolvedRowDimDefined = 
!Float.isNaN(node.csslayout.dimensions[dim[resolvedRowAxis]]);
-
-      float width = CSSConstants.UNDEFINED;
-      if ((!Float.isNaN(node.cssstyle.dimensions[dim[resolvedRowAxis]]) && 
node.cssstyle.dimensions[dim[resolvedRowAxis]] >= 0.0)) {
-        width = node.cssstyle.dimensions[DIMENSION_WIDTH];
-      } else if (isResolvedRowDimDefined) {
-        width = node.csslayout.dimensions[dim[resolvedRowAxis]];
-      } else {
-        width = parentMaxWidth -
-                
(node.cssstyle.margin.getWithFallback(leadingSpacing[resolvedRowAxis], 
leading[resolvedRowAxis]) + 
node.cssstyle.margin.getWithFallback(trailingSpacing[resolvedRowAxis], 
trailing[resolvedRowAxis]));
-      }
-      width -= paddingAndBorderAxisResolvedRow;
-
-      // We only need to give a dimension for the text if we haven't got any
-      // for it computed yet. It can either be from the cssstyle attribute or 
because
-      // the element is flexible.
-      boolean isRowUndefined = 
!(!Float.isNaN(node.cssstyle.dimensions[dim[resolvedRowAxis]]) && 
node.cssstyle.dimensions[dim[resolvedRowAxis]] >= 0.0) && 
!isResolvedRowDimDefined;
-      boolean isColumnUndefined = 
!(!Float.isNaN(node.cssstyle.dimensions[dim[CSS_FLEX_DIRECTION_COLUMN]]) && 
node.cssstyle.dimensions[dim[CSS_FLEX_DIRECTION_COLUMN]] >= 0.0) &&
-                                  
Float.isNaN(node.csslayout.dimensions[dim[CSS_FLEX_DIRECTION_COLUMN]]);
-
-      // Let's not measure the text if we already know both dimensions
-      if (isRowUndefined || isColumnUndefined) {
-        MeasureOutput measureDim = node.measure(
-
-            layoutContext.measureOutput,
-            width
-                                               );
-        if (isRowUndefined) {
-          node.csslayout.dimensions[DIMENSION_WIDTH] = measureDim.width +
-                                                       
paddingAndBorderAxisResolvedRow;
-        }
-        if (isColumnUndefined) {
-          node.csslayout.dimensions[DIMENSION_HEIGHT] = measureDim.height +
-                                                        
((node.cssstyle.padding.getWithFallback(leadingSpacing[CSS_FLEX_DIRECTION_COLUMN],
 leading[CSS_FLEX_DIRECTION_COLUMN]) + 
node.cssstyle.border.getWithFallback(leadingSpacing[CSS_FLEX_DIRECTION_COLUMN], 
leading[CSS_FLEX_DIRECTION_COLUMN])) + 
(node.cssstyle.padding.getWithFallback(trailingSpacing[CSS_FLEX_DIRECTION_COLUMN],
 trailing[CSS_FLEX_DIRECTION_COLUMN]) + 
node.cssstyle.border.getWithFallback(trailingSpacing[CSS_FLEX_DIRECTION_COLUMN],
 trailing[CSS_FLEX_DIRECTION_COLUMN])));
-        }
-      }
-      if (childCount == 0) {
-        return;
-      }
-    }
-
-    boolean isNodeFlexWrap = (node.cssstyle.flexWrap == CSSWrap.WRAP);
-
-    CSSJustify justifyContent = node.cssstyle.justifyContent;
-
-    float leadingPaddingAndBorderMain = 
(node.cssstyle.padding.getWithFallback(leadingSpacing[mainAxis], 
leading[mainAxis]) + 
node.cssstyle.border.getWithFallback(leadingSpacing[mainAxis], 
leading[mainAxis]));
-    float leadingPaddingAndBorderCross = 
(node.cssstyle.padding.getWithFallback(leadingSpacing[crossAxis], 
leading[crossAxis]) + 
node.cssstyle.border.getWithFallback(leadingSpacing[crossAxis], 
leading[crossAxis]));
-    float paddingAndBorderAxisMain = 
((node.cssstyle.padding.getWithFallback(leadingSpacing[mainAxis], 
leading[mainAxis]) + 
node.cssstyle.border.getWithFallback(leadingSpacing[mainAxis], 
leading[mainAxis])) + 
(node.cssstyle.padding.getWithFallback(trailingSpacing[mainAxis], 
trailing[mainAxis]) + 
node.cssstyle.border.getWithFallback(trailingSpacing[mainAxis], 
trailing[mainAxis])));
-    float paddingAndBorderAxisCross = 
((node.cssstyle.padding.getWithFallback(leadingSpacing[crossAxis], 
leading[crossAxis]) + 
node.cssstyle.border.getWithFallback(leadingSpacing[crossAxis], 
leading[crossAxis])) + 
(node.cssstyle.padding.getWithFallback(trailingSpacing[crossAxis], 
trailing[crossAxis]) + 
node.cssstyle.border.getWithFallback(trailingSpacing[crossAxis], 
trailing[crossAxis])));
-
-    boolean isMainDimDefined = 
!Float.isNaN(node.csslayout.dimensions[dim[mainAxis]]);
-    boolean isCrossDimDefined = 
!Float.isNaN(node.csslayout.dimensions[dim[crossAxis]]);
-    boolean isMainRowDirection = (mainAxis == CSS_FLEX_DIRECTION_ROW || 
mainAxis == CSS_FLEX_DIRECTION_ROW_REVERSE);
-
-    int i;
-    int ii;
-    CSSNode child;
-    int axis;
-
-    CSSNode firstAbsoluteChild = null;
-    CSSNode currentAbsoluteChild = null;
-
-    float definedMainDim = CSSConstants.UNDEFINED;
-    if (isMainDimDefined) {
-      definedMainDim = node.csslayout.dimensions[dim[mainAxis]] - 
paddingAndBorderAxisMain;
-    }
-
-    // We want to execute the next two loops one per line with flex-wrap
-    int startLine = 0;
-    int endLine = 0;
-    // int nextOffset = 0;
-    int alreadyComputedNextLayout = 0;
-    // We aggregate the total dimensions of the container in those two 
variables
-    float linesCrossDim = 0;
-    float linesMainDim = 0;
-    int linesCount = 0;
-    while (endLine < childCount) {
-      // <Loop A> Layout non flexible children and count children by type
-
-      // mainContentDim is accumulation of the dimensions and margin of all the
-      // non flexible children. This will be used in order to either set the
-      // dimensions of the node if none already exist, or to compute the
-      // remaining space left for the flexible children.
-      float mainContentDim = 0;
-
-      // There are three kind of children, non flexible, flexible and absolute.
-      // We need to know how many there are in order to distribute the space.
-      int flexibleChildrenCount = 0;
-      float totalFlexible = 0;
-      int nonFlexibleChildrenCount = 0;
-
-      // Use the line loop to position children in the main axis for as long
-      // as they are using a simple stacking behaviour. Children that are
-      // immediately stacked in the initial loop will not be touched again
-      // in <Loop C>.
-      boolean isSimpleStackMain =
-          (isMainDimDefined && justifyContent == CSSJustify.FLEX_START) ||
-          (!isMainDimDefined && justifyContent != CSSJustify.CENTER);
-      int firstComplexMain = (isSimpleStackMain ? childCount : startLine);
-
-      // Use the initial line loop to position children in the cross axis for
-      // as long as they are relatively positioned with alignment STRETCH or
-      // FLEX_START. Children that are immediately stacked in the initial loop
-      // will not be touched again in <Loop D>.
-      boolean isSimpleStackCross = true;
-      int firstComplexCross = childCount;
-
-      CSSNode firstFlexChild = null;
-      CSSNode currentFlexChild = null;
-
-      float mainDim = leadingPaddingAndBorderMain;
-      float crossDim = 0;
-
-      float maxWidth;
-      for (i = startLine; i < childCount; ++i) {
-        child = node.getChildAt(i);
-        if (!child.isShow()) {
-          endLine = i + 1;
-          continue;
-        }
-        child.lineIndex = linesCount;
-
-        child.nextAbsoluteChild = null;
-        child.nextFlexChild = null;
-
-        CSSAlign alignItem = getAlignItem(node, child);
-
-        // Pre-fill cross axis dimensions when the child is using stretch 
before
-        // we call the recursive csslayout pass
-        if (alignItem == CSSAlign.STRETCH &&
-            child.cssstyle.positionType == CSSPositionType.RELATIVE &&
-            isCrossDimDefined &&
-            !(!Float.isNaN(child.cssstyle.dimensions[dim[crossAxis]]) && 
child.cssstyle.dimensions[dim[crossAxis]] >= 0.0)) {
-          child.csslayout.dimensions[dim[crossAxis]] = Math.max(
-              boundAxis(child, crossAxis, 
node.csslayout.dimensions[dim[crossAxis]] -
-                                          paddingAndBorderAxisCross - 
(child.cssstyle.margin.getWithFallback(leadingSpacing[crossAxis], 
leading[crossAxis]) + 
child.cssstyle.margin.getWithFallback(trailingSpacing[crossAxis], 
trailing[crossAxis]))),
-              // You never want to go smaller than padding
-              
((child.cssstyle.padding.getWithFallback(leadingSpacing[crossAxis], 
leading[crossAxis]) + 
child.cssstyle.border.getWithFallback(leadingSpacing[crossAxis], 
leading[crossAxis])) + 
(child.cssstyle.padding.getWithFallback(trailingSpacing[crossAxis], 
trailing[crossAxis]) + 
child.cssstyle.border.getWithFallback(trailingSpacing[crossAxis], 
trailing[crossAxis])))
-                                                               );
-        } else if (child.cssstyle.positionType == CSSPositionType.ABSOLUTE) {
-          // Store a private linked list of absolutely positioned children
-          // so that we can efficiently traverse them later.
-          if (firstAbsoluteChild == null) {
-            firstAbsoluteChild = child;
-          }
-          if (currentAbsoluteChild != null) {
-            currentAbsoluteChild.nextAbsoluteChild = child;
-          }
-          currentAbsoluteChild = child;
-
-          // Pre-fill dimensions when using absolute position and both offsets 
for the axis are defined (either both
-          // left and right or top and bottom).
-          for (ii = 0; ii < 2; ii++) {
-            axis = (ii != 0) ? CSS_FLEX_DIRECTION_ROW : 
CSS_FLEX_DIRECTION_COLUMN;
-            if (!Float.isNaN(node.csslayout.dimensions[dim[axis]]) &&
-                !(!Float.isNaN(child.cssstyle.dimensions[dim[axis]]) && 
child.cssstyle.dimensions[dim[axis]] >= 0.0) &&
-                !Float.isNaN(child.cssstyle.position[leading[axis]]) &&
-                !Float.isNaN(child.cssstyle.position[trailing[axis]])) {
-              child.csslayout.dimensions[dim[axis]] = Math.max(
-                  boundAxis(child, axis, node.csslayout.dimensions[dim[axis]] -
-                                         
((node.cssstyle.padding.getWithFallback(leadingSpacing[axis], leading[axis]) + 
node.cssstyle.border.getWithFallback(leadingSpacing[axis], leading[axis])) + 
(node.cssstyle.padding.getWithFallback(trailingSpacing[axis], trailing[axis]) + 
node.cssstyle.border.getWithFallback(trailingSpacing[axis], trailing[axis]))) -
-                                         
(child.cssstyle.margin.getWithFallback(leadingSpacing[axis], leading[axis]) + 
child.cssstyle.margin.getWithFallback(trailingSpacing[axis], trailing[axis])) -
-                                         
(Float.isNaN(child.cssstyle.position[leading[axis]]) ? 0 : 
child.cssstyle.position[leading[axis]]) -
-                                         
(Float.isNaN(child.cssstyle.position[trailing[axis]]) ? 0 : 
child.cssstyle.position[trailing[axis]])),
-                  // You never want to go smaller than padding
-                  
((child.cssstyle.padding.getWithFallback(leadingSpacing[axis], leading[axis]) + 
child.cssstyle.border.getWithFallback(leadingSpacing[axis], leading[axis])) + 
(child.cssstyle.padding.getWithFallback(trailingSpacing[axis], trailing[axis]) 
+ child.cssstyle.border.getWithFallback(trailingSpacing[axis], trailing[axis])))
-                                                              );
-            }
-          }
-        }
-
-        float nextContentDim = 0;
-
-        // It only makes sense to consider a child flexible if we have a 
computed
-        // dimension for the node.
-        if (isMainDimDefined && (child.cssstyle.positionType == 
CSSPositionType.RELATIVE && child.cssstyle.flex > 0)) {
-          flexibleChildrenCount++;
-          totalFlexible += child.cssstyle.flex;
-
-          // Store a private linked list of flexible children so that we can
-          // efficiently traverse them later.
-          if (firstFlexChild == null) {
-            firstFlexChild = child;
-          }
-          if (currentFlexChild != null) {
-            currentFlexChild.nextFlexChild = child;
-          }
-          currentFlexChild = child;
-
-          // Even if we don't know its exact size yet, we already know the 
padding,
-          // border and margin. We'll use this partial information, which 
represents
-          // the smallest possible size for the child, to compute the remaining
-          // available space.
-          nextContentDim = 
((child.cssstyle.padding.getWithFallback(leadingSpacing[mainAxis], 
leading[mainAxis]) + 
child.cssstyle.border.getWithFallback(leadingSpacing[mainAxis], 
leading[mainAxis])) + 
(child.cssstyle.padding.getWithFallback(trailingSpacing[mainAxis], 
trailing[mainAxis]) + 
child.cssstyle.border.getWithFallback(trailingSpacing[mainAxis], 
trailing[mainAxis]))) +
-                           
(child.cssstyle.margin.getWithFallback(leadingSpacing[mainAxis], 
leading[mainAxis]) + 
child.cssstyle.margin.getWithFallback(trailingSpacing[mainAxis], 
trailing[mainAxis]));
-
-        } else {
-          maxWidth = CSSConstants.UNDEFINED;
-          if (!isMainRowDirection) {
-            if ((!Float.isNaN(node.cssstyle.dimensions[dim[resolvedRowAxis]]) 
&& node.cssstyle.dimensions[dim[resolvedRowAxis]] >= 0.0)) {
-              maxWidth = node.csslayout.dimensions[dim[resolvedRowAxis]] -
-                         paddingAndBorderAxisResolvedRow;
-            } else {
-              maxWidth = parentMaxWidth -
-                         
(node.cssstyle.margin.getWithFallback(leadingSpacing[resolvedRowAxis], 
leading[resolvedRowAxis]) + 
node.cssstyle.margin.getWithFallback(trailingSpacing[resolvedRowAxis], 
trailing[resolvedRowAxis])) -
-                         paddingAndBorderAxisResolvedRow;
-            }
-          }
-
-          // This is the main recursive call. We csslayout non flexible 
children.
-          if (alreadyComputedNextLayout == 0) {
-            layoutNode(layoutContext, child, maxWidth, direction);
-          }
-
-          // Absolute positioned elements do not take part of the csslayout, 
so we
-          // don't use them to compute mainContentDim
-          if (child.cssstyle.positionType == CSSPositionType.RELATIVE) {
-            nonFlexibleChildrenCount++;
-            // At this point we know the final size and margin of the element.
-            nextContentDim = (child.csslayout.dimensions[dim[mainAxis]] + 
child.cssstyle.margin.getWithFallback(leadingSpacing[mainAxis], 
leading[mainAxis]) + 
child.cssstyle.margin.getWithFallback(trailingSpacing[mainAxis], 
trailing[mainAxis]));
-          }
-        }
-
-        // The element we are about to add would make us go to the next line
-        if (isNodeFlexWrap &&
-            isMainDimDefined &&
-            mainContentDim + nextContentDim > definedMainDim &&
-            // If there's only one element, then it's bigger than the content
-            // and needs its own line
-            i != startLine) {
-          nonFlexibleChildrenCount--;
-          alreadyComputedNextLayout = 1;
-          break;
-        }
-
-        // Disable simple stacking in the main axis for the current line as
-        // we found a non-trivial child. The remaining children will be laid 
out
-        // in <Loop C>.
-        if (isSimpleStackMain &&
-            (child.cssstyle.positionType != CSSPositionType.RELATIVE || 
(child.cssstyle.positionType == CSSPositionType.RELATIVE && child.cssstyle.flex 
> 0))) {
-          isSimpleStackMain = false;
-          firstComplexMain = i;
-        }
-
-        // Disable simple stacking in the cross axis for the current line as
-        // we found a non-trivial child. The remaining children will be laid 
out
-        // in <Loop D>.
-        if (isSimpleStackCross &&
-            (child.cssstyle.positionType != CSSPositionType.RELATIVE ||
-             (alignItem != CSSAlign.STRETCH && alignItem != 
CSSAlign.FLEX_START) ||
-             Float.isNaN(child.csslayout.dimensions[dim[crossAxis]]))) {
-          isSimpleStackCross = false;
-          firstComplexCross = i;
-        }
-
-        if (isSimpleStackMain) {
-          child.csslayout.position[pos[mainAxis]] += mainDim;
-          if (isMainDimDefined) {
-            child.csslayout.position[trailing[mainAxis]] = 
node.csslayout.dimensions[dim[mainAxis]] - 
child.csslayout.dimensions[dim[mainAxis]] - 
child.csslayout.position[pos[mainAxis]];
-          }
-
-          mainDim += (child.csslayout.dimensions[dim[mainAxis]] + 
child.cssstyle.margin.getWithFallback(leadingSpacing[mainAxis], 
leading[mainAxis]) + 
child.cssstyle.margin.getWithFallback(trailingSpacing[mainAxis], 
trailing[mainAxis]));
-          crossDim = Math.max(crossDim, boundAxis(child, crossAxis, 
(child.csslayout.dimensions[dim[crossAxis]] + 
child.cssstyle.margin.getWithFallback(leadingSpacing[crossAxis], 
leading[crossAxis]) + 
child.cssstyle.margin.getWithFallback(trailingSpacing[crossAxis], 
trailing[crossAxis]))));
-        }
-
-        if (isSimpleStackCross) {
-          child.csslayout.position[pos[crossAxis]] += linesCrossDim + 
leadingPaddingAndBorderCross;
-          if (isCrossDimDefined) {
-            child.csslayout.position[trailing[crossAxis]] = 
node.csslayout.dimensions[dim[crossAxis]] - 
child.csslayout.dimensions[dim[crossAxis]] - 
child.csslayout.position[pos[crossAxis]];
-          }
-        }
-
-        alreadyComputedNextLayout = 0;
-        mainContentDim += nextContentDim;
-        endLine = i + 1;
-      }
-
-      // <Loop B> Layout flexible children and allocate empty space
-
-      // In order to position the elements in the main axis, we have two
-      // controls. The space between the beginning and the first element
-      // and the space between each two elements.
-      float leadingMainDim = 0;
-      float betweenMainDim = 0;
-
-      // The remaining available space that needs to be allocated
-      float remainingMainDim = 0;
-      if (isMainDimDefined) {
-        remainingMainDim = definedMainDim - mainContentDim;
-      } else {
-        remainingMainDim = Math.max(mainContentDim, 0) - mainContentDim;
-      }
-
-      // If there are flexible children in the mix, they are going to fill the
-      // remaining space
-      if (flexibleChildrenCount != 0) {
-        float flexibleMainDim = remainingMainDim / totalFlexible;
-        float baseMainDim;
-        float boundMainDim;
-
-        // If the flex share of remaining space doesn't meet min/max bounds,
-        // remove this child from flex calculations.
-        currentFlexChild = firstFlexChild;
-        while (currentFlexChild != null) {
-          if (currentFlexChild.isShow()) {
-            baseMainDim = flexibleMainDim * currentFlexChild.cssstyle.flex +
-                          
((currentFlexChild.cssstyle.padding.getWithFallback(leadingSpacing[mainAxis], 
leading[mainAxis]) + 
currentFlexChild.cssstyle.border.getWithFallback(leadingSpacing[mainAxis], 
leading[mainAxis])) + 
(currentFlexChild.cssstyle.padding.getWithFallback(trailingSpacing[mainAxis], 
trailing[mainAxis]) + 
currentFlexChild.cssstyle.border.getWithFallback(trailingSpacing[mainAxis], 
trailing[mainAxis])));
-            boundMainDim = boundAxis(currentFlexChild, mainAxis, baseMainDim);
-
-            if (baseMainDim != boundMainDim) {
-              remainingMainDim -= boundMainDim;
-              totalFlexible -= currentFlexChild.cssstyle.flex;
-            }
-          }
-          currentFlexChild = currentFlexChild.nextFlexChild;
-        }
-        flexibleMainDim = remainingMainDim / totalFlexible;
-
-        // The non flexible children can overflow the container, in this case
-        // we should just assume that there is no space available.
-        if (flexibleMainDim < 0) {
-          flexibleMainDim = 0;
-        }
-
-        currentFlexChild = firstFlexChild;
-        while (currentFlexChild != null) {
-          if (currentFlexChild.isShow()) {
-            // At this point we know the final size of the element in the main
-            // dimension
-            currentFlexChild.csslayout.dimensions[dim[mainAxis]] = 
boundAxis(currentFlexChild, mainAxis,
-                                                                             
flexibleMainDim * currentFlexChild.cssstyle.flex +
-                                                                             
((currentFlexChild.cssstyle.padding.getWithFallback(leadingSpacing[mainAxis], 
leading[mainAxis]) + 
currentFlexChild.cssstyle.border.getWithFallback(leadingSpacing[mainAxis], 
leading[mainAxis])) + 
(currentFlexChild.cssstyle.padding.getWithFallback(trailingSpacing[mainAxis], 
trailing[mainAxis]) + 
currentFlexChild.cssstyle.border.getWithFallback(trailingSpacing[mainAxis], 
trailing[mainAxis])))
-                                                                            );
-
-            maxWidth = CSSConstants.UNDEFINED;
-            if ((!Float.isNaN(node.cssstyle.dimensions[dim[resolvedRowAxis]]) 
&& node.cssstyle.dimensions[dim[resolvedRowAxis]] >= 0.0)) {
-              maxWidth = node.csslayout.dimensions[dim[resolvedRowAxis]] -
-                         paddingAndBorderAxisResolvedRow;
-            } else if (!isMainRowDirection) {
-              maxWidth = parentMaxWidth -
-                         
(node.cssstyle.margin.getWithFallback(leadingSpacing[resolvedRowAxis], 
leading[resolvedRowAxis]) + 
node.cssstyle.margin.getWithFallback(trailingSpacing[resolvedRowAxis], 
trailing[resolvedRowAxis])) -
-                         paddingAndBorderAxisResolvedRow;
-            }
-
-            // And we recursively call the csslayout algorithm for this child
-            layoutNode(layoutContext, currentFlexChild, maxWidth, direction);
-          }
-          child = currentFlexChild;
-          currentFlexChild = currentFlexChild.nextFlexChild;
-          child.nextFlexChild = null;
-        }
-
-        // We use justifyContent to figure out how to allocate the remaining
-        // space available
-      } else if (justifyContent != CSSJustify.FLEX_START) {
-        if (justifyContent == CSSJustify.CENTER) {
-          leadingMainDim = remainingMainDim / 2;
-        } else if (justifyContent == CSSJustify.FLEX_END) {
-          leadingMainDim = remainingMainDim;
-        } else if (justifyContent == CSSJustify.SPACE_BETWEEN) {
-          remainingMainDim = Math.max(remainingMainDim, 0);
-          if (flexibleChildrenCount + nonFlexibleChildrenCount - 1 != 0) {
-            betweenMainDim = remainingMainDim /
-                             (flexibleChildrenCount + nonFlexibleChildrenCount 
- 1);
-          } else {
-            betweenMainDim = 0;
-          }
-        } else if (justifyContent == CSSJustify.SPACE_AROUND) {
-          // Space on the edges is half of the space between elements
-          betweenMainDim = remainingMainDim /
-                           (flexibleChildrenCount + nonFlexibleChildrenCount);
-          leadingMainDim = betweenMainDim / 2;
-        }
-      }
-
-      // <Loop C> Position elements in the main axis and compute dimensions
-
-      // At this point, all the children have their dimensions set. We need to
-      // find their position. In order to do that, we accumulate data in
-      // variables that are also useful to compute the total dimensions of the
-      // container!
-      mainDim += leadingMainDim;
-
-      for (i = firstComplexMain; i < endLine; ++i) {
-        child = node.getChildAt(i);
-        if (!child.isShow()) {
-          continue;
-        }
-
-        if (child.cssstyle.positionType == CSSPositionType.ABSOLUTE &&
-            !Float.isNaN(child.cssstyle.position[leading[mainAxis]])) {
-          // In case the child is position absolute and has left/top being
-          // defined, we override the position to whatever the user said
-          // (and margin/border).
-          child.csslayout.position[pos[mainAxis]] = 
(Float.isNaN(child.cssstyle.position[leading[mainAxis]]) ? 0 : 
child.cssstyle.position[leading[mainAxis]]) +
-                                                    
node.cssstyle.border.getWithFallback(leadingSpacing[mainAxis], 
leading[mainAxis]) +
-                                                    
child.cssstyle.margin.getWithFallback(leadingSpacing[mainAxis], 
leading[mainAxis]);
-        } else {
-          // If the child is position absolute (without top/left) or relative,
-          // we put it at the current accumulated offset.
-          child.csslayout.position[pos[mainAxis]] += mainDim;
-
-          // Define the trailing position accordingly.
-          if (isMainDimDefined) {
-            child.csslayout.position[trailing[mainAxis]] = 
node.csslayout.dimensions[dim[mainAxis]] - 
child.csslayout.dimensions[dim[mainAxis]] - 
child.csslayout.position[pos[mainAxis]];
-          }
-
-          // Now that we placed the element, we need to update the variables
-          // We only need to do that for relative elements. Absolute elements
-          // do not take part in that phase.
-          if (child.cssstyle.positionType == CSSPositionType.RELATIVE) {
-            // The main dimension is the sum of all the elements dimension plus
-            // the spacing.
-            mainDim += betweenMainDim + 
(child.csslayout.dimensions[dim[mainAxis]] + 
child.cssstyle.margin.getWithFallback(leadingSpacing[mainAxis], 
leading[mainAxis]) + 
child.cssstyle.margin.getWithFallback(trailingSpacing[mainAxis], 
trailing[mainAxis]));
-            // The cross dimension is the max of the elements dimension since 
there
-            // can only be one element in that cross dimension.
-            crossDim = Math.max(crossDim, boundAxis(child, crossAxis, 
(child.csslayout.dimensions[dim[crossAxis]] + 
child.cssstyle.margin.getWithFallback(leadingSpacing[crossAxis], 
leading[crossAxis]) + 
child.cssstyle.margin.getWithFallback(trailingSpacing[crossAxis], 
trailing[crossAxis]))));
-          }
-        }
-      }
-
-      float containerCrossAxis = node.csslayout.dimensions[dim[crossAxis]];
-      if (!isCrossDimDefined) {
-        containerCrossAxis = Math.max(
-            // For the cross dim, we add both sides at the end because the 
value
-            // is aggregate via a max function. Intermediate negative values
-            // can mess this computation otherwise
-            boundAxis(node, crossAxis, crossDim + paddingAndBorderAxisCross),
-            paddingAndBorderAxisCross
-                                     );
-      }
-
-      // <Loop D> Position elements in the cross axis
-      for (i = firstComplexCross; i < endLine; ++i) {
-        child = node.getChildAt(i);
-        if (!child.isShow()) {
-          continue;
-        }
-
-        if (child.cssstyle.positionType == CSSPositionType.ABSOLUTE &&
-            !Float.isNaN(child.cssstyle.position[leading[crossAxis]])) {
-          // In case the child is absolutely positionned and has a
-          // top/left/bottom/right being set, we override all the previously
-          // computed positions to set it correctly.
-          child.csslayout.position[pos[crossAxis]] = 
(Float.isNaN(child.cssstyle.position[leading[crossAxis]]) ? 0 : 
child.cssstyle.position[leading[crossAxis]]) +
-                                                     
node.cssstyle.border.getWithFallback(leadingSpacing[crossAxis], 
leading[crossAxis]) +
-                                                     
child.cssstyle.margin.getWithFallback(leadingSpacing[crossAxis], 
leading[crossAxis]);
-
-        } else {
-          float leadingCrossDim = leadingPaddingAndBorderCross;
-
-          // For a relative children, we're either using alignItems (parent) or
-          // alignSelf (child) in order to determine the position in the cross 
axis
-          if (child.cssstyle.positionType == CSSPositionType.RELATIVE) {
-            /*eslint-disable */
-            // This variable is intentionally re-defined as the code is 
transpiled to a block scope language
-            CSSAlign alignItem = getAlignItem(node, child);
-            /*eslint-enable */
-            if (alignItem == CSSAlign.STRETCH) {
-              // You can only stretch if the dimension has not already been set
-              // previously.
-              if (Float.isNaN(child.csslayout.dimensions[dim[crossAxis]])) {
-                child.csslayout.dimensions[dim[crossAxis]] = Math.max(
-                    boundAxis(child, crossAxis, containerCrossAxis -
-                                                paddingAndBorderAxisCross - 
(child.cssstyle.margin.getWithFallback(leadingSpacing[crossAxis], 
leading[crossAxis]) + 
child.cssstyle.margin.getWithFallback(trailingSpacing[crossAxis], 
trailing[crossAxis]))),
-                    // You never want to go smaller than padding
-                    
((child.cssstyle.padding.getWithFallback(leadingSpacing[crossAxis], 
leading[crossAxis]) + 
child.cssstyle.border.getWithFallback(leadingSpacing[crossAxis], 
leading[crossAxis])) + 
(child.cssstyle.padding.getWithFallback(trailingSpacing[crossAxis], 
trailing[crossAxis]) + 
child.cssstyle.border.getWithFallback(trailingSpacing[crossAxis], 
trailing[crossAxis])))
-                                                                     );
-              }
-            } else if (alignItem != CSSAlign.FLEX_START) {
-              // The remaining space between the parent dimensions+padding and 
child
-              // dimensions+margin.
-              float remainingCrossDim = containerCrossAxis -
-                                        paddingAndBorderAxisCross - 
(child.csslayout.dimensions[dim[crossAxis]] + 
child.cssstyle.margin.getWithFallback(leadingSpacing[crossAxis], 
leading[crossAxis]) + 
child.cssstyle.margin.getWithFallback(trailingSpacing[crossAxis], 
trailing[crossAxis]));
-
-              if (alignItem == CSSAlign.CENTER) {
-                leadingCrossDim += remainingCrossDim / 2;
-              } else { // CSSAlign.FLEX_END
-                leadingCrossDim += remainingCrossDim;
-              }
-            }
-          }
-
-          // And we apply the position
-          child.csslayout.position[pos[crossAxis]] += linesCrossDim + 
leadingCrossDim;
-
-          // Define the trailing position accordingly.
-          if (isCrossDimDefined) {
-            child.csslayout.position[trailing[crossAxis]] = 
node.csslayout.dimensions[dim[crossAxis]] - 
child.csslayout.dimensions[dim[crossAxis]] - 
child.csslayout.position[pos[crossAxis]];
-          }
-        }
-      }
-
-      linesCrossDim += crossDim;
-      linesMainDim = Math.max(linesMainDim, mainDim);
-      linesCount += 1;
-      startLine = endLine;
-    }
-
-    // <Loop E>
-    //
-    // Note(prenaux): More than one line, we need to csslayout the crossAxis
-    // according to alignContent.
-    //
-    // Note that we could probably remove <Loop D> and handle the one line case
-    // here too, but for the moment this is safer since it won't interfere with
-    // previously working code.
-    //
-    // See specs:
-    // http://www.w3.org/TR/2012/CR-css3-flexbox-20120918/#csslayout-algorithm
-    // section 9.4
-    //
-    if (linesCount > 1 && isCrossDimDefined) {
-      float nodeCrossAxisInnerSize = node.csslayout.dimensions[dim[crossAxis]] 
-
-                                     paddingAndBorderAxisCross;
-      float remainingAlignContentDim = nodeCrossAxisInnerSize - linesCrossDim;
-
-      float crossDimLead = 0;
-      float currentLead = leadingPaddingAndBorderCross;
-
-      CSSAlign alignContent = node.cssstyle.alignContent;
-      if (alignContent == CSSAlign.FLEX_END) {
-        currentLead += remainingAlignContentDim;
-      } else if (alignContent == CSSAlign.CENTER) {
-        currentLead += remainingAlignContentDim / 2;
-      } else if (alignContent == CSSAlign.STRETCH) {
-        if (nodeCrossAxisInnerSize > linesCrossDim) {
-          crossDimLead = (remainingAlignContentDim / linesCount);
-        }
-      }
-
-      int endIndex = 0;
-      for (i = 0; i < linesCount; ++i) {
-        int startIndex = endIndex;
-
-        // compute the line's height and find the endIndex
-        float lineHeight = 0;
-        for (ii = startIndex; ii < childCount; ++ii) {
-          child = node.getChildAt(ii);
-
-          if (!child.isShow() || child.cssstyle.positionType != 
CSSPositionType.RELATIVE) {
-            continue;
-          }
-          if (child.lineIndex != i) {
-            break;
-          }
-          if (!Float.isNaN(child.csslayout.dimensions[dim[crossAxis]])) {
-            lineHeight = Math.max(
-                lineHeight,
-                child.csslayout.dimensions[dim[crossAxis]] + 
(child.cssstyle.margin.getWithFallback(leadingSpacing[crossAxis], 
leading[crossAxis]) + 
child.cssstyle.margin.getWithFallback(trailingSpacing[crossAxis], 
trailing[crossAxis]))
-                                 );
-          }
-        }
-        endIndex = ii;
-        lineHeight += crossDimLead;
-
-        for (ii = startIndex; ii < endIndex; ++ii) {
-          child = node.getChildAt(ii);
-
-          if (!child.isShow() || child.cssstyle.positionType != 
CSSPositionType.RELATIVE) {
-            continue;
-          }
-
-          CSSAlign alignContentAlignItem = getAlignItem(node, child);
-          if (alignContentAlignItem == CSSAlign.FLEX_START) {
-            child.csslayout.position[pos[crossAxis]] = currentLead + 
child.cssstyle.margin.getWithFallback(leadingSpacing[crossAxis], 
leading[crossAxis]);
-          } else if (alignContentAlignItem == CSSAlign.FLEX_END) {
-            child.csslayout.position[pos[crossAxis]] = currentLead + 
lineHeight - child.cssstyle.margin.getWithFallback(trailingSpacing[crossAxis], 
trailing[crossAxis]) - child.csslayout.dimensions[dim[crossAxis]];
-          } else if (alignContentAlignItem == CSSAlign.CENTER) {
-            float childHeight = child.csslayout.dimensions[dim[crossAxis]];
-            child.csslayout.position[pos[crossAxis]] = currentLead + 
(lineHeight - childHeight) / 2;
-          } else if (alignContentAlignItem == CSSAlign.STRETCH) {
-            child.csslayout.position[pos[crossAxis]] = currentLead + 
child.cssstyle.margin.getWithFallback(leadingSpacing[crossAxis], 
leading[crossAxis]);
-            // TODO(prenaux): Correctly set the height of items with undefined
-            //                (auto) crossAxis dimension.
-          }
-        }
-
-        currentLead += lineHeight;
-      }
-    }
-
-    boolean needsMainTrailingPos = false;
-    boolean needsCrossTrailingPos = false;
-
-    // If the user didn't specify a width or height, and it has not been set
-    // by the container, then we set it via the children.
-    if (!isMainDimDefined) {
-      node.csslayout.dimensions[dim[mainAxis]] = Math.max(
-          // We're missing the last padding at this point to get the final
-          // dimension
-          boundAxis(node, mainAxis, linesMainDim + 
(node.cssstyle.padding.getWithFallback(trailingSpacing[mainAxis], 
trailing[mainAxis]) + 
node.cssstyle.border.getWithFallback(trailingSpacing[mainAxis], 
trailing[mainAxis]))),
-          // We can never assign a width smaller than the padding and borders
-          paddingAndBorderAxisMain
-                                                         );
-
-      if (mainAxis == CSS_FLEX_DIRECTION_ROW_REVERSE ||
-          mainAxis == CSS_FLEX_DIRECTION_COLUMN_REVERSE) {
-        needsMainTrailingPos = true;
-      }
-    }
-
-    if (!isCrossDimDefined) {
-      node.csslayout.dimensions[dim[crossAxis]] = Math.max(
-          // For the cross dim, we add both sides at the end because the value
-          // is aggregate via a max function. Intermediate negative values
-          // can mess this computation otherwise
-          boundAxis(node, crossAxis, linesCrossDim + 
paddingAndBorderAxisCross),
-          paddingAndBorderAxisCross
-                                                          );
-
-      if (crossAxis == CSS_FLEX_DIRECTION_ROW_REVERSE ||
-          crossAxis == CSS_FLEX_DIRECTION_COLUMN_REVERSE) {
-        needsCrossTrailingPos = true;
-      }
-    }
-
-    // <Loop F> Set trailing position if necessary
-    if (needsMainTrailingPos || needsCrossTrailingPos) {
-      for (i = 0; i < childCount; ++i) {
-        child = node.getChildAt(i);
-        if (!child.isShow()) {
-          continue;
-        }
-
-        if (needsMainTrailingPos) {
-          child.csslayout.position[trailing[mainAxis]] = 
node.csslayout.dimensions[dim[mainAxis]] - 
child.csslayout.dimensions[dim[mainAxis]] - 
child.csslayout.position[pos[mainAxis]];
-        }
-
-        if (needsCrossTrailingPos) {
-          child.csslayout.position[trailing[crossAxis]] = 
node.csslayout.dimensions[dim[crossAxis]] - 
child.csslayout.dimensions[dim[crossAxis]] - 
child.csslayout.position[pos[crossAxis]];
-        }
-      }
-    }
-
-    // <Loop G> Calculate dimensions for absolutely positioned elements
-    currentAbsoluteChild = firstAbsoluteChild;
-    while (currentAbsoluteChild != null) {
-      if (currentAbsoluteChild.isShow()) {
-        // Pre-fill dimensions when using absolute position and both offsets 
for
-        // the axis are defined (either both left and right or top and bottom).
-        for (ii = 0; ii < 2; ii++) {
-          axis = (ii != 0) ? CSS_FLEX_DIRECTION_ROW : 
CSS_FLEX_DIRECTION_COLUMN;
-
-          if (!Float.isNaN(node.csslayout.dimensions[dim[axis]]) &&
-              
!(!Float.isNaN(currentAbsoluteChild.cssstyle.dimensions[dim[axis]]) && 
currentAbsoluteChild.cssstyle.dimensions[dim[axis]] >= 0.0) &&
-              
!Float.isNaN(currentAbsoluteChild.cssstyle.position[leading[axis]]) &&
-              
!Float.isNaN(currentAbsoluteChild.cssstyle.position[trailing[axis]])) {
-            currentAbsoluteChild.csslayout.dimensions[dim[axis]] = Math.max(
-                boundAxis(currentAbsoluteChild, axis, 
node.csslayout.dimensions[dim[axis]] -
-                                                      
(node.cssstyle.border.getWithFallback(leadingSpacing[axis], leading[axis]) + 
node.cssstyle.border.getWithFallback(trailingSpacing[axis], trailing[axis])) -
-                                                      
(currentAbsoluteChild.cssstyle.margin.getWithFallback(leadingSpacing[axis], 
leading[axis]) + 
currentAbsoluteChild.cssstyle.margin.getWithFallback(trailingSpacing[axis], 
trailing[axis])) -
-                                                      
(Float.isNaN(currentAbsoluteChild.cssstyle.position[leading[axis]]) ? 0 : 
currentAbsoluteChild.cssstyle.position[leading[axis]]) -
-                                                      
(Float.isNaN(currentAbsoluteChild.cssstyle.position[trailing[axis]]) ? 0 : 
currentAbsoluteChild.cssstyle.position[trailing[axis]])
-                         ),
-                // You never want to go smaller than padding
-                
((currentAbsoluteChild.cssstyle.padding.getWithFallback(leadingSpacing[axis], 
leading[axis]) + 
currentAbsoluteChild.cssstyle.border.getWithFallback(leadingSpacing[axis], 
leading[axis])) + 
(currentAbsoluteChild.cssstyle.padding.getWithFallback(trailingSpacing[axis], 
trailing[axis]) + 
currentAbsoluteChild.cssstyle.border.getWithFallback(trailingSpacing[axis], 
trailing[axis])))
-                                                                           );
-          }
-
-          if 
(!Float.isNaN(currentAbsoluteChild.cssstyle.position[trailing[axis]]) &&
-              
!!Float.isNaN(currentAbsoluteChild.cssstyle.position[leading[axis]])) {
-            currentAbsoluteChild.csslayout.position[leading[axis]] =
-                node.csslayout.dimensions[dim[axis]] -
-                currentAbsoluteChild.csslayout.dimensions[dim[axis]] -
-                
(Float.isNaN(currentAbsoluteChild.cssstyle.position[trailing[axis]]) ? 0 : 
currentAbsoluteChild.cssstyle.position[trailing[axis]]);
-          }
-        }
-      }
-      child = currentAbsoluteChild;
-      currentAbsoluteChild = currentAbsoluteChild.nextAbsoluteChild;
-      child.nextAbsoluteChild = null;
-    }
-  }
-  /** END_GENERATED **/
-}

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/2f8caedb/android/sdk/src/main/java/com/taobao/weex/dom/flex/MeasureOutput.java
----------------------------------------------------------------------
diff --git 
a/android/sdk/src/main/java/com/taobao/weex/dom/flex/MeasureOutput.java 
b/android/sdk/src/main/java/com/taobao/weex/dom/flex/MeasureOutput.java
deleted file mode 100755
index f20719b..0000000
--- a/android/sdk/src/main/java/com/taobao/weex/dom/flex/MeasureOutput.java
+++ /dev/null
@@ -1,15 +0,0 @@
-/**
- * Copyright (c) 2014, Facebook, Inc. All rights reserved. <p/> This source 
code is licensed under
- * the BSD-style license found in the LICENSE file in the root directory of 
this source tree. An
- * additional grant of patent rights can be found in the PATENTS file in the 
same directory.
- */
-package com.taobao.weex.dom.flex;
-
-/**
- * POJO to hold the output of the measure function.
- */
-public class MeasureOutput {
-
-  public float width;
-  public float height;
-}

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/2f8caedb/android/sdk/src/main/java/com/taobao/weex/dom/flex/Spacing.java
----------------------------------------------------------------------
diff --git a/android/sdk/src/main/java/com/taobao/weex/dom/flex/Spacing.java 
b/android/sdk/src/main/java/com/taobao/weex/dom/flex/Spacing.java
deleted file mode 100755
index 7df7d35..0000000
--- a/android/sdk/src/main/java/com/taobao/weex/dom/flex/Spacing.java
+++ /dev/null
@@ -1,237 +0,0 @@
-/**
- * Copyright (c) 2014, Facebook, Inc. All rights reserved. <p/> This source 
code is licensed under
- * the BSD-style license found in the LICENSE file in the root directory of 
this source tree. An
- * additional grant of patent rights can be found in the PATENTS file in the 
same directory.
- */
-package com.taobao.weex.dom.flex;
-
-//import javax.annotation.Nullable;
-
-import java.util.Arrays;
-
-/**
- * Class representing CSS spacing (padding, margin, and borders). This is 
mostly necessary to
- * properly implement interactions and updates for properties like margin, 
marginLeft, and
- * marginHorizontal.
- */
-public class Spacing /**implements Cloneable**/
-{
-
-  /**
-   * Spacing type that represents the left direction. E.g. {@code marginLeft}.
-   */
-  public static final int LEFT = 0;
-  /**
-   * Spacing type that represents the top direction. E.g. {@code marginTop}.
-   */
-  public static final int TOP = 1;
-  /**
-   * Spacing type that represents the right direction. E.g. {@code 
marginRight}.
-   */
-  public static final int RIGHT = 2;
-  /**
-   * Spacing type that represents the bottom direction. E.g. {@code 
marginBottom}.
-   */
-  public static final int BOTTOM = 3;
-  /**
-   * Spacing type that represents vertical direction (top and bottom). E.g. 
{@code marginVertical}.
-   */
-  public static final int VERTICAL = 4;
-  /**
-   * Spacing type that represents horizontal direction (left and right). E.g.
-   * {@code marginHorizontal}.
-   */
-  public static final int HORIZONTAL = 5;
-  /**
-   * Spacing type that represents start direction e.g. left in left-to-right, 
right in right-to-left.
-   */
-  public static final int START = 6;
-  /**
-   * Spacing type that represents end direction e.g. right in left-to-right, 
left in right-to-left.
-   */
-  public static final int END = 7;
-  /**
-   * Spacing type that represents all directions (left, top, right, bottom). 
E.g. {@code margin}.
-   */
-  public static final int ALL = 8;
-
-  private static final int[] sFlagsMap = {
-      1, /*LEFT*/
-      2, /*TOP*/
-      4, /*RIGHT*/
-      8, /*BOTTOM*/
-      16, /*VERTICAL*/
-      32, /*HORIZONTAL*/
-      64, /*START*/
-      128, /*END*/
-      256, /*ALL*/
-  };
-
-  private final float[] mSpacing = newFullSpacingArray();
-  private float[] mDefaultSpacing = null;
-  private int mValueFlags = 0;
-  private boolean mHasAliasesSet;
-
-  private static float[] newFullSpacingArray() {
-    return new float[]{
-        CSSConstants.UNDEFINED,
-        CSSConstants.UNDEFINED,
-        CSSConstants.UNDEFINED,
-        CSSConstants.UNDEFINED,
-        CSSConstants.UNDEFINED,
-        CSSConstants.UNDEFINED,
-        CSSConstants.UNDEFINED,
-        CSSConstants.UNDEFINED,
-        CSSConstants.UNDEFINED,
-    };
-  }
-
-  /**
-   * Set a spacing value.
-   *
-   * @param spacingType one of {@link #LEFT}, {@link #TOP}, {@link #RIGHT}, 
{@link #BOTTOM},
-   *        {@link #VERTICAL}, {@link #HORIZONTAL}, {@link #ALL}
-   * @param value the value for this direction
-   * @return {@code true} if the spacing has changed, or {@code false} if the 
same value was already
-   *         set
-   */
-  public boolean set(int spacingType, float value) {
-    if (!FloatUtil.floatsEqual(mSpacing[spacingType], value)) {
-      mSpacing[spacingType] = value;
-
-      if (CSSConstants.isUndefined(value)) {
-        mValueFlags &= ~sFlagsMap[spacingType];
-      } else {
-        mValueFlags |= sFlagsMap[spacingType];
-      }
-
-      mHasAliasesSet =
-          (mValueFlags & sFlagsMap[ALL]) != 0 ||
-          (mValueFlags & sFlagsMap[VERTICAL]) != 0 ||
-          (mValueFlags & sFlagsMap[HORIZONTAL]) != 0;
-
-      return true;
-    }
-    return false;
-  }
-
-  /**
-   * Set a default spacing value. This is used as a fallback when no spacing 
has been set for a
-   * particular direction.
-   *
-   * @param spacingType one of {@link #LEFT}, {@link #TOP}, {@link #RIGHT}, 
{@link #BOTTOM}
-   * @param value the default value for this direction
-   * @return
-   */
-  public boolean setDefault(int spacingType, float value) {
-    if (mDefaultSpacing == null) {
-      mDefaultSpacing = newSpacingResultArray();
-    }
-    if (!FloatUtil.floatsEqual(mDefaultSpacing[spacingType], value)) {
-      mDefaultSpacing[spacingType] = value;
-      return true;
-    }
-    return false;
-  }
-
-  private static float[] newSpacingResultArray() {
-    return newSpacingResultArray(0);
-  }
-
-  private static float[] newSpacingResultArray(float defaultValue) {
-    return new float[]{
-        defaultValue,
-        defaultValue,
-        defaultValue,
-        defaultValue,
-        defaultValue,
-        defaultValue,
-        CSSConstants.UNDEFINED,
-        CSSConstants.UNDEFINED,
-        defaultValue,
-    };
-  }
-
-  /**
-   * Get the raw value (that was set using {@link #set(int, float)}), without 
taking into account
-   * any default values.
-   *
-   * @param spacingType one of {@link #LEFT}, {@link #TOP}, {@link #RIGHT}, 
{@link #BOTTOM},
-   *        {@link #VERTICAL}, {@link #HORIZONTAL}, {@link #ALL}
-   */
-  public float getRaw(int spacingType) {
-    return mSpacing[spacingType];
-  }
-
-  /**
-   * Resets the spacing instance to its default state. This method is meant to 
be used when
-   * recycling {@link Spacing} instances.
-   */
-  void reset() {
-    Arrays.fill(mSpacing, CSSConstants.UNDEFINED);
-    mDefaultSpacing = null;
-    mHasAliasesSet = false;
-    mValueFlags = 0;
-  }
-
-  /**
-   * Try to get start value and fallback to given type if not defined. This is 
used privately
-   * by the layout engine as a more efficient way to fetch direction-aware 
values by
-   * avoid extra method invocations.
-   */
-  float getWithFallback(int spacingType, int fallbackType) {
-    return
-        (mValueFlags & sFlagsMap[spacingType]) != 0
-        ? mSpacing[spacingType]
-        : get(fallbackType);
-  }
-
-  /**
-   * Get the spacing for a direction. This takes into account any default 
values that have been set.
-   *
-   * @param spacingType one of {@link #LEFT}, {@link #TOP}, {@link #RIGHT}, 
{@link #BOTTOM}
-   */
-  public float get(int spacingType) {
-    float defaultValue = (mDefaultSpacing != null)
-                         ? mDefaultSpacing[spacingType]
-                         : (spacingType == START || spacingType == END ? 
CSSConstants.UNDEFINED : 0);
-
-    if (mValueFlags == 0) {
-      return defaultValue;
-    }
-
-    if ((mValueFlags & sFlagsMap[spacingType]) != 0) {
-      return mSpacing[spacingType];
-    }
-
-    if (mHasAliasesSet) {
-      int secondType = spacingType == TOP || spacingType == BOTTOM ? VERTICAL 
: HORIZONTAL;
-      if ((mValueFlags & sFlagsMap[secondType]) != 0) {
-        return mSpacing[secondType];
-      } else if ((mValueFlags & sFlagsMap[ALL]) != 0) {
-        return mSpacing[ALL];
-      }
-    }
-
-    return defaultValue;
-  }
-
-  public boolean equal(Spacing spacing) {
-    return FloatUtil.floatsEqual(get(LEFT), spacing.get(LEFT))
-           && FloatUtil.floatsEqual(get(TOP), spacing.get(TOP))
-           && FloatUtil.floatsEqual(get(RIGHT), spacing.get(RIGHT))
-           && FloatUtil.floatsEqual(get(BOTTOM), spacing.get(BOTTOM));
-  }
-
-  //   @Override
-  //   public Spacing clone(){
-  //
-  //           try {
-  //                   return (Spacing) super.clone();
-  //           } catch (CloneNotSupportedException e) {
-  //                   e.printStackTrace();
-  //           }
-  //           return null;
-  //   }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/2f8caedb/android/sdk/src/main/java/com/taobao/weex/dom/text/FontBroadcastReceiver.java
----------------------------------------------------------------------
diff --git 
a/android/sdk/src/main/java/com/taobao/weex/dom/text/FontBroadcastReceiver.java 
b/android/sdk/src/main/java/com/taobao/weex/dom/text/FontBroadcastReceiver.java
deleted file mode 100644
index 8d1d556..0000000
--- 
a/android/sdk/src/main/java/com/taobao/weex/dom/text/FontBroadcastReceiver.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package com.taobao.weex.dom.text;
-
-import android.content.BroadcastReceiver;
-import android.content.Context;
-import android.content.Intent;
-
-import com.taobao.weex.WXEnvironment;
-import com.taobao.weex.WXSDKManager;
-import com.taobao.weex.dom.DOMActionContext;
-import com.taobao.weex.dom.WXDomHandler;
-import com.taobao.weex.dom.WXDomObject;
-import com.taobao.weex.dom.WXTextDomObject;
-import com.taobao.weex.utils.WXLogUtils;
-
-import java.lang.ref.WeakReference;
-
-/**
- * Created by furture on 2018/2/24.
- */
-
-public class FontBroadcastReceiver extends BroadcastReceiver {
-
-    private WeakReference<WXTextDomObject> wxTextDomObjectRef;
-
-    private String mFontFamily;
-
-    public FontBroadcastReceiver(WXTextDomObject wxTextDomObject, String 
mFontFamily) {
-        this.wxTextDomObjectRef = new 
WeakReference<WXTextDomObject>(wxTextDomObject);
-        this.mFontFamily = mFontFamily;
-    }
-
-    @Override
-    public void onReceive(Context context, Intent intent) {
-        String fontFamily = intent.getStringExtra("fontFamily");
-        if (!mFontFamily.equals(fontFamily)) {
-            return;
-        }
-        WXTextDomObject wxTextDomObject = wxTextDomObjectRef.get();
-        if(wxTextDomObject == null){
-            return;
-        }
-        if(wxTextDomObject.isDestroy() || wxTextDomObject.getDomContext() == 
null){
-            return;
-        }
-
-        DOMActionContext domActionContext = 
WXSDKManager.getInstance().getWXDomManager().getDomContext(wxTextDomObject.getDomContext().getInstanceId());
-        if(domActionContext == null){
-            return;
-        }
-        WXDomObject domObject = 
domActionContext.getDomByRef(wxTextDomObject.getRef());
-        if(domObject == null){
-            return;
-        }
-        domObject.markDirty();
-        domActionContext.markDirty();
-        
WXSDKManager.getInstance().getWXDomManager().sendEmptyMessageDelayed(WXDomHandler.MsgType.WX_DOM_START_BATCH,
 2);
-        if(WXEnvironment.isApkDebugable()) {
-            WXLogUtils.d("WXText", "Font family " + fontFamily + " is 
available");
-        }
-    }
-}


Reply via email to