Commit graph

62 commits

Author SHA1 Message Date
roytam1
bd335d6284 Merge remote-tracking branch 'origin/tracking' into custom 2025-07-07 11:59:17 +08:00
erixreyes
f4ffb1ec16 Issue #2124 - Adjust overflow parser to handle two values 2025-07-07 11:57:59 +08:00
Francis Dominic Fajardo
9105c58a30 Issue #2045 - Part 4: Parse "revert" in property values wherever "unset" is allowed 2025-07-07 11:20:42 +08:00
Francis Dominic Fajardo
b0f0972314 Issue #2045 - Part 3: Implement cascade origin tracking to CSS parser
The CSS parser already knows the cascade origin, but it is using a different enum for storing it.
2025-07-07 11:20:23 +08:00
roytam1
b86d97747f Merge remote-tracking branch 'origin/tracking' into custom 2025-04-03 09:50:55 +08:00
Moonchild
80b30a8177 Issue #2720 - Implement two-location color stop logic.
This allows for two-location color stops (`color x% y%`) which is shorthand
for `color x%, color y%` where both colors are equal. (pct/length accepted)
See code comment for the reason it's implemented the way it is.

Resolves #2720
2025-04-03 09:44:51 +08:00
roytam1
789327be17 Merge remote-tracking branch 'origin/tracking' into custom 2025-01-23 09:39:37 +08:00
Martok
2e3953399a Issue #1765 - Follow-Up: For parsing calc() in non-hue component of hsl/a(), explicitly expect <percentage> values 2025-01-23 09:38:03 +08:00
roytam1
a57b7e6ca4 Merge remote-tracking branch 'origin/tracking' into custom 2024-07-18 22:32:59 +08:00
FranklinDM
9ad579bd35 Issue #2486 - Part 5: Fix parsing of nested layer names
This does not handle the merging of same-named layers, however.
2024-07-18 22:32:26 +08:00
FranklinDM
2fc2056be7 Issue #2486 - Part 4: Ensure layer statement rule is appended and invalid tokens are restored 2024-07-18 22:32:09 +08:00
FranklinDM
9630698d31 Issue #2486 - Part 2: Implement parser support for layer block and layer statements
This does not deal with layer specificity.
2024-07-18 22:31:34 +08:00
FranklinDM
cac56b8e77 Issue #2486 - Part 1: Initial plumbing and CSSOM support for cascade layers 2024-07-18 22:31:18 +08:00
roytam1
a30e0e7448 Merge remote-tracking branch 'origin/tracking' into custom 2024-06-11 10:15:00 +08:00
FranklinDM
2ba31f4e97 Issue #2522 - Part 2: Implement support for logical viewport units 2024-06-11 10:14:40 +08:00
FranklinDM
5c06335c5b Issue #2522 - Part 1: Alias small, large, and dynamic viewport units to base viewport 2024-06-11 10:14:27 +08:00
roytam1
9df06e86a2 layout: fix source code mojibake in nsCSSParser 2024-05-08 16:36:49 +08:00
FranklinDM
f41ad3aae5 Issue #2477 - Part 3: Logical box properties should accept auto values 2024-04-11 15:56:49 +08:00
FranklinDM
bfe76f65db Issue #2477 - Part 2: Implement shorthand properties for [margin/padding][block/inline] 2024-04-11 15:56:31 +08:00
FranklinDM
1e73f1f2d2 Issue #2477 - Part 1: Implement a separate function for parsing pair box properties
This reuses existing logic from ParseGap.
2024-04-11 15:54:36 +08:00
FranklinDM
6ae0a69ac7 Issue #1765 - Part 3: Provided token type should be used in LookForTokenType
I didn't realize this immediately after moving the code into a method. Oops.
2023-05-15 09:14:24 +08:00
FranklinDM
d678cc2c45 Issue #1765 - Part 2: Implement calc() parsing inside rgb/a() and the non-hue component of hsl/a()
This also adds a new helper method for checking the type of tokens that will be parsed after the current token, which is useful for determining the unit of values inside calc() functions.

Partially based on 8a0897d23f
2023-05-15 09:14:07 +08:00
FranklinDM
73a6dc3122 Issue #1765 - Part 1: Move ReduceNumberCalcOps struct up higher, rename IsCSSTokenCalcFunction to CSSParserImpl::IsCalcFunctionToken 2023-05-15 09:13:47 +08:00
FranklinDM
91d2b6f4cf Issue #1592 - Part 6: Allow pseudo-classes with a forgiving selector list argument to follow pseudo-elements
Pseudo-classes with a forgiving selector list argument are allowed to follow a pseudo-element, but must treat any selector that is not of the same type as invalid. It doesn't make any sense, but that's the behavior of other tainted browsers.
2023-03-24 09:12:00 +08:00
FranklinDM
92b31dd255 Issue #1592 - Part 3: Ensure only tree-abiding pseudo-elements will follow ::slotted() 2023-03-24 09:10:42 +08:00
FranklinDM
77ad970db6 Issue #1592 - Part 2: Parse ::slotted() pseudo-element as if it were a pseudo-class
- Block slot elements from being matched by ::slotted
- Ensure ::slotted() is serialized as a pseudo-element
- Add pref to control whether the pseudo-class is enabled
2023-03-24 09:07:36 +08:00
FranklinDM
ab63b7b946 Issue #1592 - Part 1c: Pass SelectorParsingFlags as a reference 2023-03-24 09:04:18 +08:00
FranklinDM
ef36c56593 Issue #2137 - Part 4: Fix namespace regression 2023-03-12 07:09:56 +08:00
FranklinDM
b257a71cce Issue #2137 - Part 3: Don't always use the internal pseudo-class for handling negations 2023-03-12 07:09:41 +08:00
FranklinDM
3bb3c193d0 Issue #2137 - Part 2: Implement SelectorParsingFlags and use it to pass info around 2023-03-12 07:09:22 +08:00
FranklinDM
82fa9fb80b Issue #2137 - Part 1: Modify :not() selector to accept a complex selector list 2023-03-12 07:09:00 +08:00
Martok
2b903a20b3 Issue #2143 - Implement CSS env() Environment Variables 2023-03-07 11:17:39 +08:00
FranklinDM
21d468ee65 Issue #2136 - Part 1: Implement CSS inset property 2023-03-06 16:27:53 +08:00
FranklinDM
439c671b26 Issue #2078 - Follow-up: Propagate combinator restriction to :is()/:where()
Based on spec discussion: https://github.com/w3c/csswg-drafts/issues/5093
2023-02-23 21:15:40 +08:00
FranklinDM
53f5905381 Issue #2078 - Follow-up: Move isForgiving check to ParsePseudoClassWithSelectorListArg 2023-02-23 21:14:58 +08:00
FranklinDM
9037d5662d Issue #1593 - Follow-up: Accept only a single selector in the argument of :host/:host-context
Current spec says these two pseudo-classes accept only a single compound selector:
:host( <compound-selector> )
:host-context( <compound-selector> )
2023-02-22 07:07:39 +08:00
FranklinDM
6d77f755da Issue #2078 - Part 6: Replace empty list head with the next non-empty list for forgiving selector lists
What happens here if aListHead is an empty selector list:
(1) next selector group is parsed and continues to the next iteration if it's empty or invalid
(2) if we're a forgiving selector list and aListHead is empty, replace it with the selector group that we've just parsed
(3) step 1 ignores invalid/empty, so we assert that step 2 should never have an empty selector list
2023-02-22 07:06:24 +08:00
FranklinDM
453b715ef6 Issue #2078 - Part 1: Update CSS rule processor to handle :is() and :where() CSS pseudo-classes
This modifies selector list parsing to accommodate being "forgiving". Aliases for the :is selector's former names were also included. Note that the older and prefixed variant `-moz-any` remains unforgiving.
2023-02-22 07:04:49 +08:00
FranklinDM
56e636d8ec Issue #2084 - Part 2: Simplify logic in CSSParserImpl::LookupKeywordPrefixAware
Based on https://bugzilla.mozilla.org/show_bug.cgi?id=1259348
2023-01-10 07:41:39 +08:00
FranklinDM
db3ce13f28 Issue #2084 - Part 1: Remove CSSUnprefixingService.js and associated code
It's effectively dead code since it's been supplanted by built-in webkit-prefixed-CSS support (landed before fork point in Firefox 49).

Based on https://bugzilla.mozilla.org/show_bug.cgi?id=1259348
2023-01-10 07:37:30 +08:00
FranklinDM
8a7587b401 Issue #21 - Remove use counters telemetry
This reverts Bug 968923 - Implement some equivalent of Chrome's use counters (on top of telemetry?)

For reference: https://bugzilla.mozilla.org/show_bug.cgi?id=968923
2022-04-28 10:43:09 +08:00
roytam1
92a1cc3139 Revert "Issue #21 - Remove use counters telemetry"
This reverts commit 8ca9db6b65.
2022-04-27 16:25:00 +08:00
FranklinDM
8ca9db6b65 Issue #21 - Remove use counters telemetry
This reverts Bug 968923 - Implement some equivalent of Chrome's use counters (on top of telemetry?)

For reference: https://bugzilla.mozilla.org/show_bug.cgi?id=968923
2022-04-27 16:15:31 +08:00
Moonchild
7c93047283 Issue #1885 - Allow unitless rootMargin entries for IntersectionObserver.
I could have done this through a CSSLoader to allow all CSS unit quirks but
I wasn't planning to start passing around document and element references
everywhere, so instead just did it manually by accepting numbers/floats in
addition to pixel and percent.
2022-04-25 20:52:00 +08:00
FranklinDM
37753e32a8 Issue #1881 - Interpret empty or whitespace root margin string as zero length
This attempts to get the first non-whitespace token, which if exists, continues with previous behavior of parsing the margin string. Otherwise, if the specified margin string is empty or consists only of whitespace characters, is interpreted as zero length.

IntersectionObserver is the only consumer of the `ParseMarginString` method, as far as I can tell, so this should not affect anything else.

Note: For some reason, Firefox and Chrome treat the unitless zero length as invalid, while with this change, we do not change existing behavior in that regard and continue to accept that value.
2022-04-25 20:51:48 +08:00
Jeremy Andrews
7472bc02be Issue #1593 - Part 1: Import William Chen's patches w/o selector implementation, fixed up. 2022-04-21 21:52:40 +08:00
roytam1
ecdf4bfb29 Revert "Issue #3024 - First pass support for :host and :host-context"
This reverts commit 4cc56c2cb6.
2022-04-21 21:51:52 +08:00
FranklinDM
e16a340a33 Issue #1838 - Follow-up: Prevent grid shorthand from resetting gutter properties
This also fixes crashing when using the grid shorthand property.
2022-04-19 22:05:56 +08:00
FranklinDM
9dc59c43f1 Issue #1370 - Part 3: Implement content keyword for flex-basis property
Partially based on https://bugzilla.mozilla.org/show_bug.cgi?id=1105111
2022-04-19 21:56:35 +08:00
FranklinDM
b4f2c83687 Issue #1838 - Part 2: Remove grid- prefix from grid-(column|row)-gap properties
This removes the `grid` prefix from the gap-related properties of grid since they are now part of the box alignment specification. Former grid-gap* properties were aliased to the unprefixed properties to maintain compatibility.

The previously multi-column layout only `column-gap` property has been modified to apply to the Grid layout (and Flexbox in a following commit), moving the `mColumnGap` member variable from `nsStyleColumn` to `nsStylePosition`.

Notes:
* Bug 1398537 - support for percent values in column-gap for multi-column layout landed as part of Issue #1230. However, it was incomplete because it did not update `nsRuleNode` to allow transformation of percentage values for `column-gap`. This was consequently fixed as part of this commit.
* Bug 1456166 - this might not apply because we don't have that devtools test in UXP
* `nsRuleNode`, `nsCSSParser`, `Declaration`, and other related classes were merged into Stylo. These should be taken into consideration when porting patches from Mozilla.

Partially based on https://bugzilla.mozilla.org/show_bug.cgi?id=1398482
2022-04-19 21:55:52 +08:00