884 Commits
Author SHA1 Message Date
Masayuki Nakano a7b798c8d2 Bug 2035992 - Add EventStateManager::GetEventTargetContent and PresShell::GetEventTargetContent r=smaug
They have only `GetExplicitEventTargetContent` and some callers may want
to get proper target `Element`. Therefore, we should add them and the
common logic should be shared.

`nsListControlFrame::GetIndexFromEvent` looks for an inclusive ancestor
`<option>`. So, it can start the loop from its inclusive ancestor
element of the explicit event target so that it can use the new API.

Differential Revision: https://phabricator.services.mozilla.com/D300217
2026-05-19 08:19:32 +00:00
Masayuki Nakano b77593c2f7 Bug 2035992 - Add nsIFrame::GetEventTargetContent() to get proper event target from the given event r=smaug,emilio,layout-reviewers
Most event targets an element node even if the input occurs on a `Text`.
`EventStateManager`, `PresShell`, `PresShell::EventHandler`, etc use
the result of `nsIFrame::GetContentForEvent` result as-is or looking
for proper ancestor element by the caller selves.

So, I think there should be `GetEventTargetContent()` which solves the
target node kind automatically and in the same way. And also this patch
renames `nsIFrame::GetContentForEvent` to
`nsIFrame::GetEventTargetExplicitContent` for consistency with
`Event::mExplicitOriginalTarget`.

Finally, this patch changes the callers which retrieves a parent
`Element` if the result of `GetContentForEvent` is not an `Element` to
use the new `GetEventTargetContent`.

The following patches make each caller of `GetContentForEvent` marked
with "FIXME" comment fix one by one.

Differential Revision: https://phabricator.services.mozilla.com/D297848
2026-05-19 08:19:05 +00:00
Serban Stanca 37fe53f379 Revert "Bug 2035992 - Add EventStateManager::GetEventTargetContent and PresShell::GetEventTargetContent r=smaug" for causing build bustages in EventStateManager.cpp.
This reverts commit c1105686da.

This reverts commit 65dfa9f984.

This reverts commit adc2bf1081.

This reverts commit 7163909ad8.

This reverts commit fa2354f5f8.

This reverts commit 95a8aec384.

This reverts commit a46e328cae.

This reverts commit 84f304eb70.
2026-05-19 00:52:14 +00:00
Masayuki Nakano c1105686da Bug 2035992 - Add EventStateManager::GetEventTargetContent and PresShell::GetEventTargetContent r=smaug
They have only `GetExplicitEventTargetContent` and some callers may want
to get proper target `Element`. Therefore, we should add them and the
common logic should be shared.

`nsListControlFrame::GetIndexFromEvent` looks for an inclusive ancestor
`<option>`. So, it can start the loop from its inclusive ancestor
element of the explicit event target so that it can use the new API.

Differential Revision: https://phabricator.services.mozilla.com/D300217
2026-05-19 00:09:51 +00:00
Masayuki Nakano 84f304eb70 Bug 2035992 - Add nsIFrame::GetEventTargetContent() to get proper event target from the given event r=smaug,emilio,layout-reviewers
Most event targets an element node even if the input occurs on a `Text`.
`EventStateManager`, `PresShell`, `PresShell::EventHandler`, etc use
the result of `nsIFrame::GetContentForEvent` result as-is or looking
for proper ancestor element by the caller selves.

So, I think there should be `GetEventTargetContent()` which solves the
target node kind automatically and in the same way. And also this patch
renames `nsIFrame::GetContentForEvent` to
`nsIFrame::GetEventTargetExplicitContent` for consistency with
`Event::mExplicitOriginalTarget`.

Finally, this patch changes the callers which retrieves a parent
`Element` if the result of `GetContentForEvent` is not an `Element` to
use the new `GetEventTargetContent`.

The following patches make each caller of `GetContentForEvent` marked
with "FIXME" comment fix one by one.

Differential Revision: https://phabricator.services.mozilla.com/D297848
2026-05-19 00:09:23 +00:00
Daniel Holbert 10725540f6 Bug 2037754: Use 'MakeAndAddRef' instead of 'new' when allocating runnable for nsContentUtils::AddScriptRunner. r=dom-core,smaug
MakeAndAddRef ensures that the freshly-allocated object immediately gets a
refcount of 1 (before it's even passed to AddScriptRunner).  This avoids
several potential footguns that otherwise exist with a zero-refcount
freshly-allocated object.

It also makes the ownership-transfer semantics more clear
(via the already_AddRefed type that it produces) - AddScriptRunner is taking
ownership of the object, rather than using it temporarily while the caller
maintains ownership.

Differential Revision: https://phabricator.services.mozilla.com/D299039
2026-05-07 06:35:57 +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 b9a0d71900 Bug 2034055 - Make HTMLOptionsCollection use nsContentList. r=dom-core,smaug
Make nsIHTMLCollection the first base for nsContentList and co, since
it's needed for WebIDL bindings to work properly and shouldn't change
behavior in practice.

Move the handling of selected option and validity to HTMLSelectElement's
mutation observer.

Differential Revision: https://phabricator.services.mozilla.com/D295818
2026-04-28 07:38:24 +00:00
agoloman 8d40053465 Revert "Bug 2034055 - Make HTMLOptionsCollection use nsContentList. r=dom-core,smaug" for causing failures @nsContentList.cpp.
This reverts commit fd37a5a8cb.
2026-04-28 06:17:53 +00:00
Emilio Cobos Álvarez fd37a5a8cb Bug 2034055 - Make HTMLOptionsCollection use nsContentList. r=dom-core,smaug
Make nsIHTMLCollection the first base for nsContentList and co, since
it's needed for WebIDL bindings to work properly and shouldn't change
behavior in practice.

Move the handling of selected option and validity to HTMLSelectElement's
mutation observer.

Differential Revision: https://phabricator.services.mozilla.com/D295818
2026-04-27 23:07:56 +00:00
Jonathan Watt 017557984b Bug 2030928. Rename mozilla::ScrollAxis to mozilla::AxisScrollParams. r=credential-management-reviewers,layout-reviewers,emilio,dimi
The current mozilla::ScrollAxis struct in PresShellForwards.h isn't a simple
axis enum. It carries information about where to scroll to along a specific
axis, and under what conditions that should happen. So 'ScrollAxis' isn't the
best name.

Now we're introducing WebIDL 'ScrollAxis' in bug 1350457:

https://drafts.csswg.org/scroll-animations-1/#scrolltimeline-interface

The extensive use of PresShellForwards.h's ScrollAxis in DOM code makes it
conflict with this new DOM enum. Rather than try to fix this through lots of
explitic namespacing, this patch renames PresShellForwards.h's ScrollAxis.

Differential Revision: https://phabricator.services.mozilla.com/D293485
2026-04-14 12:59:21 +00:00
Emilio Cobos Álvarez ac0f3aeae2 Bug 2031441 - Remove ShouldPropagateComputedBSizeToScrolledContent. r=layout-reviewers,dshin
Always true.

Differential Revision: https://phabricator.services.mozilla.com/D293992
2026-04-14 07:32:33 +00:00
Emilio Cobos Álvarez 9998e4c779 Bug 2023453 - Remove HTMLSelectEventListener. r=dom-core,keithamus
This will allow events to get handled with customizable select.

HasPrimaryAction for listboxes needs to be overridden since before it
was returning true because of the listener:

  https://searchfox.org/firefox-main/rev/7b08fa00f500ed877b16983a6a77d2c852aad1d0/accessible/generic/LocalAccessible.cpp#3433-3435

Without that, we fail
devtools/server/tests/browser/browser_accessibility_keyboard_audit.js

Differential Revision: https://phabricator.services.mozilla.com/D287830
2026-03-26 13:29:14 +00:00
Lando 901f919f0e Bug 2023419: apply code formatting via Lando
# ignore-this-changeset
2026-03-17 12:07:57 +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 3c4e0d11ac Bug 2013887 - Fix win32 build.
Signed-off-by: Emilio Cobos Álvarez <[email protected]>
2026-02-04 13:35:04 +00:00
Emilio Cobos Álvarez 3271cb4e57 Bug 2013887 - Remove nsISelectControlFrame. r=layout-reviewers,jfkthame
After bug 2011709, there's only one implementation of this.

Differential Revision: https://phabricator.services.mozilla.com/D281453
2026-02-04 12:00:31 +00:00
Emilio Cobos Álvarez 4021464773 Bug 2011709 - Make combobox select use a shadow tree for its contents. r=jjaschke,layout-reviewers,firefox-style-system-reviewers,accessibility-platform-reviewers,smaug,Jamie,jfkthame,dshin
For now, replicate the label + icon structure.

Use pseudo-elements for them. We could use select.css instead, but we
need a way to to prevent the display fix-up from applying (this is
needed because otherwise <select style=display:flex> starts getting the
label and button on different lines), and pseudo-elements is easier.

Use a <span> for the icon since we basically otherwise have a hidden,
unfocusable button and it simplifies the styling that way.

Use the same for the input file content since it simplifies the logic on
the frame constructor.

nsListControlFrame gets some clean-up as well since I was trying to make
sense of nsISelectFrame, but I could split that out if needed.

Tests for bug 323656 fail now because it tests explicit inheritance from
the <select> to the <option>, and now that goes through a <slot>.

Other elements have the same issue, see
https://github.com/whatwg/html/issues/3748. So for now remove those
tests.

Differential Revision: https://phabricator.services.mozilla.com/D280041
2026-02-03 14:33:36 +00:00
Emilio Cobos Álvarez c207a896df Bug 2008108 - Simplify listbox select rendering. r=jwatt
No effective user visible behavior change, but this improves on the
previous state of things in a few ways. First, nsSelectsAreaFrame is
removed. This frame did three things:

 * Calculated the row bsize at the end of reflow. We can move that to
   nsListControlFrame::Reflow.

 * Drew the focus navigation outline: We can move it to
   ScrollContainerFrame and simplify a bit the logic while at it.

 * Made events go to the list control. We could do that with CSS if
   needed, but other browsers don't and no test seems to rely on it.

Secondly, nsDisplayListFocus now uses WebRender, avoiding slow fallback
code.

Differential Revision: https://phabricator.services.mozilla.com/D277704
2026-01-06 22:32:45 +00:00
Serban Stanca e7efe8e2d1 Revert "Bug 2008108 - Simplify listbox select rendering. r=jwatt" for causing wpt failures in auto-007.html.
This reverts commit 0e35e47a58.
2026-01-06 16:04:11 +00:00
Emilio Cobos Álvarez 0e35e47a58 Bug 2008108 - Simplify listbox select rendering. r=jwatt
No effective user visible behavior change, but this improves on the
previous state of things in a few ways. First, nsSelectsAreaFrame is
removed. This frame did three things:

 * Calculated the row bsize at the end of reflow. We can move that to
   nsListControlFrame::Reflow.

 * Drew the focus navigation outline: We can move it to
   ScrollContainerFrame and simplify a bit the logic while at it.

 * Made events go to the list control. We could do that with CSS if
   needed, but other browsers don't and no test seems to rely on it.

Secondly, nsDisplayListFocus now uses WebRender, avoiding slow fallback
code.

Differential Revision: https://phabricator.services.mozilla.com/D277704
2026-01-06 12:12:58 +00:00
Emilio Cobos Álvarez 194051e8a7 Bug 1993353 - Remove NS_FRAME_INDEPENDENT_SELECTION from nsListControlFrame. r=layout-reviewers,dshin
It doesn't have an independent selection. Only nsTextControlFrame has a
different nsISelectionController.

Differential Revision: https://phabricator.services.mozilla.com/D268105
2025-10-09 11:56:03 +00:00
Emilio Cobos Álvarez a8a2311474 Bug 1976457 - Sort includes in layout/. r=janv,dshin
Interesting bit is layout/.clang-format, the rest is all automated.

Differential Revision: https://phabricator.services.mozilla.com/D256616
2025-07-09 13:24:00 +00:00
Jonathan Watt 89c1154d34 Bug 1931736. Add missing braces around if/loop statements in layout/forms/. r=layout-reviewers,emilio
Depends on D229246

Differential Revision: https://phabricator.services.mozilla.com/D229247
2024-11-17 05:03:58 +00:00
Emilio Cobos Álvarez a1b5fe0f95 Bug 1925484 - Further nsListControlFrame clean-ups. r=dshin
* Initialize fields in the constructor.
 * Remove never set forced selection.
 * Deindent some code by early returning.

Differential Revision: https://phabricator.services.mozilla.com/D226162
2024-10-19 08:24:03 +00:00
Emilio Cobos Álvarez f0cb276fd9 Bug 1925484 - Remove nsListControlFrame::DidReflow. r=dshin,jwatt
Move it to ReflowFinished() (which ScrollContainerFrame manages for us).

The reason for this is that if you get reflowed twice in the same reflow
(which happens very often with grid or flexbox), we might queue a reset
if we don't get interrupted in the first, but get interrupted in the
second for example.

In general DidReflow is almost never what you want.

Differential Revision: https://phabricator.services.mozilla.com/D226124
2024-10-18 19:23:45 +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 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
Ting-Yu Lin 2969a5e0cb Bug 1909995 Part 2 - Add IntrinsicISize() as a helper to implement GetMinISize() and GetPrefISize(). r=layout-reviewers,emilio
Most frame types have identical or very similar implementation for GetMinISize()
and GetPrefISize(), and many of them already have `IntrinsicISize()` to unify
the implementation. This patch introduces nsIFrame::IntrinsicISize() so that
derived classes only need to override one method.

`nsBlockFrame`, `ColumnSetWrapperFrame`, and `nsColumnSetFrame` are the only
three classes where their `GetMinISize()` and `GetPrefISize()` have significant
differences. Therefore, we rename `GetMinISize()` and `GetPrefISize()` to
`MinISize()` and `PrefISize`, respectively, and use them as helpers to implement
their `IntrinsicISize()`.

This patch doesn't change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D217790
2024-07-26 20:54:56 +00:00
Emilio Cobos Álvarez d25d53b6fc Bug 1909311 - Remove nsIFormControlFrame and nsITextControlFrame. r=masayuki,layout-reviewers,dholbert
It's a rather useless interface:

 * nsITextControlFrame is only implemented by nsTextControlFrame, so we
   can just use that.
 * nsIFormControlFrame had very few actual functionality, mostly
   scattered around:
    * SetFormProperty(select) was only useful for nsTextControlFrame.
    * SetFormProperty(value) was only called on file controls.
    * SetFocus() did mostly nothing, or things that can be done in
      ElementStateChanged instead.

There are some do_QueryFrame calls that I replaced for better checks in
font inflation and nsIFrame, but I'll adjust to preserve behavior if you
insist (it just such a somewhat-random check).

Differential Revision: https://phabricator.services.mozilla.com/D217322
2024-07-23 16:16:18 +00:00
Ting-Yu Lin c1b8db243d Bug 1906792 Part 4 - Add IntrinsicISize() helpers to implement GetMinISize()/GetPrefISize(). r=layout-reviewers,emilio
These frames have very similar implementations in `GetMinISize()` and
`GetPrefISize()`. Therefore, add helpers to avoid code duplication. The helpers
are named `IntrinsicISize()` to match existing helpers in flex & grid container.

Drop "Get" in `GetIntrinsicISize()` for `nsFieldSetFrame` and
`nsComboboxControlFrame` to match our coding style because it always returns a
value.

Differential Revision: https://phabricator.services.mozilla.com/D216002
2024-07-09 18:49:33 +00:00
Luke Warlow 4ccfb86bca Bug 1901376: Implement field-sizing support for listboxes r=emilio
Change listbox block size calculations such that when field-sizing is content, the number of rows is used not the size attribute.

Differential Revision: https://phabricator.services.mozilla.com/D212984
2024-06-18 13:45:54 +00:00
Ting-Yu Lin a653b7becd Bug 1899894 - Remove debug statements that require customized #define. r=layout-reviewers,emilio
The debug statements all require customized #define to enable. I don't feel it
is useful to leave code that is not compiled in the default debug build.

Differential Revision: https://phabricator.services.mozilla.com/D212192
2024-05-31 17:45:44 +00:00
Ting-Yu Lin 5cdee429ce Bug 1896516 Part 11 - Remove nsIScrollableFrame usages under layout/, widget/, and toolkit/. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D211498
2024-05-30 06:32:22 +00:00
Ting-Yu Lin f59e487e79 Bug 1896516 Part 5 - Fix build errors after including ScrollContainerFrame.h under dom/animation/. r=layout-reviewers,boris
This is a preparation to remove `#include "nsIScrollableFrame.h"` for
ScrollTimeline.cpp and ViewTimeline.cpp.

Move the implementation of `nsListControlFrame::GetMultiple()` to cpp. Keeping
it inline requires adding `#include "mozilla/dom/Element.h"` in the header, and
I don't feel the method is hot enough to be inlined.

Differential Revision: https://phabricator.services.mozilla.com/D211492
2024-05-30 06:32:19 +00:00
Sebastian Hengst bf4dfe53f8 Backed out 15 changesets (bug 1896516) for causing scrolling crashes on macOS. a=backout
Backed out changeset fd6904338812 (bug 1896516)
Backed out changeset 2977ff81a23e (bug 1896516)
Backed out changeset c8a6b0e526d6 (bug 1896516)
Backed out changeset 3c06f22da72b (bug 1896516)
Backed out changeset f63b0c4335fe (bug 1896516)
Backed out changeset 6f7ab8adfa6e (bug 1896516)
Backed out changeset 997c9249dbed (bug 1896516)
Backed out changeset c964fccd5180 (bug 1896516)
Backed out changeset 7b481b747b7a (bug 1896516)
Backed out changeset 42e1bbe0ecb6 (bug 1896516)
Backed out changeset 717dac08b607 (bug 1896516)
Backed out changeset 2f0817331dbe (bug 1896516)
Backed out changeset b765169a7a8f (bug 1896516)
Backed out changeset a2d37b98273c (bug 1896516)
Backed out changeset ea9ecb543e66 (bug 1896516)
2024-05-29 11:22:52 +02:00
Ting-Yu Lin 37e9b779f9 Bug 1896516 Part 11 - Remove nsIScrollableFrame usages under layout/, widget/, and toolkit/. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D211498
2024-05-28 04:46:20 +00:00
Ting-Yu Lin 2ac683bd57 Bug 1896516 Part 5 - Fix build errors after including ScrollContainerFrame.h under dom/animation/. r=layout-reviewers,boris
This is a preparation to remove `#include "nsIScrollableFrame.h"` for
ScrollTimeline.cpp and ViewTimeline.cpp.

Move the implementation of `nsListControlFrame::GetMultiple()` to cpp. Keeping
it inline requires adding `#include "mozilla/dom/Element.h"` in the header, and
I don't feel the method is hot enough to be inlined.

Differential Revision: https://phabricator.services.mozilla.com/D211492
2024-05-28 04:46:18 +00:00
Ting-Yu Lin 27bb908f13 Bug 1824877 Part 2 - Rename nsHTMLScrollFrame to mozilla::ScrollContainerFrame. r=dholbert
Also, change the ScrollContainerFrame::GetFrameName() to return
"ScrollContainer" instead of "HTMLScroll".

Differential Revision: https://phabricator.services.mozilla.com/D210233
2024-05-15 17:50:48 +00:00
Ting-Yu Lin 319fc12b73 Bug 1888535 Part 4 - Remove DISPLAY_PREF_INLINE_SIZE and DISPLAY_MIN_INLINE_SIZE. r=layout-reviewers,emilio
The two macros are used in `GetPrefISize()` and `GetMinISize()` implementations.
After removing them, we could further simplify some implementations because we
don't need a `result` variable in many cases.

This patch doesn't change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D206316
2024-04-02 19:03:04 +00:00
Emilio Cobos Álvarez 6c324c6d1b Bug 1851868 - Refactor nsIFrame::Destroy to pass a single DestroyContext parameter. r=dholbert
This shouldn't change behavior, but it packs the two arguments to
DestroyFrom into a single thing, and makes nsIFrame::Destroy not so easy
to call without a previous context.

This is a prerequisite to pass aDestroyContext to various things that
right now just mint one, which can cause badness, see bug 1851787 and
related bugs.

It's also a bit nicer to add things there if we need to in the future.

Differential Revision: https://phabricator.services.mozilla.com/D187578
2023-09-07 11:46:30 +00:00
Narcis Beleuzu 33592fec5e Backed out changeset 55052ae7d067 (bug 1851868) for reftest failure on 1153695.html . CLOSED TREE 2023-09-07 02:42:25 +03:00
Emilio Cobos Álvarez 0698c96bd1 Bug 1851868 - Refactor nsIFrame::Destroy to pass a single DestroyContext parameter. r=dholbert
This shouldn't change behavior, but it packs the two arguments to
DestroyFrom into a single thing, and makes nsIFrame::Destroy not so easy
to call without a previous context.

This is a prerequisite to pass aDestroyContext to various things that
right now just mint one, which can cause badness, see bug 1851787 and
related bugs.

It's also a bit nicer to add things there if we need to in the future.

Differential Revision: https://phabricator.services.mozilla.com/D187578
2023-09-06 22:34:35 +00:00
Emilio Cobos Álvarez a64126ae9c Bug 1837382 - Remove nsIContent::IsDoneAddingChildren. r=smaug
It's only called once for a place where it knows it's a select element.

Differential Revision: https://phabricator.services.mozilla.com/D180312
2023-06-08 14:59:31 +00:00
David Shin cd09d0a351 Bug 1809568 - Part 2: Provide GetNaturalBaselineBOffset with baseline export context. r=emilio
Some baseline exports are context-sensitive. One example: In line-layout scenario,
the last baseline of a scroll container is always the margin-end. In other (e.g.
flex, grid) scenarios, it's the border-box clamped offset to the last line in the
container.
This enables the required 3 different behaviours for `inline-block` scroll containers
for 3 different `baseline-source` values:
- `auto`: Last baseline, margin-end
- `first`: Border-box clamped offset to the first line
- `last`: Border-box clamped offset to the last line

Differential Revision: https://phabricator.services.mozilla.com/D173886
2023-05-17 12:56:54 +00:00
Sandor Molnar 3faee50252 Backed out 3 changesets (bug 1809568) for causing build bustages in layout/generic/nsLineLayout.cpp CLOSED TREE
Backed out changeset 6c5bbcbafce9 (bug 1809568)
Backed out changeset b518133a5c34 (bug 1809568)
Backed out changeset 2407088e9b49 (bug 1809568)
2023-05-17 01:34:42 +03:00
David Shin 33ec2490df Bug 1809568 - Part 2: Provide GetNaturalBaselineBOffset with baseline export context. r=emilio
Some baseline exports are context-sensitive. One example: In line-layout scenario,
the last baseline of a scroll container is always the margin-end. In other (e.g.
flex, grid) scenarios, it's the border-box clamped offset to the last line in the
container.
This enables the required 3 different behaviours for `inline-block` scroll containers
for 3 different `baseline-source` values:
- `auto`: Last baseline, margin-end
- `first`: Border-box clamped offset to the first line
- `last`: Border-box clamped offset to the last line

Differential Revision: https://phabricator.services.mozilla.com/D173886
2023-05-16 20:48:18 +00:00
Sandor Molnar 146a43a1bc Backed out 3 changesets (bug 1809568) for causing node devtools failures in devtools/client/debugger/src/components/test/QuickOpenModal.spec.js CLOSED TREE
Backed out changeset 56ce741da8f5 (bug 1809568)
Backed out changeset 5a91ce4870e4 (bug 1809568)
Backed out changeset cc00422f050a (bug 1809568)
2023-05-16 22:22:31 +03:00
David Shin 970986fac9 Bug 1809568 - Part 2: Provide GetNaturalBaselineBOffset with baseline export context. r=emilio
Some baseline exports are context-sensitive. One example: In line-layout scenario,
the last baseline of a scroll container is always the margin-end. In other (e.g.
flex, grid) scenarios, it's the border-box clamped offset to the last line in the
container.
This enables the required 3 different behaviours for `inline-block` scroll containers
for 3 different `baseline-source` values:
- `auto`: Last baseline, margin-end
- `first`: Border-box clamped offset to the first line
- `last`: Border-box clamped offset to the last line

Differential Revision: https://phabricator.services.mozilla.com/D173886
2023-05-16 19:02:11 +00:00