aboutsummaryrefslogtreecommitdiffstats
path: root/components/style
Commit message (Collapse)AuthorAgeFilesLines
...
* style: Make content-visibility: auto forces contain-intrinsic-size to gain ↵Jihye Hong2023-11-242-0/+41
| | | | | | | | | | an auto value When the content having `content-visibility: auto` and the specific value for `contain-intrinsic-size` is slightly out of the viewport, its computed value keeps changing. This patch makes `content-visibilty: auto` forces `contain-intrinsic-size` to gain an auto value to solve this issue. Differential Revision: https://phabricator.services.mozilla.com/D174583
* style: Update the syntax of offset-positionBoris Chiou2023-11-247-13/+72
| | | | | | | | | | | | | | | 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
* Further changes required by ServoOriol Brufau2023-11-241-1/+6
|
* style: Simplify border snappingEmilio Cobos Álvarez2023-11-2412-98/+55
| | | | | | | | 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-2465-425/+629
| | | | | | | | $ 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-247-206/+126
| | | | | | | | | 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-243-9/+9
| | | | | | Depends on D179038 Differential Revision: https://phabricator.services.mozilla.com/D179039
* style: Correct style sharing handling for any element that considered ↵David Shin2023-11-247-5/+76
| | | | | | | | | | | | | | `: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-properties-values-api] Share PropertyRule instance when cloning ↵Zach Hoffman2023-11-241-2/+3
| | | | | | CssRule::Property Differential Revision: https://phabricator.services.mozilla.com/D178892
* style: Flush parent document layout if needed for viewport dependent media ↵Emilio Cobos Álvarez2023-11-244-5/+19
| | | | | | | | | | | queries This is necessary to properly report changes in our document. The remaining failures are about change event scheduling, which is a pre-existing issue. Will fix, but in a separate bug. Differential Revision: https://phabricator.services.mozilla.com/D178917
* style: Simplify some appearance codeEmilio Cobos Álvarez2023-11-241-10/+0
| | | | | | | | | | | | I was looking into simplifying our scrollbar styles: * StyleAppearance::Resizer is not used in content, and some of the values were only for <xul:window> which are not supported anymore. * Statusbarpanel and Resizerpanel aren't used. Statusbar is only used once on macOS so we only need to keep it there. Differential Revision: https://phabricator.services.mozilla.com/D178374
* Further changes required by ServoOriol Brufau2023-11-242-2/+8
|
* style: Make style parallel traversal more tunable at runtimeEmilio Cobos Álvarez2023-11-242-88/+89
| | | | | | | | | | | | | | | | | | This adds two prefs to configure the parallel traversal work item size and kick-off threshold, but otherwise shouldn't change behavior. I switched from iterator generics to just a slice while at it, mostly for simplicity, but there is a trade-off: * When switching from sequential to parallel traversal, we potentially pay the price of memmoving the VecDeque around once to make them a contiguous slice. * However we win in the common case of the smaller-than-work-unit size in which case we no longer need to copy stuff to a WorkItem. So I think overall this should be an improvement. Differential Revision: https://phabricator.services.mozilla.com/D178656
* Further changes required by ServoOriol Brufau2023-11-242-3/+4
|
* style: Make stylo thread pool size configurable via pref rather than just envEmilio Cobos Álvarez2023-11-241-48/+32
| | | | | | | Remove a variety of code which we don't use to change the pool size. We can just use the pref as needed in the future. Differential Revision: https://phabricator.services.mozilla.com/D178575
* style: Remove overflow-block optional-pagedCanadaHonk2023-11-241-2/+1
| | | | | | | | | | | Removed overflow-block optional-paged value and reftesting as it was removed from the spec in 2020: https://github.com/w3c/csswg-drafts/issues/5287 1 WPT subtest now newly passes. WPT tests: https://wpt.fyi/results/css/mediaqueries/test_media_queries.html Differential Revision: https://phabricator.services.mozilla.com/D178710
* Further changes required by ServoOriol Brufau2023-11-242-2/+6
|
* style: [css-properties-values-api] Implement parsing and serialization for ↵Zach Hoffman2023-11-2411-3/+310
| | | | | | | | | | | | | | @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
* style: [css-properties-values-api] Parsing and serialization for @property ↵Zach Hoffman2023-11-2412-14/+495
| | | | | | | | | | | syntax descriptor Based off of @emilio's syntax parser at <https://github.com/emilio/css-typed-om-syntax>. Co-authored-by: Emilio Cobos Álvarez <emilio@crisal.io> Differential Revision: https://phabricator.services.mozilla.com/D178268
* style: Remove code that's flagged as to-be-removed once ↵Daniel Holbert2023-11-241-14/+0
| | | | | | | | | layout.css.always-repaint-on-unvisited is true If I'm reading the code comment correctly, this is now unreachable code, and hence can & should be removed. Differential Revision: https://phabricator.services.mozilla.com/D178570
* style: Reject empty svg path string for basic shape path functionBoris Chiou2023-11-244-29/+59
| | | | | | | | | | Per CSS shape spec, the empty path string is invalid. However, for SVG d property, the EBNF allows the path data string in the d property to be empty. We just disable the rendering of the path. Note: only offset-path and clip-path are affected. Differential Revision: https://phabricator.services.mozilla.com/D178123
* 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-2411-284/+506
| | | | | | | | | | | | | | | | | | 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-244-21/+7
| | | | | | | | | | | | 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: Implement parsing for `baseline-source`David Shin2023-11-246-10/+64
| | | | Differential Revision: https://phabricator.services.mozilla.com/D173884
* style: Remove the layout.css.named-pages.enabled prefEmily McDonough2023-11-242-7/+3
| | | | Differential Revision: https://phabricator.services.mozilla.com/D175438
* style: [css-nesting] Update cssparser againEmilio Cobos Álvarez2023-11-2415-335/+335
| | | | | | | | | | | | | | | 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-242-0/+2
|
* style: Move a bit declaration_block and cascade modulesEmilio Cobos Álvarez2023-11-245-64/+90
| | | | | | | 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-246-305/+319
| | | | | | | | | | | | | | | | | | | 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: Finish removing HasArcFFIEmilio Cobos Álvarez2023-11-246-311/+147
| | | | | | | Use the actual Locked<T> types around (via a typedef, just for convenience). Differential Revision: https://phabricator.services.mozilla.com/D177824
* style: Plumb android text scale via nsLookAndFeelEmilio Cobos Álvarez2023-11-241-4/+4
| | | | | | | | That's how we do it for all other platforms. Do this rather than via a custom mostly-untested pref, which allows us to simplify text zoom handling. Differential Revision: https://phabricator.services.mozilla.com/D177062
* style: Container units should prevent us from using the rule cacheEmilio Cobos Álvarez2023-11-241-0/+3
| | | | | | | | | | | | Much like with font-relative units, when they're used for a non-inherited property we need to avoid using the rule cache. This is because two elements matching the same rules won't get guaranteed-equal non-inherited style structs. Depends on D177732 Differential Revision: https://phabricator.services.mozilla.com/D177733
* style: Clean up length handlingEmilio Cobos Álvarez2023-11-242-182/+178
| | | | | | | No behavior change, but using Self is shorter and while I'm touching this code might as well clean it up a little bit. Differential Revision: https://phabricator.services.mozilla.com/D177732
* style: Remove dead GTK menu styling codeEmilio Cobos Álvarez2023-11-242-4/+2
| | | | Differential Revision: https://phabricator.services.mozilla.com/D177369
* style: Remove HasArcFFI for AnimationValueEmilio Cobos Álvarez2023-11-243-67/+52
| | | | | | See previous patches for context. Differential Revision: https://phabricator.services.mozilla.com/D177622
* style: Remove HasArcFFI for some typesEmilio Cobos Álvarez2023-11-243-36/+40
| | | | | | | | | | See blocked bug. For non-Locked types we can just use the same underlying type at the FFI boundary. Port StylesheetContents and CssUrlData to this set-up. CssUrlData is already generated by cbindgen anyways. Differential Revision: https://phabricator.services.mozilla.com/D177559
* style: Add an API to parse an absolute length without any other contextEmilio Cobos Álvarez2023-11-241-1/+9
| | | | | | This should allow making these work on canvas. Differential Revision: https://phabricator.services.mozilla.com/D177074
* style: display: inline list-item is also a line participantEmilio Cobos Álvarez2023-11-241-1/+3
| | | | | | | | | | | | | So the line break suppression flags should be propagated through it. Otherwise ruby invariants might break, leading to a nullptr crash in this case. On debug builds the assertion was this one: https://searchfox.org/mozilla-central/rev/e6cb503ac22402421186e7488d4250cc1c5fecab/layout/generic/nsRubyBaseContainerFrame.cpp#631 Differential Revision: https://phabricator.services.mozilla.com/D177093
* style: Hardening color checksTiaan Louw2023-11-246-55/+54
| | | | | | | Avoid trying to resolve a currentcolor when a foreground color is not available. Differential Revision: https://phabricator.services.mozilla.com/D177368
* style: Remove HasFFI as wellEmilio Cobos Álvarez2023-11-212-24/+13
| | | | | | | After the previous patches we only have one trait which we should also tweak / rework, so let's put it all on that single trait. Differential Revision: https://phabricator.services.mozilla.com/D177515
* style: Remove HasSimpleFFIEmilio Cobos Álvarez2023-11-211-37/+0
| | | | | | | It's completely unsused and we don't want to use it any time soon, see bug 1831539 and related. Differential Revision: https://phabricator.services.mozilla.com/D177497
* style: Remove HasBoxFFIEmilio Cobos Álvarez2023-11-219-180/+10
| | | | | | | | | | HasBoxFFI and HasArcFFI aren't great, see bug 1831242 as for examples of why. HasArcFFI requires a bit more care, but HasBoxFFI doesn't give us much benefit. Instead use the same type in the FFI boundary. Differential Revision: https://phabricator.services.mozilla.com/D177252
* style: when iterating over a selector to find a bucket, choose the rightmostEmilio Cobos Álvarez2023-11-211-1/+8
| | | | | | | | | This restores the pre-regression behavior by choosing the later class in cases where folks use stuff like `.foo.bar`. This matches other browsers too. Differential Revision: https://phabricator.services.mozilla.com/D177398
* style: Support self keyword for scroll()Boris Chiou2023-11-211-1/+3
| | | | | | | | `self` keyword specifies to use the element’s own principal box as the scroll container. If the principal box is not a scroll container, then the scroll progress timeline is inactive. Differential Revision: https://phabricator.services.mozilla.com/D175707
* style: Update the syntax of scroll() to accept <scroller> and <axis> in any ↵Boris Chiou2023-11-211-7/+21
| | | | | | | | | order The order of <scroller> and <axis> doesn't matter in the parser. However, we serialize <scroller> first, if it is not the initial value. Differential Revision: https://phabricator.services.mozilla.com/D173906
* style: Rework -x-text-zoom to allow disabling text zoom and min-font-size ↵Emilio Cobos Álvarez2023-11-2110-65/+46
| | | | | | | | | | | | | | 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: Add negate node to use in place of mul_by in sum nodesTiaan Louw2023-11-212-28/+163
| | | | | | | | | Sum nodes would use mul_by to negate nodes to do subtraction, but some nodes are not distributive. This patch adds a negate node, so that the operations inside these negate nodes can be resolved first and then the "subtraction" can be applied. Differential Revision: https://phabricator.services.mozilla.com/D172941
* style: Add animation-timeline: view() in style systemBoris Chiou2023-11-213-49/+182
| | | | | | | | | | | | | | | | Support view() notation for animation-timeline: `<view()> = view( [ <axis> || <'view-timeline-inset'> ]? )` We move AnimationTimeline and its related types into the generics folder, and define two new structs for scroll() and view(). Note: 1. The syntax of scroll() doesn't match the current version of the spec. I will update it in Bug 1814444. 2. We will handle the creation/usage of the Anonymous View Progress Timelines in the next patch. Differential Revision: https://phabricator.services.mozilla.com/D173904