[Attachment Support] Introduce data structures and IPC support for writing promised...
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-01-02  Wenson Hsieh  <wenson_hsieh@apple.com>
2
3         [Attachment Support] Introduce data structures and IPC support for writing promised blobs
4         https://bugs.webkit.org/show_bug.cgi?id=181189
5
6         Reviewed by Tim Horton.
7
8         Introduces a new header containing structs to be used for writing blob data when dragging. PromisedBlobInfo
9         represents information needed to declare data on the pasteboard that will eventually be provided via a Blob.
10         This includes the type and filename of the Blob-backed content. PromisedBlobData represents information needed
11         to actually deliver the Blob's content to the platform, and is sent some time after its corresponding
12         PromisedBlobInfo. The content may either be in the form of a file path (as is the case using the previous
13         declareAndWriteAttachment codepath) or a data buffer (which we would use if the Blob is not already backed by a
14         file on disk).
15
16         No new tests, since there is no observable change in functionality yet.
17
18         * WebCore.xcodeproj/project.pbxproj:
19         * platform/PromisedBlobInfo.h: Added.
20         (WebCore::PromisedBlobInfo::operator bool const):
21         (WebCore::PromisedBlobData::hasData const):
22         (WebCore::PromisedBlobData::hasFile const):
23         (WebCore::PromisedBlobData::operator bool const):
24         (WebCore::PromisedBlobData::fulfills const):
25
26 2018-01-02  Brady Eidson  <beidson@apple.com>
27
28         Make MessagePortChannel::takeAllMessagesFromRemote asynchronous.
29         https://bugs.webkit.org/show_bug.cgi?id=181205
30
31         Reviewed by Alex Christensen.
32
33         No new tests (No behavior change)
34
35         This is needed for the ongoing WK2 MessagePort work.
36
37         For WK1 in-process MessagePorts it is still synchronous; no behavior change.
38
39         * dom/InProcessMessagePortChannel.cpp:
40         (WebCore::InProcessMessagePortChannel::takeAllMessagesFromRemote):
41         * dom/InProcessMessagePortChannel.h:
42
43         * dom/MessagePort.cpp:
44         (WebCore::MessagePort::dispatchMessages):
45         * dom/MessagePortChannel.h:
46
47 2018-01-02  Jiewen Tan  <jiewen_tan@apple.com>
48
49         Add a WebAuthentication runtime feature flag
50         https://bugs.webkit.org/show_bug.cgi?id=181220
51         <rdar://problem/36055305>
52
53         Reviewed by Brent Fulgham.
54
55         This patch basically renames the CredentialManagement runtime feature flag into
56         WebAuthentication runtime feature flag.
57
58         No tests.
59
60         * Modules/credentialmanagement/BasicCredential.idl:
61         * Modules/credentialmanagement/CredentialsContainer.idl:
62         * Modules/credentialmanagement/NavigatorCredentials.idl:
63         * Modules/webauthn/PublicKeyCredential.idl:
64         * page/RuntimeEnabledFeatures.h:
65         (WebCore::RuntimeEnabledFeatures::setWebAuthenticationEnabled):
66         (WebCore::RuntimeEnabledFeatures::webAuthenticationEnabled const):
67         (WebCore::RuntimeEnabledFeatures::setCredentialManagementEnabled): Deleted.
68         (WebCore::RuntimeEnabledFeatures::credentialManagementEnabled const): Deleted.
69
70 2018-01-02  Wenson Hsieh  <wenson_hsieh@apple.com>
71
72         [Attachment Support] Don't Blob-convert images and attachments with https:, http: or data: urls
73         https://bugs.webkit.org/show_bug.cgi?id=181143
74         <rdar://problem/36200381>
75
76         Reviewed by Tim Horton.
77
78         Clients such as Mail would expect pasting or dropping an image with src="https://..." to result in the source
79         URL being preserved (i.e. staying as remote images) instead of creating image attachments out of them. This
80         patch hooks into the shouldConvertToBlob() check added in r226272 so that it applies to attachment element
81         replacement as well.
82
83         Test: WKAttachmentTests.DoNotInsertDataURLImagesAsAttachments
84
85         * editing/cocoa/WebContentReaderCocoa.mm:
86         (WebCore::shouldConvertToBlob):
87         (WebCore::replaceRichContentWithAttachments):
88
89 2018-01-02  Brady Eidson  <beidson@apple.com>
90
91         Identify MessagePorts by a globally unique MessagePortIdentifier.
92         https://bugs.webkit.org/show_bug.cgi?id=181172
93
94         Reviewed by Alex Christensen.
95
96         No new tests (Behavior change covered by all existing tests).
97
98         This cleans up the abstract MessagePortChannel interface to be in terms of identifiers
99         instead of actual MessagePort objects.
100         
101         The identifiers are compounded with the current ProcessIdentifier meaning they are global
102         across all processes for the running UI process, enabling easy cross-process communication.
103         
104         (Actual cross-process communication comes in a followup)
105         
106         * WebCore.xcodeproj/project.pbxproj:
107         
108         * dom/InProcessMessagePortChannel.cpp:
109         (WebCore::InProcessMessagePortChannel::createChannelBetweenPorts):
110         (WebCore::InProcessMessagePortChannel::isConnectedTo):
111         (WebCore::InProcessMessagePortChannel::entangleWithRemoteIfOpen):
112         (WebCore::InProcessMessagePortChannel::entangleIfOpen): Deleted.
113         * dom/InProcessMessagePortChannel.h:
114         
115         * dom/MessageChannel.cpp:
116         (WebCore::MessageChannel::MessageChannel):
117         (WebCore::m_port2):
118         
119         * dom/MessagePort.cpp:
120         (WebCore::allMessagePortsLock):
121         (WebCore::MessagePort::ref const):
122         (WebCore::MessagePort::deref const):
123         (WebCore::MessagePort::existingMessagePortForIdentifier):
124         (WebCore::MessagePort::MessagePort):
125         (WebCore::MessagePort::~MessagePort):
126         (WebCore::MessagePort::postMessage):
127         (WebCore::MessagePort::entangleWithRemote):
128         (WebCore::MessagePort::entanglePorts):
129         (WebCore::MessagePort::entangle): Deleted.
130         * dom/MessagePort.h:
131         
132         * dom/MessagePortChannel.h:
133         
134         * dom/MessagePortIdentifier.h: Added.
135         (WebCore::operator==):
136         (WebCore::MessagePortIdentifier::encode const):
137         (WebCore::MessagePortIdentifier::decode):
138         (WebCore::MessagePortIdentifier::hash const):
139         (WTF::MessagePortIdentifierHash::hash):
140         (WTF::MessagePortIdentifierHash::equal):
141         (WTF::HashTraits<WebCore::MessagePortIdentifier>::emptyValue):
142         (WTF::HashTraits<WebCore::MessagePortIdentifier>::constructDeletedValue):
143         (WTF::HashTraits<WebCore::MessagePortIdentifier>::isDeletedValue):
144
145 2018-01-02  Youenn Fablet  <youenn@apple.com>
146
147         Memory cache should not reuse resources with different credential fetch option
148         https://bugs.webkit.org/show_bug.cgi?id=181212
149
150         Reviewed by Alex Christensen.
151
152         Covered by rebased test.
153
154         * loader/cache/CachedResourceLoader.cpp:
155         (WebCore::CachedResourceLoader::determineRevalidationPolicy const):
156
157 2018-01-02  Jiewen Tan  <jiewen_tan@apple.com>
158
159         Update Credential Management API for WebAuthentication
160         https://bugs.webkit.org/show_bug.cgi?id=181082
161         <rdar://problem/36055239>
162
163         Reviewed by Brent Fulgham.
164
165         Part 2/2
166
167         This patch implements Core API from Credential Management API: https://www.w3.org/TR/credential-management-1/#core.
168         which is required by WebAuthN. It also sets the CredentialManagement runtime flag to enable testing. Note that it
169         introduces a dummy PublicKeyCredential interface for testing functionalities of the Credential interface, which
170         cannot be instantiated.
171
172         Tests: http/wpt/credential-management/credentialscontainer-create-basics.https.html
173                http/wpt/credential-management/credentialscontainer-get-basics.https.html
174                http/wpt/credential-management/credentialscontainer-preventSilentAccess-basics.https.html
175                http/wpt/credential-management/idl.https.html
176
177         * CMakeLists.txt:
178         * DerivedSources.make:
179         * Modules/credentialmanagement/BasicCredential.cpp:
180         (WebCore::BasicCredential::BasicCredential):
181         (WebCore::BasicCredential::type const):
182         * Modules/credentialmanagement/BasicCredential.h:
183         (WebCore::BasicCredential::discovery const):
184         * Modules/credentialmanagement/BasicCredential.idl:
185         * Modules/credentialmanagement/CredentialCreationOptions.h:
186         * Modules/credentialmanagement/CredentialCreationOptions.idl:
187         * Modules/credentialmanagement/CredentialRequestOptions.h:
188         * Modules/credentialmanagement/CredentialRequestOptions.idl:
189         * Modules/credentialmanagement/CredentialsContainer.cpp:
190         (WebCore::CredentialsContainer::CredentialsContainer):
191         (WebCore::CredentialsContainer::isSameOriginWithItsAncestors):
192         (WebCore::CredentialsContainer::dispatchTask):
193         (WebCore::CredentialsContainer::get):
194         (WebCore::CredentialsContainer::store):
195         (WebCore::CredentialsContainer::isCreate):
196         (WebCore::CredentialsContainer::preventSilentAccess):
197         * Modules/credentialmanagement/CredentialsContainer.h:
198         (WebCore::CredentialsContainer::create):
199         (WebCore::CredentialsContainer::CredentialsContainer): Deleted.
200         * Modules/credentialmanagement/CredentialsContainer.idl:
201         * Modules/credentialmanagement/NavigatorCredentials.cpp:
202         (WebCore::NavigatorCredentials::credentials):
203         * Modules/credentialmanagement/NavigatorCredentials.h:
204         * Modules/credentialmanagement/NavigatorCredentials.idl:
205         * Modules/webauthn/PublicKeyCredential.cpp: Copied from Source/WebCore/Modules/credentialmanagement/BasicCredential.cpp.
206         (WebCore::PublicKeyCredential::PublicKeyCredential):
207         (WebCore::PublicKeyCredential::collectFromCredentialStore):
208         (WebCore::PublicKeyCredential::discoverFromExternalSource):
209         (WebCore::PublicKeyCredential::store):
210         (WebCore::PublicKeyCredential::create):
211         * Modules/webauthn/PublicKeyCredential.h: Copied from Source/WebCore/Modules/credentialmanagement/BasicCredential.cpp.
212         * Modules/webauthn/PublicKeyCredential.idl: Copied from Source/WebCore/Modules/credentialmanagement/BasicCredential.idl.
213         * Sources.txt:
214         * WebCore.xcodeproj/project.pbxproj:
215         * bindings/js/WebCoreBuiltinNames.h:
216         * page/RuntimeEnabledFeatures.h:
217
218 2018-01-02  Oleksandr Skachkov  <gskachkov@gmail.com>
219
220         WebAssembly: sending module to iframe fails
221         https://bugs.webkit.org/show_bug.cgi?id=179263
222
223         Reviewed by JF Bastien.
224
225         Allow use WebAssembly.Module as input parameters for postMessage 
226         in window and iframe object. To prevent sending message to iframe
227         that is not ready, in iframe-* test we are waiting message from
228         iframe only after that we send message to it.   
229
230         Tests: wasm/iframe-parent-postmessage.html
231                wasm/iframe-postmessage.html
232                wasm/window-postmessage.html
233
234         * bindings/js/SerializedScriptValue.cpp:
235         (WebCore::CloneSerializer::dumpIfTerminal):
236         * bindings/js/SerializedScriptValue.h:
237         * page/DOMWindow.cpp:
238         (WebCore::DOMWindow::postMessage):
239
240 == Rolled over to ChangeLog-2018-01-01 ==