Commit Graph
70 Commits
Author SHA1 Message Date
Emilio Cobos Álvarez dced783049 Bug 2036647 - Allow extension themes to use CSS gradients. r=desktop-theme-reviewers,extension-reviewers,firefox-style-system-reviewers,layout-reviewers,dao,jwatt,willdurand
And use this for Alpenglow. Note that I had to allow configuring
background-size too.

Differential Revision: https://phabricator.services.mozilla.com/D301050
2026-06-04 18:17:47 +00:00
Boris Chiou 87e342df40 Bug 2016879 - Add the parser for view timeline inset if it is a UTF8String. r=firefox-style-system-reviewers,emilio,webidl
We should parse the inset value as `<view-timeline-inset>`, just same as
the CSS property, if the input is a UTF8String.

Differential Revision: https://phabricator.services.mozilla.com/D301986
2026-05-28 01:22:49 +00:00
Sylvestre Ledru 55481ac4b5 Bug 2023419 - Remove Emacs/Vim modelines from layout/ r=emilio,firefox-style-system-reviewers,layout-reviewers
replaced by .editorconfig

Differential Revision: https://phabricator.services.mozilla.com/D287852
2026-03-17 12:05:43 +00:00
Kagami Sascha Rosylight ddddc40e0f Bug 1919718 - Part 1: Implement HTMLInputElement.colorSpace r=emilio,webidl,firefox-style-system-reviewers
Skipping the picker part for now, as we don't support wide color gamut yet. Color mapping doesn't work either because of how the picker element is implemented - it's using white-and-black-to-transparent linear-gradient on top of the solid color.

Differential Revision: https://phabricator.services.mozilla.com/D277905
2026-01-16 16:41:05 +00:00
agoloman a05a9aa240 Revert "Bug 1919718 - Part 3: Update color on AfterSetAttr and add tests r=emilio" for causing reftest failures @transformations-1.html.
This reverts commit ff457f98ed.

Revert "Bug 1919718 - Part 2: Implement HTMLInputElement.alpha r=emilio,webidl,firefox-style-system-reviewers,layout-reviewers"

This reverts commit 7a1ca0d962.

Revert "Bug 1919718 - Part 1: Implement HTMLInputElement.colorSpace r=emilio,webidl,firefox-style-system-reviewers"

This reverts commit 609b28f052.
2026-01-15 20:18:20 +00:00
Kagami Sascha Rosylight 609b28f052 Bug 1919718 - Part 1: Implement HTMLInputElement.colorSpace r=emilio,webidl,firefox-style-system-reviewers
Skipping the picker part for now, as we don't support wide color gamut yet. Color mapping doesn't work either because of how the picker element is implemented - it's using white-and-black-to-transparent linear-gradient on top of the solid color.

Differential Revision: https://phabricator.services.mozilla.com/D277905
2026-01-15 18:56:57 +00:00
Jan Varga af94611fd2 Bug 1998896 - Rename AnimatedPropertyID to CSSPropertyId; r=emilio,firefox-style-system-reviewers
This patch renames AnimatedPropertyID to CSSPropertyId and updates all uses
accordingly. No behavior changes intended.

AnimatedPropertyID has long served as the general property identifier,
covering both non custom and custom properties. The name is currently
misleading.

Potential follow-ups:
- Rename AnimatedPropertyIDSet

Differential Revision: https://phabricator.services.mozilla.com/D271750
2025-11-15 02:19:19 +00:00
Jan Varga b314d21751 Bug 1998365 - Rename nsCSSPropertyID to NonCustomCSSPropertyId and normalize ID naming; r=emilio,firefox-style-system-reviewers,layout-reviewers
nsCSSPropertyID only enumerates non custom properties, but the name suggests
otherwise. (eCSSPropertyExtra_variable only signals a custom property and does
not carry the custom name.) This mismatch has been confusing and also blocks
renaming AnimatedPropertyID to CSSPropertyId.

This patch renames nsCSSPropertyID to NonCustomCSSPropertyId to make the non
custom scope explicit. It also normalizes identifier naming (aPropID ->
aPropId, mID -> mId, etc.) for consistency.

No behavior changes intended.

Potential follow-ups:
- Move the enum to the mozilla namespace.
- Convert the enum to an enum class.
- Rename nsCSSPropertyIDSet.

Differential Revision: https://phabricator.services.mozilla.com/D271443
2025-11-12 06:11:29 +00:00
Henri Sivonen b1685935b1 Bug 1968903 - Avoid creating script and CSS loaders for documents loaded as data. r=firefox-style-system-reviewers,emilio,layout-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D264779
2025-10-20 15:49:01 +00:00
Cristina Horotan f21b53b704 Revert "Bug 1968903 - Avoid creating script and CSS loaders for documents loaded as data. r=firefox-style-system-reviewers,emilio,layout-reviewers" for causing bug 1991800
This reverts commit 6cbdfe15a0.
2025-10-01 07:15:03 +00:00
Henri Sivonen 6cbdfe15a0 Bug 1968903 - Avoid creating script and CSS loaders for documents loaded as data. r=firefox-style-system-reviewers,emilio,layout-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D264779
2025-09-30 10:27:43 +00:00
agoloman 0a11d7413f Revert "Bug 1968903 - Avoid creating script and CSS loaders for documents loaded as data. r=firefox-style-system-reviewers,emilio,layout-reviewers" for causing multiple wpt failures.
This reverts commit f83cb28789.
2025-09-30 09:25:22 +00:00
Henri Sivonen f83cb28789 Bug 1968903 - Avoid creating script and CSS loaders for documents loaded as data. r=firefox-style-system-reviewers,emilio,layout-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D264779
2025-09-30 07:45:53 +00:00
Kagami Sascha Rosylight bf673891ce Bug 1965029 - Accept CSS color syntax in input type=color r=emilio
The alpha and colorspace part of the https://html.spec.whatwg.org/#serialize-a-color-well-control-color is largely skipped in this patch, as we don't support them yet in `<input type=color>`, and thus the value is always in the "HTML compatible" form.

Changing the existing WPT color.tentative.html to color.html to specifically cover implementations without `alpha` and `colorspace` support, because otherwise reading the test result of `color.window.js` is overly confusing. (Ideally the two tests should share the same test data, but for now I'm skipping that as I'm not confident yet to fill the display-p3 fields. That can be done when we actually implement `colorspace` support.)

Introducing Servo_ComputeColorWellControlColor so that the colorspace conversion can happen before losing number precision, following the spec.

Differential Revision: https://phabricator.services.mozilla.com/D258654
2025-07-31 22:45:43 +00:00
Cristina Horotan 89e73abd8b Revert "Bug 1965029 - Accept CSS color syntax in input type=color r=emilio" for causing mochitest failures on test_input_color_picker_datalist.html
This reverts commit f360400c29.
2025-07-30 18:24:12 +00:00
Kagami Sascha Rosylight f360400c29 Bug 1965029 - Accept CSS color syntax in input type=color r=emilio
The alpha and colorspace part of the https://html.spec.whatwg.org/#serialize-a-color-well-control-color is largely skipped in this patch, as we don't support them yet in `<input type=color>`, and thus the value is always in the "HTML compatible" form.

Changing the existing WPT color.tentative.html to color.html to specifically cover implementations without `alpha` and `colorspace` support, because otherwise reading the test result of `color.window.js` is overly confusing. (Ideally the two tests should share the same test data, but for now I'm skipping that as I'm not confident yet to fill the display-p3 fields. That can be done when we actually implement `colorspace` support.)

Introducing Servo_ComputeColorWellControlColor so that the colorspace conversion can happen before losing number precision, following the spec.

Differential Revision: https://phabricator.services.mozilla.com/D258654
2025-07-30 16:55:30 +00:00
Tiaan Louw 880b676126 Bug 1815186 - Add ColorTo to InspectorUtils to convert color to other color spaces. r=emilio,layout-reviewers,supply-chain-reviewers
This will allow calling InspectorUtils.ColorTo("red", "lab") and
receive {color: "lab(54.3 80.8 69.9)", components: [54.3, 80.8, 69.9, 1.0], adjusted: false}.

The adjusted value is always "false", because gamut checking and mapping
is not supported at the moment. See:
https://bugzilla.mozilla.org/show_bug.cgi?id=1823363

Depends on D192673

Differential Revision: https://phabricator.services.mozilla.com/D169942
2024-02-26 14:55:01 +00:00
cc6095536c Bug 1846516 - [css-properties-values-api] Use AnimatedPropertyID to communicate between Gecko and Servo. r=emilio,layout-reviewers,firefox-style-system-reviewers
Co-authored-by: Frederic Wang <[email protected]>
Co-authored-by: Emilio Cobos Álvarez <[email protected]>

Depends on D191059

Differential Revision: https://phabricator.services.mozilla.com/D191322
2023-12-18 09:24:08 +00:00
Zach Hoffman 8cf28aa08b Bug 1844295 - Don't duplicate ParsingMode in rust and C++. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D184409
2023-07-25 10:00:59 +00:00
Jonathan Kew 8534e006a7 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
Butkovits Atila 30bc067c96 Backed out changeset ab9f3266184b (bug 1815186) for causing failures at test_color_to.html. 2023-05-22 23:29:17 +03:00
Tiaan Louw 2b549f2962 Bug 1815186 - Add ColorTo to InspectorUtils to convert color to other color spaces. r=emilio,layout-reviewers,supply-chain-reviewers
This will allow calling `InspectorUtils.ColorTo("red", "lab")` and
receive `{color: "lab(54.3 80.8 69.9)", components: [54.3, 80.8, 69.9, 1.0], adjusted: false}`.

The adjusted value is always "false", because gamut checking and mapping
is not supported at the moment. See:
https://bugzilla.mozilla.org/show_bug.cgi?id=1823363

Differential Revision: https://phabricator.services.mozilla.com/D169942
2023-05-22 17:19:14 +00:00
Emilio Cobos Álvarez 057cadb272 Bug 1832173 - Finish removing HasArcFFI. r=boris
Use the actual Locked<T> types around (via a typedef, just for
convenience).

Differential Revision: https://phabricator.services.mozilla.com/D177824
2023-05-12 22:31:38 +00:00
Butkovits Atila 1f06787277 Backed out changeset f6e3d050b3e7 (bug 1832173) for causing bustages at CanvasRenderingContext2D.cpp. CLOSED TREE 2023-05-13 01:16:03 +03:00
Emilio Cobos Álvarez 5c9b936c47 Bug 1832173 - Finish removing HasArcFFI. r=boris
Use the actual Locked<T> types around (via a typedef, just for
convenience).

Differential Revision: https://phabricator.services.mozilla.com/D177824
2023-05-12 21:37:19 +00:00
Emilio Cobos Álvarez 79e2754796 Bug 1831539 - Remove HasBoxFFI. r=boris
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
2023-05-09 11:07:26 +00:00
Emilio Cobos Álvarez 81a58c8271 Bug 1781140 - Remove nsTimingFunction and ComputedTimingFunction. r=dshin
They're simple wrappers of StyleComputedTimingFunction so we can remove
them.

Differential Revision: https://phabricator.services.mozilla.com/D152700
2022-07-26 14:49:02 +00:00
Emilio Cobos Álvarez b5ae64557f Bug 1778199 - Simplify ServoCSSParser::GetURLExtraData. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D151056
2022-07-05 19:40:14 +00:00
Emilio Cobos Álvarez 42a711655b Bug 1773558 - Move fixed-point font types to Rust. r=layout-reviewers,jfkthame
Now that cbindgen and rust support const generics, it seems more simple.

This centralizes all the relevant font constants etc in rust and avoids
conversions when going from rust to C++ and vice versa.

Differential Revision: https://phabricator.services.mozilla.com/D148847
2022-06-13 00:59:23 +00:00
Noemi Erli fbf29a9961 Backed out changeset 7585591a9bad (bug 1773558) for causing failures in system-fonts.html 2022-06-12 19:02:33 +03:00
Emilio Cobos Álvarez 152643ec11 Bug 1773558 - Move fixed-point font types to Rust. r=layout-reviewers,jfkthame
Now that cbindgen and rust support const generics, it seems more simple.

This centralizes all the relevant font constants etc in rust and avoids
conversions when going from rust to C++ and vice versa.

Differential Revision: https://phabricator.services.mozilla.com/D148847
2022-06-12 10:48:58 +00:00
Emilio Cobos Álvarez 14996b799b Bug 1343919 - Fix base URI in KeyframeEffect. r=birtles
This is the only meaningful consumer of
ServoCSSParser::GetParsingEnvironment right now, but seems worth fixing
before other folks add more.

Differential Revision: https://phabricator.services.mozilla.com/D148145
2022-06-04 12:49:12 +00:00
Emilio Cobos Álvarez 387195f2a9 Bug 1759686 - Extend part 4 to resolve keyword sizes correctly, and reuse existing code to turning lengths into absolute pixels. r=jfkthame
I think it doesn't make sense to support em/percentages without
supporting smaller/bigger/other font-relative things.

I have many questions about how other units like viewport-units etc are
supposed to behave. Blink seems to resolve viewport units to zero:

  https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/css/resolver/font_style_resolver.cc;l=15-27;drc=5e62802ab420dc1743a1824ec4b537a730b2b24b

Which might be reasonable, but I think keeping a simple model consistent
with what other code like DOMMatrix does seems better for now.

Differential Revision: https://phabricator.services.mozilla.com/D144455
2022-05-03 12:39:10 +00:00
Jonathan Kew ea3b948183 Bug 1759686 - patch 4 - Extend ServoCSSParser::ParseFontShorthandForMatching to (optionally) return font size in addition to family/style. r=emilio
When running in a Worker, the canvas2d SetFontInternal method can't call GetFontStyleForServo
because it doesn't have a canvasElement or presShell to pass. But we can use the method
ServoCSSParser::ParseFontShorthandForMatching to parse the canvas 'font' property, if we
extend it so as to also return the size from the font shorthand.

(This is incomplete by itself; Emilio's following patch fixes it up, so the intention is to land them together.)

Depends on D144186

Differential Revision: https://phabricator.services.mozilla.com/D144187
2022-05-03 12:39:09 +00:00
Emilio Cobos Álvarez 8b7d1120ed Bug 1716045 - Unify font-family storage. r=mats,jfkthame
This changes font-family storage to reuse the rust types, removing a
bunch of code while at it. This allows us to, for example, use a single
static font family for -moz-bullet and clone it, rather than creating a
lot of expensive copies.

Differential Revision: https://phabricator.services.mozilla.com/D118011
2021-06-18 19:35:50 +00:00
Emilio Cobos Álvarez fe2b95e111 Bug 1682003 - Avoid UTF-8 -> UTF-16 conversion during CSSOM serialization. r=heycam
This lifts a bunch of string conversions higher up the stack, but allows
us to make the servo code use utf-8 unconditionally, and seemed faster
in my benchmarking (see comment 0).

It should also make a bunch of attribute setters faster too (like
setting .cssText), now that we use UTF8String for them (we couldn't
because we couldn't specify different string types for the getter and
setters).

Differential Revision: https://phabricator.services.mozilla.com/D99590
2020-12-17 14:04:35 +00:00
Hiroyuki Ikezoe 1919f52df1 Bug 1676062 - Use a dummy URL data in Servo_ParseEasing and drop Document* and URLExtraData* arguments from relevant functions. r=boris
Differential Revision: https://phabricator.services.mozilla.com/D96791
2020-11-12 20:34:01 +00:00
Emilio Cobos Álvarez b04596dcdf Bug 1665816 - CSSOM should respect rule-level property restrictions. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D90729
2020-09-21 09:57:46 +00:00
Emilio Cobos Álvarez 19dea3309c Bug 1607006 - Remove utf-16 versions of nsCSSProps::LookupProperty* and ServoCSSParser::ComputeColor. r=bzbarsky
Now that we have UTF8String in the WebIDL, we can remove quite a few of the
conversions. Do that, and lift the remaining string conversions up as needed.

Also deindent Servo_ComputeColor while touching it.

Most of the remaining copies are because either bug 1606994, or because they're
WebIDL attributes that we still need to serialize back as UTF-16 (bug 1606995).

Differential Revision: https://phabricator.services.mozilla.com/D58687
2020-01-08 01:21:30 +00:00
Emilio Cobos Álvarez f052ee48fd Bug 1607080 - Avoid a silly UTF16 -> UTF8 round-trip in DOMMatrix. r=smaug,boris
Depends on D58710

Differential Revision: https://phabricator.services.mozilla.com/D58711
2020-01-07 09:46:53 +00:00
Thomas Nguyen 8e17cce240 Bug 1546334 - Use referrerInfo in style system. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D36478
2019-07-16 11:43:56 +00:00
Emilio Cobos Álvarez 39911e6484 Bug 1536586 - Simplify a bit our generated bindings by getting rid of FooBorrowed and FooBorrowedMut. r=heycam
This reduces a lot the boilerplate that's needed in order to add simple binding
functions.

This starts using &Foo and Option<&Foo> instead, and as a result we need to
remove the servo_function_signatures test, which is a bit unfortunate.

I think it's worth though, this causes problems on some platforms (see bug
1534844), and messing up the functions signature is not something that I've ever
seen (other than bug 1308234, which already had all the FooBorrowed mess which
I'm removing).

Also, cbindgen understands references and Option<&Foo>, so it will be the way to
go in the future.

After this patch we can also remove HasSimpleFFI, but I've kept it for now since
I still use it in a few places, and this patch is quite big on its own.

Differential Revision: https://phabricator.services.mozilla.com/D24092
2019-03-21 17:00:27 +00:00
Daniel Holbert 07fa7d3fd6 Bug 1533870: Preemptively fix unified build bustage in layout/style. r=boris
I wrote this patch by first removing UNIFIED_ from layout/style/moz.build, and
then rebuilding, and then addressing build errors one by one.

Nearly all of the build errors were for using the "Document" type without a
proper namespace, and I've addressed this by sprinkling "using namespace"
declarations in the affected .cpp files (and removing a few now-unnecessary
dom:: prefixes on types in those files).

The only other errors were for WorkletGlobalScope.h which needed an #include to
provide the type "DOMHighResTimeStamp", and nsHTMLStyleSheet.h which needed a
forward-declaration for the type "mozilla::dom::Document".

Differential Revision: https://phabricator.services.mozilla.com/D22767
2019-03-08 21:48:39 +00:00
Ryan Hunt a96492f0f6 Bug 1523969 part 14 - Move method definition inline comments to new line in 'layout/'. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D21115
2019-02-25 16:09:24 -06:00
Emilio Cobos Álvarez dc336a73ba Bug 1517241 - Rename nsIDocument to mozilla::dom::Document. r=smaug
Summary: Really sorry for the size of the patch. It's mostly automatic
s/nsIDocument/Document/ but I had to fix up in a bunch of places manually to
add the right namespacing and such.

Overall it's not a very interesting patch I think.

nsDocument.cpp turns into Document.cpp, nsIDocument.h into Document.h and
nsIDocumentInlines.h into DocumentInlines.h.

I also changed a bunch of nsCOMPtr usage to RefPtr, but not all of it.

While fixing up some of the bits I also removed some unneeded OwnerDoc() null
checks and such, but I didn't do anything riskier than that.
2019-01-03 17:48:33 +01:00
Sylvestre Ledru e5a134f73a Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset
2018-11-30 11:46:48 +01:00
Emilio Cobos Álvarez 1203186c4e Bug 1496486 - Remove nsCSSValue usage from font code. r=heycam
Really sorry for the size of the patch.

Differential Revision: https://phabricator.services.mozilla.com/D7753
2018-10-09 19:07:41 +02:00
Narcis Beleuzu ae1469597d Backed out 5 changesets (bug 1496486) for valgrind bustages. CLOSED TREE
Backed out changeset d2f1e35ee4b7 (bug 1496486)
Backed out changeset 7f843f4ee162 (bug 1496486)
Backed out changeset 2f629a60f12c (bug 1496486)
Backed out changeset 4dd15fa31474 (bug 1496486)
Backed out changeset e8d8e2f3f00b (bug 1496486)
2018-10-09 19:44:51 +03:00
Emilio Cobos Álvarez 8b8cd9d94d Bug 1496486 - Remove nsCSSValue usage from font code. r=heycam
Really sorry for the size of the patch.

Differential Revision: https://phabricator.services.mozilla.com/D7753
2018-10-09 17:33:24 +02:00
Brindusan Cristian 23bf677c29 Backed out 5 changesets (bug 1496486) for build bustages on gfxUserFontSet.h. CLOSED TREE
Backed out changeset 6b740afea403 (bug 1496486)
Backed out changeset 5cf44e254ac3 (bug 1496486)
Backed out changeset 8e465202c355 (bug 1496486)
Backed out changeset 86382b2249f6 (bug 1496486)
Backed out changeset ab92ed3e0a23 (bug 1496486)
2018-10-09 16:58:38 +03:00