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
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. 🎉
Differential Revision: https://phabricator.services.mozilla.com/D171659
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
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
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
Now that we've removed nsXULScrollFrame, ScrollFrameHelper can be
subsumed under nsHTMLScrollFrame.
I want to do this before making scrollbars non-XUL.
Renaming to mozilla::ScrollFrame is left for a follow-up bug.
Differential Revision: https://phabricator.services.mozilla.com/D173063
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
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
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
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
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
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
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
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
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 🎉
Differential Revision: https://phabricator.services.mozilla.com/D172183
Starts to add part of the basic functionality for popover. Including
[1] :open & :closed CSS pseudo class
[2] showPopover(), hidePopover() and togglePopover() interfaces. Much of the
functionality is still to-do.
[3] PopoverData interface
Differential Revision: https://phabricator.services.mozilla.com/D171719
Times like NaN and infinity are now parsed and serialized correctly.
Rewrote time to use `calc_clamping_mode` instead of `was_calc` to
stop some parse-time clamping which broke these values.
Adjusted WPT test expectations, 19 newly pass 🎉
Also added a new WPT test to cover a missing edge case:
`calc(1<unit> * NaN)` -> `calc(NaN * 1<canonical_unit>)`
The very similar angle tests do this already for angle's units.
Differential Revision: https://phabricator.services.mozilla.com/D171911
Computed color values will not be in the correct format, closer to the
one specified by the author. This also means that colors accross the
code are stored now as AbsoluteColor or StyleAbsoluteColor. This allows
color space/gamut information to be available for use.
Some animation related test failures had to be changed, because colors
now has greater precision. Animated a color now causes a lot more
animation updates, which was not initially expected. See the bug for
discussion.
Differential Revision: https://phabricator.services.mozilla.com/D171021
Per the spec update, the new syntax is:
`ray() = ray( <angle> && <ray-size>? && contain? )`
And for `<ray-size>`:
"If no <ray-size> is specified it defaults to closest-side."
So `<ray-size>` is optional and we omit it if it's default value, for
serialization.
By the way, offset=* properties are supported only in Gecko, so we don't
need a servo function to check the preference.
Differential Revision: https://phabricator.services.mozilla.com/D171625
Make display: -moz-box's visibility: collapse handling switchable by its
own CSS property.
Longer term maybe we should switch the front-end away from visibility:
collapse altogether (there are some alternatives), but for now this will
allow to move the front-end to switch to modern `display: flex` while
keeping `visibility: collapse` work as in -moz-box.
Differential Revision: https://phabricator.services.mozilla.com/D171472
Also, we make it animatable but don't apply it to the motion transform and
don't run it on the compositor for now (so it works for getComputedStyle but
doesn't have rendering result).
Per spec: https://w3c.github.io/csswg-drafts/css-values/#calc-serialize,
we tweak the WPT to let calc() serialize the percentage first, and maintain
zero-valued terms, i.e. 0%. (We are doing the same thing as
offset-anchor, so it should be fine with other browsers.)
Besides, I tweak the serialization of shorthand a little bit so we match
the implementation of WebKit.
Differential Revision: https://phabricator.services.mozilla.com/D170972
* Remove some legacy appearance aliases that other engines don't
implement.
* Allow to pass with unimplemented <compat-auto> values, since per the
spec the idea of these is to get them removed, see
https://github.com/w3c/csswg-drafts/issues/8506 for the ones we don't
implement.
* Also allow the `-moz-` prefix to be implemented, because we can't
quite get rid of it (people use it to remove the <input type=number>
buttons with -moz-appearance: textfield and so on), and the
alternative is to implement a bunch of non-standard ::-webkit-
pseudo-elements.
Differential Revision: https://phabricator.services.mozilla.com/D171243