Commit Graph

282 Commits

Author SHA1 Message Date
Andi-Bogdan Postelnicu
120496a230 Bug 1519636 - Reformat recent changes to the Google coding style. r=sylvestre
Updated with clang-format version 13.0.0 (taskcluster-dn0nWlPhT22vaQNfMnFkSg)

Differential Revision: https://phabricator.services.mozilla.com/D135325
2022-01-11 15:49:03 +00:00
Cristian Tuns
dea3b789a7 Backed out 2 changesets (bug 1617369, bug 1519636) for causing lint failures on multiple files. CLOSED TREE
Backed out changeset 6726892a0012 (bug 1617369)
Backed out changeset c08caa5f8504 (bug 1519636)
2022-01-11 04:38:34 -05:00
Andi-Bogdan Postelnicu
f4ea362111 Bug 1519636 - Reformat recent changes to the Google coding style. r=sylvestre
Updated with clang-format version 13.0.0 (taskcluster-dn0nWlPhT22vaQNfMnFkSg)

Differential Revision: https://phabricator.services.mozilla.com/D135325
2022-01-11 09:16:56 +00:00
Jonathan Kew
28735abb7b Bug 1745715 - Process app-bundled fonts before system fonts when initializing the font list, to ensure their families get the expected Base visibility level. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D133667
2021-12-13 20:09:36 +00:00
Lee Salzman
49eee343af Bug 1742896 - Pass TextRunDrawParams to GetScaledFont. r=jfkthame
This tries to clean up some of the awkwardness from bug 1730772 so that we can
do further fixes more easily if necessary.

Differential Revision: https://phabricator.services.mozilla.com/D133353
2021-12-09 22:16:17 +00:00
Lee Salzman
56d552e8ec Bug 1454152 - Allow bitmaps from emoji fonts that have no outlines with Fontconfig. r=jfkthame
The default Cairo-compatible behavior of ignoring all embedded bitmaps in a font
if hinting is disabled and antialiasing is enabled seems to not work with emoji
fonts like Noto Color Emoji which do not have any outlines at all, but do have
color bitmaps that present as scalable. Detect this corner case and allow bitmaps.

Differential Revision: https://phabricator.services.mozilla.com/D133328
2021-12-09 22:12:18 +00:00
Jonathan Kew
9477e32f16 Bug 1531223 - Add support for the 'ic' font-relative unit. r=emilio
This is a "simplified" implementation of 'ic', similar to what Safari Preview
currently supports: it only considers the advance of U+6C34 if found in the
first available font, and otherwise falls back to the default of 1em.

(The spec allows for this "in cases where it is impossible or impractical to
determine the ideographic advance measure".)

Differential Revision: https://phabricator.services.mozilla.com/D132818
2021-12-08 17:07:05 +00:00
Lee Salzman
29ccb70482 Bug 1732577 - Fix interpretation of Fontconfig hinting toggle in PrepareFontOptions. r=jfkthame
In bug 1547063, a bug was introduced where a logic condition was improperly negated.
!(printing || !hinting) became (!printing || hinting), when the negation is actually
!printing && hinting. This fixes that so that we do the right thing here and actually
ignore the following hint-style check if hinting is false.

Differential Revision: https://phabricator.services.mozilla.com/D128017
2021-10-11 13:56:52 +00:00
Jonathan Kew
bfa1d70def Bug 1715501 - patch 2 - Pass the presContext to platform font lookup methods so they can query it for font visibility. r=emilio
This does not in itself change user-visible behavior, but is a foundation for bug
1715507 where we will make the behavior per-context instead of global. This is basically
just plumbing, passing a pointer to the presContext that's asking for fonts to be
resolved all the way down to the gfx code that handles the font list and looks up
fonts.

For the immediate goal of making font visibility work per-context, it would be
sufficient to pass the desired visibility level in to the font-selection methods.
However, passing the actual presContext down (and not just its visibility level)
will enable us to report back via the dev console when a font is blocked (see bug
1715537), so the approach here provides the basis for that upcoming enhancement.

Depends on D124194

Differential Revision: https://phabricator.services.mozilla.com/D124195
2021-09-08 12:18:17 +00:00
Cristian Tuns
9e1718d5a5 Backed out 4 changesets (bug 1715537, bug 1715507, bug 1715501) for causing mochitest failures on test_bug418986-2.html. CLOSED TREE
Backed out changeset fff777ea5637 (bug 1715537)
Backed out changeset 240308eb514d (bug 1715507)
Backed out changeset e3f8526e0e2a (bug 1715501)
Backed out changeset cfdd1c5d8d3f (bug 1715501)
2021-09-08 07:48:51 -04:00
Jonathan Kew
20585f15c0 Bug 1715501 - patch 2 - Pass the presContext to platform font lookup methods so they can query it for font visibility. r=emilio
This does not in itself change user-visible behavior, but is a foundation for bug
1715507 where we will make the behavior per-context instead of global. This is basically
just plumbing, passing a pointer to the presContext that's asking for fonts to be
resolved all the way down to the gfx code that handles the font list and looks up
fonts.

For the immediate goal of making font visibility work per-context, it would be
sufficient to pass the desired visibility level in to the font-selection methods.
However, passing the actual presContext down (and not just its visibility level)
will enable us to report back via the dev console when a font is blocked (see bug
1715537), so the approach here provides the basis for that upcoming enhancement.

Depends on D124194

Differential Revision: https://phabricator.services.mozilla.com/D124195
2021-09-08 09:35:17 +00:00
Emilio Cobos Álvarez
9f1a306d13 Bug 1728086 - Fix system-ui support on Linux distros where Gnome settings aren't mapped to fontconfig. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D124049
2021-09-01 00:21:57 +00:00
Csoregi Natalia
dea5ee66a8 Backed out changeset df6b2d7ac580 (bug 1728086) for failures on system-ui-ar.html. CLOSED TREE 2021-08-31 17:55:00 +03:00
Emilio Cobos Álvarez
66d9cbefd5 Bug 1728086 - Fix system-ui support on Linux distros where Gnome settings aren't mapped to fontconfig. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D124049
2021-08-31 11:53:48 +00:00
Emilio Cobos Álvarez
cfca657d9c Bug 1722487 - Avoid some work for font list updates. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D123363
2021-08-26 23:17:54 +00:00
Jonathan Kew
da11a216cc Bug 1724421 - Use template argument deduction to simplify callsites when checking the standard font-family visibility lists. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D122003
2021-08-06 14:06:53 +00:00
Mike Hommey
25c71f548b Bug 1722653 - Remove --enable-system-cairo. r=firefox-build-system-reviewers,jrmuizel,andi
It hasn't been supported since bug 1432751, > 3 years ago.

Differential Revision: https://phabricator.services.mozilla.com/D121063
2021-07-29 23:38:30 +00:00
Jonathan Kew
bf3113343b Bug 1716841 - Update font-size-adjust keywords to match CSSWG resolution in csswg-drafts/#6288. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D118198
2021-07-07 11:58:40 +00:00
Emilio Cobos Álvarez
fb069248c0 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
Jonathan Kew
553fdd24fc Bug 1711479 - Support various metrics (not only ex-height) as the basis for font-size-adjust calculations in the gfx font implementations. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D115211
2021-06-14 12:32:37 +00:00
Jonathan Kew
74aef88b56 Bug 1664151 - Drop FC_CHARSET element from fontconfig patterns for TrueType/OpenType fonts, as we will read the cmap directly anyhow. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D117423
2021-06-10 16:13:39 +00:00
Csoregi Natalia
1fa90cf8b2 Backed out 5 changesets (bug 1711479) for multiple failures e.g. test_css-properties-db.js. CLOSED TREE
Backed out changeset f1b19a0463cd (bug 1711479)
Backed out changeset 3d1d2b4a2713 (bug 1711479)
Backed out changeset 4e689776fe5d (bug 1711479)
Backed out changeset 85b6b2648f60 (bug 1711479)
Backed out changeset a15cec1f0554 (bug 1711479)
2021-06-07 13:55:29 +03:00
Jonathan Kew
ddbc4e9bed Bug 1711479 - Support various metrics (not only ex-height) as the basis for font-size-adjust calculations in the gfx font implementations. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D115211
2021-06-07 08:58:12 +00:00
Jonathan Kew
2f1aa020c3 Bug 1714282 - Handle bitmap font sizes in the shared font list on Linux. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D116874
2021-06-06 20:30:14 +00:00
Emilio Cobos Álvarez
e2df872ab8 Bug 1708285 - Pass default font settings from parent to child processes. r=jfkthame
Instead of relying on GTK to be initialized in the child process.

Differential Revision: https://phabricator.services.mozilla.com/D113784
2021-05-01 20:00:31 +00:00
Emilio Cobos Álvarez
ae22a9903e Bug 1704466 - Make sure to preserve face order from fontconfig when appropriate. r=jfkthame
This seems to help: https://treeherder.mozilla.org/perfherder/compare?originalProject=try&originalRevision=158613f137b8fe9409f19a3b6abbe5ce773a7b4f&newProject=try&newRevision=c87de791fbfc5d269d0f2071dc8a6dd28707bebc&framework=13

My patch reversed the ordering of faces with different weight / style /
etc for a single font (which shouldn't matter for correctness, but seems
to have some perf implications).

Based on logging, fontconfig on automation returns "regular" faces first
and "bold / semibold / italic / etc" later.

My guess is that putting the regular faces later (which are more
commonly used) affected performance of these test-cases.

This patch should address it and restore the original order, by tweaking
the prioritization code to stop doing "insert to front" / "insert to
back", but instead moving aliases to the end.

Differential Revision: https://phabricator.services.mozilla.com/D112674
2021-04-20 10:42:44 +00:00
Emilio Cobos Álvarez
0302792235 Bug 1703693 - Prefer faces for fonts that can only be named in one way. r=jfkthame
This produces the desired rendering here by effectively "deprioritizing"
faces from fonts that have multiple names.

Your call whether this is a good idea or not, seems reasonable off-hand
to me.

Differential Revision: https://phabricator.services.mozilla.com/D111283
2021-04-09 14:50:44 +00:00
Jonathan Kew
39edce2d71 Bug 1698495 - Implement size-adjust font scaling in gfx/thebes font code. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D110024
2021-03-29 21:14:44 +00:00
Simon Giesecke
91fdeec18c Bug 1695162 - Migrate from custom hashtable iteration to range-based for in accessible, dom/animation, dom/base, dom/localstorage, gfx/thebes. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D106895
2021-03-12 16:14:58 +00:00
Alexandru Michis
c691800cb0 Backed out changeset fd03162e726d (bug 1695162) for causing bustages in Document.cpp
CLOSED TREE
2021-03-12 17:10:02 +02:00
Simon Giesecke
2fb6095f16 Bug 1695162 - Migrate from custom hashtable iteration to range-based for in accessible, dom/animation, dom/base, dom/localstorage, gfx/thebes. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D106895
2021-03-12 14:54:08 +00:00
Jan Alexander Steffens (heftig)
4920407bb3 Bug 1696845 - Use dlsym for gdk_*_display_get_type. r=stransky
Using `dlsym` for `gdk_wayland_display_get_type` is a cleaner solution
to bug 1696319, allowing running with a GTK that lacks the Wayland
backend.

Also adds a symmetric implementation for `gdk_x11_display_get_type`,
which should help running without X11.

Differential Revision: https://phabricator.services.mozilla.com/D107406
2021-03-11 14:32:53 +00:00
Narcis Beleuzu
198358fc15 Backed out changeset a4f4f640eaa7 (bug 1696845) for bustages on pangofc-fontmap.h 2021-03-10 04:49:51 +02:00
Jan Alexander Steffens (heftig)
1261a74d17 Bug 1696845 - Use dlsym for gdk_*_display_get_type. r=stransky
Using `dlsym` for `gdk_wayland_display_get_type` is a cleaner solution
to bug 1696319, allowing running with a GTK that lacks the Wayland
backend.

Also adds a symmetric implementation for `gdk_x11_display_get_type`,
which should help running without X11.

Differential Revision: https://phabricator.services.mozilla.com/D107406
2021-03-09 22:55:47 +00:00
Simon Giesecke
bc9766c354 Bug 1634281 - Use nsTHashMap for nsBaseHashtable/nsDataHashtable uses with RefPtr data type. r=xpcom-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D105963
2021-03-09 11:39:36 +00:00
Jonathan Kew
08f7bb3e17 Bug 1696162 - Add telemetry to record the startup-time cost of activating bundled fonts. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D107094
2021-03-08 16:23:39 +00:00
Simon Giesecke
63fcc3f1a2 Bug 1693541 - Revert changes to FindAndAddFamilies and adapt to nsBaseHashtable changes. a=fix
Differential Revision: https://phabricator.services.mozilla.com/D106905
2021-03-02 13:32:01 +00:00
Simon Giesecke
69f2d14907 Bug 1693541 - Improve uses of nsBaseHashtable and descendants and avoid multiple subsequent lookups in gfx. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D106096
2021-03-01 09:59:29 +00:00
smolnar
464bef8dad Backed out changeset 473b37f1e3e2 (bug 1693541) for causing gfx crashes. a=backout 2021-03-02 14:38:21 +02:00
Simon Giesecke
48a32bdd4e Bug 1693541 - Improve uses of nsBaseHashtable and descendants and avoid multiple subsequent lookups in gfx. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D106096
2021-03-01 09:59:29 +00:00
Simon Giesecke
b399a8194c Bug 1691913 - Add some convenience methods to LookupResult and EntryHandle. r=xpcom-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D105475
2021-03-01 09:59:29 +00:00
Simon Giesecke
9af107a839 Bug 1691913 - Rename nsBaseHashtable::Put to InsertOrUpdate. r=xpcom-reviewers,necko-reviewers,jgilbert,dragana,nika
This makes the naming more consistent with other functions called
Insert and/or Update. Also, it removes the ambiguity whether
Put expects that an entry already exists or not, in particular because
it differed from nsTHashtable::PutEntry in that regard.

Differential Revision: https://phabricator.services.mozilla.com/D105473
2021-02-26 09:11:46 +00:00
Simon Giesecke
4f75368dcb Bug 1691913 - Rename nsBaseHashtable::GetOrInsert(With) to LookupOrInsert(With). r=xpcom-reviewers,necko-reviewers,jgilbert,dragana,nika
The functions should be called "Lookup" rather than "Get" because they return
a DataType& (rather than UserDataType).

Differential Revision: https://phabricator.services.mozilla.com/D105472
2021-02-26 09:11:45 +00:00
Simon Giesecke
d2caea36fa Bug 1691894 - Simplify uses of WithEntryHandle that only use OrInsert(With) by using GetOrInsertWith. r=xpcom-reviewers,necko-reviewers,jgilbert,nika
Differential Revision: https://phabricator.services.mozilla.com/D104676
2021-02-22 12:07:46 +00:00
Simon Giesecke
780a1636a9 Bug 1691894 - Replace several suboptimal uses of Put after Get by GetOrInsertWith or WithEntryHandle. r=xpcom-reviewers,necko-reviewers,kmag,valentin,geckoview-reviewers,agi
Differential Revision: https://phabricator.services.mozilla.com/D104849
2021-02-15 15:12:17 +00:00
smolnar
1afbbe67e1 Backed out 5 changesets (bug 1691894) for causing hazard failures in nsXULPrototypeCache. CLOSED TREE
Backed out changeset 22dc870ee609 (bug 1691894)
Backed out changeset 58c31e9d6ae3 (bug 1691894)
Backed out changeset 7483e84149d8 (bug 1691894)
Backed out changeset f977d6cfa973 (bug 1691894)
Backed out changeset db4503476f34 (bug 1691894)
2021-02-15 16:43:23 +02:00
Simon Giesecke
8973094ec1 Bug 1691894 - Replace several suboptimal uses of Put after Get by GetOrInsertWith or WithEntryHandle. r=xpcom-reviewers,necko-reviewers,kmag,valentin,geckoview-reviewers,agi
Differential Revision: https://phabricator.services.mozilla.com/D104849
2021-02-15 10:04:45 +00:00
Simon Giesecke
f701c44a5c Bug 1691894 - Fix EntryHandle to only work with DataType rather than wrapping UserDataType. r=xpcom-reviewers,necko-reviewers,nika,jonco,valentin
Differential Revision: https://phabricator.services.mozilla.com/D104810
2021-02-12 15:25:40 +00:00
Simon Giesecke
010633d2d1 Bug 1688833 - Migrate LookupForAdd to WithEntryHandle in gfx/thebes. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D104215
2021-02-09 18:19:39 +00:00
Jonathan Kew
fa6b797928 Bug 1686274 - Put the activation of app-bundled fonts behind a pref on all platforms, with a default auto option that is Windows-version-sensitive. r=lsalzman
This allows us to default to skipping the bundled Twemoji Mozilla font when running on Win8.1 or later,
where we can assume Segoe UI Emoji is available.

The new pref here replaces the existing pair of boolean prefs that were only supported on Android,
and is now respected on all platforms. Available settings are:

    0     disable use of app-bundled fonts
    > 0   enable use of app-bundled fonts
    < 0   default (auto): decide at startup, based on the system environment

(The pref is relevant only at startup; changing its value during a session will not make the bundled fonts
appear/disappear dynamically.)

Differential Revision: https://phabricator.services.mozilla.com/D102085
2021-01-18 20:04:36 +00:00