Commit Graph
413 Commits
Author SHA1 Message Date
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 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
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
Ting-Yu Lin 2f6171db5c Bug 2030432 - Fix abspos painting in wrong column when its containing block has transform. r=layout-reviewers,dshin
When a transformed absolute containing block fragments across multi-column,
abspos children could paint in the wrong column. This happened because the
abspos display item was built when its placeholder was encountered during
display list traversal, and the placeholder could end up in a different column
than where the abspos should paint.

Extend `DisplayPushedAbsoluteFrames` (now renamed to
`DisplayAbsoluteFramesNotBuiltByPlaceholder`) to also directly build abspos
frames whose placeholder lived in a different continuation subtree. Skip
building those abspos frames when they are later traversed via their
placeholders.

Differential Revision: https://phabricator.services.mozilla.com/D294312
2026-04-15 23:27:08 +00:00
agoloman 83610050c8 Revert "Bug 2030432 - Fix abspos painting in wrong column when its containing block has transform. r=layout-reviewers,dshin" for causing failures @anchor-position-multicol-fixed-001.html.
This reverts commit d7c27ff2a1.
2026-04-15 21:00:00 +00:00
Ting-Yu Lin d7c27ff2a1 Bug 2030432 - Fix abspos painting in wrong column when its containing block has transform. r=layout-reviewers,dshin
When a transformed absolute containing block fragments across multi-column,
abspos children could paint in the wrong column. This happened because the
abspos display item was built when its placeholder was encountered during
display list traversal, and the placeholder could end up in a different column
than where the abspos should paint.

Extend `DisplayPushedAbsoluteFrames` (now renamed to
`DisplayAbsoluteFramesNotBuiltByPlaceholder`) to also directly build abspos
frames whose placeholder lived in a different continuation subtree. Skip
building those abspos frames when they are later traversed via their
placeholders.

Differential Revision: https://phabricator.services.mozilla.com/D294312
2026-04-15 20:04:19 +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
Ting-Yu Lin 2021aaf948 Bug 482886 - Relax nsCanvasFrame::SetInitialChildList assertion for continuations. r=layout-reviewers,emilio
In paginated (printing), `ReplicateFixedFrames` may create multiple placeholder
frames for fixed-pos elements on canvas frame continuations. It is an expected
scenario handled by `nsCanvasFrame::Reflow()` already. See
https://searchfox.org/firefox-main/rev/35009c6b3c3a10d189dd24790b5aaa6a27b6058f/layout/generic/nsCanvasFrame.cpp#447-448

The existing assertions for 675246-1.xhtml and 427017-1.xhtml are
`ASSERTION: can't mark frame dirty during reflow`, tracked in bug 457400.

Differential Revision: https://phabricator.services.mozilla.com/D284394
2026-02-23 14:04:42 +00:00
David Shin 9462427f28 Bug 2013139: Paint pushed absolute frames and after painting children. r=emilio,layout-reviewers
See discussion in
https://phabricator.services.mozilla.com/D272401#inline-1485354

We seem to rely on the timing of overflow containers display items for e.g.
Pagination.

DisplayList will be sorted by z-index, but it's a stable sort that relies on
items being added in document order.

`out-of-flow-in-multicolumn-paint-order-003.html` fails due to us not
fragmenting grid items needs fragmentation.

Differential Revision: https://phabricator.services.mozilla.com/D281028
2026-01-30 14:02:16 +00:00
Ting-Yu Lin 9aa23feec4 Bug 2007058 Part 2 - Paint pushed abspos frames with NS_FRAME_IS_PUSHED_OUT_OF_FLOW bit in DisplayPushedAbsoluteFrames(). r=layout-reviewers,dholbert
Mark abspos next-in-flows with the `NS_FRAME_IS_PUSHED_OUT_OF_FLOW` bit, and
adjust the display item generation code accordingly.

In Bug 1994346, pushed abspos first-in-flow will get the bit as well.

Differential Revision: https://phabricator.services.mozilla.com/D277138
2025-12-19 21:05:37 +00:00
Ting-Yu Lin 80e7aa39a2 Bug 1994083 - Generate display items for frames in absolute child list. r=dholbert,layout-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D272401
2025-11-24 20:48:15 +00:00
Cristina Horotan 8317428fcd Revert "Bug 1994083 - Add WPTs for abspos fragmentation in vertical-rl writing-mode. r=dholbert" for causing Wr failures nsFrameList::ContinueRemoveFrame related
This reverts commit 0bb89a9e15.

Revert "Bug 1994083 - Adjust existing WPT expectations. r=dholbert"

This reverts commit a716c30e8f.

Revert "Bug 1994083 - Generate display items for frames in absolute child list. r=dholbert,layout-reviewers"

This reverts commit 1da35cc35d.

Revert "Bug 1994083 - Allow AbsoluteContainingBlock to reflow all abspos continuations. r=dholbert,layout-reviewers"

This reverts commit 643eec9921.
2025-11-23 05:31:49 +00:00
Ting-Yu Lin 1da35cc35d Bug 1994083 - Generate display items for frames in absolute child list. r=dholbert,layout-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D272401
2025-11-22 23:34:19 +00:00
Botond Ballo fe9df17192 Bug 2000121 - Ensure that a fixed item's scroll target ASR is always ASRKind::Scroll. r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D272700
2025-11-15 00:29:21 +00:00
Emilio Cobos Álvarez f786affdc7 Bug 1993353 - Remove view reparenting code that has been disabled forever. r=tnikkel,layout-reviewers
The subdocument frame caller is a no-op because nsSubdocumentFrame is a
leaf frame.

Differential Revision: https://phabricator.services.mozilla.com/D268104
2025-10-09 11:25:27 +00:00
Timothy Nikkel dbe8df76fa Bug 1984898. Properly update asrs during partial display list update. r=layout-reviewers,emilio
The asr of some display items depends on the items that it contains. When we do a partial display list update and we merge display list we can change what an item contains so we might have to update the asr of the item. UpdateASR performs this work. Unfortunately it doesn't quite do it correctly.

Items whose asr depends on the items that it contains will pick the asr that is an ancestor (or equal to) of the asr of every item that it contains. Additionally we want the asr to be an ancestor (or equal to) the initial asr for the item.

aContainerASR in UpdateASR contains the asr that is an ancestor of every contained item. So UpdateASR assumes that if the item is not a wrap list item that it wants the container asr as its asr. This is not correct. Additionally it assumes that if the item is a wrap list item (or subclass) that it wants the ancestor behaviour for it's asr. This is also not correct. What each display item wants for its asr is more complicated then that.

The pernosco session https://bugzilla.mozilla.org/show_bug.cgi?id=1764863#c1 gives an example of this going wrong. In that case the item is a transform item and it only contains items whose asr is a descendant of the asr of the transform item. The transform item is not a wrap list, so we set the asr of the transform item to a descendant of the asr that it should be.

To fix this we add a function to all display items that opts them in to this ancestor behaviour for asrs if they want it. Some display item types only want the ancestor behaviour in some cases so it can't just be based on the display item type. In making this change we need to look at all display item types that can return non-null from GetChildren (if they can't have children the asr won't change dynamically based on children/the contents). There are four such classes (and then all of their subclasses): nsDisplayContainer, nsDisplayTransform, nsDisplayPerspective, nsDisplayWrapList. In practice nsDisplayContainer is always Ancestor asr (but we still pass Ancestor at all places we create one). nsDisplayPerspective and nsDisplayTransform are always Constant asr. and nsDisplayWrapList has a very large tree of subclasses with various different behaviours of asr.

This also fixes a bug in UpdateASR: if aContainerASR is nothing then we should set the asr to the frame asr rather then early exiting.

Differential Revision: https://phabricator.services.mozilla.com/D262257
2025-08-28 16:33:50 +00:00
Emilio Cobos Álvarez 2f8418236d Bug 1982307 - Remove canvas frame focus outline code. r=smaug
The root element no longer gets focus by default when tabbing, so this
code can only be triggered by making it explicitly editable or focusable in
some other way.

It's inconsistent with how we do :focus-visible, and hardcodes the style, so
remove it. This matches other browsers and authors can still show an outline if
they want to via the outline property.

Differential Revision: https://phabricator.services.mozilla.com/D260631
2025-08-11 12:35:25 +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
Emilio Cobos Álvarez 8ff4a65ffa Bug 1967507 - Simplify custom content container set-up. r=smaug,devtools-reviewers,nchevobbe
I haven't been able to reproduce this locally, but I see what's going
on, and I think we could do better.

This avoids the frame flush from nsCanvasFrame::CreateAnonymousContent,
and in general makes the anonymous content timing a lot more reasonable
(see the FlushPendingNotifications call that's getting removed).

The ServoStyleSet changes are needed now that there are multiple style
roots that can be unstyled like that.

It also simplifies the API as now it's not dependent on having a canvas
frame around (and thus doesn't need to flush layout).

Differential Revision: https://phabricator.services.mozilla.com/D250531
2025-05-22 13:06:12 +00:00
Emilio Cobos Álvarez a17ef36279 Bug 1961469 - Simplify nsIFrame::GetContentForEvent. r=smaug
No behavior change (note that nsImageFrame inits the image map on
Init()).

Differential Revision: https://phabricator.services.mozilla.com/D246077
2025-04-19 19:21:17 +00:00
Emilio Cobos Álvarez ed11eed7b0 Bug 1956453 - Simplify how we suppress the canvas background color. r=mstange
Instead of conditionally inserting the item at the bottom of the
BorderBackground() list, just suppress its color.

Differential Revision: https://phabricator.services.mozilla.com/D243317
2025-03-27 18:30:00 +00:00
Emilio Cobos Álvarez 72b034e1ed Bug 1955697 - Remove nsDisplayCanvasThemedBackground. r=mstange
We don't set appearance on `::-moz-canvas` and co.

Differential Revision: https://phabricator.services.mozilla.com/D242627
2025-03-25 08:09:58 +00:00
Emilio Cobos Álvarez 09d79d87ff Bug 1955697 - Paint the scrolled canvas background if not observable by blending. r=mstange
This restores the behavior that D242017 removed.

This is not per spec, and is mostly to avoid having to spend a lot of
time updating fuzzy annotations, but also de-risks the patch a little
bit, since the behavior should be the same as before.

Note that this is relatively well tested.

We need to change the time of the blending check to happen after
building the kid's display list, but on the flip side the "initial"
determination can be done upfront, so we can remove a few temporary
display lists.

Differential Revision: https://phabricator.services.mozilla.com/D242613
2025-03-25 08:09:58 +00:00
Emilio Cobos Álvarez 8b44b13d91 Bug 1955697 - Remove nsDisplayCanvasBackgroundColor. r=mstange
We no longer need it, as now it behaves just like a solid color.

This causes an expectation change in an internal windowUtils.elementFromPoint
test, due to the HitTest implementation, but it's not observable to the web
(the web APIs return null when off-screen rather than the root), and no other
internal callers depend on it.

Differential Revision: https://phabricator.services.mozilla.com/D242445
2025-03-25 08:09:58 +00:00
Emilio Cobos Álvarez 1cada22c31 Bug 1955697 - Simplify scrolled canvas background painting. r=mstange
Always paint the scrolled canvas background if it's CSS-specified.

Compute the canvas background upfront so we don't need to walk the
display list after the fact.

This removes the scrolled canvas background in a few cases where the old
code could prove that it was not needed due to blending, see the
comment:

    // To make layers work better, we want to avoid having a big non-scrolled
    // color background behind a scrolled transparent background. Instead, we'll
    // try to move the color background into the scrolled content by making
    // nsDisplayCanvasBackground paint it.

It's unclear if that matters for performance with webrender nowadays,
but removing it does cause significant fuzzy failures, so it will be
reintroduced in a more explicit way in a follow-up patch.

Differential Revision: https://phabricator.services.mozilla.com/D242017
2025-03-25 08:09:57 +00:00
Emilio Cobos Álvarez 9b63ca329f Bug 1955697 - Clean up a bit nsDisplayCanvasBackgroundColor and surrounding code. r=mstange
No behavior change.

Differential Revision: https://phabricator.services.mozilla.com/D242624
2025-03-24 18:54:34 +00:00
Emilio Cobos Álvarez ac1476befe Bug 1955697 - Clean-up a little bit nsCanvasFrame::BuildDisplayList. r=mstange
No behavior change.

Differential Revision: https://phabricator.services.mozilla.com/D242623
2025-03-24 18:54:34 +00:00
Timothy Nikkel 292af322c3 Bug 1933440. Make all display item destructors default and mark all display items final that can be. r=layout-reviewers,jfkthame
This just makes things nice and consistent and lets the compiler optimize if it can.

Differential Revision: https://phabricator.services.mozilla.com/D230249
2024-12-06 13:22:11 +00:00
Jonathan Watt 7532be254f Bug 1931736. Add missing braces around if/loop statements in layout/generic/. r=layout-reviewers,emilio
Depends on D229247

Differential Revision: https://phabricator.services.mozilla.com/D229248
2024-11-17 05:03:58 +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
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 9ff564d485 Bug 1896516 Part 7 - Remove PresShell::GetRootScrollFrameAsScrollable(). r=layout-reviewers,emilio
`PresShell::GetRootScrollFrameAsScrollable()` is equivalent to
`PresShell::GetRootScrollContainerFrame()`.

In ScrollContainerFrame.h, `DecideScrollableLayer()` has two versions, one has
four parameters, and the other has five parameters with the fifth parameter
`aDirtyRectHasBeenOverriden` having a default value `nullptr`. When we switch
the caller from `nsIScrollableFrame` to `ScrollContainerFrame`, we need to
remove the default value for the fifth parameter to avoid ambiguity.

Differential Revision: https://phabricator.services.mozilla.com/D211494
2024-05-30 06:32:20 +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 5ac7609fac Bug 1896516 Part 7 - Remove PresShell::GetRootScrollFrameAsScrollable(). r=layout-reviewers,emilio
`PresShell::GetRootScrollFrameAsScrollable()` is equivalent to
`PresShell::GetRootScrollContainerFrame()`.

In ScrollContainerFrame.h, `DecideScrollableLayer()` has two versions, one has
four parameters, and the other has five parameters with the fifth parameter
`aDirtyRectHasBeenOverriden` having a default value `nullptr`. When we switch
the caller from `nsIScrollableFrame` to `ScrollContainerFrame`, we need to
remove the default value for the fifth parameter to avoid ambiguity.

Differential Revision: https://phabricator.services.mozilla.com/D211494
2024-05-28 04:46:19 +00:00
Timothy Nikkel ff872b7c4e Bug 1870415. In nsCanvasFrame::BuildDisplayList, only capture background items we create in our blend container item instead of any items that might be in the display list already. r=mstange,layout-reviewers,emilio
When we call nsCanvasFrame::BuildDisplayList from nsHTMLScrollFrame::BuildDisplayList there is already a compositor hit test item in it, created here https://searchfox.org/mozilla-central/rev/ff08e36e1f368bd193b54f569dbd79105b50f9a0/layout/generic/nsGfxScrollFrame.cpp#4146

If we create a blend container item in nsCanvasFrame::BuildDisplayList it puts everything that might already exist in the display list inside the blend container item. It should only do this for the background items that we just created as this is for background blend mode, we are only blending within the background of this frame.

In the fuzz testcase we then have a partial display list build that visits the root scroll frame (because a scroll bar is dirty), so it builds the compositor hit test item for the canvas frame (the child of the scroll frame), but canvas frame is not modified, so we don't descend into it, and we don't call nsCanvasFrame::BuildDisplayList, so the compositor hit test item does not get wrapped in the blend container, and thus it has moved in the display list without being marked modified.

Differential Revision: https://phabricator.services.mozilla.com/D209511
2024-05-06 21:11:33 +00:00
Ting-Yu Lin 8a77ebbb16 Bug 1888535 Part 5 - Remove DISPLAY_REFLOW. r=layout-reviewers,emilio
It is used in `Reflow()` implementations.

Differential Revision: https://phabricator.services.mozilla.com/D206317
2024-04-02 19:03:05 +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
Ting-Yu Lin 42e322f8a0 Bug 1878433 Part 3 - Sort #includes in nsCanvasFrame.cpp, and removed some unused ones. r=dholbert
Also, remove the following because they are not used.

- #include "AccessibleCaretEventHub.h"
- #include "nsPrintfCString.h"

Differential Revision: https://phabricator.services.mozilla.com/D200529
2024-02-03 01:30:39 +00:00
Ting-Yu Lin 1f298e1a96 Bug 1878433 Part 2 - Remove broken code within DEBUG_CANVAS_FOCUS define. r=dholbert
The code no longer compiles because most of the functions such as
`EventStateManager::GetFocusedContent()`, `PresContext::GetContainer()`, and
`nsIDocShell::GetHasFocus()` are gone.

Differential Revision: https://phabricator.services.mozilla.com/D200528
2024-02-03 01:30:39 +00:00
Ting-Yu Lin 4f26895e18 Bug 1877850 Part 1 - Convert callers of ReflowInput physical size accessors to use logical ones. r=dholbert
ReflowInput's computed sizes and border&padding are stored in logical
coordinates, so accessing the physical version is slower [1]. This patch
converts as many callers as possible to use logical coordinates.

This patch doesn't change behavior.

[1] For example, accessing `ComputedWidth()` and `ComputedHeight()` needs two
`IsVertical()` check, but `GetPhysicalSize()` only needs one.

Differential Revision: https://phabricator.services.mozilla.com/D200237
2024-02-01 22:02:00 +00:00
Ting-Yu Lin e9151ca0ee Bug 1875600 - Use nsIFrame::PresShell() to simply some callers. r=layout-reviewers,emilio
Those callers who using the pointer immediately after getting from
`GetPresShell()` can be replaced with `PresShell()`.

This patch doesn't change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D199164
2024-01-23 00:30:53 +00:00
Emilio Cobos Álvarez 0b366c953e Bug 1851787 - Plumb a DestroyContext through all functions that can destroy frames. r=dholbert
This prevents anonymous content getting destroyed at weird times
during frame destruction.

Differential Revision: https://phabricator.services.mozilla.com/D187693
2023-09-08 15:11:17 +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