aboutsummaryrefslogtreecommitdiffstats
path: root/components/style
Commit message (Collapse)AuthorAgeFilesLines
...
* Further changes required by ServoOriol Brufau2023-11-211-0/+1
|
* style: Move animation-related values from box.rs/ui.rs to animation.rsBoris Chiou2023-11-2111-478/+517
| | | | | | | | | | | | Although we store animation and transition style values in StyleUIReset and define their properties in longhands/ui.mako.rs, but we may move them in the future if this style struct becomes too large. So let's move the definition of their values to an independent module, animation, so we don't have to worry about this again. This patch doesn't change any other things. Only move code. Differential Revision: https://phabricator.services.mozilla.com/D173903
* style: Refactor ImportLayer into enumCanadaHonk2023-11-214-18/+28
| | | | | | | Refactored ImportLayer into an enum instead of a struct and using Option everywhere. Differential Revision: https://phabricator.services.mozilla.com/D176793
* style: Serialize NaN and infinity percentages correctlyCanadaHonk2023-11-213-5/+18
| | | | | | | | | NaN and infinity percentages are now serialized as expected. Also added some new WPT tests as percentages were previously untested and added some spec comments to previous NaN/inf serialization code. Differential Revision: https://phabricator.services.mozilla.com/D176726
* style: [css-nesting] Update cssparser to allow parsing qualified rules along ↵Emilio Cobos Álvarez2023-11-216-21/+72
| | | | | | | | | | 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-212-18/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | 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-214-11/+53
| | | | | | | | | 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
* style: Enable all math functions on chrome codeEmilio Cobos Álvarez2023-11-218-12/+15
| | | | | | | | | They should be stable. Not sure this is worth writing a test for since the idea is that this code goes away eventually. Differential Revision: https://phabricator.services.mozilla.com/D176680
* 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: Use more non-native rendering of menusEmilio Cobos Álvarez2023-11-211-5/+3
| | | | | | | | | | | This makes our menus closer to GTK4, and depends less on the native menu rendering etc. Thunderbird already does this to some extent. Leave the old code behind a pref for now (just in case). Also fix some code in nsNativeTheme::GetContentState (fixes rendering of radio menu items). Differential Revision: https://phabricator.services.mozilla.com/D175664
* 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: Replace popover's ':open' and ':closed' pseudo-classes with ↵Mirko Brodesser2023-11-213-5/+3
| | | | | | | | ':popover-open' See https://github.com/whatwg/html/pull/9077. Differential Revision: https://phabricator.services.mozilla.com/D175223
* style: Remove cascade layers prefEmilio Cobos Álvarez2023-11-212-17/+2
| | | | | | 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
* Further changes required by ServoOriol Brufau2023-11-211-1/+1
|
* style: Allow to use ThinVec/nsTArray in the style crateEmilio Cobos Álvarez2023-11-214-48/+22
| | | | | | | This allows to clean-up the previous patches by using a single ThinVec (which stores length / capacity along with the allocation). Differential Revision: https://phabricator.services.mozilla.com/D175029
* style: Accept a comma-separated list of language codes in the :lang() pseudoJonathan Kew2023-11-212-15/+48
| | | | | | | | | This is the other extension to the :lang() pseudo-class in Selectors-4. (Also supported in Safari.) Depends on D174999 Differential Revision: https://phabricator.services.mozilla.com/D175000
* style: Implement inverted-colors media featureCanadaHonk2023-11-212-1/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | Implemented the inverted-colors media feature from Media Queries Level 5 for all platforms. Spec: https://drafts.csswg.org/mediaqueries-5/#inverted Platform specific implementations: - Windows: Checks system color filter setting, and if it is inverted (note: Windows does not live update due to having to read a reg key) - Mac: Checks dedicated inverted accessibility system setting - Android: Checks dedicated inverted system setting - Linux: No GTK API exposes anything like it so always none Locked behind new pref `layout.css.inverted-colors.enabled`, always off by default for now. Also added new WPT tests (none previously). Other browsers: - WebKit: shipped since Safari 9.1 (Jan 2017) - Blink: no signal Test page: https://goose.icu/inverted-colors Differential Revision: https://phabricator.services.mozilla.com/D173201
* style: Simplify NAC setupEmilio Cobos Álvarez2023-11-216-112/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | Make all UA widgets also NAC. Keep the UA widget flag but break at anonymous subtree boundaries, so that only nodes inside the UA widget directly (and not NAC from those) get the flag. This is important because two callers depend on this difference: * The style system, since we still want to match content rules from stylesheets in the UA widget. We also match user rules, which is a bit sketchy, but that was the previous behavior, will file a follow-up for that. * The reflector code, since we want the scope for UA widgets to not include the NAC nodes inside that UA widget. nsINode::IsInUAWidget got it wrong. After this patch, ChromeOnlyAccess is equivalent to IsInNativeAnonymousSubtree, so we should probably unify the naming. That's left for a follow-up patch because I don't have a strong preference. Differential Revision: https://phabricator.services.mozilla.com/D174310
* style: Fix some spec linksEmilio Cobos Álvarez2023-11-211-15/+14
| | | | | | Trivial, comment-only Differential Revision: https://phabricator.services.mozilla.com/D174474
* style: Update bindgen to 0.64Mike Hommey2023-11-211-1/+1
| | | | Differential Revision: https://phabricator.services.mozilla.com/D174054
* style: Remove a bunch of now completely dead XUL layout codeEmilio Cobos Álvarez2023-11-212-35/+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: Implement scripting media featureCanadaHonk2023-11-211-1/+33
| | | | | | | | | | | | | | | Implemented the scripting media feature. Not locked behind a pref as it does not do anything new or particularly give new data which could be used for fingerprinting (see <noscript>, etc). Also added new WPT tests (none previously). Not supported in any other browsers yet. Test page: https://goose.icu/media-scripting Differential Revision: https://phabricator.services.mozilla.com/D172995
* style: CSS comp funcs should handle NaN contagiouslyCanadaHonk2023-11-211-0/+16
| | | | | | | | | If NaN is given as any input to CSS comp funcs (min/max/clamp), it should return NaN. Does not cover simplification (see Bug 1820412). Adjusted WPT test expectations, 18 newly pass. :tada: Differential Revision: https://phabricator.services.mozilla.com/D171659
* 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: Restyle pseudo-elements as well on part attribute changesEmilio Cobos Álvarez2023-11-216-177/+129
| | | | | | | | Refactor a bit the code to unify how we deal with this conditional restyling (we had similar code for MustCascadeChildrenIfInheritResetStyle). Differential Revision: https://phabricator.services.mozilla.com/D172890
* style: Minor clean ups on top of the previous patchEmilio Cobos Álvarez2023-11-211-140/+41
| | | | | | | Remove now dead Mul implementations. Use Self rather than the whole type to shrink a bit the code. Differential Revision: https://phabricator.services.mozilla.com/D173143
* style: Refactor mul_by fn into map fnTiaan Louw2023-11-214-38/+146
| | | | | | | Refactor the mul_by function on leafs into a more generic map function that can be used for more operations like abs, signum and mul. Differential Revision: https://phabricator.services.mozilla.com/D172936
* style: Use auto as the initial value for view-timeline-insetBoris Chiou2023-11-213-14/+10
| | | | | | | 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: Update UA stylesheet for popoverCathie Chen2023-11-212-3/+8
| | | | Differential Revision: https://phabricator.services.mozilla.com/D172700
* 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
* style: Optimize [id=foo] as #foo in querySelector/AllEmilio Cobos Álvarez2023-11-212-63/+93
| | | | | | | | This page seems to rely on this optimization being present. Optimizing it is straight-forward. Why do they do that instead of using the #foo syntax? Who knows. Differential Revision: https://phabricator.services.mozilla.com/D173148
* style: Check that the lowercase attribute is different before trying to track itZach Hoffman2023-11-211-3/+7
| | | | Differential Revision: https://phabricator.services.mozilla.com/D173112
* style: Color interpolation takes none keyword into accountTiaan Louw2023-11-213-69/+174
| | | | | | | | | Now that the none keyword is available, we can take it into account when interpolating colors following the rules from the spec here: https://drafts.csswg.org/css-color-4/#interpolation-missing Differential Revision: https://phabricator.services.mozilla.com/D172666
* Further changes required by ServoOriol Brufau2023-11-211-5/+5
|
* style: Allow 'none' keyword in color componentsTiaan Louw2023-11-213-71/+263
| | | | | | | | | | | | Make use of the new changes in the cssparser that allows 'none' keywords in color components where allowed. We store the none values as 0.0 (as per the spec) and mark the components with the flags. This way we don't have to check anything on the components before doing calculations. As this is the last part intended to be released for the new [color-4] changes, I've also enabled the changes on nightly. Differential Revision: https://phabricator.services.mozilla.com/D170208
* 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
* Further changes required by ServoOriol Brufau2023-11-211-0/+1
|
* style: Record attribute dependencies within the selector list of ↵Zach Hoffman2023-11-214-12/+174
| | | | | | | | | | | | | | | | | | | | :nth-child(... of <selector list>) There are separate filters for IDs, classes, attribute local names, and element state. Also, we invalidate siblings of elements matched against the selector list of :nth-child(... of <selector list>) by marking matched elements with NODE_HAS_SLOW_SELECTOR_NTH_OF. The only remaining invalidation case invalidation case is `:nth-child(An+B of :has())` (bug 1818155), which should not block shipping `layout.css.nth-child-of.enabled`, because :has(...) is still being implemented (bug 418039). Depends on D172352 Differential Revision: https://phabricator.services.mozilla.com/D171936
* style: Apply selector flags to the shadow rootZach Hoffman2023-11-212-7/+23
| | | | | | | | | | | | Because restyle events cannot be posted for non-element nodes like the shadow root, a child's siblings are restyled directly if its parent has NODE_HAS_SLOW_SELECTOR or NODE_HAS_SLOW_SELECTOR_LATER_SIBLINGS but that parent is the shadow root. Drive-by, but braces were also added to some single-line "if" statements in RestyleManager. Differential Revision: https://phabricator.services.mozilla.com/D172352
* style: Support rendering content: <gradient> imagesEmilio Cobos Álvarez2023-11-213-20/+16
| | | | | | We implemented support for list-style-image anyways. Differential Revision: https://phabricator.services.mozilla.com/D172343
* style: Implement prefers-reduced-transparency media queryCanadaHonk2023-11-212-1/+39
| | | | | | | | | | | | | | | | | | | Implemented the prefers-reduced-transparency media query for all platforms. Windows and Mac have specific settings which are used, others (Android and Linux/GTK) have it enabled if prefers-reduced-motion is also enabled as there is no dedicated setting to check. Locked behind new pref `layout.css.prefers-reduced-transparency.enabled`, off by default always for now. Also added new WPT tests (none previously). Demo video: https://goose.icu/firefox_prt.mp4 Test page: https://goose.icu/prefers-reduced-transparency Differential Revision: https://phabricator.services.mozilla.com/D172424
* style: Simplify/remove a couple other length operationsEmilio Cobos Álvarez2023-11-211-34/+5
| | | | Differential Revision: https://phabricator.services.mozilla.com/D172430
* style: Fix a couple minor issues with the previous patchEmilio Cobos Álvarez2023-11-212-20/+2
| | | | | | | Having unused imports and undocumented functions trigger warnings that don't build in automation. Differential Revision: https://phabricator.services.mozilla.com/D172429
* style: Serialize NaN and infinity lengthsCanadaHonk2023-11-212-32/+104
| | | | | | | | | | Lengths using NaN and infinity are now serialized properly with some improvements to computed values as well. Also added a few minor new relevant WPT tests. 35 WPT tests newly pass :tada: Differential Revision: https://phabricator.services.mozilla.com/D172183