servo/components/style
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
..
color style: [css-properties-values-api] Parsing and serialization for @property syntax descriptor 2023-11-24 08:57:14 +01:00
counter_style style: Rustfmt servo/. r=zrhoffman 2023-11-24 08:57:14 +01:00
gecko style: Speed up / specialize attribute selector-matching 2023-11-24 08:57:14 +01:00
gecko_bindings style: Disable NSCAP_FEATURE_USE_BASE 2023-11-24 08:57:14 +01:00
gecko_string_cache Miscellaneous build / tidy fixes. 2021-02-26 17:53:55 +01:00
invalidation style: Fix style invalidation on layer rule insertion 2023-11-24 08:57:14 +01:00
media_queries style: Rustfmt servo/. r=zrhoffman 2023-11-24 08:57:14 +01:00
properties layout: Implement support for line-height and vertical-align (#30902) 2024-01-08 14:49:50 +00:00
properties_and_values Further changes required by Servo 2023-11-24 08:57:14 +01:00
queries style: Rustfmt servo/. r=zrhoffman 2023-11-24 08:57:14 +01:00
rule_tree style: Move size of tests to compile-time tests in the style crate 2023-08-16 17:46:41 +02:00
servo Add support for table fixups (#30868) 2023-12-22 12:11:58 +00:00
sharing style: Container units should prevent us from sharing style by rule node 2023-11-24 08:57:14 +01:00
stylesheets style: Remove viewport rule code 2023-11-24 08:57:14 +01:00
use_counters style: Remove HasBoxFFI 2023-11-21 15:36:35 +01:00
values Generalize LengthPercentageOrAuto impl to Generic Type (#30824) 2023-12-06 10:20:43 +00:00
animation.rs style: Share computed animation-iteration-count representation between Servo and Gecko 2023-11-06 09:35:57 +01:00
applicable_declarations.rs style: Run "cargo +nightly fmt" for style components in servo 2023-11-03 08:59:49 +01:00
attr.rs Further changes required by Servo 2023-11-21 15:36:35 +01:00
author_styles.rs style: Remove HasBoxFFI 2023-11-21 15:36:35 +01:00
bezier.rs style: Port bezier edge cases handling from C++ to Rust 2023-10-02 14:37:19 +00:00
bloom.rs Further changes required by Servo 2023-05-27 05:59:01 +02:00
build.rs Make the choice of layout runtime setting 2023-07-06 14:49:24 +02:00
build_gecko.rs style: Remove explicit rust target for bindgen in stylo 2023-11-04 08:17:09 +01:00
Cargo.toml Further changes required by Servo 2023-11-24 08:57:14 +01:00
context.rs style: Create timeline objects when mutating scroll-timeline property 2023-11-21 15:36:35 +01:00
custom_properties.rs style: Rustfmt servo/. r=zrhoffman 2023-11-24 08:57:14 +01:00
data.rs style: Rustfmt servo/. r=zrhoffman 2023-11-24 08:57:14 +01:00
dom.rs Further changes required by Servo 2023-11-24 08:57:14 +01:00
dom_apis.rs Further changes required by Servo 2023-11-24 08:57:14 +01:00
driver.rs Further changes required by Servo 2023-11-24 08:57:14 +01:00
encoding_support.rs
error_reporting.rs style: [css-properties-values-api] Implement parsing and serialization for @property at-rule 2023-11-24 08:57:14 +01:00
font_face.rs style: Rustfmt servo/. r=zrhoffman 2023-11-24 08:57:14 +01:00
font_metrics.rs style: Use ScriptPercentScaleDown and ScriptScriptPercentScaleDown constants 2023-11-03 08:59:49 +01:00
global_style_data.rs style: Unify parallel and sequential traversal scheduling 2023-11-24 08:57:14 +01:00
lib.rs style: [css-properties-values-api] Parsing and serialization for @property syntax descriptor 2023-11-24 08:57:14 +01:00
logical_geometry.rs Temporarily convert more cfg(debug_assertions) crashes to warnings (#30590) 2023-10-20 10:19:41 +00:00
macros.rs style: Move line-clamp out of mako and do some adjacent clean-up 2023-11-03 08:59:49 +01:00
matching.rs style: Restyle pseudo-elements as well on part attribute changes 2023-11-21 15:36:35 +01:00
parallel.rs Further changes required by Servo 2023-11-24 08:57:14 +01:00
parser.rs style: Rustfmt servo/. r=zrhoffman 2023-11-24 08:57:14 +01:00
piecewise_linear.rs style: Use write_char in place of write_str when serializing single-character literals 2023-11-06 09:35:57 +01:00
README.md Update branch name to main (#30877) 2023-12-16 09:32:20 +00:00
rule_cache.rs style: Use used, rather than computed font-size for font-metric dependent units 2023-11-04 08:17:09 +01:00
rule_collector.rs style: Simplify NAC setup 2023-11-21 15:36:35 +01:00
rustfmt.toml Disable formatting for components/style/ 2023-05-15 17:45:25 +02:00
scoped_tls.rs style: Unify parallel and sequential traversal scheduling 2023-11-24 08:57:14 +01:00
selector_map.rs style: when iterating over a selector to find a bucket, choose the rightmost 2023-11-21 15:36:35 +01:00
selector_parser.rs style: Use write_char in place of write_str when serializing single-character literals 2023-11-06 09:35:57 +01:00
shared_lock.rs style: Run rustfmt on servo/components/style and servo/ports/geckolib 2023-06-09 10:22:19 +02:00
str.rs Miscellaneous build / tidy fixes. 2021-02-26 17:53:55 +01:00
style_adjuster.rs Further changes required by Servo 2023-11-24 08:57:14 +01:00
style_resolver.rs style: Move ANCHORS_RELATIVE_SELECTOR out of nsINode flags 2023-11-24 08:57:14 +01:00
stylesheet_set.rs style: Share CascadeData instances across ShadowRoots 2023-05-16 13:00:08 +02:00
stylist.rs style: Remove viewport rule code 2023-11-24 08:57:14 +01:00
thread_state.rs
traversal.rs style: Unify parallel and sequential traversal scheduling 2023-11-24 08:57:14 +01:00
traversal_flags.rs

servo-style

Style system for Servo, using rust-cssparser for parsing.