aboutsummaryrefslogtreecommitdiffstats
path: root/components/style/properties
Commit message (Collapse)AuthorAgeFilesLines
* Move Stylo to its own repo (#31350)Delan Azabani2024-02-2751-20278/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Remove packages that were moved to external repo * Add workspace dependencies pointing to 2023-06-14 branch * Fix servo-tidy.toml errors * Update commit to include #31346 * Update commit to include servo/stylo#2 * Move css-properties.json lookup to target/doc/stylo * Remove dependency on vendored mako in favour of pypi dependency This also removes etc/ci/generate_workflow.py, which has been unused since at least 9e71bd6a7010d6e5723831696ae0ebe26b47682f. * Add temporary code to debug Windows test failures * Fix failures on Windows due to custom target dir * Update commit to include servo/stylo#3 * Fix license in tests/unit/style/build.rs * Document how to build with local Stylo in Cargo.toml
* style: Remove dependency on servo_config (was #31409) (#31411)Delan Azabani2024-02-231-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | * Initial style_config crate * Remove servo_config from style * Remove servo_config from tests/unit/style * Plumb servo prefs into stylo * Clean up dependencies * Fix formatting * Add unit tests * Add comment about avoiding clone * Fix bug where getters acquire unnecessary write lock * Remove stray dbg!() * Plumb default prefs into Stylo as well * Add comments about logging and mapping new pref types
* layout: Add initial support for `text-transform` (#31396)Martin Robinson2024-02-221-1/+0
| | | | | | | | | | | | | This adds basic support for `text-transform` in a way that is more complete than legacy layout. There are still many missing elements of proper `text-transform` support such as: 1. Support for `full-width` and `full-size-kana` 2. Support for grapheme based uppercasing, lowercasing, and capitalization. These are all done per-code point right now. 3. Support for the language-specific `SpecialCasing.txt` cases for case mapping such as the ones for Irish and Turkish. Co-authored-by: Rakhi Sharma <atbrakhi@igalia.com>
* Revert remaining Stylo changes (#31408)Delan Azabani2024-02-221-4/+4
| | | | | * Revert remaining changes from Stylo split-into-commits branch * Do the minimum amount of formatting to appease mach test-tidy
* style: Add a `static_prefs` implementation (#31351)Martin Robinson2024-02-141-8/+1
| | | | This will eventually be part of the stylo crate and reduces the diff between our verson of style and upstream's.
* Fix list-style serialization (#31314)Oriol Brufau2024-02-111-2/+9
| | | | | | | In layout2020, 'list-style-position' is disabled behind a pref, so the list_style_position field is an Option. The serialization of the 'list-style' shorthand wasn't correctly handling the case of it being None.
* layout: Add support for table `border-spacing` (#31166)Martin Robinson2024-01-261-1/+0
| | | | | | This adds support for table `border-spacing` property. Note that we do not yet support the collapsed border model. Co-authored-by: Oriol Brufau <obrufau@igalia.com>
* layout: Implement support for `line-height` and `vertical-align` (#30902)Martin Robinson2024-01-081-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* layout: Add support for `text-align-last` (#30905)Martin Robinson2023-12-211-1/+1
| | | | | | | | This change adds support for `text-align-last` as well as ensuring that it also applies to lines before forced line breaks. Two tests start to fail because they rely on right-to-left text to pass: - /css/css-text/text-align/text-align-last-010.html.ini - /css/css-text/text-align/text-align-last-011.html.ini
* Add basic support for `text-align: justify` (#30807)Martin Robinson2023-12-151-1/+0
| | | | This also enables parsing of `text-justify` for non-legacy layout, though only None is supported (disabling justification).
* style: Container units should prevent us from sharing style by rule nodeEmilio Cobos Álvarez2023-11-241-0/+5
| | | | | | | | | | | | At least when the containers are different. For now check that by doing a somewhat simplified test (checking sibling-ness). The new flag can be useful to optimize container query restyles on resizes too, in the future. Differential Revision: https://phabricator.services.mozilla.com/D179268
* style: Remove obsolete comment to add use counter for developing CSS propertiesTing-Yu Lin2023-11-241-10/+0
| | | | | | | | The CSS properties in the list are all shipped. Since we still don't support use counter for developing CSS properties since this bug opens, I assume this feature is not critical. Hence the removal of the comment. Differential Revision: https://phabricator.services.mozilla.com/D180771
* style: Move `ANCHORS_RELATIVE_SELECTOR` out of nsINode flagsDavid Shin2023-11-241-1/+7
| | | | | | Move the flag to ComputedValueFlags, like `CONSIDERED_RELATIVE_SELECTOR`. Differential Revision: https://phabricator.services.mozilla.com/D180726
* style: Clean up Context::for_non_inherited_propertyEmilio Cobos Álvarez2023-11-243-13/+3
| | | | | | | We don't ever check the particular property, so it can just be a boolean. Differential Revision: https://phabricator.services.mozilla.com/D180680
* style: Do not snap -webkit-text-stroke-width to dev pixelsEmilio Cobos Álvarez2023-11-244-5/+5
| | | | | | | Introduce LineWidth (which doesn't snap) and let BorderSideWidth wrap it and actually do the snapping. Differential Revision: https://phabricator.services.mozilla.com/D180688
* style: Improve border-image shorthand serialization, and annotate more passesEmilio Cobos Álvarez2023-11-241-11/+25
|
* style: Improve border shorthand serializationEmilio Cobos Álvarez2023-11-242-48/+34
| | | | | | | | | | | | Fix some bugs caught by css/cssom/shorthand-values. In particular: * Make the shorthand order match the spec. * Omit values when we can. Fix a subtest that wasn't correct. Shorthands can be serialized as long as !important matches in all components. Differential Revision: https://phabricator.services.mozilla.com/D180466
* style: Minor clean-ups to border shorthand parsingEmilio Cobos Álvarez2023-11-241-64/+50
| | | | | | This doesn't change behavior. Differential Revision: https://phabricator.services.mozilla.com/D180465
* style: Make flex-flow serialization interoperableTing-Yu Lin2023-11-241-1/+15
| | | | Differential Revision: https://phabricator.services.mozilla.com/D180270
* style: Send offset-position to the compositorBoris Chiou2023-11-241-0/+1
| | | | | | | | | | We send offset-position to the compositor, just like other similar properties, e.g. offset-rotate, offset-anchor. This includes extracting this animation value, doing serialization and sending it via IPC. So now we can run the animation of ray() on the compositor properly. Differential Revision: https://phabricator.services.mozilla.com/D179862
* style: Update the syntax of offset-positionBoris Chiou2023-11-242-8/+9
| | | | | | | | | | | | | | | Now it supports "normal" keyword. Also, offset-position doesn't create stacking context and it doesn't have offset transform, so we can simplify CompareMotionValues() a little bit. Note: We don't have to add test in [1] because Blink added one to WPT upstream repo already. [1] css/motion/parsing/offset-position-parsing-valid.html Note: the usage of offset-position is in other bugs. Differential Revision: https://phabricator.services.mozilla.com/D179623
* style: Simplify border snappingEmilio Cobos Álvarez2023-11-247-58/+17
| | | | | | | | Make the computed value of border-like properties app units (which is effectively what happens in Gecko already), and clamp at computed value time. Differential Revision: https://phabricator.services.mozilla.com/D179481
* style: Rustfmt servo/. r=zrhoffmanEmilio Cobos Álvarez2023-11-243-25/+59
| | | | | | | | $ find servo -name '*.rs' | xargs rustup run nightly rustfmt Depends on D179380 Differential Revision: https://phabricator.services.mozilla.com/D179381
* style: Correct style sharing handling for any element that considered ↵David Shin2023-11-241-1/+4
| | | | | | | | | | | | | | `:has()` in selector matching For any element that anchors a `:has()` selector (i.e. Matches a selector that contains a `:has()` on its rightmost side), we prevent style sharing altogether, as evaluation of the `:has()` selector is required in the first place to determine style sharing. On the other hand, any element matching a rule containing `:has()` without anchoring it can do style sharing for siblings, but not cousins. Differential Revision: https://phabricator.services.mozilla.com/D176836
* style: [css-nesting] Do a first pass at parsing nested rules mixed with ↵Emilio Cobos Álvarez2023-11-242-100/+168
| | | | | | | | | | | | | | | | | | declarations Plumb everything up. This factors out declaration and rule parsing so we share the code with the regular declaration parser. This could be made a bit nicer in the future. We need to decide what to do for @page and @keyframe (it seems conditional rules inside ought to work, but that's not so easy because per spec we create a nested style rule). But this is a first pass that passes a good chunk of the tests. There are other fixups to cssom, and I think some of the tests we fail are actually wrong... Differential Revision: https://phabricator.services.mozilla.com/D178266
* style: Implement parsing for `baseline-source`David Shin2023-11-242-0/+15
| | | | Differential Revision: https://phabricator.services.mozilla.com/D173884
* style: Remove the layout.css.named-pages.enabled prefEmily McDonough2023-11-241-1/+0
| | | | Differential Revision: https://phabricator.services.mozilla.com/D175438
* style: [css-nesting] Update cssparser againEmilio Cobos Álvarez2023-11-242-9/+19
| | | | | | | | | | | | | | | This changes the cssparser setup to: * Avoid having to do copies of the ParsingContext all over the place, which is useful because I plan to stash more nesting state in there. * Use the new RuleBodyParser which allows parsing qualified rules, declarations, and so on. Though we still don't use this anywhere. The next step is to join NestedRuleParser and PropertyDeclarationParser, so that we can parse declarations in a lot of the nested rules as well. Differential Revision: https://phabricator.services.mozilla.com/D178053
* Further changes required by ServoOriol Brufau2023-11-241-0/+1
|
* style: Move a bit declaration_block and cascade modulesEmilio Cobos Álvarez2023-11-244-50/+89
| | | | | | | So that they aren't imported via #[path]. This allows cargo to see them even before building. Differential Revision: https://phabricator.services.mozilla.com/D178105
* style: Remove some magic from the bindingsEmilio Cobos Álvarez2023-11-244-300/+314
| | | | | | | | | | | | | | | | | | | This simplifies a tiny bit our bindings in some places, and complicates it in others, but over all I think it's better. It requires a bit more manual code in the rust side to drop and cast the relevant pointers (which was done implicitly before), but it's a lot less magic than it used to be, and that's all autogenerated so consumers don't need to care about it. The set up is still not ideal. I don't like that we rely on destructors running in both sides of the FFI boundary, but that's for another day. This is the last usage of RawOffsetArc, so remove that. We now support proper Arc<> in structs (GridTemplateAreas uses it), so I don't think we'll need it any time soon. Differential Revision: https://phabricator.services.mozilla.com/D177905
* style: Hardening color checksTiaan Louw2023-11-242-4/+4
| | | | | | | Avoid trying to resolve a currentcolor when a foreground color is not available. Differential Revision: https://phabricator.services.mozilla.com/D177368
* style: Rework -x-text-zoom to allow disabling text zoom and min-font-size ↵Emilio Cobos Álvarez2023-11-215-41/+22
| | | | | | | | | | | | | | separately And use it instead of explicit document checks. This centralizes where we check for it. IsChromeDoc is relatively cheap, but this bug wants to also check for PDF.js which is a bit more expensive. No behavior change. Differential Revision: https://phabricator.services.mozilla.com/D176940
* style: [css-nesting] Update cssparser to allow parsing qualified rules along ↵Emilio Cobos Álvarez2023-11-211-11/+27
| | | | | | | | | | with declaration No implementation just yet (the default QualifiedRuleParser implementation just rejects stuff), but this is plumbing that I'd rather get reviewed separately. Differential Revision: https://phabricator.services.mozilla.com/D176686
* style: Implement CSS and rendering (but not copy/paste) support for the ↵Jonathan Kew2023-11-212-1/+9
| | | | | | (non-standard) -webkit-text-security property Differential Revision: https://phabricator.services.mozilla.com/D174951
* style: Avoid linear search to check for custom property presenceEmilio Cobos Álvarez2023-11-211-75/+93
| | | | | | | The test-case in the next patch from 10s to a couple hundred milliseconds on my machine. No behavior change other than that. Differential Revision: https://phabricator.services.mozilla.com/D175612
* style: Remove cascade layers prefEmilio Cobos Álvarez2023-11-211-9/+1
| | | | | | These have been enabled by default for quite a while. Differential Revision: https://phabricator.services.mozilla.com/D175513
* style: Remove a bunch of now completely dead XUL layout codeEmilio Cobos Álvarez2023-11-211-10/+0
| | | | | | | | | And some related tests. A bunch of -moz-box* properties are web exposed, so I'll file a follow-up for hiding them. Differential Revision: https://phabricator.services.mozilla.com/D173819
* style: Remove layout.css.d-property.enabledBoris Chiou2023-11-211-1/+0
| | | | | | | This feature was shipped in Fx97, and it seems we don't need this pref anymore. Differential Revision: https://phabricator.services.mozilla.com/D173591
* style: Use auto as the initial value for view-timeline-insetBoris Chiou2023-11-211-1/+1
| | | | | | | Per the proposal in https://github.com/w3c/csswg-drafts/issues/7747, we change view-timeline-inset to have an initial value of auto. Differential Revision: https://phabricator.services.mozilla.com/D173487
* style: Reuse declaration block with SVG presentation attributesEmilio Cobos Álvarez2023-11-211-0/+8
| | | | | | | | Ideally we'd only update the attributes that actually changed. That's a bit more work I can try to look into, but this and bug 1823686 should improve things here. Differential Revision: https://phabricator.services.mozilla.com/D173162
* Further changes required by ServoOriol Brufau2023-11-211-0/+2
|
* style: Create timeline objects when mutating scroll-timeline propertyBoris Chiou2023-11-212-0/+35
| | | | | | And so we can lookup the timeline from TimelineCollection. Differential Revision: https://phabricator.services.mozilla.com/D169273
* style: Convert RGBA to AbsoluteColor for computed/animated/resolved CSS colorsTiaan Louw2023-11-214-10/+9
| | | | | | | | | | | | | | Computed color values will not be in the correct format, closer to the one specified by the author. This also means that colors accross the code are stored now as AbsoluteColor or StyleAbsoluteColor. This allows color space/gamut information to be available for use. Some animation related test failures had to be changed, because colors now has greater precision. Animated a color now causes a lot more animation updates, which was not initially expected. See the bug for discussion. Differential Revision: https://phabricator.services.mozilla.com/D171021
* style: Move legacy -moz-box collapse to its own CSS propertyEmilio Cobos Álvarez2023-11-061-0/+10
| | | | | | | | | | | | Make display: -moz-box's visibility: collapse handling switchable by its own CSS property. Longer term maybe we should switch the front-end away from visibility: collapse altogether (there are some alternatives), but for now this will allow to move the front-end to switch to modern `display: flex` while keeping `visibility: collapse` work as in -moz-box. Differential Revision: https://phabricator.services.mozilla.com/D171472
* style: Support offset-position in the style systemBoris Chiou2023-11-062-19/+63
| | | | | | | | | | | | | | | | Also, we make it animatable but don't apply it to the motion transform and don't run it on the compositor for now (so it works for getComputedStyle but doesn't have rendering result). Per spec: https://w3c.github.io/csswg-drafts/css-values/#calc-serialize, we tweak the WPT to let calc() serialize the percentage first, and maintain zero-valued terms, i.e. 0%. (We are doing the same thing as offset-anchor, so it should be fine with other browsers.) Besides, I tweak the serialization of shorthand a little bit so we match the implementation of WebKit. Differential Revision: https://phabricator.services.mozilla.com/D170972
* style: Make -moz-box-layout: flex default, and clean-up CSSEmilio Cobos Álvarez2023-11-061-1/+1
| | | | | | | | Now it's on by default everywhere, so all this is not needed. No behavior change effectively since the xul.css bits being removed effectively achieve the same. Differential Revision: https://phabricator.services.mozilla.com/D170944
* style: Remove -moz-image-region support from layoutEmilio Cobos Álvarez2023-11-061-11/+0
| | | | | | | There are no users of non-auto values, so we can just simplify some code and remove the property. Differential Revision: https://phabricator.services.mozilla.com/D170010
* Further changes required by ServoOriol Brufau2023-11-061-3/+5
|
* style: Add forced-color-adjust propertyFred Chasen2023-11-064-0/+19
| | | | | | | | Adds the forced-color-adjust property and ForcedColorAdjust keywords. Updates tweak_when_ignoring_colors to check for `none` value of that property when determining if a color adjustment in needed. Adds a check for `none` when styling selections to make sure they can be styled in forced color modes. Differential Revision: https://phabricator.services.mozilla.com/D169000