Commit Graph

496 Commits

Author SHA1 Message Date
longsonr
4a5a611b4e Bug 1929626 - Remove more uses/includes of nsAlgorithm.h r=emilio,win-reviewers,gstoll
Differential Revision: https://phabricator.services.mozilla.com/D228203
2024-11-07 11:09:40 +00:00
longsonr
e1526d9b0e Bug 1734476 - Don't run on compositor when content may contain non-scaling-stroke r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D227400
2024-11-07 11:03:46 +00:00
Goloman Adrian
74ec3166cc Backed out changeset fe24b8ac5257 (bug 1929626) for causing build bustages @StackArena.cpp. CLOSED TREE 2024-11-07 01:28:24 +02:00
longsonr
975fd89f6c Bug 1929626 - Remove more uses/includes of nsAlgorithm.h r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D228203
2024-11-06 21:15:52 +00:00
longsonr
0e8304cee2 Bug 1928319 - Use std::clamp instead of clamped r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D227459
2024-10-31 13:52:48 +00:00
Lee Salzman
4972c18d69 Bug 1923636 - Avoid copying paths when transforming. r=aosmond
TransformedCopyToBuilder is called any time in Canvas2D the transform
is modified and then a path op is used. On cases that repeatedly change
the transform while building paths, this leads to fairly significant
expense in repeatedly copying the path contents as well as allocating
and deallocating paths.

To work around this, a new primitive TransformedMoveToBuilder is provided
that allows in-place transforming of the path contents. Because paths that
are "finished" and referenced externally can't be safely modified, extra
static methods (i.e. ToBuilder) are added to guarantee that there are no
other refs to the path before modifying its contents.

One snag is that ArcParams could previously not handle transforms, so it
is modified to allow a transform to be supplied to an Arc op, which is
only flattened out when it is streamed to a sink.

Differential Revision: https://phabricator.services.mozilla.com/D225548
2024-10-14 22:48:45 +00:00
Otto Länd
e3756a4c78 Bug 1919040: apply code formatting via Lando
# ignore-this-changeset
2024-09-18 17:06:57 +00:00
Emilio Cobos Álvarez
9b59cd0cce Bug 1919040 - Fix some pre-existing transform invalidation issues. r=longsonr
When the transform attribute was removed from <g> we weren't notifying
of TRANSFORM_CHANGED.

Differential Revision: https://phabricator.services.mozilla.com/D222498
2024-09-18 15:22:50 +00:00
Emilio Cobos Álvarez
34ff066322 Bug 1919040 - Allow choosing scales < 1.0 for SVG text. r=longsonr
This matches the previous behavior. The test in question has a
scale of 0.1 in the test, which changes our font choice and uses simpler
glyph advances.

Differential Revision: https://phabricator.services.mozilla.com/D222422
2024-09-18 15:22:50 +00:00
Sandor Molnar
8b51a7184d Backed out changeset 861f44128431 (bug 1919040) for causing perma android reftest failures. CLOSED TREE 2024-09-17 13:33:25 +03:00
Emilio Cobos Álvarez
e48618be5d Bug 1919040 - Allow choosing scales < 1.0 for SVG text. r=longsonr
This matches the previous behavior. The test in question has a
scale of 0.1 in the test, which changes our font choice and uses simpler
glyph advances.

Differential Revision: https://phabricator.services.mozilla.com/D222422
2024-09-17 09:25:24 +00:00
Ting-Yu Lin
aa389ab830 Bug 1917144 Part 2 - Add IntrinsicSizeInput::mContainingBlockSize. r=dholbert
Currently, only the grid container needs the containing block size to resolve
the transferred min and max sizes for `repeat()` function in
`nsGridContainerFrame::ComputeIntrinsicISize()`.

This patch is a preparation for Bug 1865438. `mContainingBlockSize` will be used
there, so it does not change any behavior yet.

Differential Revision: https://phabricator.services.mozilla.com/D221333
2024-09-11 18:01:40 +00:00
Ting-Yu Lin
0a5e62e315 Bug 1909761 Part 4 - Construct a percentage basis when computing children's intrinsic inline size contributions. r=dholbert
A percentage basis is needed to resolve percentage block size when computing
children's intrinsic inline size contributions. This is necessary for a child or
descendants with a preferred aspect-ratio so that the block size can transfer
through the aspect-ratio to become an intrinsic inline size.

The change in `nsFlexContainerFrame::ComputeIntrinsicISize()` is necessary to
keep us passing
`testing/web-platform/tests/css/css-flexbox/image-nested-within-definite-column-flexbox.html`.

The change in `nsPlaceholderFrame::AddFloatToIntrinsicISizeData()` is necessary
to keep us passing
`testing/web-platform/tests/css/css-sizing/intrinsic-percent-replaced-dynamic-010.html`.

`GetISizeInfo()` in BasicTableLayoutStrategy.cpp is modified to pass table cell
frame's bsize as percentage basis. Otherwise,
`layout/reftests/bugs/522632-1.html` fails. This is our current behavior, but it
is bug 1461852.

Differential Revision: https://phabricator.services.mozilla.com/D219523
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
3ac03672b0 Bug 1909761 Part 4 - Construct a percentage basis when computing children's intrinsic inline size contributions. r=dholbert
A percentage basis is needed to resolve percentage block size when computing
children's intrinsic inline size contributions. This is necessary for a child or
descendants with a preferred aspect-ratio so that the block size can transfer
through the aspect-ratio to become an intrinsic inline size.

The change in `nsFlexContainerFrame::ComputeIntrinsicISize()` is necessary to
keep us passing
`testing/web-platform/tests/css/css-flexbox/image-nested-within-definite-column-flexbox.html`.

The change in `nsPlaceholderFrame::AddFloatToIntrinsicISizeData()` is necessary
to keep us passing
`testing/web-platform/tests/css/css-sizing/intrinsic-percent-replaced-dynamic-010.html`.

`GetISizeInfo()` in BasicTableLayoutStrategy.cpp is modified to pass table cell
frame's bsize as percentage basis. Otherwise,
`layout/reftests/bugs/522632-1.html` fails. This is our current behavior, but it
is bug 1461852.

Differential Revision: https://phabricator.services.mozilla.com/D219523
2024-08-28 06:18:45 +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
Emilio Cobos Álvarez
a34122737f Bug 878346 - Make transform a mapped attribute for SVG. r=longsonr,firefox-style-system-reviewers,zrhoffman
The tricky bit is rotate() which in SVG means something different if
there's an origin (you translate-then-untranslate it).

But this seems to work off-hand, and fix the reminder of bug 1906261.

Differential Revision: https://phabricator.services.mozilla.com/D215788
2024-08-21 15:00:48 +00:00
Jonathan Kew
52f40ac5fd Bug 1906978 - Fix the positioning/anchoring of SVG text runs with bidi control characters. r=longsonr,layout-reviewers,emilio
The added reftests here failed both prior to and after the bidi-engine update,
although the exact nature of the failures changed due to the engine leaving the
bidi control characters in different places in the reordered text. (This is
explicitly unspecified by the Unicode Bidi Algorithm, because the control codes
are nominally removed after processing; leaving them present but invisible is
an implementation detail.)

The key fix here is that DoGlyphPositioning() anchors the first *addressable*
character of the text, not necessarily the absolute first codepoint, as that
may be a "deleted" control code whose position is arbitrary.

Differential Revision: https://phabricator.services.mozilla.com/D216400
2024-07-12 17:31:37 +00:00
Emilio Cobos Álvarez
ebf6304af0 Bug 1903361 - Make SVG paths respect zoom. r=longsonr
Differential Revision: https://phabricator.services.mozilla.com/D214175
2024-06-27 11:12:47 +00:00
longsonr
53b89d52d5 Bug 1903352 - SVG attribute values should not be zoomed r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D214286
2024-06-20 14:56:29 +00:00
Stanca Serban
6620c05e49 Backed out changeset 031c8a5d110b (bug 1903352) as requested for causing android failures. CLOSED TREE 2024-06-20 15:14:25 +03:00
longsonr
afc6731a2a Bug 1903352 - SVG attribute values should not be zoomed r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D214286
2024-06-20 10:41:02 +00:00
longsonr
5bce133e64 Bug 1903679 - Simplify antialiasing code r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D214340
2024-06-20 09:02:20 +00:00
longsonr
3570874c6c Bug 1899525 - Stop lengthAdjust="spacingAndGlyphs" clipping the last character r=jfkthame
Reverts a small part of bug 1621502

Differential Revision: https://phabricator.services.mozilla.com/D212091
2024-05-30 14:26:29 +00:00
Daniel Holbert
3f02c7c39d Bug 1896711 part 2: Use MakeRefPtr to reduce boilerplate, in layout/svg. r=TYLin
Also remove one unnecessary null-check for an object that we're allocating
infallibly.

Differential Revision: https://phabricator.services.mozilla.com/D210388
2024-05-15 07:29:20 +00:00
Robert Longson
9260698b4c Bug 1882921 - Set mPaintingShadows to false in NotifySelectionBackgroundNeedsFill r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D203242
2024-03-01 16:09:25 +00:00
Daniel Holbert
8a3a9fa319 Bug 1882921: Initialize SVGTextDrawPathCallbacks:mPaintingShadows to false. r=longsonr,jfkthame
While we're there: also pull mColor's initialization out of the init list,
since it's the other member that's unconditionally initialized to a constant
value; and initialize it to 0 using the easier-to-interpret NS_RGBA macro
for setting nscolor values.

Differential Revision: https://phabricator.services.mozilla.com/D203214
2024-03-01 16:09:25 +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
Robert Longson
cffbaf089b Bug 1621502 - fix lengthAdjust when applied to vertical text r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D199797
2024-01-28 21:17:04 +00:00
Masayuki Nakano
d5a890bd62 Bug 1816581 - part 1: Make CaretAssociationHint an enum class r=emilio
For forward-decl-able.

Differential Revision: https://phabricator.services.mozilla.com/D197283
2023-12-27 04:42:09 +00:00
Robert Longson
f9b453b648 Bug 1871107 - Use do_AddRef more r=TYLin
Differential Revision: https://phabricator.services.mozilla.com/D197001
2023-12-20 23:34:03 +00:00
Jens Stutte
7e95d16b1d Bug 1839051 - Remove include nsQuickSort.h from some more files. r=emilio
Depends on D182724

Differential Revision: https://phabricator.services.mozilla.com/D182731
2023-12-11 06:53:28 +00:00
Iulian Moraru
7a59e75c46 Backed out 8 changesets (bug 1839051) for causing assertion failures on NotificationController.cpp. CLOSED TREE
Backed out changeset 94a4c163e417 (bug 1839051)
Backed out changeset 5204b97e40bc (bug 1839051)
Backed out changeset 8443a22a399d (bug 1839051)
Backed out changeset 2ab1e27d5945 (bug 1839051)
Backed out changeset 20a850a4fd7e (bug 1839051)
Backed out changeset 658568fe9662 (bug 1839051)
Backed out changeset 82525b11a7c3 (bug 1839051)
Backed out changeset 720e6863c41a (bug 1839051)
2023-12-04 22:34:25 +02:00
Jens Stutte
b612507fab Bug 1839051 - Remove include nsQuickSort.h from some more files. r=emilio
Depends on D182724

Differential Revision: https://phabricator.services.mozilla.com/D182731
2023-12-04 18:33:42 +00:00
Robert Longson
cc9eee5e2d Bug 1862411 - simplify array access by using range based loops and LastElement r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D192465
2023-11-03 16:22:23 +00:00
Sylvestre Ledru
b0fe72dee5 Bug 1856795 - Remove redundant member init r=emilio
Done with:
./mach static-analysis check --checks="-*, readability-redundant-member-init" --fix .

https://clang.llvm.org/extra/clang-tidy/checks/readability/redundant-member-init.html

Differential Revision: https://phabricator.services.mozilla.com/D190002
2023-10-15 15:29:02 +00:00
Cristina Horotan
7388749830 Backed out 2 changesets (bug 1856795) for causing build bustage at BasicEvents.h CLOSED TREE
Backed out changeset 1d98b028923a (bug 1856795)
Backed out changeset eae2ac93e17c (bug 1856795)
2023-10-14 21:42:14 +03:00
Sylvestre Ledru
4a97019e39 Bug 1856795 - Remove redundant member init r=emilio
Done with:
./mach static-analysis check --checks="-*, readability-redundant-member-init" --fix .

https://clang.llvm.org/extra/clang-tidy/checks/readability/redundant-member-init.html

Differential Revision: https://phabricator.services.mozilla.com/D190002
2023-10-14 17:34:26 +00:00
Robert Longson
d3b3f2c561 Bug 1844992 - refactor GetSubStringLength r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D184410
2023-07-27 10:15:23 +00:00
Jonathan Kew
717c43c12d Bug 1840195 - Don't try to treat the first character in an SVGTextFrame as a cluster extender, even if it's a combining char. r=longsonr
Differential Revision: https://phabricator.services.mozilla.com/D181941
2023-06-26 08:41:13 +00:00
Robert Longson
acce73f925 Bug 1832517 - simplify pointer-events and hit-testing logic r=emilio
Move SVGUtils:HitTestChildren into its only caller

Remove unreachable code post bug 829802

Remove code that checks for the bounding box when there is opacity as it does nothing useful.

Differential Revision: https://phabricator.services.mozilla.com/D177739
2023-05-11 15:26:57 +00:00
Robert Longson
db5bd5b9a8 Bug 1751025 - Opacity CSS property should apply to all children of text elements r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D174964
2023-04-11 22:08:24 +00:00