Commit Graph
54 Commits
Author SHA1 Message Date
Emilio Cobos Álvarez 58b1a2fe38 Bug 2026672 - Improve some of the FontFace::Load-adjacent code. r=layout-reviewers,firefox-style-system-reviewers,dshin
Differential Revision: https://phabricator.services.mozilla.com/D290165
2026-03-30 11:29:41 +00:00
Emilio Cobos Álvarez 6824df40e2 Bug 2026299 - Don't keep FontFace owner alive after it's disconnected from the global. 2026-03-26 15:13:10 +00:00
Emilio Cobos Álvarez 1419dbdd64 Bug 2026299 - Improve FontFace promise resolution. r=dholbert
Make promise resolution async, and a lot of the FontFaceSetImpl stuff
doesn't make sense anymore because FontFaceSetImpl _is_ thread-safe.

Differential Revision: https://phabricator.services.mozilla.com/D289918
2026-03-26 07:43:56 +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
Emilio Cobos Álvarez 39b71d4c0c Bug 2021942 - Make handling of font-face and counter-style descriptors similar to handling of properties. r=firefox-style-system-reviewers,webidl,smaug,dshin
They share some of that code already various lookup stuff in nsCSSProps and so
on. This reuses a very similar approach for these two.

Differential Revision: https://phabricator.services.mozilla.com/D286731
2026-03-10 22:09:23 +00:00
Emilio Cobos Álvarez 4d4fcbb13b Bug 1998621 - Use a quoted string for view transition dynamic animation names. r=view-transitions-reviewers,boris
Fix a quoting issue that is exposed by japanese-tag.html

The quoting issue got introduced by bug 1986533 which converted this
code to work on UTF-8 strings rather than utf-16.

Differential Revision: https://phabricator.services.mozilla.com/D271850
2025-11-22 16:55:50 +00:00
Jonathan Kew 3c213707b7 Bug 1999164 - If unicode-range is simply 0..10FFFF, don't bother to create a gfxCharacterMap for it as nothing will be masked. r=layout-reviewers,firefox-style-system-reviewers,emilio
This virtually eliminates GetUnicodeRangeAsCharacterMap from the profile with the testcase here.

Differential Revision: https://phabricator.services.mozilla.com/D272045
2025-11-11 01:27:28 +00:00
Jonathan Kew 7252cb0aa5 Bug 1999164 - Micro-optimize gfxSparseBitSet / gfxCharacterMap construction to reduce repeated re-allocation overhead. r=gfx-reviewers,lsalzman
In local testing, this reduces time spent under FontFaceImpl::GetUnicodeRangeAsCharacterMap
by around 20-25% for the testcase here, by reducing array reallocations while the bitset
is being populated.

(The following patch makes this redundant for the common case when unicode-range is absent,
but this will still benefit cases with a large but not-universal unicode-range descriptor.)

Differential Revision: https://phabricator.services.mozilla.com/D272044
2025-11-11 01:27:26 +00:00
Emilio Cobos Álvarez 08fa6498a4 Bug 1986533 - Quote invalid font-family descriptors in FontFace constructor and family setter. r=layout-reviewers,firefox-style-system-reviewers,dshin
Existing tests will be modified as needed for this, and a WPT added for
this edge case.

Differential Revision: https://phabricator.services.mozilla.com/D265128
2025-09-18 13:25:11 +00:00
Emilio Cobos Álvarez 893348ae24 Bug 1986533 - Improve font face error reporting. r=layout-reviewers,firefox-style-system-reviewers,dshin
With this patch, something like:

  let ff = new FontFace("content:Segoe", "https://foo.com");
  ff.load();

Generates an exception like:

> Uncaught (in promise) DOMException: Invalid font descriptor font-family: content:Segoe

Rather than the error in the bug.

Differential Revision: https://phabricator.services.mozilla.com/D265127
2025-09-18 13:25:07 +00:00
mr. m dd07a53136 Bug 1872780 - Remove layout.css.size-adjust.enabled pref r=webidl,emilio
Differential Revision: https://phabricator.services.mozilla.com/D258800
2025-07-26 22:17:40 +00:00
iulian moraru f211be5f4b Revert "Bug 1872780 - Remove layout.css.size-adjust.enabled pref r=webidl,emilio" for causing mass build bustages related to layout_css_size_adjust_enabled.
This reverts commit 67a6df05cb.
2025-07-26 11:46:47 +00:00
mr. m 67a6df05cb Bug 1872780 - Remove layout.css.size-adjust.enabled pref r=webidl,emilio
Differential Revision: https://phabricator.services.mozilla.com/D258800
2025-07-26 10:43:11 +00:00
Emilio Cobos Álvarez a8a2311474 Bug 1976457 - Sort includes in layout/. r=janv,dshin
Interesting bit is layout/.clang-format, the rest is all automated.

Differential Revision: https://phabricator.services.mozilla.com/D256616
2025-07-09 13:24:00 +00:00
Sylvestre Ledru 8ae54ea4f9 Bug 1519636 - Reformat recent changes to the Google coding style r=geckoview-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,nalexander,gstoll,tcampbell,janv,julienw
Updated with clang-format version 19.1.7 (taskcluster-DYvBxDZJRVqTi8E7pTSJAQ)

Differential Revision: https://phabricator.services.mozilla.com/D249880
2025-05-17 19:11:13 +00:00
Emilio Cobos Álvarez a0a14bcfb9 Bug 1963212 - Reuse FontFaceImpl more aggressively. r=jfkthame
When deep-cloning a stylesheet (like we do for devtools), we end up with
new (identical) LockedFontFaceRule object, but we'd fail to re-use it,
triggering new font loads. Since we don't cache failed loads, this
caused flashing and a temporary state where the used fonts were not what
this DevTools test expects.

Rejigger the code a little bit to push down the decision of whether to
reuse the FontFaceImpl object further down. That allows us to reuse the
FontFace object for the stylesheet caching / deep cloning use-case.

Differential Revision: https://phabricator.services.mozilla.com/D247704
2025-05-07 15:47:30 +00:00
Jonathan Kew a0e8acbf5c Bug 1945637 - Remove the separate 'normal' value of font-style types, as it is a synonym for 'oblique 0deg'; always serialize 'oblique 0deg' as 'normal'. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D236733
2025-02-06 19:38:57 +00:00
Alexandru Marc 8c93644e3b Backed out changeset 46540ac0fc04 (bug 1945637) for causing multiple failures CLOSED TREE 2025-02-06 04:37:03 +02:00
Jonathan Kew 900aaa6a8d Bug 1945637 - Remove the separate 'normal' value of font-style types, as it is a synonym for 'oblique 0deg'; always serialize 'oblique 0deg' as 'normal'. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D236733
2025-02-05 17:07:26 +00:00
Stanca Serban d8376bba5c Backed out changeset 3c90c2d82cf4 (bug 1945637) for causing build bustages in gfxFontUtils.h. CLOSED TREE 2025-02-05 17:14:07 +02:00
Jonathan Kew e15e183ff3 Bug 1945637 - Remove the separate 'normal' value of font-style types, as it is a synonym for 'oblique 0deg'; always serialize 'oblique 0deg' as 'normal'. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D236733
2025-02-05 12:49:05 +00:00
Goloman Adrian 59aeae3ed7 Backed out changeset e8acbf46ade0 (bug 1945637) for causing mass failures @ServoStyleConstsInlines.h. CLOSED TREE 2025-02-05 01:10:44 +02:00
Jonathan Kew 556a433073 Bug 1945637 - Remove the separate 'normal' value of font-style types, as it is a synonym for 'oblique 0deg'; always serialize 'oblique 0deg' as 'normal'. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D236733
2025-02-04 18:29:37 +00:00
Emilio Cobos Álvarez 75a9e9b0e1 Bug 1897589 - Stop keeping FontFace alive at worker shutdown. r=asuth
We check that we can cc and kill the global object on shutdown.

At this point it doesn't really matter that the FontFace is still
loading, the promise will never resolve.

To fix this, implement the "keep alive" by using a target shutdown task.

Differential Revision: https://phabricator.services.mozilla.com/D214741
2024-07-10 19:59:58 +00:00
Emilio Cobos Álvarez 5bc3e22a47 Bug 1897589 - Ensure a FontFace object is kept alive while loading. r=aosmond,jfkthame
Otherwise we might never resolve the loaded promise.

This was the simplest / most obvious place to put the code, but let me
know if you can think of something better...

Ideally the nsFontFaceLoader would keep alive the RefPtr<FontFace>
objects as needed, but that's not really easy, because we can have the
same UserFontSet entry for fonts in different threads, AIUI, and
FontFace itself isn't movable across threads, so... This should be a
safe place to do this.

Differential Revision: https://phabricator.services.mozilla.com/D211625
2024-07-10 19:59:57 +00:00
Iulian Moraru 44b25784bb Backed out changeset 80e6f1d766c1 (bug 1897589) for causing assertion failures on RuntimeService.cpp. CLOSED TREE 2024-06-24 15:27:12 +03:00
Emilio Cobos Álvarez 7781cda58b Bug 1897589 - Ensure a FontFace object is kept alive while loading. r=aosmond,jfkthame
Otherwise we might never resolve the loaded promise.

This was the simplest / most obvious place to put the code, but let me
know if you can think of something better...

Ideally the nsFontFaceLoader would keep alive the RefPtr<FontFace>
objects as needed, but that's not really easy, because we can have the
same UserFontSet entry for fonts in different threads, AIUI, and
FontFace itself isn't movable across threads, so... This should be a
safe place to do this.

Differential Revision: https://phabricator.services.mozilla.com/D211625
2024-06-24 09:52:50 +00:00
Daniel Holbert cd7fd0677f Bug 1896711 part 5: Use MakeRefPtr/MakeAndAddRef to reduce boilerplate, in layout/style. r=TYLin
Differential Revision: https://phabricator.services.mozilla.com/D210390
2024-05-15 07:29:21 +00:00
Jonathan Kew ae8bec2d03 Bug 1878199 - patch 2 - If the FontFaceImpl has a user-font entry, hold its lock during Add/Remove font-set operations. r=gfx-reviewers,lsalzman
This should fix the intermittently-reported race here, by ensuring that access into
the FontFaceImpl from GetUserFontSets(), called by the main thread, cannot race with
changes being made by the AddFontSet()/RemoveFontSet() methods.

(If the FontFaceImpl doesn't have an mUserFontEntry yet, then these methods don't
need to lock, as only the owning thread will be touching it.)

Differential Revision: https://phabricator.services.mozilla.com/D207296
2024-04-11 18:40:56 +00:00
Jonathan Kew 4d880f638a Bug 1878199 - patch 1 - Don't create an additional Mutex in FontFaceImpl::Entry, just use the base gfxFontEntry's existing RWLock. r=gfx-reviewers,lsalzman
No functional change here, just cleanup in preparation for the following patch.
We don't need FontFaceImpl to create a mutex, as there's already a lock (RWLock)
in its base class gfxFontEntry, and we can use that to guard the fields here.

Differential Revision: https://phabricator.services.mozilla.com/D207295
2024-04-11 18:40:56 +00:00
Emilio Cobos Álvarez a96d244918 Bug 1883868 - Don't fire http loads from workers. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D203927
2024-03-08 17:42:05 +00:00
Gregory Pappas a85a4bdc0f Bug 1851093 - Remove layout.css.font-metrics-overrides.enabled pref r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D187351
2023-09-04 16:02:13 +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
Andrew Osmond 4b893dc663 Bug 1798591. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D163295
2022-12-14 17:50:54 +00:00
Cristian Tuns bd238b780d Backed out changeset d647be139836 (bug 1798591) for causing build bustages on FontFaceSetImpl.cpp CLOSED TREE 2022-12-14 10:26:07 -05:00
Andrew Osmond fcdd3810c7 Bug 1798591. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D163295
2022-12-14 14:31:20 +00:00
Andrew Osmond 0cfb70fadb Bug 1798494. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D162616
2022-11-24 18:20:20 +00:00
Andrew Osmond 123bed7d89 Bug 1799198 - Check FontFaceSetImpl::GetURLExtraData for nullptr. r=emilio
FontFaceSetWorkerImpl::GetURLExtraData should generally not return a
null pointer, but if it failed to initialize because the worker was
shutdown during FontFaceSetWorkerImpl initialization, then it may never
be created. This patch ensures we check for this race and handle it
appropriately.

Differential Revision: https://phabricator.services.mozilla.com/D161476
2022-11-07 19:34:52 +00:00
Andrew Osmond 41f1d501e0 Bug 1793127. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D159655
2022-10-30 23:48:26 +00:00
Andrew Osmond f9c92c7431 Bug 1072107 - Part 6. Dispatch font calls and callbacks as necessary. r=emilio
Also update thread assertions.

Differential Revision: https://phabricator.services.mozilla.com/D149253
2022-07-07 21:24:10 +00:00
Andrew Osmond a92490c2d2 Bug 1072107 - Part 3. Expose GetURLExtraData on FontFaceSetImpl. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D150540
2022-07-07 21:24:09 +00:00
Andrew Osmond bb23925579 Bug 1771493 - Part 3. Abstract away buffer extraction from FontFaceImpl::InitializeSource. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D147818
2022-06-28 21:47:00 +00:00
Andrew Osmond 840cb97f4c Bug 1771493 - Part 2. Merge FontFaceSetImpl and gfxUserFontSet into a single class. r=emilio
This patch merges FontFaceSetImpl and gfxUserFontSet into the same
class. This reduces the level of indirection and in theory makes it
easier to manage future threading issues.

Differential Revision: https://phabricator.services.mozilla.com/D147817
2022-06-28 21:47:00 +00:00
Andrew Osmond c4c2b34441 Bug 1771493 - Part 1. Split FontFace(Set) into DOM facing and implementation classes. r=emilio
This patch aims to split the implementation details of FontFace(Set)
into FontFace(Set)Impl classes. The Impl variants have threadsafe
refcounting and are intended to be the basis for worker support for
FontFace(Set). We need threadsafe objects to pass around because parts
of the stack can only run on the main thread (network loading of font
data, graphics initialization of a font) even if the FontFace(Set)
itself lives on a DOM worker thread. Given the DOM facing objects are
cycle collected, we need additional indirection to support this use
case.

This patch should be a non-functional change.

Differential Revision: https://phabricator.services.mozilla.com/D147505
2022-06-28 21:46:59 +00:00
Marian-Vasile Laza 2058ad3030 Backed out 5 changesets (bug 1771493) for causing bustages on FontFaceSetDocumentImpl.obj. CLOSED TREE
Backed out changeset 07513973391f (bug 1771493)
Backed out changeset 22f567c00af3 (bug 1771493)
Backed out changeset 609a5d93bf08 (bug 1771493)
Backed out changeset 1f5b0b087930 (bug 1771493)
Backed out changeset aa5527055ad1 (bug 1771493)
2022-06-28 22:21:00 +03:00
Andrew Osmond 058b8a34aa Bug 1771493 - Part 3. Abstract away buffer extraction from FontFaceImpl::InitializeSource. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D147818
2022-06-28 15:58:10 +00:00
Andrew Osmond b546ac3d77 Bug 1771493 - Part 2. Merge FontFaceSetImpl and gfxUserFontSet into a single class. r=emilio
This patch merges FontFaceSetImpl and gfxUserFontSet into the same
class. This reduces the level of indirection and in theory makes it
easier to manage future threading issues.

Differential Revision: https://phabricator.services.mozilla.com/D147817
2022-06-28 15:58:10 +00:00
Andrew Osmond 4964867caa Bug 1771493 - Part 1. Split FontFace(Set) into DOM facing and implementation classes. r=emilio
This patch aims to split the implementation details of FontFace(Set)
into FontFace(Set)Impl classes. The Impl variants have threadsafe
refcounting and are intended to be the basis for worker support for
FontFace(Set). We need threadsafe objects to pass around because parts
of the stack can only run on the main thread (network loading of font
data, graphics initialization of a font) even if the FontFace(Set)
itself lives on a DOM worker thread. Given the DOM facing objects are
cycle collected, we need additional indirection to support this use
case.

This patch should be a non-functional change.

Differential Revision: https://phabricator.services.mozilla.com/D147505
2022-06-28 15:58:09 +00:00