Commit Graph

470 Commits

Author SHA1 Message Date
Adam Comella
f3dd51ab97 Alter layout engine to conform closer to W3C spec
The primary goals of this change are:
  - Better conformance to the W3C flexbox standard (https://www.w3.org/TR/css-flexbox-1/)
    and a clear articulation of the areas where it deviates from the spec.
  - Support for flex-shrink.
  - Conformance with layout effects of "overflow: hidden".

Specifically, here are the limitations of this implementation as compared to the W3C
flexbox standard (this is also documented in Layout.js):
  - Display property is always assumed to be 'flex' except for Text nodes, which
    are assumed to be 'inline-flex'.
  - The 'zIndex' property (or any form of z ordering) is not supported. Nodes are
    stacked in document order.
  - The 'order' property is not supported. The order of flex items is always defined
    by document order.
  - The 'visibility' property is always assumed to be 'visible'. Values of 'collapse'
    and 'hidden' are not supported.
  - The 'wrap' property supports only 'nowrap' (which is the default) or 'wrap'. The
    rarely-used 'wrap-reverse' is not supported.
  - Rather than allowing arbitrary combinations of flexGrow, flexShrink and
    flexBasis, this algorithm supports only the three most common combinations:
      - flex: 0 is equiavlent to flex: 0 0 auto
      - flex: n (where n is a positive value) is equivalent to flex: n 0 0
      - flex: -1 (or any negative value) is equivalent to flex: 0 1 auto
  - Margins cannot be specified as 'auto'. They must be specified in terms of pixel
    values, and the default value is 0.
  - The 'baseline' value is not supported for alignItems and alignSelf properties.
  - Values of width, maxWidth, minWidth, height, maxHeight and minHeight must be
    specified as pixel values, not as percentages.
  - There is no support for calculation of dimensions based on intrinsic aspect ratios
    (e.g. images).
  - There is no support for forced breaks.
  - It does not support vertical inline directions (top-to-bottom or bottom-to-top text).

And here is how the implementation deviates from the standard (this is also documented in
Layout.js):
  - Section 4.5 of the spec indicates that all flex items have a default minimum
    main size. For text blocks, for example, this is the width of the widest word.
    Calculating the minimum width is expensive, so we forego it and assume a default
    minimum main size of 0.
  - Min/Max sizes in the main axis are not honored when resolving flexible lengths.
  - The spec indicates that the default value for 'flexDirection' is 'row', but
    the algorithm below assumes a default of 'column'.
2016-04-26 19:45:58 -07:00
Emil Sjölander
b0d00ad338 Merge pull request #163 from emilsjolander/measuremode
Add support for measure mode
2016-04-06 18:07:37 +01:00
Emil Sjolander
7bd6b2b7dd Add support for measure mode 2016-04-01 11:01:16 +01:00
Pieter De Baets
68e0b0cc58 Merge pull request #182 from javache/skip-layout-correctly
Correct skipLayout condition in Layout.c
2016-03-30 15:22:43 +01:00
Pieter De Baets
5b56be412c Correct skipLayout condition in Layout.c
Fixes #155
2016-03-30 12:11:49 +01:00
Lucas Rocha
3454511947 Merge pull request #178 from javache/node-layout-reset 2016-03-29 11:15:53 +01:00
Pieter De Baets
b157ab4a00 Reset child position/sizes before calculating layout 2016-03-29 11:05:53 +01:00
Lucas Rocha
8d5cdd4e6c Merge pull request #145 from alebo/issue-127 2016-03-01 23:07:14 +00:00
Alex Bogomazov
425345aa8d Redo layout of 'stretch' aligned items for correct positioning of nested
items

Fixes facebook/css-layout#83, facebook/css-layout#100,
facebook/css-layout#127.
2016-02-26 00:43:58 +03:00
Christopher Chedeau
dd8e5cd65d Merge pull request #170 from casandrasilva/patch-1
fixes UMD url
2016-02-05 03:57:39 -08:00
Casandra Silva Zenteno
64704dd708 fixes UMD url 2016-02-04 23:31:16 -08:00
Christopher Chedeau
dc7059d340 Merge pull request #166 from RReverser/patch-1
Add C# to the supported language list
2016-01-13 06:26:40 -08:00
Ingvar Stepanyan
acd295e470 Add C# to the supported language list 2016-01-13 14:15:48 +00:00
Lucas Rocha
5d5630d3c8 Merge pull request #161 from emilsjolander/master 2016-01-07 12:17:49 +00:00
Emil Sjolander
c9094f94d0 Check layout instead of style before setting height and width to whatever is set in layout 2016-01-06 15:07:41 +00:00
Christopher Chedeau
f3b6fb3be0 Merge pull request #159 from CatalystCode/dirty
Need dirty() to be virtual to override in special cases.
2016-01-05 07:19:23 -08:00
Eric Rozell
3d7bc48fa6 Need dirty() to be virtual to override in special cases.
See, for example ReactShadowNode in the ReactAndroid code base, which overrides this virtual.
2016-01-05 08:55:32 -05:00
Lucas Rocha
219bdaed15 Merge pull request #154 from majak/width 2015-12-14 16:28:52 +00:00
Martin Kralik
f2aa5ba604 passing height to the measure function
This diff:
* adds height as another parameter passed to the measure function, computed the same way width is
* adds tests for this extension, which has involved adding a new measure function to all of js, c, java and c# tests
2015-12-14 15:00:13 +00:00
Colin Eberhardt
53769ccbc5 Merge pull request #153 from casandrawith1s/patch-1
'package-all' tense consistency
2015-11-22 14:36:31 +00:00
Casandra Silva
2733ebf1d0 'package-all' tense consistency
Change 'package-all' comment to present tense and unfiform grammar for consistency
2015-11-21 21:51:50 -08:00
Colin Eberhardt
45227c0b9a Merge pull request #151 from pragmatrix/csharp-travis-pr
Configure travis to install mono and run the C# tests from within the…
2015-11-20 09:11:27 +00:00
Armin Sander
e848706911 Configure travis to install mono and run the C# tests from within the Gruntfile 2015-11-19 21:27:58 +01:00
Colin Eberhardt
79d7291906 1.1.1 v1.1.1 2015-11-12 14:32:34 +00:00
Colin Eberhardt
bae4eb1830 Updated distribution build 2015-11-12 14:31:58 +00:00
Colin Eberhardt
609d4ae69d Do not delete release instructions! 2015-11-12 14:26:15 +00:00
Colin Eberhardt
99c3a88df4 Update release process to include a build step!
See #149
2015-11-12 11:52:07 +00:00
Colin Eberhardt
4364c6ebb2 Merge pull request #150 from wpcarro/patch-1
grammatical fix
2015-11-11 07:41:42 +00:00
Colin Eberhardt
73b1e63bd7 1.1.0 v1.1.0 2015-11-11 07:27:17 +00:00
William Carroll
b7856ce26a grammatical fix
also, on line 134, I could be wrong, but be wary of this sentence: "No C implementation of this function is provided in provided..." Perhaps this is a mistake.

thanks for all the awesome code!
2015-11-10 22:46:41 -08:00
Christopher Chedeau
f5eefe51f8 Merge pull request #148 from moneppo/master
Add C usage to documentation.
2015-11-07 08:39:01 -08:00
Michael
aac6694127 Add C usage to documentation.
Fixes #114.
2015-11-07 08:29:12 -08:00
Krzysztof Magiera
6e499300ff Merge pull request #146 from lucasr/style-getters
New style getters and cleanups in CSSNode
2015-10-21 16:42:46 +01:00
Lucas Rocha
d3b702e1ad Rename getStylePadding() to getPadding() for consistency
So that we're consistent with other style-only methods. Move existing
getters to be close to their matching setters in CSSNode.
2015-10-21 14:31:35 +01:00
Lucas Rocha
eb1d1726b9 Add getters for all style properties
For consistency and because now we have some use cases for it.
2015-10-21 10:37:09 +01:00
Christopher Chedeau
8f7632bc7f Merge pull request #144 from woehrl01/woehrl01-width
return correct value from Width property (C#)
2015-10-14 08:45:59 -07:00
Lukas Wöhrl
d2e66a8d82 return correct value from Width property 2015-10-14 08:50:49 +02:00
Lucas Rocha
4b4cd06be2 Merge pull request #140 from lucasr/fast-reset 2015-10-08 15:06:49 +01:00
Lucas Rocha
a821f6c555 Add reset() method to CSSNode
This allows users of css-layout in Java to perform faster resets on
CSSNode in cases when you want to recycle instances.
2015-10-08 14:49:28 +01:00
Colin Eberhardt
fbeef4542d Merge pull request #139 from ColinEberhardt/eslint
Eslint - enforces many more rules.
2015-10-07 22:26:04 +01:00
Colin Eberhardt
f02fbfc10c Changed from '"typeof foo === 'undefined'" to "foo === undefined" 2015-10-07 22:18:27 +01:00
Colin Eberhardt
e4c93e8c59 Updated to use eslint from fbjs-scripts 2015-10-07 21:52:22 +01:00
Krzysztof Magiera
35bd01e3f2 Merge pull request #141 from lucasr/enum-comparison
Faster enum comparisons in CSSNode
2015-10-07 13:19:56 +01:00
Colin Eberhardt
040f0f3e7c relaxed the eqeqeq rule to permit 'foo != null' 2015-10-07 06:40:17 +01:00
Lucas Rocha
af09213d1a Faster enum comparisons in CSSNode
Enums are singletons by design so it's safe (and faster) to compare by
reference. This also covers the null case.
2015-10-05 17:07:23 +01:00
Colin Eberhardt
538cb2e940 Fixed build
(I was using an older verson of eslint locally)
2015-10-05 13:30:59 +01:00
Colin Eberhardt
45f62c424c Widened scope of CI eslint to all JavaScript files 2015-10-05 13:21:19 +01:00
Colin Eberhardt
c33e255182 Enforced quote style and indentation 2015-10-05 13:18:27 +01:00
Colin Eberhardt
0f43977bb2 Enforced the eqeqeq rule 2015-10-05 12:50:54 +01:00
Colin Eberhardt
9b75493988 auto-configured eslint and fixed gruntfile linting failures 2015-10-05 08:08:57 +01:00