Skip to content

Commit

Permalink
Add Flexbox 2012 implementation (IE10)
Browse files Browse the repository at this point in the history
References:
- http://msdn.microsoft.com/en-us/library/ie/hh673531(v=vs.85).aspx
- http://www.w3.org/TR/2012/WD-css3-flexbox-20120322/

"-ms-flex" is defined (see reference) as
   [ <positive-flex> <negative-flex> <preferred-size> ] | none
   ^ <number>      ^ <number>      ^ "<width> without inherit"
"<width> without inherit" expands to "<length> || <percentage> || auto",
so the final definition of "-ms-flex" is:
[[ <number> <number>? ] || [ <length> || <percentage> || auto ] ] | none

The other values are taken verbatim from the references.
  • Loading branch information
Rob--W committed Sep 21, 2013
1 parent a18a60d commit bea96d7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/css/Properties.js
Expand Up @@ -263,7 +263,7 @@ var Properties = {

//D
"direction" : "ltr | rtl | inherit",
"display" : "inline | block | list-item | inline-block | table | inline-table | table-row-group | table-header-group | table-footer-group | table-row | table-column-group | table-column | table-cell | table-caption | grid | inline-grid | none | inherit | -moz-box | -moz-inline-block | -moz-inline-box | -moz-inline-grid | -moz-inline-stack | -moz-inline-table | -moz-grid | -moz-grid-group | -moz-grid-line | -moz-groupbox | -moz-deck | -moz-popup | -moz-stack | -moz-marker | -webkit-box | -webkit-inline-box | flex | -webkit-flex | inline-flex | -webkit-inline-flex",
"display" : "inline | block | list-item | inline-block | table | inline-table | table-row-group | table-header-group | table-footer-group | table-row | table-column-group | table-column | table-cell | table-caption | grid | inline-grid | none | inherit | -moz-box | -moz-inline-block | -moz-inline-box | -moz-inline-grid | -moz-inline-stack | -moz-inline-table | -moz-grid | -moz-grid-group | -moz-grid-line | -moz-groupbox | -moz-deck | -moz-popup | -moz-stack | -moz-marker | -webkit-box | -webkit-inline-box | -ms-flexbox | -ms-inline-flexbox | flex | -webkit-flex | inline-flex | -webkit-inline-flex",
"dominant-baseline" : 1,
"drop-initial-after-adjust" : "central | middle | after-edge | text-after-edge | ideographic | alphabetic | mathematical | <percentage> | <length>",
"drop-initial-after-align" : "baseline | use-script | before-edge | text-before-edge | after-edge | text-after-edge | central | middle | ideographic | alphabetic | hanging | mathematical",
Expand All @@ -287,6 +287,12 @@ var Properties = {
"flex-grow" : "<number>",
"flex-shrink" : "<number>",
"flex-wrap" : "nowrap | wrap | wrap-reverse",
"-ms-flex" : "[[ <number> <number>? ] || [ <length> || <percentage> || auto ] ] | none",
"-ms-flex-align" : "start | end | center | stretch | baseline",
"-ms-flex-direction" : "row | column | row-reverse | column-reverse | inherit",
"-ms-flex-order" : "<number>",
"-ms-flex-pack" : "start | end | center | justify",
"-ms-flex-wrap" : "nowrap | wrap | wrap-reverse",
"float" : "left | right | none | inherit",
"float-offset" : 1,
"font" : 1,
Expand Down
4 changes: 3 additions & 1 deletion tests/css/Validation.js
Expand Up @@ -590,6 +590,8 @@
"-moz-marker",
"-webkit-box",
"-webkit-inline-box",
"-ms-flexbox",
"-ms-inline-flexbox",
"flex",
"-webkit-flex",
"inline-flex",
Expand All @@ -598,7 +600,7 @@
],

invalid: {
"foo" : "Expected (inline | block | list-item | inline-block | table | inline-table | table-row-group | table-header-group | table-footer-group | table-row | table-column-group | table-column | table-cell | table-caption | grid | inline-grid | none | inherit | -moz-box | -moz-inline-block | -moz-inline-box | -moz-inline-grid | -moz-inline-stack | -moz-inline-table | -moz-grid | -moz-grid-group | -moz-grid-line | -moz-groupbox | -moz-deck | -moz-popup | -moz-stack | -moz-marker | -webkit-box | -webkit-inline-box | flex | -webkit-flex | inline-flex | -webkit-inline-flex) but found 'foo'."
"foo" : "Expected (inline | block | list-item | inline-block | table | inline-table | table-row-group | table-header-group | table-footer-group | table-row | table-column-group | table-column | table-cell | table-caption | grid | inline-grid | none | inherit | -moz-box | -moz-inline-block | -moz-inline-box | -moz-inline-grid | -moz-inline-stack | -moz-inline-table | -moz-grid | -moz-grid-group | -moz-grid-line | -moz-groupbox | -moz-deck | -moz-popup | -moz-stack | -moz-marker | -webkit-box | -webkit-inline-box | -ms-flexbox | -ms-inline-flexbox | flex | -webkit-flex | inline-flex | -webkit-inline-flex) but found 'foo'."
}
}));

Expand Down

0 comments on commit bea96d7

Please sign in to comment.