Commit graph

1605 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
169a5d539e 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
6bfd255000 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
39f5d902e5 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
9f0669cfab 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
62bdf442eb 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
8c2521e9d5 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
763356e4fb 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
008be0fde3 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
Masayuki Nakano
d38ecaa856 Bug 1879862 - Make PresShell::HandleEvent check whether the frame is alive after flushing synthesized mouse move r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D201673
2024-02-15 23:30:05 +00:00
Masayuki Nakano
a127c7ee63 Bug 1877815 - Make PresShell::EventHandler::DispatchPrecedingPointerEvent update event target after dispatching a pointer event r=smaug
The reason of the bug is, no `mouseup` event is fired after the `pointerup`
event listener removed the target.  Therefore, `nsIFrame::HandleRelease()` does
not run and nobody cleans up the drag state of the `nsFrameSelection`.

This is caused by that `PresShell::EventHandler::DispatchPrecedingPointerEvent()`
updates only event target frame of the following mouse event target if the
pointer event target was removed from the tree, however, the frame may not be
ready.  In this case, `PresShell::GetCurrentContent()` will clear both current
event target content and frame because its composed document (`nullptr`) never
matches with the document for the `PresShell`.  Therefore, it needs to update
the target too.

This patch makes all developers won't create similar bugs, this encapsulate
`EventTargetData::mContent` and `EventTargetData::mFrame` to make their setters
clean up or automatically check the relation.

Differential Revision: https://phabricator.services.mozilla.com/D201053
2024-02-10 01:07:01 +00:00
Sean Feng
306ec6d03f Bug 1878753 - Fix focus gets incorrectly cleared by PresShell::FixUpFocus if the focus is on area element r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D200950
2024-02-08 16:35:02 +00:00
Masayuki Nakano
fc5c01d0f1 Bug 1875424 - Make PresShell::HandleEvent flush pending synthetic mouse move at handling eMouseMove r=smaug
`mouse_boundary_events_after_removing_last_over_element.html` expects that
a `mouseover` should be fired between `click` and `mousemove`, but it's
dispatched by a synthetic mouse move event caused by removing the click target.
The fix of bug 1864654 tried to fix this kind of issues, but it does not flush
pending event at `eMouseMove`.  Therefore, the synthetic mouse move may not be
handled before handling `eMouseMove` which is caused by `pointerMove()` in the
test.

I guess that we need to make it flush before all events which are directly
caused by a user input.  However, I don't want to do it for now because of
the risk.

Depends on D199607

Differential Revision: https://phabricator.services.mozilla.com/D199694
2024-01-26 15:05:37 +00:00
Masayuki Nakano
d3b4a4d6ac Bug 1864654 - Make PresShell flush pending synthetic mousemove before dispatching mousedown or mouseup r=smaug,dom-core,extension-reviewers,edgar,robwu
`inert-iframe-hittest.html` expects that `:hover` state should be updated
immediately after a pointer down.  The state is updated by
`EventStateManager::NotifyMouseOver` [1] when we received a real or synthetic
`eMouseMove`.  Therefore, the hover state may have not set yet if no refresh
occurs between the pointer down and checking the result.

Additionally, some WPT for UI Events and Pointer Events expect that `mouseover`
or `mouseout` should be fired before `mouseup`/`pointerup` if a preceding
`mousedown` or `pointerdown` event listener removes the target.  So, this
patch may fix intermittent failures of them if there are.

Therefore, we should flush pending synthetic `mousemove` event for keeping the
event order as same as they happen.  However, simply flushing it causes
unexpected pointer capture state change because
`PointerEventHandler::ProcessPointerCaptureForMouse` handles synthetic
`mousemove` but it should not cause pointer boundary events at the moment (the
pointer boundary events should be fired when the pointer is actually moved, note
that this is different rule from the rules of mouse boundary events).
Therefore, this patch changes
`PointerEventHandler::ShouldGeneratePointerEventFromMouse`.

However, this blocks `lostpointercatpure` event when the capturing content has
already been removed from the DOM tree.  The path is,
`EventHandler::HandleEventWithPointerCapturingContentWithoutItsFrame` stops
dispatching `pointerup` nor `pointercancel` in this case, but
`EventStateManager::PostHandleEvent` is the only handler of implicit pointer
capture release.  Therefore, we need to make it dispatch lostpointercatpure`
event if the canceling event caused `ePointerUp` or `ePointerCancel`.

Finally, this patch fixes a bug of `browser_ext_browserAction_popup_preload.js`.
It tests the pre-loading which starts when `mouseover` before `mousedown` on a
widget.  However, it does not correctly emulate the user input.
* Synthesizing only `mouseover` does not update the internal pointer info and
does not cause dispatching related events.
* Synthesizing `mousedown` without `mousemove` cause `mouseover` before
`mouseup` because at dispatching `mousedown`, `PresShell` stores the cursor [2]
and the mouse boundary events will be dispatched before `mouseup`.

`ext-browserAction.js` assumes the events are fired as this order,
`mouseover` -> `mousedown` -> `mouseup`, but this would not work if the
preceding `mousemove` of `mousedown` is not correctly fired.  I'm not sure
whether `mousemove` is always fired before `mousedown` on any environments,
but it should be rare and it affects only this kind of tricky code.  For now,
fixing this in the test side must be enough.

1. https://searchfox.org/mozilla-central/rev/9a5bf21ea2dd04946734658f67f83f62ca76b0fa/dom/events/EventStateManager.cpp#4874,4913-4914
2. https://searchfox.org/mozilla-central/rev/9a5bf21ea2dd04946734658f67f83f62ca76b0fa/layout/base/PresShell.cpp#6756

Differential Revision: https://phabricator.services.mozilla.com/D193870
2024-01-24 11:07:34 +00:00
Frédéric Wang
56a3e0d495 Bug 1765615 - Handle most changes to CSS contain and content-visibility without needing to reconstruct frames. r=layout-reviewers,emilio
Right now, we reconstruct frames in response to a change in the CSS
`contain` property or `content-visibility`. This patch tries to optimize
this a bit:

1. Updates involving style containment change continue to force a
  reconstruction, due to the need to handle counters/quotes.

2. Updates involving paint/layout containment change only force a
   reconstruction if it's needed to handle absolutely/fixed
   positioned descendants or floats (for this one, see also bug 1874826).

3. Other containment changes will only force a reflow and repaint.

Per the CSS contain spec, layout, style and paint containments are
enabled for `content-visibility: hidden` and `content-visibility: auto`.
As a consequence, changing `content-visibility` between `hidden` and
`auto` values no longer requires reconstruction. Changing between these
values and `visible` may need a reconstruction although authors may
generally avoid that in practice by forcing `style` containment.

Differential Revision: https://phabricator.services.mozilla.com/D197043
2024-01-17 08:22:48 +00:00
Emilio Cobos Álvarez
9311a56677 Bug 1872154 - Move paint unsuppression and similar code to DidDoReflow. r=dholbert
This can run script, and as such shouldn't run from a container query
update. Instead, let's move the check to DidDoReflow, which deals with
that appropriately already.

I don't know of an easy / reliable way to reproduce this, since paint
unsuppression is very timing-dependent.

While at it, remove the long reflow telemetry check for
GetRootElement(). This comes from a time where we used the root
element's namespace to determine which telemetry counter to use.

Differential Revision: https://phabricator.services.mozilla.com/D197477
2024-01-10 09:56:34 +00:00
Dan Robertson
d4f4491766 Bug 1858984 - Fix ComputeNeedToScroll with large line sizes. r=emilio,devtools-reviewers,ochameau
When the line scroll amount is larger than that of the rectangle to
scroll into view, do not use the line size to determine if we should
scroll.

Depends on D192869

Differential Revision: https://phabricator.services.mozilla.com/D192870
2024-01-03 19:12:22 +00:00
Emilio Cobos Álvarez
35c465dca0 Bug 1872399 - Clean-up -moz-window-shadow set-up. r=dholbert
-moz-window-shadow is a chrome-only property (not exposed to the web),
and chrome stylesheets only use the none value to disable the default
behavior.

Split the style property (default/none) from the actual widget behavior.
This is useful because I want to add a distinction between
natively-styled menupopups and other panels in the following commit.

While at it rename default to "auto" which is a more common name in CSS
for something like this.

We have no use case for removing the shadow of a top-level window, so
remove it to simplify the code.

Differential Revision: https://phabricator.services.mozilla.com/D197454
2023-12-31 21:53:32 +00:00
Masayuki Nakano
fe9fef936b Bug 1816581 - part 1: Make CaretAssociationHint an enum class r=emilio
For forward-decl-able.

Differential Revision: https://phabricator.services.mozilla.com/D197283
2023-12-27 04:42:09 +00:00
Emilio Cobos Álvarez
644a6bc997 Bug 1870512 - Simplify ShouldAttachToTopLevel(), and revert patch for bug 1869891. r=tnikkel
Definitely not for 122, but I think we should try this. Note that this
doesn't affect nsMenuPopupFrames, which create the widget on their own
here:

  https://searchfox.org/mozilla-central/rev/07937a5d00e0f65611d8b3bd2992c7603aeaa70d/layout/xul/nsMenuPopupFrame.cpp#266

It only affects windows with popup=yes, which right now are only the
nsXULAlerts windows.

I'll look into trying to unify the macOS set-up, which right now
unconditionally uses this (presumably to get an nsChildView for each
top-level nsCocoaWindow). Maybe that can be handled internally by the
widget layer, we'll see.

Differential Revision: https://phabricator.services.mozilla.com/D196664
2023-12-20 18:32:38 +00:00
Norisz Fay
12d5bd6705 Backed out 3 changesets (bug 1870512) as part of previous backout since issues are still present CLOSED TREE
Backed out changeset c909d207f316 (bug 1870512)
Backed out changeset cf0bda3b4253 (bug 1870512)
Backed out changeset 39cc9d155c12 (bug 1870512)
2023-12-18 23:37:42 +02:00
Emilio Cobos Álvarez
33c17b43f6 Bug 1870512 - Simplify ShouldAttachToTopLevel(), and revert patch for bug 1869891. r=tnikkel
Definitely not for 122, but I think we should try this. Note that this
doesn't affect nsMenuPopupFrames, which create the widget on their own
here:

  https://searchfox.org/mozilla-central/rev/07937a5d00e0f65611d8b3bd2992c7603aeaa70d/layout/xul/nsMenuPopupFrame.cpp#266

It only affects windows with popup=yes, which right now are only the
nsXULAlerts windows.

I'll look into trying to unify the macOS set-up, which right now
unconditionally uses this (presumably to get an nsChildView for each
top-level nsCocoaWindow). Maybe that can be handled internally by the
widget layer, we'll see.

Differential Revision: https://phabricator.services.mozilla.com/D196664
2023-12-18 17:56:41 +00:00
Emilio Cobos Álvarez
894a09c9c2 Bug 1869891 - Hack around for 122. r=tnikkel
Co-authored-by: Vsevolod Buzinov <vsevolod.buzinov@4dpipeline.com>

Differential Revision: https://phabricator.services.mozilla.com/D196669
2023-12-17 16:05:17 +00:00
Masayuki Nakano
90b77204fb Bug 1868283 - part 3: Make PresShell::HandleEvent ignore eMouseExitFromWidget and eMouseEnterIntoWidget events which are synthesized in the parent process accidentally r=smaug
Currently, the method ignores synthesized `eMouseMove` events coming from the
parent process if
* the last mouse location was updated by a synthesized mouse event for tests
* the event comes from parent process
* the event is not marked as synthesized for tests

However, `eMouseExitFromWidget` is also handled as a synthesized `eMouseMove` [1].
Therefore, the method needs to ignore this event too in the same conditions.

Additionally, `eMouseEnterIntoWidget` may cause updating the `:hover` state
under the event position which may be different from the last cursor position
in the content process [2].  Therefore, the method needs to ignore this too.

On the other hand, if the event is caused by a test API synthesizing mouse
events, e.g., when `test.events.async.enabled` is set to `true`, the running
test must expect the events.  Therefore, these events need to be marked as
synthesized for tests correctly.  Therefore, this patch updates the
initializers of the events.

1. https://searchfox.org/mozilla-central/rev/78a2c17cc80680a5a82446e4ce7c45a73b935383/dom/events/EventStateManager.cpp#773,794-796,800-801
2. https://searchfox.org/mozilla-central/rev/78a2c17cc80680a5a82446e4ce7c45a73b935383/dom/events/EventStateManager.cpp#4063,4068

Differential Revision: https://phabricator.services.mozilla.com/D195638
2023-12-13 07:13:04 +00:00
Magnus Melin
aac78f7939 Bug 1869195 - Fix crash in [@ mozilla::PresShell::GetRootScrollFrame]. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D196021
2023-12-11 10:45:19 +00:00
Cathie Chen
e88b28e248 Bug 1866566 - If there is change in over-all relevancy, update HiddenByContentVisibility for animations, r=emilio,hiro
Differential Revision: https://phabricator.services.mozilla.com/D195009
2023-12-06 13:36:59 +00:00
Cosmin Sabou
5c95548994 Backed out changeset d9e8e468a2f2 (bug 1866566) for wpt failures on content-visibility-animation-with-scroll-timeline-in-hidden-subtree.html. 2023-12-05 18:59:19 +02:00
Cathie Chen
4395752c23 Bug 1866566 - If there is change in over-all relevancy, update HiddenByContentVisibility for animations, r=emilio,hiro
Differential Revision: https://phabricator.services.mozilla.com/D195009
2023-12-05 15:57:51 +00:00
Vsevolod Buzinov
637c5339ea Bug 1865494: Implement see-through video player mode r=emilio,mstange,desktop-theme-reviewers,pip-reviewers,mhowell
Implement experimental transparent-on-hover behavior for the
picture-in-picture video player. This makes the popup player less of
a nuisance on smaller displays.

Tested on macOS, but should also work on Windows with small tweaks.

The behavior is hidden behind a pref:
media.videocontrols.picture-in-picture.seethrough-mode.enabled

Differential Revision: https://phabricator.services.mozilla.com/D193993
2023-11-30 18:33:41 +00:00
Emilio Cobos Álvarez
d407a74502 Bug 1866738 - Make initial about:blank docs always transparent, even in content docshells. r=jwatt
This implements the proposed fix to
https://github.com/w3c/csswg-drafts/issues/9624, and adds a tentative
test for it.

Differential Revision: https://phabricator.services.mozilla.com/D194751
2023-11-29 12:09:46 +00:00
Frederic Wang
850e093dc8 Bug 1867090 - Don't deliver resize loop error notification for internal Last Remembered Size observer. r=emilio
This fixes regression from bug 1866894.
Also revert some code used to worked these undesired errors.

Differential Revision: https://phabricator.services.mozilla.com/D194876
2023-11-29 09:06:49 +00:00
Norisz Fay
1488e83e44 Backed out 2 changesets (bug 1858984) for causing dt failures on browser_markup_dragdrop_reorder.js
Backed out changeset 03881cb508be (bug 1858984)
Backed out changeset 0aad09d9cd3f (bug 1858984)
2023-11-29 01:04:25 +02:00
Dan Robertson
e698949a0b Bug 1858984 - Fix ComputeNeedToScroll with large line sizes. r=emilio
When the line scroll amount is larger than that of the rectangle to
scroll into view, do not use the line size to determine if we should
scroll.

Differential Revision: https://phabricator.services.mozilla.com/D192870
2023-11-28 18:27:33 +00:00
Frederic Wang
7484499e28 Bug 1865994 - Do not force resize observer update after PresShell::DidDoReflow(). r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D194478
2023-11-27 18:01:23 +00:00
Frederic Wang
e7e16e453b Bug 1807253 - unreliable timing for content-visibility:auto, r=emilio
Rewrite implementation of content-visibility: auto as defined in
https://github.com/w3c/csswg-drafts/issues/8542

Differential Revision: https://phabricator.services.mozilla.com/D170394
2023-11-27 08:26:46 +00:00
Emilio Cobos Álvarez
5730ee0ca5 Bug 1364813 - Remove IsFrameOfType, use non-virtual checks. r=jwatt
Extend the per-frame-class bit we have to devirtualize IsLeaf to also
devirtualize IsFrameOfType. That is, move this data to FrameClasses.py.

This was done by going through all the frame classes, trying to preserve
behavior.

The only quirky thing is that I had to add two more trivial frame
classes, `nsAudioFrame` for audio elements, and
`nsFloatingFirstLetterFrame`. That's because these frame classes were
returning different answers at runtime, but they do this only on
conditions that trigger frame reconstruction (floating, and being an
audio element, respectively).

Differential Revision: https://phabricator.services.mozilla.com/D194703
2023-11-26 22:17:28 +00:00
Jonathan Watt
15c1a58822 Bug 1866011 p2. Rename nsIDocShell.contentViewer. r=emilio,credential-management-reviewers,devtools-reviewers,sgalich
Differential Revision: https://phabricator.services.mozilla.com/D194370
2023-11-24 09:10:52 +00:00
Jonathan Watt
90bd3e3cec Bug 1865995 p5. Rename GetContentViewerSize to match nsIDocumentViewer's new name. r=emilio,geckoview-reviewers,owlish
Includes the methods on:
 - nsIDOMWindowUtils
 - nsLayoutUtils
 - MVMContext

Differential Revision: https://phabricator.services.mozilla.com/D194339
2023-11-23 21:35:20 +00:00
Natalia Csoregi
17befdb121 Backed out changeset 20a5c1f3b35e (bug 1807253) for causing failures on content-visibility-continuations-crash.html. CLOSED TREE 2023-11-22 16:12:27 +02:00
Frederic Wang
cb0618baf3 Bug 1807253 - unreliable timing for content-visibility:auto, r=emilio
Rewrite implementation of content-visibility: auto as defined in
https://github.com/w3c/csswg-drafts/issues/8542

Differential Revision: https://phabricator.services.mozilla.com/D170394
2023-11-22 13:00:36 +00:00
Emilio Cobos Álvarez
805a8127b0 Bug 1865868 - Make top-level initial about:blank document transparent. r=jwatt
This fixes the flash mentioned in bug 1858405 comment 6.

I don't think this is realistically testable tho, since this is only for
non-content-accessible, temporary documents (if you load about:blank
directly that's not an initial doc).

Differential Revision: https://phabricator.services.mozilla.com/D194246
2023-11-22 00:38:24 +00:00
Jonathan Watt
c96a66c3de Bug 1865480. Rename nsIContentViewer to nsIDocumentViewer. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D193987
2023-11-21 12:45:59 +00:00
Cathie Chen
1a3d0bd724 Bug 1668136 - Set visible the content relevancy of an element with content-visibility:auto if its descendant is called scrollIntoView, r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D186943
2023-11-03 15:37:29 +00:00
Sean Feng
539e32202b Bug 1722322 - Implement LargestContentfulPaint r=emilio
Spec: https://w3c.github.io/largest-contentful-paint

Differential Revision: https://phabricator.services.mozilla.com/D151079
2023-11-02 20:53:36 +00:00
Sandor Molnar
a4163792c6 Backed out 7 changesets (bug 1722322) for causing bp-nu bustages
Backed out changeset 0ebd32e273b8 (bug 1722322)
Backed out changeset 7a75717f127c (bug 1722322)
Backed out changeset c2a6440a83d7 (bug 1722322)
Backed out changeset 9955756855bd (bug 1722322)
Backed out changeset 37fccb407777 (bug 1722322)
Backed out changeset f52b1f28f753 (bug 1722322)
Backed out changeset 0121c8cf5d2f (bug 1722322)
2023-11-02 21:27:24 +02:00
Sean Feng
611093989e Bug 1722322 - Implement LargestContentfulPaint r=emilio
Spec: https://w3c.github.io/largest-contentful-paint

Differential Revision: https://phabricator.services.mozilla.com/D151079
2023-11-02 17:04:47 +00:00
Norisz Fay
37cbcfe9be Backed out changeset 6e5782df6da1 (bug 1668136) for causing wpt failures on content-visibility-vs-scrollIntoView-003.html CLOSED TREE 2023-11-01 18:02:54 +02:00
Cathie Chen
eeb53397a8 Bug 1668136 - Set visible the content relevancy of an element with content-visibility:auto if its descendant is called scrollIntoView, r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D186943
2023-11-01 12:01:51 +00:00
Natalia Csoregi
f62ca31731 Backed out changeset aa66fda02aac (bug 1668136) for causing failures on content-visibility. CLOSED TREE 2023-10-31 06:49:20 +02:00
Cathie Chen
5046f7ee73 Bug 1668136 - Set visible the content relevancy of an element with content-visibility:auto if its descendant is called scrollIntoView, r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D186943
2023-10-31 01:38:16 +00:00
Adam Brouwers-Harries
a26eafe5c3 Bug 1421651 - Remove obseleted timeline and TimelineMarker code r=canaltinova,webidl,devtools-reviewers,saschanaz,smaug,ochameau
This patch removes the old docshell timeline and timeline markers codebase and replaces them with equivalent Gecko profiler marker. This patch also fixes Bug 1834143, which is a subset of 1421651.

Differential Revision: https://phabricator.services.mozilla.com/D184217
2023-10-24 15:18:12 +00:00
Narcis Beleuzu
948c7279ee Backed out changeset 714aaf6484fb (bug 1421651) for causing Bug 1860719. CLOSED TREE 2023-10-24 17:31:02 +03:00
Adam Brouwers-Harries
4cdf967b4e Bug 1421651 - Remove obseleted timeline and TimelineMarker code r=canaltinova,webidl,devtools-reviewers,saschanaz,smaug,ochameau
This patch removes the old docshell timeline and timeline markers codebase and replaces them with equivalent Gecko profiler marker. This patch also fixes Bug 1834143, which is a subset of 1421651.

Differential Revision: https://phabricator.services.mozilla.com/D184217
2023-10-23 13:55:50 +00:00
Sylvestre Ledru
d0f6c7fc66 Bug 1856795 - Remove redundant member init r=emilio
Done with:
./mach static-analysis check --checks="-*, readability-redundant-member-init" --fix .

https://clang.llvm.org/extra/clang-tidy/checks/readability/redundant-member-init.html

Differential Revision: https://phabricator.services.mozilla.com/D190002
2023-10-15 15:29:02 +00:00
Cristina Horotan
6a90f5eded Backed out 2 changesets (bug 1856795) for causing build bustage at BasicEvents.h CLOSED TREE
Backed out changeset 1d98b028923a (bug 1856795)
Backed out changeset eae2ac93e17c (bug 1856795)
2023-10-14 21:42:14 +03:00
Sylvestre Ledru
cc8a0ee742 Bug 1856795 - Remove redundant member init r=emilio
Done with:
./mach static-analysis check --checks="-*, readability-redundant-member-init" --fix .

https://clang.llvm.org/extra/clang-tidy/checks/readability/redundant-member-init.html

Differential Revision: https://phabricator.services.mozilla.com/D190002
2023-10-14 17:34:26 +00:00
Emilio Cobos Álvarez
56346e9adf Bug 1857915 - Remove about:PreferenceStyleSheet. r=morgan,devtools-reviewers,nchevobbe
These days, after bug 1853323, about:PreferenceStyleSheet is basically
just an empty sheet for most users. For the ones that isn't, it's either
slightly or completely broken (see below).

If we were to implement this today, we'd do it with privileged env()
variables or media queries, and add a bunch of tests for different
combinations, but I don't think it's worth the effort:

 * There's no UI for any of these prefs.

 * There are no tests for any of these prefs.

 * browser.display.focus_ring_or_anything is not great, it's better
   replaced by browser.display.show_focus_rings, which actually makes
   the :focus-visible pseudo-class work. Otherwise the native controls
   may show no rings even though this pref is set.

 * for browser.display.focus_ring_style = 0, the color used
   (-moz-mac-focusring) is not implemented in any non-macOS platform.

 * The ::-moz-focus-inner rules are completely useless nowadays, because
   ::-moz-focus-inner only works on the windows native theme (which
   isn't used on content).

 * The focus colors are not color-scheme aware.

So given those, and that if you want the specific current behavior,
these are trivially implementable as a web extension (by using a user
stylesheet), I think we should just remove this code altogether.

Differential Revision: https://phabricator.services.mozilla.com/D190464
2023-10-11 17:47:50 +00:00
Emilio Cobos Álvarez
25c0d10932 Bug 1624819 - Remove TaskCategory and other quantum dom remnants. r=smaug,media-playback-reviewers,credential-management-reviewers,cookie-reviewers,places-reviewers,win-reviewers,valentin,mhowell,sgalich,alwu
Sorry this is not a particularly easy patch to review. But it should be
mostly straight-forward.

I kept Document::Dispatch mostly for convenience, but could be
cleaned-up too / changed by SchedulerGroup::Dispatch. Similarly maybe
that can just be NS_DispatchToMainThread if we add an NS_IsMainThread
check there or something (to preserve shutdown semantics).

Differential Revision: https://phabricator.services.mozilla.com/D190450
2023-10-10 08:51:12 +00:00
Masayuki Nakano
b8f3f296ed Bug 1844723 - Make CreateMouseOrPointerWidgetEvent() set mButton to "not pressed" value and compute mButtons if the source event has not been dispatched yet r=edgar,dom-core
`CreateMouseOrPointerWidgetEvent()` is designed to create `mouseenter`,
`mouseover`, `mouseout`, `mouseleave`, `pointerenter`, `pointerover`,
`pointerout` and `pointerleave` from a source event.

They are not button state change events, but the source event may be so.

According to the WPTs ([1], [2]) and the fact that the other browsers pass the
tests, the button state of pointer events of synthesizing events should be
synchronized with what the web apps notified (i.e., previous state of the
source event) if and only if the input source supports hover state and the
source event which changes a button state has not been dispatched into the DOM
yet.

1. https://searchfox.org/mozilla-central/rev/08d53deb2cf587e68d1825082c955e8a1926be73/testing/web-platform/tests/pointerevents/pointerevent_attributes_hoverable_pointers.html#44,51,60,63
2. https://searchfox.org/mozilla-central/rev/08d53deb2cf587e68d1825082c955e8a1926be73/testing/web-platform/tests/pointerevents/pointerevent_attributes_nohover_pointers.html#17,45,47,51

Differential Revision: https://phabricator.services.mozilla.com/D187644
2023-10-10 07:33:05 +00:00
Emilio Cobos Álvarez
432004fe4e Bug 1857073 - Remove ResizeObserverController. r=surkov,smaug
These days it's just a very thin wrapper over an nsTArray of
ResizeObservers. We also schedule notifications for resize observations
for the whole BrowsingContext tree at once, so there's no point on
individually keep track of them.

Differential Revision: https://phabricator.services.mozilla.com/D190113
2023-10-05 12:11:56 +00:00
Jan Varga
c458754592 Bug 1855134 - Move existing MOZ_TRY macros to a dedicated header file; r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D189226
2023-09-28 20:46:07 +00:00
Dan Robertson
baa1ce9de8 Bug 1816473 - Fix event reference point handling in accessible caret check. r=edgar
If an event will not be handled by accessible caret, do not use the
event reference point that may have been modified by event retargetting.
Restore the original reference point.

Depends on D185327

Differential Revision: https://phabricator.services.mozilla.com/D187896
2023-09-25 19:13:08 +00:00
Gregory Pappas
ce9f61c539 Bug 1854546 - Remove dom.focus.fixup pref r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D188929
2023-09-22 16:06:27 +00:00
Gregory Pappas
321f6d0ea4 Bug 1853832 - Remove dom.mouseevent.click.hack.use_legacy_non-primary_dispatch pref r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D188638
2023-09-20 08:38:04 +00:00
Emilio Cobos Álvarez
9dc286ae62 Bug 1847929 - Remove OOPIF activity grace period. r=smaug
This massive hack shouldn't be needed after the previous patch, and
throttling of in-process and out-of-process should be consistent now.

Differential Revision: https://phabricator.services.mozilla.com/D185809
2023-09-06 11:15:45 +00:00
Sean Feng
30faa0076d Bug 1830820 - Add tests for user input delay handling r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D186053
2023-09-05 18:28:53 +00:00
Sean Feng
6721383752 Bug 1830820 - Introduce some delays to user input handling r=smaug
In some edge cases, we may start handling user input events that
are not supposed to be handled by the current document.

This patch introduces some delay to handle user input events.

Differential Revision: https://phabricator.services.mozilla.com/D180976
2023-09-05 18:28:52 +00:00
Iulian Moraru
1007c47c48 Backed out 2 changesets (bug 1830820) for causing marionette failures on test_actions_wheel.py. CLOSED TREE
Backed out changeset e930161a5935 (bug 1830820)
Backed out changeset 4df110e417d4 (bug 1830820)
2023-08-31 20:55:06 +03:00
Sean Feng
d7592d5abe Bug 1830820 - Add tests for user input delay handling r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D186053
2023-08-31 15:56:47 +00:00
Sean Feng
cd954eaa9f Bug 1830820 - Introduce some delays to user input handling r=smaug
In some edge cases, we may start handling user input events that
are not supposed to be handled by the current document.

This patch introduces some delay to handle user input events.

Differential Revision: https://phabricator.services.mozilla.com/D180976
2023-08-31 15:56:47 +00:00
Markus Stange
d89c20090c Bug 1843484 - Use EventTarget* instead of nsISupports* for the event target parameter of the EventDispatcher::Dispatch methods. r=smaug
This saves a few QueryInterface calls on the hot path.

Differential Revision: https://phabricator.services.mozilla.com/D186977
2023-08-28 23:38:43 +00:00
Ziran Sun
9dac459535 Bug 1849689 - Initial steps on handling Esc key for popover. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D186643
2023-08-28 07:47:24 +00:00
Narcis Beleuzu
0c70f2a736 Backed out 2 changesets (bug 1830820) for reftest failure on inline-block-slice-5.html . CLOSED TREE
Backed out changeset 941c44881781 (bug 1830820)
Backed out changeset da493ba4c9a6 (bug 1830820)
2023-08-15 18:55:44 +03:00
Sean Feng
c8985f4b39 Bug 1830820 - Add tests for user input delay handling r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D186053
2023-08-15 13:55:57 +00:00
Sean Feng
65383b4b4e Bug 1830820 - Introduce some delays to user input handling r=smaug
In some edge cases, we may start handling user input events that
are not supposed to be handled by the current document.

This patch introduces some delay to handle user input events.

Differential Revision: https://phabricator.services.mozilla.com/D180976
2023-08-15 13:55:57 +00:00
Emilio Cobos Álvarez
dbbf7dc0fb Bug 1835864 - Make printing / paged mode deal with multiple canvas backgrounds properly. r=dholbert
The subdocument call when there's no root frame is silly, because we
won't find a canvas frame and we'll end up with transparent.

This needs to tweak the canvas frame construction code to make canvas
anon content show up on the "top" canvas, not on the page content
canvas.

This can be simplified now, because the reason we had to build canvas
anon content before processing kids of the root frame (bug 1558352) no
longer applies since I made popups regular out-of-flow elements
(bug 1799343).

Differential Revision: https://phabricator.services.mozilla.com/D179461
2023-08-10 12:59:00 +00:00
Masayuki Nakano
e4d8451468 Bug 1845904 - Make PresShell::EventHandler::HandleEventWithCurrentEventInfo stop flushing pending notifications if a query content event does not require that r=emilio
We've already known that `WidgetQueryContentEvent` is dispatched at initializing
a popup menu on macOS (bug 1530188).  Therefore, I made the dispatcher under
`widget/cocoa` set `WidgetQueryContentEvent::mNeedLayoutFlush` to `false` to
avoid to flush pending things in `ContentEventHandler`, but
`PresShell::EventHandler` does it.

Differential Revision: https://phabricator.services.mozilla.com/D185264
2023-08-07 05:24:20 +00:00
Emilio Cobos Álvarez
9aa60b822a Bug 1844241 - Remove now-dead graphics glass code. r=tnikkel,devtools-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D183942
2023-07-19 12:44:34 +00:00
Emilio Cobos Álvarez
bd1b363ff9 Bug 1824886 - Rewrite AnonymousContent to use a shadow tree. r=smaug,TYLin,sfoster,devtools-reviewers,nchevobbe
Subtle things:

 * We now have shadow trees in NAC, inception! Only a couple lines of
   code in the style system had to be changed to match :host rules and
   so properly.

 * Had to make highlighters.css contentaccessible, because otherwise we
   can't load it from the shadow tree. I don't think it's a big deal.

 * I removed some of the code from highlighters.css that claimed that
   stuff inherited from the html element. That's just no longer true.

 * Had to switch from `setAttribute("style", ...)` to `.style = ...;`.
   This is needed because CSSOM from chrome code bypasses CSP (as
   AnonymousContent did), but setAttribute() doesn't, see bug 1424474.

Differential Revision: https://phabricator.services.mozilla.com/D173998
2023-07-09 11:34:05 +00:00
Gregory Pappas
ada05ac4fa Bug 1759303 - Allow disabling Shift+Right Click force-opening the context menu r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D183075
2023-07-09 02:58:11 +00:00
Stanca Serban
15c8455338 Backed out changeset 1c835137f532 (bug 1824886) for causing multiple failures. CLOSED TREE 2023-07-06 02:11:59 +03:00
Emilio Cobos Álvarez
3338831b84 Bug 1824886 - Rewrite AnonymousContent to use a shadow tree. r=smaug,TYLin,sfoster,devtools-reviewers,nchevobbe
Subtle things:

 * We now have shadow trees in NAC, inception! Only a couple lines of
   code in the style system had to be changed to match :host rules and
   so properly.

 * Had to make highlighters.css contentaccessible, because otherwise we
   can't load it from the shadow tree. I don't think it's a big deal.

 * I removed some of the code from highlighters.css that claimed that
   stuff inherited from the html element. That's just no longer true.

 * Had to switch from `setAttribute("style", ...)` to `.style = ...;`.
   This is needed because CSSOM from chrome code bypasses CSP (as
   AnonymousContent did), but setAttribute() doesn't, see bug 1424474.

Differential Revision: https://phabricator.services.mozilla.com/D173998
2023-07-05 21:59:44 +00:00
Cosmin Sabou
fb92d5f42f Backed out 2 changesets (bug 1824886) for causing failures on browser_all_files_referenced.js. CLOSED TREE
Backed out changeset 650ef77d1c4d (bug 1824886)
Backed out changeset 1c835137f532 (bug 1824886)
2023-07-06 00:42:53 +03:00
Emilio Cobos Álvarez
454c0b932e Bug 1824886 - Rewrite AnonymousContent to use a shadow tree. r=smaug,TYLin,sfoster,devtools-reviewers,nchevobbe
Subtle things:

 * We now have shadow trees in NAC, inception! Only a couple lines of
   code in the style system had to be changed to match :host rules and
   so properly.

 * Had to make highlighters.css contentaccessible, because otherwise we
   can't load it from the shadow tree. I don't think it's a big deal.

 * I removed some of the code from highlighters.css that claimed that
   stuff inherited from the html element. That's just no longer true.

 * Had to switch from `setAttribute("style", ...)` to `.style = ...;`.
   This is needed because CSSOM from chrome code bypasses CSP (as
   AnonymousContent did), but setAttribute() doesn't, see bug 1424474.

Differential Revision: https://phabricator.services.mozilla.com/D173998
2023-07-05 18:21:31 +00:00
Peter Van der Beken
b52a207bb0 Bug 1522052 - remove nsIDOMChromeWindow. r=dom-core,webdriver-reviewers,devtools-reviewers,whimboo,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D34310
2023-06-23 14:21:05 +00:00
Tom Schuster
cac1e671bf Bug 1838415 - Introduce RFPTarget::WidgetEvents. r=tjr
Differential Revision: https://phabricator.services.mozilla.com/D180951
2023-06-21 07:01:22 +00:00
Neil Deakin
18f5e1220a Bug 1776339, add a browsing context field that syncs the isUnderHiddenEmbedderElement state, r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D168440
2023-05-31 19:46:49 +00:00
Tom Schuster
b4c6e62b3c Bug 1834737 - Make RFPTarget parameter of Document::ShouldResistFingerprinting non-optional. r=tjr
Differential Revision: https://phabricator.services.mozilla.com/D178925
2023-05-31 09:46:54 +00:00
Emilio Cobos Álvarez
67b6c8dad6 Bug 1833733 - Properly detect page sequence background from FindEffectiveBackgroundColor. r=dholbert
And specify it since we don't look at gradients.

Differential Revision: https://phabricator.services.mozilla.com/D178476
2023-05-30 11:25:36 +00:00
Cosmin Sabou
b3f3b7cab8 Backed out changeset 12975d519459 (bug 1833733) for causing pagination reftest failures. CLOSED TREE 2023-05-19 17:19:56 +03:00
Emilio Cobos Álvarez
23020ca032 Bug 1833733 - Properly detect page sequence background from FindEffectiveBackgroundColor. r=dholbert
And specify it since we don't look at gradients.

Differential Revision: https://phabricator.services.mozilla.com/D178476
2023-05-19 12:42:22 +00:00
Hiroyuki Ikezoe
2b70168145 Bug 1764606 - Expand nsDisplaySolidColor's bounds including the dynamic toolbar area. r=botond,tnikkel,geckoview-reviewers,owlish
Differential Revision: https://phabricator.services.mozilla.com/D168913
2023-05-11 21:17:30 +00:00
Emilio Cobos Álvarez
3a99b7feb9 Bug 1831136 - Plumb android text scale via nsLookAndFeel. r=geckoview-reviewers,dholbert,owlish
That's how we do it for all other platforms. Do this rather than via a
custom mostly-untested pref, which allows us to simplify text zoom
handling.

Differential Revision: https://phabricator.services.mozilla.com/D177062
2023-05-11 19:01:19 +00:00
Emilio Cobos Álvarez
99eea56b5d Bug 1829137 - When sizing to content, ceil to CSS pixels. r=dholbert
Much like in bug 1620575. The front-end works with sizing in int CSS
pixels, so size to that so that there isn't a mismatch between our size
and the window size.

Differential Revision: https://phabricator.services.mozilla.com/D176359
2023-05-10 22:56:18 +00:00
Emilio Cobos Álvarez
8b5b7ad998 Bug 1827856 - Remove nativeAnonymousChildList observers. r=smaug,credential-management-reviewers,devtools-reviewers,sgalich,nchevobbe
You let me know if this seems appealing to you :)

Differential Revision: https://phabricator.services.mozilla.com/D175382
2023-04-18 14:58:34 +00:00
Cristian Tuns
f65f34399a Backed out 2 changesets (bug 1753565) for causing bc failures in browser_proton_moreTools_panel.js CLOSED TREE
Backed out changeset 817b0cf1e4e0 (bug 1753565)
Backed out changeset 947534ff1319 (bug 1753565)
2023-04-18 02:03:20 -04:00
Dan Robertson
e4776501d3 Bug 1753565 - Disable smooth scrolls if prefers-reduced-motion. r=botond
If the user has the prefers-reduced-motion system setting enabled, do
not enable smooth scrolls.

Differential Revision: https://phabricator.services.mozilla.com/D172446
2023-04-18 04:11:10 +00:00
Emilio Cobos Álvarez
2d0e69f4a1 Bug 1824957 - Remove a bunch of now completely dead XUL layout code. r=layout-reviewers,desktop-theme-reviewers,devtools-reviewers,dao,TYLin
And some related tests.

A bunch of -moz-box* properties are web exposed, so I'll file a
follow-up for hiding them.

Differential Revision: https://phabricator.services.mozilla.com/D173819
2023-03-29 21:23:55 +00:00
Jonathan Kew
5de5902b95 Bug 1822561 - Distinguish profiler markers for interruptible vs sync reflows. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D173636
2023-03-26 18:14:05 +00:00
Emilio Cobos Álvarez
cb2a32d8af Bug 1823455 - Merge ScrollFrameHelper and nsHTMLScrollFrame. r=layout-reviewers,TYLin
Now that we've removed nsXULScrollFrame, ScrollFrameHelper can be
subsumed under nsHTMLScrollFrame.

I want to do this before making scrollbars non-XUL.

Renaming to mozilla::ScrollFrame is left for a follow-up bug.

Differential Revision: https://phabricator.services.mozilla.com/D173063
2023-03-22 13:06:40 +00:00
Emilio Cobos Álvarez
5dfcee19a5 Bug 1600542 - Remove a few other no longer reachable XUL box special-cases. r=TYLin
The only XUL frames that remain are either scrollbars, or leafs. These are uses
that I'm pretty sure are no longer needed. There are a few others that will go
in the future.

Depends on D172874

Differential Revision: https://phabricator.services.mozilla.com/D172875
2023-03-20 23:56:03 +00:00