Commit Graph

45 Commits

Author SHA1 Message Date
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 https://github.com/roytam1/UXP/commit/8a0897d23f5b51526f8a2c6ef63cb26968e6b985
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
Matt A. Tobin 4cc56c2cb6 Issue #3024 - First pass support for :host and :host-context 2022-03-22 22:57:05 +08:00
Jeremy Andrews d1a537b9cf Issue #1776 - Support detecting bool preferences in chrome stylesheets
This functionality was already added to Gecko for UA stylesheets allow the "dom.details_element.enabled" preference to work. I changed the condition to allow bool preferences to be used in chrome stylesheets as well.
2021-06-24 11:05:21 +08:00
athenian200 9f00ec1dfe Issue #1647 - Followup: Remove excessive VARIANT_OPACITY statements.
I got very anxious about making sure I included VARIANT_OPACITY in all the places VARIANT_NUMBER was included to make sure it couldn't possibly break unexpectedly, and that led to me accidentally breaking a mechanism that prevented percentages from serializing as numbers in other parts of the code. It was a total accident, and these additions were unnecessary. Basically, the situation is that there was one part of the code where it determines what's allowed for the flex statement (and possibly other statements) by checking whether it got stored as a "number", and basically only disallows percentages if it attempted to store/serialize them as percentages.

However, it only got to that part of the code because I accidentally allowed VARIANT_OPACITY as a valid way for certain tokens to parse where it wasn't necessary. If it tries to parse it that way under very specific circumstances... percentages will be marked valid and fed through the system as numbers rather than being rejected and not serialized at all, because the check to disallow percentages there relied on them being stored as percentages.

It's a really weird thing to have a problem with in a lot of ways, because if percentages aren't allowed in a field, you would think people wouldn't try to use them there, much less depend on the broken behavior that results from them not parsing as a related value.
2020-10-02 17:19:56 +08:00
Moonchild 30df895eb2 Issue #1656 - Part 3: Nuke more vim config lines in the tree.
Another S&R run with some smarter matching.
2020-09-25 22:04:17 +08:00
athenian200 fb8d9b8c78 Issue #1647 - Part 2: Implement VARIANT_OPACITY to correctly serialize.
Even though percentages are already treated as floats internally by the style system for computation purposes, you have to go out of your way to stop them from being read back out as percentages. What I do here amounts to storing the percentage token in the "wrong" container, the one normally used for floats. This allows a value that was read in as a percentage to be read back out as something else, which is normally prevented by the design of the style system.
2020-09-18 20:53:45 +08:00
wolfbeast cda9951c24 [CSS] Add stub for font-variation-settings
This stub is added because websites insist on considering this
very hardware-dependent and O.S.-variable low-level font-control
as a "critical feature" which it isn't as there is 0 guarantee
that font variation settings are supported or honored by any
operating system used by the client.

On top this is a WD status feature that sites shouldn't be using, and
the feature itself is strongly discouraged for use in favor of standard
CSS font manipulation keywords like `font-weight`.
2020-02-13 07:17:37 +08:00
yami b5376e63c5 issue #908 - implement missing parts of CSS mask 2019-02-16 00:27:53 +08:00
wolfbeast f09b84deb0 Make MAX_CSS_VAR_LENGTH unsigned to avoid warnings.
Follow-up for #891. Tag #457.
2019-02-16 00:23:53 +08:00
wolfbeast 528de62070 Limit the CSS string length for resolved variables to sane values.
This resolves #891
2019-02-16 00:20:50 +08:00
janekptacijarabaci 66276efa0a [draft] CSS - linear-gradient - zero (0) angle value without degree unit is not correctly interpreted 2019-02-15 23:36:11 +08:00
janekptacijarabaci 622832ae39 CSS - Grid - fit-content unexpectedly reserves space for full clamp size in repeat() 2019-02-15 23:36:09 +08:00
roytam1 dcd9973243 import FIREFOX_52_6_0esr_RELEASE from mozilla-esr52 hg repo 2018-01-19 03:59:58 +08:00