Commit Graph
61 Commits
Author SHA1 Message Date
Daniel Holbert b9eb620914 Bug 2036982: Use MakeAndAddRef to replace some new/forget() patterns in layout/style. r=layout-reviewers,firefox-style-system-reviewers,emilio
MakeAndAddRef exists partly to serve as syntactic sugar to combine statements
like this.  And this lets us reduce our count of manual 'new' statements,
which is a nice plus.

One exception was "new StyleSheet" which has a private constructor and hence
can't use MakeAndAddRef, so in that instance I used do_AddRef(new) to stuff the
newly-allocated object into a smart pointer, in a way that we can consistently
grep for across the codebase when auditing our new/delete invocations.

Differential Revision: https://phabricator.services.mozilla.com/D298473
2026-05-06 22:31:29 +00:00
Daniel Holbert 1d19a6df13 Bug 2036984: Allocate reference-counted objects with MakeRefPtr instead of 'new', in layout/style. r=layout-reviewers,firefox-style-system-reviewers,emilio
This is mostly just changing `new Foo()` to `MakeRefPtr<Foo>()`.

Notablye exceptions:
* In one case where the result gets stuck in a `nsCOMPtr` instead of a `RefPtr`,
  I use `MakeAndAddRef` instead, to follow precedent from elsewhere in the
  codebase (and avoid the appearance of a pointer-type-mixup).
* In cases where the class has a private constructor, we can't use MakeRefPtr,
  so I use `do_AddRef(new Foo())` to make it slightly clearer (in an easily
  greppable way) that the 'new' invocation is instantly being stuffed into
  a smart pointer.

Differential Revision: https://phabricator.services.mozilla.com/D298475
2026-05-06 22:31:27 +00:00
Emilio Cobos Álvarez 406b05d943 Bug 2026296 - Improve handling of Post-traversal tasks. r=jfkthame,firefox-style-system-reviewers,layout-reviewers,dshin
Differential Revision: https://phabricator.services.mozilla.com/D292814
2026-04-09 19:54:35 +00:00
Jonathan Kew eb5278fb30 Bug 2029064 - Make nsFontFaceLoader::Cancel() remove itself from the registering font-set. r=layout-reviewers,firefox-style-system-reviewers,emilio
(Based on suggested patch from clauditor, with comments modified.)

Differential Revision: https://phabricator.services.mozilla.com/D292468
2026-04-07 21:02:00 +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
Jonathan Kew a6cb564e82 Bug 1979061 - Don't eagerly call FlushUserFontSet() every time a face is added/removed. r=firefox-style-system-reviewers,emilio
AFAICS this isn't really necessary, and becomes extremely expensive when the font set is large.

Differential Revision: https://phabricator.services.mozilla.com/D272550
2025-11-14 10:50:51 +00:00
Emilio Cobos Álvarez 4ea5ebeaa0 Bug 1995282 - Remove StyleSheet::mSheetURI. r=smaug
We don't need it:

 * For built-in sheets (ContentParent etc) the original URI is the same.
 * For Document / nsStyleSheetService / LinkStyle, the original URI is
   what you want to avoid registering / loading the same URI multiple
   times.

Differential Revision: https://phabricator.services.mozilla.com/D269423
2025-10-22 11:24:36 +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
Florian Quèze 6afb2c9c36 Bug 1956726 - Migrate histograms to use Glean APIs for WEBFONT_*, r=chutten.
Differential Revision: https://phabricator.services.mozilla.com/D242767
2025-04-03 13:42:52 +00:00
Florian Quèze 9609e47f62 Bug 1879329 - script generated replacement of the GleanMetrics.h includes, r=chutten,valentin,media-playback-reviewers,cookie-reviewers,anti-tracking-reviewers,profiler-reviewers,win-reviewers,rkraesig,emz,aabh,padenot.
Differential Revision: https://phabricator.services.mozilla.com/D234744
2025-01-21 11:21:45 +00:00
Emilio Cobos Álvarez 77c40caac6 Bug 1910698 - Remove nsIScriptError.sourceLine. r=smaug,devtools-reviewers,webdriver-reviewers,necko-reviewers,nchevobbe,kershaw,jdescottes,credential-management-reviewers,dimi
Afaict the source lines are not exposed anywhere in the UI.

Differential Revision: https://phabricator.services.mozilla.com/D218115
2024-08-01 17:12:48 +00:00
Eden Chuang feb314e721 Bug 1894231 - P3 Remove WorkerPrivate* in WorkerMainThreadRunnable. r=dom-worker-reviewers,extension-reviewers,smaug,rpl
Remove mWorkerPrivate from WorkerMainThreadRunnable. Instead, using a ThreadSafeWorkerRef to keep Worker alive until the created syncLoop is destroyed.

In general, WorkerMainThreadRunnable::mWorkerPrivate is only used for dispatching the MainThreadStopSyncLoopRunnable back to the Worker thread. Because of the syncLoop, the Worker is supposed to be kept alive until the created syncLoop is destroyed.

RefPtr<ThreadSafeWorkerRef> WorkerMainThreadRunnable::mWorkerRef is introduced to ensure a valid WorkerPrivate during WorkerMainThreadRunnable's execution.

WorkerMainThreadRunnable::mWorkerRef is allocated just before creating a syncLoop in WorkerMainThreadRunnable::Dispatch. And released after the created syncLoop::Run() finishes.

Depends on D212556

Differential Revision: https://phabricator.services.mozilla.com/D212557
2024-06-24 22:20:51 +00:00
Jonathan Kew bf9465d6b5 Bug 1838834 - Hoist mutex from FontFaceSetImpl to gfxUserFontSet. r=gfx-reviewers,lsalzman
So we can use it to guard generation-counter updates.

Differential Revision: https://phabricator.services.mozilla.com/D206886
2024-04-08 16:30:53 +00:00
Perry McManis 729f4b8875 Bug 1877839 - Migrate GVST metrics in the network namespace to pure glean r=chutten,necko-reviewers,valentin
GVST is how these probes sent data in Fenix and is now unnecessary (and doesn't send data in Fenix release) since Firefox Desktop has direct access to Glean. We therefore need to clean them up in some capacity.

Following the recommendations from the GeckoView Streaming (GVST) validation effort, this is a pure Glean api implementation of the metrics that fell under network in geckoview streaming.

Each metric retains its previous name, and gains a Glean Interface for FireFox Telemetry (GIFFT) version, such that downstream data analyses will not be impacted.

Several metrics were not recorded in the current codebase and have been removed.

Differential Revision: https://phabricator.services.mozilla.com/D200400
2024-02-08 14:36:14 +00:00
Emilio Cobos Álvarez 2ec0cb440a Bug 1854742 - Don't over-invalidate in FontFaceSet::UpdateRules. r=aosmond
We already account for non-rule-face dirtiness via mNonRuleFacesDirty.

If mNonRuleFaces is not empty, this would cause every stylesheet
insertion to think font faces have changed, and trigger a restyle.

Differential Revision: https://phabricator.services.mozilla.com/D189033
2023-09-26 14:13:54 +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 1c7528f873 Bug 1818417 - Tweak nsFontFaceLoader destruction to be more consistent. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D170744
2023-02-24 17:37:23 +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 41f1d501e0 Bug 1793127. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D159655
2022-10-30 23:48:26 +00:00
Jonathan Kew e38622a12c Bug 1715546 - Add support for the @font-face src descriptor's tech() function. r=emilio
WPT tests to be added in a following patch.

Differential Revision: https://phabricator.services.mozilla.com/D154399
2022-08-12 22:17:24 +00:00
Jonathan Kew 47d4aa9c51 Bug 650372 - Use the style-system format hint directly in gfx, instead of mapping to a separate internal enum. r=gfx-reviewers,aosmond,lsalzman
Now that the style system has keywords for this, we don't need to define them in gfx
but can just use the enum directly. (No functional change, just code simplification.)

Depends on D154237

Differential Revision: https://phabricator.services.mozilla.com/D154238
2022-08-12 11:25:59 +00:00
Jonathan Kew 08356cafca Bug 650372 - Accept keywords in addition to strings in the @font-face format() hint function. r=emilio
The CSS Fonts 4 spec requires this, and Safari (at least) has long supported it.

Depends on D154277

Differential Revision: https://phabricator.services.mozilla.com/D154237
2022-08-12 11:25:59 +00:00
Jonathan Kew 99fa0ff816 Bug 1784058 - Simplify @font-face format hint handling in gfx/thebes, now that it is explicitly only a single hint, not a set. r=gfx-reviewers,aosmond,lsalzman
No functional change, just simplifying the code a bit.

Depends on D154235

Differential Revision: https://phabricator.services.mozilla.com/D154236
2022-08-12 11:25:58 +00:00
Iulian Moraru b2a2b27770 Backed out 7 changesets (bug 1784058, bug 650372) for causing wpt failures on format-specifiers-variations.html. CLOSED TREE
Backed out changeset 2aa97ebc8593 (bug 650372)
Backed out changeset 41d1c62f11ac (bug 650372)
Backed out changeset 8340c08ff8b6 (bug 650372)
Backed out changeset cbe59d9bbcbb (bug 1784058)
Backed out changeset 40b00a214019 (bug 1784058)
Backed out changeset 714d84a2680a (bug 1784058)
Backed out changeset e5b24489d365 (bug 1784058)
2022-08-11 23:24:20 +03:00
Jonathan Kew 4a84154178 Bug 650372 - Use the style-system format hint directly in gfx, instead of mapping to a separate internal enum. r=gfx-reviewers,aosmond,lsalzman
Now that the style system has keywords for this, we don't need to define them in gfx
but can just use the enum directly. (No functional change, just code simplification.)

Depends on D154237

Differential Revision: https://phabricator.services.mozilla.com/D154238
2022-08-11 18:03:58 +00:00
Jonathan Kew 3dd02d51f6 Bug 650372 - Accept keywords in addition to strings in the @font-face format() hint function. r=emilio
The CSS Fonts 4 spec requires this, and Safari (at least) has long supported it.

Depends on D154277

Differential Revision: https://phabricator.services.mozilla.com/D154237
2022-08-11 18:03:58 +00:00
Jonathan Kew a97cd3feab Bug 1784058 - Fix up legacy @font-face tests that depended on previous behavior, no longer allowed by the spec. r=emilio
Depends on D154236

Differential Revision: https://phabricator.services.mozilla.com/D154277
2022-08-11 18:03:57 +00:00
Jonathan Kew 427c3abb12 Bug 1784058 - Simplify @font-face format hint handling in gfx/thebes, now that it is explicitly only a single hint, not a set. r=gfx-reviewers,aosmond,lsalzman
No functional change, just simplifying the code a bit.

Depends on D154235

Differential Revision: https://phabricator.services.mozilla.com/D154236
2022-08-11 18:03:57 +00:00
Cristian Tuns 96ac2d4fa3 Backed out 7 changesets (bug 650372, bug 1784058) for causing reftest failures on variation-format-hint-1a.html CLOSED TREE
Backed out changeset c78a59ace7ec (bug 650372)
Backed out changeset eea47293ce56 (bug 650372)
Backed out changeset e978496c7ea0 (bug 650372)
Backed out changeset 597837e9753f (bug 1784058)
Backed out changeset 6d71bcfcc1a1 (bug 1784058)
Backed out changeset 5d21f6e4f8e0 (bug 1784058)
Backed out changeset 35634f66cb37 (bug 1784058)
2022-08-11 10:28:40 -04:00
Jonathan Kew 694a39cdd0 Bug 650372 - Use the style-system format hint directly in gfx, instead of mapping to a separate internal enum. r=gfx-reviewers,aosmond,lsalzman
Now that the style system has keywords for this, we don't need to define them in gfx
but can just use the enum directly. (No functional change, just code simplification.)

Differential Revision: https://phabricator.services.mozilla.com/D154238
2022-08-11 13:10:04 +00:00
Jonathan Kew 1564423192 Bug 650372 - Accept keywords in addition to strings in the @font-face format() hint function. r=emilio
The CSS Fonts 4 spec requires this, and Safari (at least) has long supported it.

Differential Revision: https://phabricator.services.mozilla.com/D154237
2022-08-11 13:10:03 +00:00
Jonathan Kew c4d2d51e9f Bug 1784058 - Simplify @font-face format hint handling in gfx/thebes, now that it is explicitly only a single hint, not a set. r=gfx-reviewers,aosmond,lsalzman
No functional change, just simplifying the code a bit.

Differential Revision: https://phabricator.services.mozilla.com/D154236
2022-08-11 13:10:02 +00:00
Andrew Osmond b6cc8dd79b Bug 1782710 - Avoid accessing network service or principals on worker threads with font pathways. r=jfkthame
We do some initialization of gfxFontSrcURI and gfxFontFaceSrc that is
main thread only on the DOM worker threads. These portions of the
initialization can easily be deferred to on demand access since they are
only ever used on the main thread itself.

Differential Revision: https://phabricator.services.mozilla.com/D153461
2022-08-03 11:39:34 +00:00
Sandor Molnar fc6bf405c6 Backed out changeset b7b04703f99d (bug 1782710) for causing wpt failure. 2022-08-02 18:16:28 +03:00
Andrew Osmond 671faeef8d Bug 1782710 - Avoid accessing network service or principals on worker threads with font pathways. r=jfkthame
We do some initialization of gfxFontSrcURI and gfxFontFaceSrc that is
main thread only on the DOM worker threads. These portions of the
initialization can easily be deferred to on demand access since they are
only ever used on the main thread itself.

Differential Revision: https://phabricator.services.mozilla.com/D153461
2022-08-02 14:26:57 +00:00
Andrew Osmond 789a21dab0 Bug 1779096 - Clear FontFaceSetImpl::mOwner when destroyed. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D151554
2022-07-11 23:24:36 +00:00
Andrew Osmond aeb00f5e9f Bug 1072107 - Part 9. Expose FontFaceSet on workers. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D149254
2022-07-07 21:24:11 +00:00
Andrew Osmond 4252f2198f Bug 1072107 - Part 8. Provide worker variant of FontFaceSetImpl. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D149252
2022-07-07 21:24:11 +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 a9222d9267 Bug 1072107 - Part 5. Skip logging to the console for workers right now r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D149246
2022-07-07 21:24:10 +00:00
Andrew Osmond f282f90daa Bug 1072107 - Part 4. Rework gfxFontSrcPrincipal creation to never be lazy. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D150541
2022-07-07 21:24:09 +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 719267821f Bug 1771493 - Part 4. Split FontFaceSetDocumentImpl from FontFaceSetImpl. r=emilio
This patch splits document specific functionality from FontFaceSetImpl
into a new class FontFaceSetDocumentImpl. This will make it easier to
fork FontFaceSetImpl for workers.

Differential Revision: https://phabricator.services.mozilla.com/D147819
2022-06-28 21:47:01 +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