aboutsummaryrefslogtreecommitdiffstats
path: root/components/style/stylesheets
Commit message (Collapse)AuthorAgeFilesLines
* Move Stylo to its own repo (#31350)Delan Azabani2024-02-2722-6632/+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
* Revert remaining Stylo changes (#31408)Delan Azabani2024-02-221-2/+1
| | | | | * Revert remaining changes from Stylo split-into-commits branch * Do the minimum amount of formatting to appease mach test-tidy
* style: Remove dependency on servo_url (#31358)Martin Robinson2024-02-161-2/+29
| | | | | In order for stylo to be a separate crate, it needs to depend on less things from Servo. This change makes it so that stylo no longer depends on servo_url.
* style: Add a `static_prefs` implementation (#31351)Martin Robinson2024-02-143-27/+3
| | | | This will eventually be part of the stylo crate and reduces the diff between our verson of style and upstream's.
* style: Remove viewport rule codeEmilio Cobos Álvarez2023-11-246-920/+1
| | | | | | | Turns out Servo doesn't need this either, see https://github.com/servo/servo/pull/29850. Differential Revision: https://phabricator.services.mozilla.com/D180264
* style: Rustfmt servo/. r=zrhoffmanEmilio Cobos Álvarez2023-11-2412-90/+114
| | | | | | | | $ find servo -name '*.rs' | xargs rustup run nightly rustfmt Depends on D179380 Differential Revision: https://phabricator.services.mozilla.com/D179381
* Further changes required by ServoOriol Brufau2023-11-241-0/+23
|
* style: Use non-locked rules for all rule types that canEmilio Cobos Álvarez2023-11-245-167/+102
| | | | | | | | | Anything that doesn't need interior mutability doesn't need Locked<> around it. Depends on D179059 Differential Revision: https://phabricator.services.mozilla.com/D179060
* style: [css-properties-values-api] Remove Locked<> from CssRule::Property arcZach Hoffman2023-11-242-7/+8
| | | | | | Depends on D179038 Differential Revision: https://phabricator.services.mozilla.com/D179039
* style: [css-properties-values-api] Share PropertyRule instance when cloning ↵Zach Hoffman2023-11-241-2/+3
| | | | | | CssRule::Property Differential Revision: https://phabricator.services.mozilla.com/D178892
* Further changes required by ServoOriol Brufau2023-11-241-1/+5
|
* style: [css-properties-values-api] Implement parsing and serialization for ↵Zach Hoffman2023-11-245-1/+39
| | | | | | | | | | | | | | @property at-rule Implemented behind the new properties-and-values pref. Support for the CSSPropertyRule WebIDL interface is also added in this patch, because until it's added, any attempt to access the rule using the CSSOM would crash the browser. Depends on D178268 Differential Revision: https://phabricator.services.mozilla.com/D178270
* Further changes required by ServoOriol Brufau2023-11-241-1/+4
|
* style: [css-nesting] Do a first pass at parsing nested rules mixed with ↵Emilio Cobos Álvarez2023-11-247-173/+324
| | | | | | | | | | | | | | | | | | 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: Disable NSCAP_FEATURE_USE_BASEEmilio Cobos Álvarez2023-11-241-6/+2
| | | | | | | | | | | | This is a relatively small code size regression (130k on windows and macOS, 180k on Linux), for a few high confidence improvements in speedometer 3. See link in the bug. If this sticks, we can actually clean up a bunch of code, and eventually unify RefPtr and nsCOMPtr. But I want this to be on the tree for a while before doing more aggressive refactorings / actually removing the code. Differential Revision: https://phabricator.services.mozilla.com/D178267
* style: Remove the layout.css.named-pages.enabled prefEmily McDonough2023-11-241-6/+3
| | | | Differential Revision: https://phabricator.services.mozilla.com/D175438
* style: [css-nesting] Update cssparser againEmilio Cobos Álvarez2023-11-249-285/+278
| | | | | | | | | | | | | | | 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
* style: Finish removing HasArcFFIEmilio Cobos Álvarez2023-11-241-2/+2
| | | | | | | Use the actual Locked<T> types around (via a typedef, just for convenience). Differential Revision: https://phabricator.services.mozilla.com/D177824
* style: Refactor ImportLayer into enumCanadaHonk2023-11-213-16/+23
| | | | | | | Refactored ImportLayer into an enum instead of a struct and using Option everywhere. Differential Revision: https://phabricator.services.mozilla.com/D176793
* style: [css-nesting] Update cssparser to allow parsing qualified rules along ↵Emilio Cobos Álvarez2023-11-213-5/+26
| | | | | | | | | | 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: [css-nesting] Process nested rules at cascade data rebuildEmilio Cobos Álvarez2023-11-211-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | More nesting plumbing. Still does nothing because we don't parse the nested rules. Should be trivial to prove this patch doesn't change any behavior so far, but I want to land it on its own because it can have performance implications. This follows the pattern of what we do with other rules like layers and container conditions, that is, keep the ancestor selectors in a stack, and poke at the last one in order to replace the ancestor. This changes the behavior of replace_parent_selector as with the newer version of the spec, stuff like: div { .foo { stuff } } Should work as `div .foo`. A test is added for this case. Differential Revision: https://phabricator.services.mozilla.com/D176560
* style: [css-nesting] Add storage for nested rulesEmilio Cobos Álvarez2023-11-213-11/+43
| | | | | | | | | Allow to have a CssRules list inside a StyleRule. This only introduces the storage and serialization code for them, but we still don't parse it. Differential Revision: https://phabricator.services.mozilla.com/D176550
* Further changes required by ServoOriol Brufau2023-11-211-1/+6
|
* style: Share code to parse @import layer + supports()Emilio Cobos Álvarez2023-11-212-47/+61
| | | | | | The duplication was slightly annoying me :) Differential Revision: https://phabricator.services.mozilla.com/D176564
* style: Fix @import supports() parsing positionCanadaHonk2023-11-211-15/+15
| | | | | | | | Fixed @import supports() being parsed in the incorrect position as per spec. Also added more WPT tests for layer and supports in one @import. Differential Revision: https://phabricator.services.mozilla.com/D176193
* style: Fix @import serialization orderCanadaHonk2023-11-211-5/+5
| | | | | | | | Fixed @import serialization being out of (spec) order. Also added some more WPT tests. Differential Revision: https://phabricator.services.mozilla.com/D176182
* style: Remove cascade layers prefEmilio Cobos Álvarez2023-11-211-8/+1
| | | | | | These have been enabled by default for quite a while. Differential Revision: https://phabricator.services.mozilla.com/D175513
* Further changes required by ServoOriol Brufau2023-11-212-7/+43
|
* style: Implement supports() syntax for @import rulesCanadaHonk2023-11-214-11/+61
| | | | | | | | | | | | | | | Implemented supports conditions using supports() in @import rules as per CSS Cascading and Inheritance Level 4. Locked behind new pref, layout.css.import-supports.enabled, only enabled in nightlies in this patch. Also added new WPT tests for @import supports() generally. Spec: https://drafts.csswg.org/css-cascade-4/#conditional-import WPT tests: https://wpt.fyi/results/css/css-cascade/import-conditions.html Differential Revision: https://phabricator.services.mozilla.com/D172622
* style: Add (unused for now) parsing for support conditions in @importEmilio Cobos Álvarez2023-11-211-3/+10
| | | | | | | | | | You can use this as: input.try_parse(SupportsCondition::parse_for_import).ok() Or so. Differential Revision: https://phabricator.services.mozilla.com/D172668
* style: Convert RGBA to AbsoluteColor for computed/animated/resolved CSS colorsTiaan Louw2023-11-211-2/+5
| | | | | | | | | | | | | | 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: Use write_char in place of write_str when serializing ↵Jonathan Kew2023-11-066-17/+17
| | | | | | | | | | | | 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: Add lab(), lch(), oklab(), oklch() to specified colorsTiaan Louw2023-11-061-6/+5
| | | | | | | | | | | 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: Fix container orientation evaluationEmilio Cobos Álvarez2023-11-041-5/+11
| | | | | | | | | 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
* style: Avoid generic soup and extra reference count bumpsEmilio Cobos Álvarez2023-11-041-8/+8
| | | | | | This makes me a bit happier about the previous patch :) Differential Revision: https://phabricator.services.mozilla.com/D165236
* style: Partial fix for container units in pseudo-elementsOriol Brufau2023-11-041-12/+9
| | | | | | | | | | | | | | 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
* style: Fix elements not being query containers for the pseudo-element they ↵Oriol Brufau2023-11-041-38/+100
| | | | | | originate. r=emilio Differential Revision: https://phabricator.services.mozilla.com/D164807
* style: Lint container_rule.rsOriol Brufau2023-11-041-37/+35
| | | | | | | Just using 'rustup run nightly rustfmt'. No change in behavior. Differential Revision: https://phabricator.services.mozilla.com/D164805
* style: Re-evaluate container queries when container gets display:contentsOriol Brufau2023-11-041-2/+2
| | | | Differential Revision: https://phabricator.services.mozilla.com/D164234
* style: Evaluate size feature to unknown if the container lacks size containmentOriol Brufau2023-11-041-2/+2
| | | | | | | For example, inline elements may have container-type:size but they don't support size containment, so @container(width >= 0) shouldn't match. Differential Revision: https://phabricator.services.mozilla.com/D163936
* style: @container(width:0) shouldn't match elements with no boxOriol Brufau2023-11-041-11/+11
| | | | | | Depends on D163879 Differential Revision: https://phabricator.services.mozilla.com/D163844
* style: Make container queries check content-box sizeOriol Brufau2023-11-041-2/+2
| | | | | | | | They were checking the border-box size (with paddings and borders), but https://drafts.csswg.org/css-contain-3/#size-container says it should be the content-box size. Differential Revision: https://phabricator.services.mozilla.com/D163784
* style: Add parsing for <general-enclosed> in queries conditionsZiran Sun2023-11-041-1/+2
| | | | | | See https://drafts.csswg.org/mediaqueries-5/#typedef-general-enclosed Differential Revision: https://phabricator.services.mozilla.com/D158662
* style: Fix container query evaluation on unsupported axisEmilio Cobos Álvarez2023-11-031-33/+26
| | | | | | We were falling back to viewport size, which is not what the spec says. Differential Revision: https://phabricator.services.mozilla.com/D161132
* style: Only a single name allowed in @container ruleZiran Sun2023-11-031-5/+1
| | | | Differential Revision: https://phabricator.services.mozilla.com/D158775
* style: Simplify container-type implementationEmilio Cobos Álvarez2023-11-031-14/+14
| | | | | | | | | | | | It was made a bitfield so that we could include style. But then style containment was removed and the bitfield keeps causing us to do wrong check (since INLINE_SIZE intersects SIZE). So just make it an enum. This causes a progression and a test that failed now times out (which is a pre-existing issue, just like the pseudo-elements test that times out). Differential Revision: https://phabricator.services.mozilla.com/D160371
* style: Container Relative Units: Set flag for `USES_VIEWPORT_UNITS` only ↵David Shin2023-11-031-3/+1
| | | | | | when viewport fallback is actually used Differential Revision: https://phabricator.services.mozilla.com/D159866
* style: Allow propagating computed style bits from the selector-matching processEmilio Cobos Álvarez2023-11-031-2/+15
| | | | | | | | | | | | This allows us to propagate flags from the container query styles all the way to the computed style of the element. The flag for viewport units in container queries has to be different because it requires rematching, see comments. Depends on D159851 Differential Revision: https://phabricator.services.mozilla.com/D159852
* style: Enable lookup and computation of container size queriesDavid Shin2023-11-032-35/+283
| | | | Differential Revision: https://phabricator.services.mozilla.com/D158057
* style: Centralize construction of `computed::Context`David Shin2023-11-031-10/+4
| | | | | | For controlled construction and access of upcoming, lazily-evaluated container query size. Differential Revision: https://phabricator.services.mozilla.com/D158055