Commit Graph
81 Commits
Author SHA1 Message Date
Ray Kraesig 0bdd4f2aa3 Bug 1598915 - [2/2] Ignore external drag-and-drop responses for Fx tabs r=handyman,win-reviewers
When dragging and dropping a Firefox tab onto another application,
assume the tab-drop is not handled, even if the application claims that
it was.

Differential Revision: https://phabricator.services.mozilla.com/D216625
2024-07-16 22:09:39 +00:00
Tamas Szentpeteri 68012aa965 Backed out 2 changesets (bug 1598915) for causing build bustages on nsDragService.cpp. CLOSED TREE
Backed out changeset 340e2d1b2d23 (bug 1598915)
Backed out changeset 415be9b49528 (bug 1598915)
2024-07-17 00:53:21 +03:00
Ray Kraesig f7e64af9cd Bug 1598915 - [2/2] Ignore external drag-and-drop responses for Fx tabs r=handyman,win-reviewers
When dragging and dropping a Firefox tab onto another application,
assume the tab-drop is not handled, even if the application claims that
it was.

Differential Revision: https://phabricator.services.mozilla.com/D216625
2024-07-16 17:49:30 +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 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 9f2046bb92 Bug 1893119: Part 8 - Prepare for nsBaseDragSession to be broken out of nsBaseDragService r=gstoll,rkraesig,win-reviewers,geckoview-reviewers,m_kato
Creates the nsBaseDragSession class and moves nsIDragSession's methods and data
into it.  This patch also does this for each platform-specific nsDragService
and the nsDragServiceProxy.  The result is that the drag service and drag
session are still one object in both the main and child processes, and the
inheritance diagram for each platform implementation goes from its present
from:

nsDragService -> nsBaseDragService -> nsIDragService + nsIDragSession

to:

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

(and similar for the nsDragServiceProxy).

At the end of this patch series, the objects will be separated and the
inheritance diagram will be as expected:

nsDragService -> nsBaseDragService -> nsIDragService

nsDragSession -> nsBaseDragSession -> nsIDragSession

There are no substantive changes here -- it's essentially all cut
and paste to prepare to smoothly sever the unwanted inheritance.

Differential Revision: https://phabricator.services.mozilla.com/D211072
2024-07-04 07:48:06 +00:00
Edgar Chen 4d5c734268 Bug 1851041 - Part 3: Ignore CFSTR_FILEDESCRIPTOR* if text/x-moz-url is present; r=rkraesig,win-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D189626
2023-10-10 15:24:43 +00:00
Edgar Chen b33a91a4e2 Bug 1851041 - Part 2: Add some log in DragService for debugging; r=rkraesig,win-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D189625
2023-10-06 21:23:45 +00:00
Edgar Chen 8213a4e9af Bug 1851041 - Part 1: Clean up nsDragService::IsDataFlavorSupported; r=win-reviewers,gstoll
This doesn't change the behavior, it's just to improve the readability
by reducing the if-else block.

Differential Revision: https://phabricator.services.mozilla.com/D189624
2023-10-06 21:23:44 +00:00
Natalia Csoregi 3706a617b6 Backed out 3 changesets (bug 1851041) for causing bustage on nsClipboard.cpp. CLOSED TREE
Backed out changeset 5cb270a4e6b6 (bug 1851041)
Backed out changeset f6e5e427d8e8 (bug 1851041)
Backed out changeset 7c7228999e18 (bug 1851041)
2023-10-05 23:59:45 +03:00
Edgar Chen bf6617c97e Bug 1851041 - Part 3: Ignore CFSTR_FILEDESCRIPTOR* if text/x-moz-url is present; r=rkraesig,win-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D189626
2023-10-05 18:46:14 +00:00
Edgar Chen 7c11d58d7f Bug 1851041 - Part 2: Add some log in DragService for debugging; r=rkraesig,win-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D189625
2023-10-05 18:46:13 +00:00
Edgar Chen ea3ada5367 Bug 1851041 - Part 1: Clean up nsDragService::IsDataFlavorSupported; r=win-reviewers,gstoll
This doesn't change the behavior, it's just to improve the readability
by reducing the if-else block.

Differential Revision: https://phabricator.services.mozilla.com/D189624
2023-10-05 18:46:13 +00:00
mspiess 3319c09834 Bug 580928 - Add support for Drag and Drop with Outlook items. r=cmartin
Differential Revision: https://phabricator.services.mozilla.com/D157587
2023-03-21 13:50:32 +00:00
Neil Deakin 21426e24f4 Bug 1776879, replace text/unicode for clipboard and drag and drop and use text/plain directly, r=edgar,mak,stransky,geckoview-reviewers,extension-reviewers,zombie,m_kato
Most usage is a straight replacement but gtk needs extra changes as it transfers plain text in UTF8 natively and needs to be converted into UTF16, and Windows uses single-byte characters for RTF and CF_HTML formats so we preserve this.

Differential Revision: https://phabricator.services.mozilla.com/D158587
2023-02-01 23:30:55 +00:00
Emilio Cobos Álvarez df848b8114 Bug 1767944 - Fix drag image coordinates after bug 1753836. r=tnikkel
The existing code was relying on the drag event coordinates being
already unscaled by the zoom, which bug 1753836 fixed.

This simplifies the relevant code and fixes the bug.

Differential Revision: https://phabricator.services.mozilla.com/D145578
2022-05-05 12:10:08 +00:00
Emilio Cobos Álvarez 81ca7ca7af Bug 1756241 - Make Windows DragService have the same coordinate system as all other drag and mouse events. r=tnikkel
Passing the widget makes sure that in mixed dpi situations the pixels match
that of all other events.

The windows code was working around this by storing CSS pixels directly, but
with that tweak it's no longer needed.

Chances are I need to undo similarish workarounds on other platforms like
https://searchfox.org/mozilla-central/rev/caad7a563d267a8a06ed8c7222b21df91625f5ac/widget/gtk/nsDragService.cpp#2110,
will test there.

Differential Revision: https://phabricator.services.mozilla.com/D139243
2022-02-22 19:06:58 +00:00
Gabriele Svelto f03cdb2b2d Bug 1600545 - Remove useless inclusions of header files generated from IDL files in modules/, netwerk/, parser/, security/, startupcache/, storage/, toolkit/, tools/, uriloader/, widget/, xpcom/ and xpfe/ r=Ehsan
The inclusions were removed with the following very crude script and the
resulting breakage was fixed up by hand. The manual fixups did either
revert the changes done by the script, replace a generic header with a more
specific one or replace a header with a forward declaration.

find . -name "*.idl" | grep -v web-platform | grep -v third_party | while read path; do
    interfaces=$(grep "^\(class\|interface\).*:.*" "$path" | cut -d' ' -f2)
    if [ -n "$interfaces" ]; then
        if [[ "$interfaces" == *$'\n'* ]]; then
          regexp="\("
          for i in $interfaces; do regexp="$regexp$i\|"; done
          regexp="${regexp%%\\\|}\)"
        else
          regexp="$interfaces"
        fi
        interface=$(basename "$path")
        rg -l "#include.*${interface%%.idl}.h" . | while read path2; do
            hits=$(grep -v "#include.*${interface%%.idl}.h" "$path2" | grep -c "$regexp" )
            if [ $hits -eq 0 ]; then
                echo "Removing ${interface} from ${path2}"
                grep -v "#include.*${interface%%.idl}.h" "$path2" > "$path2".tmp
                mv -f "$path2".tmp "$path2"
            fi
        done
    fi
done

Differential Revision: https://phabricator.services.mozilla.com/D55444
2019-12-06 09:17:57 +00:00
Masayuki Nakano cec53aafad Bug 1543315 - part 17: Mark PresShell::HandleDOMEventWithTarget() as MOZ_CAN_RUN_SCRIPT r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D30494
2019-05-09 20:21:28 +00:00
Masatoshi Kimura b3db499d5c Bug 1532140 - Cleanup nsDataObj. r=jmathies
* Removed dead code.
* Removed a duplicated field (`m_cRef`) from the derived class.
* Removed #ifdefs for older SDKs that we no longer support.
* Made access specifiers more restrictive.
* Added `override` and `final`.
* De-virtualized member functions unless it is neccessary.

Differential Revision: https://phabricator.services.mozilla.com/D21864
2019-03-13 19:00:59 +00:00
Emilio Cobos Álvarez dc336a73ba Bug 1517241 - Rename nsIDocument to mozilla::dom::Document. r=smaug
Summary: Really sorry for the size of the patch. It's mostly automatic
s/nsIDocument/Document/ but I had to fix up in a bunch of places manually to
add the right namespacing and such.

Overall it's not a very interesting patch I think.

nsDocument.cpp turns into Document.cpp, nsIDocument.h into Document.h and
nsIDocumentInlines.h into DocumentInlines.h.

I also changed a bunch of nsCOMPtr usage to RefPtr, but not all of it.

While fixing up some of the bits I also removed some unneeded OwnerDoc() null
checks and such, but I didn't do anything riskier than that.
2019-01-03 17:48:33 +01:00
Sylvestre Ledru e5a134f73a Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset
2018-11-30 11:46:48 +01:00
Tom Schuster 2ab84f73a8 Bug 396370 - Set RequestingPrincipal and ContentPolicy in BaseDragService. r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D7407
2018-10-04 10:31:32 +00:00
Andrew McCreight 9bd88bef98 Bug 1495912- Remove more trivial calls to do_QueryInterface r=smaug
MozReview-Commit-ID: 34BAwt3SAJk

Differential Revision: https://phabricator.services.mozilla.com/D7640
2018-10-03 19:52:01 +00:00
Neil Deakin bb1d678c62 Bug 1473029, convert drag services to internally use CSSIntRegion instead ns nsIScriptableRegion, r=mstange 2018-08-07 09:32:08 -04:00
Kyle Machulis bc0faeb5d0 Bug 1480607 - Remove nsCWebBrowser and nsCWebBrowserPersist; r=nika
It doesn't appear these IDL files have had interfaces in them since
before the Netscape import, and were mostly just hanging around
because they contained some IDs needed elsewhere. Move the IDs
somewhere more appropriate and remove files.

MozReview-Commit-ID: AINtTerqHu1

Differential Revision: https://phabricator.services.mozilla.com/D2688
2018-08-07 01:10:31 +00:00
Chris Peterson f7ceeaf5cf Bug 1469769 - Part 6: Replace non-failing NS_NOTREACHED with MOZ_ASSERT_UNREACHABLE. r=froydnj
This patch is an automatic replacement of s/NS_NOTREACHED/MOZ_ASSERT_UNREACHABLE/. Reindenting long lines and whitespace fixups follow in patch 6b.

MozReview-Commit-ID: 5UQVHElSpCr
2018-06-17 22:43:11 -07:00
Boris Zbarsky 5f546dac16 Bug 1455676 part 3. Remove nsIDOMNode usage from widget/. r=qdot 2018-05-29 22:58:48 -04:00
Boris Zbarsky 17c9b27706 Bug 1444686 part 13. Remove remaining nsIDOMDataTransfer uses. r=mystor
MozReview-Commit-ID: EFauqLMGz5S
2018-03-13 16:24:00 -04:00
Milan Sreckovic 1a108fed6c Bug 1423559: Use BaseRect access methods instead of member variables in widget/ r=mstange
MozReview-Commit-ID: AqnztoUbsmk
2018-01-10 11:14:16 -05:00
Alexis Beingessner 3117218f13 Bug 1088760 - Remove nsRenderingContext, replacing all of its uses with gfxContext. r=jwatt,jrmuizel
MozReview-Commit-ID: K1WUIOnvazF
2017-06-13 11:00:10 -04:00
Sebastian Hengst 1b1d14e565 Backed out changeset 3d1ce85e6348 (bug 1088760) for bustage, at least on Android at layout/generic/nsPluginFrame.cpp:1612. r=backout 2017-06-13 00:30:03 +02:00
Alexis Beingessner c6fbc5e17e Bug 1088760 - Remove nsRenderingContext, replacing all of its uses with gfxContext. r=jwatt,jrmuizel
MozReview-Commit-ID: K1WUIOnvazF
2017-06-12 17:32:48 -04:00
Farmer Tseng 169f2d53db Bug 1361949 - Add missing 'using namespace::widget' to widget/windows/nsDragService.cpp r=jwatt
Because ModifierKeyState is in the 'mozilla::widget' namespace, this file uses
it without qualification.

MozReview-Commit-ID: H6t3AqLjRwJ
2017-05-04 17:31:23 +08:00
Stone Shih 2b86511344 Bug 606885 - Fire drag events with keyboard modifiers. r=enn 2017-02-17 11:29:42 +08:00
Neil Deakin 8d294a33cd Bug 1309596, implementation of UpdateDragImage by adjusting image and calling DragEnter of the drag feedback helper, r=jimm 2016-12-23 18:09:44 -05:00
Neil Deakin df6ce0d915 Bug 1301673, use device pixels for the supplied drag position and the computed dragrectangle, r=tn 2016-10-19 15:01:39 -04:00
Neil Deakin 4a820ef165 Bug 1301673, use more specific coordinates for screen position in drag calculations, r=tn 2016-10-19 15:01:39 -04:00
Eric Rahm 2a4d3b22b9 Bug 1309698 - Remove usage of nsISupportsArray from nsIDragService. r=smaug 2016-10-18 11:56:20 -07:00
Hector Zhao e4bed69af9 Bug 664717 - Part 1: Switch to requestingPrincipal in nsITransferable. r=ckerschb
MozReview-Commit-ID: Hndb5ftbEuL
2016-07-01 16:01:11 +08:00
Masatoshi Kimura ffdc38f400 Bug 1288760 - Fix point conversion in nsDragService::StartInvokingDragSession. r=jfkthame
MozReview-Commit-ID: DgNtnsvEPnR
2016-07-28 19:57:28 +09:00
Thomas Zimmermann ba133ac07a Bug 1265386: Fix white-space errors in widget/, r=nfroyd
MozReview-Commit-ID: ATXI7dYFHmA
2016-07-22 10:56:13 +02:00
Carsten "Tomcat" Book 49865a8de6 Backed out changeset 2bea1e1e403d (bug 1265386) for bustage on a CLOSED TREE 2016-07-21 13:59:02 +02:00
Thomas Zimmermann 4fa3fb2bb5 Bug 1265386: Fix white-space errors in widget/, r=nfroyd
MozReview-Commit-ID: ATXI7dYFHmA
2016-07-21 13:29:30 +02:00
Jonathan Kingston ed99242d32 Bug 1192945 - Use channel->asyncOpen2 in widget/windows/nsDataObj.cpp. r=ckerschb
MozReview-Commit-ID: 5whNAj5KAjf
2015-08-10 12:56:47 -07:00
Randell Jesup 48d6215a5d Backed out changeset 36e71bcb0266 (bug 1192945) 2016-06-10 02:24:08 -04:00
Jonathan Kingston 99b2793b93 Bug 1192945 - Use channel->ascynOpen2 in widget/windows/nsDataObj.cpp . r=ckerschb, r=jmathies
MozReview-Commit-ID: 5whNAj5KAjf
2015-08-10 12:56:47 -07:00
Jonathan Watt 80a104b4e7 Bug 1265953, part 2 - Convert much of the rest of the widget code from nsAutoPtr to UniquePtr. r=mstange 2016-04-19 21:51:25 +01:00
Jorg K 15c978e033 Bug 1254980 - Ensure that text/html is still written to the clipboard. r=enndeakin 2016-03-22 11:47:00 -04:00