mirror of
https://github.com/servo/servo
synced 2026-05-12 09:56:50 +02:00
In DOM traversal, `display:contents `elements don't generate boxes, but their styles still need to apply to children. `ModernContainerBuilder` now keeps track of `display:contents` ancestors during traversal then apply their style to text runs. In `InlineFormattingContextBuilder::push_text` only use same style parent if both selected and current inline style are identical. Testing: > PASS [expected FAIL] /css/css-display/display-contents-dynamic-before-after-001.html > PASS [expected FAIL] /css/css-display/display-contents-dynamic-inline-flex-001-inline.html > PASS [expected FAIL] /css/css-display/display-contents-dynamic-inline-flex-001-none.html > FAIL [expected PASS] /css/css-display/display-contents-fieldset.html > PASS [expected FAIL] /css/css-display/display-contents-first-line-002.html > PASS [expected FAIL] /css/css-display/display-contents-inline-001.html > PASS [expected FAIL] /css/css-display/display-contents-inline-flex-001.html > PASS [expected FAIL] /css/css-display/display-contents-line-height.html Fixes: https://github.com/servo/servo/issues/41797 cc: @xiaochengh Signed-off-by: Oriol Brufau <obrufau@igalia.com> Co-authored-by: Oriol Brufau <obrufau@igalia.com> Co-authored-by: Martin Robinson <mrobinson@igalia.com>