Commit graph

1692 commits

Author SHA1 Message Date
David Shin
6cb3b01af3 Bug 1812679 - Handle central baseline calculation in GetNaturalBaselineBOffset. r=layout-reviewers,emilio
Previously, for writing-mode using central baseline alignment (i.e. `vertical-(lr|rl)`,
we simply used the center of content-box in `nsLineLayout::VerticalAlignFrames`.
However, this is incorrect for e.g. a `div` with two lines of text - just like how
its alphabetical baseline is the baseline of the second line of text, the central
baseline should be the centerline of the second line.

Differential Revision: https://phabricator.services.mozilla.com/D172165
2023-03-23 17:36:49 +00:00
Stanca Serban
7c4f609327 Backed out changeset 49646b0d59aa (bug 1812679) for causing mochitests failures in layout/style/test/test_revert.html. CLOSED TREE 2023-03-23 17:39:13 +02:00
David Shin
2f94be9968 Bug 1812679 - Handle central baseline calculation in GetNaturalBaselineBOffset. r=layout-reviewers,emilio
Previously, for writing-mode using central baseline alignment (i.e. `vertical-(lr|rl)`,
we simply used the center of content-box in `nsLineLayout::VerticalAlignFrames`.
However, this is incorrect for e.g. a `div` with two lines of text - just like how
its alphabetical baseline is the baseline of the second line of text, the central
baseline should be the centerline of the second line.

Differential Revision: https://phabricator.services.mozilla.com/D172165
2023-03-23 14:35:12 +00:00
Jonathan Kew
612bf9c124 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
Jonathan Kew
bbb315c6c5 Bug 1818654 - Don't give up on clipping to the visible rect in nsDisplayText when selection or shadow is present. r=emilio
Although I haven't been able to reproduce the reporter's OOM crash here, I hope this will avoid
the issue; it certainly improves performance characteristics in my local build.

On the example here, my laptop happily scrolls the text field at 60fps when nothing is selected;
but if the text is selected it can only manage around 40fps, because we lose the clipping
optimization here.

With this change, it maintains 60fps regardless of whether the text is selected (or text-shadow
is present), and memory footprint is substantially reduced.

Differential Revision: https://phabricator.services.mozilla.com/D171318
2023-03-01 11:37:27 +00:00
David Shin
f5a42005e2 Bug 1811311 - Part 3: Refactor GetNaturalBaselineBOffset to return Maybe<nscoord>. r=layout-reviewers,emilio
Changed from returning `bool` & taking an out parameter.

Differential Revision: https://phabricator.services.mozilla.com/D168998
2023-02-23 14:53:27 +00:00
David Shin
5c7c22165f Bug 1811311 - Part 1: Unite baseline-related functions in nsIFrame into one. r=emilio
Before, there existed 3 virtual functions that calculated baselines:

- `GetLogicalBaseline`
- `GetVerticalAlignBaseline`
- `GetNaturalBaselineBOffset`

Each of them had slightly different behaviours:

- `GetLogicalBaseline` would synthesize a baseline if there is no baseline.
  Others would simply return `false`.
- `GetNaturalBaselineBOffset` requires the caller to pick which of first/last
  baseline to calculate. Others pick on on their own.
- `GetNaturalBaselineBOffset`'s result can be either offset from border box
   start/end edge, depending on the caller-supplied baseline. Others always
   return offset from border box start edge.

Now:

- `GetNaturalBaselineBOffset` is the sole virtual function.
- `GetLogicalBaseline` exists to support its use, with 2 virtual helper functions:
  - `SynthesizeFallbackBaseline` to generate a baseline for elements that
    doesn't have one.
  - `GetBaselineSharingGroup` to preserve the default baseline picking behaviour.

Differential Revision: https://phabricator.services.mozilla.com/D167990
2023-02-23 14:53:26 +00:00
Jonathan Kew
89530bf362 Bug 1818172 - Use nsTextFrame::ResolveSelections and a SelectionRangeIterator to optimize PaintTextSelectionDecorations. r=emilio
With this, the old SelectionIterator that expects a per-character array of
SelectionDetails pointers is no longer used anywhere.

Differential Revision: https://phabricator.services.mozilla.com/D170588
2023-02-23 11:14:27 +00:00
Jonathan Kew
cc1e7449f8 Bug 1816927 - Improve performance of nsTextFrame::PaintTextWithSelectionColors on very large textframes. r=emilio
This significantly improves performance and reduces memory usage when painting a very long textframe
with some or all of the text selected.

Differential Revision: https://phabricator.services.mozilla.com/D170530
2023-02-23 09:36:13 +00:00
Jonathan Kew
1b3e69f8aa Bug 1815404 - Remove refcounting from gfxContext. r=gfx-reviewers,lsalzman
Depends on D170367

Differential Revision: https://phabricator.services.mozilla.com/D170369
2023-02-21 07:28:24 +00:00
Robert Longson
2ec308723b Bug 1651129 - Convert uses of mState to various StateBits methods and make mState private r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D169943
2023-02-15 21:35:46 +00:00
Emilio Cobos Álvarez
eb823eb895 Bug 1814626 - Expose line-height resolution to style, and use it from ToResolvedValue. r=jfkthame
For ToResolvedValue implementation purposes we wouldn't need to split
out the vertical / font / line-height arguments and we could just pass
around the ComputedStyle, but the lh unit would need that distinction,
(because computing lh on font properties should use the parent style).

Differential Revision: https://phabricator.services.mozilla.com/D168705
2023-02-14 22:36:31 +00:00
Robert Longson
b1c227d6c4 Bug 1407955 - Display text shadow with fill and stroke specified r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D169661
2023-02-14 09:28:44 +00:00
Emilio Cobos Álvarez
eb330d953c Bug 1816329 - Avoid computing WebRender text bounds without text shadows. r=jfkthame
The WR text bounds are just "ink overflow without shadows", so save some
work and memory when we don't have shadows anyways.

Differential Revision: https://phabricator.services.mozilla.com/D169573
2023-02-12 21:31:13 +00:00
Jan-Niklas Jaeschke
fa75d3a60f Bug 1803355: Basic implementation of Custom Highlight API. r=edgar,emilio
Added WebIDL interfaces as per spec, added some necessary changes to support maplike and setlike structures to be accessed from C++.

Added `::highlight(foo)` pseudo element to CSS engine.

Implemented Highlight as new kind of `Selection` using `HighlightType::eHighlight`. This implies Selections being added/removed during runtime (one `Selection` object per highlight identifier), therefore a dynamic container for highlight `Selection` objects was added to `nsFrameSelection`. Also, the painting code queries the highlight style for highlight Selections.

Implementation is currently hidden behind a pref `dom.customHighlightAPI.enabled`.

Differential Revision: https://phabricator.services.mozilla.com/D164203
2023-01-27 11:42:18 +00:00
Sandor Molnar
4c4d29b581 Backed out changeset d7f27aa40260 (bug 1803355) for causing win build bustage. 2023-01-24 18:07:50 +02:00
Jan-Niklas Jaeschke
1b3bff372b Bug 1803355: Basic implementation of Custom Highlight API. r=edgar,emilio
Added WebIDL interfaces as per spec, added some necessary changes to support maplike and setlike structures to be accessed from C++.

Added `::highlight(foo)` pseudo element to CSS engine.

Implemented Highlight as new kind of `Selection` using `HighlightType::eHighlight`. This implies Selections being added/removed during runtime (one `Selection` object per highlight identifier), therefore a dynamic container for highlight `Selection` objects was added to `nsFrameSelection`. Also, the painting code queries the highlight style for highlight Selections.

Implementation is currently hidden behind a pref `dom.customHighlightAPI.enabled`.

Differential Revision: https://phabricator.services.mozilla.com/D164203
2023-01-24 11:46:28 +00:00
Sandor Molnar
a610ef723a Backed out changeset 54771a1963b6 (bug 1803355) for causing win build bustage. CLOSED TREE 2023-01-24 12:17:49 +02:00
Jan-Niklas Jaeschke
99eb703228 Bug 1803355: Basic implementation of Custom Highlight API. r=edgar,emilio
Added WebIDL interfaces as per spec, added some necessary changes to support maplike and setlike structures to be accessed from C++.

Added `::highlight(foo)` pseudo element to CSS engine.

Implemented Highlight as new kind of `Selection` using `HighlightType::eHighlight`. This implies Selections being added/removed during runtime (one `Selection` object per highlight identifier), therefore a dynamic container for highlight `Selection` objects was added to `nsFrameSelection`. Also, the painting code queries the highlight style for highlight Selections.

Implementation is currently hidden behind a pref `dom.customHighlightAPI.enabled`.

Differential Revision: https://phabricator.services.mozilla.com/D164203
2023-01-24 07:36:13 +00:00
Noemi Erli
aec839cbc8 Backed out changeset 759d4948ed8b (bug 1803355) for causing build bustages CLOSED TREE 2023-01-22 05:03:04 +02:00
Jan-Niklas Jaeschke
0a52844148 Bug 1803355: Basic implementation of Custom Highlight API. r=edgar,emilio
Added WebIDL interfaces as per spec, added some necessary changes to support maplike and setlike structures to be accessed from C++.

Added `::highlight(foo)` pseudo element to CSS engine.

Implemented Highlight as new kind of `Selection` using `HighlightType::eHighlight`. This implies Selections being added/removed during runtime (one `Selection` object per highlight identifier), therefore a dynamic container for highlight `Selection` objects was added to `nsFrameSelection`. Also, the painting code queries the highlight style for highlight Selections.

Implementation is currently hidden behind a pref `dom.customHighlightAPI.enabled`.

Differential Revision: https://phabricator.services.mozilla.com/D164203
2023-01-22 02:04:43 +00:00
Ben Freist
476cccc35c Bug 1808888 - [refactor] Migrate NS_STYLE_LIST_STYLE_POSITION_* defines r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D166140
2023-01-09 07:07:13 +00:00
Jonathan Kew
c644dcc044 Bug 290125 - Create a pref to treat floated ::first-letter more like webkit/blink, not tightly wrapping the glyph extents. r=emilio
Historically, Gecko implemented the behavior allowed by CSS2 whereby a floated ::first-letter is "boxed"
tightly around the glyph shape, rather than using constant font-ascent and -descent metrics which may
leave a lot of blank space depending whether the character has any ascender/descender or not.

However, neither webkit nor blink do this, which leads to webcompat pain when sites are constructed
assuming their behavior.

Eventually, I think we should ideally reimplement ::first-letter entirely at frame-construction time,
rather than during reflow. But in the interest of minimizing risk here, and making it easy to flip
between our existing "legacy" behavior and the new "compatible" behavior, this patch leaves the
overall implementation unchanged and just alters the metrics used for the resulting first-letter
frame.

This patch creates an integer pref layout.css.floating-first-letter.tight-glyph-bounds to allow us
to choose between three behaviors:

    1: Use tight glyph bounds, and ignore line-height; the baseline of the floated letter automatically
       adjusts to wrap text around the "ink box" of the glyph. This is the existing Gecko behavior.

    0: Don't use tight glyph bounds, respect line-height: the floated letter acts like a normal <span>
       with float positioning; baseline position and vertical size are based on font metrics but not
       the specific shape of the individual glyph. This gives a similar result to webkit/blink.

   -1: Automatically choose between (1) and (0) based on heuristics to try and detect whether the page
       was written with the webkit/blink behavior (0) in mind; specifically, if there is a line-height
       of less than 1em, or a negative block-start margin, we assume the author was trying to eliminate
       excess blank space that behavior (0) tends to produce, and so we use that model.

Initially, this patch leaves the behavior unchanged for Beta/Release builds, but enables option -1 (use
heuristics to choose which layout model to apply) on Nightly so we can see how that works in practice.

Differential Revision: https://phabricator.services.mozilla.com/D165008
2022-12-20 07:55:24 +00:00
Ben Freist
ce6cd37bc7 Bug 1802799 - [refactor] Migrate NS_STYLE_TEXT_DECORATION_STYLE_* defines r=emilio,geckoview-reviewers,ohall
Differential Revision: https://phabricator.services.mozilla.com/D163177
2022-12-19 22:47:24 +00:00
Cristian Tuns
d3c6c33e10 Backed out 3 changesets (bug 290125) for causing build bustages on nsFirstLetterFrame.cpp CLOSED TREE
Backed out changeset 0b6b18ea2634 (bug 290125)
Backed out changeset d8297eee88e7 (bug 290125)
Backed out changeset 3f341b8efb86 (bug 290125)
2022-12-19 12:34:05 -05:00
Jonathan Kew
38d9b4abd2 Bug 290125 - Create a pref to treat floated ::first-letter more like webkit/blink, not tightly wrapping the glyph extents. r=emilio
Historically, Gecko implemented the behavior allowed by CSS2 whereby a floated ::first-letter is "boxed"
tightly around the glyph shape, rather than using constant font-ascent and -descent metrics which may
leave a lot of blank space depending whether the character has any ascender/descender or not.

However, neither webkit nor blink do this, which leads to webcompat pain when sites are constructed
assuming their behavior.

Eventually, I think we should ideally reimplement ::first-letter entirely at frame-construction time,
rather than during reflow. But in the interest of minimizing risk here, and making it easy to flip
between our existing "legacy" behavior and the new "compatible" behavior, this patch leaves the
overall implementation unchanged and just alters the metrics used for the resulting first-letter
frame.

This patch creates an integer pref layout.css.floating-first-letter.tight-glyph-bounds to allow us
to choose between three behaviors:

    1: Use tight glyph bounds, and ignore line-height; the baseline of the floated letter automatically
       adjusts to wrap text around the "ink box" of the glyph. This is the existing Gecko behavior.

    0: Don't use tight glyph bounds, respect line-height: the floated letter acts like a normal <span>
       with float positioning; baseline position and vertical size are based on font metrics but not
       the specific shape of the individual glyph. This gives a similar result to webkit/blink.

   -1: Automatically choose between (1) and (0) based on heuristics to try and detect whether the page
       was written with the webkit/blink behavior (0) in mind; specifically, if there is a line-height
       of less than 1em, or a negative block-start margin, we assume the author was trying to eliminate
       excess blank space that behavior (0) tends to produce, and so we use that model.

Initially, this patch leaves the behavior unchanged for Beta/Release builds, but enables option -1 (use
heuristics to choose which layout model to apply) on Nightly so we can see how that works in practice.

Differential Revision: https://phabricator.services.mozilla.com/D165008
2022-12-19 16:35:18 +00:00
Martin Robinson
abb5044ca7 Bug 1803377 - Rename the values of the IntrinsicDirty enum r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D163607
2022-12-02 12:27:31 +00:00
Ben Freist
a0881d2bec Bug 1801458 - [refactor] Migrate NS_STYLE_UNICODE_BIDI_* defines r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D162487
2022-11-22 18:37:02 +00:00
James Teh
6c0098d405 Bug 1801433: Remove PresShell::GetAccessibilityService/IsAccessibilityActive. r=emilio
These have just called GetAccService for a long time now, so callers should just call that directly.

Differential Revision: https://phabricator.services.mozilla.com/D162449
2022-11-19 23:04:08 +00:00
Jonathan Kew
5ff7d28400 Bug 1800437 - Correct behavior of GetClusterLength helper when applying text-overflow:ellipsis in RTL. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D162095
2022-11-15 14:24:59 +00:00
Ting-Yu Lin
514d412f9b Bug 1799732 Part 3 - Convert FrameChildListID to enum class. r=emilio
This patch is first generated by the following script under gecko root folder.

```
#!/bin/bash

function rename() {
    echo "Renaming $1 to $2"
    rg -l "$1" | xargs sed -i -E -e s/"$1"/"$2"/g
}

rename "kPrincipalList" "FrameChildListID::Principal"
rename "kPopupList" "FrameChildListID::Popup"
rename "kCaptionList" "FrameChildListID::Caption"
rename "kColGroupList" "FrameChildListID::ColGroup"
rename "kAbsoluteList" "FrameChildListID::Absolute"
rename "kFixedList" "FrameChildListID::Fixed"
rename "kOverflowList" "FrameChildListID::Overflow"
rename "kOverflowContainersList" "FrameChildListID::OverflowContainers"
rename "kExcessOverflowContainersList" "FrameChildListID::ExcessOverflowContainers"
rename "kOverflowOutOfFlowList" "FrameChildListID::OverflowOutOfFlow"
rename "kFloatList" "FrameChildListID::Float"
rename "kBulletList" "FrameChildListID::Bullet"
rename "kPushedFloatsList" "FrameChildListID::PushedFloats"
rename "kBackdropList" "FrameChildListID::Backdrop"
rename "kNoReflowPrincipalList" "FrameChildListID::NoReflowPrincipal"
```

And then:
1. Manually fix `FrameChildListID` definition in nsFrameList.h.
2. Apply clang-format.

Differential Revision: https://phabricator.services.mozilla.com/D161864
2022-11-12 04:38:53 +00:00
Ting-Yu Lin
c565d29604 Bug 1799732 Part 2 - Flatten the namespace for FrameChildList and co. by removing namespace layout. r=emilio
After moving FrameChildListID into mozilla namespace, `kPrincipalList` etc. are
also exposed in the mozilla namespace. In the next part, I'll convert
FrameChildListID enum into an enum class, so the naming pollution shouldn't be
an issue.

This patch has a nice side effect that it is now easier to remove all the
aliases of FrameChildListID (`kPrincipalList` etc.) defined in multiple places
since it is confusion to have the same thing written in different ways, e.g.
`nsIFrame::kPrincipalList`, `mozilla::layout::kPrincipalList`,
`FrameChildListID::kPrincipalList`, `kPrincipalList`.

This patch doesn't change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D161863
2022-11-12 04:38:53 +00:00
Noemi Erli
7c40c0e983 Backed out 3 changesets (bug 1799732) for causing build bustages in nsIFrame.cpp CLOSED TREE
Backed out changeset e559f9dbc76f (bug 1799732)
Backed out changeset c40fda7a8b0b (bug 1799732)
Backed out changeset 1f84bfb41ab8 (bug 1799732)
2022-11-12 02:16:45 +02:00
Ting-Yu Lin
192956df1b Bug 1799732 Part 3 - Convert FrameChildListID to enum class. r=emilio
This patch is first generated by the following script under gecko root folder.

```
#!/bin/bash

function rename() {
    echo "Renaming $1 to $2"
    rg -l "$1" | xargs sed -i -E -e s/"$1"/"$2"/g
}

rename "kPrincipalList" "FrameChildListID::Principal"
rename "kPopupList" "FrameChildListID::Popup"
rename "kCaptionList" "FrameChildListID::Caption"
rename "kColGroupList" "FrameChildListID::ColGroup"
rename "kAbsoluteList" "FrameChildListID::Absolute"
rename "kFixedList" "FrameChildListID::Fixed"
rename "kOverflowList" "FrameChildListID::Overflow"
rename "kOverflowContainersList" "FrameChildListID::OverflowContainers"
rename "kExcessOverflowContainersList" "FrameChildListID::ExcessOverflowContainers"
rename "kOverflowOutOfFlowList" "FrameChildListID::OverflowOutOfFlow"
rename "kFloatList" "FrameChildListID::Float"
rename "kBulletList" "FrameChildListID::Bullet"
rename "kPushedFloatsList" "FrameChildListID::PushedFloats"
rename "kBackdropList" "FrameChildListID::Backdrop"
rename "kNoReflowPrincipalList" "FrameChildListID::NoReflowPrincipal"
```

And then:
1. Manually fix `FrameChildListID` definition in nsFrameList.h.
2. Apply clang-format.

Differential Revision: https://phabricator.services.mozilla.com/D161864
2022-11-11 23:44:17 +00:00
Ting-Yu Lin
75940b1777 Bug 1799732 Part 2 - Flatten the namespace for FrameChildList and co. by removing namespace layout. r=emilio
After moving FrameChildListID into mozilla namespace, `kPrincipalList` etc. are
also exposed in the mozilla namespace. In the next part, I'll convert
FrameChildListID enum into an enum class, so the naming pollution shouldn't be
an issue.

This patch has a nice side effect that it is now easier to remove all the
aliases of FrameChildListID (`kPrincipalList` etc.) defined in multiple places
since it is confusion to have the same thing written in different ways, e.g.
`nsIFrame::kPrincipalList`, `mozilla::layout::kPrincipalList`,
`FrameChildListID::kPrincipalList`, `kPrincipalList`.

This patch doesn't change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D161863
2022-11-11 23:44:16 +00:00
Razvan Cojocaru
1629218702 Bug 1060421 - Change the type of [Int]PointTyped::[x|y] back to [Int]CoordTyped. r=botond
[Int]CoordTyped no longer inherits Units because otherwise
instances of [Int]IntPointTyped may get one Base subobject because
it inherits Units, and others because of BasePoint's Coord members,
which end up increasing the [Int]CoordTyped's objects size (since
according to the ISO C++ standard, different Base subobject are
required to have different addresses).

Differential Revision: https://phabricator.services.mozilla.com/D160713
2022-11-04 18:29:35 +00:00
Daniel Holbert
6d7a2bc895 Bug 1798953 part 1: Initialize ClusterIterator::mIterator in the init list. r=jfkthame
Before this patch, we implicitly invoke the default constructor for this
member-var, and then immediately stomp on the results with a reassignment.

This patch avoids that unnecessary usage of the default constructor, saving
ourslves a bit of work and getting this member-var more directly into a
fully-initialized/valid state.

Differential Revision: https://phabricator.services.mozilla.com/D159903
2022-11-03 18:03:59 +00:00
Ting-Yu Lin
040feb02dd Bug 1798373 Part 7 - Change nsContainerFrame::InsertFrames() to take rvalue reference of nsFrameList. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D160843
2022-11-01 21:15:55 +00:00
Iulian Moraru
82b06c58a4 Backed out 4 changesets (bug 1796697) as per Daniel Holbert's request. CLOSED TREE
Backed out changeset f9d2d5f60fe9 (bug 1796697)
Backed out changeset b7ee22f54a6c (bug 1796697)
Backed out changeset d43777f8ef79 (bug 1796697)
Backed out changeset a2763d3ad250 (bug 1796697)
2022-10-30 23:06:57 +02:00
Daniel Holbert
707a9a407d Bug 1797148: Simplify checkVisibility API (on nsISelectionController and nsIFrame) into a single nsTextFrame::HasVisibleText method. r=masayuki
Before this patch, we had two `checkVisibilty` methods on the
nsISelectionController interface, backed by several layers of implementation,
ultimately backed by a single function on nsTextFrame (which didn't actually
do anything meaningful with any of the parameters).

As it turns out, this API only had one caller, in HTMLEditUtils.cpp.

This patch converts that caller to directly query nsTextFrame (if the given
node's primary frame is indeed a nsTextFrame).  The direct function-call is
renamed to HasVisibleText(), to be a bit clearer about it being text-specific
and also to avoid confusion with the (unrelated) recently-specified HTML
checkVisibility() API.

With these changes, we can remove the API from the nsISelectionController
interface and its implementations.

This patch also updates the HTMLEditUtils::IsInVisibleTextFrames documentation
(with s/all/any/) to reflect the reality of what the nsTextFrame impl actually
does.

Differential Revision: https://phabricator.services.mozilla.com/D160563
2022-10-28 17:56:04 +00:00
Daniel Holbert
6cd5f0c320 Bug 1797143: Remove unnecessary const_cast usage in nsTextFrame.cpp. r=layout-reviewers,emilio
This patch doesn't affect behavior.

The removed const_casts are unnecessary; they're in a non-const function, so
'this' is already a non-const type.

Depends on D160101

Differential Revision: https://phabricator.services.mozilla.com/D160102
2022-10-24 19:17:23 +00:00
Daniel Holbert
a10820f200 Bug 1797143: Add curly braces around if-controlled statements in nsTextFrame.cpp. r=layout-reviewers,emilio
This patch doesn't impact behavior.

This patch changes the code to align with this Mozilla coding style rule:
"Always brace controlled statements, even a single-line consequent [...]"
https://firefox-source-docs.mozilla.org/code-quality/coding-style/coding_style_cpp.html#control-structures

Differential Revision: https://phabricator.services.mozilla.com/D160101
2022-10-24 19:17:22 +00:00
Daniel Holbert
3edbf95781 Bug 1797143: Switch from 'new' to 'MakeUnique' to construct an instance that's stored in a UniquePtr, in nsTextFrame.cpp. r=layout-reviewers,emilio
This patch doesn't change behavior.

'observers' is a pointer to nsTArray<UniquePtr<GlyphObserver>>; and UniquePtr
prefers[1] MakeUnique over 'new' (due to stronger ownership-related
guarantees), so let's switch to MakeUnique for construction here.

[1] reference:
https://searchfox.org/mozilla-central/rev/88f285c5163f73abd209d4f73cfa476660351982/mfbt/UniquePtr.h#129-131

Depends on D160099

Differential Revision: https://phabricator.services.mozilla.com/D160100
2022-10-24 19:17:22 +00:00
Daniel Holbert
880ea24d1f 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
580cd3342a 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
b593702fb8 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
d811a2820d 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
5b0216e320 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
1ced95e237 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
fbe5f32f43 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