231 Commits
Author SHA1 Message Date
Emilio Cobos Álvarez 1ddad57128 Bug 2034055 - Clean up NodeList / HTMLCollection set-up. r=smaug
Make them concrete classes rather than interfaces, and make the
inheritance chain simpler.

Differential Revision: https://phabricator.services.mozilla.com/D296484
2026-04-28 07:38:27 +00:00
Silaghi ce61f876cc Revert "Bug 2034055 - Clean up NodeList / HTMLCollection set-up. r=smaug" for causing wpt failures at BaseContentList
This reverts commit cde3e5607b.
2026-04-28 03:43:46 +00:00
Emilio Cobos Álvarez cde3e5607b Bug 2034055 - Clean up NodeList / HTMLCollection set-up. r=smaug
Make them concrete classes rather than interfaces, and make the
inheritance chain simpler.

Differential Revision: https://phabricator.services.mozilla.com/D296484
2026-04-28 00:24:11 +00:00
Edgar Chen 64886fb731 Bug 2024067 - Make nsIDragService.isMockService infallible; r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D288292
2026-03-19 06:19:06 +00:00
Sylvestre Ledru 4f6b8b516d Bug 2023419 - Remove Emacs/Vim modelines from widget/ r=emilio
replaced by .editorconfig
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D287877
2026-03-16 17:22:02 +00:00
Norisz Fay a86d829321 Revert "Bug 2012637 - part 9: Add a Firefox Source Docs documentation page for TreeKind and notable issues r=smaug,dom-core" as requested by dev
This reverts commit 88008cd8ca.

Revert "Bug 2012637 - part 8: Make `nsContentUtils::ComparePoints` handle `TreeKind::Flat` and `TreeKind::FlatForSelection` correctly r=smaug,dom-core"

This reverts commit 73e6f6587b.

Revert "Bug 2012637 - part 7: Make `RangeUtils::CompareNodeToRangeBoundaries()` use `nsContentUtils::ComparePoints` with valid point in the tree r=smaug"

This reverts commit 6985d5e80f.

Revert "Bug 2012637 - part 6: Make `nsRange::CutContents()` convert the range boundaries to the ones in the DOM before comparing r=smaug"

This reverts commit 73b585af3d.

Revert "Bug 2012637 - part 5: Delete the default template parameter of `nsContentUtils::ComparePoints` and relatives r=smaug,dom-core"

This reverts commit 1a7f24e5b5.

Revert "Bug 2012637 - part 4: Make `nsContentUtils` use `nsIContent` for taking a child node as a parameter r=smaug"

This reverts commit a6ea8d6824.

Revert "Bug 2012637 - part 3: Add template `nsINode` API which can switch to call API from `TreeKind` r=smaug,dom-core,webidl"

This reverts commit a4211e9df0.

Revert "Bug 2012637 - part 2: Add `TreeKind::FlatForSelection` and change the template parameter of `ChildIteratorBase` to `TreeKind` r=smaug,dom-core"

This reverts commit 0241749ee7.

Revert "Bug 2012637 - part 1: Make `ChildIterBase` template class to re-implement `FlattenedChildIterator` for DOM, Flat and FlatForSelection TreeKind r=smaug,dom-core,layout-reviewers,emilio"

This reverts commit 9e71cb77fb.
2026-03-13 02:52:45 +00:00
Masayuki Nakano a4211e9df0 Bug 2012637 - part 3: Add template nsINode API which can switch to call API from TreeKind r=smaug,dom-core,webidl
This will make the main patch simpler. However, some of them do not
support `TreeKind::ShadowIncludingDOM` because it's unclear what
should return as a parent node of a child of `ShadowRoot`, what should
return as a child node of a shadow host. To avoid the developers to use
them on wrong assumptions, this patch makes the users use `DOM`, `Flat`
or `FlatForSelection` explicitly.

Differential Revision: https://phabricator.services.mozilla.com/D281305
2026-03-12 03:01:50 +00:00
Emilio Cobos Álvarez 5624defbfd Bug 2016280 - Use shadow DOM for editor. r=masayuki,dom-core,smaug,Jamie
There's still a ton of things that can be cleaned up after this, but
this setup is nicer.

For now, editor keeps getting set-up / torn down on BindToFrame. Seems
all that could be untangled, but step by step.

The preview stuff and placeholder can just be created on demand now,
rather than requiring frame reconstruction.

Also, nsSearchControlFrame and co no longer do anything of interest, so
move the still relevant bits elsewhere and remove them.

test_bug1248459.html is removed because it messes with the editor
selection using SpecialPowers, in a way such that it crosses shadow
boundaries, and messes up the selected state triggering debug asserts.

test_focus_docnav.xhtml now triggers a different code-path because of
the shadow root (rather than the frame tree traversal). Keep it working
for now by replacing it with something that isn't a shadow root.

Differential Revision: https://phabricator.services.mozilla.com/D282953
2026-02-17 09:53:01 +00:00
Timothy Nikkel 884a9c4296 Bug 2009131. Use async_notify and bilinear filtering for image Draw/GetFrame calls. r=gfx-reviewers,aosmond
We always want to user aync notifications. The filtering controls how we draw if we use a pre-existing surface that has the wrong size, but in this case that is unlikely to happen due to the sync decode flag, but it would make the most sense if it did. We should update this to use best practices in case this code gets copied (which is exactly how this issue came up).

Differential Revision: https://phabricator.services.mozilla.com/D278253
2026-01-20 13:55:33 +00:00
Emilio Cobos Álvarez 256e9aa1ec Bug 1998225 - Remove some unused nsView includes. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D271260
2025-11-04 19:06:23 +00:00
serge-sans-paille 7662b3abdc Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.

In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.

One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.

Most of the heavy lifting was done through:

    $ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
    $ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'

Differential Revision: https://phabricator.services.mozilla.com/D268706
2025-10-21 19:36:01 +00:00
Cristina Horotan 8a1b1970b7 Revert "Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch" for causing Gtest failures on AlreadyAddRefed.h
This reverts commit e98adca292.
2025-10-21 16:16:29 +00:00
serge-sans-paille e98adca292 Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.

In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.

One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.

Most of the heavy lifting was done through:

    $ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
    $ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'

Differential Revision: https://phabricator.services.mozilla.com/D268706
2025-10-21 15:05:17 +00:00
Cristina Horotan aab924e90d Revert "Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch" for causing build bustage at nsBrowserApp.cpp
This reverts commit fd0ffa193c.
2025-10-21 10:44:13 +00:00
serge-sans-paille fd0ffa193c Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.

In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.

One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.

Most of the heavy lifting was done through:

    $ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
    $ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'

Differential Revision: https://phabricator.services.mozilla.com/D268706
2025-10-21 09:44:11 +00:00
Narcis Beleuzu e1e6bbb1c9 Revert "Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch" for causing bustages on Document.cpp
This reverts commit b23c15e927.
2025-10-21 06:34:58 +00:00
serge-sans-paille b23c15e927 Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.

In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.

One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.

Most of the heavy lifting was done through:

    $ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
    $ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'

Differential Revision: https://phabricator.services.mozilla.com/D268706
2025-10-21 06:01:36 +00:00
Emilio Cobos Álvarez cd5f760648 Bug 1994964 - Introduce PresShell::GetRootWidget(). r=tnikkel,layout-reviewers
Most callers of nsViewManager::GetRootWidget have a pres shell around
and don't need to care about views.

This is in preparation for bug 1994942, where we'll disconnect subdocs
from the view tree (and thus the view manager will not have the ability
to get a root widget).

Differential Revision: https://phabricator.services.mozilla.com/D269019
2025-10-17 13:32:14 +00:00
Masayuki Nakano 49cd614ea8 Bug 1983375 - part 2: Get rid of GetBoolName r=win-reviewers,gstoll
Differential Revision: https://phabricator.services.mozilla.com/D261347
2025-08-20 10:41:01 +00:00
Alexandru Marc d683b2b2ed Revert "Bug 1983375 - part 2: Get rid of GetBoolName r=win-reviewers,gstoll" for causing non-unified build bustages @ nsNativeDragSource.cpp
This reverts commit 0062ee7423.

Revert "Bug 1983375 - part 1: Define `MOZ_LOG_ONLY_DEBUG` and variants in `Logging.h` and sort it out `GetBoolName` for making it more generic r=emilio,padenot"

This reverts commit b61fa4819b.
2025-08-20 07:45:10 +00:00
Masayuki Nakano 0062ee7423 Bug 1983375 - part 2: Get rid of GetBoolName r=win-reviewers,gstoll
Differential Revision: https://phabricator.services.mozilla.com/D261347
2025-08-20 04:24:49 +00:00
Fatih Kilic eed44c4862 Bug 1968607 - Part 1: Replace CSP with PolicyContainer. r=tschuster,webidl,smaug
We are making changes to many files. Very huge chunk of the changes are just renaming CSP -> PolicyContainer. Part 1 and part 2 are solely separated as frontend and backend. The unfortunate thing is, I mistakenly placed IDL changes in part 1, and many of those IDL changes affect frontend code too. I'm sorry for this inconvinience and hard to review patch(es).

(FWIW before this rewrite we had another patch stack. It is 25 patches and I believe isn't as comprehensive as this one. It also didn't replace CSP's inheritance but was copied alongside with CSP, but we decided to change our method and make policy conttainer contain CSP and copy it around after some discussion and reviews)

Differential Revision: https://phabricator.services.mozilla.com/D249248
2025-07-11 05:39:17 +00:00
Edgar Chen bf721d5c3e Bug 1670200 - Part 1: Add log to dump flavors in nsITransferable for drag session; r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D255281
2025-07-06 21:16:46 +00:00
iulian moraru 7e9c51b1e1 Revert "Bug 1670200 - Part 3: Fix support for dragging image that use blob URL; r=tschuster" for causing mochitest-plain failures test_dragstart.html.
This reverts commit 6b55918734.

Revert "Bug 1670200 - Part 2: Refactor test_drag_image_file.html test; r=tschuster"

This reverts commit bc6921f5e7.

Revert "Bug 1670200 - Part 1: Add log to dump flavors in nsITransferable for drag session; r=handyman"

This reverts commit 412b8cc3d6.
2025-07-03 21:35:03 +00:00
Edgar Chen 412b8cc3d6 Bug 1670200 - Part 1: Add log to dump flavors in nsITransferable for drag session; r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D255281
2025-07-03 20:45:42 +00:00
David P 42ba961db0 Bug 1969993: Add logging for DND operations on Windows r=win-reviewers,gstoll
Depends on D252240

Differential Revision: https://phabricator.services.mozilla.com/D252242
2025-06-17 03:16:38 +00:00
Alexandru Marc 12647675a7 Revert "Bug 1969993: Add logging for DND operations on Windows r=win-reviewers,gstoll" for causing build bustages @ nsBaseDragService.cpp
This reverts commit aabd452dcf.

Revert "Bug 1969993: Move various definitions of GetBoolName to Logging.h r=mccr8"

This reverts commit b611c5a7f0.
2025-06-06 01:31:42 +00:00
David P aabd452dcf Bug 1969993: Add logging for DND operations on Windows r=win-reviewers,gstoll
Differential Revision: https://phabricator.services.mozilla.com/D252242
2025-06-05 23:08:33 +00:00
Greg Stoll 51930f6e5c Bug 1961170 part 5 - make SendDispatchToDropTargetAndResumeEndDragSession() take allowedFiles r=dlp-reviewers,handyman
Differential Revision: https://phabricator.services.mozilla.com/D248522
2025-05-21 17:33:26 +00:00
Greg Stoll 7d57a26160 Bug 1961170 part 3 - make DispatchToDropTargetAndResumeEndDragSession() take allowedFiles r=dlp-reviewers,handyman
Differential Revision: https://phabricator.services.mozilla.com/D248520
2025-05-21 17:33:19 +00:00
David Parks 060bf8db67 Bug 1933228: Use float coordinates for test dragend position r=win-reviewers,gstoll
We need fractional coordinates here for device scale.

Differential Revision: https://phabricator.services.mozilla.com/D247190
2025-05-07 03:19:50 +00:00
Masayuki Nakano 71ada507bb Bug 1680669 - part 6: Make methods of MouseEvent and static methods of Event aware of fractional coordinates r=smaug,emilio,webdriver-reviewers
`screenX`, `screenY`, `clientX`, `clientY`, `x`, `y`, `offsetX` and `offsetY`
are now `double`.  This patch makes the event classes aware of DOM events.

Currently, Chrome allows fractional values only for pointer events whose type
is not `click`, `auxclick` nor `contextmenu` (this exception is defined by the
Pointer Events spec).  Therefore, this patch follows them.

I'm not sure about the untrusted events of non-pointer events, `click`,
`auxclick` and `contextmenu`. Chrome does check whether it's trusted or not
before applying `std::floor` or `std::round` at getter methods (I think that
using `std::round` in `offsetX` and `offsetY` is their bug at least for
untrusted events).  This patch follows them for now but has a pref to allow
for all untrusted events.

Finally, for aligning to Chrome, this patch makes `click`, `auxclick` and
`contextmneu` keep using integer coordinates because it's recommended by the
Pointer Events spec.

Note that this changes the logic in `Event::GetPageCoords`.  It rounded the
client point and scroll point before adding them.  Similarly,
`Event::GetOffsetCoords` too.  It rounded the client point before transforming
it.  Therefore, in strictly speaking, this changes the behavior of other events
which keep returning integer coordinates.  However, I don't see any issues in
our CI.  So, for making the code simpler, let's use it and once we got some
regression reports caused by this, let's make them take additional param to
round the points to integer done in the traditional code.

Differential Revision: https://phabricator.services.mozilla.com/D222728
2024-12-03 07:10:05 +00:00
Masayuki Nakano 6a016e033a Bug 1680669 - part 5: Make MouseEvent and subclasses work with double coordinates r=smaug
This patch makes the following patch simpler.  Therefore, this patch just cast
`double` coordinates to `int32_t` points at initializing untrusted events.
Therefore, this does not change any behavior.

Differential Revision: https://phabricator.services.mozilla.com/D222727
2024-12-03 07:10:01 +00:00
David Parks 49e0bf14d9 Bug 1916804: Make content analysis DND use getURIForDropEvent r=dlp-reviewers,reusable-components-reviewers,gstoll,mstriemer
getURIForDropEvent delegates to getURIForBrowsingContext -- the ground truth for
CA URIs.

This also adds a check that getURIForDropEvent is correctly called in CA tests.
We do not yet test that it returns the right value -- that is future work.

Differential Revision: https://phabricator.services.mozilla.com/D222192
2024-09-17 03:48:06 +00:00
David Parks 2f776696c6 Bug 1910452: Part 1 - Intercept drop events for content analysis r=smaug,dlp-reviewers,gstoll,reusable-components-reviewers,mstriemer
Sends OOP drop events to content analysis for approval before sending them to
the DOM.  It intercepts drop events at the browser level and sends them to CA
before calling stopPropagation and preventDefault on them.  (CA also presents a
modal dialog over the tab.) The drag session then ends as usual in the parent
process but remains open on the related browser in the process where it would be
sent to the DOM while the drop is being analyzed.  While CA runs, the browser
dispatches an eQueryDropTargetHittest event to locate the drop target while the
event screen coordinates are still valid.  When CA is complete, a drop or
dragexit event is sent to the drop target (drop if it was approved by CA). Calls
to EndDragSession are delayed during this.

Differential Revision: https://phabricator.services.mozilla.com/D219201
2024-09-11 23:02:22 +00:00
Sean Feng 3149d939df Bug 1906388 - Ensure dragend uses the same target as dragstart r=masayuki,dom-core
Since this issue is too obvious, I am not even sure I am doing the right
thing. This looks like it should be discovered years ago....

As far as I can tell from the spec, dragstart and dragend use the same node
as the target, but it's not always the same node in Firefox.

Differential Revision: https://phabricator.services.mozilla.com/D215827
2024-07-16 14:53:18 +00:00
Ting-Yu Lin b7e4c25991 Bug 1150182 - Use strong-typed CSSIntSize instead of nsIntSize for canvas sizes. r=gfx-reviewers,layout-reviewers,emilio,nical
Canvas uses CSS pixels, so this patch encodes the information into the type
system. Some painting code still uses unknown sizes, so we need to use
`CSSIntSize::FromUnknownSize` and `ToUnknownSize()` to convert them.

This patch doesn't change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D216463
2024-07-15 15:20:11 +00:00
Otto Länd ee85122101 Bug 1893119: apply code formatting via Lando
# ignore-this-changeset
2024-07-04 07:52:52 +00:00
David P 48b66f76d5 Bug 1893119: Part 22 - Make nsIDragService::StartDragSession return the nsIDragSession r=rkraesig,win-reviewers,gstoll,geckoview-reviewers,m_kato
Differential Revision: https://phabricator.services.mozilla.com/D212298
2024-07-04 07:48:12 +00:00
David P e844cdeed5 Bug 1893119: Part 21 - Separate nsIDragService and nsIDragSession implementations r=gstoll,geckoview-reviewers,rkraesig,win-reviewers,m_kato
Split the class inheritance trees for nsIDragService and nsIDragSession.
Remember that, before the start of this patch series, the inheritance
diagram was:

nsDragService -> nsBaseDragService -> nsIDragService + nsIDragSession

and the only instance was a singleton.  We switched it to:

nsDragService -> nsDragSession -> nsBaseDragService -> nsIDragService + nsBaseDragSession -> nsIDragSession

and maintained the singleton.  This allowed us to allow us to move things to
the new classes without breaking behavior.  We are done with that,
so we can now change the inheritance to its final form:

nsDragService -> nsBaseDragService -> nsIDragService

nsDragSession -> nsBaseDragSession -> nsIDragSession

Of course, we also need to properly construct and release the
nsIDragSessions (formerly part of the singleton), so that is done here as
well.  That happens in nsBaseDrag[Service|Session] for parent process drags
and in nsDrag[Service|Session]Proxy for content.  This is all fairly
straightforward, except in the case of gtk, where we need to change
some callback behavior.

Differential Revision: https://phabricator.services.mozilla.com/D211084
2024-07-04 07:48:11 +00:00
David P 5c77b63f65 Bug 1893119: Part 20 - Move EndDragSession from nsIDragService to nsIDragSession r=gstoll,rkraesig,win-reviewers,geckoview-reviewers,m_kato
This is a straightforward move.  It does take the liberty of breaking out an
EndDragSessionImpl method, which will be needed later.

Differential Revision: https://phabricator.services.mozilla.com/D211083
2024-07-04 07:48:11 +00:00
David Parks 447704fe80 Bug 1893119: Part 18 - Copy/Move MaybeAddBrowser, RemoveAllBrowsers and MustUpdateDataTransfer from nsIDragService to nsIDragSession r=geckoview-reviewers,gstoll,m_kato
MustUpdateDataTransfer is a simple function that makes more sense on
nsIDragSession.

MaybeAddBrowser records BrowserParents for processes with existing drag
sessions.  There may be such processes before the parent process
even has a drag session, so they cannot be tied to drag sessions.  We tie
them to the drag service, until the service creates a drag session in
the process, at which point we move them to the drag session.  Since
the session and service are still the same object and each now has methods
with these names, we leave part of session's implementation commented out
so that we run correctly instead of looping infinitely.  The code is
exposed when the objects separate later in the patch series.

Finally, the implementation of TakeSessionBrowserListFromService currently
amounts to a nop, but it will have substace when the service and session
are separated.

Differential Revision: https://phabricator.services.mozilla.com/D211081
2024-07-04 07:48:10 +00:00
David P 19861d5e8d Bug 1893119: Part 17 - Pass the widget to StartDragSession r=gstoll,rkraesig,win-reviewers,geckoview-reviewers,m_kato
Differential Revision: https://phabricator.services.mozilla.com/D211080
2024-07-04 07:48:10 +00:00
David P c32e8a504a Bug 1893119: Part 16 - Make nsBaseDragService weakly remember PBrowsers instead of PContents r=nika,win-reviewers,rkraesig
nsBaseDragService keeps track of the processes that might need to cancel a drag with EndDragSession and this is technically correct since the drag session is a singleton in the child process, but this series of patches changes those sessions to be per-PuppetWidget/BrowserChild.  This allows content processes to distinguish which of its browsers is engaged in a drag.

Differential Revision: https://phabricator.services.mozilla.com/D211062
2024-07-04 07:48:09 +00:00
David P 808c72fba0 Bug 1893119: Part 15 - Give StartDragSessionForTests a window to start the drag session on r=gstoll,rkraesig
Differential Revision: https://phabricator.services.mozilla.com/D211079
2024-07-04 07:48:09 +00:00
David Parks f62a3a2577 Bug 1893119: Part 14 - Move SetDragEndPoint from nsBaseDragService to nsIDragSession r=gstoll,rkraesig,win-reviewers,geckoview-reviewers,m_kato
Differential Revision: https://phabricator.services.mozilla.com/D211078
2024-07-04 07:48:08 +00:00
David Parks 88e30b7141 Bug 1893119: Part 13 - Move FireDragEventAtSource from nsIDragService to nsIDragSession r=gstoll,rkraesig,win-reviewers,geckoview-reviewers,m_kato
Differential Revision: https://phabricator.services.mozilla.com/D211077
2024-07-04 07:48:08 +00:00
David P 3b7651c8d7 Bug 1893119: Part 12 - Move DragMoved from nsIDragService to nsIDragSession r=gstoll,rkraesig,win-reviewers,spohl
Differential Revision: https://phabricator.services.mozilla.com/D211076
2024-07-04 07:48:07 +00:00
David Parks a3af715796 Bug 1893119: Part 11 - Add widget to nsIDragService::InvokeDragSession and friends r=gstoll,rkraesig
This also moves InvokeDragSession from an IDL to a private one.

Differential Revision: https://phabricator.services.mozilla.com/D211075
2024-07-04 07:48:07 +00:00
David P c407e9dcea Bug 1893119: Part 10 - Move MaybeEditorDeletedSourceNode from nsIDragService to nsIDragSession r=gstoll,masayuki
MaybeEditorDeletedSourceNode was defined on nsIDragService but is more appropriately defined on nsIDragSession.  This was not an issue previously since those were the same object.

Differential Revision: https://phabricator.services.mozilla.com/D211074
2024-07-04 07:48:06 +00:00