Commit Graph

1699 Commits

Author SHA1 Message Date
Daniel Holbert
87fde64340 Bug 1797143: Remove unnecessary null-check for infallible append to an AutoTArray in nsTextFrame.cpp. r=layout-reviewers,TYLin,emilio
As noted in nsTArray.h, "nsTArray, CopyableTArray, AutoTArray [...] are
infallible by default" (unless you explicitly pass mozilla::fallible, and we
don't do that here.)

So, there's no need to check for failure.

Differential Revision: https://phabricator.services.mozilla.com/D160099
2022-10-24 19:17:21 +00:00
Daniel Holbert
ebca2aea68 Bug 1796697 part 2: Remove gfxSkipCharsIterator's dummy no-arg constructor, as well as its associated now-unnecessary "IsInitialized()" API. r=jfkthame
This patch doesn't change behavior.

This no-arg constructor only had one inadvertent usage -- it was used to
default-initialize one of ClusterIterator's member-vars, just before we
reassign it to something else in the constructor body.  (I'm fixing that here
by explicitly constructing that member-var up-front in the init list, rather
than in the constructor body.)

Depends on D159902

Differential Revision: https://phabricator.services.mozilla.com/D159903
2022-10-24 14:06:12 +00:00
Jonathan Kew
ee7fe6a9b9 Bug 1791782 - Connect CSS font-palette features to rendering via the presContext. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D157959
2022-10-07 23:00:46 +00:00
Jonathan Kew
1cb050b2e6 Bug 1791780 - Support custom color font palettes in the COLR-font rendering code. r=gfx-reviewers,lsalzman
This creates the gfx support needed to use alternate palettes, though not yet connected
to the CSS rules/properties to define and access them.

Differential Revision: https://phabricator.services.mozilla.com/D157958
2022-10-07 23:00:45 +00:00
Noemi Erli
5bff78ad47 Backed out 9 changesets (bug 1791778, bug 1791782, bug 1791780, bug 1791777) for causing build bustages in TestCOLRv1.cpp CLOSED TREE
Backed out changeset aeb44b79bf31 (bug 1791782)
Backed out changeset 292fd3a1b6dd (bug 1791782)
Backed out changeset 9947218170d0 (bug 1791780)
Backed out changeset 528b4c022a44 (bug 1791778)
Backed out changeset c734ff661a66 (bug 1791778)
Backed out changeset 6585dd386ee3 (bug 1791777)
Backed out changeset af4243189ef1 (bug 1791777)
Backed out changeset a47ae5f76514 (bug 1791777)
Backed out changeset 24ce615e77fd (bug 1791777)
2022-10-08 00:08:57 +03:00
Jonathan Kew
68ba474c47 Bug 1791782 - Connect CSS font-palette features to rendering via the presContext. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D157959
2022-10-07 18:58:53 +00:00
Jonathan Kew
cc9413e7f3 Bug 1791780 - Support custom color font palettes in the COLR-font rendering code. r=gfx-reviewers,lsalzman
This creates the gfx support needed to use alternate palettes, though not yet connected
to the CSS rules/properties to define and access them.

Differential Revision: https://phabricator.services.mozilla.com/D157958
2022-10-07 18:58:52 +00:00
Cristian Tuns
7e076fb429 Backed out 9 changesets (bug 1791777, bug 1791780, bug 1791778, bug 1791782) for causing build bustages on TestCOLRv1.cpp CLOSED TREE
Backed out changeset f145a34cfbc1 (bug 1791782)
Backed out changeset 2f12216fbeda (bug 1791782)
Backed out changeset 61bd2a4496bf (bug 1791780)
Backed out changeset 4e4eb99a7fd9 (bug 1791778)
Backed out changeset 32d171a28810 (bug 1791778)
Backed out changeset e317795cd27a (bug 1791777)
Backed out changeset 5e32d5a01917 (bug 1791777)
Backed out changeset cf87497dbead (bug 1791777)
Backed out changeset 586c735b005e (bug 1791777)
2022-10-07 13:46:43 -04:00
Jonathan Kew
e532c384de Bug 1791782 - Connect CSS font-palette features to rendering via the presContext. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D157959
2022-10-07 16:53:36 +00:00
Jonathan Kew
664be397c0 Bug 1791780 - Support custom color font palettes in the COLR-font rendering code. r=gfx-reviewers,lsalzman
This creates the gfx support needed to use alternate palettes, though not yet connected
to the CSS rules/properties to define and access them.

Differential Revision: https://phabricator.services.mozilla.com/D157958
2022-10-07 16:53:35 +00:00
Norisz Fay
c89c407e10 Backed out 9 changesets (bug 1791780, bug 1791782, bug 1791778, bug 1791777) for causing multiple mochitest failures CLOSED TREE
Backed out changeset 6de1ade5a9b6 (bug 1791782)
Backed out changeset ce96452a38a1 (bug 1791782)
Backed out changeset 7cc8e027f5a7 (bug 1791780)
Backed out changeset 8e023280032c (bug 1791778)
Backed out changeset 26d65d76d02a (bug 1791778)
Backed out changeset a98dd552df64 (bug 1791777)
Backed out changeset 766386309ee5 (bug 1791777)
Backed out changeset 7de66a218ba4 (bug 1791777)
Backed out changeset 1d17c257444e (bug 1791777)
2022-10-07 17:36:38 +03:00
Jonathan Kew
77713230cf Bug 1791782 - Connect CSS font-palette features to rendering via the presContext. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D157959
2022-10-07 12:16:53 +00:00
Jonathan Kew
6b83887095 Bug 1791780 - Support custom color font palettes in the COLR-font rendering code. r=gfx-reviewers,lsalzman
This creates the gfx support needed to use alternate palettes, though not yet connected
to the CSS rules/properties to define and access them.

Differential Revision: https://phabricator.services.mozilla.com/D157958
2022-10-07 12:16:53 +00:00
Frederic Wang
e4111e3a6b 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
Nathan LaPre
ca16d83e39 Bug 1776928 - avoid backplating text that is entirely whitespace in HCM, r=morgan
Some sites use text content that consists entirely of whitespace, which can
lead to unexpected rendering in High Contrast Mode - namely, backplating of
invisible characters. This commit adds logic that detects text nodes consisting
entirely of whitespace and reports their text area as 0. This commit also adds
a test for the behavior, and modifies an existing test to reflect the new
behavior.

Differential Revision: https://phabricator.services.mozilla.com/D155248
2022-08-23 19:41:59 +00:00
Ting-Yu Lin
06ddbd2b65 Bug 1464761 Part 4 - Remove nsReflowStatus::mTruncated bit. r=dholbert
In the description of the mTruncated bit, its purpose is the same as calling
SetInlineLineBreakBeforeAndReset(). We've removed all its usages in previous
patches, so the bit is no longer needed.

Differential Revision: https://phabricator.services.mozilla.com/D151461
2022-07-27 21:55:18 +00:00
Andrew Osmond
66c6bad8f6 Bug 1779519 - gfxFontCache expiration tracker operations should be more atomic. r=jfkthame
gfxFontCache acquires and releases its mutex during various operations.
In order to keep the state internally consistent, we should only release
the lock after the full operation is complete. This involves moving the
deletion of gfxFont to outside the lock via a temporary discard array.

The expiration state should not be protected by the gfxFont's mutex
since we don't hold it during most operations. Instead we should hold
gfxFontCache's mutex because then we can guarantee the operation is
atomic, particularly when a worker wants a font, and the main thread is
aging the generations.

When a font is returned from gfxFontCache, we now return it already
removed from the tracker, and with its refcount updated. This avoids any
potential races between the expiration timer and a worker accessing the
font, as well as simplying the callers so they don't need to be aware of
addref-ing manually in case the result is to be discarded (so that it
gets readded to the tracker).

Differential Revision: https://phabricator.services.mozilla.com/D151821
2022-07-14 19:53:09 +00:00
criss
380e3e436f Backed out changeset e4cd98b5984d (bug 1779519) for causing build bustages. CLOSED TREE 2022-07-14 22:06:53 +03:00
Andrew Osmond
8cb302b7c5 Bug 1779519 - gfxFontCache expiration tracker operations should be more atomic. r=jfkthame
gfxFontCache acquires and releases its mutex during various operations.
In order to keep the state internally consistent, we should only release
the lock after the full operation is complete. This involves moving the
deletion of gfxFont to outside the lock via a temporary discard array.

The expiration state should not be protected by the gfxFont's mutex
since we don't hold it during most operations. Instead we should hold
gfxFontCache's mutex because then we can guarantee the operation is
atomic, particularly when a worker wants a font, and the main thread is
aging the generations.

When a font is returned from gfxFontCache, we now return it already
removed from the tracker, and with its refcount updated. This avoids any
potential races between the expiration timer and a worker accessing the
font, as well as simplying the callers so they don't need to be aware of
addref-ing manually in case the result is to be discarded (so that it
gets readded to the tracker).

Differential Revision: https://phabricator.services.mozilla.com/D151821
2022-07-14 18:35:49 +00:00
Emilio Cobos Álvarez
9b20825c61 Bug 1777135 - Part 2: Improve nsNativeTheme::IsDarkBackground by accounting for default bg color. r=dholbert
Since callers want just an effective color to compute whether it's dark,
we simplify the API a bit too.

This makes sure we find the dark background in plain text documents.

Differential Revision: https://phabricator.services.mozilla.com/D151018
2022-07-12 09:51:47 +00:00
Jonathan Kew
8d4ff7b979 Bug 1774851 - Apply the proper directionality when creating the hyphenate-character textrun. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D150318
2022-06-28 12:40:18 +00:00
Emilio Cobos Álvarez
1c58e2a928 Bug 1773070 - Unify Gecko and Servo EventState/ElementState bits. r=smaug
Add a dom/base/rust crate called just "dom" where we can share these.

Most of the changes are automatic:

  s/mozilla::EventStates/mozilla::dom::ElementState/
  s/EventStates/ElementState/
  s/NS_EVENT_STATE_/ElementState::/
  s/NS_DOCUMENT_STATE_/DocumentState::/

And so on. This requires a new cbindgen version to avoid ugly casts for
large shifts.

Differential Revision: https://phabricator.services.mozilla.com/D148537
2022-06-07 23:09:52 +00:00
Jonathan Kew
48e857f289 Bug 1770981 - Split the nsBlockFrame "line cursor" into separate cursors used for display-list building vs frame queries. r=layout-reviewers,Jamie,emilio
Differential Revision: https://phabricator.services.mozilla.com/D147203
2022-05-26 16:32:10 +00:00
Morgan Reschenberg
fec4277327 Bug 1735101: Adjust GetCharacterRectsInRange to return physical coordinates for RtL text r=emilio,Jamie
Differential Revision: https://phabricator.services.mozilla.com/D144767
2022-04-29 17:30:59 +00:00
Noemi Erli
c9b2cebd5c Backed out changeset 7985a1fa0789 (bug 1764768) for causing multiple failures CLOSED TREE 2022-04-20 22:25:02 +03:00
Emilio Cobos Álvarez
e1ac6cb990 Bug 1764768 - Don't truncate viewport units at computed value time. r=dholbert
Instead, make the behavior consistent across all <length-percentage>
values (by truncating instead of rounding). This is the already-existing
behavior for calc() and percentages, but with this patch we also apply
it to plain length-flavored <length-percentage> values (this is needed
to avoid regressing things like bug 989802).

Regular <length>s keep rounding, to preserve existing behavior. We can
consider changing that in a follow-up if need be.

Differential Revision: https://phabricator.services.mozilla.com/D143857
2022-04-20 17:22:36 +00:00
Mathew Hodson
bbe90472d4 Bug 1751828 - Clamp the inline size when reflowing text. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D140447
2022-03-09 09:16:31 +00:00
Marian-Vasile Laza
75891c19e6 Backed out changeset d161da1543bc (bug 1751828) for causing crashtest failures on 459968.html. 2022-03-08 08:55:17 -08:00
Mathew Hodson
35ff4178ef Bug 1751828 - Clamp the inline size when reflowing text. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D140447
2022-03-08 11:05:16 +00:00
Emilio Cobos Álvarez
9651b4c81a Bug 1756750 - Add a missing null-check.
MANUAL PUSH: Trivial crashtest fix CLOSED TREE
2022-03-02 17:19:33 +01:00
Emilio Cobos Álvarez
d5c309494c Bug 1756750 - Ensure we observe SVG glyph changes inside <svg:text>. r=jfkthame
This gets done usually in BreakSink::Finish, but we don't do
line-breaking in SVG Text so we need to do this here instead.

Do you know where I could crib a test for this?

Depends on D139964

Differential Revision: https://phabricator.services.mozilla.com/D139965
2022-03-02 14:31:58 +00:00
Emilio Cobos Álvarez
6722ec55a2 Bug 1757230 - Avoid unneeded includes in nsTextFrame.h. r=longsonr
Move stuff to the C++ file where possible, and move ClipEdges to
nsTextFrame since it's the only thing using it (rather than keeping it
in nsDisplayText).

Also avoids a RemoteBrowser.h include from nsDisplayList.h while at it.

This came up in https://phabricator.services.mozilla.com/D137271#inline-768125

Differential Revision: https://phabricator.services.mozilla.com/D139759
2022-02-25 22:18:11 +00:00
Ting-Yu Lin
830637b4c9 Bug 1756008 Part 3 - Rename nsLineLayout::mBlockReflowInput. r=layout-reviewers,emilio
Its type is not `BlockReflowInput` but an ordinary `ReflowInput`. Rename it to
`mLineContainerRI` to match its accessor.

While I'm here, I change `mLineContainerRI` to be a reference since it cannot be
nullptr (see nsLineLayout's constructor); also, replace
`mLineContainerRI->mFrame` with `LineContainerFrame()`.

Differential Revision: https://phabricator.services.mozilla.com/D139438
2022-02-23 21:22:43 +00:00
Jonathan Kew
d8886ac7f7 Bug 1751738 - Check textframe writing mode when generating/drawing a soft-hyphen textrun. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D136910
2022-01-25 23:27:23 +00:00
Miko Mynttinen
a65a273fd8 Bug 1697979 - Part 1: Reuse previously built stacking context display items without merging r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D128413
2022-01-22 02:37:31 +00:00
Alexandru Michis
dce8504d76 Backed out 3 changesets (bug 1697979) for causing reftest failures in retained-dl-displayport-1.html
Backed out changeset e4248d811360 (bug 1697979)
Backed out changeset db3882cc536c (bug 1697979)
Backed out changeset ea7ce38abaab (bug 1697979)
2022-01-21 04:01:27 +02:00
Miko Mynttinen
55ab9e83dd Bug 1697979 - Part 1: Reuse previously built stacking context display items without merging r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D128413
2022-01-21 00:43:34 +00:00
Noemi Erli
47edcb7964 Backed out 3 changesets (bug 1697979) for causing reftest failures CLOSED TREE
Backed out changeset 4edb10a45d13 (bug 1697979)
Backed out changeset 456b57492294 (bug 1697979)
Backed out changeset 1cb3b14f2f6c (bug 1697979)
2022-01-20 22:25:00 +02:00
Miko Mynttinen
cc5862abeb Bug 1697979 - Part 1: Reuse previously built stacking context display items without merging r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D128413
2022-01-20 18:38:59 +00:00
Jonathan Kew
b99a6703b1 Bug 1751103 - Short-circuit AdvanceToNextTab when tab-size is zero. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D136480
2022-01-20 13:58:14 +00:00
Ting-Yu Lin
18989890b3 Bug 1745113 Part 3 - Change CountGraphemeClusters() to take a Span parameter. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D135641
2022-01-13 18:36:04 +00:00
Emilio Cobos Álvarez
945e00490a Bug 1747922 - Rename StyleMathMLMathVariant -> StyleMathVariant.
MANUAL PUSH: Trivial rename.
2021-12-30 02:35:54 +01:00
Neia Finch
a3e861c2e1 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
Jonathan Kew
d45a6027c4 Bug 1746187 - Implement rendering support for hyphenate-character. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D133890
2021-12-16 13:47:56 +00:00
Marian-Vasile Laza
f94b4ad3f5 Backed out 4 changesets (bug 1746187) for causing xpcshell failures on test_css-properties-db.js.
Backed out changeset fa4f889dd0d3 (bug 1746187)
Backed out changeset e3fce2273109 (bug 1746187)
Backed out changeset 6733677ad35d (bug 1746187)
Backed out changeset a4375ff93414 (bug 1746187)
2021-12-16 04:51:13 +02:00
Jonathan Kew
8b1b478d28 Bug 1746187 - Implement rendering support for hyphenate-character. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D133890
2021-12-15 23:16:49 +00:00
Nika Layzell
0e975d0e8d Bug 1741665 - Align nsCString's public size_type better with other C++ APIs, r=mccr8,geckoview-reviewers,agi
Differential Revision: https://phabricator.services.mozilla.com/D131422
2021-12-13 21:47:56 +00:00
Jonathan Kew
a5581f4e1c Bug 1742626 - Attempt to improve Indic-script ::first-letter behavior by not allowing a boundary after a ligated virama in scripts that use half-consonant forms. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D132373
2021-12-08 15:42:55 +00:00
Dan Minor
237b40ae17 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
Miko Mynttinen
0ef5ab223a Bug 1743637 - Fix array out of bounds in nsTextFrame::ToCString r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D132498
2021-12-06 14:44:55 +00:00