Commit Graph
25 Commits
Author SHA1 Message Date
Jan-Niklas Jaeschke c19b2f2de2 Bug 1904796 - Text Fragments: Override ::target-text colors with mark/marktext in High-Contrast mode. r=morgan,emilio
Differential Revision: https://phabricator.services.mozilla.com/D218653
2024-08-09 06:52:57 +00:00
Jan-Niklas Jaeschke c25a8c4b54 Bug 1867940 - Text Fragments: Implement sensible default colors. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D212378
2024-06-05 10:46:53 +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
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
Peter Van der Beken 0f266299d5 Bug 1640839 - Add some helpers for enums to calculate the size and use it in EnumeratedArray. r=glandium,jgilbert,media-playback-reviewers,padenot
Differential Revision: https://phabricator.services.mozilla.com/D201334
2024-03-02 07:50:19 +00:00
Peter Van der Beken 41dfa49835 Bug 1640839 - Move size template parameter for EnumeratedArray to the end. r=glandium,jgilbert,media-playback-reviewers,credential-management-reviewers,padenot,dimi
This will allow us to provide a default value for the size when some enum
helper traits are defined.

Differential Revision: https://phabricator.services.mozilla.com/D201333
2024-03-02 07:50:19 +00:00
Natalia Csoregi 10b9ceb789 Backed out 13 changesets (bug 1640839) for causing bustage on Element.cpp CLOSED TREE
Backed out changeset 179ceb82c9e5 (bug 1640839)
Backed out changeset 73f498a821f0 (bug 1640839)
Backed out changeset dc2d3d0e0365 (bug 1640839)
Backed out changeset ddc989ac0509 (bug 1640839)
Backed out changeset e595bb3feea8 (bug 1640839)
Backed out changeset c85aca04e27f (bug 1640839)
Backed out changeset 98e8e3a4047a (bug 1640839)
Backed out changeset 59ef180517db (bug 1640839)
Backed out changeset af2f5e293662 (bug 1640839)
Backed out changeset 89aa6d9dc598 (bug 1640839)
Backed out changeset 67b722a722f9 (bug 1640839)
Backed out changeset 24a9665c6ced (bug 1640839)
Backed out changeset d93f199385e9 (bug 1640839)
2024-03-01 18:23:08 +02:00
Peter Van der Beken e5be7aeaf9 Bug 1640839 - Add some helpers for enums to calculate the size and use it in EnumeratedArray. r=glandium,jgilbert,media-playback-reviewers,padenot
Differential Revision: https://phabricator.services.mozilla.com/D201334
2024-03-01 14:31:09 +00:00
Peter Van der Beken d2abb054b6 Bug 1640839 - Move size template parameter for EnumeratedArray to the end. r=glandium,jgilbert,media-playback-reviewers,credential-management-reviewers,padenot,dimi
This will allow us to provide a default value for the size when some enum
helper traits are defined.

Differential Revision: https://phabricator.services.mozilla.com/D201333
2024-03-01 14:31:09 +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 5caa5beb24 Bug 1330088 part 4: Use a constant (maximum-enum-value) to represent the number of styles in nsTextPaintStyle types, rather than a repeated magic number. r=layout-reviewers,emilio
This patch doesn't change behavior. It's just replacing a magic number `5` with
a constant whose value is automatically inferred based on the enum that it's
defined within. (The enum's other values are explicitly 0-based so that they
can serve as array indices, so it's natural to define a final sentinel
enum-value to represent the count of valid indices.)

Differential Revision: https://phabricator.services.mozilla.com/D197755
2024-01-08 20:47:34 +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
Daniel Holbert 6c0b4ab40b Bug 1330088 part 2: Drop "Get" from GetSelectionStyle API to reflect the fact that it's infallible. r=jfkthame,layout-reviewers
This patch doesn't change behavior.

We have a gecko convention that pointer-returning getters will only have "Get"
in the name if they might return nullptr (and the caller needs to check for
this).

This particular API doesn't ever return null, so it shouldn't have "Get" in its
name.

Differential Revision: https://phabricator.services.mozilla.com/D197753
2024-01-08 20:47:33 +00:00
Daniel Holbert b9e9a967d1 Bug 1330088 part 1: Refactor nsTextPaintStyle to use Maybe<> instead of an explicit "mInit" bool. r=jfkthame,layout-reviewers
This patch doesn't change behavior. It just replaces an "is-this-initialized"
bool with our more declarative Maybe<> struct which is uninitialized-by-default
(and brings along debug-build checks to ensure we don't use before
initializing).

Differential Revision: https://phabricator.services.mozilla.com/D197752
2024-01-08 20:47:32 +00:00
Emilio Cobos Álvarez 2cfef07f89 Bug 1845667 - Use semi-transparent text for urlbar rather than trying to do that manually. r=dao
This comes back all the way to bug 654411. This doesn't work great with
semi-transparent backgrounds (like the one on that theme) because we
don't bother computing the "real" background (we can't really, since
it's partially a background image).

I don't think text rendering quality should be worse with alpha text
nowadays. I guess we could preserve it with some effort for opaque
mFrameBackgroundColor values (propagating whether it was really opaque
or not), but let's not do it unless we really need to.

Differential Revision: https://phabricator.services.mozilla.com/D185512
2023-08-07 09:12:47 +00:00
Jan-Niklas Jaeschke 1f364d2e38 Bug 1838262, part 3: Removed ServoStyleSet::ProbeHighlightPseudoElementStyle(). r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D184709
2023-07-31 13:47:55 +00:00
Jan-Niklas Jaeschke c821b10ef4 Bug 1811823, part 2: Add correct prioritization for custom highlights. r=emilio
Due to the prioritization rules for custom highlights, it is not feasible to rely on cascading.
Instead, highlights need to be stacked by their priority (and order of insertion).
Text and background color of the highest-prioritized highlight which defines that property should be used.

Since highlights are implemented as special `Selection`s, the algorithm that determines the prevailing selection for a text frame needed to be adapted to instead return a list of selections.

Differential Revision: https://phabricator.services.mozilla.com/D181143
2023-06-23 15:22:44 +00:00
Emilio Cobos Álvarez 2319f4f573 Bug 1832803 - Remove some magic from the bindings. r=boris
This simplifies a tiny bit our bindings in some places, and complicates
it in others, but over all I think it's better.

It requires a bit more manual code in the rust side to drop and cast the
relevant pointers (which was done implicitly before), but it's a lot
less magic than it used to be, and that's all autogenerated so consumers
don't need to care about it.

The set up is still not ideal. I don't like that we rely on destructors
running in both sides of the FFI boundary, but that's for another day.

This is the last usage of RawOffsetArc, so remove that. We now support
proper Arc<> in structs (GridTemplateAreas uses it), so I don't think
we'll need it any time soon.

Differential Revision: https://phabricator.services.mozilla.com/D177905
2023-05-12 23:33:12 +00:00
Robert Longson 40b6dc20e5 Bug 1826001 - Change SVGUtils::IsInSVGTextSubtree into a member function on nsIFrame r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D174375
2023-04-02 21:17:07 +00:00
Jonathan Kew 9bf21859c3 Bug 1819957 - Split out nsTextPaintStyle into its own source file. r=emilio
This lets us instantiate it on the stack in nsDisplayText::Paint.

Differential Revision: https://phabricator.services.mozilla.com/D171635
2023-03-05 22:24:10 +00:00