Commit Graph
3425 Commits
Author SHA1 Message Date
velzie 673a67963e initial commit for wasm work 2026-06-15 19:20:19 -04:00
Keith Cirkel a804178a61 Bug 2041004 - Make ::picker-icon generated content, add UA styles r=layout-reviewers,firefox-style-system-reviewers,emilio
This refactors the `::picker-icon` to be a generated content tree
abiding pseudo, rather than an element backed. This is in order for us
to support the specified `content:` UA styles.

This change also introduces said UA styles.

Differential Revision: https://phabricator.services.mozilla.com/D304450
2026-06-12 02:15:08 +00:00
Silaghi 98bf5b0321 Revert "Bug 204494, Bug 2041004 - Add <select> pseudo elements to devtools style inspector r=devtools-reviewers,nchevobbe"
This reverts commit 739a225b8a.

Revert "Bug 2041004 - Make ::picker-icon generated content, add UA styles r=layout-reviewers,firefox-style-system-reviewers,emilio"

This reverts commit 4b7b2a4083.
2026-06-10 16:55:02 +00:00
Keith Cirkel 4b7b2a4083 Bug 2041004 - Make ::picker-icon generated content, add UA styles r=layout-reviewers,firefox-style-system-reviewers,emilio
This refactors the `::picker-icon` to be a generated content tree
abiding pseudo, rather than an element backed. This is in order for us
to support the specified `content:` UA styles.

This change also introduces said UA styles.

Differential Revision: https://phabricator.services.mozilla.com/D304450
2026-06-10 15:27:45 +00:00
Emilio Cobos Álvarez 78b87ae8be Bug 2045230 - Add background-clip: border-area support for solid borders. r=gfx-reviewers,layout-reviewers,firefox-style-system-reviewers,lsalzman,dshin
This is useful for nova (which wants to use a gradient border around the
selected tab and right now hack around it with multiple backgrounds).

For now enable only on chrome code by default since we only support
solid borders (which is what we want anyways), and we don't support
combining it with `background-clip: text`.

Differential Revision: https://phabricator.services.mozilla.com/D304960
2026-06-10 12:24:34 +00:00
Silaghi 50913f8313 Revert "Bug 2044945, Bug 2041004 - Add <select> psuedo elements to devtools style inspector r=devtools-reviewers,nchevobbe" for causing wr failures at select-appearance-disabled.html
This reverts commit 6b8775f47f.

Revert "Bug 2041004 - Make ::picker-icon generated content, add UA styles r=layout-reviewers,firefox-style-system-reviewers,emilio"

This reverts commit e3529d76f3.
2026-06-10 10:08:51 +00:00
Keith Cirkel e3529d76f3 Bug 2041004 - Make ::picker-icon generated content, add UA styles r=layout-reviewers,firefox-style-system-reviewers,emilio
This refactors the `::picker-icon` to be a generated content tree
abiding pseudo, rather than an element backed. This is in order for us
to support the specified `content:` UA styles.

This change also introduces said UA styles.

Differential Revision: https://phabricator.services.mozilla.com/D304450
2026-06-10 08:20:21 +00:00
Alexandru Marc ca229e12ac Revert (Bug 2044945, Bug 2041004) for causing wr failures @ select-explicit-size.html
This reverts commit b434b10988.

Revert "Bug 2041004 - Make ::picker-icon generated content, add UA styles r=layout-reviewers,firefox-style-system-reviewers,emilio"

This reverts commit e92bda8433.
2026-06-09 19:14:13 +00:00
Keith Cirkel e92bda8433 Bug 2041004 - Make ::picker-icon generated content, add UA styles r=layout-reviewers,firefox-style-system-reviewers,emilio
This refactors the `::picker-icon` to be a generated content tree
abiding pseudo, rather than an element backed. This is in order for us
to support the specified `content:` UA styles.

This change also introduces said UA styles.

Differential Revision: https://phabricator.services.mozilla.com/D304450
2026-06-09 17:37:46 +00:00
Sandor Molnar 15b6e590cd Revert "Bug 2041004 - Make ::picker-icon generated content, add UA styles r=layout-reviewers,firefox-style-system-reviewers,emilio" for causing wpt failures
This reverts commit 8ecfcdcb81.
2026-06-08 17:32:43 +00:00
Keith Cirkel 8ecfcdcb81 Bug 2041004 - Make ::picker-icon generated content, add UA styles r=layout-reviewers,firefox-style-system-reviewers,emilio
This refactors the `::picker-icon` to be a generated content tree
abiding pseudo, rather than an element backed. This is in order for us
to support the specified `content:` UA styles.

This change also introduces said UA styles.

Differential Revision: https://phabricator.services.mozilla.com/D304450
2026-06-08 16:00:35 +00:00
Emilio Cobos Álvarez 8a2eeff8e8 Bug 2044694 - Move ScrollOffsetUpdateType out of FrameMetrics to avoid unnecessary FrameMetrics.h includes. r=botond,layout-reviewers,TYLin
Differential Revision: https://phabricator.services.mozilla.com/D304480
2026-06-05 01:19:42 +00:00
Tiaan Louw aa4033b3f8 Bug 1974792 - Implement ::checkmark pseudo selector for customizable select r=layout-reviewers,devtools-reviewers,firefox-style-system-reviewers,emilio,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D295550
2026-06-02 09:40:28 +00:00
Atila Butkovits b2571923b9 Revert "Bug 1974792 - Implement ::checkmark pseudo selector for customizable select r=layout-reviewers,devtools-reviewers,firefox-style-system-reviewers,emilio,nchevobbe" for causing failures at browser_parsable_css.js.
This reverts commit 3e903c86a3.
2026-06-02 01:46:29 +00:00
Tiaan Louw 3e903c86a3 Bug 1974792 - Implement ::checkmark pseudo selector for customizable select r=layout-reviewers,devtools-reviewers,firefox-style-system-reviewers,emilio,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D295550
2026-06-01 20:56:54 +00:00
rperta 32326b72c7 Revert "Bug 1974792 - Implement ::checkmark pseudo selector for customizable select r=layout-reviewers,devtools-reviewers,firefox-style-system-reviewers,emilio,nchevobbe" for causing mass failures
This reverts commit 498b28b9e5.
2026-06-01 16:14:26 +00:00
Tiaan Louw 498b28b9e5 Bug 1974792 - Implement ::checkmark pseudo selector for customizable select r=layout-reviewers,devtools-reviewers,firefox-style-system-reviewers,emilio,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D295550
2026-06-01 15:22:26 +00:00
Lando a55502f71b Bug 1886762: apply code formatting via Lando
# ignore-this-changeset
2026-05-29 00:56:10 +00:00
Ting-Yu Lin 1d86c70a43 Bug 1886762 Part 2 - Make GetAnchorPosRect() and helper aware of inline containing block and IB-split. r=layout-reviewers,dshin
`IsProperAncestorFrameConsideringContinuations()` gets the ability to traverse
IB-split. This doesn't change behavior for existing callers because they are all
within `MOZ_ASSERT`.

Delete `TraverseUpToContainerChild()` since it is not aware of continuations nor
IB-split, and we don't need a returned child frame pointer. Fixing it properly
makes its functionally equivalent to
`IsProperAncestorFrameConsideringContinuations()`.

Differential Revision: https://phabricator.services.mozilla.com/D303080
2026-05-29 00:55:52 +00:00
Jan-Niklas Jaeschke bbb0e519d8 Bug 2017940 - Expand inline frame block-size in vertical mixed mode to fit sideways glyph runs. r=jfkthame,layout-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D284102
2026-05-13 22:32:42 +00:00
Swarup Ukil 4e99e4a115 Bug 2024341 - Ensure pseudo-elements that use attr() recascade when their originating element's attribute changes. r=emilio,firefox-style-system-reviewers,layout-reviewers
As it stood, if the originating element did not use attr(data) while
its pseudo-elements did use attr(data), then if data's value changed,
we would miss recascading the pseudo and leave them stale.

This patch only covers some pseudo-elements: generated content pseudo
elements (::marker, ::after, ::marker, ::backdrop), ::first-letter and
::first-line, and UA widget pseudos.

More work is needed for the remaining pseudos: Bug 2037724

Differential Revision: https://phabricator.services.mozilla.com/D299040
2026-05-12 18:06:49 +00:00
Ting-Yu Lin 1a4668757b Bug 2038366 - Add a child frame iterator for nsLineBox, and adapt callers. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D299505
2026-05-09 13:56:59 +00:00
Eugeniusz Lewandowski fc8097fcc3 Bug 1650944 - Remove ReflowInput.h include from nsIFrame.h r=firefox-style-system-reviewers,layout-reviewers,emilio
Removed the Reflow Input in nsIFrame. Added includes for ReflowInput as
necessary in cpp files. Also Forward Declared nsLineLayout in 3 header
files.

Differential Revision: https://phabricator.services.mozilla.com/D298203
2026-05-04 12:06:23 +00:00
Emilio Cobos Álvarez 68df57dca6 Bug 1930674 - Don't consider will-change: transform an always-active layer. r=gfx-reviewers,jrmuizel
will-change doesn't mean it is changing. We already did the same thing
for opacity years ago in bug 1754834.

will-change is useful to prevent side effects when the property changes
(like going from being a containing block for fixed-pos descendants to
not being it).

Given its limited extra effect and the complexity involved, let's remove
it.

We allow it to keep prerendering, since that is actually tested, and
seems worth doing.

Differential Revision: https://phabricator.services.mozilla.com/D228650
2026-04-28 20:06:11 +00:00
Emilio Cobos Álvarez 34b249c82e Bug 2031757 - Rejigger text input / textarea rendering to make field-sizing easier. r=layout-reviewers,devtools-reviewers,fxview-reviewers,firefox-style-system-reviewers,ochameau,jsudiaman,dshin
This also should fix bug 1881942 (placeholder is now scrollable
alongside the textarea).

This makes nsTextControlFrame a subclass of ScrollContainerFrame (with
an inner block), and tweaks layout to match.

It lays out the inner content using block layout and align-content,
rather than bespoke reflow primitives. This makes field-sizing trivial
to implement on top.

This is a bit scary, but simpler in most ways. In particular, it needs
to teach ScrollContainerFrame of the button, because that goes outside
the scrollable area, like scrollbars. That said it needs less
special-cases added than those removed, and it should also be faster
(needs less frames to layout an input with placeholder etc), and match
other browsers better.

The general set-up is:

  <text-control-editing-root/>
  <placeholder/>
  <autofill-preview/>

text-control-editing-root is always inline-block and always displayed
(since it's what grabs the focus / shows the caret). If the
autofill-preview or placeholder are displayed, the editing-root is
zero-width and clipped (note that for placeholder that's guaranteed
because placeholder is only shown with an empty value, but
autofill-preview needs it).

placeholder and autofill-preview are hidden via `display` rather than
visibility. This doesn't make a difference with this patch but it
matters for bug 1977176.

Caret painting needs an extra hop to paint atop the placeholder (no
observable behavior change, but worth calling out).

There is one subtle behavior change, which is that single-line inputs
never report scrollable overflow in the block axis. This matches other
browsers (see the tweak in nsBlockFrame's overflow computation) and is
needed to avoid regressing scrollable-overflow-padding-input.html.

The changes in window_composition_text_querycontent.xhtml are needed
because before this patch, the height of the control editing root was
always the height of the whole textarea. The characters you're composing
might legitimately be taller than the line. Bump the line height so that
that doesn't happen in this test.

Differential Revision: https://phabricator.services.mozilla.com/D293666
2026-04-16 17:09:40 +00:00
Serban Stanca 5d4176345b Revert "Bug 2031757 - Rejigger text input / textarea rendering to make field-sizing easier. r=layout-reviewers,devtools-reviewers,fxview-reviewers,firefox-style-system-reviewers,ochameau,jsudiaman,dshin" for causing several failures.
This reverts commit 81ef425716.
2026-04-16 09:31:32 +00:00
Emilio Cobos Álvarez 81ef425716 Bug 2031757 - Rejigger text input / textarea rendering to make field-sizing easier. r=layout-reviewers,devtools-reviewers,fxview-reviewers,firefox-style-system-reviewers,ochameau,jsudiaman,dshin
This also should fix bug 1881942 (placeholder is now scrollable
alongside the textarea).

This makes nsTextControlFrame a subclass of ScrollContainerFrame (with
an inner block), and tweaks layout to match.

It lays out the inner content using block layout and align-content,
rather than bespoke reflow primitives. This makes field-sizing trivial
to implement on top.

This is a bit scary, but simpler in most ways. In particular, it needs
to teach ScrollContainerFrame of the button, because that goes outside
the scrollable area, like scrollbars. That said it needs less
special-cases added than those removed, and it should also be faster
(needs less frames to layout an input with placeholder etc), and match
other browsers better.

The general set-up is:

  <text-control-editing-root/>
  <placeholder/>
  <autofill-preview/>

text-control-editing-root is always inline-block and always displayed
(since it's what grabs the focus / shows the caret). If the
autofill-preview or placeholder are displayed, the editing-root is
zero-width and clipped (note that for placeholder that's guaranteed
because placeholder is only shown with an empty value, but
autofill-preview needs it).

placeholder and autofill-preview are hidden via `display` rather than
visibility. This doesn't make a difference with this patch but it
matters for bug 1977176.

Caret painting needs an extra hop to paint atop the placeholder (no
observable behavior change, but worth calling out).

There is one subtle behavior change, which is that single-line inputs
never report scrollable overflow in the block axis. This matches other
browsers (see the tweak in nsBlockFrame's overflow computation) and is
needed to avoid regressing scrollable-overflow-padding-input.html.

The changes in window_composition_text_querycontent.xhtml are needed
because before this patch, the height of the control editing root was
always the height of the whole textarea. The characters you're composing
might legitimately be taller than the line. Bump the line height so that
that doesn't happen in this test.

Differential Revision: https://phabricator.services.mozilla.com/D293666
2026-04-16 08:10:39 +00:00
Hiroyuki Ikezoe 6b95a4dcb5 Bug 2020226 - Propagate the scroll container's writing mode into APZ. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D294549
2026-04-16 04:18:51 +00:00
agoloman dfead40619 Revert "Bug 2031757 - Rejigger text input / textarea rendering to make field-sizing easier. r=layout-reviewers,devtools-reviewers,fxview-reviewers,firefox-style-system-reviewers,ochameau,jsudiaman,dshin" for causing crashtest assertions @399262.html.
This reverts commit 51d51c3b33.
2026-04-16 00:28:13 +00:00
Emilio Cobos Álvarez 51d51c3b33 Bug 2031757 - Rejigger text input / textarea rendering to make field-sizing easier. r=layout-reviewers,devtools-reviewers,fxview-reviewers,firefox-style-system-reviewers,ochameau,jsudiaman,dshin
This also should fix bug 1881942 (placeholder is now scrollable
alongside the textarea).

This makes nsTextControlFrame a subclass of ScrollContainerFrame (with
an inner block), and tweaks layout to match.

It lays out the inner content using block layout and align-content,
rather than bespoke reflow primitives. This makes field-sizing trivial
to implement on top.

This is a bit scary, but simpler in most ways. In particular, it needs
to teach ScrollContainerFrame of the button, because that goes outside
the scrollable area, like scrollbars. That said it needs less
special-cases added than those removed, and it should also be faster
(needs less frames to layout an input with placeholder etc), and match
other browsers better.

The general set-up is:

  <text-control-editing-root/>
  <placeholder/>
  <autofill-preview/>

text-control-editing-root is always inline-block and always displayed
(since it's what grabs the focus / shows the caret). If the
autofill-preview or placeholder are displayed, the editing-root is
zero-width and clipped (note that for placeholder that's guaranteed
because placeholder is only shown with an empty value, but
autofill-preview needs it).

placeholder and autofill-preview are hidden via `display` rather than
visibility. This doesn't make a difference with this patch but it
matters for bug 1977176.

Caret painting needs an extra hop to paint atop the placeholder (no
observable behavior change, but worth calling out).

There is one subtle behavior change, which is that single-line inputs
never report scrollable overflow in the block axis. This matches other
browsers (see the tweak in nsBlockFrame's overflow computation) and is
needed to avoid regressing scrollable-overflow-padding-input.html.

The changes in window_composition_text_querycontent.xhtml are needed
because before this patch, the height of the control editing root was
always the height of the whole textarea. The characters you're composing
might legitimately be taller than the line. Bump the line height so that
that doesn't happen in this test.

Differential Revision: https://phabricator.services.mozilla.com/D293666
2026-04-15 23:25:11 +00:00
Jonathan Kew 9e487e5d83 Bug 2030115 - Make the systemFont field in gfxFontStyle default to false. r=layout-reviewers,dshin,emilio
Setting it to true in the default constructor is quite unintuitive.

Differential Revision: https://phabricator.services.mozilla.com/D293902
2026-04-15 12:33:41 +00:00
Hiroyuki Ikezoe f65f37da89 Bug 1977511 - Handle ::-webkit-scrollbar { display:none } as if it's scrollbar-width: none. r=layout-reviewers,firefox-style-system-reviewers,emilio
Note about layout.css.scrollbar-width-thin.disabled:

In the case where the pref is false (default),

```
.scrollabler { scrollbar-wdith: thin; }
.scrollable::-webkit-scrollbar { display: none; }
```
does NOT hide the scrollbars just like what Chrome does.

In the case where the pref is true,

```
.scrollabler { scrollbar-wdith: thin; }
.scrollable::-webkit-scrollbar { display: none; }
```
does NOT hide the scrollbars either, the width of scrollbar is rendered
as if it's 'auto`.

Differential Revision: https://phabricator.services.mozilla.com/D286183
2026-03-27 04:32:25 +00:00
Hiroyuki Ikezoe 9b778db524 Bug 1977511 - Introduce nsLayoutUtils::UseOverlayScrollbars and use it in proper places instead of nsPresContext::UseOverlayScrollbars. r=layout-reviewers,emilio
There remain some direct call sites of
nsPresContext::UseOverlayScrollbars.

0) two call sites in nsCSSFrameConstructor::GetAnonymousContent [0]
  These call sites for used for scrollbar style caching stuff,
  thoguh I am not 100% sure whether these two call sites needs to be
  replaced, in the next patch only width/height are applicable to
  ::-webkit-scrollbar pseudo elements and those properties are flagged
  as has_effect_on_gecko_scrollbars=false, so it's okay-ish?
  anyway the first one can not be replaced since it gets called before
  styling the <scrollbar> itself

1) in Element::GetClientAreaRect [1]
  it's for an optimization to avoid layout flush on the root scroll
  container, we will not apply ::-webkit-scrollbar to the root one, so it
  doesn't matter

2) in Gecko_GetScrollbarInlineSize [2]
 it's used only for internal CSS env scrollbar-inline-size, so it
 doesn't matter unless we use ::-webkit-scrollbar internally

3) in nsTreeBodyFrame::Init [3]
 it's XUL we won't use ::-webkit-scrollbar in chrome contents

4) in Gecko_MediaFeatures_UseOverlayScrollbars [4]
 it's used for `-moz-overlay-scrollbars` media query, we leave the
 styles in the media query, to disable overlay we will set `active` to
 the scrollbar element.

[0] https://searchfox.org/firefox-main/rev/33fd6bd39c625067a29f153adce6a4646e45750f/layout/base/nsCSSFrameConstructor.cpp#3964,4035
[1] https://searchfox.org/firefox-main/rev/e480af4adea0d838f97b105d7efdd32fa18b73c1/dom/base/Element.cpp#1057
[2] https://searchfox.org/firefox-main/rev/e480af4adea0d838f97b105d7efdd32fa18b73c1/layout/style/GeckoBindings.cpp#317
[3] https://searchfox.org/firefox-main/rev/e480af4adea0d838f97b105d7efdd32fa18b73c1/layout/xul/tree/nsTreeBodyFrame.cpp#293
[4] https://searchfox.org/firefox-main/rev/e480af4adea0d838f97b105d7efdd32fa18b73c1/layout/style/nsMediaFeatures.cpp#112

Differential Revision: https://phabricator.services.mozilla.com/D281571
2026-03-27 04:32:17 +00:00
Hiroyuki Ikezoe 4a9694dee4 Bug 1977511 - Use ScrollContainerFrame::UseOverlayScrollbars in ResizeObserver and ScrollbarAreaToExcludeFromCompositionBoundsFor. r=layout-reviewers,emilio
Most of the remaining call sites of nsPresContext::UseOverlayScrollbars
for scrollbar parts' frames will be replaced by a new function in the
next change.

Differential Revision: https://phabricator.services.mozilla.com/D281570
2026-03-27 04:32:14 +00:00
Cosmin Sabou a2d880fc9b Revert "Bug 1977511, Bug 2026430 - Guard mScrollbarActivity access with WeakFrame. r=emilio,layout-reviewers"
This reverts commit 0bc649e1df.

Revert "Bug 1977511 - Handle `::-webkit-scrollbar { display:none }` as if it's `scrollbar-width: none`. r=layout-reviewers,firefox-style-system-reviewers,emilio"

This reverts commit fe392b1cd5.

Revert "Bug 1977511 - Add reftests for ::-webkit-scrollbar. r=layout-reviewers,emilio"

This reverts commit 1b6d4641c7.

Revert "Bug 1977511 - Disable overlay scrollbars if there's any non-zero width and height defined in ::-webkit-scrollbar. r=layout-reviewers,firefox-style-system-reviewers,emilio"

This reverts commit 926eea5a10.

Revert "Bug 1977511 - Resolve ::-webkit-scrollbar pseudo element styles soon after the scroll container style was set. r=layout-reviewers,devtools-reviewers,firefox-style-system-reviewers,nchevobbe,emilio"

This reverts commit 8164020c76.

Revert "Bug 1977511 - Introduce nsLayoutUtils::UseOverlayScrollbars and use it in proper places instead of nsPresContext::UseOverlayScrollbars. r=layout-reviewers,emilio"

This reverts commit 8856d35471.

Revert "Bug 1977511 - Use ScrollContainerFrame::UseOverlayScrollbars in ResizeObserver and ScrollbarAreaToExcludeFromCompositionBoundsFor. r=layout-reviewers,emilio"

This reverts commit 5baba0ed09.
2026-03-27 02:33:00 +00:00
Hiroyuki Ikezoe fe392b1cd5 Bug 1977511 - Handle ::-webkit-scrollbar { display:none } as if it's scrollbar-width: none. r=layout-reviewers,firefox-style-system-reviewers,emilio
Note about layout.css.scrollbar-width-thin.disabled:

In the case where the pref is false (default),

```
.scrollabler { scrollbar-wdith: thin; }
.scrollable::-webkit-scrollbar { display: none; }
```
does NOT hide the scrollbars just like what Chrome does.

In the case where the pref is true,

```
.scrollabler { scrollbar-wdith: thin; }
.scrollable::-webkit-scrollbar { display: none; }
```
does NOT hide the scrollbars either, the width of scrollbar is rendered
as if it's 'auto`.

Differential Revision: https://phabricator.services.mozilla.com/D286183
2026-03-27 01:57:06 +00:00
Hiroyuki Ikezoe 8856d35471 Bug 1977511 - Introduce nsLayoutUtils::UseOverlayScrollbars and use it in proper places instead of nsPresContext::UseOverlayScrollbars. r=layout-reviewers,emilio
There remain some direct call sites of
nsPresContext::UseOverlayScrollbars.

0) two call sites in nsCSSFrameConstructor::GetAnonymousContent [0]
  These call sites for used for scrollbar style caching stuff,
  thoguh I am not 100% sure whether these two call sites needs to be
  replaced, in the next patch only width/height are applicable to
  ::-webkit-scrollbar pseudo elements and those properties are flagged
  as has_effect_on_gecko_scrollbars=false, so it's okay-ish?
  anyway the first one can not be replaced since it gets called before
  styling the <scrollbar> itself

1) in Element::GetClientAreaRect [1]
  it's for an optimization to avoid layout flush on the root scroll
  container, we will not apply ::-webkit-scrollbar to the root one, so it
  doesn't matter

2) in Gecko_GetScrollbarInlineSize [2]
 it's used only for internal CSS env scrollbar-inline-size, so it
 doesn't matter unless we use ::-webkit-scrollbar internally

3) in nsTreeBodyFrame::Init [3]
 it's XUL we won't use ::-webkit-scrollbar in chrome contents

4) in Gecko_MediaFeatures_UseOverlayScrollbars [4]
 it's used for `-moz-overlay-scrollbars` media query, we leave the
 styles in the media query, to disable overlay we will set `active` to
 the scrollbar element.

[0] https://searchfox.org/firefox-main/rev/33fd6bd39c625067a29f153adce6a4646e45750f/layout/base/nsCSSFrameConstructor.cpp#3964,4035
[1] https://searchfox.org/firefox-main/rev/e480af4adea0d838f97b105d7efdd32fa18b73c1/dom/base/Element.cpp#1057
[2] https://searchfox.org/firefox-main/rev/e480af4adea0d838f97b105d7efdd32fa18b73c1/layout/style/GeckoBindings.cpp#317
[3] https://searchfox.org/firefox-main/rev/e480af4adea0d838f97b105d7efdd32fa18b73c1/layout/xul/tree/nsTreeBodyFrame.cpp#293
[4] https://searchfox.org/firefox-main/rev/e480af4adea0d838f97b105d7efdd32fa18b73c1/layout/style/nsMediaFeatures.cpp#112

Differential Revision: https://phabricator.services.mozilla.com/D281571
2026-03-27 01:56:57 +00:00
Hiroyuki Ikezoe 5baba0ed09 Bug 1977511 - Use ScrollContainerFrame::UseOverlayScrollbars in ResizeObserver and ScrollbarAreaToExcludeFromCompositionBoundsFor. r=layout-reviewers,emilio
Most of the remaining call sites of nsPresContext::UseOverlayScrollbars
for scrollbar parts' frames will be replaced by a new function in the
next change.

Differential Revision: https://phabricator.services.mozilla.com/D281570
2026-03-27 01:56:54 +00:00
Atila Butkovits a6cb0e6249 Revert "Bug 1977511 - Handle ::-webkit-scrollbar { display:none } as if it's scrollbar-width: none. r=layout-reviewers,firefox-style-system-reviewers,emilio" for causing a top crash in bug 2026487.
This reverts commit e7e66a8471.

Revert "Bug 1977511 - Add reftests for ::-webkit-scrollbar. r=layout-reviewers,emilio"

This reverts commit 1ef6a456dc.

Revert "Bug 1977511 - Disable overlay scrollbars if there's any non-zero width and height defined in ::-webkit-scrollbar. r=layout-reviewers,firefox-style-system-reviewers,emilio"

This reverts commit 904febaca7.

Revert "Bug 1977511 - Resolve ::-webkit-scrollbar pseudo element styles soon after the scroll container style was set. r=layout-reviewers,devtools-reviewers,firefox-style-system-reviewers,nchevobbe,emilio"

This reverts commit b8f0d32cfb.

Revert "Bug 1977511 - Introduce nsLayoutUtils::UseOverlayScrollbars and use it in proper places instead of nsPresContext::UseOverlayScrollbars. r=layout-reviewers,emilio"

This reverts commit 0694ea2bf8.

Revert "Bug 1977511 - Use ScrollContainerFrame::UseOverlayScrollbars in ResizeObserver and ScrollbarAreaToExcludeFromCompositionBoundsFor. r=layout-reviewers,emilio"

This reverts commit 19303dead1.
2026-03-26 08:05:45 +00:00
Hiroyuki Ikezoe e7e66a8471 Bug 1977511 - Handle ::-webkit-scrollbar { display:none } as if it's scrollbar-width: none. r=layout-reviewers,firefox-style-system-reviewers,emilio
Note about layout.css.scrollbar-width-thin.disabled:

In the case where the pref is false (default),

```
.scrollabler { scrollbar-wdith: thin; }
.scrollable::-webkit-scrollbar { display: none; }
```
does NOT hide the scrollbars just like what Chrome does.

In the case where the pref is true,

```
.scrollabler { scrollbar-wdith: thin; }
.scrollable::-webkit-scrollbar { display: none; }
```
does NOT hide the scrollbars either, the width of scrollbar is rendered
as if it's 'auto`.

Differential Revision: https://phabricator.services.mozilla.com/D286183
2026-03-25 15:43:32 +00:00
Hiroyuki Ikezoe 0694ea2bf8 Bug 1977511 - Introduce nsLayoutUtils::UseOverlayScrollbars and use it in proper places instead of nsPresContext::UseOverlayScrollbars. r=layout-reviewers,emilio
There remain some direct call sites of
nsPresContext::UseOverlayScrollbars.

0) two call sites in nsCSSFrameConstructor::GetAnonymousContent [0]
  These call sites for used for scrollbar style caching stuff,
  thoguh I am not 100% sure whether these two call sites needs to be
  replaced, in the next patch only width/height are applicable to
  ::-webkit-scrollbar pseudo elements and those properties are flagged
  as has_effect_on_gecko_scrollbars=false, so it's okay-ish?
  anyway the first one can not be replaced since it gets called before
  styling the <scrollbar> itself

1) in Element::GetClientAreaRect [1]
  it's for an optimization to avoid layout flush on the root scroll
  container, we will not apply ::-webkit-scrollbar to the root one, so it
  doesn't matter

2) in Gecko_GetScrollbarInlineSize [2]
 it's used only for internal CSS env scrollbar-inline-size, so it
 doesn't matter unless we use ::-webkit-scrollbar internally

3) in nsTreeBodyFrame::Init [3]
 it's XUL we won't use ::-webkit-scrollbar in chrome contents

4) in Gecko_MediaFeatures_UseOverlayScrollbars [4]
 it's used for `-moz-overlay-scrollbars` media query, we leave the
 styles in the media query, to disable overlay we will set `active` to
 the scrollbar element.

[0] https://searchfox.org/firefox-main/rev/33fd6bd39c625067a29f153adce6a4646e45750f/layout/base/nsCSSFrameConstructor.cpp#3964,4035
[1] https://searchfox.org/firefox-main/rev/e480af4adea0d838f97b105d7efdd32fa18b73c1/dom/base/Element.cpp#1057
[2] https://searchfox.org/firefox-main/rev/e480af4adea0d838f97b105d7efdd32fa18b73c1/layout/style/GeckoBindings.cpp#317
[3] https://searchfox.org/firefox-main/rev/e480af4adea0d838f97b105d7efdd32fa18b73c1/layout/xul/tree/nsTreeBodyFrame.cpp#293
[4] https://searchfox.org/firefox-main/rev/e480af4adea0d838f97b105d7efdd32fa18b73c1/layout/style/nsMediaFeatures.cpp#112

Differential Revision: https://phabricator.services.mozilla.com/D281571
2026-03-25 15:43:22 +00:00
Hiroyuki Ikezoe 19303dead1 Bug 1977511 - Use ScrollContainerFrame::UseOverlayScrollbars in ResizeObserver and ScrollbarAreaToExcludeFromCompositionBoundsFor. r=layout-reviewers,emilio
Most of the remaining call sites of nsPresContext::UseOverlayScrollbars
for scrollbar parts' frames will be replaced by a new function in the
next change.

Differential Revision: https://phabricator.services.mozilla.com/D281570
2026-03-25 15:43:19 +00:00
Nika Layzell 5f0f9dd22a Bug 2020817 - Part 4: Annotate & clean up nsACString callers of BeginReading/Data, r=xpcom-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,toolkit-telemetry-reviewers-rotation,layout-reviewers,dom-worker-reviewers,gfx-reviewers,webgpu-reviewers,necko-reviewers,dom-core,smaug,handyman,emilio,pehrsons,kershaw,timhuang,edenchuang,padenot,bradwerth
This is a large number of largely mechanical changes. When possible, the code
was called to directly call `.get()` instead, performing the assertions
manually. In many places PromiseFlatCString() calls were added to dynamically
copy the strings into null terminated buffers if the string was not null
terminated.

Differential Revision: https://phabricator.services.mozilla.com/D286158
2026-03-25 08:23:04 +00:00
longsonr 638d81d0c6 Bug 2025164 - Convert BBoxFlags to enum class r=emilio,layout-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D289133
2026-03-25 04:51:56 +00:00
Sylvestre Ledru 55481ac4b5 Bug 2023419 - Remove Emacs/Vim modelines from layout/ r=emilio,firefox-style-system-reviewers,layout-reviewers
replaced by .editorconfig

Differential Revision: https://phabricator.services.mozilla.com/D287852
2026-03-17 12:05:43 +00:00
Emilio Cobos Álvarez 1e7c1504ae Bug 343048 - Get rid of ColGroup list. r=layout-reviewers,dshin
Having two lists that the frame constructor is not aware is a quirk that
causes correctness issues like bug 2021043.

Instead, sort rowgroups and colgroups once in the common case during
table layout. This also fixed some visibility collapse things because
now we compute overflow just once after collapsing. It also caused some
unexpected passes in some editing tests.

Add a test for bug 2021043, which is fixed by this.

Differential Revision: https://phabricator.services.mozilla.com/D286457
2026-03-12 09:37:21 +00:00
serge-sans-paille ae1341ef2a Bug 2020590 - Replace copy assignment by move assignment in misc subdirectory r=firefox-style-system-reviewers,layout-reviewers,emilio
Commit automatically generated through clang-tidy's
performance-use-std-move new pass.

- nsCOMPtr benefits from being moved
- Maybe type has a custom move-assign operator
- nsAutoCString benefits from being moved
- nsRegion benefits from being moved

Differential Revision: https://phabricator.services.mozilla.com/D285677
2026-03-06 10:47:28 +00:00
Xidorn Quan 9583561d23 Bug 2019173 - Scale vector image before rasterization when creating surface from element. r=gfx-reviewers,bradwerth
Differential Revision: https://phabricator.services.mozilla.com/D284943
2026-03-05 08:17:14 +00:00
Atila Butkovits c2edc7d171 Revert "Bug 2019173 - Scale vector image before rasterization when creating surface from element. r=gfx-reviewers,bradwerth" as requested by dev.
This reverts commit 0f0e2131a5.
2026-03-05 03:17:22 +00:00
Xidorn Quan 0f0e2131a5 Bug 2019173 - Scale vector image before rasterization when creating surface from element. r=gfx-reviewers,bradwerth
Differential Revision: https://phabricator.services.mozilla.com/D284943
2026-03-05 01:01:28 +00:00