Граф коммитов

17977 Коммитов

Автор SHA1 Сообщение Дата
Boris Chiou 64846883fe Bug 1840601 - Enable preferences in layout/style/test/mochitest.ini for motion path. r=hiro
Enable the necessary preferences for motion path.

Differential Revision: https://phabricator.services.mozilla.com/D182239
2023-06-27 22:19:44 +00:00
Emilio Cobos Álvarez 3d3511bf24 Bug 1840476 - [css-properties-values-api] Custom property registration plumbing. r=zrhoffman,firefox-style-system-reviewers,webidl,saschanaz
This implements script registration and some basic validity checks so
that we start keeping track of custom properties in the CascadeData and
in script.

Differential Revision: https://phabricator.services.mozilla.com/D182110
2023-06-27 09:48:51 +00:00
Emilio Cobos Álvarez a398815dad Bug 1839950 - CSSStyleDeclaration.getPropertyValue doesn't throw. r=peterv
We fixed nsComputedDOMStyle ages ago.

Differential Revision: https://phabricator.services.mozilla.com/D181944
2023-06-27 08:21:46 +00:00
Norisz Fay 07a91b8c6a Backed out 2 changesets (bug 1838829) for causing perma mochitest failure with dom/websocket/tests being skipped CLOSED TREE
Backed out changeset 19a5d4f1850a (bug 1838829)
Backed out changeset 97cd8a256954 (bug 1838829)
2023-06-27 02:52:52 +03:00
Boris Chiou 3523b747c5 Bug 1598156 - Part 8: Support Compositor animations for all basic shapes. r=emilio,hiro
This patch sends the information of border-radius to the compositor as
well, so we can use it if offset-path uses coord-box only.

Note:
We repaint the frame if border-radius property gets changed, and rebuild
the display item. In this case, we resend the transaction of compositor
animation as well. Therefore, we don't have to block the compositor animations
if they depends on border-radius (i.e. use coord-box only).

We may need a better way to check what should we pass to the compositor,
for motion path, in Bug 1838977.

Differential Revision: https://phabricator.services.mozilla.com/D179631
2023-06-26 23:23:55 +00:00
Boris Chiou dfd2e54386 Bug 1598156 - Part 3: Remove RayReferenceData. r=emilio
I'd like to reuse the data in RayReferenceData for all basic shapes,
so unpack RayReferenceData and drop this struct.

Also, use `nsPoint` for the current position and use `nsRect` for coord-box
because we use these types (i.e. app units) in ShapeUtils.

Besides, remove the usage of Maybe from nsStyleTransformMatrix.h and
just accept the pointer of ResolvedMotionPathData to avoid including
the entire header.

No behavior change.

Differential Revision: https://phabricator.services.mozilla.com/D181008
2023-06-26 23:23:54 +00:00
Emilio Cobos Álvarez 19b74cd4e3 Bug 1839945 - [css-nesting] Properly restrict nested rules. r=zrhoffman
As per https://drafts.csswg.org/css-nesting/#conditionals only some
rules are allowed inside style rules.

Differential Revision: https://phabricator.services.mozilla.com/D181798
2023-06-26 20:36:12 +00:00
Kershaw Chang 75c68b6864 Bug 1838829 - Skip failed tests, r=necko-reviewers,extension-reviewers,credential-management-reviewers,devtools-reviewers,dimi,valentin,robwu
Differential Revision: https://phabricator.services.mozilla.com/D181251
2023-06-26 14:22:14 +00:00
Tom Schuster a0e70b744b Bug 1838415 - Introduce RFPTargets for all CSS media features. r=tjr
Differential Revision: https://phabricator.services.mozilla.com/D181247
2023-06-26 07:17:39 +00:00
Tom Schuster 04d571f1de Bug 1838415 - Introduce RFPTarget::DOMStyleOsxFontSmoothing. r=tjr
Differential Revision: https://phabricator.services.mozilla.com/D181245
2023-06-26 07:17:39 +00:00
Tom Schuster ea9dd64c2b Bug 1838415 - Introduce RFPTarget::UseStandinsForNativeColors. r=tjr
Differential Revision: https://phabricator.services.mozilla.com/D181241
2023-06-26 07:17:39 +00:00
Jan-Niklas Jaeschke 7518e2e9bc Bug 1811823, part 2: Add correct prioritization for custom highlights. r=emilio
Due to the prioritization rules for custom highlights, it is not feasible to rely on cascading.
Instead, highlights need to be stacked by their priority (and order of insertion).
Text and background color of the highest-prioritized highlight which defines that property should be used.

Since highlights are implemented as special `Selection`s, the algorithm that determines the prevailing selection for a text frame needed to be adapted to instead return a list of selections.

Differential Revision: https://phabricator.services.mozilla.com/D181143
2023-06-23 15:22:44 +00:00
Emilio Cobos Álvarez ea0c4b6272 Bug 1839420 - Make CSSStyleRule.selectorMatchesElement use the desugared selector list. r=nchevobbe,firefox-style-system-reviewers,boris
Trivial enough. This makes the test in D181732 pass.

Differential Revision: https://phabricator.services.mozilla.com/D181741
2023-06-22 22:12:49 +00:00
Emilio Cobos Álvarez 7bddcf9e5a Bug 1839223 - Remove nsMappedAttributes. r=smaug
Instead, lazily schedule evaluation of them before styling, much like we
were doing for SVG.

A subtle tweak is that we only remain scheduled while in the document.
This allows us to use the "in document" bit plus the "mapped attributes
dirty" bit to know our scheduled status. It also prevents doing silly
work for disconnected elements, and having to do hashmap lookups on
adoption and node destruction.

Differential Revision: https://phabricator.services.mozilla.com/D181549
2023-06-22 17:22:03 +00:00
Cristian Tuns 6957543e5e Backed out changeset a3e55d5f9f13 (bug 1839223) for causing multiple failures in Document.cpp CLOSED TREE 2023-06-22 11:34:15 -04:00
Emilio Cobos Álvarez 2c6de5f038 Bug 1839223 - Remove nsMappedAttributes. r=smaug
Instead, lazily schedule evaluation of them before styling, much like we
were doing for SVG.

A subtle tweak is that we only remain scheduled while in the document.
This allows us to use the "in document" bit plus the "mapped attributes
dirty" bit to know our scheduled status. It also prevents doing silly
work for disconnected elements, and having to do hashmap lookups on
adoption and node destruction.

Differential Revision: https://phabricator.services.mozilla.com/D181549
2023-06-22 14:31:16 +00:00
Emilio Cobos Álvarez 1ac45263e4 Bug 1839221 - Simplify rule to hide forms inside tables in html docs. r=jfkthame
While we're at it:

 * Hide :-moz-is-html from content. This is barely documented (a google
   search for that yields two pages mostly of our UA sheet) and unlikely
   to cause any compat impact (plus it's a one-liner to expose it if we
   needed to).

 * Make that only depend on the document state. It doesn't have any
   practical implications since we only use it on html.css which already
   has a default namespace.

 * Add some documentation on why are these pseudo-classes (rather than
   e.g., media queries).

Differential Revision: https://phabricator.services.mozilla.com/D181406
2023-06-22 11:31:44 +00:00
Tiaan Louw ce2ee22a42 Bug 1838600 - Implement the abs() function r=emilio
The abs() function resolves to the absolute value in calculations.

https://drafts.csswg.org/css-values-4/#sign-funcs

Differential Revision: https://phabricator.services.mozilla.com/D181060
2023-06-22 11:20:03 +00:00
Peter Van der Beken 36003fd793 Bug 1803752 - Make CSS2Properties getters and setters use a common generated implementation. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D181106
2023-06-22 08:12:07 +00:00
Norisz Fay e86f1fa0e9 Backed out 5 changesets (bug 1838829) for causing mochitest failures CLOSED TREE
Backed out changeset 693d34c8447d (bug 1838829)
Backed out changeset 903d9ff4afaa (bug 1838829)
Backed out changeset 5e51feff7467 (bug 1838829)
Backed out changeset e125be49d2a6 (bug 1838829)
Backed out changeset 1a8cf3c83dc4 (bug 1838829)
2023-06-22 03:37:07 +03:00
Emily McDonough f2355a52d5 Bug 1833471 Part 2 - Export @page pseudo-class flags to Gecko style code r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D178869
2023-06-21 23:37:46 +00:00
Emily McDonough 99e10c5f8a Bug 1833471 Part 1 - Implement @page pseudo-class parsing and rule handling r=emilio
This currently will not match page-rules based on any selectors with any
pseudo-classes present.

Differential Revision: https://phabricator.services.mozilla.com/D178252
2023-06-21 23:37:46 +00:00
Norisz Fay 9e2d68a917 Backed out 3 changesets (bug 1833471) for causing failures on cssom-ruleTypeAndOrder.html, page-rule-declarations-000.html
Backed out changeset 69c9504ac848 (bug 1833471)
Backed out changeset e76595d749fb (bug 1833471)
Backed out changeset fd4e99d77a6b (bug 1833471)
2023-06-22 01:01:20 +03:00
Emilio Cobos Álvarez f4a4f38cc0 Bug 1839580 - For async-parsed stylesheets, fire the load event sooner. r=smaug
This avoids one extra task hop when we finish parsing the stylesheet.

Differential Revision: https://phabricator.services.mozilla.com/D181613
2023-06-21 20:36:58 +00:00
Kershaw Chang 2cdb6b3a96 Bug 1838829 - Skip failed tests, r=necko-reviewers,extension-reviewers,credential-management-reviewers,devtools-reviewers,dimi,valentin,robwu
Differential Revision: https://phabricator.services.mozilla.com/D181251
2023-06-21 19:43:33 +00:00
Emily McDonough 332fa4dc43 Bug 1833471 Part 2 - Export @page pseudo-class flags to Gecko style code r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D178869
2023-06-21 19:02:23 +00:00
Emily McDonough a18b6d735d Bug 1833471 Part 1 - Implement @page pseudo-class parsing and rule handling r=emilio
This currently will not match page-rules based on any selectors with any
pseudo-classes present.

Differential Revision: https://phabricator.services.mozilla.com/D178252
2023-06-21 19:02:23 +00:00
Nicolas Chevobbe b15d728a25 Bug 1839168 - [devtools] Add `InspectorUtils.getAllStyleSheetCSSStyleRules` method. r=emilio.
This method returns a flat list of all the rules in a given stylesheet.
This will be helpful for DevTools so we don't have to recursively walk through
all the children rules (which is slow on the JS DevTools server).

Differential Revision: https://phabricator.services.mozilla.com/D181505
2023-06-21 18:48:39 +00:00
Norisz Fay 38a938a13c Backed out changeset dfcc0494fe8d (bug 1839580) for causing wpt and mochitest failures CLOSED TREE 2023-06-21 21:23:18 +03:00
Emilio Cobos Álvarez 02b8315b58 Bug 1839580 - For async-parsed stylesheets, fire the load event sooner. r=smaug
This avoids one extra task hop when we finish parsing the stylesheet.

Differential Revision: https://phabricator.services.mozilla.com/D181613
2023-06-21 16:01:43 +00:00
Jonathan Kew 695f595aef Bug 1839432 - Fix serialization of quoted family names for OffscreenCanvas font attribute. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D181535
2023-06-21 13:37:30 +00:00
Narcis Beleuzu 15227435c3 Backed out 3 changesets (bug 1833471) for wpt failure on page-rule-declarations-000.html . CLOSED TREE
Backed out changeset 547eef705668 (bug 1833471)
Backed out changeset e21e18f3f729 (bug 1833471)
Backed out changeset 16164bf63457 (bug 1833471)
2023-06-21 11:24:49 +03:00
Vincent Hilla 99810beb2a Bug 1708370 - adjust UA stylesheet to match spec for form rendering. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D180812
2023-06-21 07:35:34 +00:00
Emilio Cobos Álvarez 3a086ed3a7 Bug 1838627 - Refactor InspectorUtils APIs that just forward to CSSStyleRule, and expose desugared selectors on them. r=nchevobbe,webidl,firefox-style-system-reviewers,smaug,devtools-reviewers,boris
Differential Revision: https://phabricator.services.mozilla.com/D181109
2023-06-21 07:14:57 +00:00
Emily McDonough 8d5d46116d Bug 1833471 Part 2 - Export @page pseudo-class flags to Gecko style code r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D178869
2023-06-21 02:13:01 +00:00
Emily McDonough 7025ca8885 Bug 1833471 Part 1 - Implement @page pseudo-class parsing and rule handling r=emilio
This currently will not match page-rules based on any selectors with any
pseudo-classes present.

Differential Revision: https://phabricator.services.mozilla.com/D178252
2023-06-21 02:13:01 +00:00
Sandor Molnar 53e2e84520 Backed out 2 changesets (bug 1803752) for causing python mbu failures in dom/bindings/mozwebidlcodegen/test/test_mozwebidlcodegen.py CLOSED TREE
Backed out changeset 0a06638b1f49 (bug 1803752)
Backed out changeset 3e1599493e2e (bug 1803752)
2023-06-20 21:35:33 +03:00
Peter Van der Beken f1c25edf31 Bug 1803752 - Make CSS2Properties getters and setters use a common generated implementation. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D181106
2023-06-20 16:32:06 +00:00
Emilio Cobos Álvarez 1c92ed74cb Bug 1839255 - Clean up a bit the mapped attribute set-up. r=smaug
This doesn't change behavior on its own. It could be split up a bit more
if needed though over all it shouldn't be hard to follow.

Unify nsHTMLStyleSheet and nsHTMLCSSStyleSheet into AttributeStyles
because the fact that we have two right now is pretty silly. They are
also not stylesheets (they used to be pre-stylo).

Differential Revision: https://phabricator.services.mozilla.com/D181414
2023-06-20 10:02:44 +00:00
Emilio Cobos Álvarez 728853d2bb Bug 1825244 - follow-up: Move rule to html.css since now it's no longer just about forms.
Differential Revision: https://phabricator.services.mozilla.com/D181403
2023-06-19 18:31:31 +00:00
Jake Senne 9dc1566acd Bug 1825244 - Prevent interactivity in print preview window. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D176221
2023-06-19 18:11:40 +00:00
Cristina Horotan 89404a9865 Backed out changeset 24043b03134b (bug 1708370) for causing wpt failures at idlharness.https.html 2023-06-19 17:02:42 +03:00
Vincent Hilla f1298f04b8 Bug 1708370 - adjust UA stylesheet to match spec for form rendering. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D180812
2023-06-19 12:02:17 +00:00
Emilio Cobos Álvarez 91f4b5156a Bug 1803752 - Generate a dict from id to property, rather than a list in ServoCSSPropList. r=peterv
Also include the list of alias ids in the longhand and shorthands, so
that they can be looked up.

Differential Revision: https://phabricator.services.mozilla.com/D181110
2023-06-16 11:00:42 +00:00
Jonathan Kew bc3b00d427 Bug 1838658 - patch 1 - Handle the 'small-caps' variant when OffscreenCanvas is parsing and serializing the 'font' attribute. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D181147
2023-06-16 08:40:39 +00:00
Boris Chiou 4b8c77479a Bug 1837305 - Part 6: Update AnimationValue for offset-path. r=emilio
We are using NonNegative now for offset-path, so just like clip-path, we
have to make sure we don't get the negative radius for circle and ellipse,
and don't get the negative border-radius for inset. Therefore, we have to
convert the computed value into animated value when doing interpolation,
and then clamp the value to make sure it is always >= 0 when converting
it back to computed value, just like what we do for clip-path in Bug 1512883.

Also drop the normalization of SVGPathData in AnimationInfo when
preparing offset-path for compositor animations. It's useless because we
"always" do normalization in SVGPathData::animate().

Differential Revision: https://phabricator.services.mozilla.com/D180284
2023-06-15 00:04:00 +00:00
Boris Chiou 38cbd14258 Bug 1837305 - Part 4: Update OffsetPath to use BasicShape in style system. r=devtools-reviewers,emilio
We rewrite the data structure of OffsetPath to support all basic shapes.
However, We don't build the gfx::Path for basic shapes other than path()
for now because the current caching mechanism (on the main thread) doesn't
work for basic shapes. It's layout dependent.

Note:
1. Update offset-path-interpolation-006.html to make sure the start value
   and the end value have `at <position>`. `offset-path` doesn't set center
   as default for `at <position>`, so if any of the values omits the
   `at <position>`, we expect they are not interpolated in Gecko.
   This is different from Blink, they still use center as the default value
   for interpolation.
2. We still have some failures in offset-path-interpolation-006.html
   beacuse we don't clamp the negative radius/radii and the negative
   border-radius. We will handle it in the following patches.
3. We will add `<coord-box>` in the later patch.
4. Adding Deserialize and Serialize is necessary for compositor
   animations.

Differential Revision: https://phabricator.services.mozilla.com/D179627
2023-06-15 00:03:59 +00:00
Boris Chiou 8e1a7c8124 Bug 1837305 - Part 1: Rework GenericBasicShape. r=devtools-reviewers,emilio
The definition of `<basic-shape>` includes other types of basic shapes,
e.g. path(), xywh(), rect(). So we put them together to match the spec.
However, some properties only use the subset of basic shapes, so we use
the bitflags to choose the supported basic shape at the parse time.

Also, remove StyleBasicShapeType because no one uses it.

Only refactoring in this patch.

Differential Revision: https://phabricator.services.mozilla.com/D179624
2023-06-15 00:03:59 +00:00
Emilio Cobos Álvarez 31e76d13b4 Bug 1838045 - Make <link rel=stylesheet> load event scheduling saner. r=smaug
The spec asks to post a task, see html.spec.whatwg.org/#update-a-style-block

What we were doing is quite crazy. Unifying the scheduling between
<style> and <link rel=stylesheet> on the patch above causes failures on
some mochitests.

Some of them aren't really related to these and are a pre-existing bug,
see bug 1838346.

Differential Revision: https://phabricator.services.mozilla.com/D180895
2023-06-14 21:42:31 +00:00
Emilio Cobos Álvarez 7b001e69d1 Bug 1838045 - Fix load event on cached inline style sheets. r=mstange
Turns out we do fire load events on these (I thought they were only for
sheets with imports).

Simplify a bit some related code for links. Callers / observers need to
deal with SheetComplete being called sync anyways because of this:

  https://searchfox.org/mozilla-central/rev/962a843f6d96283c45162c788dc72bf217fca7df/layout/style/Loader.cpp#1873

So this removes the need for SheetLoadData to be a runnable etc.

Differential Revision: https://phabricator.services.mozilla.com/D180840
2023-06-14 21:42:31 +00:00