Commit Graph

31 Commits

Author SHA1 Message Date
Michael Layzell
a3d57f1d3f Bug 1342057 - Part 1: Use correct MIME type for files as DataTransferItem.type, r=baku
MozReview-Commit-ID: 4hrZ3YoGTJj
2017-03-07 18:18:42 -05:00
Wes Kocher
4424ad9cd7 Backed out 2 changesets (bug 1342057) for android failures in test_clipboard_events.html a=backout
Backed out changeset 5a1e069911fa (bug 1342057)
Backed out changeset 6758f6e0b836 (bug 1342057)

MozReview-Commit-ID: 6MHaDaORlqx
2017-03-07 11:44:03 -08:00
Michael Layzell
b985d62013 Bug 1342057 - Part 1: Use correct MIME type for files as DataTransferItem.type, r=baku
MozReview-Commit-ID: 4hrZ3YoGTJj
2017-03-07 12:45:58 -05:00
Andrea Marchesini
c980b8d524 Bug 1323935 - Entries API must use NS_NewLocalFile instead of NS_NewNativeLocalFile, r=smaug 2017-01-18 04:48:29 +01:00
Michael Layzell
da36f2140e Bug 1330979 - Don't raise NS_ERROR_DOM_SECURITY_ERROR on DataTransfer access violations, r=baku
In our previous code, we would accidentially not perform the correct
security checks when retreiving data from DataTransferItems in some
situations. The regressing patch fixed this behavior and ensured that we
always perform the correct security checks, making any "insecure"
accesses (such as accesses to file data from the OS in DragEnter) would
raise an NS_ERROR_DOM_SECURTY_ERROR. This behavior is not consistent
with Chrome, and thus OneDrive would accidentally trigger an exception
and break its d&d handling logic.

With this patch our behavior for "insecure" accesses to file data from
the OS is more in line with Chrome's, in that we now don't raise an
exception, but instead just produce the value "null" when the data
should not be avaliable yet. From my quick test this fixes the problem
with OneDrive, and should be a fairly trivial patch to uplift to Beta,
with very little risk.

This patch doesn't include a test, as Drag and Drop is a very difficult
component to test in automation, however I am currently working on
defining a set of manual tests for the Drag and Drop component, and I'll
make sure that our behavior for "insecure" accesses is tested in those
tests in the future.

MozReview-Commit-ID: 4pnPyL1tgcV
2017-01-13 15:39:21 -05:00
Andrea Marchesini
3a9551a834 Bug 1284987 - Entries API - part 2 - FileSystemEntry.getParent, r=smaug 2016-11-03 07:55:30 +01:00
Michael Layzell
ca1ad87346 Bug 1303999 - Check our kind after filling in external data in GetAsFile and GetAsString, r=baku
MozReview-Commit-ID: CbHWTDTY3Xs
2016-10-20 15:09:13 -04:00
Boris Zbarsky
3f10f5ed57 Bug 1308287 part 1. Change [NeedsSubjectPrincipal] to only do the Maybe thing for interfaces that can be exposed to workers. r=baku
The idea is to not make consumers think about whether the principal exists or
not when the caller knows for sure that it does.

The substantive changes are in dom/bindings, nsHTMLDocument::SetDesignMode, and
around the CanUseStorage bits.  Everything else is pretty mechanical.
2016-10-10 21:07:48 -04:00
Boris Zbarsky
241a4d12eb Bug 1298243 part 5. Notify the DataTransfer whenever its types list changes. r=mystor 2016-10-10 21:07:47 -04:00
Boris Zbarsky
298989ed98 Bug 1298243 part 2. Make the type of a DataTransferItem immutable. r=mystor 2016-10-10 21:07:47 -04:00
Andrea Marchesini
995acd8d49 Bug 1297393 - Make passing of subject principals to webidl entry points explicit - part 2 - DataTransferItem, r=ehsan 2016-09-29 08:55:20 +02:00
Nicholas Nethercote
34dcc7b852 Bug 1299384 - Use MOZ_MUST_USE with NS_warn_if_impl(). r=erahm.
This change avoids lots of false positives for Coverity's CHECKED_RETURN
warning, caused by NS_WARN_IF's current use in both statement-style and
expression-style.

In the case where the code within the NS_WARN_IF has side-effects, I made the
following change.

> NS_WARN_IF(NS_FAILED(FunctionWithSideEffects()));
> -->
> Unused << NS_WARN_IF(NS_FAILED(FunctionWithSideEffects()));

In the case where the code within the NS_WARN_IF lacks side-effects, I made the
following change.

> NS_WARN_IF(!condWithoutSideEffects);
> -->
> NS_WARNING_ASSERTION(condWithoutSideEffects, "msg");

This has two improvements.
- The condition is not evaluated in non-debug builds.
- The sense of the condition is inverted to the familiar "this condition should
  be true" sense used in assertions.

A common variation on the side-effect-free case is the following.

> nsresult rv = Fn();
> NS_WARN_IF_(NS_FAILED(rv));
> -->
> DebugOnly<nsresult rv> = Fn();
> NS_WARNING_ASSERTION(NS_SUCCEEDED(rv), "Fn failed");

--HG--
extra : rebase_source : 58788245021096efa8372a9dc1d597a611d45611
2016-09-02 17:12:24 +10:00
Michael Layzell
e4a2ac3b82 Bug 1297186 - Correctly propagate principals when getting the files list in DataTransfer, r=enndeakin
MozReview-Commit-ID: 8LRBekaOUJR
2016-09-01 11:22:15 -04:00
Michael Layzell
6dbd9e26cb Bug 1296041 - Check subject principal in Data(), instead of IndexedGetter, r=baku
MozReview-Commit-ID: 4aeGjTejP3z
2016-08-18 15:54:21 -04:00
Andrea Marchesini
de09eb6947 Bug 1295570 - Entries API - part 4 - Rename DirectoryEntry to FileSystemDirectoryEntry, r=smaug
--HG--
rename : dom/filesystem/compat/DirectoryEntry.cpp => dom/filesystem/compat/FileSystemDirectoryEntry.cpp
rename : dom/filesystem/compat/DirectoryEntry.h => dom/filesystem/compat/FileSystemDirectoryEntry.h
rename : dom/filesystem/compat/RootDirectoryEntry.cpp => dom/filesystem/compat/FileSystemRootDirectoryEntry.cpp
rename : dom/filesystem/compat/RootDirectoryEntry.h => dom/filesystem/compat/FileSystemRootDirectoryEntry.h
2016-08-18 09:18:05 +02:00
Andrea Marchesini
e06457dcf2 Bug 1295570 - Entries API - part 3 - Rename FileEntry to FileSystemFileEntry, r=smaug
--HG--
rename : dom/filesystem/compat/FileEntry.cpp => dom/filesystem/compat/FileSystemFileEntry.cpp
rename : dom/filesystem/compat/FileEntry.h => dom/filesystem/compat/FileSystemFileEntry.h
2016-08-18 09:17:48 +02:00
Andrea Marchesini
94d10aeb4c Bug 1295570 - Entries API - part 2 - Rename Entry to FileSystemEntry, r=smaug
--HG--
rename : dom/filesystem/compat/Entry.cpp => dom/filesystem/compat/FileSystemEntry.cpp
rename : dom/filesystem/compat/Entry.h => dom/filesystem/compat/FileSystemEntry.h
2016-08-18 09:17:25 +02:00
Andrea Marchesini
f0c18d080e Bug 1295570 - Entries API - part 1 - Rename DOMFileSystem to FileSystem, r=smaug
--HG--
rename : dom/filesystem/compat/DOMFileSystem.cpp => dom/filesystem/compat/FileSystem.cpp
rename : dom/filesystem/compat/DOMFileSystem.h => dom/filesystem/compat/FileSystem.h
rename : dom/webidl/DOMFileSystem.webidl => dom/webidl/FileSystem.webidl
2016-08-18 09:17:02 +02:00
Michael Layzell
02881e51c3 Bug 1290688 - Part 1: Don't provide more than one type from the clipboard when pasting images, r=baku 2016-08-15 13:16:10 -04:00
Olli Pettay
47a98b8ad1 Bug 1289255 - Implement DataTransferItem.webkitGetAsEntry, r=baku
--HG--
extra : rebase_source : 10517eeb5b5a68204514527c8a904ab216df6534
2016-07-29 14:42:33 +03:00
Olli Pettay
811035a57c Bug 1289900 - DataTransferItem::mCachedFile leaks, r=khuey
--HG--
extra : rebase_source : 610259321f53ef77d9c81039bd30de9e2643e083
2016-07-28 00:37:12 +03:00
Michael Layzell
01c990e206 Bug 1278939 - Store nsIFile entries as nsIFile, but continue to produce dom::File objects from relevant APIs, r=enndeakin 2016-07-04 15:45:45 -04:00
Michael Layzell
e3f9006f22 Bug 906420 - Part 3: Either expose files or strings generated by system drag or clipboard events to content, not both, r=baku 2016-07-04 15:45:45 -04:00
Michael Layzell
038736ebef Bug 906420 - Part 2: Add support for images to DataTransfer, r=baku 2016-07-04 15:45:45 -04:00
Michael Layzell
dde888ae28 Bug 906420 - Part 1: Implement DataTransferItem and DataTransferItemList, r=baku 2016-07-04 15:45:45 -04:00
Carsten "Tomcat" Book
afff301b32 Backed out changeset 5c836acf3197 (bug 906420) on developer request by baku
--HG--
extra : rebase_source : 9f109cdb706feef6d2bcd9a2e71f8c4d3c17ebdf
2016-06-09 15:30:53 +02:00
Carsten "Tomcat" Book
cec713e0c7 Backed out changeset e3615a839821 (bug 906420)
--HG--
extra : rebase_source : f9898c9163ce45b9ecfeff88a0f140e890f40ef6
2016-06-09 15:30:37 +02:00
Carsten "Tomcat" Book
ed14bc0dce Backed out changeset 18b3c95f1a38 (bug 906420)
--HG--
extra : rebase_source : 2cb14884f71aa8a41e56c935abe93755b0b0d8db
2016-06-09 15:30:35 +02:00
Michael Layzell
5cb6cd1b79 Bug 906420 - Part 3: Either expose files or strings generated by system drag or clipboard events to content, not both, r=baku 2016-06-07 18:05:55 -04:00
Michael Layzell
eec2a353e0 Bug 906420 - Part 2: Add support for images to DataTransfer, r=baku 2016-06-07 18:05:55 -04:00
Michael Layzell
bd973fcaa4 Bug 906420 - Part 1: Implement DataTransferItem and DataTransferItemList, r=baku 2016-06-07 18:05:55 -04:00