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

749 Коммитов

Автор SHA1 Сообщение Дата
Bas Schouten 469ae76354 Bug 1730772: Do not use GDI classic rendering when rendering Canvas. r=jfkthame,jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D125982
2021-09-19 21:10:35 +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
Mats Palmgren 14c9063444 Bug 1706080 - [css-fonts] Implement 'font-synthesis: small-caps'. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D114313
2021-08-09 21:41:34 +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
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 fd668cd57a Bug 1703213 - Disallow soft line break between adjacent IDEOGRAPHIC SPACE characters. r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D111065
2021-04-08 09:41:48 +00:00
Jonathan Kew 87da9bf675 Bug 1694123 - Pass userfont source index to font loader and decoder tasks, to avoid potential race with the field in the gfxUserFontEntry being reset on the main thread. r=layout-reviewers,emilio
This is a preliminary step that is needed in order for the following patch to be safe. (It's
mostly just plumbing, although the patch looks big because we need to pass the index through
so many functions.)

The issue is that loading a font resource involves a couple of tasks that happen asynchronously -
fetching the data from the network, and decoding/sanitizing the font data. We have an implicit
assumption that once a font load has been initiated, the state of the associated gfxUserFontEntry
will not change; in particular, we depend on mSrcIndex remaining constant, because we may use it
to index into the mSrcList array and access the gfxFontFaceSrc record again in the various
completion tasks that are executed after the async steps finish.

But the following patch breaks this assumption, because it may reset mSrcIndex at arbitrary times
when we discover that we need to re-resolve the @font-face to potentially recognize a src:local()
resource that was earlier in the list, but was previously unavailable. If this happens while
a font-load is doing its off-main-thread work, then when it completes, it will end up accessing
the wrong gfxFontFaceSrc record, which would result at least in incorrect behavior, but can also
result in a crash (e.g. if the record is of the wrong type altogether, such as trying to use the
principal or URI fields from a record of type src:local).

To avoid this problem, we should pass the source index at the time the font load is initiated
through to the OMT tasks and back to their main-thread completion routines, so that we do not
depend on the field in the gfxUserFontEntry remaining frozen. This makes the loading process
safe even if the source index in the entry gets reset while loading tasks are in progress.

Differential Revision: https://phabricator.services.mozilla.com/D110911
2021-04-06 16:23:17 +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
Jonathan Kew 6aa01e5aa4 Bug 1681691 - Add support for metrics overrides to gfxUserFontEntry, dom::FontFace, etc r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D109289
2021-03-23 17:10:24 +00:00
Simon Giesecke cafe2c9d00 Bug 708901 - Migrate to nsTHashSet in gfx/thebes. r=jfkthame,jrmuizel
Depends on D108602

Differential Revision: https://phabricator.services.mozilla.com/D108603
2021-03-23 10:36:36 +00:00
smolnar 03eae2c9a5 Backed out 8 changesets (bug 1681691) for causing wpt failures in idlharness.https.html. CLOSED TREE
Backed out changeset dda736a69ceb (bug 1681691)
Backed out changeset 64edecd0df6f (bug 1681691)
Backed out changeset a19844063d00 (bug 1681691)
Backed out changeset 5dd06c73f703 (bug 1681691)
Backed out changeset 1bc4081f95e4 (bug 1681691)
Backed out changeset e7887dc9a3c6 (bug 1681691)
Backed out changeset d9b488c09c23 (bug 1681691)
Backed out changeset b45b607fee4d (bug 1681691)
2021-03-23 12:00:39 +02:00
Jonathan Kew 31e403716c Bug 1681691 - Add support for metrics overrides to gfxUserFontEntry, dom::FontFace, etc r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D109289
2021-03-23 08:37:07 +00:00
Cosmin Sabou 193a73a5ea Backed out 10 changesets (bug 1681691) for wpt failures on fontface-override-descriptor-getter-setter.sub.html and idlharness.https.html. CLOSED TREE
Backed out changeset e43fba82fb31 (bug 1681691)
Backed out changeset 104675869016 (bug 1681691)
Backed out changeset 536bbc4b9ecd (bug 1681691)
Backed out changeset bb53155c3dd0 (bug 1681691)
Backed out changeset 9f9c3c13801a (bug 1681691)
Backed out changeset af79bc7f7919 (bug 1681691)
Backed out changeset e86d980f511e (bug 1681691)
Backed out changeset 12418707741d (bug 1681691)
Backed out changeset 8d5c2106a2b4 (bug 1681691)
Backed out changeset 4805e23e62d2 (bug 1681691)
2021-03-22 20:37:38 +02:00
Jonathan Kew 9c404e3453 Bug 1681691 - Add support for metrics overrides to gfxUserFontEntry, dom::FontFace, etc r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D109289
2021-03-22 15:40:54 +00:00
Simon Giesecke b9621d6376 Bug 1695162 - Use range-based for instead of custom hashtable iterators. r=xpcom-reviewers,kmag
Differential Revision: https://phabricator.services.mozilla.com/D108585
2021-03-17 15:49:46 +00:00
Simon Giesecke ad01a10a3b Bug 1634281 - Use nsTHashMap instead of nsDataHashtable. r=xpcom-reviewers,necko-reviewers,jgilbert,nika,valentin
Note that this patch only transforms the use of the nsDataHashtable type alias
to a directly equivalent use of nsTHashMap. It does not change the specification
of the hash key type to make use of the key class deduction that nsTHashMap
allows for in some cases. That can be done in a separate step, but requires more
attention.

Differential Revision: https://phabricator.services.mozilla.com/D106008
2021-03-10 10:47:47 +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 971b645fe3 Bug 1660470 - Add missing include directives/forward declarations. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D87865
2020-11-23 16:21:38 +00:00
Jonathan Kew 16eb1dba68 Bug 1674340 - Separate out language from gfxFontStyle and pass it separately to shaping processes that need it. r=lsalzman
This allows us to avoid instantiating separate gfxFont objects when content is tagged
with different 'lang' attributes, yet ends up using the same fonts (e.g. Wikipedia may
use a default font such as Arial for language names/links that are tagged with several
dozen different languages).

Differential Revision: https://phabricator.services.mozilla.com/D96978
2020-11-13 13:15:39 +00:00
Jonathan Kew 6dc05ab6ef Bug 1665773 - Ensure CompressedGlyph::SetComplex() always clears the glyphCount to zero; let gfxShapedText::SetDetailedGlyphs() own the setting of this field. r=heycam
We also rearrange bits in the CompressedGlyph so that the advance field doesn't need to be shifted,
and remove unnecessary glyphCount parameters from various setter methods.

Differential Revision: https://phabricator.services.mozilla.com/D90678
2020-09-30 21:16:44 +00:00
Jonathan Kew 3c2cb7fd1a Bug 1371386 - Take account of requirements for emoji-style or text-style presentation during font selection & fallback. r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D87304
2020-08-26 09:31:58 +00:00
Mihai Alexandru Michis b162701621 Backed out changeset 0cad1ef724ee (bug 1371386) for causing failures in emoji-fallback-3.html
CLOSED TREE
2020-08-24 21:02:10 +03:00
Jonathan Kew ba87878325 Bug 1371386 - Take account of requirements for emoji-style or text-style presentation during font selection & fallback. r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D87304
2020-08-24 14:24:12 +00:00
Jonathan Kew 95e0f6f509 Bug 1655364 - Rename gfxShapedText::SetGlyphs to SetDetailedGlyphs and make it just set glyph information, not clobber character-type flags. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D85187
2020-07-30 11:48:06 +00:00
Mihai Alexandru Michis 78c470dbaa Backed out changeset 3c88adc13a06 (bug 1655364) for causing assertion failures regarding glyphs.
CLOSED TREE
2020-07-30 13:25:04 +03:00
Jonathan Kew ab3b20c648 Bug 1655364 - Rename gfxShapedText::SetGlyphs to SetDetailedGlyphs and make it just set glyph information, not clobber character-type flags. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D85187
2020-07-30 07:56:05 +00:00
Jonathan Kew 6cb63be4a2 Bug 1640293 - Remove EARLY_BETA_OR_EARLIER conditional, so that word-cache expiration is enabled for all builds. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D76553
2020-05-22 21:52:27 +00:00
Jonathan Kew 230f11b26b Bug 1629787 - Initialize font metrics via harfbuzz API rather than reading tables directly, so that variations are respected. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D71029

--HG--
extra : moz-landing-system : lando
2020-04-15 14:14:55 +00:00
Andreas Farre f2fa2e633c Bug 1620594 - Part 5: Use GetMainThreadSerialEventTarget instead of SystemGroup::EventTargetFor. r=nika
This patch also tries to remove the event target entirely if it would
default to the main thread on a null event target.

Depends on D67634

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

--HG--
extra : moz-landing-system : lando
2020-04-07 15:17:07 +00:00
Jonathan Kew 684a3ccf96 Bug 1624827 - Synthesize a space for U+3000 in preference to relying on font fallback. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D68181

--HG--
extra : moz-landing-system : lando
2020-03-26 00:08:40 +00:00
Andrew Osmond 91b071ed14 Bug 1618345 - Enforce proper color management by splitting gfx::Color into sRGBColor and DeviceColor types. r=jrmuizel
gfx::Color is currently misused in many places. The DrawTargets expect
the color space to be in device space, e.g. what we are actually going
to draw using. Everything sitting above generally deals with sRGB, as
specified in CSS. Sometimes we missed the conversion from sRGB to device
space when issuing draw calls, and similarly sometimes we converted the
color to device space twice.

This patch splits the type in two. sRGBColor and DeviceColor now
represent sRGB and device color spaces respectively. DrawTarget only
accepts DeviceColor, and one can get a DeviceColor from an sRGBColor via
the ToDeviceColor helper API. The reftests now pass with color
management enabled for everything (e.g. CSS) instead of just tagged
raster images.

There will be a follow up patch to enable color management everywhere by
default on all supported platforms.

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

--HG--
extra : moz-landing-system : lando
2020-03-09 14:16:17 +00:00
Jonathan Kew e1a0b48294 Bug 1620125 - Don't assume mVerticalMetrics has necessarily been initialized before DrawOneGlyph is called. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D65567

--HG--
extra : moz-landing-system : lando
2020-03-05 18:07:17 +00:00
Jonathan Kew f7cf3de506 Bug 1616995 - patch 2 - Support vertical skew for upright-vertical fonts in webrender. r=lsalzman
Depends on D63893

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

--HG--
extra : moz-landing-system : lando
2020-02-28 15:36:19 +00:00
Jonathan Kew b6b828ed19 Bug 1616995 - patch 1 - Correct the axis of skew for synthetic-oblique glyphs in upright-vertical mode. r=lsalzman
This corrects the direction of the skew for non-WebRender drawing.

For WR, I guess we'll need to adjust the matrix that's generated in
FontTransform::synthesize_italics (or something like that).

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

--HG--
extra : moz-landing-system : lando
2020-02-28 14:55:39 +00:00
Jonathan Kew ab65dd885f Bug 1612822 - Refactor text decoration offset/thickness computations. r=emilio
We replace SetWidthIfLength and SetOffsetIfLength with ComputeDecorationLine{Thickness,Offset} functions,
and consolidate more of the computation of the offset within this function to simplify callers.

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

--HG--
extra : moz-landing-system : lando
2020-02-03 14:38:47 +00:00
Jonathan Kew 4a6c3ec3f6 Bug 1611610 - Don't increase glyph advance for synthetic bold if the glyph is zero-width. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D61065

--HG--
extra : moz-landing-system : lando
2020-01-25 15:43:45 +00:00
Jonathan Kew f360407017 Bug 1611589 - Fix precedence of font-feature-settings vs disabling of ligatures due to letter-spacing. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D61060

--HG--
extra : moz-landing-system : lando
2020-01-25 12:18:00 +00:00
Chris Peterson 406763af7f Bug 1570499 - Part 1: Replace MOZ_FALLTHROUGH macro with C++17's [[fallthrough]] attribute. r=froydnj
This changeset is a simple find and replace of `MOZ_FALLTHROUGH` and `[[fallthrough]]`.

Unfortunately, the MOZ_FALLTHROUGH_ASSERT macro (to assert on case fallthrough in debug builds) is still necessary after switching from [[clang::fallthrough]] to [[fallthrough]] because:

* MOZ_ASSERT(false) followed by [[fallthrough]] triggers a -Wunreachable-code warning in DEBUG builds
* but MOZ_ASSERT(false) without [[fallthrough]] triggers a -Wimplicit-fallthrough warning in NDEBUG builds.

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

--HG--
extra : moz-landing-system : lando
2019-12-20 07:16:43 +00:00
shravanrn@gmail.com bfd31f93d3 Bug 1569369 - Add RLBox verifications to tainted data from sandboxed libGraphite r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D42725

--HG--
extra : moz-landing-system : lando
2019-12-19 16:05:47 +00:00
Brindusan Cristian 858cf4323e Backed out 2 changesets (bug 1569369, bug 1566288) for build bustages at rlbox_sandbox.hpp. CLOSED TREE
Backed out changeset 75d775daa792 (bug 1569369)
Backed out changeset 0bc20fd26ca0 (bug 1566288)
2019-12-18 13:53:56 +02:00
shravanrn@gmail.com 8f13634411 Bug 1569369 - Add RLBox verifications to tainted data from sandboxed libGraphite r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D42725

--HG--
extra : moz-landing-system : lando
2019-12-16 07:43:21 +00:00
Jonathan Kew ad9a50096d Bug 1599841 - Invert the direction of details->mOffset.x when doing "mirrored" measurement of RTL glyph runs. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D55709

--HG--
extra : moz-landing-system : lando
2019-12-09 17:34:41 +00:00
Daniel Varga 67c3c4b0c0 Backed out 1 changesets (bug 1599841) for causing reftest failures at tests/layout/reftests/bugs/1562733-rotated-nastaliq-1.html
CLOSED TREE

Backed out changeset d0f23fdfc04b (bug 1599841)
2019-12-09 19:20:43 +02:00
Jonathan Kew 2840ed04e9 Bug 1599841 - Invert the direction of details->mOffset.x when doing "mirrored" measurement of RTL glyph runs. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D55709

--HG--
extra : moz-landing-system : lando
2019-12-09 15:19:43 +00:00
Daniel Varga 85b60ab28d Backed out 2 changesets (bug 1599841) for causing reftest failures at tests/reftest/tests/layout/reftests/bugs/1599841-1.html
CLOSED TREE

Backed out changeset a7a57d54b008 (bug 1599841)
Backed out changeset 6f03a144b7b0 (bug 1599841)
2019-12-09 17:14:56 +02:00