Commit Graph

1597 Commits

Author SHA1 Message Date
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
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
Emilio Cobos Álvarez
9bae74fae2 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 10:25:31 +00:00
Emilio Cobos Álvarez
c54d301d5e 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 08:33:36 +00:00
Ting-Yu Lin
b4a0842882 Bug 1824877 Part 3 - Change ScrollContainerFrame's type from Scroll to ScrollContainer. r=dholbert
This effectively changes the `IsScrollFrame()` helper to
`IsScrollContainerFrame()`.

Differential Revision: https://phabricator.services.mozilla.com/D210357
2024-05-15 17:50:49 +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
Daniel Holbert
af69b59aae Bug 1896711 part 3: Use MakeRefPtr/MakeAndAddRef to reduce boilerplate, in layout/base. r=TYLin
Also remove some unnecessary null-checks for objects that we're allocating
infallibly.

Differential Revision: https://phabricator.services.mozilla.com/D210389
2024-05-15 07:29:20 +00:00
Emilio Cobos Álvarez
0a1d2b49ff Bug 1895870 - Simplify refresh driver observer set-up. r=smaug
There's no call to AddRefreshObserver(FlushType::Layout), so we don't
need to track layout flushes. The only reason we need
mLayoutFlushObservers is so that reflows triggered from the style flush
get processed. But at that point, we can just flush layout directly.

There's no really good distinction between style flushes and layout
flushes with container queries anyways, so this makes the code simpler
to reason about.

Differential Revision: https://phabricator.services.mozilla.com/D209924
2024-05-14 08:12:03 +00:00
Masayuki Nakano
bdc24b132f Bug 1840568 - Make PresShell::HandleEventWithCurrentEventInfo never try to flush pending things if it handled a query content event r=smaug
Query content is used for a part of handling user interaction with IME or
query request from IME via native API.  Therefore, we don't need to flush
pending things at that time since it's not the last chance to do so before
handling next user input.  Additionally, the call may cause same query before
returning the result to IME so that may cause stack overflow crash and
that means we flush layout even if the query request does not want flushing
pending things.  Therefore, we should not do that at handling query content
event.

Differential Revision: https://phabricator.services.mozilla.com/D209990
2024-05-14 01:08:37 +00:00
Masayuki Nakano
33274b20c7 Bug 1891304 - Make APZEventState manage whether the pointerdown was consumed by content or not r=smaug,hiro
The Pointer Events spec defines that:

> Authors can prevent the firing of certain compatibility mouse events by
> canceling the pointerdown event (if the isPrimary property is true).
> <snip>
> Note, however, that this does not prevent the mouseover, mouseenter, mouseout,
> or mouseleave events from firing.
https://w3c.github.io/pointerevents/#the-pointerdown-event

The other browsers conform to this.  Therefore, we should stop dispatching
compatibility mouse events only if the preceding `pointerdown` is consumed by
content.  I.e., we need to keep dispatching touch events and `click` etc which
indicate what should happen on the element.

Currently, `APZEventState` does not manage whether the preceding `pointerdown`
is canceled or not.  So, it dispatches compatibility mouse events via
`APZCCallbackHelper` after the consumed pointer is removed.  Therefore, we
need to make it manage whether the preceding `pointerdown` of the first touch
is consumed or not and `APZCCallbackHelper` needs an option to dispatch the
compatibility mouse events only to chrome (they are required to dispatch
`click` etc).

However, if `APZEventState` is not available like test API used in the
remote process, `TouchManager` needs to manage it instead of `APZEventState`.

I don't think only `TouchManager` should manage it because `APZEventState`
manages complicated state of touch gestures and that can know whether the
synthesizing compatibility mouse events related to the consumed `pointerdown`
or not strictly.  Therefore, this patch makes the `TouchManager` state used
only in the path handling synthesized events for tests.

Differential Revision: https://phabricator.services.mozilla.com/D208706
2024-05-14 01:07:49 +00:00
Emilio Cobos Álvarez
3abe531738 Bug 1895928 - PresShell::ScheduleViewManagerFlush shouldn't set the layout flush bit. r=smaug
A version of the patch in bug 1895870 caused some WPT tests to time out
because document.fonts.ready never resolves.

This is because I made PresShell::HasPendingReflow look at
mNeedLayoutFlush, and nsIFrame::SchedulePaint() calls
PresShell::ScheduleViewManagerFlush() which sets that bit.

So we end up with mNeedLayoutFlush, but without a flush scheduled, and
the ready promise doesn't resolve until something else schedules a
flush. I fixed the original patch to preserve behavior, but requesting a
repaint shouldn't require a layout flush.

This call was added in bug 598482 part 16:

  https://hg.mozilla.org/mozilla-central/rev/71d77495b606fc145bdceabcda29181978bd9405

We only need the layout flush if there are view geometry updates, so
shift the call up to the view manager.

Differential Revision: https://phabricator.services.mozilla.com/D209938
2024-05-10 08:08:42 +00:00
Emilio Cobos Álvarez
8e07c2864f Bug 1890576 - Make root element color-scheme affect widget appearance. r=mstange,mac-reviewers
Instead of relying on the embedder color-scheme directly, use the
color-scheme property to determine the nsCocoaWindow's appearance.

This is more in line with what content does, would've prevented this bug
from existing altogether, and avoids the need for MOZGlobalAppearance.

Differential Revision: https://phabricator.services.mozilla.com/D207050
2024-05-02 15:41:14 +00:00
Dan Robertson
729d142d49 Bug 1863194 - Do not terminate wheel transaction on browsing context change. r=hiro,smaug,webdriver-reviewers,Sasha
We should continue to use a wheel transaction for wheel events when the
browsing context changes from the current context. Avoiding the override
of the event target with the current wheel transaction can halt a page
scroll when the mouse moves over content in a different presentation
context.

Differential Revision: https://phabricator.services.mozilla.com/D205495
2024-04-25 12:16:40 +00:00
Timothy Nikkel
8ac1db6c96 Bug 1892678. Rename pref image.decode-sync.enabled to image.testing.decode-sync.enabled. r=gfx-reviewers,nical
The reason I want to rename this so that it is clear that it is intended for tests only is for bug 1866411. If we see that this pref is set then we can assume that it isn't being flipped during the loading of images, and therefore we can avoid the extra invalidates that sync decode paints would normally incur.

Differential Revision: https://phabricator.services.mozilla.com/D208111
2024-04-24 01:57:41 +00:00
Mike Hommey
eb41ab9b93 Bug 1890926 - Remove unused temporary variable. r=hiro
Differential Revision: https://phabricator.services.mozilla.com/D207236
2024-04-16 01:56:53 +00:00
Sandor Molnar
1f76bee7da Backed out changeset f946717df0fd (bug 1863194) for causing wd failures @ webdriver/tests/bidi/input/perform_actions/wheel.py CLOSED TREE 2024-04-16 02:09:18 +03:00
Dan Robertson
e83943cc40 Bug 1863194 - Do not terminate wheel transaction on browsing context change. r=hiro,smaug
We should continue to use a wheel transaction for wheel events when the
browsing context changes from the current context. Avoiding the override
of the event target with the current wheel transaction can halt a page
scroll when the mouse moves over content in a different presentation
context.

Differential Revision: https://phabricator.services.mozilla.com/D205495
2024-04-15 20:45:38 +00:00
Jan-Niklas Jaeschke
6019fb9e6a Bug 1867939, part 5: Integrate find-text-directive algorithm into Document load. r=peterv,farre,dom-core
This patch integrates the algorithm to find a text fragment range
into the document loading mechanism.
Unlike described in the spec, the fragment directive is not stripped
from the URL in the Session History Entry, instead it is stripped when
setting the URI into the Document using `Document::SetURI()`,
as well as when accessing the URL through `Location`.

The `PresShell` class is extended by a new method which sets the
ranges created from the text directives into the FrameSelection as
TargetText selection and scrolls it into view.

Security restrictions like force load at top and cross-origin iframes
are not yet considered in this patch.

Differential Revision: https://phabricator.services.mozilla.com/D195688
2024-04-04 14:39:33 +00:00
Stanca Serban
ce5dc60809 Backed out 6 changesets (bug 1867939) for causing wpt failures in target-text-010.html. CLOSED TREE
Backed out changeset 44101c258e52 (bug 1867939)
Backed out changeset c53267e1b460 (bug 1867939)
Backed out changeset 0748839408e5 (bug 1867939)
Backed out changeset 38631fbd2f2f (bug 1867939)
Backed out changeset d77b9257c842 (bug 1867939)
Backed out changeset 0d269b891421 (bug 1867939)
2024-04-04 00:50:50 +03:00
Jan-Niklas Jaeschke
4117054bb6 Bug 1867939, part 5: Integrate find-text-directive algorithm into Document load. r=peterv,farre,dom-core
This patch integrates the algorithm to find a text fragment range
into the document loading mechanism.
Unlike described in the spec, the fragment directive is not stripped
from the URL in the Session History Entry, instead it is stripped when
setting the URI into the Document using `Document::SetURI()`,
as well as when accessing the URL through `Location`.

The `PresShell` class is extended by a new method which sets the
ranges created from the text directives into the FrameSelection as
TargetText selection and scrolls it into view.

Security restrictions like force load at top and cross-origin iframes
are not yet considered in this patch.

Differential Revision: https://phabricator.services.mozilla.com/D195688
2024-04-03 15:23:02 +00:00
Sandor Molnar
7a867184d3 Backed out 6 changesets (bug 1867939) for causing a top crash in nightly Bug 1889393 CLOSED TREE
Backed out changeset 2110f57e928c (bug 1867939)
Backed out changeset 51890598ecb4 (bug 1867939)
Backed out changeset 839bc1b11a2c (bug 1867939)
Backed out changeset bb88c4d09e82 (bug 1867939)
Backed out changeset 27c76e65cf58 (bug 1867939)
Backed out changeset c3e3c81f9ceb (bug 1867939)
2024-04-03 17:31:56 +03:00
Emilio Cobos Álvarez
dadf0fbdef Bug 1888242 - Simplify viewport handling in RDM. r=bradwerth,devtools-reviewers,ochameau
In particular:

 * Always handle meta viewport in RDM. This fixes bug 1625999 too by
   making touch simulation enabled and disabled consistent.

 * Restore the resolution to 1 when toggling RDM. This is just simpler,
   and we're not keeping around the visual viewport offsets anyways
   so...

 * Deal with the change more easily, at the same point we switch
   scrollbars etc.

Differential Revision: https://phabricator.services.mozilla.com/D206266
2024-04-02 15:21:04 +00:00
Jan-Niklas Jaeschke
a6845cd22c Bug 1867939, part 5: Integrate find-text-directive algorithm into Document load. r=peterv,farre,dom-core
This patch integrates the algorithm to find a text fragment range
into the document loading mechanism.
Unlike described in the spec, the fragment directive is not stripped
from the URL in the Session History Entry, instead it is stripped when
setting the URI into the Document using `Document::SetURI()`,
as well as when accessing the URL through `Location`.

The `PresShell` class is extended by a new method which sets the
ranges created from the text directives into the FrameSelection as
TargetText selection and scrolls it into view.

Security restrictions like force load at top and cross-origin iframes
are not yet considered in this patch.

Differential Revision: https://phabricator.services.mozilla.com/D195688
2024-04-02 13:44:25 +00:00
Cristian Tuns
9a4d6d56af Backed out 6 changesets (bug 1867939) for causing build bustages in Document.h CLOSED TREE
Backed out changeset 0853f9a7a06c (bug 1867939)
Backed out changeset 2279e6577c13 (bug 1867939)
Backed out changeset 1b3af4b6a27b (bug 1867939)
Backed out changeset 2fbe643ca483 (bug 1867939)
Backed out changeset 575873406614 (bug 1867939)
Backed out changeset 82f99c0210b0 (bug 1867939)
2024-04-02 09:15:46 -04:00
Jan-Niklas Jaeschke
9dd5893918 Bug 1867939, part 5: Integrate find-text-directive algorithm into Document load. r=peterv,farre,dom-core
This patch integrates the algorithm to find a text fragment range
into the document loading mechanism.
Unlike described in the spec, the fragment directive is not stripped
from the URL in the Session History Entry, instead it is stripped when
setting the URI into the Document using `Document::SetURI()`,
as well as when accessing the URL through `Location`.

The `PresShell` class is extended by a new method which sets the
ranges created from the text directives into the FrameSelection as
TargetText selection and scrolls it into view.

Security restrictions like force load at top and cross-origin iframes
are not yet considered in this patch.

Differential Revision: https://phabricator.services.mozilla.com/D195688
2024-04-02 11:43:21 +00:00
Emilio Cobos Álvarez
a729842e1e Bug 1888592 - Terminate mOriginalCaret properly, and fix null crash. r=masayuki
We have callers that call RestoreCaret after pres shell shut down.

Differential Revision: https://phabricator.services.mozilla.com/D206120
2024-03-29 21:51:11 +00:00
keithamus
390ef8eb0d Bug 1865589 - Notify PresShell of CustomState changes, so Restyle can invalidate. r=emilio,dshin
Differential Revision: https://phabricator.services.mozilla.com/D202460
2024-03-22 22:18:05 +00:00
Gregory Pappas
388a03bed2 Bug 1885708 - Remove apz.mvm.force-enabled pref r=botond
Differential Revision: https://phabricator.services.mozilla.com/D204839
2024-03-22 20:01:11 +00:00
Emilio Cobos Álvarez
3948b45eb8 Bug 1886506 - Fix caret paint invalidation issues. r=sefeng
The caret position is in the DOM, and sometimes can get out of sync.

While that is an issue, it's not new: The code before the regressing bug
papered over it on a pre-pass before entering DL building.

Instead, deal with it using MarkFramesForDisplay (just like we mark the
caret frame itself, which has the same issue), and invalidate the old
frame more precisely by tracking it in nsCaret directly.

Also, add missing invalidation in PresShell::SetCaret, where the caret
might change and the old caret might not be invalidated properly.

Differential Revision: https://phabricator.services.mozilla.com/D205369
2024-03-22 12:20:14 +00:00
Emilio Cobos Álvarez
494c63e551 Bug 1884631 - Remove macOS native sheet support. r=mac-reviewers,aleca,kaie,bradwerth
Firefox never uses this. TB could use the same approach Firefox uses,
but for now on macOS the sheets become regular modal dialogs, which is
the same as on Windows and Linux.

See bug 1755330 and bug 1737489 for more context.

Differential Revision: https://phabricator.services.mozilla.com/D204209
2024-03-18 10:06:26 +00:00
Masayuki Nakano
657bfed498 Bug 1885259 - Make AutoPointerEventTargetUpdater work without event target frame r=edgar,dom-core
The crash occurs when `PointerEventHandler::DispatchPointerFromMouseOrTouch`
dispatches a pointer event for `eTouchStart`.  In this case, `aFrame` of
the constructor of `AutoPointerEventTargetUpdater` is set to the primary frame
of the event target content [1][2] and the event target may have no frame
because touch targets are considered by `TouchManager` before dispatching
`ePointerDown` [3][4][5].  Therefore, we should make it take event target
content for the case of no event target frame.

I tried to reproduce the crash with removing the target or making the target
`display:contents` at first `pointerdown` or `touchstart` of multi-touch, but
I couldn't reproduce the crash.  Therefore, this patch does not contain new
tests.

1. https://searchfox.org/mozilla-central/rev/109bb25545f0d2df31954dc0a9afbf30d900b6bb/dom/events/PointerEventHandler.cpp#694,701
2. https://searchfox.org/mozilla-central/rev/109bb25545f0d2df31954dc0a9afbf30d900b6bb/layout/base/PresShell.cpp#8319,8341
3. https://searchfox.org/mozilla-central/rev/109bb25545f0d2df31954dc0a9afbf30d900b6bb/layout/base/TouchManager.cpp#115
4. https://searchfox.org/mozilla-central/rev/109bb25545f0d2df31954dc0a9afbf30d900b6bb/layout/base/PresShell.cpp#7400
5. https://searchfox.org/mozilla-central/rev/109bb25545f0d2df31954dc0a9afbf30d900b6bb/layout/base/PresShell.cpp#7198

Differential Revision: https://phabricator.services.mozilla.com/D204632
2024-03-14 23:46:07 +00:00
Masayuki Nakano
a3e8cfa08d Bug 1695574 - Make PresShell::EventHandler::HandleEventUsingCoordinates keep handling touch events after preceding pointer event target is removed r=smaug,edgar,dom-core
As far as investigating the behavior of the other browsers, touch events are
dispatched the same target as the preceding `pointerdown` even after the target
is removed from the DOM tree.  However, the following pointer events are
dispatched on the target as usual (i.e., the element under the pointer except
when the pointer is captured).  However, our code stops handling touch events
if the preceding `pointerdown` removes the target and not dispatching
`touchstart` causes not dispatching the following touch events so that no
`click` event is fired.

This patch makes the touch event dispatching path work without frame and
keep handling even with an orphan event target.

Differential Revision: https://phabricator.services.mozilla.com/D202811
2024-03-12 01:03:44 +00:00
Peter Van der Beken
9e9199880e Bug 1640839 - Stop generating a sentinel value at the end of WebIDL enums. r=mccr8,jgilbert,media-playback-reviewers,padenot
Differential Revision: https://phabricator.services.mozilla.com/D201344
2024-03-02 07:50:25 +00:00
Natalia Csoregi
10b9ceb789 Backed out 13 changesets (bug 1640839) for causing bustage on Element.cpp CLOSED TREE
Backed out changeset 179ceb82c9e5 (bug 1640839)
Backed out changeset 73f498a821f0 (bug 1640839)
Backed out changeset dc2d3d0e0365 (bug 1640839)
Backed out changeset ddc989ac0509 (bug 1640839)
Backed out changeset e595bb3feea8 (bug 1640839)
Backed out changeset c85aca04e27f (bug 1640839)
Backed out changeset 98e8e3a4047a (bug 1640839)
Backed out changeset 59ef180517db (bug 1640839)
Backed out changeset af2f5e293662 (bug 1640839)
Backed out changeset 89aa6d9dc598 (bug 1640839)
Backed out changeset 67b722a722f9 (bug 1640839)
Backed out changeset 24a9665c6ced (bug 1640839)
Backed out changeset d93f199385e9 (bug 1640839)
2024-03-01 18:23:08 +02:00
Peter Van der Beken
e0fa109cb0 Bug 1640839 - Stop generating a sentinel value at the end of WebIDL enums. r=mccr8,jgilbert,media-playback-reviewers,padenot
Differential Revision: https://phabricator.services.mozilla.com/D201344
2024-03-01 14:31:15 +00:00
Masayuki Nakano
31efb600ee Bug 1880594 - Make PresShell::EventHandler dispatch mouse events as a default action of eTouchEnd if it's dispatched without APZ r=smaug
The mouse events for `eTouchEnd` is currently dispatched by
`APZCCallbackHelper` [1] and currently we don't support async event dispatching
in WPT (bug 1773393).  Therefore, tests of Pointer Events for touch won't work.
This blocks our further work to improve Pointer Events.  Therefore,
`PresShell::EventHandler` should have a fallback path for it.

1. https://searchfox.org/mozilla-central/rev/a7809ff8b0a6d98e6df3183d3ca99c77ef2f983e/gfx/layers/apz/util/APZCCallbackHelper.cpp#553,562-567

Differential Revision: https://phabricator.services.mozilla.com/D202376
2024-02-27 01:25:51 +00:00