From a48abf6e5aff3a530dc77396aff4724d8fb7f333 Mon Sep 17 00:00:00 2001 From: Jia Date: Tue, 22 Aug 2017 14:20:47 +1000 Subject: [PATCH 1/3] Serialize property display --- css-typed-om/Overview.bs | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/css-typed-om/Overview.bs b/css-typed-om/Overview.bs index 4eddc34b..20ad968f 100644 --- a/css-typed-om/Overview.bs +++ b/css-typed-om/Overview.bs @@ -300,7 +300,7 @@ The append(DOMString property, 3. If {{StylePropertyMap}}’s [=property model=] contains an entry for |property|, return the first value found in that entry. - + 4. Else, return `null`. @@ -2275,7 +2275,7 @@ objects, the {{CSSURLImageValue/url}} attribute contains the URL that references when called, perform the following steps: - 1. If the |url| passed into the constructor doesn't correctly + 1. If the |url| passed into the constructor doesn't correctly parse as a <>, throw a {{TypeError}} and exit this algorithm. 2. Else, return a new {{CSSURLImageValue}} with its {{CSSURLImageValue/url}} internal slot @@ -2879,7 +2879,7 @@ depending on the property they came from: 3. If 'border-image-slice' does not specify ''100%'' for all sides and omits the ''border-image-slice/fill'' keyword, serialize 'border-image-slice' and append it to |values|. 4. If 'border-image-width' does not specify ''1'' for all sides, - append "/ " (U+002F FORWARD SLASH followed by U+0020 SPACE) + append "/ " (U+002F FORWARD SLASH followed by U+0020 SPACE) to the result of serializing 'border-image-width' and append it to |values|. 5. If 'border-image-outset' does not specify ''0'' for all sides: 1. If the previous 'border-image-width' step did not append anything to |values|, @@ -2888,7 +2888,7 @@ depending on the property they came from: otherwise let |prefix| be "/ " (U+002F FORWARD SLASH followed by U+0020 SPACE) 2. Append |prefix| - to the result of serializing 'border-image-outset' + to the result of serializing 'border-image-outset' and append it to |values|. 6. If 'border-image-repeat' is not ''border-image-repeat/stretch'' in both axises, serialize 'border-image-repeat' and append it to |values|. @@ -2903,6 +2903,21 @@ depending on the property they came from: return "currentcolor". 2. Otherwise, return the result of serializing the <> value. +: 'display' +:: + 1. Let |values| initially be the empty [=list=]. + 2. Append value of 'display-outside' to |values|. + 3. Append value of 'display-inside' to |values|. + 4. If 'display-listitem' is specified: + 1. Append ''list-item'' to |values|. + 2. Serialize 'display-outside' and append it to |values|. + 3. If ''flow'' or ''flow-root'' exists, append it to |values|. + 5. Append value of 'display-internal' to |values|. + 6. Append value of 'display-box' to |values|. + 7. Append value of 'display-legacy' to |values|. + 8. If |values| is [=list/empty=] or if it only contains ''inline'', clear |values| and append "none" to |values|. + 9. Return the result of concatenating all the items in |values|, + separated by " " (U+0020 SPACE). Security Considerations {#security-considerations} From 3a7b05faa0ec2ee173c57072bd6f6d6777d4f5c7 Mon Sep 17 00:00:00 2001 From: Jia Date: Tue, 22 Aug 2017 15:26:31 +1000 Subject: [PATCH 2/3] Changed serialization description of display --- css-typed-om/Overview.bs | 43 ++++++++++++++++++++++++++++++---------- 1 file changed, 33 insertions(+), 10 deletions(-) diff --git a/css-typed-om/Overview.bs b/css-typed-om/Overview.bs index 20ad968f..4699f57e 100644 --- a/css-typed-om/Overview.bs +++ b/css-typed-om/Overview.bs @@ -2906,17 +2906,40 @@ depending on the property they came from: : 'display' :: 1. Let |values| initially be the empty [=list=]. - 2. Append value of 'display-outside' to |values|. - 3. Append value of 'display-inside' to |values|. - 4. If 'display-listitem' is specified: + 2. If 'display-outside' or 'display-inside' is specified: + 1. Append value of 'display-outside' to |values|. + 2. Append value of 'display-inside' to |values|. + 3. Goto step 7. + 3. If 'display-listitem' is specified: 1. Append ''list-item'' to |values|. - 2. Serialize 'display-outside' and append it to |values|. - 3. If ''flow'' or ''flow-root'' exists, append it to |values|. - 5. Append value of 'display-internal' to |values|. - 6. Append value of 'display-box' to |values|. - 7. Append value of 'display-legacy' to |values|. - 8. If |values| is [=list/empty=] or if it only contains ''inline'', clear |values| and append "none" to |values|. - 9. Return the result of concatenating all the items in |values|, + 2. If 'display-outside' is specified, serialize it and append it to |values|. + 3. If ''flow'' or ''flow-root'' is specified, append it to |values|. + 4. Goto step 7. + 4. If 'display-internal' is specified: + 1. Append its value to |values|. + 2. Goto step 7. + 5. If 'display-box' is specified: + 1. Append its value to |values|. + 2. Goto step 7. + 6. If 'display-legacy' is specified: + 1. Append its value to |values|. + 2. Goto step 7. + 7. If |values| is: + 1. ''block flow'', return 'block'. + 2. ''block flow-root'', return ''flow-root''. + 3. ''inline flow'', return ''inline''. + 4. ''inline flow-root'', return ''inline-block''. + 5. ''run-in flow'', return ''run-in''. + 6. ''list-item block flow'', return ''list-item''. + 7. ''list-item inline flow'', return ''inline list-item''. + 8. ''block flex'', return ''flex''. + 9. ''inline flex'', return ''inline-flex''. + 10. ''block grid'', return ''grid''. + 11. ''inline ruby'', return ''ruby''. + 12. ''block table'', return ''table''. + 13. ''inline table'', return ''inline-table''. + 14. [=list/empty=], return "none". + 15. otherwise, return the result of concatenating all the items in |values|, separated by " " (U+0020 SPACE). From 01d4142202108a6049ccd0b21b1a99a392b37a7b Mon Sep 17 00:00:00 2001 From: Jia Date: Wed, 23 Aug 2017 11:16:25 +1000 Subject: [PATCH 3/3] Changed descriptions to address review comments' --- css-typed-om/Overview.bs | 54 ++++++++++++++++++++-------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/css-typed-om/Overview.bs b/css-typed-om/Overview.bs index 5fd6f770..c4a321bb 100644 --- a/css-typed-om/Overview.bs +++ b/css-typed-om/Overview.bs @@ -2912,39 +2912,39 @@ depending on the property they came from: : 'display' :: 1. Let |values| initially be the empty [=list=]. - 2. If 'display-outside' or 'display-inside' is specified: - 1. Append value of 'display-outside' to |values|. - 2. Append value of 'display-inside' to |values|. + 2. If <> or <> is specified: + 1. Serialize value of <> and append it to |values|. + 2. Serialize value of <> and append to |values|. 3. Goto step 7. - 3. If 'display-listitem' is specified: - 1. Append ''list-item'' to |values|. - 2. If 'display-outside' is specified, serialize it and append it to |values|. - 3. If ''flow'' or ''flow-root'' is specified, append it to |values|. + 3. If <> is specified: + 1. Append "list-item" to |values|. + 2. If <> is specified, serialize its value and append it to |values|. + 3. If "flow" or "flow-root" is specified, append it to |values|. 4. Goto step 7. - 4. If 'display-internal' is specified: - 1. Append its value to |values|. + 4. If <> is specified: + 1. Serialize its value and append it to |values|. 2. Goto step 7. - 5. If 'display-box' is specified: - 1. Append its value to |values|. + 5. If <> is specified: + 1. Serialize its value and append it to |values|. 2. Goto step 7. - 6. If 'display-legacy' is specified: - 1. Append its value to |values|. + 6. If <> is specified: + 1. Serialize its value and append it to |values|. 2. Goto step 7. 7. If |values| is: - 1. ''block flow'', return 'block'. - 2. ''block flow-root'', return ''flow-root''. - 3. ''inline flow'', return ''inline''. - 4. ''inline flow-root'', return ''inline-block''. - 5. ''run-in flow'', return ''run-in''. - 6. ''list-item block flow'', return ''list-item''. - 7. ''list-item inline flow'', return ''inline list-item''. - 8. ''block flex'', return ''flex''. - 9. ''inline flex'', return ''inline-flex''. - 10. ''block grid'', return ''grid''. - 11. ''inline ruby'', return ''ruby''. - 12. ''block table'', return ''table''. - 13. ''inline table'', return ''inline-table''. - 14. [=list/empty=], return "none". + 1. «"block", "flow"», return "block". + 2. «"block", "flow-root"», return "flow-root". + 3. «"inline", "flow"», return "inline". + 4. «"inline", "flow-root"», return "inline-block". + 5. «"run-in", "flow"», return "run-in". + 6. «"list-item", "block", "flow"», return "list-item". + 7. «"list-item", "inline", "flow"», return the result of concatenating «"inline", "list-item"», separated by " " (U+0020 SPACE). + 8. «"block", "flex"», return "flex". + 9. «"inline", "flex"», return "inline-flex". + 10. «"block", "grid"», return "grid". + 11. «"inline", "grid"», return "inline-grid". + 12. «"inline", "ruby"», return "ruby". + 13. «"block", "table"», return "table". + 14. «"inline", "table"», return "inline-table". 15. otherwise, return the result of concatenating all the items in |values|, separated by " " (U+0020 SPACE).