diff options
author | bptato <nincsnevem662@gmail.com> | 2023-11-12 02:58:00 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2023-11-12 02:59:59 +0100 |
commit | 39e2ef5207ad13c34de00c8cc998e434eeb42ab7 (patch) | |
tree | 98cc813f4945327ef205708467676d43a8199c11 /src/css | |
parent | a3bd24ae53ea4e1d1c77dfc5a1171a05b5d9ca18 (diff) | |
download | chawan-39e2ef5207ad13c34de00c8cc998e434eeb42ab7.tar.gz |
layout: refactor flow margin propagation, sizing
* Blocks are now positioned before their text contents would be layouted * Untangle calcAvailableSpaceSizes's results from BlockBox * Move a couple of objects from box -> engine * Use Size in a few more places * Set display to block if float is not none
Diffstat (limited to 'src/css')
-rw-r--r-- | src/css/values.nim | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/css/values.nim b/src/css/values.nim index 91911c09..6a02f5ba 100644 --- a/src/css/values.nim +++ b/src/css/values.nim @@ -1467,3 +1467,16 @@ func buildComputedValues*(builder: CSSComputedValuesBuilder): CSSComputedValues result[prop] = builder.parent[prop] else: result[prop] = getDefault(prop) + if result{"float"} != FLOAT_NONE: + case result{"display"} + of DISPLAY_BLOCK, DISPLAY_TABLE, DISPLAY_LIST_ITEM, DISPLAY_NONE: + #TODO flex, grid + discard + {.linearScanEnd.} + of DISPLAY_INLINE, DISPLAY_INLINE_BLOCK, DISPLAY_TABLE_ROW, + DISPLAY_TABLE_ROW_GROUP, DISPLAY_TABLE_COLUMN, + DISPLAY_TABLE_COLUMN_GROUP, DISPLAY_TABLE_CELL, DISPLAY_TABLE_CAPTION, + DISPLAY_TABLE_HEADER_GROUP, DISPLAY_TABLE_FOOTER_GROUP: + result{"display"} = DISPLAY_BLOCK + of DISPLAY_INLINE_TABLE: + result{"display"} = DISPLAY_TABLE |