Commit Graph

1808 Commits

Author SHA1 Message Date
Jonathan Kew
64b9727f2c Bug 385615 - Backed out 9 changesets (aec1be189f68, f9c2e5707d43, fe82d67b63ef, 07004e2608f3, f6022837406b, 36fc4e06713d, 30718580670d, 82242b2d942d, 5cd51f055a1a) due to reported regressions.
Differential Revision: https://phabricator.services.mozilla.com/D212435
2024-06-03 15:50:57 +00:00
Emilio Cobos Álvarez
716862543d Bug 1899187 - Use cbindgen for initial-letter. r=firefox-style-system-reviewers,layout-reviewers,boris
Differential Revision: https://phabricator.services.mozilla.com/D211782
2024-05-28 09:37:22 +00:00
Jonathan Kew
1b4dfde53d Bug 385615 - patch 3 - Implement nsTextFrame::SetFirstLetterLength to constrain first-letter during intrinsic-size calculation. r=layout-reviewers,emilio
This is an alternative version of SetLength to be used for the child of an nsFirstLetterFrame,
when we may need to create continuations in order to separate the first-letter from its
following text.

With this, the intrinsic sizes of first-letter should be computed correctly.

Differential Revision: https://phabricator.services.mozilla.com/D211597
2024-05-28 09:08:14 +00:00
Jonathan Kew
fe4894cfd4 Bug 385615 - patch 2 - Determine extent of ::first-letter range during intrinsic-width computation. r=layout-reviewers,emilio
If we're querying the intrinsic widths of a first-letter and its continuation
before they have been reflowed, we need to check the extent of the first-letter
text (similarly to what nsTextFrame::ReflowText does) to avoid measuring too
much of the content using the first-letter styling.

This patch checks the first-letter length during intrinsic size computation,
but does not actually work in most cases because nsTextFrame::SetLength will
bail out if there is not already a next-in-flow frame. The following patch
will address that.

Differential Revision: https://phabricator.services.mozilla.com/D211596
2024-05-28 09:08:13 +00:00
Jonathan Kew
6a750b0653 Bug 385615 - patch 1 - Factor out a GetContentNewLineOffset() helper in nsTextFrame. r=layout-reviewers,emilio
No behavior change here, just factoring out a helper that will be wanted
for the following patch.

Differential Revision: https://phabricator.services.mozilla.com/D211595
2024-05-28 09:08:12 +00:00
Emilio Cobos Álvarez
f9b44817e4 Bug 1899126 - Simplify text-transform representation. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D211731
2024-05-27 17:24:10 +00:00
Jonathan Kew
10169b1937 Bug 1890773 - Create a pref to control how letter-spacing is inserted around characters. r=layout-reviewers,emilio
With the pref set to 0 by default, this does not change any existing behavior.

My intention is that a following patch will set it to 2 in Nightly. This will affect
a bunch of reftests, and so test/expectation adjustments will also be needed.

Differential Revision: https://phabricator.services.mozilla.com/D207150
2024-04-11 18:41:37 +00:00
Jan-Niklas Jaeschke
dbaf47b1f4 Bug 1867939, part 4: Implemented the ::target-text CSS Pseudo Element. r=emilio,devtools-reviewers,nchevobbe
This patch implements the `::target-text` pseudo element.
Similarly to the Custom Highlight API, this is done implementing
a new Selection type.

Differential Revision: https://phabricator.services.mozilla.com/D195687
2024-04-04 14:39:32 +00:00
Stanca Serban
ce5dc60809 Backed out 6 changesets (bug 1867939) for causing wpt failures in target-text-010.html. CLOSED TREE
Backed out changeset 44101c258e52 (bug 1867939)
Backed out changeset c53267e1b460 (bug 1867939)
Backed out changeset 0748839408e5 (bug 1867939)
Backed out changeset 38631fbd2f2f (bug 1867939)
Backed out changeset d77b9257c842 (bug 1867939)
Backed out changeset 0d269b891421 (bug 1867939)
2024-04-04 00:50:50 +03:00
Jan-Niklas Jaeschke
3f695f17a9 Bug 1867939, part 4: Implemented the ::target-text CSS Pseudo Element. r=emilio,devtools-reviewers,nchevobbe
This patch implements the `::target-text` pseudo element.
Similarly to the Custom Highlight API, this is done implementing
a new Selection type.

Differential Revision: https://phabricator.services.mozilla.com/D195687
2024-04-03 15:23:02 +00:00
Sandor Molnar
7a867184d3 Backed out 6 changesets (bug 1867939) for causing a top crash in nightly Bug 1889393 CLOSED TREE
Backed out changeset 2110f57e928c (bug 1867939)
Backed out changeset 51890598ecb4 (bug 1867939)
Backed out changeset 839bc1b11a2c (bug 1867939)
Backed out changeset bb88c4d09e82 (bug 1867939)
Backed out changeset 27c76e65cf58 (bug 1867939)
Backed out changeset c3e3c81f9ceb (bug 1867939)
2024-04-03 17:31:56 +03:00
Ting-Yu Lin
8a77ebbb16 Bug 1888535 Part 5 - Remove DISPLAY_REFLOW. r=layout-reviewers,emilio
It is used in `Reflow()` implementations.

Differential Revision: https://phabricator.services.mozilla.com/D206317
2024-04-02 19:03:05 +00:00
Jan-Niklas Jaeschke
f46900e678 Bug 1867939, part 4: Implemented the ::target-text CSS Pseudo Element. r=emilio,devtools-reviewers,nchevobbe
This patch implements the `::target-text` pseudo element.
Similarly to the Custom Highlight API, this is done implementing
a new Selection type.

Differential Revision: https://phabricator.services.mozilla.com/D195687
2024-04-02 13:44:25 +00:00
Cristian Tuns
9a4d6d56af Backed out 6 changesets (bug 1867939) for causing build bustages in Document.h CLOSED TREE
Backed out changeset 0853f9a7a06c (bug 1867939)
Backed out changeset 2279e6577c13 (bug 1867939)
Backed out changeset 1b3af4b6a27b (bug 1867939)
Backed out changeset 2fbe643ca483 (bug 1867939)
Backed out changeset 575873406614 (bug 1867939)
Backed out changeset 82f99c0210b0 (bug 1867939)
2024-04-02 09:15:46 -04:00
Jan-Niklas Jaeschke
9ce335fcb7 Bug 1867939, part 4: Implemented the ::target-text CSS Pseudo Element. r=emilio,devtools-reviewers,nchevobbe
This patch implements the `::target-text` pseudo element.
Similarly to the Custom Highlight API, this is done implementing
a new Selection type.

Differential Revision: https://phabricator.services.mozilla.com/D195687
2024-04-02 11:43:21 +00:00
flowejam
9d4992fcc6 Bug 1885693: Converted LogicalSide to an enum class, and renamed variables accordingly. r=TYLin
Values were static_casted where required. Some functions in WritingModes.h were
rewritten such that bitwise operations aren't being used. Added static_casts to
avoid (debug) build errors from debugging printfs in layout/tables/nsCellMap.cpp.

Differential Revision: https://phabricator.services.mozilla.com/D205510
2024-03-26 17:55:16 +00:00
Robert Longson
034f3b85c8 Bug 1816628 Part 2 - Make text-shadow react to stroke properties and fill opacity r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D200436
2024-02-28 18:51:23 +00:00
Robert Longson
841e079aa9 Bug 1816628 Part 1 - Account for horizontal overflow caused by text-shadow r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D200435
2024-02-28 18:51:23 +00:00
Stanca Serban
1b062c0f39 Backed out 2 changesets (bug 1816628) for causing OS X mochitests-plain failures in test_bug1426594.html.
Backed out changeset e32deae0b0b4 (bug 1816628)
Backed out changeset 3ee753e740b9 (bug 1816628)
2024-02-24 06:38:52 +02:00
Robert Longson
74a41ace0a Bug 1816628 Part 2 - Make text-shadow react to stroke properties and fill opacity r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D200436
2024-02-23 23:48:24 +00:00
Robert Longson
0d94aa3378 Bug 1816628 Part 1 - Account for horizontal overflow caused by text-shadow r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D200435
2024-02-23 23:48:23 +00:00
Stanca Serban
7235cac1d4 Backed out 2 changesets (bug 1816628) for linux related wr failures in SVGTextFrame.cpp. CLOSED TREE
Backed out changeset d58d91582a84 (bug 1816628)
Backed out changeset ddaf27e9243d (bug 1816628)
2024-02-23 21:37:04 +02:00
Robert Longson
06bad336c9 Bug 1816628 Part 2 - Make text-shadow react to stroke properties and fill opacity r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D200436
2024-02-23 16:58:58 +00:00
Robert Longson
9631cdc7fb Bug 1816628 Part 1 - Account for horizontal overflow caused by text-shadow r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D200435
2024-02-23 16:58:58 +00:00
Edgar Chen
7c3453d032 Bug 1878976 - Remove plugin-related code in EventStateManager; r=emilio
`nsIFrame::GetCursor()` can never return `Nothing()` after bug 1687239, which
removes `nsPluginFrame`. Therefore `mLastFrameConsumedSetCursor` in
`EventStateManager` can never be true.

Differential Revision: https://phabricator.services.mozilla.com/D200890
2024-02-07 12:35:27 +00:00
Jonathan Kew
13628e7d44 Bug 1878865 - Only record that breakPriority indicated use of overflow-wrap if we actually needed to break the text. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D200853
2024-02-06 23:07:59 +00:00
Cristina Horotan
1afd4a1593 Backed out changeset 07c6057bdf29 (bug 1878865) for causing lint failure at text-wrap-balance-overflow-002-ref.html CLOSED TREE 2024-02-06 22:21:40 +02:00
Jonathan Kew
9d87143b30 Bug 1878865 - Only record that breakPriority indicated use of overflow-wrap if we actually needed to break the text. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D200853
2024-02-06 18:41:07 +00:00
Jonathan Kew
c5ac190354 Bug 1872929 - Don't allow text-wrap:balance adjustment to cause an overflow-wrap line break to be used. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D199974
2024-01-30 18:58:16 +00:00
Jonathan Kew
ba9032e630 Bug 1852478 - Convert CSS white-space into a shorthand that expands to white-space-collapse and text-wrap-mode longhands. r=firefox-style-system-reviewers,emilio
Note that although this builds, it would (by itself) result in some test breakage;
this is resolved in the following patches that build on this.

Differential Revision: https://phabricator.services.mozilla.com/D198790
2024-01-26 09:40:02 +00:00
Cristian Tuns
b0886adb5c Backed out 4 changesets (bug 1758391, bug 1852478) for causing build bustages in UseCounterMetrics.cpp CLOSED TREE
Backed out changeset fe673f87d86a (bug 1852478)
Backed out changeset d466ccbd1aad (bug 1852478)
Backed out changeset c0fa98fec39a (bug 1758391)
Backed out changeset 04d322f23fd0 (bug 1852478)
2024-01-25 18:29:39 -05:00
Jonathan Kew
87225af2ba Bug 1852478 - Convert CSS white-space into a shorthand that expands to white-space-collapse and text-wrap-mode longhands. r=firefox-style-system-reviewers,emilio
Note that although this builds, it would (by itself) result in some test breakage;
this is resolved in the following patches that build on this.

Differential Revision: https://phabricator.services.mozilla.com/D198790
2024-01-25 22:20:05 +00:00
Ting-Yu Lin
e9151ca0ee Bug 1875600 - Use nsIFrame::PresShell() to simply some callers. r=layout-reviewers,emilio
Those callers who using the pointer immediately after getting from
`GetPresShell()` can be replaced with `PresShell()`.

This patch doesn't change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D199164
2024-01-23 00:30:53 +00:00
Narcis Beleuzu
756ec5ce4b Backed out 4 changesets (bug 1758391, bug 1852478) for failures on test_animation-type-longhand.html . CLOSED TREE
Backed out changeset d6a8b0b97282 (bug 1852478)
Backed out changeset fef9fcec3afc (bug 1852478)
Backed out changeset 01711557e2bf (bug 1758391)
Backed out changeset 8c8a01dbca12 (bug 1852478)
2024-01-22 16:37:15 +02:00
Jonathan Kew
63f8c995be Bug 1852478 - Convert CSS white-space into a shorthand that expands to white-space-collapse and text-wrap-mode longhands. r=firefox-style-system-reviewers,emilio
Note that although this builds, it would (by itself) result in some test breakage;
this is resolved in the following patches that build on this.

Differential Revision: https://phabricator.services.mozilla.com/D198790
2024-01-22 12:57:54 +00:00
Ting-Yu Lin
5c884d5335 Bug 1874897 - Revert Bug 1873530 Part 3 to fix performance regression. r=dholbert
This reverts commit https://hg.mozilla.org/mozilla-central/rev/dfcfa98a7e21
without any additional modification.

Differential Revision: https://phabricator.services.mozilla.com/D198764
2024-01-17 05:14:35 +00:00
Ting-Yu Lin
1c5fd05aca Bug 1873530 Part 3 - Unify continuation linking operations by removing SetPrevContinuation() and SetPrevInFlow(). r=jfkthame
SetNextContinuation() and SetPrevContinuation() are almost always called
together when setting up a continuation link, but the callers don't call them in
particular order. We should unify them as one method so that it's more
ergonomics and robust, especially when we do more complex work such as caching
continuations. Same reason for SetNextInFlow() and SetPrevInFlow().

We choose to merge the SetPrevContinuation() code into SetNextContinuation() for
the symmetry of SetNextSibling(). (Yes, we don't have SetPrevSibling().)

This patch doesn't change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D197966
2024-01-11 19:50:58 +00:00
Ting-Yu Lin
fd8f769590 Bug 1873530 Part 2 - Add a helper to update cached continuations in nsTextFrame. r=jfkthame
`SetPrevContinuation()` and `SetPrevInFlow()` have the same piece of code. Let's
move it into a helper.

Differential Revision: https://phabricator.services.mozilla.com/D197965
2024-01-11 19:50:57 +00:00
Jonathan Kew
26eb4d55b7 Bug 1851952 - Allow line-wrapping after hyphen if necessary to avoid overflow, even if the hyphen would not normally be a break opportunity (e.g. between numerals). r=layout-reviewers,emilio
We don't line-break after a hyphen when it occurs between numerals, like in page or date ranges,
preferring to keep the range together as a unit when wrapping text.

However, if the available space is very narrow, e.g. in a small table cell, this may lead to
undesirable overflow. So to try and avoid this, this patch allows an "emergency" line-break
opportunity (similar to what `overflow-wrap: break-word` would do) after the hyphen in such
a case.

This affects a number of existing reftests, but the changes in behavior make us more like
WebKit/Blink (which generally allow a break after hyphen between numerals) in these cases,
so it seems unlikely to lead to webcompat issues; rather, it will help with existing issues
where people assume the content can wrap.

Differential Revision: https://phabricator.services.mozilla.com/D197936
2024-01-09 21:59:56 +00:00
Narcis Beleuzu
d8c3c8ce61 Backed out 2 changesets (bug 1851952) for reftest failure on hyphens-1.html
Backed out changeset e6e18eed2d76 (bug 1851952)
Backed out changeset 3c81bf22f846 (bug 1851952)
2024-01-09 21:15:52 +02:00
Jonathan Kew
789ddaae17 Bug 1851952 - Allow line-wrapping after hyphen if necessary to avoid overflow, even if the hyphen would not normally be a break opportunity (e.g. between numerals). r=layout-reviewers,emilio
We don't line-break after a hyphen when it occurs between numerals, like in page or date ranges,
preferring to keep the range together as a unit when wrapping text.

However, if the available space is very narrow, e.g. in a small table cell, this may lead to
undesirable overflow. So to try and avoid this, this patch allows an "emergency" line-break
opportunity (similar to what `overflow-wrap: break-word` would do) after the hyphen in such
a case.

This affects a number of existing reftests, but the changes in behavior make us more like
WebKit/Blink (which generally allow a break after hyphen between numerals) in these cases,
so it seems unlikely to lead to webcompat issues; rather, it will help with existing issues
where people assume the content can wrap.

Differential Revision: https://phabricator.services.mozilla.com/D197936
2024-01-09 18:07:17 +00:00
Jonathan Kew
26542f268a Bug 1873680 - Use a strongly-typed enum class instead of raw integer indexes for selection style lookup in nsTextPaintStyle. r=layout-reviewers,emilio
This should not change any behavior.

Differential Revision: https://phabricator.services.mozilla.com/D198030
2024-01-09 18:06:12 +00:00
Daniel Holbert
d34d1559a8 Bug 1330088 part 3: Change various nsTextPaintStyle APIs to use unsigned values for an array-index. r=layout-reviewers,emilio
This patch doesn't change behavior.

The APIs that I'm changing here are all indexing into an array that only has 5
entries; it's a bit odd to be using a signed array-index for this, particularly
since the indices all originate from GetUnderlineStyleIndexForSelectionType()
which explicitly returns values 0 through 4 (as enum values).

I suspect we were using signed index because we were using an enum to represent
the values, which was signed-by-default.  Let's just explicitly declare the
enum to use an unsigned underlying representation, and then change its
downstream integer variables/params to be unsigned as well.

Conveniently, this lets us simplify the assertions about the index being
in-range, since unsigned values are >=0 by definition.

Differential Revision: https://phabricator.services.mozilla.com/D197754
2024-01-08 20:47:33 +00:00
Jonathan Kew
f9312fc171 Bug 1872545 - Hoist color-font palette cache out of TextRunDrawParams to the nsPresContext or CanvasRenderingContext2D, for greater effectiveness. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D197463
2024-01-04 11:07:44 +00:00
Iulian Moraru
27b6f41469 Backed out changeset 21beaf6ba627 (bug 1872545) for causing windows build bustages on FontPaletteCache.cpp. CLOSED TREE 2024-01-04 01:54:01 +02:00
Jonathan Kew
e976fa1b8c Bug 1872545 - Hoist color-font palette cache out of TextRunDrawParams to the nsPresContext or CanvasRenderingContext2D, for greater effectiveness. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D197463
2024-01-03 22:54:10 +00:00
Cristian Tuns
7695546799 Backed out changeset 395cc57551ec (bug 1872545) for causing build bustages in rust.mk CLOSED TREE 2024-01-03 05:14:31 -05:00
Jonathan Kew
66b754598a Bug 1872545 - Hoist color-font palette cache out of TextRunDrawParams to the nsPresContext or CanvasRenderingContext2D, for greater effectiveness. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D197463
2024-01-02 13:12:29 +00:00
Narcis Beleuzu
99b9ad7672 Backed out changeset e959df5e9484 (bug 1872545) for bustages on COLRFonts.cpp 2024-01-02 13:50:05 +02:00
Jonathan Kew
c018bc5255 Bug 1872545 - Hoist color-font palette cache out of TextRunDrawParams to the nsPresContext or CanvasRenderingContext2D, for greater effectiveness. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D197463
2024-01-02 09:52:49 +00:00