Commit Graph

1861 Commits

Author SHA1 Message Date
Masayuki Nakano
4e6fcb1183 Bug 1943228 - Rename methods GetSomethingWithoutCreation() to GetExtantSomething() r=edgar,dom-core
Differential Revision: https://phabricator.services.mozilla.com/D235256
2025-01-23 23:47:28 +00:00
Jonathan Kew
b7a8f00f5e Bug 1935148 - Remove newline (instead of transforming to space) if adjacent to East-Asian punctuation character. r=m_kato
Includes the examples from the report as a testcase, though there is not yet
any formal spec for the exact behavior of segment break transformation.
(But nevertheless there is an existing collection of tests, so this just adds
one for the punctuation case.)

Differential Revision: https://phabricator.services.mozilla.com/D231476
2025-01-02 10:17:53 +00:00
Alexandru Marc
ab65fe8c1b Backed out changeset ce6faa97d947 (bug 1935148) for causing build bustages @ nsTextFrameUtils.h CLOSED TREE 2025-01-02 02:21:59 +02:00
Jonathan Kew
762cccdd3f Bug 1935148 - Remove newline (instead of transforming to space) if adjacent to East-Asian punctuation character. r=m_kato
Includes the examples from the report as a testcase, though there is not yet
any formal spec for the exact behavior of segment break transformation.
(But nevertheless there is an existing collection of tests, so this just adds
one for the punctuation case.)

Differential Revision: https://phabricator.services.mozilla.com/D231476
2025-01-01 22:30:49 +00:00
Alexandru Marc
f73c5665dd Backed out changeset 87246fb462dd (bug 1935148) for causing build bustages @ nsTextFrameUtils.cpp CLOSED TREE 2025-01-01 20:47:47 +02:00
Jonathan Kew
e54cfb5250 Bug 1935148 - Remove newline (instead of transforming to space) if adjacent to East-Asian punctuation character. r=m_kato
Includes the examples from the report as a testcase, though there is not yet
any formal spec for the exact behavior of segment break transformation.
(But nevertheless there is an existing collection of tests, so this just adds
one for the punctuation case.)

Differential Revision: https://phabricator.services.mozilla.com/D231476
2025-01-01 17:59:04 +00:00
Emilio Cobos Álvarez
b1269ccea6 Bug 1932800 - Fix caret baseline of empty inline and text frames. r=dshin
Added Gecko reftests because I don't know what the best place to put
them in WPT is, and caret rendering is kind of undefined, but...

Differential Revision: https://phabricator.services.mozilla.com/D229926
2024-11-24 14:46:16 +00:00
Goloman Adrian
caa559759f Backed out 3 changesets (bug 1932800) for causing marionette failures @test_accessiblecaret_cursor_mode.py. CLOSED TREE
Backed out changeset f40a44add850 (bug 1932800)
Backed out changeset 7cda61151052 (bug 1932800)
Backed out changeset 4974ccf274fa (bug 1932800)
2024-11-24 15:16:48 +02:00
Emilio Cobos Álvarez
b121dde1da Bug 1932800 - Fix caret baseline of empty inline and text frames. r=dshin
Added Gecko reftests because I don't know what the best place to put
them in WPT is, and caret rendering is kind of undefined, but...

Differential Revision: https://phabricator.services.mozilla.com/D229926
2024-11-23 12:46:48 +00:00
Sandor Molnar
e7348a5625 Backed out 3 changesets (bug 1932800) for causing reftest failures. CLOSED TREE
Backed out changeset c06b939ca2f2 (bug 1932800)
Backed out changeset 048956318eb0 (bug 1932800)
Backed out changeset 333442d03d1a (bug 1932800)
2024-11-23 12:40:11 +02:00
Emilio Cobos Álvarez
8121200d6a Bug 1932800 - Fix caret baseline of empty inline and text frames. r=dshin
Added Gecko reftests because I don't know what the best place to put
them in WPT is, and caret rendering is kind of undefined, but...

Differential Revision: https://phabricator.services.mozilla.com/D229926
2024-11-23 09:00:29 +00:00
Sean Feng
9f96024990 Bug 1931909 - Make the assertion that check selection caching MOZ_ASSERT r=emilio
This is a NS_ASSERTION now. When I worked selection related code,
I noticed that this assertion always pointed to actual bugs in my code,
and I don't see we hit this assertion in current code, so it
should be a MOZ_ASSERT in my opinion.

Differential Revision: https://phabricator.services.mozilla.com/D229371
2024-11-18 20:46:24 +00:00
Jonathan Watt
7532be254f Bug 1931736. Add missing braces around if/loop statements in layout/generic/. r=layout-reviewers,emilio
Depends on D229247

Differential Revision: https://phabricator.services.mozilla.com/D229248
2024-11-17 05:03:58 +00:00
Emily McDonough
3ada87c36c Bug 1929360 - Reserve capacity before bulk append in CreateObserversForAnimatedGlyphs r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D228084
2024-11-07 23:14:23 +00:00
Jonathan Kew
6970714eba Bug 1927709 - Properly preserve newlines in GetRenderedText for textframes with white-space:pre-line. r=jwatt
This makes innerText better reflect the actual rendered text, and matches the result
seen in Blink for the testcase.

Differential Revision: https://phabricator.services.mozilla.com/D227164
2024-10-30 14:28:01 +00:00
Butkovits Atila
652ebd2c2e Backed out changeset d9d099719789 (bug 1927709) for causing failures at browser_textleafpoint.js. CLOSED TREE 2024-10-29 22:34:16 +02:00
Jonathan Kew
afb87cf3ef Bug 1927709 - Properly preserve newlines in GetRenderedText for textframes with white-space:pre-line. r=jwatt
This makes innerText better reflect the actual rendered text, and matches the result
seen in Blink for the testcase.

Differential Revision: https://phabricator.services.mozilla.com/D227164
2024-10-29 15:18:31 +00:00
serge-sans-paille
262f78c07f Bug 1922838 - Replace ArrayLength, ArrayEnd and MOZ_ARRAY_LENGTH by standard alternative r=glandium,necko-reviewers,jgilbert,application-update-reviewers,media-playback-reviewers,credential-management-reviewers,anti-tracking-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,bytesized,janv,dimi,daisuke,karlt,gstoll,canaltinova,timhuang
Namely std::size, std::end and std::size. This drops C support for
MOZ_ARRAY_LENGTH but it wasn't used anyway.

Differential Revision: https://phabricator.services.mozilla.com/D224611
2024-10-28 08:21:19 +00:00
Alexandru Marc
a5eb905bf4 Backed out changeset d92f391b3b0c (bug 1922838) for backing out bug 1915351 2024-10-25 16:42:33 +03:00
serge-sans-paille
07101ac24d Bug 1922838 - Replace ArrayLength, ArrayEnd and MOZ_ARRAY_LENGTH by standard alternative r=glandium,necko-reviewers,jgilbert,application-update-reviewers,media-playback-reviewers,credential-management-reviewers,anti-tracking-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,bytesized,janv,dimi,daisuke,karlt,gstoll,canaltinova,timhuang
Namely std::size, std::end and std::size. This drops C support for
MOZ_ARRAY_LENGTH but it wasn't used anyway.

Differential Revision: https://phabricator.services.mozilla.com/D224611
2024-10-24 09:06:01 +00:00
Alexandru Marc
004e704b22 Backed out changeset 448597bce69d (bug 1922838) for causing build bustages. CLOSED TREE 2024-10-24 11:37:49 +03:00
serge-sans-paille
2c916d4973 Bug 1922838 - Replace ArrayLength, ArrayEnd and MOZ_ARRAY_LENGTH by standard alternative r=glandium,necko-reviewers,jgilbert,application-update-reviewers,media-playback-reviewers,credential-management-reviewers,anti-tracking-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,bytesized,janv,dimi,daisuke,karlt,gstoll,canaltinova,timhuang
Namely std::size, std::end and std::size. This drops C support for
MOZ_ARRAY_LENGTH but it wasn't used anyway.

Differential Revision: https://phabricator.services.mozilla.com/D224611
2024-10-24 07:38:30 +00:00
Jonathan Kew
971b964316 Bug 1923829 - Check the correct frame when iterating over continuations in nsTextFrame::GetRenderedText. r=dshin
For clarity, we refactor body of the loop-over-continuations in
nsTextFrame::GetRenderedText into a helper method AppendRenderedText
that handles a single continuation in the chain.

This avoids the footgun of an nsTextFrame method iterating over its
continuations (using the textFrame variable) but potentially calling
methods of the primary frame within the loop, instead of the current
frame being processed.

Differential Revision: https://phabricator.services.mozilla.com/D225686
2024-10-17 18:24:09 +00:00
Jonathan Kew
a93a779c56 Bug 1919511 - Rename gfxFontGroup::BuildFontList to EnsureFontList, and defer calling it until we really need the resolved font instances. r=layout-reviewers,emilio
This is preparation for splitting out separate per-script resolved font lists in gfxFontGroup.
By itself, it should not change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D222748
2024-10-12 15:37:18 +00:00
Tamas Szentpeteri
5c914102f8 Backed out changeset 8c451596a34f (bug 1919511) for causing mochitest failures on gfxUserFontSet.cpp. CLOSED TREE 2024-10-10 16:13:48 +03:00
Jonathan Kew
da08a70728 Bug 1919511 - Rename gfxFontGroup::BuildFontList to EnsureFontList, and defer calling it until we really need the resolved font instances. r=layout-reviewers,emilio
This is preparation for splitting out separate per-script resolved font lists in gfxFontGroup.
By itself, it should not change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D222748
2024-10-10 09:43:59 +00:00
Jonathan Kew
015a867848 Bug 1884118 - Make letter-spacing accept <length-percentage>, not just <length>. r=dshin
As per https://drafts.csswg.org/css-text-4/#letter-spacing-property.

Differential Revision: https://phabricator.services.mozilla.com/D224747
2024-10-07 15:54:23 +00:00
serge-sans-paille
05acc5a9a3 Bug 1921348 - Remove global constructor from layout/generic/nsTextFrame.cpp r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D223872
2024-10-04 09:55:14 +00:00
Jonathan Kew
26ee40e65a Bug 1885702 - Fix initialization of masked text fragment in ClusterIterator. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D223050
2024-09-25 17:44:22 +00:00
David Shin
1fad4eeb43 Bug 1900232: Part 4 - Add anchor-size() to margin properties. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D222533
2024-09-23 13:58:38 +00:00
Jonathan Kew
b2ea078648 Bug 1919812 - Vertical Mongolian text takes underline on the right, like Japanese & Korean. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D222809
2024-09-21 08:38:02 +00:00
Jonathan Kew
3f3a8c3e8d Bug 1919658 - Add support for text-emphasis-position:auto. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D222855
2024-09-20 20:15:19 +00:00
Emilio Cobos Álvarez
3ca9c49882 Bug 1917715 - Rename nsLayoutUtils::GetColor. r=longsonr,dholbert
It's suitable for foreground colors only.

Differential Revision: https://phabricator.services.mozilla.com/D221557
2024-09-09 23:12:05 +00:00
Ting-Yu Lin
116ca76700 Bug 1909761 Part 3 - Use IntrinsicSizeInput for AddInlineMinISize() and AddInlinePrefISize(). r=dholbert
Another preparation patch in order to pass down a percentage basis when
computing intrinsic size.

Differential Revision: https://phabricator.services.mozilla.com/D219522
2024-09-03 04:25:42 +00:00
Ting-Yu Lin
6af05a0977 Bug 1909761 Part 2 - Create a helper struct IntrinsicSizeInput to aggregate needed data when computing intrinsic inline size. r=dholbert
This patch changes the signature to `GetMinISize()`, `GetPrefISize()`,
`IntrinsicISize` by adding a helper struct as a preparation. Then we can just
add more data such as a percentage basis to the struct without altering the
signature in the future.

When passing `IntrinsicSizeInput` struct down to another helper method, we
generally just pass the original one if the method is computing the intrinsic
size of our own or our anonymous children. If the method is computing our
children's intrinsic contribution, we'll need to create a brand new
`IntrinsicSizeInput` for our children.

Differential Revision: https://phabricator.services.mozilla.com/D219521
2024-09-03 04:25:41 +00:00
Butkovits Atila
4d06404349 Backed out 6 changesets (bug 1909761) for causing failures at test_contextmenu_rtl.xhtml. CLOSED TREE
Backed out changeset 1e9f47784a54 (bug 1909761)
Backed out changeset d2dcf159185b (bug 1909761)
Backed out changeset 3f48c106bff9 (bug 1909761)
Backed out changeset 38d1e5eda09d (bug 1909761)
Backed out changeset 8de556490289 (bug 1909761)
Backed out changeset 4e7f22f43bb4 (bug 1909761)
2024-08-28 10:44:09 +03:00
Ting-Yu Lin
caac17bc1b Bug 1909761 Part 3 - Use IntrinsicSizeInput for AddInlineMinISize() and AddInlinePrefISize(). r=dholbert
Another preparation patch in order to pass down a percentage basis when
computing intrinsic size.

Differential Revision: https://phabricator.services.mozilla.com/D219522
2024-08-28 06:18:44 +00:00
Ting-Yu Lin
f0ff97db90 Bug 1909761 Part 2 - Create a helper struct IntrinsicSizeInput to aggregate needed data when computing intrinsic inline size. r=dholbert
This patch changes the signature to `GetMinISize()`, `GetPrefISize()`,
`IntrinsicISize` by adding a helper struct as a preparation. Then we can just
add more data such as a percentage basis to the struct without altering the
signature in the future.

When passing `IntrinsicSizeInput` struct down to another helper method, we
generally just pass the original one if the method is computing the intrinsic
size of our own or our anonymous children. If the method is computing our
children's intrinsic contribution, we'll need to create a brand new
`IntrinsicSizeInput` for our children.

Differential Revision: https://phabricator.services.mozilla.com/D219521
2024-08-28 06:18:44 +00:00
Jonathan Kew
899ed77a9f Bug 1912667 - Do not apply text-emphasis marks to punctuation characters (with some exceptions, per css-text-decor spec). r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D219099
2024-08-14 14:23:17 +00:00
Sandor Molnar
bd839a9def Backed out changeset c8f5afbb26a5 (bug 1912667) for causing build bustages @ layout/generic/nsTextFrame.cpp CLOSED TREE 2024-08-14 17:00:07 +03:00
Jonathan Kew
df2f73e279 Bug 1912667 - Do not apply text-emphasis marks to punctuation characters (with some exceptions, per css-text-decor spec). r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D219099
2024-08-14 11:39:06 +00:00
Jan-Niklas Jaeschke
70014fe558 Bug 1867249, part 1: Implemented new cache to determine selected nodes. r=sefeng,dom-core
Determining if a node is selected is a super-hot code path,
which at times introduces jank both in Reflow and Painting.
This is due to each node comparing its position to the range's start and end point,
which even happens several times (`nsINode::IsSelected()` and `Selection::LookupSelection()`).
In worst cases, this can lead to reflow which takes several minutes.

This patch introduces a cache which contains all fully selected nodes,
and lives throughout one `PresShell::DoReflow()` call.
Collecting all selected nodes of a selection is very fast.
The selected nodes are then stored in a hash set.
During reflow the check if a node is selected first checks the cache
if the node is fully selected, and otherwise goes through the existing
code to check if the node is partially selected.

Differential Revision: https://phabricator.services.mozilla.com/D217794
2024-08-05 15:43:27 +00:00
Ting-Yu Lin
9aba34e1fd Bug 1911027 Part 2 - Drop unnecessary nsIFrame:: for InlineMinISizeData and InlinePrefISizeData usages. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D218283
2024-08-01 17:47:07 +00:00
Ting-Yu Lin
bbefead4db Bug 1911027 Part 1 - Clean up for various frame classes. r=layout-reviewers,emilio
- Replace 'Width' with 'ISize'.
- Drop `virtual` on methods already with `override`.
- Define `AddInlineMinISize()` and `AddInlinePrefISize` directly in
  `nsContinuingTextFrame`.
- Rename `ReflowOutpt` parameter to `aReflowOutput`.

Differential Revision: https://phabricator.services.mozilla.com/D218282
2024-08-01 17:47:06 +00:00
Ting-Yu Lin
2969a5e0cb Bug 1909995 Part 2 - Add IntrinsicISize() as a helper to implement GetMinISize() and GetPrefISize(). r=layout-reviewers,emilio
Most frame types have identical or very similar implementation for GetMinISize()
and GetPrefISize(), and many of them already have `IntrinsicISize()` to unify
the implementation. This patch introduces nsIFrame::IntrinsicISize() so that
derived classes only need to override one method.

`nsBlockFrame`, `ColumnSetWrapperFrame`, and `nsColumnSetFrame` are the only
three classes where their `GetMinISize()` and `GetPrefISize()` have significant
differences. Therefore, we rename `GetMinISize()` and `GetPrefISize()` to
`MinISize()` and `PrefISize`, respectively, and use them as helpers to implement
their `IntrinsicISize()`.

This patch doesn't change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D217790
2024-07-26 20:54:56 +00:00
Ting-Yu Lin
e67b56ee4c Bug 1909995 Part 1 - Unify MinISizeFromInline and PrefISizeFromInline in nsLayoutUtils, and move it into nsIFrame. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D217789
2024-07-26 20:54:56 +00:00
Jonathan Kew
5fd21294fa Bug 1908512 - Don't set the NS_HAS_FLOWLENGTH_PROPERTY flag if the property setter actually failed. r=layout-reviewers,emilio
Doesn't change observable behavior.

Differential Revision: https://phabricator.services.mozilla.com/D216859
2024-07-19 17:38:27 +00:00
Jonathan Kew
d92b275d01 Bug 1907772 - Don't attempt to trim letter-spacing at start of line in textframes being used for SVG text. r=longsonr
SVG text elements in general don't have a clearly-defined concept of "lines", so we can't
know where it would be appropriate to trim.

Differential Revision: https://phabricator.services.mozilla.com/D216506
2024-07-15 08:02:18 +00:00
Jonathan Kew
759158947b Bug 1892262 - Trim leading letter-spacing at start of line. r=layout-reviewers,dholbert
Differential Revision: https://phabricator.services.mozilla.com/D215015
2024-06-27 15:13:33 +00:00
Ting-Yu Lin
415f61e85f Bug 1903652 Part 1 - Revert Bug 1901515 Part 3 to rework the performance issue. r=dholbert
This patch is a revert of
https://hg.mozilla.org/mozilla-central/rev/8ea9b9da6922 because the correctness
assumption described in the commit message was wrong. Note that this patch does
not revert the documentation improvement for
`nsSplittableFrame::RemoveFromFlow()` because it is worth keeping.

During frame destruction, `nsBlockFrame::MarkIntrinsicISizesDirty()` can be
called and it accesses `FirstContinuation()`. Thus, it is not acceptable to
allow a stale first-continuation cache during frame destruction.

Differential Revision: https://phabricator.services.mozilla.com/D214658
2024-06-23 04:31:36 +00:00