servo/components
Oriol Brufau 7d8122b264 Check computed (min-)block-size when determining margin collapse
To collapse margins through, CSS2 requires "zero or auto computed height"
and "zero computed min-height" (the latter should also also include auto,
which was introduced in CSS3 as the new initial value).

Similarly, "auto computed height" is required to collapse the bottom margin
with the bottom margin of the contents.

Therefore this patch stops collapsing when the used height is clamped
to zero by max-height, but the computed value is not zero. Same for
non-zero percentages that are indefinite or that resolve to 0px.

Note that 0% and calc(0% + 0px) are still considered to be zero (so they
allow margin collapse), this may a bit inconsistent but matches Firefox
(for the collapsing through case).

This also matches the heuristics in find_block_margin_collapsing_with_parent().
We could change the heuristics instead, but then they would have to track
block sizes in order to be able to resolve percentages.

The change makes margin-collapse-through-percentage-height-block.html fail,
that test is only passing on Blink, which did a different interpretation
of the spec. To be fair, various places of CSS2 loosely consider that
indefinite percentages compute to auto, and even Firefox does so when
determining whether to collapse the top margin with the contents.

Since the spec isn't particularly clear and interoperability is lacking,
I filed https://github.com/w3c/csswg-drafts/issues/8919.
2023-07-01 03:00:53 +02:00
..
allocator Start the transition to workspace dependencies 2023-05-17 11:59:35 +02:00
atoms Further changes required by Servo 2023-06-09 10:22:21 +02:00
background_hang_monitor Start the transition to workspace dependencies 2023-05-17 11:59:35 +02:00
bluetooth Start the transition to workspace dependencies 2023-05-17 11:59:35 +02:00
bluetooth_traits Start the transition to workspace dependencies 2023-05-17 11:59:35 +02:00
canvas Remove the DOMToTexture feature 2023-06-27 11:39:52 +02:00
canvas_traits Remove the DOMToTexture feature 2023-06-27 11:39:52 +02:00
compositing It was removed from the spec and it's disabled everywhere. 2023-06-30 16:28:21 +02:00
config It was removed from the spec and it's disabled everywhere. 2023-06-30 16:28:21 +02:00
config_plugins Start the transition to workspace dependencies 2023-05-17 11:59:35 +02:00
constellation It was removed from the spec and it's disabled everywhere. 2023-06-30 16:28:21 +02:00
deny_public_fields Start the transition to workspace dependencies 2023-05-17 11:59:35 +02:00
derive_common Start the transition to workspace dependencies 2023-05-17 11:59:35 +02:00
devtools Start the transition to workspace dependencies 2023-05-17 11:59:35 +02:00
devtools_traits Start the transition to workspace dependencies 2023-05-17 11:59:35 +02:00
dom_struct Start the transition to workspace dependencies 2023-05-17 11:59:35 +02:00
domobject_derive Start the transition to workspace dependencies 2023-05-17 11:59:35 +02:00
embedder_traits Start the transition to workspace dependencies 2023-05-17 11:59:35 +02:00
geometry Start the transition to workspace dependencies 2023-05-17 11:59:35 +02:00
gfx Further changes required by Servo 2023-06-09 10:22:20 +02:00
gfx_traits Clean up and document the send_display_list interface 2023-05-24 09:16:25 +02:00
jstraceable_derive Start the transition to workspace dependencies 2023-05-17 11:59:35 +02:00
layout Make Layout 2013 style a superset of Layout 2020 style 2023-06-28 16:06:07 +02:00
layout_2020 Check computed (min-)block-size when determining margin collapse 2023-07-01 03:00:53 +02:00
layout_thread It was removed from the spec and it's disabled everywhere. 2023-06-30 16:28:21 +02:00
layout_thread_2020 It was removed from the spec and it's disabled everywhere. 2023-06-30 16:28:21 +02:00
layout_traits Start the transition to workspace dependencies 2023-05-17 11:59:35 +02:00
malloc_size_of style: Remove ThinBoxedSlice 2023-06-09 10:22:25 +02:00
media Start the transition to workspace dependencies 2023-05-17 11:59:35 +02:00
metrics Start the transition to workspace dependencies 2023-05-17 11:59:35 +02:00
msg Start the transition to workspace dependencies 2023-05-17 11:59:35 +02:00
net Update uuid 2023-06-26 16:27:12 +02:00
net_traits Auto merge of #29637 - AnthonyJ3:Use-same-origin-as-default-credential-mode-for-RequestInit-fix, r=mukilan 2023-05-18 14:16:45 +02:00
pixels Start the transition to workspace dependencies 2023-05-17 11:59:35 +02:00
profile Start the transition to workspace dependencies 2023-05-17 11:59:35 +02:00
profile_traits Start the transition to workspace dependencies 2023-05-17 11:59:35 +02:00
rand Update uuid 2023-06-26 16:27:12 +02:00
range Start the transition to workspace dependencies 2023-05-17 11:59:35 +02:00
remutex Start the transition to workspace dependencies 2023-05-17 11:59:35 +02:00
script Auto merge of #29850 - servo:css-viewport-removal, r=mrobinson 2023-06-30 20:54:11 +02:00
script_layout_interface Start the transition to workspace dependencies 2023-05-17 11:59:35 +02:00
script_plugins Upgrade remaining components to edition 2018 2023-02-18 09:42:37 +01:00
script_traits It was removed from the spec and it's disabled everywhere. 2023-06-30 16:28:21 +02:00
selectors style: Remove layout.css.is-and-where-better-error-recovery.enabled 2023-05-24 18:32:43 +02:00
servo Remove the DOMToTexture feature 2023-06-27 11:39:52 +02:00
servo_arc style: Refactor the author sheet cache to keep alive the relevant StylesheetContents 2023-05-24 18:32:30 +02:00
size_of_test Upgrade remaining components to edition 2018 2023-02-18 09:42:37 +01:00
std_test_override Upgrade remaining components to edition 2018 2023-02-18 09:42:37 +01:00
style It was removed from the spec and it's disabled everywhere. 2023-06-30 16:28:21 +02:00
style_derive Upgrade darling to 0.13.1 2023-06-09 11:17:48 +02:00
style_traits style: Make #[css(field_bound)] and #[css(iterable)] work properly 2023-06-09 10:22:17 +02:00
to_shmem style: Remove ThinBoxedSlice 2023-06-09 10:22:25 +02:00
to_shmem_derive Start the transition to workspace dependencies 2023-05-17 11:59:35 +02:00
url Start the transition to workspace dependencies 2023-05-17 11:59:35 +02:00
webdriver_server Fix compiler warning introduced in 4aa8a1c418 2023-05-20 02:03:58 +00:00
webgpu Start the transition to workspace dependencies 2023-05-17 11:59:35 +02:00
webrender_surfman Start the transition to workspace dependencies 2023-05-17 11:59:35 +02:00
webrender_traits Start the transition to workspace dependencies 2023-05-17 11:59:35 +02:00