Changeset 221639 in webkit
- Timestamp:
- Sep 5, 2017 3:53:59 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 5 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r221638 r221639 1 2017-09-05 Chris Dumez <cdumez@apple.com> 2 3 FileSystemEntry API should ignore hidden files 4 https://bugs.webkit.org/show_bug.cgi?id=176292 5 <rdar://problem/34257666> 6 7 Reviewed by Andreas Kling. 8 9 Add layout test coverage. 10 11 * editing/pasteboard/enties-api/datatransfer-items-drop-getAsEntry-expected.txt: 12 * editing/pasteboard/enties-api/datatransfer-items-drop-getAsEntry.html: 13 * editing/pasteboard/enties-api/datatransfer-items-drop-hidden-file-expected.txt: Added. 14 * editing/pasteboard/enties-api/datatransfer-items-drop-hidden-file.html: Added. 15 * fast/forms/file/entries-api/resources/testFiles/.hidden.txt: Added. 16 * fast/forms/file/entries-api/resources/testFiles/.hidden/hidden.txt: Added. 17 * platform/win/TestExpectations: 18 1 19 2017-09-05 Matt Lewis <jlewis3@apple.com> 2 20 -
trunk/LayoutTests/editing/pasteboard/enties-api/datatransfer-items-drop-getAsEntry-expected.txt
r221556 r221639 17 17 PASS secondDataTransferItem.type is "" 18 18 PASS secondFile.name is "testFiles" 19 PASS secondFile.size is 2 0419 PASS secondFile.size is 272 20 20 PASS secondFile.type is "" 21 21 PASS secondEntry.isDirectory is true -
trunk/LayoutTests/editing/pasteboard/enties-api/datatransfer-items-drop-getAsEntry.html
r221556 r221639 38 38 secondFile = secondDataTransferItem.getAsFile(); 39 39 shouldBeEqualToString("secondFile.name", "testFiles"); 40 shouldBe("secondFile.size", "2 04"); // Chrome returns folder size, Firefox returns 0.40 shouldBe("secondFile.size", "272"); // Chrome returns folder size, Firefox returns 0. 41 41 shouldBeEqualToString("secondFile.type", ""); 42 42 -
trunk/LayoutTests/platform/win/TestExpectations
r221635 r221639 581 581 # TODO Missing WebSpeech implementation 582 582 webkit.org/b/136224 fast/speechsynthesis [ Skip ] 583 584 # Test is Posix-specific. 585 editing/pasteboard/enties-api/datatransfer-items-drop-hidden-file.html [ Skip ] 583 586 584 587 # TODO Impossible to test text-only-zoom from DRT on Windows -
trunk/Source/WebCore/ChangeLog
r221630 r221639 1 2017-09-05 Chris Dumez <cdumez@apple.com> 2 3 FileSystemEntry API should ignore hidden files 4 https://bugs.webkit.org/show_bug.cgi?id=176292 5 <rdar://problem/34257666> 6 7 Reviewed by Andreas Kling. 8 9 FileSystemEntry API should ignore hidden files as the user likely does not mean 10 to expose those when drag'n dropping a folder. 11 12 Test: editing/pasteboard/enties-api/datatransfer-items-drop-hidden-file.html 13 14 * Modules/entriesapi/DOMFileSystem.cpp: 15 (WebCore::listDirectoryWithMetadata): 16 (WebCore::validatePathIsExpectedType): 17 (WebCore::fileType): 18 (WebCore::DOMFileSystem::getEntry): 19 1 20 2017-09-05 Myles C. Maxfield <mmaxfield@apple.com> 2 21 -
trunk/Source/WebCore/Modules/entriesapi/DOMFileSystem.cpp
r221608 r221639 57 57 for (auto& childPath : childPaths) { 58 58 auto metadata = fileMetadata(childPath); 59 if (!metadata )59 if (!metadata || metadata.value().isHidden) 60 60 continue; 61 61 listedChildren.uncheckedAppend(ListedChild { pathGetFileName(childPath), metadata.value().type }); … … 165 165 166 166 auto metadata = fileMetadata(fullPath); 167 if (!metadata )167 if (!metadata || metadata.value().isHidden) 168 168 return Exception { NotFoundError, ASCIILiteral("Path does not exist") }; 169 169 … … 172 172 173 173 return WTFMove(virtualPath); 174 } 175 176 static std::optional<FileMetadata::Type> fileType(const String& fullPath) 177 { 178 auto metadata = fileMetadata(fullPath); 179 if (!metadata || metadata.value().isHidden) 180 return std::nullopt; 181 return metadata.value().type; 174 182 } 175 183 … … 298 306 299 307 m_workQueue->dispatch([this, context = makeRef(context), fullPath = crossThreadCopy(fullPath), resolvedVirtualPath = crossThreadCopy(resolvedVirtualPath), completionCallback = WTFMove(completionCallback)]() mutable { 300 std::optional<FileMetadata::Type> entryType; 301 if (auto metadata = fileMetadata(fullPath)) 302 entryType = metadata.value().type; 308 auto entryType = fileType(fullPath); 303 309 callOnMainThread([this, context = WTFMove(context), resolvedVirtualPath = crossThreadCopy(resolvedVirtualPath), entryType, completionCallback = WTFMove(completionCallback)]() mutable { 304 310 if (!entryType) {
Note: See TracChangeset
for help on using the changeset viewer.