Граф коммитов

204 Коммитов

Автор SHA1 Сообщение Дата
Kristen Wright 74a5665bf6 Bug 1622111 - Convert dom.datatransfer.mozAtAPIs to static pref. r=njn
Converts dom.datatransfer.mozAtAPIs to a static pref and adds the `do_not_use_directly` field, since the pref is used in combination with an additional check in `DataTransfer::MozAtAPIsEnabled`.

Differential Revision: https://phabricator.services.mozilla.com/D67202

--HG--
extra : moz-landing-system : lando
2020-03-19 00:54:15 +00:00
Stefan Hindli 5f419e4b50 Backed out 9 changesets (bug 1622111) for causing mochitest failures in dom/animation/test/mozilla/test_restyles.html CLOSED TREE
Backed out changeset c244160797f8 (bug 1622111)
Backed out changeset dd9209f6bd8b (bug 1622111)
Backed out changeset d694c9e7061f (bug 1622111)
Backed out changeset 486aae809f6d (bug 1622111)
Backed out changeset 709266168c41 (bug 1622111)
Backed out changeset ca0d47bb86a8 (bug 1622111)
Backed out changeset caa735c8bb91 (bug 1622111)
Backed out changeset 12397711ab25 (bug 1622111)
Backed out changeset b66002fd1480 (bug 1622111)
2020-03-19 02:47:51 +02:00
Kristen Wright 92d93617df Bug 1622111 - Convert dom.datatransfer.mozAtAPIs to static pref. r=njn
Converts dom.datatransfer.mozAtAPIs to a static pref and adds the `do_not_use_directly` field, since the pref is used in combination with an additional check in `DataTransfer::MozAtAPIsEnabled`.

Differential Revision: https://phabricator.services.mozilla.com/D67202

--HG--
extra : moz-landing-system : lando
2020-03-18 22:19:06 +00:00
Sebastian Streich 4b4a5382fa Bug 1621001 - Refactor DataTransfer.cpp r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D66044

--HG--
extra : moz-landing-system : lando
2020-03-10 14:30:58 +00:00
Simon Giesecke 61be6c6c35 Bug 1613985 - Use default for equivalent-to-default constructors/destructors in dom/events. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D63164

--HG--
extra : moz-landing-system : lando
2020-02-20 15:56:28 +00:00
Masayuki Nakano 25e931d406 Bug 1609603 - Optimize the callers of `DataTransfer::GetTypes()` r=smaug
In C++ code, `DataTransfer::GetTypes()` are used for checking whether the
`DataTransfer` instance has specific type `DataTransferItem` or not.  Therefore,
it does not make sense to retrieve all item types nor compare some types
looking for with the retrieved item types.

This patch adds `DataTransfer::HasType()` and `DataTransfer::HasFile()` for
the current C++ users.  They don't take `CallerType` since all C++ users use
`GetTypes()` as `CallertType::System`.  And they just call a corresponding
method of `DataTransferItemList`.

Then, `DataTransferItemList` methods compares given type with every items
simply.

Note that this patch moves `DataTransfer::GetTypes()` to `DataTransferItemList`
too because new methods and `GetTypes()` should be maintained at every logic
changes.

The reason why there is no `DataTransfer::HasAnyOfTypes()` method is,
`DataTransfer.h` cannot include `DataTransferItemList.h` due to their
dependency but parameter pack requires inline methods.

Differential Revision: https://phabricator.services.mozilla.com/D60387

--HG--
extra : moz-landing-system : lando
2020-01-20 09:46:48 +00:00
Gabriele Svelto ace6d1063f Bug 1600545 - Remove useless inclusions of header files generated from IDL files in dom/ 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/D55442

--HG--
extra : moz-landing-system : lando
2019-12-06 09:24:56 +00:00
Boris Zbarsky 75124bdd98 Bug 1517588. Use nsIPrincipal::IsSystemPrincipal instead of nsContentUtils::IsSystemPrincipal r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D53067

--HG--
extra : moz-landing-system : lando
2019-12-05 04:44:32 +00:00
Dorel Luca a381d5c96d Backed out changeset f6e53d1c6518 (bug 1600545) for Android build bustage. CLOSED TREE 2019-12-04 17:32:27 +02:00
Gabriele Svelto bc9290f767 Bug 1600545 - Remove useless inclusions of header files generated from IDL files in dom/ 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/D55442

--HG--
extra : moz-landing-system : lando
2019-12-04 15:01:19 +00:00
danwalsh99 333e172d73 Bug 1597237 - Remove useless return; declaration, r=sylvestre
Differential Revision: https://phabricator.services.mozilla.com/D54414

--HG--
extra : moz-landing-system : lando
2019-11-24 08:28:39 +00:00
Boris Zbarsky 1128b8dee8 Bug 1578173 part 6. Remove remaining uses of [Constructor] from bindings. r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D45394

--HG--
extra : moz-landing-system : lando
2019-09-12 11:01:17 +00:00
Sebastian Streich db893cf0d7 Bug 1561056 - Pass CSP on Link-drop r=ckerschb,Gijs,farre
***
Fix linux build

Differential Revision: https://phabricator.services.mozilla.com/D37563

--HG--
extra : moz-landing-system : lando
2019-08-20 12:43:02 +00:00
Daniel Varga 95ce40b8d4 Backed out changeset a7ac9f64f6ea (bug 1561056) for build bustage at widget/gtk/nsDragService. On a CLOSED TREE 2019-08-16 09:30:39 +03:00
Sebastian Streich c051155f99 Bug 1561056 - Pass CSP on Link-drop r=ckerschb,Gijs,farre
Differential Revision: https://phabricator.services.mozilla.com/D37563

--HG--
extra : moz-landing-system : lando
2019-08-15 18:44:00 +00:00
Nicholas Nethercote af1a8f2d27 Bug 1570212 - Convert dom.events.dataTransfer.protected.enabled to a static pref. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D40157

--HG--
extra : moz-landing-system : lando
2019-08-02 11:59:05 +00:00
Boris Zbarsky 0f70d08ec8 Bug 1566595. Stop using [array] in nsIBinaryOutputStream. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D38387

--HG--
extra : moz-landing-system : lando
2019-07-22 20:27:39 +00:00
Ciure Andrei 98278afa46 Backed out changeset a858e4411532 (bug 1566595) for causing Windows MinGW builds bustages CLOSED TREE 2019-07-22 21:39:08 +03:00
Boris Zbarsky 9c74919340 Bug 1566595. Stop using [array] in nsIBinaryOutputStream. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D38387

--HG--
extra : moz-landing-system : lando
2019-07-22 14:52:04 +00:00
Boris Zbarsky 5eb248348f Bug 1557847. Stop using [array] in nsIClipboard. r=NeilDeakin
Differential Revision: https://phabricator.services.mozilla.com/D34243

--HG--
extra : moz-landing-system : lando
2019-06-09 01:06:39 +00:00
Marco Bonardo d168e355cf Bug 1543694 - Prevent content from adding place flavors to a DataTransfer. r=NeilDeakin
Differential Revision: https://phabricator.services.mozilla.com/D27121

--HG--
extra : moz-landing-system : lando
2019-04-11 17:12:06 +00:00
Masayuki Nakano c1c11c9406 Bug 1536345 - Add comments to DataTransfer::GetExternalTransferableFormats() and DataTransfer::GetExternalClipboardFormats() to keep them similar r=smaug
I forgot to add the comments to keep them similar even though it's mentioned
in the review comment.  This patch just adds the comments.

Differential Revision: https://phabricator.services.mozilla.com/D23995

--HG--
extra : moz-landing-system : lando
2019-03-19 08:21:05 +00:00
Ryan Hunt 00e98538aa Bug 1523969 part 6 - Move method definition inline comments to new line in 'dom/'. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D21106

--HG--
extra : rebase_source : ea3f51c2c11247114deccbc86e90fb02b8a97257
2019-02-25 16:05:29 -06:00
Alex Gaynor 0e903787da Bug 1415508 - use Span in constructing a byte input stream; r=mayhemer
Differential Revision: https://phabricator.services.mozilla.com/D20687

--HG--
extra : moz-landing-system : lando
2019-02-25 19:11:20 +00:00
Masayuki Nakano f8a317eb9a Bug 998941 - part 2-3: Create new constructors of DataTransfer to set only plain text or nsITransferable r=smaug
DataTransfer should have more 2 constructors.  One takes |const nsAString&| and
sets its data to the string.  The other takes |nsITransferable*| and stores only
its data with DataTransferItem.

If given data is external resource like the case of `HTMLEditor::PasteTransferable()`,
we should copy its data to each DataTransferItem because nsITransferable is not
cycle-collectable, but DataTransfer may be grabbed by JS.  Unfortunately, adding
new path to initialize DataTransfer with nsITransferable instance is too risky
because DataTransfer and DataTransferItem work together to initialize each of
them if DataTransfer is in external mode. Therefore, this patch makes the
new constructor temporarily sets it to in external mode, then, cache usable types
first, then, call `FillAllExternalData()` to  make each DataTransferItem initializes
its data by itself, finally, make the constructor set it to internal mode and release
nsITransferable instance.  This is ugly implementation but the most reasonable
way for now because:

- We don't need to change DataTransfer nor DataTransferItem a lot in this bug.
- We don't need to duplicate any code like a loop in `CacheExternalData()`.

In another bug, we should redesign DataTransfer and DataTransferItem to
make DataTransferable easier to be added new constructors.

Differential Revision: https://phabricator.services.mozilla.com/D19298

--HG--
extra : moz-landing-system : lando
2019-02-19 07:13:20 +00:00
Tooru Fujisawa ba1b11b334 Bug 1509384 - Use IPC::Principal instead of Principal URI string in Drag-and-Drop. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D13728

--HG--
extra : moz-landing-system : lando
2019-01-04 03:16:46 +00:00
Emilio Cobos Álvarez d2ed260822 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 265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Tom Schuster 6296f48a85 Bug 1493292 - Remove aDataLen parameters from nsITransferable.setTransferData. r=smaug
Depends on D11201

Differential Revision: https://phabricator.services.mozilla.com/D11202

--HG--
extra : moz-landing-system : lando
2018-11-20 17:00:09 +00:00
Csoregi Natalia df7483024d Backed out 6 changesets (bug 1493292) for bustage on /nsTransferable.cpp. CLOSED TREE
Backed out changeset f198bf91320b (bug 1493292)
Backed out changeset 6487aa307123 (bug 1493292)
Backed out changeset f2cabd69c568 (bug 1493292)
Backed out changeset 71430fceb4a3 (bug 1493292)
Backed out changeset 3a9b6d65d8c7 (bug 1493292)
Backed out changeset 55769869037c (bug 1493292)
2018-11-20 17:13:18 +02:00
Tom Schuster 8be0fec340 Bug 1493292 - Remove aDataLen parameters from nsITransferable.setTransferData. r=smaug
Depends on D11201

Differential Revision: https://phabricator.services.mozilla.com/D11202

--HG--
extra : moz-landing-system : lando
2018-11-20 14:47:04 +00:00
Boris Zbarsky 64ae41821b Bug 1507540 part 6. Make nsIVariant's "type" a notxpcom attribute. r=froydnj 2018-11-19 20:20:05 -05:00
Tom Schuster 1506df6b61 Bug 1497476 - Remove nsITransferable.kFlavorHasDataProvider. r=NeilDeakin
Depends on D8074

Differential Revision: https://phabricator.services.mozilla.com/D8075

--HG--
extra : moz-landing-system : lando
2018-10-16 20:35:10 +00:00
Neil Deakin f659f51906 Bug 1310193 - Remove wrapping of nsISupports as nsISupportsInterfacePointer in transferables. r=smaug
--HG--
extra : rebase_source : 562b3bcd621ad348b7e2ada8151775b188ba58ff
2018-10-07 16:33:07 +02:00
Anny Gakhokidze edf3cdbd07 Bug 1453153 - Initial removal of moz* APIs in DataTransfer, r=enndeakin,r=nika
In DataTransfer, change mozItemCount, mozTypesAt, mozClearDataAt, mozSetDataAt,
mozGetDataAt APIs to be ChromeOnly.

MozReview-Commit-ID: 9uJ9ncrcBL2
2018-08-22 15:10:31 -04:00
Bogdan Tara b6dabcd8c5 Backed out changeset 485fdf8e37e8 (bug 1453153) for clipboard failures on test_findbar.xul CLOSED TREE 2018-08-11 03:21:43 +03:00
Anny Gakhokidze be49493caf Bug 1453153 - Initial removal of moz* APIs in DataTransfer, r=enndeakin,nika
In DataTransfer, change mozItemCount, mozTypesAt, mozClearDataAt, mozSetDataAt,
mozGetDataAt APIs to be ChromeOnly.

MozReview-Commit-ID: 9uJ9ncrcBL2
2018-08-10 11:57:06 -04:00
Anny Gakhokidze 469c8c4a94 Bug 1461465 - Implement async Clipboard APIs, r=nika,r=enndeakin
MozReview-Commit-ID: 3vCxbaGZtiv
2018-07-31 13:13:02 -04:00
Anny Gakhokidze 535e3c83a1 Bug 1470540 - Improve performance of DataTransfer::CacheExternalClipboardFormats, r=baku,mccr8
Currently, in order to retrieve supported clipboard formats
DataTransfer::CacheExternalClipboardFormats repeatedly makes the same calls to
clipboard->HasDataMatchingFlavors.

In the case when aPlainTextOnly == true only 1 call is made -
clipboard->HasDataMatchingFlavors(kUnicodeMime, ...), and when
aPlainTextOnly == false we have 1 call made for every member of the list
{ kCustomTypesMime, kFileMime, kHTMLMime, kRTFMime, kURLMime, kURLDataMime,
kUnicodeMime, kPNGImageMime } - a total of 8 calls.

We can see that in nsClipboardProxy::HasDataMatchingFlavors, there is a call to
ContentChild::GetSingleton()->SendClipboardHasType.
So when aPlainTextOnly == true, we will have 1 sync message, and when
aPlainTextOnly == false, we will have 8 sync messages.

With the proposed solution, in DataTransfer::CacheExternalClipboardFormats
we will only have 1 sync message regardless of the case because
GetExternalClipboardFormats() will retrieve all supported clipboard
formats at once.

MozReview-Commit-ID: CAmBfqB459v

--HG--
extra : rebase_source : 27f1b420f2613e6a747ed63762f1583ab71ba3e0
2018-06-22 14:28:27 -04:00
Jeff Gilbert 5b753da289 Bug 1470325 - s/FooBinding/Foo_Binding/g - r=qdot
MozReview-Commit-ID: JtTcLL5OPF0
2018-06-26 17:05:01 -07:00
Anny Gakhokidze 61c5f540ba Bug 1351193 - Part 1: Added new DataTransfer constructor, r=nika
Deleted the old Chrome DataTransfer constructor because it was only used
for some tests which can be easily changed. Added a new constructor that
is not Chrome Only.

MozReview-Commit-ID: HjcgafSiWfM
2018-06-04 15:09:17 -04:00
Boris Zbarsky bea3100e53 Bug 1455676 part 14. Remove most use of nsIDOMNode in dom/. r=qdot 2018-05-29 22:58:49 -04:00
Boris Zbarsky 6213894581 Bug 1455676 part 3. Remove nsIDOMNode usage from widget/. r=qdot 2018-05-29 22:58:48 -04:00
Adrian Wielgosik c501e3beb0 Bug 1460940 - Clean up most remaining C++-side uses of nsIDOMDocument. r=bz
MozReview-Commit-ID: LKRnyDPNlle

--HG--
extra : rebase_source : a48b7c72a0f7ede38c91149a04d5de53987736f1
2018-05-11 19:46:15 +02:00
Nathan Froyd 798efd6d66 Bug 1453134 - part 3 - be smarter about input stream semantics in DataTransfer; r=baku
We could have used the new NS_NewCStringInputStream overload here, but
it seemed nicer to directly transfer ownership into the newly-created
stream.  If we're going to be more efficient here, we might as well go
as far as when can without making the code too ugly.
2018-04-11 10:06:17 -04:00
Haik Aftandilian c6b21edd12 Bug 1437281 - OSX dragging image to desktop changes OSX File associations r=mystor
On Mac, when dragging an image, add the image request's MIME type to
the transfer so that the MIME-extension check can be done in the
parent process to avoid content sandboxing issues.

MozReview-Commit-ID: 3cb4fCr6GnL

--HG--
extra : rebase_source : 43720237b467765401b5504c57bbc1b43d4dfdc0
2018-03-27 14:55:33 -07:00
Coroiu Cristina 8915d0accf Backed out changeset 608119812c07 (bug 1437281) on request from haik a=backout 2018-03-26 23:53:06 +03:00
Haik Aftandilian ce6d9e36aa Bug 1437281 - OSX dragging image to desktop changes OSX File associations r=mystor
When dragging an image, add the image request's MIME type to the transfer
so that the MIME-extension check can be done in the parent process.

Move the MIME-extension check to the parent process to avoid
issues caused by content process sandboxing.

MozReview-Commit-ID: 3cb4fCr6GnL

--HG--
extra : rebase_source : ec49b8c83613be844fe4cd88a5024ac41a845199
2018-03-22 14:04:23 -07:00
Boris Zbarsky dae236c7cb Bug 1444686 part 14. Remove nsIDOMDataTransfer. r=mystor
MozReview-Commit-ID: BLi4w10clkP
2018-03-13 16:24:01 -04:00
Boris Zbarsky 0d4f7a1b44 Bug 1444686 part 7. Get rid of unused nsIDOMDataTransfer members. r=mystor
MozReview-Commit-ID: 53ShdRZHlC9
2018-03-13 16:24:00 -04:00