Граф коммитов

78 Коммитов

Автор SHA1 Сообщение Дата
Frederic Wang 9ad02dda76 Bug 1788637 - Remove MathML preferences scriptminsize_attribute and scriptsizemultiplier_attribute. r=emilio
This commit removes the runtime flags and related code for the
scriptminsize and scriptsizemultiplier, which have been disabled by
default for a while. The hardcoded default values
kMathMLDefaultScriptSizeMultiplier and kMathMLDefaultScriptMinSizePt
are still used in some places and are preserved for now.

Differential Revision: https://phabricator.services.mozilla.com/D157426
2023-07-24 10:02:24 +00:00
Frederic Wang 8343f88354 Bug 1821980: Align mathvariant implementation on MathML Core. r=emilio,jfkthame
In MathML Core, the recommendation is to directly use the proper
character from the Mathematical Alphanumeric Symbols instead of the
mathvariant attribute. The exception is for automatic italicization on
single-char `<mi>` element. This is implemented via a new text-transform
value "math-auto" [1] which is the default on the `<mi>` element. The
mathvariant attribute is now restricted to that element and to value
"normal" in order to force upright text instead [2]. This CL implements
this restriction together with that new text-transform value under the
mathml.legacy_mathvariant_attribute.disabled flag.

Some legacy MathML cases where math-auto alone does not work are
still handled via MathMLTextRunFactory.

[1] https://w3c.github.io/mathml-core/#new-text-transform-values
[2] https://w3c.github.io/mathml-core/#the-mathvariant-attribute

Differential Revision: https://phabricator.services.mozilla.com/D172395
2023-07-14 19:44:04 +00:00
Cristian Tuns 9f238811ed Backed out changeset db50582c2b9f (bug 1821980) for causing mochitest failures in browser_mathml.js CLOSED TREE 2023-07-14 13:49:13 -04:00
Frederic Wang 0a3179c31f Bug 1821980: Align mathvariant implementation on MathML Core. r=emilio,jfkthame
In MathML Core, the recommendation is to directly use the proper
character from the Mathematical Alphanumeric Symbols instead of the
mathvariant attribute. The exception is for automatic italicization on
single-char `<mi>` element. This is implemented via a new text-transform
value "math-auto" [1] which is the default on the `<mi>` element. The
mathvariant attribute is now restricted to that element and to value
"normal" in order to force upright text instead [2]. This CL implements
this restriction together with that new text-transform value under the
mathml.legacy_mathvariant_attribute.disabled flag.

Some legacy MathML cases where math-auto alone does not work are
still handled via MathMLTextRunFactory.

[1] https://w3c.github.io/mathml-core/#new-text-transform-values
[2] https://w3c.github.io/mathml-core/#the-mathvariant-attribute

Differential Revision: https://phabricator.services.mozilla.com/D172395
2023-07-14 15:53:34 +00:00
Iulian Moraru 68cbf5e276 Backed out changeset 6cceaca5e653 (bug 1821980) for causing multiple failures. CLOSED TREE 2023-07-14 15:41:31 +03:00
Frederic Wang 1e731ab03c Bug 1821980: Align mathvariant implementation on MathML Core. r=emilio,jfkthame
In MathML Core, the recommendation is to directly use the proper
character from the Mathematical Alphanumeric Symbols instead of the
mathvariant attribute. The exception is for automatic italicization on
single-char `<mi>` element. This is implemented via a new text-transform
value "math-auto" [1] which is the default on the `<mi>` element. The
mathvariant attribute is now restricted to that element and to value
"normal" in order to force upright text instead [2]. This CL implements
this restriction together with that new text-transform value under the
mathml.legacy_mathvariant_attribute.disabled flag.

Some legacy MathML cases where math-auto alone does not work are
still handled via MathMLTextRunFactory.

[1] https://w3c.github.io/mathml-core/#new-text-transform-values
[2] https://w3c.github.io/mathml-core/#the-mathvariant-attribute

Differential Revision: https://phabricator.services.mozilla.com/D172395
2023-07-14 10:52:59 +00:00
Ben Freist b0759509dd Bug 1808757 - [refactor] Migrate defines to constexpr vars r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D166110
2023-01-09 09:03:42 +00:00
Frederic Wang bf1dfd8446 Bug 1789083 - Remove doMathvariantStyling fallback from MathMLTextRunFactory. r=emilio
In order to perform basic mathvariant transforms (italic, bold, and
bold-italic) on systems that don't provide the proper characters from
the Mathematical Alphanumeric Symbols block, a fallback using font
italic/bold style was implemented in Gecko. Nowadays, several fonts
provide glyphs for these characters and are pre-installed on Desktop:

- Cambria Math (pre-installed on Windows Vista and higher)
- STIX General (pre-installed from OS X Lion to macOS Monterey)
- STIX Two Math (pre-installed on macOS Ventura and higher)
- DejaVu (pre-installed on the most popular Linux distributions)

This commit put the fallback under a preference that is disabled by
default on Desktop. It is still required on Android because the
default fonts are not enough.

Differential Revision: https://phabricator.services.mozilla.com/D156396
2022-09-07 12:24:55 +00:00
Frederic Wang 6ed0e8a19f Bug 1789197: [MathMLTextRunFactory] Do not reset font-weight/font-style when mathvariant is specified. r=emilio
This is a follow-up of 1788645, removing the font weight/style reset in
MathMLTextRunFactory when the mathvariant transform is not none. A WPT
test for mathvariant="double-struck" is added to exercise this case.

Differential Revision: https://phabricator.services.mozilla.com/D156400
2022-09-05 08:47:07 +00:00
Frederic Wang 9f8436d1ca Bug 1789081: fontstyle/fontweight attributes should not cancel automatic mathvariant transform on single-char mi. r=emilio
Some code was introduced in [1] to fix a regression with deprecated
fontstyle/fontweight attributes. However, this is no longer needed since
implementation for these attributes have been completely removed [2] and
may prevent automatic mathvariant italicization on single-char <mi>.
Also add a WPT test to check for this.

[1] https://bugzilla.mozilla.org/show_bug.cgi?id=1027354
[2] https://bugzilla.mozilla.org/show_bug.cgi?id=1783841

Differential Revision: https://phabricator.services.mozilla.com/D156373
2022-09-04 13:26:22 +00:00
Emilio Cobos Álvarez 9fc2aa47fc 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 841e350bc4 Backed out changeset 7585591a9bad (bug 1773558) for causing failures in system-fonts.html 2022-06-12 19:02:33 +03:00
Emilio Cobos Álvarez e441089ca0 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 b975e781a1 Bug 1747922 - Rename StyleMathMLMathVariant -> StyleMathVariant.
MANUAL PUSH: Trivial rename.
2021-12-30 02:35:54 +01:00
Neia Finch b205467245 Bug 1747922 - Replace MathML font constants with enum r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D134802
2021-12-30 00:34:27 +00:00
Dan Minor 522eefbe31 Bug 1719554 - Unify unicode::Script as intl::Script; r=platform-i18n-reviewers,gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D132278
2021-12-06 18:15:50 +00:00
Butkovits Atila 56c46d06a1 Backed out 3 changesets (bug 1719554) for causing bustages complaining about gfxTextRun.cpp.
Backed out changeset 6181e40d4da1 (bug 1719554)
Backed out changeset c261ede6ae81 (bug 1719554)
Backed out changeset 221ec418475c (bug 1719554)
2021-12-04 00:58:15 +02:00
Dan Minor 30ad309163 Bug 1719554 - Unify unicode::Script as intl::Script; r=platform-i18n-reviewers,gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D132278
2021-12-03 20:49:32 +00:00
Jonathan Kew c7fdc790cc Bug 1725297 - Remove expiring font telemetry probes. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D124051
2021-08-31 13:48:51 +00:00
Jonathan Kew f1d0b4bbe4 Bug 1725940 - patch 2 - Move nsFontCache from the device context to the prescontext. r=emilio
To look up/instantiate platform fonts based on CSS font properties, we create a gfxFontGroup from an nsFont and other attributes; this is currently cached in an nsFontCache attached to the nsDeviceContext.

However, this assumes that the mapping to platform fonts will be the same for all documents using the given device context. In a world where visibility of platform fonts to the page may be restricted, and may depend on the individual document (e.g. if the user disables tracking protection for a particular site), the mapping represented by nsFontCache may vary, and determining how to resolve a given font request will need access to the requesting document in order to know what visibility it is allowed.

To support this, this patch moves the nsFontCache from nsDeviceContext to nsPresContext. In itself, this should cause no visible change in behavior, but it provides a basis for the patches that will follow in bug 1715501.

It's likely that this will have some effects on individual performance tests, depending on the exact content and sequencing of page loads, because of changed caching behavior. E.g. having a per-presContext cache may sometimes mean that we no longer take advantage of a cached gfxFontGroup that a previously-loaded page created; but on the other hand the caches will tend to be smaller and have faster lookups.

My testing so far suggests that we will see some apparent regressions, alongside some improvements, but that overall there should be little change. I'd like to get this change landed separately, before any of the actual font-visibility behavior changes, so that we can more clearly see and isolate any unexpected effects.

Differential Revision: https://phabricator.services.mozilla.com/D122715
2021-08-16 13:58:03 +00:00
Jonathan Kew a0abb0f180 Bug 1717595 - Ensure we check the fontgroup's validity before using it to build a textrun or otherwise access its cached font instances. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D118733
2021-06-25 10:14:17 +00:00
Jonathan Kew 1f6b410fee Bug 1684497 - Hoist ResetGlyphRuns out of the conditional statement. r=heycam
This matches how it's done at the other callsite.
(Also add an assertion that would've caught the omission sooner.)

Differential Revision: https://phabricator.services.mozilla.com/D100779
2021-01-05 21:53:40 +00:00
Emilio Cobos Álvarez b9b9e38dd9 Bug 1646224 - Use mozilla::Length rather than nscoord to store font sizes. r=heycam,jfkthame
This avoids arbitrary precision loss when computing REM units and so on,
which is particularly important if we ever change the base of our app
units (but useful regardless).

Differential Revision: https://phabricator.services.mozilla.com/D79928
2020-06-22 09:45:40 +00:00
Cosmin Sabou 65d75a47f3 Backed out changeset 299e19193e11 (bug 1646224) for causing font related failures. CLOSED TREE 2020-06-18 18:26:51 +03:00
Emilio Cobos Álvarez 090e3d2409 Bug 1646224 - Use mozilla::Length rather than nscoord to store font sizes. r=heycam,jfkthame
This avoids arbitrary precision loss when computing REM units and so on,
which is particularly important if we ever change the base of our app
units (but useful regardless).

Differential Revision: https://phabricator.services.mozilla.com/D79928
2020-06-18 13:55:03 +00:00
Jonathan Kew 9ae6c0bed1 Bug 1619349 - patch 1 - Record statistics about font-matching behavior in the presContext. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D67787

--HG--
extra : moz-landing-system : lando
2020-04-02 01:38:18 +00:00
Ciure Andrei e1cb0f1e21 Backed out 4 changesets (bug 1619349, bug 1619350) for causing test_font_whitelist.html to fail CLOSED TREE
Backed out changeset ba16b09b5da0 (bug 1619349)
Backed out changeset f8ca02252dfc (bug 1619349)
Backed out changeset 01a2a527aa1a (bug 1619350)
Backed out changeset 67ee13868a44 (bug 1619350)
2020-04-02 04:34:31 +03:00
Jonathan Kew 82984492e6 Bug 1619349 - patch 1 - Record statistics about font-matching behavior in the presContext. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D67787

--HG--
extra : moz-landing-system : lando
2020-04-01 21:42:36 +00:00
Alex Henrie 74cc0f4dce Bug 1591490 - Use the NS_IS_SURROGATE_PAIR macro everywhere. r=Ehsan
Differential Revision: https://phabricator.services.mozilla.com/D50697

--HG--
extra : moz-landing-system : lando
2019-10-27 05:05:51 +00:00
Emilio Cobos Álvarez 11ea945833 Bug 1546697 - Use a consistent style for enum classes in layout. r=dholbert
Per the discussion in:

  https://groups.google.com/d/msg/mozilla.dev.platform/P79pwa9z5m8/iPYPAWPHCAAJ

They should be CamelCase, and that's what most of them already do. This converts
the rest, which are a few.

For the ones that already used `e` or `k` prefixes, I've mostly done:

 for file in $(rg Type::e layout | cut -d : -f 1 | sort | uniq); do sed -i 's#Type::e#Type::#g' $file; done

For the ones that used uppercase, I've removed the prefix if it was already in
the type name, and turn them into CamelCase.

Depends on D28680

Differential Revision: https://phabricator.services.mozilla.com/D28681

--HG--
extra : moz-landing-system : lando
2019-04-25 23:03:04 +00:00
Jonathan Kew c671cf4509 Bug 1533395 - Refactor gfxTextRange struct, moving the MatchType enum to gfxTypes.h as FontMatchType, and the struct inside gfxFontGroup as a local type. r=jwatt
This allows us to reduce #include usage of the massive gfxFont.h header,
and keeps this specialized kind of TextRange struct local to where it's used.

Differential Revision: https://phabricator.services.mozilla.com/D22904

--HG--
extra : moz-landing-system : lando
2019-04-01 14:32:06 +00:00
Emilio Cobos Álvarez d2cbf071d5 Bug 1528712 - Remove nsFont::featureValueLookup. r=jfkthame
It's a global object, it doesn't have to be stored in nsFont. Pass it from the
caller like the user font set and co.

Depends on D20141

Differential Revision: https://phabricator.services.mozilla.com/D20142
2019-02-19 14:54:04 +01:00
Ciure Andrei 965d533ca4 Backed out 2 changesets (bug 1528712) for Linux spcshell and reftest failures (test_ext_browserSettings.js, 1022481-1.html) CLOSED TREE
Backed out changeset 2d5c4e71e258 (bug 1528712)
Backed out changeset d981515b874b (bug 1528712)
2019-02-19 14:25:57 +02:00
Emilio Cobos Álvarez f97a9f50a2 Bug 1528712 - Remove nsFont::featureValueLookup. r=jfkthame
It's a global object, it doesn't have to be stored in nsFont. Pass it from the
caller like the user font set and co.

Depends on D20141

Differential Revision: https://phabricator.services.mozilla.com/D20142

--HG--
extra : moz-landing-system : lando
2019-02-18 14:03:47 +00:00
Sylvestre Ledru 265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Emilio Cobos Álvarez fffb25b74f Bug 1465585: Switch from mozilla::Move to std::move. r=froydnj
This was done automatically replacing:

  s/mozilla::Move/std::move/
  s/ Move(/ std::move(/
  s/(Move(/(std::move(/

Removing the 'using mozilla::Move;' lines.

And then with a few manual fixups, see the bug for the split series..

MozReview-Commit-ID: Jxze3adipUh
2018-06-01 10:45:27 +02:00
Jonathan Kew 288d62fe84 Bug 1427660 - patch 1 - Make gfxTextRange::MatchType an enum class for stronger type checking (no functional change). r=lsalzman 2018-05-11 08:56:12 +01:00
Jonathan Watt 156c4af1ec Bug 1436048: Use user defined types for font-stretch / font-style. r=jfkthame,jwatt
Co-authored-by: Emilio Cobos Álvarez <emilio@crisal.io>

MozReview-Commit-ID: 7ONYtICeAqb
2018-04-23 18:22:05 +02:00
Jonathan Watt 1e7f76576a Bug 1436048 part 1 - Use a user defined type for font weight everywhere. r=jfkthame,emilio
--HG--
extra : rebase_source : 2e267ff99de6f52484e34ac15c39e5ca8b473394
2018-04-13 20:34:37 +01:00
Emilio Cobos Álvarez e341b20ec4 Bug 1447483: Merge nsStyleContext and ServoStyleContext, rename to ComputedStyle. r=jwatt on a CLOSED TREE
MozReview-Commit-ID: JPopq0LudD
2018-03-22 20:06:24 +01:00
Emilio Cobos Álvarez 5dd797f154 Back out changeset b683bb3f22a1 (Bug 1447483) for not landing with all the files. r=me on a CLOSED TREE
This reverts commit 1808914126bb9f9e4a82d2c3d7ac961885fe7d62.

MozReview-Commit-ID: 5skESBseEvo
2018-03-22 20:05:22 +01:00
Emilio Cobos Álvarez ca5ac79cca Bug 1447483: Merge nsStyleContext and ServoStyleContext, rename to ComputedStyle. r=jwatt
MozReview-Commit-ID: JPopq0LudD
2018-03-22 19:48:42 +01:00
Daniel Holbert 7f66b8109f Bug 1438020: Add some includes for "Inlines" headers to address clang build warnings in non-unified build. r=mats
MozReview-Commit-ID: HRHnjznPjx1

--HG--
extra : rebase_source : f0500a1c68a823a4583093a25f1a9fcf97aa1515
2018-02-13 14:38:20 -08:00
Daniel Holbert 680815cd6e Bug 1412346 part 5: (automated patch) Switch a bunch of C++ files in layout to use our standard mode lines. r=jfkthame
This patch was generated automatically by the "modeline.py" script, available
here: https://github.com/amccreight/moz-source-tools/blob/master/modeline.py

For every file that is modified in this patch, the changes are as follows:
 (1) The patch changes the file to use the exact C++ mode lines from the
     Mozilla coding style guide, available here:
https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Coding_Style#Mode_Line

 (2) The patch deletes any blank lines between the mode line & the MPL
     boilerplate comment.

 (3) If the file previously had the mode lines and MPL boilerplate in a
     single contiguous C++ comment, then the patch splits them into
     separate C++ comments, to match the boilerplate in the coding style.

MozReview-Commit-ID: EuRsDue63tK

--HG--
extra : rebase_source : 3356d4b80ff6213935192e87cdbc9103fec6084c
2017-10-27 10:33:53 -07:00
Jonathan Kew 4b5525bbf7 Bug 1362167 - Use strongly-typed enum classes instead of generic uint16_t fields for the gfxShapedText and gfxTextRun flags. r=jrmuizel 2017-05-04 22:27:05 +01:00
Jonathan Kew 6fc5313103 Bug 1362167 - Split gfxShapedText.mFlags into two 16-bit flags fields, and arrange storage more compactly to reduce size of gfxShapedWord and gfxTextRun objects. r=jrmuizel 2017-05-04 22:25:16 +01:00
Jonathan Kew 95a82f84cc Bug 1280887 - patch 2 - Make gfxTextRun refcounted, replace usage of UniquePtr<> with RefPtr<> for textruns, and make nsTextFrame hold a strong reference to its run(s). r=mats 2016-08-19 13:14:22 +01:00
Jonathan Kew c60f6a1ae4 Bug 1266391 - Introduce an enum class mozilla::unicode::Script, and use this instead of bare integers to specify script codes for better type checking. r=masayuki 2016-04-21 18:58:59 +01:00
Jonathan Kew 040843e80f Bug 1266341 - Pass the right kind of enum constants for script codes. r=masayuki 2016-04-21 16:31:46 +01:00
Jonathan Kew cb1c20b3c3 Bug 1265459 - Replace uses of nsAutoPtr<gfxTextRun> with UniquePtr, and let MakeTextRun and similar methods return a UniquePtr. r=jrmuizel 2016-04-19 17:13:28 +01:00