Commit Graph

1631 Commits

Author SHA1 Message Date
Masayuki Nakano
528d09c312 Bug 1904279 - Get rid of dom.w3c_pointer_events.dispatch_click_as_pointer_event pref r=smaug,pip-reviewers,search-reviewers,devtools-reviewers,urlbar-reviewers,nchevobbe,dao,jteow,mconley
Keep supporting the pref makes a lot of `click`, `auxclick` and `contextmenu`
event creators complicated (and look messy).  So, let's delete it as soon as
possible.

Differential Revision: https://phabricator.services.mozilla.com/D217225
2024-07-30 06:49:42 +00:00
Masayuki Nakano
16398887a4 Bug 1905267 - part 2: Make PresShell not use non-element event target when target frame is destroyed and the event wants Element target r=smaug
When event target frame is destroyed, `PresShell::NotifyDestroyingFrame` updates
current event target content to the frame content.  However, event target of
some DOM events need to be `Element`.  Therefore,
`PresShell::mCurrentEventTarget` needs to store at least the handling
`EventMessage` to consider whether the event target can be non-element content
node or only element node.  So, we need to make `PresShell::EventTargetInfo`
store `EventMessage`.  Then, we can make `PresShell::NotifyDestroyingFrame`
prefer inclusive ancestor element as new event target from the `EventMessage`.

Although I don't understand what's going on the reported case, but I found the
simple case when event target is changed to a `Text` with the assertion in
`PresShell::DispatchEventToDOM`.  Therefore, this patch has a new test.

Note that if target frame is a frame for element, e.g., when event target is
a focused element, `IsForbiddenDispatchingToNonElementContent` result won't
change the behavior.  Therefore, its implementation is not optimized for
non-user input events.

Differential Revision: https://phabricator.services.mozilla.com/D217205
2024-07-30 00:06:10 +00:00
Masayuki Nakano
66321dce9c Bug 1905267 - part 1: Make PresShell manage event target frame and content with a struct r=smaug
`PresShell::mCurrentEventTargetContent` may be update to non-element node
when `PresShell::mCurrentEventTargetFrame` is destroyed.  Therefore, for
avoiding it, I'd like to add `EventMessage` to the group to consider whether
the content needs to be `Element`.  However, adding new members for current
and stack would make `PresShell` members more messy.  Therefore, I'd like to
group the data with the simple struct.

Differential Revision: https://phabricator.services.mozilla.com/D217204
2024-07-30 00:06:09 +00:00
Masayuki Nakano
44aae6e962 Bug 1909577 - Make some nsFocusManager::GetFocusedElement() users use its static version instead r=emilio,credential-management-reviewers,issammani
Now, we have `nsFocusManager::GetFocusedElementStatic()` which returns focused
element if the `nsFocusManager` instance is available.  Therefore, if
`nsFocusManager::GetFocusedElement()` users do not use other methods of
`nsFocusManager`, they can use `nsFocusManager::GetFocusedElementStatic()` and
make themselves simpler.

Note that some callers return early if `nsFocusManager` is not available, but
they do not return error and `nsFocusManager` instance is available in most
time of the life time of the process.  Therefore, we can simply stop using the
early return.

Differential Revision: https://phabricator.services.mozilla.com/D217527
2024-07-25 00:33:58 +00:00
Emilio Cobos Álvarez
1513819c21 Bug 1789166 - Use content-visibility rather than display: none to hide <details> content. r=smaug
This matches the current shipping version of Chromium, and the last
version of the spec, except for the <slot> display when open, which per
spec ought to be `block`, but it's still `contents`.

animation-canceled-by-parent-details-element-being-closed.html is
invalid because content-visibility doesn't cancel animations, just
pauses them. It also times out in Chrome.

Differential Revision: https://phabricator.services.mozilla.com/D217192
2024-07-20 17:49:39 +00:00
Stanca Serban
fd5b1ecdad Backed out changeset 48baafc34055 (bug 1789166) for causing mochitests failures. CLOSED TREE 2024-07-20 18:43:13 +03:00
Emilio Cobos Álvarez
79779b8643 Bug 1789166 - Use content-visibility rather than display: none to hide <details> content. r=smaug
This matches the current shipping version of Chromium, and the last
version of the spec, except for the <slot> display when open, which per
spec ought to be `block`, but it's still `contents`.

animation-canceled-by-parent-details-element-being-closed.html is
invalid because content-visibility doesn't cancel animations, just
pauses them. It also times out in Chrome.

Differential Revision: https://phabricator.services.mozilla.com/D217192
2024-07-20 14:17:31 +00:00
Masayuki Nakano
793931aa6c Bug 1907967 - Make PresShell::RecordPointerLocation record mouse location and enqueue a synthetic mouse move if a drag event occurs r=smaug
During a drag session, mouse events are not fired.  Therefore, once the drag
session ends, mouse cursor may be anywhere different from the drag start
position.  Therefore, `PresShell` should update the last mouse position when it
receives drag events and needs to synthesize a mouse move after the drag session
ends to fire mouse boundary events and updating the hover state.

Differential Revision: https://phabricator.services.mozilla.com/D217080
2024-07-20 02:28:57 +00:00
Masayuki Nakano
46df5e10d3 Bug 1907967 - Change printfs for logging synthesizing mouse moves to MOZ_LOG r=smaug
I think that it should be available only in the debug build for the performance.

Differential Revision: https://phabricator.services.mozilla.com/D217079
2024-07-20 02:28:57 +00:00
Masayuki Nakano
b7d4e92909 Bug 1907967 - Rewrite PresShell::RecordPointerLocation with switch statement r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D217078
2024-07-20 02:28:56 +00:00
Jan-Niklas Jaeschke
cd139cc24d Bug 1908907 - Text Fragments: Set sequential focus to the text directive, but don't focus it. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D217100
2024-07-19 15:42:32 +00:00
Stanca Serban
b74d1bcd26 Backed out 12 changesets (bug 1831649) for causing multiple failures.
Backed out changeset 501dc3134ae1 (bug 1831649)
Backed out changeset 21235ab42839 (bug 1831649)
Backed out changeset 279fdf36aac1 (bug 1831649)
Backed out changeset 17fb50534fae (bug 1831649)
Backed out changeset b2718b2f730d (bug 1831649)
Backed out changeset a05aa1c75ece (bug 1831649)
Backed out changeset becfb23cd6b4 (bug 1831649)
Backed out changeset 2d0e7e662530 (bug 1831649)
Backed out changeset 22538f7bdc88 (bug 1831649)
Backed out changeset 4ddecb37950f (bug 1831649)
Backed out changeset 1e6ed8b78e8f (bug 1831649)
Backed out changeset 6e96a1a01c24 (bug 1831649)
2024-07-18 06:13:43 +03:00
Hiroyuki Ikezoe
e184f9d681 Bug 1831649 - Trigger MobileViewportManager::RefreshViewportSize in the case where nsDocumentViewport boundaries changes but nsView boundaries unchanges. r=tnikkel,botond
Differential Revision: https://phabricator.services.mozilla.com/D208564
2024-07-18 00:31:14 +00:00
Jan-Niklas Jaeschke
d296498d92 Bug 1906134 - Text Fragments: Ensure to scroll the first text directive on a page into the center of the view. r=emilio
Before this patch, it could happen that `PresShell::GoToAnchor()` was called while loading a document.
This method did not know about text fragments before,
and would scroll the anchor (ie., the first text directive) to the top of the view.
This was noticeable for pages that took longer to load, where the text directive was scrolled to the center first, and then to the top.

This patch saves the desired vertical scroll position as a member in `PresShell` and makes `GoToAnchor()` scroll to the center as well.

Additionally, this patch updates the test file target document to make it more mobile-friendly.

Differential Revision: https://phabricator.services.mozilla.com/D216039
2024-07-16 09:16:48 +00:00
Jan-Niklas Jaeschke
c547a4b4e6 Bug 1906895 - Text Fragments: Scroll the start container of a range into view instead of its common ancestor. r=emilio
Spec issue: https://github.com/WICG/scroll-to-text-fragment/issues/259

Differential Revision: https://phabricator.services.mozilla.com/D216147
2024-07-15 07:38:21 +00:00
Timothy Nikkel
a679a30a60 Bug 1906561. Avoid a useless call to GetTransformMatrix in PresShell::ScrollFrameIntoView. r=layout-reviewers,emilio
Since container is transformed, container->GetTransformMatrix will always just put the cross doc parent frame into parent. I checked the history when this code was written, it looks like GetTransformMatrix (via GetResultingTransformMatrix) might have go up more than one parent frame in the case of preserve 3d (combines 3d) frames. That is no longer the case, and GetTransformMatrix is a relatively heavyweight function.

Differential Revision: https://phabricator.services.mozilla.com/D215860
2024-07-10 12:00:09 +00:00
Emilio Cobos Álvarez
5f0c7d9620 Bug 1906132 - Explicitly set bresize bit when doing a measuring reflow. r=dholbert
This doesn't change behavior, but it is more explicit.

Make the two resize code-paths invalidate the same way.

Differential Revision: https://phabricator.services.mozilla.com/D215841
2024-07-05 17:50:40 +00:00
David P
805b8742ba Bug 1893119: Part 3 - Add widget to nsContentUtils::GetDragSession r=gstoll,rkraesig
Updates each client of the nsContentUtils method to get the right drag session -- the one for the widget that is currently the source or target of the drag session.
The change to nsDOMWindowUtils::DispatchDOMEventViaPresShellForTesting() supports the change to WidgetDragEvent::InitDropEffectForTests() and enabled a
large number of test fixes in the next patch.

Differential Revision: https://phabricator.services.mozilla.com/D211067
2024-07-04 07:48:04 +00:00
Jan-Niklas Jaeschke
63ac1a307c Bug 1897956 - Text Fragments: Set text fragment as :target. r=farre,dom-core
This patch makes some adjustments to follow the spec more strictly by
separating highlighting a text fragment (ie. adding the ranges to a `eTargetText` Selection)
from scrolling to it.

Scrolling to the text fragment now follows the steps given in [0] more closely,
in particular now the closest common ancestor of the target range is being used
as `:target` element.

This change also sets the focus to the start of the first text fragment, as indicated by the spec.
This resets the normal selection on the page.
The wpt test in /css/css-pseudo/target-text-005.html is based on the idea of having a same-doc
text fragment navigation with a selection.
This test fails with this patch applied, because the selection is reset.
It is currently unclear what behavior is correct here, thus the test is kept for now.

[0]: https://wicg.github.io/scroll-to-text-fragment/#invoking-text-directives

Differential Revision: https://phabricator.services.mozilla.com/D211025
2024-06-19 17:16:39 +00:00
Iulian Moraru
a9377e5b95 Backed out 4 changesets (bug 1898321, bug 1897942, bug 1897956) for causing multiple failures.
Backed out changeset ec3fcdcbfbd7 (bug 1897942)
Backed out changeset 279025d15551 (bug 1898321)
Backed out changeset a239855b02ea (bug 1897942)
Backed out changeset aab98ffe0ee9 (bug 1897956)
2024-06-14 18:43:03 +03:00
Jan-Niklas Jaeschke
8c4f317e30 Bug 1897956 - Text Fragments: Set text fragment as :target. r=farre,dom-core
This patch makes some adjustments to follow the spec more strictly by
separating highlighting a text fragment (ie. adding the ranges to a `eTargetText` Selection)
from scrolling to it.

Scrolling to the text fragment now follows the steps given in [0] more closely,
in particular now the closest common ancestor of the target range is being used
as `:target` element.

This change also sets the focus to the start of the first text fragment, as indicated by the spec.
This resets the normal selection on the page.
The wpt test in /css/css-pseudo/target-text-005.html is based on the idea of having a same-doc
text fragment navigation with a selection.
This test fails with this patch applied, because the selection is reset.
It is currently unclear what behavior is correct here, thus the test is kept for now.

[0]: https://wicg.github.io/scroll-to-text-fragment/#invoking-text-directives

Differential Revision: https://phabricator.services.mozilla.com/D211025
2024-06-14 12:20:47 +00:00
Masayuki Nakano
b3c5045ec1 Bug 1675847 - part 5: Make contextmenu event dispatchers use WidgetPointerEvent or PointerEvent r=smaug,pip-reviewers,devtools-reviewers,nchevobbe,mconley
`eContextMenu` event may be fired from `widget`.  Therefore, different from
`ePointerClick` and `ePointerAuxClick`, they may cross the process boundary,
may be handled by APZ and may be dispatched into the DOM after a delay.
Therefore, this patch is complicated than the previous patch.  This adds
* New IPC message handlers for sending/receiving a `WidgetPointerEvent`
* New `DelayedPointerEvent` class and templated `MouseInput::ToWidgetEvent`
* `PresShell::EventHandler` handles `eContextMenu` as same as `WidgetMouseEvent`

Differential Revision: https://phabricator.services.mozilla.com/D213003
2024-06-14 00:18:48 +00:00
Masayuki Nakano
e1fd41420f Bug 1675847 - part 3: Make ePointerClick event dispatchers and handlers use WidgetPointerEvent r=smaug,search-reviewers,devtools-reviewers,nchevobbe,jteow
This patch makes the all `ePointerClick` event dispatcher in C++ code use
`WidgetPointerEvent` instead of `WidgetMouseEvent`.

Then, this patch also makes the all `click` event dispatcher in chrome code use
`PointerEvent` instead of `MouseEvent`.  For detecting wrong trusted event
dispatching of `click` event, this patch adds assertion into `MouseEvent`.
Therefore, all chrome test dispatchers also changed to use `PointerEvent`.

Finally, this patch includes a change of a WPT.  That checks the `pointerId`
caused by executing an access key.  In this case, the value should be `-1`
rather than the default value `0` because Pointer Event spec defines so for
synthetic pointer events caused by non-pointing devices [1].  Chrome also
sets it to `-1` and fails [2].  Therefore, the new assertion will pass on both
Firefox and Chrome.

1. https://w3c.github.io/pointerevents/#dom-pointerevent-pointerid
2. https://wpt.fyi/results/uievents/interface/keyboard-accesskey-click-event.html?run_id=5087897523060736&run_id=5136270464647168&run_id=5163620816388096&run_id=5201281304231936

Differential Revision: https://phabricator.services.mozilla.com/D213001
2024-06-14 00:18:47 +00:00
Edgar Chen
0b7dde807f Bug 1883396 - Exit fullscreen when two Escape keyup events occur in a short time; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D209667
2024-06-04 23:38:45 +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
Edgar Chen
b6e9002fbf Bug 1743329 - Handle ESC key to release pointer lock in parent process; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D211621
2024-05-31 11:13:47 +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
Ting-Yu Lin
76523f97b1 Bug 1896516 Part 6 - Remove nsIScrollableFrame usages in nsLayoutUtils. r=layout-reviewers,emilio
Convert `nsIScrollableFrame` to `ScrollContainerFrame` for all the APIs in
nsLayoutUtils, and then adapt other callers until everything compiles.

In `nsLayoutUtils::CalculateBasicFrameMetrics()`'s documentation,
s/ComputeFrameMetrics/ComputeScrollMetadata/ because the method was renamed in
https://hg.mozilla.org/mozilla-central/rev/cb2023f50288

Differential Revision: https://phabricator.services.mozilla.com/D211493
2024-05-30 06:32:20 +00:00
Ting-Yu Lin
2a6ee61abf Bug 1896516 Part 4 - Convert some nsIScrollableFrame usage in PresShell, nsLayoutUtils, and related helpers. r=layout-reviewers,emilio
This patch starts from renaming `PresShell::GetScrollableFrameToScroll()` to
`PresShell::GetScrollContainerFrameToScroll()`, making it return
`ScrollContainerFrame*`, and then fixing other helpers until everything
compiles. As before, we can remove some `do_QueryFrame`.

Differential Revision: https://phabricator.services.mozilla.com/D211491
2024-05-30 06:32:19 +00:00
Ting-Yu Lin
14aebc5bf9 Bug 1896516 Part 1 - Rename PresShell::GetRootScrollFrame(), and make it return ScrollContainerFrame. r=layout-reviewers,emilio
In theory, changing the return type from `nsIFrame*` to `ScrollContainerFrame*`
exposes `ScrollContainerFrame` to the callers who might not needed, but almost
all of the callers in cpp files are already exposed to `nsIScrollableFrame`, as
demonstrated in this patch via replacing the #include from
"nsIScrollableFrame.h" to "ScrollContainerFrame.h", so this is OK.

Some callers can be simplified since we no longer need `do_QueryFrame` to
`nsIScrollableFrame`.

Differential Revision: https://phabricator.services.mozilla.com/D211488
2024-05-30 06:32:17 +00:00
Butkovits Atila
3a56b9800d Backed out 4 changesets (bug 1743329) for causing failures at browser_popupNotification_security_delay.js. CLOSED TREE
Backed out changeset 6d33ea38cd14 (bug 1743329)
Backed out changeset 0f9bffa357a5 (bug 1743329)
Backed out changeset cd96c48488eb (bug 1743329)
Backed out changeset 209a41c449e1 (bug 1743329)
2024-05-29 15:47:23 +03:00
Sebastian Hengst
43268d23d1 Merge mozilla-central to autoland. CLOSED TREE 2024-05-29 11:26:38 +02: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
Edgar Chen
0dbbf9fb35 Bug 1743329 - Handle ESC key to release pointer lock in parent process; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D211621
2024-05-29 07:50:21 +00: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
Ting-Yu Lin
16b24f6c41 Bug 1896516 Part 6 - Remove nsIScrollableFrame usages in nsLayoutUtils. r=layout-reviewers,emilio
Convert `nsIScrollableFrame` to `ScrollContainerFrame` for all the APIs in
nsLayoutUtils, and then adapt other callers until everything compiles.

In `nsLayoutUtils::CalculateBasicFrameMetrics()`'s documentation,
s/ComputeFrameMetrics/ComputeScrollMetadata/ because the method was renamed in
https://hg.mozilla.org/mozilla-central/rev/cb2023f50288

Differential Revision: https://phabricator.services.mozilla.com/D211493
2024-05-28 04:46:18 +00:00
Ting-Yu Lin
509e5ab505 Bug 1896516 Part 4 - Convert some nsIScrollableFrame usage in PresShell, nsLayoutUtils, and related helpers. r=layout-reviewers,emilio
This patch starts from renaming `PresShell::GetScrollableFrameToScroll()` to
`PresShell::GetScrollContainerFrameToScroll()`, making it return
`ScrollContainerFrame*`, and then fixing other helpers until everything
compiles. As before, we can remove some `do_QueryFrame`.

Differential Revision: https://phabricator.services.mozilla.com/D211491
2024-05-28 04:46:17 +00:00
Ting-Yu Lin
6f6e711315 Bug 1896516 Part 1 - Rename PresShell::GetRootScrollFrame(), and make it return ScrollContainerFrame. r=layout-reviewers,emilio
In theory, changing the return type from `nsIFrame*` to `ScrollContainerFrame*`
exposes `ScrollContainerFrame` to the callers who might not needed, but almost
all of the callers in cpp files are already exposed to `nsIScrollableFrame`, as
demonstrated in this patch via replacing the #include from
"nsIScrollableFrame.h" to "ScrollContainerFrame.h", so this is OK.

Some callers can be simplified since we no longer need `do_QueryFrame` to
`nsIScrollableFrame`.

Differential Revision: https://phabricator.services.mozilla.com/D211488
2024-05-28 04:46:16 +00:00
Emilio Cobos Álvarez
f0909e022f Bug 1897827 - Remove FrameChildListID::Popup. r=dholbert
It's no longer used. I made popups regular absolutely-positioned frames
a long time ago.

Differential Revision: https://phabricator.services.mozilla.com/D210949
2024-05-20 22:00:08 +00:00
Emilio Cobos Álvarez
d4cd5b3261 Bug 1897752 - Clean up layout telemetry. r=smaug
This telemetry was trying to measure three things:

 * The time spent during style / layout in a tick. This is useful.
 * The times SetNeed{Style,Layout} flush have been called. This is not a
   particularly useful metric, there's not much to learn or change from
   it. Any call is basically free as long as they're consecutive /
   there's no flush in between.
 * The number of times layout / style has been flushed during a tick.
   This is more useful than the above but, similarly, there's not too
   much to be learned here. Number of flushes can be completely
   orthogonal to how expensive it has been.

It also had a number of flaws:

 * It is recorded per-PresShell, so we get multiple pings per tick.
 * Similarly, if a sub-frame dies before the tick, we just never report
   that time.

Instead, refactor it to make it simpler, and just record the first
metric reliably. This simplifies the code substantially, and I don't
think we're losing much.

The histograms are also expired. We might want to renew this, I'll file
a follow-up to either properly renew this if we plan to look at it, or
remove the code entirely from the tree.

Differential Revision: https://phabricator.services.mozilla.com/D210907
2024-05-20 14:30:08 +00:00
Emilio Cobos Álvarez
ba1fb75fa2 Bug 1897657 - Remove PresShell::mReflowContinueTimer. r=dholbert
In bug 1895870 I (somewhat unintentionally) made this code not called at
all.

Instead of scheduling a 30ms timer if reflow was interrupted, we just
schedule a reflow for the next refresh driver tick via
EnsureLayoutFlush(). Which is what would happen anyways before my change
in presence of other changes (like page loading appending content or
what not).

I think thus that the new behavior is more predictable (the 30ms timer
was never quite measured, it was introduced in bug 499447).

So, just simplify the code.

Differential Revision: https://phabricator.services.mozilla.com/D210890
2024-05-20 06:41:27 +00:00
Ting-Yu Lin
467d0a3a72 Bug 1897135 Part 3 - Change two APIs to ensure root frame is a ViewportFrame. r=dholbert
Move `SetRootFrame()` to nsFrameManager.cpp, because in order to compile
`mRootFrame = aRootFrame` the compiler requires the full definition of
`ViewportFrame` to know that `ViewportFrame` is a subclass of `nsIFrame`

Differential Revision: https://phabricator.services.mozilla.com/D210671
2024-05-17 21:37:02 +00:00
Ting-Yu Lin
3fca23660d Bug 1897135 Part 2 - Remove redundant mFrameManager member in PresShell. r=dholbert
We can just use `mFrameConstructor` to call `GetRootFrame()`. In order to do so
while keeping `PresShell::GetRootFrame()` as a inline method, we need to include
`nsCSSFrameConstructor` header in `PresShell.h`, and remove `PresShell` header
in `nsCSSFrameConstructor.h`. That means we can no longer inline
`RestyleManager()` since it needs to access `PresShell`, but it's OK since
`RestyleManager` is used only in the frame constructor, and is probably not in
the hot path.

Differential Revision: https://phabricator.services.mozilla.com/D210670
2024-05-17 21:37:01 +00:00
Ting-Yu Lin
02535685c4 Bug 1897135 Part 1 - Sort #includes and forward declarations in nsFrameManager, nsCSSFrameConstructor, and PresShell. r=dholbert
Also, delete unused `DEBUG_UNDISPLAYED_MAP` and `DEBUG_DISPLAY_CONTENTS_MAP` in
nsFrameManager.cpp.

Delete the comments between the #includes in PresShell.cpp per coding style
guideline: "Don't place comments between non-conditional includes." in
https://firefox-source-docs.mozilla.org/code-quality/coding-style/coding_style_cpp.html#include-directives

Differential Revision: https://phabricator.services.mozilla.com/D210669
2024-05-17 21:37:01 +00:00
Emilio Cobos Álvarez
fc159ff851 Bug 1896762 - Make animation timing match the spec. r=smaug,firefox-animation-reviewers,boris
Differential Revision: https://phabricator.services.mozilla.com/D210658
2024-05-17 16:33:06 +00:00
Natalia Csoregi
2646ae722f Backed out changeset afcc70a5e871 (bug 1896762) for causing failures on css-transition-cross-document.html CLOSED TREE 2024-05-17 18:50:54 +03:00
Emilio Cobos Álvarez
d554a723e9 Bug 1897322 - More consistently deal with pres shell style observers. r=smaug
Much like we deal with resize events.

Differential Revision: https://phabricator.services.mozilla.com/D210776
2024-05-17 11:56:36 +00:00
Stanca Serban
4edbdf3b0d Backed out changeset 0328321272d7 (bug 1897322) for causing multiple failures. CLOSED TREE 2024-05-17 14:09:21 +03:00