aboutsummaryrefslogtreecommitdiffstats
path: root/components/style
Commit message (Collapse)AuthorAgeFilesLines
...
* style: Fixes for font-language-override parsing and testsJonathan Kew2023-11-064-75/+34
| | | | Differential Revision: https://phabricator.services.mozilla.com/D168555
* style: Ensure font-variant-alternates values are serialized in canonical orderJonathan Kew2023-11-062-14/+39
| | | | Differential Revision: https://phabricator.services.mozilla.com/D168281
* style: Avoid redundantly serializing the initial value of font-weight (400) ↵Jonathan Kew2023-11-061-2/+11
| | | | | | as part of the font shorthand in computed style Differential Revision: https://phabricator.services.mozilla.com/D168250
* style: Use write_char in place of write_str when serializing ↵Jonathan Kew2023-11-0652-129/+131
| | | | | | | | | | | | single-character literals Generated by running find servo/components/style -name "*.rs" -exec perl -p -i -e "s/write_str\(\"(.)\"\)/write_char('\1')/g" {} \; (and then added `use std::fmt::Write;` in a couple of places to fix build errors that arose). Differential Revision: https://phabricator.services.mozilla.com/D168217
* style: Implement the font-synthesis-{weight,style,small-caps} longhand ↵Jonathan Kew2023-11-069-208/+169
| | | | | | properties, and make font-synthesis into a shorthand Differential Revision: https://phabricator.services.mozilla.com/D167480
* Further changes required by ServoOriol Brufau2023-11-061-0/+1
|
* style: Create a pref to list icon font families that should be used even ↵Jonathan Kew2023-11-061-11/+48
| | | | | | | | | | | | | | when use_document_fonts=0, overriding the browser's font prefs Some widely-used icon fonts use ligature rules to replace icon names such as "volume_up" or "down_arrow" with icon glyphs. If the site is designed to use such a font, but the user disables document fonts and we use our default Latin font instead, the underlying text will be rendered instead of the intended icon. To enable such fonts to continue to work, we provide a list of known ligature-icon fonts and allow them to be used even when the document-fonts setting is disabled. Differential Revision: https://phabricator.services.mozilla.com/D167923
* style: Implement color() function from CSS specificationTiaan Louw2023-11-065-61/+778
| | | | | | | | | Colors can now be defined in different color spaces with the color() function. https://w3c.github.io/csswg-drafts/css-color-4/#predefined Differential Revision: https://phabricator.services.mozilla.com/D164866
* style: Basic implementation of Custom Highlight APIJan-Niklas Jaeschke2023-11-064-5/+40
| | | | | | | | | | | | Added WebIDL interfaces as per spec, added some necessary changes to support maplike and setlike structures to be accessed from C++. Added `::highlight(foo)` pseudo element to CSS engine. Implemented Highlight as new kind of `Selection` using `HighlightType::eHighlight`. This implies Selections being added/removed during runtime (one `Selection` object per highlight identifier), therefore a dynamic container for highlight `Selection` objects was added to `nsFrameSelection`. Also, the painting code queries the highlight style for highlight Selections. Implementation is currently hidden behind a pref `dom.customHighlightAPI.enabled`. Differential Revision: https://phabricator.services.mozilla.com/D164203
* style: Make scroll-timeline-{name|axis} be a coordinating list property groupBoris Chiou2023-11-064-48/+50
| | | | | | | | | | | Named scroll progress timelines are declared in the coordinated value list constructed from the longhands of the scroll-timeline shorthand property, which form a coordinating list property group with scroll-timeline-name as the coordinating list base property. In the meantime, we also update its shorthand to match the current spec. Differential Revision: https://phabricator.services.mozilla.com/D166596
* Further changes required by ServoOriol Brufau2023-11-061-1/+1
|
* style: Add `lab`, `lch`, `oklab` and `oklch` to DevTools autocompleteNicolas Chevobbe2023-11-061-0/+3
| | | | Differential Revision: https://phabricator.services.mozilla.com/D167803
* style: Update scroll-timeline shorthand syntax in WPTBoris Chiou2023-11-061-1/+1
| | | | | | | | | | The syntax of scroll-timeline shorthand is: `[ <'scroll-timeline-name'> <'scroll-timeline-axis'>? ]#`. This patch just updates WPT to match the spec. Our fix will be together with Bug 1809005. Differential Revision: https://phabricator.services.mozilla.com/D166595
* style: Accept auto for {scroll|view}-timeline-nameBoris Chiou2023-11-062-60/+7
| | | | | | | Per https://github.com/w3c/csswg-drafts/issues/7431, both timeline name should accept `auto`. Differential Revision: https://phabricator.services.mozilla.com/D166476
* style: Support view-timeline shorthandBoris Chiou2023-11-061-0/+65
| | | | | | | | | view-timeline shorthand includes view-timeline-name and view-timeline-axis, but excludes view-timeline-inset. Note: We will fix the test of "view-timeline-name: auto" in the next patch. Differential Revision: https://phabricator.services.mozilla.com/D166404
* style: Support view-timeline-inset in style systemBoris Chiou2023-11-068-8/+102
| | | | | | | Support view-timeline-inset: `[ [ auto | <length-percentage> ]{1,2} ]#`. And its initial value is 0. Differential Revision: https://phabricator.services.mozilla.com/D166243
* style: Support view-timeline-name and view-timeline-axis in style systemBoris Chiou2023-11-063-12/+55
| | | | | | | | | | | view-timeline-name: `none | <custom-ident>#` view-timeline-axis: `[ block | inline | vertical | horizontal ]#` Note: Both view-timeline-name and scroll-timeline-name should accept `auto`. We will fix it in this patch series. Differential Revision: https://phabricator.services.mozilla.com/D166242
* style: Minor clean-up to transform interpolation codeEmilio Cobos Álvarez2023-11-061-23/+15
| | | | Differential Revision: https://phabricator.services.mozilla.com/D167616
* style: Avoid infinite output progress after applying the easing functionBoris Chiou2023-11-061-3/+15
| | | | | | | | | | | The output progress of easing functions could be inf or -inf, per spec, https://drafts.csswg.org/css-easing-2/#output-progress-value. But we should avoid using infinity to calculate interpolation or use the infinite progress in Web Animations API, per the spec issue comments: https://github.com/w3c/csswg-drafts/issues/8344#issuecomment-1399033481 Differential Revision: https://phabricator.services.mozilla.com/D167342
* Further changes required by ServoOriol Brufau2023-11-064-8/+16
|
* style: Add lab(), lch(), oklab(), oklch() to specified colorsTiaan Louw2023-11-069-86/+509
| | | | | | | | | | | Use new changes from cssparser and use the new lab/lch/oklab/oklch color formats. Introduced a new color type AbsoluteColor. It represents any kind of color that has absolute numerical values. It is also tied to a color space and therefore can be trivially converted to another color space. Differential Revision: https://phabricator.services.mozilla.com/D163579
* style: Clean up list interpolation codeEmilio Cobos Álvarez2023-11-0610-221/+162
| | | | | | | Factor out duplicated / common code to its own module, add / fix spec links, and clean-up callers. Differential Revision: https://phabricator.services.mozilla.com/D167253
* style: De-dup items with the same tag in the computed value of ↵Jonathan Kew2023-11-063-137/+106
| | | | | | font-feature-settings and font-variation-settings Differential Revision: https://phabricator.services.mozilla.com/D167012
* style: Remove some duplicated code for coordinated propertiesEmilio Cobos Álvarez2023-11-061-120/+30
| | | | Differential Revision: https://phabricator.services.mozilla.com/D167130
* style: Use the same computed time representation between Servo and GeckoEmilio Cobos Álvarez2023-11-063-13/+14
| | | | | | Same as above. Differential Revision: https://phabricator.services.mozilla.com/D167126
* style: Share computed animation-iteration-count representation between Servo ↵Emilio Cobos Álvarez2023-11-065-73/+67
| | | | | | | | | and Gecko This removes the special AnimationIterationCount -> f32 conversion from gecko.mako.rs which will be useful to simplify coordinated properties. Differential Revision: https://phabricator.services.mozilla.com/D167123
* style: Style changes to support the 'page-orientation' propertyJonathan Watt2023-11-047-2/+33
| | | | Differential Revision: https://phabricator.services.mozilla.com/D161800
* style: Implement selector matching for :nth-child(An+B of selector list) and ↵Zach Hoffman2023-11-045-14/+25
| | | | | | | | | | | | :nth-last-child(An+B of selector list) Since we have been using a single hash map to cache all :nth-child indices (with no selector list), each different selector will need its own cache. As a side note, this patch does not address invalidation. Differential Revision: https://phabricator.services.mozilla.com/D166266
* style: Remove non-standard values of caption-side for goodEmilio Cobos Álvarez2023-11-041-19/+1
| | | | | | | | They have been disabled since bug 1688695. There's a variety of table-caption bugs that would be easier to fix if we didn't have to account for side-captions. Differential Revision: https://phabricator.services.mozilla.com/D165690
* style: Serialization differences with "columns" with one or more `auto` valueZiran Sun2023-11-041-1/+14
| | | | Differential Revision: https://phabricator.services.mozilla.com/D166087
* style: [refactor] Migrate NS_STYLE_LIST_STYLE_POSITION_* definesBen Freist2023-11-041-0/+1
| | | | Differential Revision: https://phabricator.services.mozilla.com/D166140
* style: Implement parsing and serialization for nth-child(An+B of selector ↵Zach Hoffman2023-11-042-1/+7
| | | | | | | | | list) and :nth-last-child(An+B of selector list) :nth-{,last-}child parsing is disabled by default for now by pref layout.css.nth-child-of.enabled. Differential Revision: https://phabricator.services.mozilla.com/D165895
* style: Animate the 'normal' value of font-style as 'oblique 0deg'Jonathan Kew2023-11-041-2/+11
| | | | | | | | | | | | | This matches what the spec[1] says for font-style: > Animation type: by computed value type; normal animates as oblique 0deg A bunch of WPT tests for font-style animation are landing in https://github.com/web-platform-tests/wpt/pull/37570. Current Gecko passes 66/129 of the testcases there; with this patch applied it passes all the tests. [1] https://drafts.csswg.org/css-fonts-4/#font-style-prop Differential Revision: https://phabricator.services.mozilla.com/D166128
* style: Remove spurious mention of FontStyleAdjust from style/properties/data.pyJonathan Kew2023-11-041-1/+0
| | | | | | | There's no font-style-adjust property, and no FontStyleAdjust type anywhere I can see. So the mention in data.py is redundant (and potentially confusing). Differential Revision: https://phabricator.services.mozilla.com/D166127
* style: Compute font-size-adjust early, so that we get the correct used font ↵Jonathan Kew2023-11-041-2/+3
| | | | | | size for font-dependent units Differential Revision: https://phabricator.services.mozilla.com/D165842
* style: Rename scroll-linked (animations) to scroll-driven (excluding WPT tests)Boris Chiou2023-11-042-11/+10
| | | | | | | The spec is still using `Scroll-linked`, so we exclude the change of WPT tests. I believe WPT will get updates once the spec doc is renamed. Differential Revision: https://phabricator.services.mozilla.com/D165914
* style: Represent FirstChild, FirstOfType, LastChild, LastOfType, OnlyChild, ↵Zach Hoffman2023-11-041-7/+1
| | | | | | | | | | | | and OnlyOfType as functionless Nth variants Like bug 1808226, this doesn't change any behavior, it just simplifies matching. I also added a WPT JavaScript test for :only-of-type, since dedicated WPT JavScript tests already exist for the other pseudo-classes this patch touches. Differential Revision: https://phabricator.services.mozilla.com/D165859
* style: [refactor] Migrate NS_STYLE_MASONRY_* definesBen Freist2023-11-042-32/+5
| | | | Differential Revision: https://phabricator.services.mozilla.com/D164422
* style: Store values for :nth- selectors in dedicated struct NthSelectorDataZach Hoffman2023-11-041-4/+1
| | | | | | | | | | | To accomplish this, all :nth- Components were replaced with type Nth, which uses NthSelectorData. Using NthSelectorData will make it easier to add selector lists for :nth selectors later on, but this change by itself shouldn't change any behavior. Differential Revision: https://phabricator.services.mozilla.com/D165831
* Further changes required by ServoOriol Brufau2023-11-041-0/+2
|
* style: Compute column-rule-width to 0 when column-rule-style is noneOriol Brufau2023-11-042-4/+43
| | | | | | Depends on D164554 Differential Revision: https://phabricator.services.mozilla.com/D164549
* style: Use used, rather than computed font-size for font-metric dependent unitsEmilio Cobos Álvarez2023-11-0411-39/+64
| | | | Differential Revision: https://phabricator.services.mozilla.com/D165737
* style: Fix container orientation evaluationEmilio Cobos Álvarez2023-11-044-13/+20
| | | | | | | | | Allow keyword evaluators to return unknown. Do you know of a good test to extend here? Otherwise I can add a new one, though I gotta run atm. Differential Revision: https://phabricator.services.mozilla.com/D165630
* Further changes required by ServoOriol Brufau2023-11-042-6/+14
|
* style: Avoid generic soup and extra reference count bumpsEmilio Cobos Álvarez2023-11-045-21/+29
| | | | | | This makes me a bit happier about the previous patch :) Differential Revision: https://phabricator.services.mozilla.com/D165236
* Further changes required by ServoOriol Brufau2023-11-041-0/+1
|
* style: Implement overflow: overlay as an alias on auto, and enable on NightlyEmilio Cobos Álvarez2023-11-041-1/+4
| | | | | | | See related webcompat issues and discussion in https://github.com/w3c/csswg-drafts/issues/8063 Differential Revision: https://phabricator.services.mozilla.com/D165058
* style: Fix container units on ::backdropOriol Brufau2023-11-043-2/+22
| | | | Differential Revision: https://phabricator.services.mozilla.com/D165542
* style: Implement the color-gamut media featureZach Hoffman2023-11-041-1/+40
| | | | Differential Revision: https://phabricator.services.mozilla.com/D165385
* style: Partial fix for container units in pseudo-elementsOriol Brufau2023-11-042-13/+11
| | | | | | | | | | | | | | When apply_declarations is used for a pseudo-element, make it pass the parent_style as the originating_element_style for container queries. This requires changing some parameters from Option<&Arc<ComputedValues>> to Option<&ComputedValues>. It's not a complete solution, since e.g. parent_style is not the style of the originating element of a ::backdrop. But here it's not as simple as in D164908, so leaving these details for later. Differential Revision: https://phabricator.services.mozilla.com/D164977