servo/components/style/properties/longhands
Martin Robinson aa073c3dca
layout: Implement support for line-height and vertical-align (#30902)
* layout: Implement support for `line-height` and `vertical-align`

This is an initial implementation of proper `line-height` and
`vertical-align` support. While this change includes the bulk of the
work there are still many missing pieces for full support. In particular
some big missing things are:

 - Flex containers do not properly compute their baselines. The idea is
   to tackle this in a followup change. This causes various flex tests
   to start failing because everything used to be top aligned.
 - The implementation of the line-height quirks (only active in quirks
   mode) are incomplete. While the quirk works in many cases, there are
   still some cases where it is handled incorrectly. This requires more
   redesign and refinement, better suited for a followup.
 - Most of the features are CSS 3 such as precision control of the
   baseline and first and last baselines are not implemented. This
   change gets us close to CSS 2.x support.

While there are many new test passes with this change some tests are
starting to fail. An accounting of new failures:

Tests failing also in Layout 2013:
 - /css/css2/positioning/toogle-abspos-on-relpos-inline-child.html (only passes in Chrome)
 - /css/CSS2/fonts/font-applies-to-001.xht (potentially an issue with font size)

Invalid tests:
 - /css/CSS2/visudet/inline-block-baseline-003.xht
 - /css/CSS2/visudet/inline-block-baseline-004.xht
 - These are are failing in all browsers. See https://bugs.chromium.org/p/chromium/issues/detail?id=1222151.

Missing table support:
 - /_mozilla/mozilla/table_valign_middle.html

Missing `font-size-adjust` support :
 - /css/css-fonts/font-size-adjust-zero-2.html (also failing in 2013)

Incomplete form field support :
- /html/rendering/widgets/the-select-element/option-add-label-quirks.html (label isn't rendered so button isn't the right size in quirks mode due to line height quirk)

Need support for calculating flexbox baseline:
 - /css/css-flexbox/fieldset-baseline-alignment.html
 - /css/css-flexbox/flex-inline.html
 - /css/css-flexbox/flexbox-baseline-multi-line-horiz-001.html
 - /css/css-flexbox/flexbox-baseline-single-item-001a.html
 - /css/css-flexbox/flexbox-baseline-single-item-001b.html

Failing because we don't create anonymous inline boxes for text children of blocks:
- /css/CSS2/linebox/anonymous-inline-inherit-001.html

Passes locally (potentially related to fonts):
 - /css/CSS2/css1/c414-flt-fit-004.xht
 - /css/css-transforms/transform-input-017.html
 - /html/obsolete/requirements-for-implementations/the-marquee-element-0/marquee-min-intrinsic-size.html
 - /css/css-fonts/first-available-font-005.html
 - /css/css-fonts/first-available-font-006.html

* Some cleanups after live review with @mukilan

Also update results.
2024-01-08 14:49:50 +00:00
..
background.mako.rs Make the choice of layout runtime setting 2023-07-06 14:49:24 +02:00
border.mako.rs style: Simplify border snapping 2023-11-24 08:57:14 +01:00
box.mako.rs layout: Implement support for line-height and vertical-align (#30902) 2024-01-08 14:49:50 +00:00
column.mako.rs style: Do not snap -webkit-text-stroke-width to dev pixels 2023-11-24 08:57:14 +01:00
counters.mako.rs Make the choice of layout runtime setting 2023-07-06 14:49:24 +02:00
effects.mako.rs Make the choice of layout runtime setting 2023-07-06 14:49:24 +02:00
font.mako.rs style: Remove some magic from the bindings 2023-11-24 08:57:14 +01:00
inherited_box.mako.rs style: Remove a bunch of now completely dead XUL layout code 2023-11-21 15:36:35 +01:00
inherited_svg.mako.rs style: Properly hide -moz-context-properties from content 2023-05-24 18:32:30 +02:00
inherited_table.mako.rs Make the choice of layout runtime setting 2023-07-06 14:49:24 +02:00
inherited_text.mako.rs layout: Add support for text-align-last (#30905) 2023-12-21 14:45:34 +00:00
inherited_ui.mako.rs style: Add lab(), lch(), oklab(), oklch() to specified colors 2023-11-06 09:35:57 +01:00
list.mako.rs style: Remove -moz-image-region support from layout 2023-11-06 09:35:57 +01:00
margin.mako.rs style: Implement overflow-clip-margin: <length> 2023-08-16 17:46:41 +02:00
outline.mako.rs style: Do not snap -webkit-text-stroke-width to dev pixels 2023-11-24 08:57:14 +01:00
padding.mako.rs Make the choice of layout runtime setting 2023-07-06 14:49:24 +02:00
page.mako.rs style: Remove the layout.css.named-pages.enabled pref 2023-11-24 08:57:14 +01:00
position.mako.rs style: Remove aspect-ratio preference 2023-10-02 14:37:19 +00:00
svg.mako.rs style: Remove layout.css.d-property.enabled 2023-11-21 15:36:35 +01:00
table.mako.rs Make the choice of layout runtime setting 2023-07-06 14:49:24 +02:00
text.mako.rs style: [refactor] Migrate NS_STYLE_TEXT_DECORATION_STYLE_* defines 2023-11-04 08:17:09 +01:00
ui.mako.rs style: Use auto as the initial value for view-timeline-inset 2023-11-21 15:36:35 +01:00
xul.mako.rs style: Rename alias to aliases in Longhand and Shorthand 2021-02-26 16:44:05 +01:00