Refactor data passed along for a "GetRecord" request.
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-08-02  Brady Eidson  <beidson@apple.com>
2
3         Refactor data passed along for a "GetRecord" request.
4         https://bugs.webkit.org/show_bug.cgi?id=160352
5
6         Reviewed by Tim Horton.
7
8         No new tests (No behavior change).
9
10         Adding this new object lets us easily add new data passed along for GetRecord
11         requests going forward.
12
13         * WebCore.xcodeproj/project.pbxproj:
14         * CMakeLists.txt:
15
16         * Modules/indexeddb/IDBObjectStore.cpp:
17         (WebCore::IDBObjectStore::get):
18
19         * Modules/indexeddb/IDBTransaction.cpp:
20         (WebCore::IDBTransaction::requestGetRecord):
21         (WebCore::IDBTransaction::requestIndexRecord):
22         (WebCore::IDBTransaction::getRecordOnServer):
23         * Modules/indexeddb/IDBTransaction.h:
24
25         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
26         (WebCore::IDBClient::IDBConnectionProxy::getRecord):
27         * Modules/indexeddb/client/IDBConnectionProxy.h:
28
29         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
30         (WebCore::IDBClient::IDBConnectionToServer::getRecord):
31         * Modules/indexeddb/client/IDBConnectionToServer.h:
32         * Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
33
34         * Modules/indexeddb/server/IDBServer.cpp:
35         (WebCore::IDBServer::IDBServer::getRecord):
36         * Modules/indexeddb/server/IDBServer.h:
37
38         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
39         (WebCore::IDBServer::UniqueIDBDatabase::getRecord):
40         * Modules/indexeddb/server/UniqueIDBDatabase.h:
41
42         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
43         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::getRecord):
44         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
45
46         * Modules/indexeddb/shared/IDBGetRecordData.cpp: Added.
47         (WebCore::IDBGetRecordData::isolatedCopy):
48         * Modules/indexeddb/shared/IDBGetRecordData.h: Added.
49         (WebCore::IDBGetRecordData::encode):
50         (WebCore::IDBGetRecordData::decode):
51
52         * Modules/indexeddb/shared/InProcessIDBServer.cpp:
53         (WebCore::InProcessIDBServer::getRecord):
54         * Modules/indexeddb/shared/InProcessIDBServer.h:
55
56 2016-08-01  Youenn Fablet  <youenn@apple.com>
57
58         [Fetch API] Pass directly FetchRequest fetch options to ThreadableLoader
59         https://bugs.webkit.org/show_bug.cgi?id=160407
60
61         Reviewed by Sam Weinig.
62
63         No change of behavior.
64
65         Added a ResourceLoaderOptions constructor that takes a FetchOptions as input.
66         Removed setters and getters of ResourceLoaderOptions as it is a struct.
67         Updated member fields accordingly.
68
69         Updated code accordingly.
70         Removed explicit option setting if it is the same as the default value.
71
72         * Modules/fetch/FetchLoader.cpp:
73         (WebCore::FetchLoader::start):
74         * css/CSSFontFaceSrcValue.cpp:
75         (WebCore::CSSFontFaceSrcValue::cachedFont):
76         * css/CSSImageSetValue.cpp:
77         (WebCore::CSSImageSetValue::cachedImageSet):
78         * css/CSSImageValue.cpp:
79         (WebCore::CSSImageValue::cachedImage):
80         * dom/ScriptElement.cpp:
81         (WebCore::ScriptElement::requestScript):
82         * fileapi/FileReaderLoader.cpp:
83         (WebCore::FileReaderLoader::start):
84         * html/HTMLLinkElement.cpp:
85         (WebCore::HTMLLinkElement::process):
86         * inspector/InspectorNetworkAgent.cpp:
87         (WebCore::InspectorNetworkAgent::loadResource):
88         * loader/CrossOriginPreflightChecker.cpp:
89         (WebCore::CrossOriginPreflightChecker::validatePreflightResponse):
90         (WebCore::CrossOriginPreflightChecker::startPreflight):
91         * loader/DocumentThreadableLoader.cpp:
92         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
93         (WebCore::DocumentThreadableLoader::makeCrossOriginAccessRequest):
94         (WebCore::DocumentThreadableLoader::makeSimpleCrossOriginAccessRequest):
95         (WebCore::DocumentThreadableLoader::redirectReceived):
96         (WebCore::DocumentThreadableLoader::didReceiveResponse):
97         (WebCore::DocumentThreadableLoader::preflightSuccess):
98         (WebCore::DocumentThreadableLoader::loadRequest):
99         * loader/ImageLoader.cpp:
100         (WebCore::ImageLoader::updateFromElement):
101         * loader/ResourceLoader.cpp:
102         (WebCore::ResourceLoader::ResourceLoader):
103         (WebCore::ResourceLoader::init):
104         (WebCore::ResourceLoader::start):
105         (WebCore::ResourceLoader::setDefersLoading):
106         (WebCore::ResourceLoader::setDataBufferingPolicy):
107         (WebCore::ResourceLoader::addDataOrBuffer):
108         (WebCore::ResourceLoader::willSendRequestInternal):
109         (WebCore::ResourceLoader::didReceiveResponse):
110         (WebCore::ResourceLoader::didReceiveDataOrBuffer):
111         (WebCore::ResourceLoader::didFinishLoadingOnePart):
112         (WebCore::ResourceLoader::cleanupForError):
113         (WebCore::ResourceLoader::shouldUseCredentialStorage):
114         (WebCore::ResourceLoader::didReceiveAuthenticationChallenge):
115         * loader/ResourceLoader.h:
116         (WebCore::ResourceLoader::shouldSendResourceLoadCallbacks):
117         (WebCore::ResourceLoader::setSendCallbackPolicy):
118         (WebCore::ResourceLoader::shouldSniffContent):
119         (WebCore::ResourceLoader::shouldIncludeCertificateInfo):
120         * loader/ResourceLoaderOptions.h:
121         (WebCore::ResourceLoaderOptions::ResourceLoaderOptions):
122         (WebCore::ResourceLoaderOptions::sendLoadCallbacks): Deleted.
123         (WebCore::ResourceLoaderOptions::setSendLoadCallbacks): Deleted.
124         (WebCore::ResourceLoaderOptions::sniffContent): Deleted.
125         (WebCore::ResourceLoaderOptions::setSniffContent): Deleted.
126         (WebCore::ResourceLoaderOptions::dataBufferingPolicy): Deleted.
127         (WebCore::ResourceLoaderOptions::setDataBufferingPolicy): Deleted.
128         (WebCore::ResourceLoaderOptions::allowCredentials): Deleted.
129         (WebCore::ResourceLoaderOptions::setAllowCredentials): Deleted.
130         (WebCore::ResourceLoaderOptions::securityCheck): Deleted.
131         (WebCore::ResourceLoaderOptions::setSecurityCheck): Deleted.
132         (WebCore::ResourceLoaderOptions::certificateInfoPolicy): Deleted.
133         (WebCore::ResourceLoaderOptions::setCertificateInfoPolicy): Deleted.
134         (WebCore::ResourceLoaderOptions::contentSecurityPolicyImposition): Deleted.
135         (WebCore::ResourceLoaderOptions::setContentSecurityPolicyImposition): Deleted.
136         (WebCore::ResourceLoaderOptions::defersLoadingPolicy): Deleted.
137         (WebCore::ResourceLoaderOptions::setDefersLoadingPolicy): Deleted.
138         (WebCore::ResourceLoaderOptions::cachingPolicy): Deleted.
139         (WebCore::ResourceLoaderOptions::setCachingPolicy): Deleted.
140         * loader/SubresourceLoader.cpp:
141         (WebCore::SubresourceLoader::checkRedirectionCrossOriginAccessControl):
142         * loader/TextTrackLoader.cpp:
143         (WebCore::TextTrackLoader::load):
144         * loader/cache/CachedRawResource.cpp:
145         (WebCore::CachedRawResource::setDataBufferingPolicy):
146         * loader/cache/CachedResource.cpp:
147         (WebCore::CachedResource::load):
148         * loader/cache/CachedResource.h:
149         (WebCore::CachedResource::shouldSendResourceLoadCallbacks):
150         (WebCore::CachedResource::dataBufferingPolicy):
151         (WebCore::CachedResource::allowsCaching):
152         * loader/cache/CachedResourceLoader.cpp:
153         (WebCore::CachedResourceLoader::canRequest):
154         * loader/cache/CachedResourceRequest.cpp:
155         (WebCore::CachedResourceRequest::setAsPotentiallyCrossOrigin):
156         * loader/cache/CachedResourceRequest.h:
157         (WebCore::CachedResourceRequest::allowsCaching):
158         * loader/cache/CachedResourceRequestInitiators.cpp:
159         (WebCore::CachedResourceRequestInitiators::CachedResourceRequestInitiators):
160         * loader/cache/CachedResourceRequestInitiators.h:
161         * loader/mac/ResourceLoaderMac.mm:
162         (WebCore::ResourceLoader::willCacheResponse):
163         (WebCore::ResourceLoader::didReceiveDataArray):
164         * page/EventSource.cpp:
165         (WebCore::EventSource::connect):
166         * style/StylePendingResources.cpp:
167         (WebCore::Style::loadPendingImage):
168         (WebCore::Style::loadPendingSVGFilters):
169         * svg/SVGFEImageElement.cpp:
170         (WebCore::SVGFEImageElement::requestImageResource):
171         * svg/SVGFontFaceUriElement.cpp:
172         (WebCore::SVGFontFaceUriElement::loadFont):
173         * svg/SVGUseElement.cpp:
174         (WebCore::SVGUseElement::updateExternalDocument):
175         * workers/WorkerScriptLoader.cpp:
176         (WebCore::WorkerScriptLoader::loadSynchronously):
177         (WebCore::WorkerScriptLoader::loadAsynchronously):
178         * xml/XMLHttpRequest.cpp:
179         (WebCore::XMLHttpRequest::createRequest):
180
181 2016-08-01  Carlos Garcia Campos  <cgarcia@igalia.com>
182
183         [GTK] Move the redirected XComposite window to the web process
184         https://bugs.webkit.org/show_bug.cgi?id=160389
185
186         Reviewed by Žan Doberšek.
187
188         Add helper methods to PlatformDisplayX11 to query X extensions supported by the display.
189
190         * platform/graphics/x11/PlatformDisplayX11.cpp:
191         (WebCore::PlatformDisplayX11::supportsXComposite):
192         (WebCore::PlatformDisplayX11::supportsXDamage):
193         * platform/graphics/x11/PlatformDisplayX11.h:
194
195 2016-08-01  Andreas Kling  <akling@apple.com>
196
197         Shrink MediaQuerySets to fit after parsing.
198         <https://webkit.org/b/160419>
199
200         Reviewed by Antti Koivisto.
201
202         Add shrinkToFit() helpers to MediaQuerySet and MediaQuery
203         and call it after parsing to remove extra capacity from their
204         internal vectors.
205
206         This reduces memory usage by 1.24MB on theverge.com.
207
208         * css/CSSParser.cpp:
209         (WebCore::CSSParser::createMediaRule):
210         * css/MediaList.cpp:
211         (WebCore::MediaQuerySet::parse):
212         (WebCore::MediaQuerySet::shrinkToFit):
213         * css/MediaList.h:
214         * css/MediaQuery.h:
215         (WebCore::MediaQuery::shrinkToFit):
216
217 2016-08-01  Tim Horton  <timothy_horton@apple.com>
218
219         <attachment> action label doesn't wrap, but needs to for some localizations
220         https://bugs.webkit.org/show_bug.cgi?id=160431
221         <rdar://problem/27526464>
222
223         Reviewed by Simon Fraser.
224
225         Test: fast/attachment/attachment-wrapping-action.html
226
227         * rendering/RenderThemeIOS.mm:
228         (WebCore::AttachmentInfo::buildWrappedLines):
229         (WebCore::AttachmentInfo::AttachmentInfo):
230         (WebCore::AttachmentInfo::buildTitleLines): Deleted.
231         Rework buildTitleLines into buildWrappedLines so that we have a
232         generic way to add lines that wrap up to N lines and then center-truncate.
233
234         Make use of it for the action text, and follow the same rules/width as
235         the title text already does.
236
237 2016-08-01  Anders Carlsson  <andersca@apple.com>
238
239         Build fix.
240
241         * WebCore.xcodeproj/project.pbxproj:
242
243 2016-08-01  Anders Carlsson  <andersca@apple.com>
244
245         Another build fix.
246
247         * WebCore.xcodeproj/project.pbxproj:
248
249 2016-08-01  Anders Carlsson  <andersca@apple.com>
250
251         Freeze the last of the HTML Objective-C bindings
252         https://bugs.webkit.org/show_bug.cgi?id=160430
253
254         Reviewed by Tim Horton.
255
256         Also, remove a bunch of form validation related methods that were never exposed/used.
257
258         * DerivedSources.make:
259         * WebCore.xcodeproj/project.pbxproj:
260         * bindings/objc/DOMBlob.h: Added.
261         * bindings/objc/DOMBlob.mm: Added.
262         * bindings/objc/DOMBlobInternal.h: Added.
263         * bindings/objc/DOMDOMTokenList.h: Added.
264         * bindings/objc/DOMDOMTokenList.mm: Added.
265         * bindings/objc/DOMDOMTokenListInternal.h: Added.
266         * bindings/objc/DOMFile.h: Added.
267         * bindings/objc/DOMFile.mm: Added.
268         * bindings/objc/DOMFileInternal.h: Added.
269         * bindings/objc/DOMFileList.h: Added.
270         * bindings/objc/DOMFileList.mm: Added.
271         * bindings/objc/DOMFileListInternal.h: Added.
272         * bindings/objc/DOMHTMLButtonElement.mm:
273         * bindings/objc/DOMHTMLFieldSetElement.mm:
274         * bindings/objc/DOMHTMLInputElement.mm:
275         * bindings/objc/DOMHTMLInputElementPrivate.h:
276         * bindings/objc/DOMHTMLObjectElement.mm:
277         * bindings/objc/DOMHTMLSelectElement.mm:
278         * bindings/objc/DOMHTMLTextAreaElement.mm:
279         * bindings/objc/DOMHTMLTextAreaElementPrivate.h:
280         * bindings/objc/DOMMediaError.h: Added.
281         * bindings/objc/DOMMediaError.mm: Added.
282         * bindings/objc/DOMMediaErrorInternal.h: Added.
283         * bindings/objc/DOMTimeRanges.h: Added.
284         * bindings/objc/DOMTimeRanges.mm: Added.
285         * bindings/objc/DOMTimeRangesInternal.h: Added.
286
287 2016-08-01  Anders Carlsson  <andersca@apple.com>
288
289         Fix build.
290
291         * WebCore.xcodeproj/project.pbxproj:
292
293 2016-08-01  Anders Carlsson  <andersca@apple.com>
294
295         Freeze all the DOMHTML* Objective-C bindings
296         https://bugs.webkit.org/show_bug.cgi?id=160424
297
298         Reviewed by Tim Horton.
299
300         * DerivedSources.make:
301         * WebCore.xcodeproj/project.pbxproj:
302         * bindings/objc/DOMHTMLAnchorElement.h: Added.
303         * bindings/objc/DOMHTMLAnchorElement.mm: Added.
304         * bindings/objc/DOMHTMLAnchorElementInternal.h: Added.
305         * bindings/objc/DOMHTMLAppletElement.h: Added.
306         * bindings/objc/DOMHTMLAppletElement.mm: Added.
307         * bindings/objc/DOMHTMLAppletElementInternal.h: Added.
308         * bindings/objc/DOMHTMLAreaElement.h: Added.
309         * bindings/objc/DOMHTMLAreaElement.mm: Added.
310         * bindings/objc/DOMHTMLAreaElementInternal.h: Added.
311         * bindings/objc/DOMHTMLBRElement.h: Added.
312         * bindings/objc/DOMHTMLBRElement.mm: Added.
313         * bindings/objc/DOMHTMLBRElementInternal.h: Added.
314         * bindings/objc/DOMHTMLBaseElement.h: Added.
315         * bindings/objc/DOMHTMLBaseElement.mm: Added.
316         * bindings/objc/DOMHTMLBaseElementInternal.h: Added.
317         * bindings/objc/DOMHTMLBaseFontElement.h: Added.
318         * bindings/objc/DOMHTMLBaseFontElement.mm: Added.
319         * bindings/objc/DOMHTMLBaseFontElementInternal.h: Added.
320         * bindings/objc/DOMHTMLBodyElement.h: Added.
321         * bindings/objc/DOMHTMLBodyElement.mm: Added.
322         * bindings/objc/DOMHTMLBodyElementInternal.h: Added.
323         * bindings/objc/DOMHTMLButtonElement.h: Added.
324         * bindings/objc/DOMHTMLButtonElement.mm: Added.
325         * bindings/objc/DOMHTMLButtonElementInternal.h: Added.
326         * bindings/objc/DOMHTMLCanvasElement.h: Added.
327         * bindings/objc/DOMHTMLCanvasElement.mm: Added.
328         * bindings/objc/DOMHTMLCanvasElementInternal.h: Added.
329         * bindings/objc/DOMHTMLCollection.h: Added.
330         * bindings/objc/DOMHTMLCollection.mm: Added.
331         * bindings/objc/DOMHTMLCollectionInternal.h: Added.
332         * bindings/objc/DOMHTMLDListElement.h: Added.
333         * bindings/objc/DOMHTMLDListElement.mm: Added.
334         * bindings/objc/DOMHTMLDListElementInternal.h: Added.
335         * bindings/objc/DOMHTMLDirectoryElement.h: Added.
336         * bindings/objc/DOMHTMLDirectoryElement.mm: Added.
337         * bindings/objc/DOMHTMLDirectoryElementInternal.h: Added.
338         * bindings/objc/DOMHTMLDivElement.h: Added.
339         * bindings/objc/DOMHTMLDivElement.mm: Added.
340         * bindings/objc/DOMHTMLDivElementInternal.h: Added.
341         * bindings/objc/DOMHTMLDocument.h: Added.
342         * bindings/objc/DOMHTMLDocument.mm: Added.
343         * bindings/objc/DOMHTMLDocumentInternal.h: Added.
344         * bindings/objc/DOMHTMLElement.h: Added.
345         * bindings/objc/DOMHTMLElement.mm: Added.
346         * bindings/objc/DOMHTMLElementInternal.h: Added.
347         * bindings/objc/DOMHTMLEmbedElement.h: Added.
348         * bindings/objc/DOMHTMLEmbedElement.mm: Added.
349         * bindings/objc/DOMHTMLEmbedElementInternal.h: Added.
350         * bindings/objc/DOMHTMLFieldSetElement.h: Added.
351         * bindings/objc/DOMHTMLFieldSetElement.mm: Added.
352         * bindings/objc/DOMHTMLFieldSetElementInternal.h: Added.
353         * bindings/objc/DOMHTMLFontElement.h: Added.
354         * bindings/objc/DOMHTMLFontElement.mm: Added.
355         * bindings/objc/DOMHTMLFontElementInternal.h: Added.
356         * bindings/objc/DOMHTMLFormElement.h: Added.
357         * bindings/objc/DOMHTMLFormElement.mm: Added.
358         * bindings/objc/DOMHTMLFormElementInternal.h: Added.
359         * bindings/objc/DOMHTMLFrameElement.h: Added.
360         * bindings/objc/DOMHTMLFrameElement.mm: Added.
361         * bindings/objc/DOMHTMLFrameElementInternal.h: Added.
362         * bindings/objc/DOMHTMLFrameSetElement.h: Added.
363         * bindings/objc/DOMHTMLFrameSetElement.mm: Added.
364         * bindings/objc/DOMHTMLFrameSetElementInternal.h: Added.
365         * bindings/objc/DOMHTMLHRElement.h: Added.
366         * bindings/objc/DOMHTMLHRElement.mm: Added.
367         * bindings/objc/DOMHTMLHRElementInternal.h: Added.
368         * bindings/objc/DOMHTMLHeadElement.h: Added.
369         * bindings/objc/DOMHTMLHeadElement.mm: Added.
370         * bindings/objc/DOMHTMLHeadElementInternal.h: Added.
371         * bindings/objc/DOMHTMLHeadingElement.h: Added.
372         * bindings/objc/DOMHTMLHeadingElement.mm: Added.
373         * bindings/objc/DOMHTMLHeadingElementInternal.h: Added.
374         * bindings/objc/DOMHTMLHtmlElement.h: Added.
375         * bindings/objc/DOMHTMLHtmlElement.mm: Added.
376         * bindings/objc/DOMHTMLHtmlElementInternal.h: Added.
377         * bindings/objc/DOMHTMLIFrameElement.h: Added.
378         * bindings/objc/DOMHTMLIFrameElement.mm: Added.
379         * bindings/objc/DOMHTMLIFrameElementInternal.h: Added.
380         * bindings/objc/DOMHTMLImageElement.h: Added.
381         * bindings/objc/DOMHTMLImageElement.mm: Added.
382         * bindings/objc/DOMHTMLImageElementInternal.h: Added.
383         * bindings/objc/DOMHTMLInputElement.h: Added.
384         * bindings/objc/DOMHTMLInputElement.mm: Added.
385         * bindings/objc/DOMHTMLInputElementInternal.h: Added.
386         * bindings/objc/DOMHTMLInputElementPrivate.h: Added.
387         * bindings/objc/DOMHTMLLIElement.h: Added.
388         * bindings/objc/DOMHTMLLIElement.mm: Added.
389         * bindings/objc/DOMHTMLLIElementInternal.h: Added.
390         * bindings/objc/DOMHTMLLabelElement.h: Added.
391         * bindings/objc/DOMHTMLLabelElement.mm: Added.
392         * bindings/objc/DOMHTMLLabelElementInternal.h: Added.
393         * bindings/objc/DOMHTMLLegendElement.h: Added.
394         * bindings/objc/DOMHTMLLegendElement.mm: Added.
395         * bindings/objc/DOMHTMLLegendElementInternal.h: Added.
396         * bindings/objc/DOMHTMLLinkElement.h: Added.
397         * bindings/objc/DOMHTMLLinkElement.mm: Added.
398         * bindings/objc/DOMHTMLLinkElementInternal.h: Added.
399         * bindings/objc/DOMHTMLMapElement.h: Added.
400         * bindings/objc/DOMHTMLMapElement.mm: Added.
401         * bindings/objc/DOMHTMLMapElementInternal.h: Added.
402         * bindings/objc/DOMHTMLMarqueeElement.h: Added.
403         * bindings/objc/DOMHTMLMarqueeElement.mm: Added.
404         * bindings/objc/DOMHTMLMarqueeElementInternal.h: Added.
405         * bindings/objc/DOMHTMLMediaElement.h: Added.
406         * bindings/objc/DOMHTMLMediaElement.mm: Added.
407         * bindings/objc/DOMHTMLMediaElementInternal.h: Added.
408         * bindings/objc/DOMHTMLMenuElement.h: Added.
409         * bindings/objc/DOMHTMLMenuElement.mm: Added.
410         * bindings/objc/DOMHTMLMenuElementInternal.h: Added.
411         * bindings/objc/DOMHTMLMetaElement.h: Added.
412         * bindings/objc/DOMHTMLMetaElement.mm: Added.
413         * bindings/objc/DOMHTMLMetaElementInternal.h: Added.
414         * bindings/objc/DOMHTMLModElement.h: Added.
415         * bindings/objc/DOMHTMLModElement.mm: Added.
416         * bindings/objc/DOMHTMLModElementInternal.h: Added.
417         * bindings/objc/DOMHTMLOListElement.h: Added.
418         * bindings/objc/DOMHTMLOListElement.mm: Added.
419         * bindings/objc/DOMHTMLOListElementInternal.h: Added.
420         * bindings/objc/DOMHTMLObjectElement.h: Added.
421         * bindings/objc/DOMHTMLObjectElement.mm: Added.
422         * bindings/objc/DOMHTMLObjectElementInternal.h: Added.
423         * bindings/objc/DOMHTMLObjectElementPrivate.h: Added.
424         * bindings/objc/DOMHTMLOptGroupElement.h: Added.
425         * bindings/objc/DOMHTMLOptGroupElement.mm: Added.
426         * bindings/objc/DOMHTMLOptGroupElementInternal.h: Added.
427         * bindings/objc/DOMHTMLOptionElement.h: Added.
428         * bindings/objc/DOMHTMLOptionElement.mm: Added.
429         * bindings/objc/DOMHTMLOptionElementInternal.h: Added.
430         * bindings/objc/DOMHTMLOptionsCollection.h: Added.
431         * bindings/objc/DOMHTMLOptionsCollection.mm: Added.
432         * bindings/objc/DOMHTMLOptionsCollectionInternal.h: Added.
433         * bindings/objc/DOMHTMLParagraphElement.h: Added.
434         * bindings/objc/DOMHTMLParagraphElement.mm: Added.
435         * bindings/objc/DOMHTMLParagraphElementInternal.h: Added.
436         * bindings/objc/DOMHTMLParamElement.h: Added.
437         * bindings/objc/DOMHTMLParamElement.mm: Added.
438         * bindings/objc/DOMHTMLParamElementInternal.h: Added.
439         * bindings/objc/DOMHTMLPreElement.h: Added.
440         * bindings/objc/DOMHTMLPreElement.mm: Added.
441         * bindings/objc/DOMHTMLPreElementInternal.h: Added.
442         * bindings/objc/DOMHTMLQuoteElement.h: Added.
443         * bindings/objc/DOMHTMLQuoteElement.mm: Added.
444         * bindings/objc/DOMHTMLQuoteElementInternal.h: Added.
445         * bindings/objc/DOMHTMLScriptElement.h: Added.
446         * bindings/objc/DOMHTMLScriptElement.mm: Added.
447         * bindings/objc/DOMHTMLScriptElementInternal.h: Added.
448         * bindings/objc/DOMHTMLSelectElement.h: Added.
449         * bindings/objc/DOMHTMLSelectElement.mm: Added.
450         * bindings/objc/DOMHTMLSelectElementInternal.h: Added.
451         * bindings/objc/DOMHTMLStyleElement.h: Added.
452         * bindings/objc/DOMHTMLStyleElement.mm: Added.
453         * bindings/objc/DOMHTMLStyleElementInternal.h: Added.
454         * bindings/objc/DOMHTMLTableCaptionElement.h: Added.
455         * bindings/objc/DOMHTMLTableCaptionElement.mm: Added.
456         * bindings/objc/DOMHTMLTableCaptionElementInternal.h: Added.
457         * bindings/objc/DOMHTMLTableCellElement.h: Added.
458         * bindings/objc/DOMHTMLTableCellElement.mm: Added.
459         * bindings/objc/DOMHTMLTableCellElementInternal.h: Added.
460         * bindings/objc/DOMHTMLTableColElement.h: Added.
461         * bindings/objc/DOMHTMLTableColElement.mm: Added.
462         * bindings/objc/DOMHTMLTableColElementInternal.h: Added.
463         * bindings/objc/DOMHTMLTableElement.h: Added.
464         * bindings/objc/DOMHTMLTableElement.mm: Added.
465         * bindings/objc/DOMHTMLTableElementInternal.h: Added.
466         * bindings/objc/DOMHTMLTableRowElement.h: Added.
467         * bindings/objc/DOMHTMLTableRowElement.mm: Added.
468         * bindings/objc/DOMHTMLTableRowElementInternal.h: Added.
469         * bindings/objc/DOMHTMLTableSectionElement.h: Added.
470         * bindings/objc/DOMHTMLTableSectionElement.mm: Added.
471         * bindings/objc/DOMHTMLTableSectionElementInternal.h: Added.
472         * bindings/objc/DOMHTMLVideoElement.h: Added.
473         * bindings/objc/DOMHTMLVideoElement.mm: Added.
474         * bindings/objc/DOMHTMLVideoElementInternal.h: Added.
475
476 2016-08-01  Antti Koivisto  <antti@apple.com>
477
478         REGRESSION(r198943): drop-down menu navigation on fiddlevideo.com doesn't appear on iOS, works on OS X
479         https://bugs.webkit.org/show_bug.cgi?id=160406
480         rdar://problem/26310261
481
482         Reviewed by Simon Fraser.
483
484         On iOS we generate synthetic mouse events from taps. Click event is generated on tap only if the move event
485         doesn't produce visible changes to the document. This is important to make certain types of drop down menus
486         work.
487
488         The information on mutations is passed via WKContentObservation side channel which is updated from varous parts
489         of the code. Newly visible elements are detected CheckForVisibilityChangeOnRecalcStyle during style resolution.
490         This got broken by the style refactoring because it assumes that renderer is mutated along with style computation.
491         However mutation is now a separate step performed by RenderTreeUpdater.
492
493         Fix by moving CheckForVisibilityChange to RenderTreeUpdater.
494
495         Test: fast/content-observation/click-event-suppression-on-content-change.html
496
497         * style/RenderTreeUpdater.cpp:
498         (WebCore::RenderTreeUpdater::Parent::Parent):
499         (WebCore::RenderTreeUpdater::updateElementRenderer):
500         (WebCore::RenderTreeUpdater::tearDownRenderer):
501         (WebCore::elementImplicitVisibility):
502         (WebCore::CheckForVisibilityChange::CheckForVisibilityChange):
503         (WebCore::CheckForVisibilityChange::~CheckForVisibilityChange):
504         * style/StyleTreeResolver.cpp:
505         (WebCore::Style::TreeResolver::createAnimatedElementUpdate):
506         (WebCore::Style::TreeResolver::pushParent):
507         (WebCore::Style::TreeResolver::resolveComposedTree):
508         (WebCore::Style::elementImplicitVisibility): Deleted.
509         (WebCore::Style::CheckForVisibilityChangeOnRecalcStyle::CheckForVisibilityChangeOnRecalcStyle): Deleted.
510         (WebCore::Style::CheckForVisibilityChangeOnRecalcStyle::~CheckForVisibilityChangeOnRecalcStyle): Deleted.
511
512 2016-08-01  Eric Carlson  <eric.carlson@apple.com>
513
514         [iOS] A video element that does not pause after exiting from fullscreen should be allowed to continue playing inline
515         https://bugs.webkit.org/show_bug.cgi?id=160416
516         <rdar://problem/27409854>
517
518         Reviewed by Alex Christensen.
519
520         * html/HTMLMediaElement.cpp:
521         (WebCore::HTMLMediaElement::exitFullscreen): If playback normally requires fullscreen but the 
522         element was not paused when exiting from fullscreen, set the 'playsinline' attribute so we won't
523         force fullscreen if playback is paused and resumes, and set the 'controls' attribute so the
524         user can control playback.
525
526 2016-08-01  Anders Carlsson  <andersca@apple.com>
527
528         Build fix.
529
530         * WebCore.xcodeproj/project.pbxproj:
531
532 2016-08-01  Eric Carlson  <eric.carlson@apple.com>
533
534         [Mac][iOS] Adopt MediaRemote "seek to playback position"
535         https://bugs.webkit.org/show_bug.cgi?id=160405
536         <rdar://problem/27547583>
537
538         Reviewed by Dean Jackson.
539
540         Test: media/remote-control-command-seek.html
541
542         * Modules/webaudio/AudioContext.h: Update for didReceiveRemoteControlCommand argument change.
543
544         * html/HTMLMediaElement.cpp:
545         (WebCore::HTMLMediaElement::didReceiveRemoteControlCommand): Support SeekToPlaybackPositionCommand.
546         Drive by fix, support Stop command.
547         (WebCore::HTMLMediaElement::supportsSeeking): New.
548         * html/HTMLMediaElement.h:
549
550         * platform/RemoteCommandListener.h:
551         (WebCore::RemoteCommandListenerClient::didReceiveRemoteControlCommand): Add command argument.
552         (WebCore::RemoteCommandListenerClient::supportsSeeking): New.
553         (WebCore::RemoteCommandListener::updateSupportedCommands): Ditto.
554         (WebCore::RemoteCommandListener::client): Ditto.
555
556         * platform/audio/PlatformMediaSession.cpp:
557         (WebCore::PlatformMediaSession::didReceiveRemoteControlCommand): Add command argument.
558         (WebCore::PlatformMediaSession::supportsSeeking): New, pass through to client.
559         * platform/audio/PlatformMediaSession.h:
560
561         * platform/audio/PlatformMediaSessionManager.cpp:
562         (WebCore::PlatformMediaSessionManager::setCurrentSession): Tell remote command listener to
563         update supported commands.
564         (WebCore::PlatformMediaSessionManager::currentSession): Make const.
565         (WebCore::PlatformMediaSessionManager::didReceiveRemoteControlCommand): Add command argument.
566         (WebCore::PlatformMediaSessionManager::supportsSeeking): New, pass through to session.
567         * platform/audio/PlatformMediaSessionManager.h:
568
569         * platform/ios/RemoteCommandListenerIOS.h:
570         (WebCore::RemoteCommandListenerIOS::createWeakPtr):
571         * platform/ios/RemoteCommandListenerIOS.mm:
572         (WebCore::RemoteCommandListenerIOS::RemoteCommandListenerIOS): Support changePlaybackPositionCommand.
573         (WebCore::RemoteCommandListenerIOS::~RemoteCommandListenerIOS): Remove seekToTime target.
574         (WebCore::RemoteCommandListenerIOS::updateSupportedCommands): Update changePlaybackPositionCommand.
575
576         * platform/mac/MediaRemoteSoftLink.cpp:
577         * platform/mac/MediaRemoteSoftLink.h:
578
579         * platform/mac/RemoteCommandListenerMac.h:
580         * platform/mac/RemoteCommandListenerMac.mm:
581         (WebCore::RemoteCommandListenerMac::updateSupportedCommands): New, split out of constructor.
582         (WebCore::RemoteCommandListenerMac::RemoteCommandListenerMac): Split setup logic out into
583         updateSupportedCommands. Support MRMediaRemoteCommandSeekToPlaybackPosition. Don't assert when
584         receiving an unsupported command, it happens. Return error when a command isn't supported or
585         fails.
586
587         * testing/Internals.cpp:
588         (WebCore::Internals::postRemoteControlCommand): Add command argument parameter. Support
589         seektoplaybackposition.
590         * testing/Internals.h:
591         * testing/Internals.idl:
592
593 2016-08-01  Anders Carlsson  <andersca@apple.com>
594
595         Freeze DOMHTMLTitleElement and DOMHTMLUListElement bindings
596         https://bugs.webkit.org/show_bug.cgi?id=160415
597
598         Reviewed by Sam Weinig.
599
600         * DerivedSources.make:
601         * WebCore.xcodeproj/project.pbxproj:
602         * bindings/objc/DOMHTMLTitleElement.h: Added.
603         * bindings/objc/DOMHTMLTitleElement.mm: Added.
604         * bindings/objc/DOMHTMLTitleElementInternal.h: Added.
605         * bindings/objc/DOMHTMLUListElement.h: Added.
606         * bindings/objc/DOMHTMLUListElement.mm: Added.
607         * bindings/objc/DOMHTMLUListElementInternal.h: Added.
608
609 2016-08-01  Antti Koivisto  <antti@apple.com>
610
611         REGRESSION (r196383): Drop down CSS menus not working on cnet.com, apmex.com
612         https://bugs.webkit.org/show_bug.cgi?id=160390
613
614         Reviewed by Simon Fraser.
615
616         The case here is that we have a rule like
617
618             .enableHover:hover .child { ... }
619
620         and the "enableHover" class is added dynamically. The class change invalidation optimization code would figure out
621         that nothing needs to be invalidated as the class change doesn't make the rule match (since :hover doesn't match).
622
623         However for event driven hover to actually work the hover element needs to have its childrenAffectedByHover bit set.
624         This bits is set when the selector match is attempted, whether it actually matches or not. Since we optimized away
625         the style invalidation we never set the bit either.
626
627         Fix by treating :hover as always matching (==ignored) when collecting rules for invalidation optimization purposes.
628         Dynamic pseudo elements are already treated this way for similar reasons.
629
630         Test: fast/selectors/hover-invalidation-descendant-dynamic.html
631
632         * css/SelectorChecker.cpp:
633         (WebCore::SelectorChecker::checkOne):
634
635             Match always in CollectingRulesIgnoringVirtualPseudoElements mode (now slightly misnamed).
636
637             This mode is used for optimization purposes in StyleInvalidationAnalysis (which we care about here) and
638             StyleSharingResolver. The change is fine for both.
639
640         * cssjit/SelectorCompiler.cpp:
641         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsHovered):
642
643             Same change for the slow path selector checker.
644
645 2016-08-01  Darin Adler  <darin@apple.com>
646
647         [Cocoa] Freeze Objective-C bindings and stop autogenerating them: Step 1 - Convert a single file
648         https://bugs.webkit.org/show_bug.cgi?id=160386
649
650         Reviewed by Anders Carlsson.
651
652         No behavior change, no tests changed. I tested this locally by putting "#error" into the
653         files in the DerivedSources directory to make sure the build doesn't use those files even
654         if there are stale copies still sitting there.
655
656         Moving the bindings from WebCore to the legacy part of WebKit is something we also want to
657         do, but that is quite challenging to do one file at a time, so we will do that later.
658
659         For this first file, I did some hand edits to make the code in a the file a little less
660         peculiar. It's still awkward to have all those JSMainThreadNullState in there; should double
661         check that we really need them.
662
663         An important follow up step will be to cut down on the bindings. We have lots of bindings
664         that are only in the Private.h header, and it would be good to find a way to cut down on those.
665         And on iOS we would like eliminate these bindings entirely since they are not API there.
666
667         * DerivedSources.make: Moved HTMLTextAreaElement from a list we use for both JavaScript and
668         Objective-C DOM bindings to a list we use only for JavaScript bindings.
669         * WebCore.xcodeproj/project.pbxproj: Removed references to generated DOMHTMLTextAreaElement
670         files and instead reference the checked-in copies.
671         * bindings/objc/DOMHTMLTextAreaElement.h: Added.
672         * bindings/objc/DOMHTMLTextAreaElement.mm: Added.
673         * bindings/objc/DOMHTMLTextAreaElementInternal.h: Added.
674         * bindings/objc/DOMHTMLTextAreaElementPrivate.h: Added.
675
676 2016-08-01  Frederic Wang  <fwang@igalia.com>
677
678         Introduce a RenderMathMLFencedOperator class
679         https://bugs.webkit.org/show_bug.cgi?id=160245
680
681         Reviewed by Darin Adler.
682
683         We introduce a class to handle all the code specific to anonymous mfenced operators. In
684         particular many members of the RenderMathMLOperator class are going to be removed while
685         fixing bug 156537 but they may still need to stored and exposed in some way by mfenced
686         operators.
687
688         No new tests, behavior is unchanged.
689
690         * CMakeLists.txt: Add RenderMathMLFencedOperator.
691         * WebCore.xcodeproj/project.pbxproj: Ditto.
692         * rendering/RenderObject.h:
693         (WebCore::RenderObject::isRenderMathMLFencedOperator): Function to allow casting to
694         RenderMathMLFencedOperator.
695         * rendering/mathml/RenderMathMLFenced.cpp: Use RenderMathMLFencedOperator instead of
696         RenderMathMLOperator and use the new name updateOperatorContent.
697         (WebCore::RenderMathMLFenced::updateFromElement):
698         (WebCore::RenderMathMLFenced::createMathMLOperator):
699         (WebCore::RenderMathMLFenced::makeFences):
700         (WebCore::RenderMathMLFenced::addChild):
701         * rendering/mathml/RenderMathMLFenced.h: Use RenderMathMLFencedOperator instead of
702         RenderMathMLOperator.
703         * rendering/mathml/RenderMathMLFencedOperator.cpp: New class derived from RenderMathMLOperator
704         (WebCore::RenderMathMLFencedOperator::RenderMathMLFencedOperator): Init form and operator
705         flags with the specified parameters and init the text content.
706         (WebCore::RenderMathMLFencedOperator::updateOperatorContent): We move the
707         RenderMathMLOperator::updateTokenContent function used by anonymous operators here. It is
708         renamed to avoid build errors due to conflicts with the other
709         RenderMathMLOperator::updateTokenContent function.
710         * rendering/mathml/RenderMathMLFencedOperator.h: New class for anonymous mfenced operators
711         with getter and setter for the m_textContent. Also override RenderMathMLFencedOperator to
712         allow casting to RenderMathMLFencedOperator.
713         * rendering/mathml/RenderMathMLOperator.cpp:
714         (WebCore::RenderMathMLOperator::RenderMathMLOperator): Simplify the constructors. Some
715         initializations is moved in RenderMathMLOperator.h while other code is moved to
716         RenderMathMLFencedOperator.
717         (WebCore::RenderMathMLOperator::textContent): No need to handle the anonymous case here since
718         it is handled in RenderMathMLFencedOperator.
719         (WebCore::RenderMathMLOperator::updateTokenContent): We delete the version used for anonymous
720         operators and move it into RenderMathMLFencedOperator.
721         * rendering/mathml/RenderMathMLOperator.h: Make the class and some members overridable and
722         exposed to the derived RenderMathMLFencedOperator class. We also move initialization of some
723         members here.
724
725 2016-08-01  Youenn Fablet  <youennf@gmail.com>
726
727         Reduce the number of ResourceRequest copies in DocumentThreadableLoader
728         https://bugs.webkit.org/show_bug.cgi?id=160338
729
730         Reviewed by Darin Adler.
731
732         No observable change of behavior.
733
734         Updating one of CachedResourceReques constructor to take a ResourceRequest&&.
735         This allows reducing a ResourceRequest copy in DocumentThreadableLoader.
736         Updating DocumentLoader and MediaResourceLoader accordingly (future optimization steps may look at making these
737         two loaders more efficient with regards to Resource Request).
738
739         Updating ThreadableLoader to take a ResourceRequest&&.
740         This allows reducing the number of copies in DocumentThreadableLoader.
741         Updating clients of ThreadableLoader accordingly.
742
743         * Modules/fetch/FetchLoader.cpp:
744         (WebCore::FetchLoader::start):
745         * dom/Document.cpp:
746         (WebCore::Document::didLoadResourceSynchronously):
747         * dom/Document.h:
748         * dom/ScriptExecutionContext.cpp:
749         (WebCore::ScriptExecutionContext::didLoadResourceSynchronously):
750         * dom/ScriptExecutionContext.h:
751         * fileapi/FileReaderLoader.cpp:
752         (WebCore::FileReaderLoader::start):
753         * inspector/InspectorNetworkAgent.cpp:
754         (WebCore::InspectorNetworkAgent::loadResource):
755         * loader/DocumentLoader.cpp:
756         (WebCore::DocumentLoader::startLoadingMainResource):
757         * loader/DocumentThreadableLoader.cpp:
758         (WebCore::DocumentThreadableLoader::loadResourceSynchronously):
759         (WebCore::DocumentThreadableLoader::create):
760         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
761         (WebCore::DocumentThreadableLoader::makeCrossOriginAccessRequest):
762         (WebCore::DocumentThreadableLoader::makeSimpleCrossOriginAccessRequest):
763         (WebCore::DocumentThreadableLoader::redirectReceived):
764         (WebCore::DocumentThreadableLoader::preflightSuccess):
765         (WebCore::DocumentThreadableLoader::loadRequest):
766         * loader/DocumentThreadableLoader.h:
767         * loader/MediaResourceLoader.cpp:
768         (WebCore::MediaResourceLoader::requestResource):
769         * loader/ThreadableLoader.cpp:
770         (WebCore::ThreadableLoader::create):
771         (WebCore::ThreadableLoader::loadResourceSynchronously):
772         * loader/ThreadableLoader.h:
773         * loader/WorkerThreadableLoader.cpp:
774         (WebCore::WorkerThreadableLoader::WorkerThreadableLoader):
775         (WebCore::WorkerThreadableLoader::loadResourceSynchronously):
776         (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge):
777         * loader/WorkerThreadableLoader.h:
778         (WebCore::WorkerThreadableLoader::create):
779         * loader/cache/CachedResourceRequest.cpp:
780         (WebCore::CachedResourceRequest::CachedResourceRequest):
781         * loader/cache/CachedResourceRequest.h:
782         * page/EventSource.cpp:
783         (WebCore::EventSource::connect):
784         * workers/WorkerScriptLoader.cpp:
785         (WebCore::WorkerScriptLoader::loadSynchronously):
786         (WebCore::WorkerScriptLoader::loadAsynchronously):
787         * xml/XMLHttpRequest.cpp:
788         (WebCore::XMLHttpRequest::createRequest):
789
790 2016-07-31  Youenn Fablet  <youenn@apple.com>
791
792         Fetch Response built-ins should use @makeThisTypeError
793         https://bugs.webkit.org/show_bug.cgi?id=160290
794
795         Reviewed by Darin Adler.
796
797         Covered by updated test.
798
799         Fixed type error checks.
800         Making use of @makeThisTypeError to have the correct error message.
801         Updating arrayBuffer, blob, json and text to return rejected promises in lieu of throwing
802         in case the 'this' value is not q Response object.
803
804         * Modules/fetch/FetchResponse.js:
805         (clone): Updated instanceof check and making use of @makeThisTypeError.
806         (arrayBuffer): Ditto.
807         (blob): Ditto.
808         (formData): Ditto.
809         (json): Ditto.
810         (text): Ditto.
811
812 2016-07-31  Adrian Perez de Castro  <aperez@igalia.com>
813
814         [GTK] Implement missing WebCore::moveFile() using GLib functions
815         https://bugs.webkit.org/show_bug.cgi?id=160363
816
817         Reviewed by Carlos Garcia Campos.
818
819         * platform/glib/FileSystemGlib.cpp:
820         (WebCore::moveFile): Function added.
821
822 2016-07-31  Chris Dumez  <cdumez@apple.com>
823
824         Drop [StrictTypeChecking] in cases where it is a no-op
825         https://bugs.webkit.org/show_bug.cgi?id=160387
826
827         Reviewed by Darin Adler.
828
829         Drop [StrictTypeChecking] in cases where it is a no-op. After r203949 & r203950,
830         [StrictTypeChecking] only has an impact when used on operation parameters of
831         string types and is currently used as a workaround for bugs in our overload
832         resolution algorithm.
833
834         * Modules/mediastream/RTCPeerConnection.idl:
835         * Modules/mediastream/RTCRtpSender.idl:
836         * bindings/scripts/test/TestObj.idl:
837         * bindings/scripts/test/TestTypedefs.idl:
838         * html/canvas/ANGLEInstancedArrays.idl:
839         * html/canvas/OESVertexArrayObject.idl:
840         * html/canvas/WebGL2RenderingContext.idl:
841         * html/canvas/WebGLDebugShaders.idl:
842         * html/canvas/WebGLLoseContext.idl:
843         * html/canvas/WebGLRenderingContextBase.idl:
844         * svg/SVGAngle.idl:
845         * svg/SVGColor.idl:
846         * svg/SVGLength.idl:
847         * svg/SVGLengthList.idl:
848         * svg/SVGMatrix.idl:
849         * svg/SVGNumberList.idl:
850         * svg/SVGPaint.idl:
851         * svg/SVGPathSegList.idl:
852         * svg/SVGPoint.idl:
853         * svg/SVGPointList.idl:
854         * svg/SVGStringList.idl:
855         * svg/SVGTransform.idl:
856         * svg/SVGTransformList.idl:
857
858 2016-07-31  Nan Wang  <n_wang@apple.com>
859
860         AX: Add a check for touch event listener on iOS accessibility object
861         https://bugs.webkit.org/show_bug.cgi?id=160388
862
863         Reviewed by Chris Fleizach.
864
865         dispatchTouchEvent() is not working correctly within AXPress() sometimes. Need to 
866         investigate it more in the future. Now, adding a check for the touch event listener
867         on the object's node so that iOS can handle dispatching the touch event instead.
868
869         Test: accessibility/ios-simulator/has-touch-event-listener.html
870
871         * accessibility/AccessibilityObject.h:
872         * accessibility/ios/AccessibilityObjectIOS.mm:
873         (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject):
874         (WebCore::AccessibilityObject::hasTouchEventListener):
875         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
876         (appendStringToResult):
877         (-[WebAccessibilityObjectWrapper _accessibilityHasTouchEventListener]):
878         (-[WebAccessibilityObjectWrapper _accessibilityValueIsAutofilled]):
879
880 2016-07-30  Chris Dumez  <cdumez@apple.com>
881
882         Unreviewed, rebaseline bindings tests.
883
884         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
885         (webkit_dom_test_obj_set_property): Deleted.
886         (webkit_dom_test_obj_get_property): Deleted.
887         (webkit_dom_test_obj_class_init): Deleted.
888         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
889         * bindings/scripts/test/JS/JSTestObj.cpp:
890         (WebCore::jsTestObjStrictTypeCheckingAttribute): Deleted.
891         (WebCore::jsTestObjStrictFloat): Deleted.
892         (WebCore::setJSTestObjStrictTypeCheckingAttribute): Deleted.
893         (WebCore::setJSTestObjStrictFloat): Deleted.
894         * bindings/scripts/test/ObjC/DOMTestObj.h:
895         * bindings/scripts/test/ObjC/DOMTestObj.mm:
896         (-[DOMTestObj strictTypeCheckingAttribute]): Deleted.
897         (-[DOMTestObj setStrictTypeCheckingAttribute:]): Deleted.
898         (-[DOMTestObj strictFloat]): Deleted.
899         (-[DOMTestObj setStrictFloat:]): Deleted.
900
901 2016-07-30  Chris Dumez  <cdumez@apple.com>
902
903         Enable strict type checking for Window dictionary members
904         https://bugs.webkit.org/show_bug.cgi?id=160356
905
906         Reviewed by Darin Adler.
907
908         Enable strict type checking for Window dictionary members. Technically,
909         we should do strict type checking of all wrapper types but this patch
910         focuses on Window because it is common to pass a Window dictionary
911         member to Event constructors.
912
913         By strict type checking, I mean that we should throw a TypeError is
914         the value is not null/undefined and does not implement the Window
915         interface:
916         - http://heycam.github.io/webidl/#es-interface
917
918         Firefox and Chrome comply with the specification already.
919
920         No new tests, updated / rebaselined existing tests.
921
922         * bindings/js/JSDictionary.cpp:
923         (WebCore::JSDictionary::convertValue):
924
925 2016-07-30  Chris Dumez  <cdumez@apple.com>
926
927         [WebIDL] Enable strict type checking for nullable attribute setters of wrapper types
928         https://bugs.webkit.org/show_bug.cgi?id=160375
929
930         Reviewed by Darin Adler.
931
932         Enable strict type checking for nullable attribute setters of wrapper types:
933         - http://heycam.github.io/webidl/#es-nullable-type
934         - http://heycam.github.io/webidl/#es-interface
935
936         For such attributes, if the JS tries to assign a value that is not null /
937         undefined and does not have the expected wrapper type, then we now throw a
938         TypeError instead of silently converting the value to null.
939
940         This behavior is consistent with Chrome and Firefox. It also helps identify
941         bugs in JavaScript code.
942
943         No new tests, updated existing tests.
944
945         * Modules/webaudio/AudioBufferSourceNode.idl:
946         * bindings/scripts/CodeGeneratorJS.pm:
947         (GenerateImplementation):
948         * bindings/scripts/test/JS/JSTestObj.cpp:
949         (WebCore::setJSTestObjTestNullableObjAttr):
950         (WebCore::setJSTestObjMutablePoint):
951         (WebCore::setJSTestObjImmutablePoint):
952         * bindings/scripts/test/TestObj.idl:
953         * dom/Document.idl:
954         * html/HTMLTableElement.idl:
955         * svg/SVGAngle.idl:
956         * svg/SVGAnimatedBoolean.idl:
957         * svg/SVGAnimatedEnumeration.idl:
958         * svg/SVGAnimatedInteger.idl:
959         * svg/SVGAnimatedNumber.idl:
960         * svg/SVGLength.idl:
961         * svg/SVGMatrix.idl:
962         * svg/SVGNumber.idl:
963         * svg/SVGPathSegArcAbs.idl:
964         * svg/SVGPathSegArcRel.idl:
965         * svg/SVGPathSegCurvetoCubicAbs.idl:
966         * svg/SVGPathSegCurvetoCubicRel.idl:
967         * svg/SVGPathSegCurvetoCubicSmoothAbs.idl:
968         * svg/SVGPathSegCurvetoCubicSmoothRel.idl:
969         * svg/SVGPathSegCurvetoQuadraticAbs.idl:
970         * svg/SVGPathSegCurvetoQuadraticRel.idl:
971         * svg/SVGPathSegCurvetoQuadraticSmoothAbs.idl:
972         * svg/SVGPathSegCurvetoQuadraticSmoothRel.idl:
973         * svg/SVGPathSegLinetoAbs.idl:
974         * svg/SVGPathSegLinetoHorizontalAbs.idl:
975         * svg/SVGPathSegLinetoHorizontalRel.idl:
976         * svg/SVGPathSegLinetoRel.idl:
977         * svg/SVGPathSegLinetoVerticalAbs.idl:
978         * svg/SVGPathSegLinetoVerticalRel.idl:
979         * svg/SVGPathSegMovetoAbs.idl:
980         * svg/SVGPathSegMovetoRel.idl:
981         * svg/SVGPoint.idl:
982         * svg/SVGPreserveAspectRatio.idl:
983         * svg/SVGRect.idl:
984
985 2016-07-30  Youenn Fablet  <youenn@apple.com>
986
987         Synchronous preflight should check for successful responses
988         https://bugs.webkit.org/show_bug.cgi?id=159350
989
990         Reviewed by Darin Adler.
991
992         Test: http/tests/xmlhttprequest/access-control-preflight-not-successful.html
993
994         * loader/CrossOriginPreflightChecker.cpp:
995         (WebCore::CrossOriginPreflightChecker::doPreflight): Adding successful response check for synchronous
996         preflighting.
997
998 2016-07-30  Chris Dumez  <cdumez@apple.com>
999
1000         [WebIDL] Enable strict type checking for operations' nullable parameters of wrapper types
1001         https://bugs.webkit.org/show_bug.cgi?id=160374
1002
1003         Reviewed by Youenn Fablet.
1004
1005         Enable strict type checking for operations' nullable parameters of
1006         wrapper types to comply with the Web IDL specification:
1007         - http://heycam.github.io/webidl/#es-nullable-type
1008         - http://heycam.github.io/webidl/#es-interface
1009
1010         For such parameters, if the JS passes a value that is not null /
1011         undefined and does not have the expected wrapper type, then we now
1012         throw a TypeError instead of silently converting the value to null.
1013
1014         This behavior is consistent with Chrome and Firefox. It also helps
1015         identify bugs in JavaScript code.
1016
1017         No new tests, rebaselined existing tests.
1018
1019         * bindings/scripts/CodeGeneratorJS.pm:
1020         (GenerateParametersCheck):
1021         * bindings/scripts/test/JS/JSTestObj.cpp:
1022         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalNullableWrapper):
1023         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalNullableWrapperIsNull):
1024         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalXPathNSResolver):
1025         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod1):
1026         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod2):
1027         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod6):
1028         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter1):
1029         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter2):
1030         (WebCore::jsTestObjPrototypeFunctionConvert2):
1031         (WebCore::jsTestObjPrototypeFunctionStrictFunctionWithSequence):
1032         (WebCore::jsTestObjPrototypeFunctionConditionalMethod3): Deleted.
1033         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod5): Deleted.
1034         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod): Deleted.
1035         (WebCore::jsTestObjPrototypeFunctionOrange): Deleted.
1036
1037 2016-07-29  Chris Dumez  <cdumez@apple.com>
1038
1039         Window's named properties should be exposed on a WindowProperties object in its prototype
1040         https://bugs.webkit.org/show_bug.cgi?id=160354
1041
1042         Reviewed by Gavin Barraclough.
1043
1044         Window's named properties should be exposed on a WindowProperties object
1045         in its prototype:
1046         - http://heycam.github.io/webidl/#named-properties-object
1047
1048         Firefox and Chrome both comply with the specification. However, WebKit
1049         had no "WindowProperties" object in the Window prototype chain and the
1050         named properties are exposed on the Window object itself.
1051
1052         No new tests, rebaselined existing tests.
1053
1054         * CMakeLists.txt:
1055         * WebCore.xcodeproj/project.pbxproj:
1056         * bindings/js/JSBindingsAllInOne.cpp:
1057         * bindings/js/JSDOMWindowCustom.cpp:
1058         (WebCore::JSDOMWindow::getOwnPropertySlot):
1059         (WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
1060         (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess): Deleted.
1061         (WebCore::JSDOMWindow::put): Deleted.
1062         (WebCore::JSDOMWindow::putByIndex): Deleted.
1063         (WebCore::JSDOMWindow::getEnumerableLength): Deleted.
1064         * bindings/js/JSDOMWindowProperties.cpp: Added.
1065         (WebCore::jsDOMWindowPropertiesGetOwnPropertySlotNamedItemGetter):
1066         (WebCore::JSDOMWindowProperties::getOwnPropertySlot):
1067         (WebCore::JSDOMWindowProperties::getOwnPropertySlotByIndex):
1068         * bindings/js/JSDOMWindowProperties.h: Added.
1069         (WebCore::JSDOMWindowProperties::create):
1070         (WebCore::JSDOMWindowProperties::createStructure):
1071         (WebCore::JSDOMWindowProperties::JSDOMWindowProperties):
1072         * bindings/js/JSDOMWindowShell.cpp:
1073         (WebCore::JSDOMWindowShell::setWindow):
1074
1075 2016-07-29  Daniel Bates  <dabates@apple.com>
1076
1077         Crash under HTMLMediaElement::{resolve, reject}PendingPlayPromises() when playback is interrupted
1078         https://bugs.webkit.org/show_bug.cgi?id=160366
1079         <rdar://problem/27317407>
1080
1081         Reviewed by Eric Carlson.
1082
1083         Fixes a crash/assertion failure in DeferredWrapper::{resolve, rejectWithValue}() caused by a Promise
1084         being settled twice. In particular, if a system interruption occurs when media.play() is invoked
1085         the returned Promise may ultimately be settled twice upon cessation of the interruption.
1086
1087         A Promise can be settled (resolved) exactly once. When a system interruption occurs media
1088         playback is paused and resumes on cessation of the interruption. Currently we also immediately
1089         reject the Promise p retuned by media.play() if the interruption occurs during its invocation.
1090         So, when we resume playback on cessation of an interruption we try to resolve p again. But a
1091         Promise can only be resolved once and hence we violate the assertions that p has both a valid
1092         reference to a JSPromiseDeferred object and a reference to the global object of the page.
1093
1094         Tests: media/non-existent-video-playback-interrupted.html
1095                media/video-playback-interrupted.html
1096
1097         * html/HTMLMediaElement.cpp:
1098         (WebCore::HTMLMediaElement::play): Modified to reject the Promise and return immediately if
1099         playInternal() returns false.
1100         (WebCore::HTMLMediaElement::playInternal): Treat an interruption as success and return true
1101         so that HTMLMediaElement::play() adds the Promise to the end of the list of pending promises.
1102         We treat an interruption as a success because we will resume playback (assuming the media
1103         can be loaded and is well-formed) upon cessation of the interruption and therefore can either
1104         fulfill or reject the Promise object returned by media.play().
1105
1106 2016-07-29  Daniel Bates  <dabates@apple.com>
1107
1108         [iOS] HTMLMediaElement::updateVolume() calls MediaPlayer::volume() on null media player
1109         https://bugs.webkit.org/show_bug.cgi?id=160353
1110
1111         Reviewed by Eric Carlson.
1112
1113         Using testing functions HTMLMediaElement::updateVolume() can be called on a <video> element
1114         without an associated video. We should support this usage on iOS just as we do for non-iOS
1115         ports.
1116
1117         The use of testing functions to call HTMLMediaElement::updateVolume() on a <video> element
1118         without an associated video is demonstrated by the test LayoutTests/media/video-muted-after-setting-page-muted-state.html.
1119
1120         * html/HTMLMediaElement.cpp:
1121         (WebCore::HTMLMediaElement::updateVolume):
1122
1123 2016-07-29  Wenson Hsieh  <wenson_hsieh@apple.com>
1124
1125         Media controls are not displayed for some autoplaying videos at certain browser dimensions
1126         https://bugs.webkit.org/show_bug.cgi?id=160360
1127         <rdar://problem/27179484>
1128
1129         Reviewed by Myles C. Maxfield.
1130
1131         Previously, if a video's aspect ratio fell outside of the range [0.5, 1.8], we would
1132         not consider it main content and would subsequently not show media controls for it.
1133         This meant that on many websites that scale video dimensions to match the mainframe,
1134         if the mainframe is too wide (e.g. full bounds on a widescreen display) we would not
1135         consider the video to be main content. To fix this, we only consider aspect ratio to
1136         be a requirement if the video does not already take up most of the space in the
1137         mainframe.
1138
1139         Covered by two new TestWebKitAPI unit tests.
1140
1141         * html/MediaElementSession.cpp:
1142         (WebCore::isElementLargeRelativeToMainFrame):
1143         (WebCore::isElementLargeEnoughForMainContent):
1144
1145 2016-07-29  Zalan Bujtas  <zalan@apple.com>
1146
1147         Do not set negative rate on AVSampleBufferRenderSynchronizer.
1148         https://bugs.webkit.org/show_bug.cgi?id=160326
1149         <rdar://problem/27355214>
1150
1151         Reviewed by Eric Carlson.
1152
1153         Test: http/tests/media/media-source/mediasource-play-then-seek-back-with-remote-control.html
1154
1155         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1156         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setRateDouble):
1157
1158 2016-07-29  Myles C. Maxfield  <mmaxfield@apple.com>
1159
1160         Backspace key removes only the rainbow from the rainbow flag
1161         https://bugs.webkit.org/show_bug.cgi?id=160349
1162         <rdar://problem/27594995>
1163
1164         Reviewed by Dean Jackson.
1165
1166         In r203330 I added support for new emoji group candidates. I accidentally
1167         missed one of the new emoji code points.
1168
1169         Test: editing/deleting/delete-emoji.html
1170
1171         * platform/text/CharacterProperties.h:
1172         (WebCore::isEmojiGroupCandidate):
1173
1174 2016-07-29  Nan Wang  <n_wang@apple.com>
1175
1176         AX: Media controls accessibility improvement
1177         https://bugs.webkit.org/show_bug.cgi?id=160223
1178         <rdar://problem/27558003>
1179
1180         Reviewed by Eric Carlson.
1181
1182         Changes in this patch:
1183         1. Added a change observer for volume slider so that it will handle accessibility 
1184            increment/decrement functions correctly.
1185         2. Update the timer div's aria-label when time changes.
1186         3. Added a keydown handler for left/right arrow adjusting the timeline, so that the
1187            value increment/decrement in a reasonable way.
1188         4. Changed the mute button's role to checkbox since it only has on/off states.
1189
1190         Test: media/media-controls-accessibility.html
1191
1192         * Modules/mediacontrols/mediaControlsApple.js:
1193         (Controller.prototype.createControls):
1194         (Controller.prototype.updatePictureInPictureButton):
1195         (Controller.prototype.timelineStepFromVideoDuration):
1196         (Controller.prototype.incrementTimelineValue):
1197         (Controller.prototype.decrementTimelineValue):
1198         (Controller.prototype.showInlinePlaybackPlaceholderWhenSafe):
1199         (Controller.prototype.handleTimelineMouseUp):
1200         (Controller.prototype.handleTimelineKeyDown):
1201         (Controller.prototype.handleMuteButtonClicked):
1202         (Controller.prototype.handleMinButtonClicked):
1203         (Controller.prototype.handleMaxButtonClicked):
1204         (Controller.prototype.updateVideoVolume):
1205         (Controller.prototype.handleVolumeSliderInput):
1206         (Controller.prototype.handleVolumeSliderChange):
1207         (Controller.prototype.handleVolumeSliderMouseDown):
1208         (Controller.prototype.updateTime):
1209         (Controller.prototype.updateControlsWhileScrubbing):
1210         (Controller.prototype.updateVolume):
1211
1212 2016-07-29  Mark Lam  <mark.lam@apple.com>
1213
1214         Remove an unused line of code.
1215         https://bugs.webkit.org/show_bug.cgi?id=160350
1216
1217         Reviewed by Simon Fraser.
1218
1219         No new tests because there's no behavior change.  Just removing dead code.
1220
1221         SVGInlineTextBox::paintText() instantiates a local variable selectionTextRun. 
1222         Thanks to analysis by Said Abou-Hallawa, we know that selectionTextRun
1223         was introduced in https://trac.webkit.org/changeset/61393, but was later
1224         rendered unused in https://trac.webkit.org/changeset/62099 because we
1225         switched to using paintTextWithShadows() with the selectionStyle.  Hence,
1226         selectionTextRun can be removed.
1227
1228         * rendering/svg/SVGInlineTextBox.cpp:
1229         (WebCore::SVGInlineTextBox::paintText):
1230
1231 2016-07-29  Eric Carlson  <eric.carlson@apple.com>
1232
1233         Change internal AVCaptureDeviceType typedef name
1234         https://bugs.webkit.org/show_bug.cgi?id=160345
1235         <rdar://problem/27610935>
1236
1237         Reviewed by Dean Jackson.
1238
1239         * platform/mediastream/mac/AVAudioCaptureSource.mm:
1240         (WebCore::AVAudioCaptureSource::create): AVCaptureDeviceType -> AVCaptureDeviceTypedef
1241         (WebCore::AVAudioCaptureSource::AVAudioCaptureSource): Ditto.
1242
1243         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
1244         (WebCore::AVCaptureDeviceManager::captureDeviceList): Ditto.
1245         (WebCore::shouldConsiderDeviceInDeviceList): Ditto.
1246         (WebCore::AVCaptureDeviceManager::refreshCaptureDeviceList): Ditto.
1247         (WebCore::AVCaptureDeviceManager::createMediaSourceForCaptureDeviceWithConstraints): Ditto.
1248         (WebCore::AVCaptureDeviceManager::deviceConnected): Ditto.
1249         (WebCore::AVCaptureDeviceManager::deviceDisconnected): Ditto.
1250         (-[WebCoreAVCaptureDeviceManagerObserver deviceDisconnected:]): Ditto.
1251
1252         * platform/mediastream/mac/AVMediaCaptureSource.mm:
1253         (WebCore::globaVideoCaptureSerialQueue): Ditto.
1254         (WebCore::AVMediaCaptureSource::AVMediaCaptureSource): Ditto.
1255
1256         * platform/mediastream/mac/AVVideoCaptureSource.mm:
1257         (WebCore::AVVideoCaptureSource::create): Ditto.
1258         (WebCore::AVVideoCaptureSource::AVVideoCaptureSource): Ditto.
1259
1260 2016-07-28  Dean Jackson  <dino@apple.com>
1261
1262         color-gamut media query returns incorrect results
1263         https://bugs.webkit.org/show_bug.cgi?id=160166
1264         <rdar://problem/27537577>
1265
1266         Reviewed by Darin Adler.
1267
1268         While I was unable to reproduce the originator's issue,
1269         we communicated via email and it might have been related
1270         to a customized color space calibration on an external
1271         display.
1272
1273         Anyway, I took this opportunity to update to use the
1274         more appropriate API for detection on macOS Sierra.
1275
1276         Covered by the existing fast/media/mq-color-gamut.html test.
1277
1278         * platform/mac/PlatformScreenMac.mm:
1279         (WebCore::screenSupportsExtendedColor): Use NSScreen canRepresentDisplayGamut.
1280
1281 2016-07-29  George Ruan  <gruan@apple.com>
1282
1283         HTMLVideoElement with MediaStream src shows paused image when all video tracks are disabled
1284         https://bugs.webkit.org/show_bug.cgi?id=160222
1285         <rdar://problem/27557313>
1286
1287         Reviewed by Eric Carlson.
1288
1289         Tests: fast/mediastream/MediaStream-video-element-video-tracks-disabled-then-enabled.html
1290                fast/mediastream/MediaStream-video-element-video-tracks-disabled.html
1291
1292         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
1293         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
1294         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSampleBufferFromTrack): Change criteria to enqueue a
1295         Sample Buffer to the AVSampleBufferDisplayLayer to allow an initial frame to be shown.
1296         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::shouldEnqueueVideoSampleBuffer): Allow an initial frame to be shown.
1297         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::flushAndRemoveVideoSampleBuffers): Removes all buffers from the
1298         AVSampleBufferDisplayLayer.
1299         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayer): Make the AVSampleBufferDisplayLayer's background black.
1300         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateDisplayMode): Remove all buffers from the AVSampleBufferDisplayLayer
1301         when state of MediaPlayerPrivateMediaStreamAVFObjC is changed to None of PaintItBlack.
1302         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updatePausedImage): Updates paused image.
1303         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::pause): Calls updatePausedImage.
1304         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::paintCurrentFrameInContext): Allow an initial frame to be painted to canvas.
1305
1306 2016-07-29  Youenn Fablet  <youenn@apple.com>
1307
1308         [Fetch API] Activate credentials mode
1309         https://bugs.webkit.org/show_bug.cgi?id=160292
1310
1311         Reviewed by Alex Christensen.
1312
1313         Covered by updated and rebased tests.
1314
1315         Previously the allowCredentials option was computed by DocumentThreadableLoader clients.
1316         This option is really similar to the credentials flag in the fetch specification and should be handled at lower levels.
1317         In the future, it might be good to retire that option.
1318
1319         In case of Omit mode, we need to explicitely disable cookies in DocumentThreadableLoader.
1320         This should be updated so that ResourceLoader does it, depending on credential flag being set or not.
1321
1322         Updated DocumentThreadableLoader clients to only use FetchOptions::Credentials.
1323         This allows to link code more easely to specification.
1324
1325         * Modules/fetch/FetchLoader.cpp:
1326         (WebCore::FetchLoader::start): Removing use of allowCredentials option. Using FetchOptions::Credentials instead.
1327         * fileapi/FileReaderLoader.cpp:
1328         (WebCore::FileReaderLoader::start): Ditto.
1329         * inspector/InspectorNetworkAgent.cpp:
1330         (WebCore::InspectorNetworkAgent::loadResource): Ditto.
1331         * loader/DocumentThreadableLoader.cpp:
1332         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader): Computing allowCredentials from FetchOptions::Credentials.
1333         (WebCore::DocumentThreadableLoader::loadRequest): Enabling cookie only if allowed to use credentials. This is in
1334         particular useful for FetchOptions::Credentials::Omit mode.
1335         * page/EventSource.cpp:
1336         (WebCore::EventSource::connect): Removing use of allowCredentials option. Using FetchOptions::Credentials instead.
1337         * workers/WorkerScriptLoader.cpp:
1338         (WebCore::WorkerScriptLoader::loadSynchronously): Ditto.
1339         (WebCore::WorkerScriptLoader::loadAsynchronously): Ditto.
1340         * xml/XMLHttpRequest.cpp: Ditto.
1341         (WebCore::XMLHttpRequest::createRequest):
1342
1343 2016-07-29  Youenn Fablet  <youenn@apple.com>
1344
1345         CrossOrigin preflight checker should compute the right Access-Control-Request-Headers value
1346         https://bugs.webkit.org/show_bug.cgi?id=160028
1347
1348         Reviewed by Alex Christensen.
1349
1350         Covered by updated test.
1351
1352         Computing Access-Control-Request-Headers value according https://fetch.spec.whatwg.org/#cors-preflight-fetch:
1353         - Remove safe headers
1354         - lowercase header names
1355         - sort lexicographically header names
1356         The only difference is that we keep separating headers with ', ' instead of ',' as per the spec.
1357         Also, some headers that might be safe are still marked as unsafe (DPR, Downlink...).
1358
1359         Moved setting of Origin header after preflighting, consistently with fetch spec.
1360
1361         * loader/CrossOriginAccessControl.cpp:
1362         (WebCore::createAccessControlPreflightRequest): Implementing new computation of Access-Control-Request-Headers.
1363         * loader/DocumentThreadableLoader.cpp:
1364         (WebCore::DocumentThreadableLoader::makeCrossOriginAccessRequest): Removing call to updateRequestForAccessControl (which sets Origin header value).
1365         (WebCore::DocumentThreadableLoader::makeSimpleCrossOriginAccessRequest): Adding call to updateRequestForAccessControl.
1366         (WebCore::DocumentThreadableLoader::preflightSuccess): Ditto.
1367         * platform/network/HTTPParsers.cpp:
1368         (WebCore::isCrossOriginSafeRequestHeader): Helper routine to implement https://fetch.spec.whatwg.org/#cors-safelisted-request-header.
1369         * platform/network/HTTPParsers.h:
1370
1371 2016-07-29  Frederic Wang  <fwang@igalia.com>
1372
1373         Parse the operator text on the MathMLOperatorElement class.
1374         https://bugs.webkit.org/show_bug.cgi?id=160241
1375
1376         Reviewed by Darin Adler.
1377
1378         The text of the MathML operators is important to determine form or dictionary properties and
1379         hence provide default values when no explicit attributes are privided. Since that text only
1380         depends on the MathML DOM content, it makes sense to move its parsing into
1381         MathMLOperatorElement. Anonymous operators created by the mfenced elements still need to be
1382         handled specially and this will be true for all the operator properties that can just be
1383         determined in MathMLOperatorElement. Hence in a follow-up patch we will introduce a class
1384         to move all the code specific to mfenced in a class derived from RenderMathMLOperator while
1385         we continue to move the corresponding code for non-anonymous into MathMLOperatorElement.
1386
1387         No new tests, behavior is unchanged.
1388
1389         * mathml/MathMLOperatorElement.cpp: Include header for hyphenMinus/minusSign characters.
1390         (WebCore::MathMLOperatorElement::parseOperatorText): Move that code from rebuildTokenContent
1391         (WebCore::MathMLOperatorElement::operatorText): Helper function to get the cached text.
1392         (WebCore::MathMLOperatorElement::childrenChanged): Make the cached text dirty.
1393         * mathml/MathMLOperatorElement.h: Update defitions and add a member for the operator text.
1394         * mathml/MathMLTextElement.h: Make childrenChanged overridable.
1395         * rendering/mathml/RenderMathMLOperator.cpp:
1396         (WebCore::RenderMathMLOperator::element): Helper function to cast to a MathMLOperatorElement.
1397         (WebCore::RenderMathMLOperator::textContent): Helper function to call
1398         MathMLOperatorElement::operatorText or fallback to m_textContent for anonymous operators.
1399         m_textContent and this special case can be moved into a derived class later.
1400         (WebCore::RenderMathMLOperator::setOperatorProperties): Call textContent().
1401         (WebCore::RenderMathMLOperator::computePreferredLogicalWidths): Ditto.
1402         (WebCore::RenderMathMLOperator::rebuildTokenContent): Remove the string parameter and the
1403         parsing of the operator text.
1404         (WebCore::RenderMathMLOperator::updateTokenContent): Call textContent(). The special function
1405         for anonymous operators also parses the text content but this could be moved into a derived
1406         class later.
1407         (WebCore::RenderMathMLOperator::shouldAllowStretching): Call textContent().
1408         (WebCore::RenderMathMLOperator::useMathOperator): Ditto.
1409         (WebCore::RenderMathMLOperator::RenderMathMLOperator): No need to initialize m_textContent
1410         as it is not used anymore for non-anonymous renderers.
1411         * rendering/mathml/RenderMathMLOperator.h: Update definitions and call textContent().
1412
1413 2016-07-28  Youenn Fablet  <youenn@apple.com>
1414
1415         Binding generator should expose the visible interface name in error messages
1416         https://bugs.webkit.org/show_bug.cgi?id=160192
1417
1418         Reviewed by Darin Adler.
1419
1420         Covered by updated layout and binding tests.
1421
1422         * bindings/scripts/CodeGeneratorJS.pm:
1423         (GenerateImplementation): Using visibleInterfaceName instead of interfaceName.
1424         (GenerateFunctionCastedThis): Ditto.
1425         (GenerateParametersCheck): Ditto.
1426         (GenerateConstructorDefinition): Ditto.
1427         * bindings/scripts/test/JS/JSTestObj.cpp: Rebased.
1428         * bindings/scripts/test/TestObj.idl: Adding ConstructorCallWith to exercice change in GenerateConstructorDefinition.
1429
1430 2016-07-28  Carlos Garcia Campos  <cgarcia@igalia.com>
1431
1432         Split calculateCacheSizes in two methods
1433         https://bugs.webkit.org/show_bug.cgi?id=160237
1434
1435         Reviewed by Darin Adler.
1436
1437         Rename getVolumeFreeSizeForPath as volumeFreeSizeForPath and make it available to all platforms adding an
1438         implementation for mac.
1439
1440         * platform/FileSystem.h:
1441         * platform/efl/FileSystemEfl.cpp:
1442         (WebCore::volumeFreeSizeForPath):
1443         (WebCore::getVolumeFreeSizeForPath): Deleted.
1444         * platform/glib/FileSystemGlib.cpp:
1445         (WebCore::volumeFreeSizeForPath):
1446         (WebCore::getVolumeFreeSizeForPath): Deleted.
1447         * platform/mac/FileSystemMac.mm:
1448         (WebCore::volumeFreeSizeForPath):
1449         * platform/win/FileSystemWin.cpp:
1450         (WebCore::volumeFreeSizeForPath):
1451
1452 2016-07-28  Myles C. Maxfield  <mmaxfield@apple.com>
1453
1454         Remove deprecated SPI for video inline / fullscreen controls
1455         https://bugs.webkit.org/show_bug.cgi?id=160318
1456
1457         Reviewed by Tim Horton.
1458
1459         r203752 deprecated the SPI allowsInlineMediaPlaybackWithPlaysInlineAttribute
1460         and allowsInlineMediaPlaybackWithWebKitPlaysInlineAttribute (in favor of
1461         inlineMediaPlaybackRequiresPlaysInlineAttribute). This patch removes the
1462         deprecated SPI symbols.
1463
1464         No new tests because there is no behavior change.
1465
1466         * page/Settings.cpp:
1467         * page/Settings.in:
1468         * testing/InternalSettings.cpp:
1469         (WebCore::InternalSettings::Backup::Backup): Deleted.
1470         (WebCore::InternalSettings::Backup::restoreTo): Deleted.
1471         (WebCore::InternalSettings::setAllowsInlineMediaPlaybackWithPlaysInlineAttribute): Deleted.
1472         (WebCore::InternalSettings::setAllowsInlineMediaPlaybackWithWebKitPlaysInlineAttribute): Deleted.
1473         * testing/InternalSettings.h:
1474         * testing/InternalSettings.idl:
1475
1476 2016-07-28  Chris Dumez  <cdumez@apple.com>
1477
1478         Add support for Element.getAttributeNames()
1479         https://bugs.webkit.org/show_bug.cgi?id=160327
1480
1481         Reviewed by Alex Christensen.
1482
1483         Add support for Element.getAttributeNames():
1484         - https://dom.spec.whatwg.org/#dom-element-getattributenames
1485
1486         Firefox already supports this, Chrome 52 does not yet.
1487
1488         Test: fast/dom/Element/getAttributeNames.html
1489
1490         * bindings/js/JSDOMBinding.h:
1491         (WebCore::JSValueTraits<AtomicString>::arrayJSValue):
1492         * dom/Element.cpp:
1493         (WebCore::Element::getAttributeNames):
1494         * dom/Element.h:
1495         * dom/Element.idl:
1496
1497 2016-07-28  Chris Dumez  <cdumez@apple.com>
1498
1499         window.open.length should be 0
1500         https://bugs.webkit.org/show_bug.cgi?id=160323
1501
1502         Reviewed by Darin Adler.
1503
1504         window.open.length should be 0 as all its parameters are optional:
1505         - https://html.spec.whatwg.org/multipage/browsers.html#the-window-object
1506
1507         It is 2 in WebKit. Firefox and Chrome agree with the specification and return 0.
1508
1509         No new tests, rebaselined existing test.
1510
1511         * bindings/js/JSDOMWindowCustom.cpp:
1512         (WebCore::JSDOMWindow::open):
1513         Minor code optimization.
1514
1515         * page/DOMWindow.idl:
1516         Update IDL to match the specification and our custom implementation.
1517         This makes us return the right "length" value.
1518
1519 2016-07-28  Chris Dumez  <cdumez@apple.com>
1520
1521         Parameters to Event.initEvent() should be mandatory
1522         https://bugs.webkit.org/show_bug.cgi?id=160320
1523
1524         Reviewed by Darin Adler.
1525
1526         Parameters to Event.initEvent() should be mandatory:
1527         - https://dom.spec.whatwg.org/#interface-event
1528
1529         Firefox agrees with the specification. Chrome does not.
1530
1531         No new tests, rebaselined existing tests.
1532
1533         * dom/Event.idl:
1534
1535 2016-07-28  Anders Carlsson  <andersca@apple.com>
1536
1537         Move a Mail.app workaround closer to where it's actually needed
1538         https://bugs.webkit.org/show_bug.cgi?id=160317
1539
1540         Reviewed by Tim Horton.
1541
1542         * loader/FrameLoader.cpp:
1543         (WebCore::FrameLoader::loadArchive):
1544         * platform/network/cf/ResourceRequest.h:
1545         * platform/network/cocoa/ResourceRequestCocoa.mm:
1546         (WebCore::ResourceRequest::applyWebArchiveHackForMail): Deleted.
1547         * platform/network/mac/ResourceRequestMac.mm:
1548         (WebCore::ResourceRequest::applyWebArchiveHackForMail): Deleted.
1549
1550 2016-07-28  Chris Dumez  <cdumez@apple.com>
1551
1552         2 first parameters to window.postMessage() should be mandatory
1553         https://bugs.webkit.org/show_bug.cgi?id=160319
1554
1555         Reviewed by Darin Adler.
1556
1557         2 first parameters to window.postMessage() should be mandatory:
1558         - https://html.spec.whatwg.org/multipage/browsers.html#the-window-object
1559
1560         Firefox and Chrome agree with the specification.
1561
1562         No new tests, rebaselined existing test.
1563
1564         * bindings/js/JSDOMWindowCustom.cpp:
1565         (WebCore::handlePostMessage):
1566
1567 2016-07-28  Chris Dumez  <cdumez@apple.com>
1568
1569         First parameter to canvas.getContext() / probablySupportsContext() should be mandatory
1570         https://bugs.webkit.org/show_bug.cgi?id=160312
1571
1572         Reviewed by Darin Adler.
1573
1574         First parameter to canvas.getContext() / probablySupportsContext()
1575         should be mandatory:
1576         - http://w3c.github.io/html/semantics-scripting.html#the-canvas-element
1577
1578         Firefox and Chrome agree with the specification for getContext().
1579         Neither of them supports probablySupportsContext().
1580
1581         No new tests, rebaselined existing tests.
1582
1583         * bindings/js/JSHTMLCanvasElementCustom.cpp:
1584         (WebCore::JSHTMLCanvasElement::getContext):
1585         (WebCore::JSHTMLCanvasElement::probablySupportsContext):
1586         * html/HTMLCanvasElement.idl:
1587
1588 2016-07-28  Chris Dumez  <cdumez@apple.com>
1589
1590         Parameter to table.deleteRow() / body.deleteRow() should be mandatory
1591         https://bugs.webkit.org/show_bug.cgi?id=160307
1592
1593         Reviewed by Ryosuke Niwa.
1594
1595         Parameter to table.deleteRow() / body.deleteRow() should be mandatory:
1596         - https://html.spec.whatwg.org/multipage/tables.html#the-table-element
1597         - https://html.spec.whatwg.org/multipage/tables.html#htmltablesectionelement
1598
1599         Firefox and Chrome agree with the specification.
1600
1601         No new tests, rebaselined existing test.
1602
1603         * html/HTMLTableElement.idl:
1604         * html/HTMLTableSectionElement.idl:
1605
1606 2016-07-28  Commit Queue  <commit-queue@webkit.org>
1607
1608         Unreviewed, rolling out r203826.
1609         https://bugs.webkit.org/show_bug.cgi?id=160314
1610
1611         The test added with this change fails on El Capitan WK2.
1612         (Requested by ryanhaddad on #webkit).
1613
1614         Reverted changeset:
1615
1616         "HTMLVideoElement with MediaStream src shows paused image when
1617         all video tracks are disabled"
1618         https://bugs.webkit.org/show_bug.cgi?id=160222
1619         http://trac.webkit.org/changeset/203826
1620
1621 2016-07-28  Chris Dumez  <cdumez@apple.com>
1622
1623         2 first parameters to input.setSelectionRange() should be mandatory
1624         https://bugs.webkit.org/show_bug.cgi?id=160310
1625
1626         Reviewed by Alex Christensen.
1627
1628         2 first parameters to input.setSelectionRange() should be mandatory:
1629         - https://html.spec.whatwg.org/multipage/forms.html#htmlinputelement
1630
1631         Calling this method without the 2 first parameters makes little
1632         sense.
1633
1634         Firefox agrees with the specification, Chrome does not.
1635
1636         No new tests, rebaselined existing test.
1637
1638         * bindings/js/JSHTMLInputElementCustom.cpp:
1639         (WebCore::JSHTMLInputElement::setSelectionRange):
1640         * html/HTMLInputElement.idl:
1641
1642 2016-07-28  Anders Carlsson  <andersca@apple.com>
1643
1644         Remove an unnecessary comment from UUID.h
1645         https://bugs.webkit.org/show_bug.cgi?id=160313
1646
1647         Reviewed by Simon Fraser.
1648
1649         * platform/UUID.h:
1650
1651 2016-07-28  Chris Dumez  <cdumez@apple.com>
1652
1653         Parameter to tr.deleteCell() should be mandatory
1654         https://bugs.webkit.org/show_bug.cgi?id=160308
1655
1656         Reviewed by Ryosuke Niwa.
1657
1658         Parameter to tr.deleteCell() should be mandatory:
1659         - https://html.spec.whatwg.org/multipage/tables.html#htmltablerowelement
1660
1661         Firefox and Chrome agree with the specification.
1662
1663         No new tests, rebaselined existing tests.
1664
1665         * html/HTMLTableRowElement.idl:
1666
1667 2016-07-28  Chris Dumez  <cdumez@apple.com>
1668
1669         [Bindings] "length" value of overloaded operations may be wrong
1670         https://bugs.webkit.org/show_bug.cgi?id=160303
1671
1672         Reviewed by Ryosuke Niwa.
1673
1674         "length" value of overloaded operations may be wrong because we fail to
1675         account for overloads when computing the length of a function:
1676         - https://heycam.github.io/webidl/#es-operations
1677
1678         No new tests, rebaselined existing test.
1679
1680         * bindings/scripts/CodeGeneratorJS.pm:
1681         (GetFunctionLength):
1682         * bindings/scripts/test/JS/JSTestObj.cpp:
1683
1684 2016-07-28  George Ruan  <gruan@apple.com>
1685
1686         HTMLVideoElement with MediaStream src shows paused image when all video tracks are disabled
1687         https://bugs.webkit.org/show_bug.cgi?id=160222
1688         <rdar://problem/27557313>
1689
1690         Reviewed by Eric Carlson.
1691
1692         Tests: fast/mediastream/MediaStream-video-element-video-tracks-disabled-then-enabled.html
1693                fast/mediastream/MediaStream-video-element-video-tracks-disabled.html
1694
1695         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
1696         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
1697         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSampleBufferFromTrack): Change criteria to enqueue a
1698         Sample Buffer to the AVSampleBufferDisplayLayer to allow an initial frame to be shown.
1699         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::shouldEnqueueVideoSampleBuffer): Allow an initial frame to be shown.
1700         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::flushAndRemoveVideoSampleBuffers): Removes all buffers from the
1701         AVSampleBufferDisplayLayer.
1702         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayer): Make the AVSampleBufferDisplayLayer's background black.
1703         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateDisplayMode): Remove all buffers from the AVSampleBufferDisplayLayer
1704         when state of MediaPlayerPrivateMediaStreamAVFObjC is changed to None of PaintItBlack.
1705         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updatePausedImage): Updates paused image.
1706         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::pause): Calls updatePausedImage.
1707         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::paintCurrentFrameInContext): Allow an initial frame to be painted to canvas.
1708
1709 2016-07-28  Dean Jackson  <dino@apple.com>
1710
1711         REGRESSION (r202880): Default controls pip glyph inverted
1712         https://bugs.webkit.org/show_bug.cgi?id=160304
1713         <rdar://problem/27578447>
1714
1715         Reviewed by Eric Carlson.
1716
1717         I accidentally committed the "Exit Picture-in-picture" glyph
1718         for the "Enter Picture-in-picture" buttons :(
1719
1720         * Modules/mediacontrols/mediaControlsApple.css:
1721         (video::-webkit-media-controls-panel .picture-in-picture-button):
1722         Use the correct artwork.
1723
1724 2016-07-28  Chris Dumez  <cdumez@apple.com>
1725
1726         First parameter to SVGDocument.createEvent() should be mandatory
1727         https://bugs.webkit.org/show_bug.cgi?id=160296
1728
1729         Reviewed by Alex Christensen.
1730
1731         First parameter to SVGDocument.createEvent() should be mandatory:
1732         - https://www.w3.org/TR/SVG2/struct.html#InterfaceDocumentExtensions
1733         - https://dom.spec.whatwg.org/#document
1734
1735         This patch drops createEvent() from SVGDocument so that the spec-compliant
1736         Document.createEvent() is used instead. In the specification, SVGDocument
1737         no longer exists and is a simple Document.
1738
1739         Firefox and Chrome agree with the specification.
1740
1741         Test: svg/dom/SVGDocument-createEvent.html
1742
1743         * svg/SVGDocument.idl:
1744
1745 2016-07-28  Chris Dumez  <cdumez@apple.com>
1746
1747         Parameters to CanvasGradient.addColorStop() should be mandatory
1748         https://bugs.webkit.org/show_bug.cgi?id=160297
1749
1750         Reviewed by Alex Christensen.
1751
1752         Parameters to CanvasGradient.addColorStop() should be mandatory:
1753         - https://html.spec.whatwg.org/multipage/scripting.html#canvasgradient
1754
1755         Firefox and Chrome agree with the specification.
1756
1757         No new tests, rebaselined existing test.
1758
1759         * html/canvas/CanvasGradient.idl:
1760
1761 2016-07-28  Romain Bellessort  <romain.bellessort@crf.canon.fr>
1762
1763         [Streams API] Replace ReadableStreamController by ReadableStreamDefaultController
1764         https://bugs.webkit.org/show_bug.cgi?id=160242
1765
1766         Reviewed by Youenn Fablet.
1767
1768         Replaced ReadableStreamController by ReadableStreamDefaultController to align
1769         with updated Streams API specification.
1770
1771         No change in functionality.
1772
1773         * CMakeLists.txt:
1774         * DerivedSources.cpp:
1775         * DerivedSources.make:
1776         * Modules/streams/ReadableStream.js:
1777         (initializeReadableStream):
1778         * Modules/streams/ReadableStreamDefaultController.idl: Renamed from Source/WebCore/Modules/streams/ReadableStreamController.idl.
1779         * Modules/streams/ReadableStreamDefaultController.js: Renamed from Source/WebCore/Modules/streams/ReadableStreamController.js.
1780         (enqueue):
1781         (error):
1782         (close):
1783         (desiredSize):
1784         * Modules/streams/ReadableStreamInternals.js:
1785         (privateInitializeReadableStreamDefaultController):
1786         (isReadableStreamDefaultController):
1787         * Modules/streams/ReadableStreamSource.h:
1788         (WebCore::ReadableStreamSource::controller):
1789         (WebCore::ReadableStreamSource::start):
1790         * Modules/streams/ReadableStreamSource.idl:
1791         * WebCore.xcodeproj/project.pbxproj:
1792         * bindings/js/JSDOMGlobalObject.cpp:
1793         (WebCore::JSDOMGlobalObject::addBuiltinGlobals):
1794         * bindings/js/JSReadableStreamPrivateConstructors.cpp:
1795         (WebCore::constructJSReadableStreamDefaultController):
1796         (WebCore::JSBuiltinReadableStreamDefaultControllerPrivateConstructor::initializeExecutable):
1797         (WebCore::createReadableStreamDefaultControllerPrivateConstructor):
1798         * bindings/js/JSReadableStreamPrivateConstructors.h:
1799         * bindings/js/JSReadableStreamSourceCustom.cpp:
1800         (WebCore::JSReadableStreamSource::start):
1801         * bindings/js/ReadableStreamDefaultController.cpp: Renamed from Source/WebCore/bindings/js/ReadableStreamController.cpp.
1802         (WebCore::callFunction):
1803         (WebCore::ReadableStreamDefaultController::invoke):
1804         (WebCore::ReadableStreamDefaultController::isControlledReadableStreamLocked):
1805         * bindings/js/ReadableStreamDefaultController.h: Renamed from Source/WebCore/bindings/js/ReadableStreamController.h.
1806         (WebCore::ReadableStreamDefaultController::ReadableStreamDefaultController):
1807         (WebCore::ReadableStreamDefaultController::close):
1808         (WebCore::ReadableStreamDefaultController::error):
1809         (WebCore::ReadableStreamDefaultController::enqueue):
1810         (WebCore::ReadableStreamDefaultController::globalObject):
1811         (WebCore::ReadableStreamDefaultController::error<String>):
1812         * bindings/js/WebCoreBuiltinNames.h:
1813
1814 2016-07-28  Youenn Fablet  <youenn@apple.com>
1815
1816         Compute fetch response type in case of cross-origin requests
1817         https://bugs.webkit.org/show_bug.cgi?id=158565
1818
1819         Reviewed by Alex Christensen.
1820
1821         Covered by rebased tests.
1822
1823         Implementing Response filtering based on Response tainting in ResourceResponse.
1824         Refactoring code in FetchHeaders and CrossOriginAccessControl.cpp accordingly.
1825
1826         Computing response tainting in SubresourceLoader for all resources.
1827         This is used by DocumentThreadableLoader which now filters responses accordingly for all its clients including fetch and XHR.
1828
1829         Response tainting notably allows computing the response type and filtering out headers in case of cross origin responses.
1830
1831         Removing the filtering implemented in XMLHttpRequest as this is done before it gets access to the headers.
1832         This is triggering some rebasing in the XHR tests as error messages triggered by trying to access unsafe headers no longer happen.
1833
1834         This filtering currently requires creating a new ResourceResponse object from the one sent from CachedResource.
1835         This is done so as the same ResourceResponse may be reused accross loads and may be filtered differently by given to two different DocumentThreadableLoader
1836         This can be mitigated in the future by changing ThreadableLoaderClient API to pass a ResourceResponse&&.
1837
1838         * Modules/fetch/FetchHeaders.cpp: Moving header checking in HTTParsers.h/.cpp
1839         (WebCore::isForbiddenHeaderName): Deleted.
1840         (WebCore::isForbiddenResponseHeaderName): Deleted.
1841         (WebCore::isSimpleHeader): Deleted.
1842         * loader/CrossOriginAccessControl.cpp:
1843         (WebCore::parseAccessControlExposeHeadersAllowList): Deleted.
1844         * loader/CrossOriginAccessControl.h: Moving header checking in HTTParsers.h/.cpp
1845         * loader/DocumentThreadableLoader.cpp:
1846         (WebCore::DocumentThreadableLoader::responseReceived):
1847         (WebCore::DocumentThreadableLoader::didReceiveResponse): Doing response filtering. Since underlying loaders are
1848         not yet aware that fetch mode may be cors (it is always no-cors currently), the tainting needs to be updated.
1849         (WebCore::DocumentThreadableLoader::loadRequest): Computing response tainting in case of synchronous calls to ensure headers are filtered for synchronous XHR.
1850         * loader/DocumentThreadableLoader.h:
1851         * loader/SubresourceLoader.cpp:
1852         (WebCore::SubresourceLoader::init): Getting origin from its resource and setting response tainting accordingly
1853         (WebCore::SubresourceLoader::willSendRequestInternal): Always calling checkRedirectionCrossOriginAccessControl
1854         to ensure response tainting is computed, even for no-cors resources.
1855         (WebCore::SubresourceLoader::didReceiveResponse):
1856         (WebCore::SubresourceLoader::checkRedirectionCrossOriginAccessControl): Computing response tainting in case of redirection.
1857         * loader/SubresourceLoader.h:
1858         * loader/cache/CachedResource.cpp:
1859         (WebCore::CachedResource::load): Computing resource origin from the HTTP headers or from the document if none is
1860         set in the HTTP headers.
1861         (WebCore::CachedResource::setCrossOrigin): Helper routine to set response tainting.
1862         (WebCore::CachedResource::isCrossOrigin): Helper routine to know whether resource is cross origin
1863         (WebCore::CachedResource::isClean):
1864         (WebCore::CachedResource::setResponse): Removing m_responseType
1865         * loader/cache/CachedResource.h:
1866         (WebCore::CachedResource::responseTainting):
1867         (WebCore::CachedResource::origin):
1868         (WebCore::CachedResource::setOpaqueRedirect): Deleted.
1869         * platform/network/HTTPParsers.cpp: Implementing safe response header checking
1870         (WebCore::parseAccessControlExposeHeadersAllowList):
1871         (WebCore::isForbiddenHeaderName):
1872         (WebCore::isForbiddenResponseHeaderName):
1873         (WebCore::isSimpleHeader):
1874         (WebCore::isCrossOriginSafeHeader):
1875         * platform/network/HTTPParsers.h:
1876         * platform/network/ResourceRequestBase.cpp:
1877         (WebCore::ResourceRequestBase::hasHTTPOrigin): Added.
1878         (WebCore::ResourceRequestBase::clearHTTPOrigin):
1879         * platform/network/ResourceRequestBase.h:
1880         * platform/network/ResourceResponseBase.cpp: Implementation of response filtering.
1881         (WebCore::ResourceResponseBase::filterResponse):
1882         * platform/network/ResourceResponseBase.h:
1883         * xml/XMLHttpRequest.cpp:
1884         (WebCore::isSetCookieHeader): Deleted.
1885         (WebCore::XMLHttpRequest::getAllResponseHeaders): Removing header filtering since DocumentThreadableLoader does it.
1886         (WebCore::XMLHttpRequest::getResponseHeader): Ditto.
1887
1888 2016-07-27  Romain Bellessort  <romain.bellessort@crf.canon.fr>
1889
1890         [Streams API] Use makeThisTypeError in ReadableStreamDefaultReader.js
1891         https://bugs.webkit.org/show_bug.cgi?id=160254
1892
1893         Reviewed by Darin Adler.
1894
1895         Use makeThisTypeError and makeGetterTypeError in ReadableStreamDefaultReader.js
1896
1897         No change in functionality.
1898
1899         * Modules/streams/ReadableStreamDefaultReader.js:
1900         (cancel):
1901         (read):
1902         (releaseLock):
1903         (closed):
1904
1905 2016-07-27  Fujii Hironori  <Hironori.Fujii@sony.com>
1906
1907         [soup] Incorrect usage of relaxAdoptionRequirement in the constructor of SocketStreamHandle
1908         https://bugs.webkit.org/show_bug.cgi?id=160281
1909
1910         Reviewed by Carlos Garcia Campos.
1911
1912         No new tests (No behavior change).
1913
1914         Incrementing refcount in a constructor causes an assertion failure
1915         that it's not adopted yet.  So, relaxAdoptionRequirement() was
1916         used to avoid the problem in the constructors of
1917         SocketStreamHandle.  This is a incorrect solution. The correct
1918         solution is to make SocketStreamHandle::create() increment the
1919         refcount after calling the constructor.
1920
1921         * platform/network/soup/SocketStreamHandle.h: Removed the second
1922         constructor of SocketStreamHandle which is not used anymore.
1923         Uninlined create() because this is not trivial anymore.
1924         * platform/network/soup/SocketStreamHandleSoup.cpp:
1925         (WebCore::SocketStreamHandle::create): Do the rest of jobs which
1926         was done by the constructors.
1927         (WebCore::SocketStreamHandle::SocketStreamHandle): Move the jobs
1928         after initialization to create().
1929         Removed the second constructor.
1930
1931 2016-07-27  Chris Dumez  <cdumez@apple.com>
1932
1933         First parameter to HTMLMediaElement.canPlayType() should be mandatory
1934         https://bugs.webkit.org/show_bug.cgi?id=160275
1935
1936         Reviewed by Ryosuke Niwa.
1937
1938         First parameter to HTMLMediaElement.canPlayType() should be mandatory:
1939         - https://html.spec.whatwg.org/multipage/embedded-content.html#htmlmediaelement
1940
1941         Firefox and Chrome agree with the specification.
1942
1943         No new tests, rebaselined existing tests.
1944
1945         * html/HTMLMediaElement.idl:
1946
1947 2016-07-27  Chris Dumez  <cdumez@apple.com>
1948
1949         First parameter to setTimeout() / setInterval() should be mandatory
1950         https://bugs.webkit.org/show_bug.cgi?id=160277
1951
1952         Reviewed by Darin Adler.
1953
1954         First parameter to setTimeout() / setInterval() should be mandatory:
1955         - https://html.spec.whatwg.org/multipage/webappapis.html#windoworworkerglobalscope
1956
1957         Firefox and Chrome agree with the specification.
1958
1959         No new tests, rebaselined existing test.
1960
1961         * bindings/js/JSDOMWindowCustom.cpp:
1962         (WebCore::JSDOMWindow::setTimeout):
1963         (WebCore::JSDOMWindow::setInterval):
1964         * bindings/js/JSWorkerGlobalScopeCustom.cpp:
1965         (WebCore::JSWorkerGlobalScope::setTimeout):
1966         (WebCore::JSWorkerGlobalScope::setInterval):
1967
1968 2016-07-27  Chris Dumez  <cdumez@apple.com>
1969
1970         Parameters to insertAdjacentText() / insertAdjacentHTML() should be mandatory
1971         https://bugs.webkit.org/show_bug.cgi?id=160274
1972
1973         Reviewed by Darin Adler.
1974
1975         Parameters to insertAdjacentText() / insertAdjacentHTML() should be mandatory:
1976         - https://dom.spec.whatwg.org/#element
1977         - https://www.w3.org/TR/DOM-Parsing/#extensions-to-the-element-interface
1978
1979         Firefox and Chrome agree with the specification (although Firefox does not
1980         have insertAdjacentText()).
1981
1982         Test: fast/dom/Element/insertAdjacentText-parameters.html
1983
1984         * html/HTMLElement.idl:
1985
1986 2016-07-27  Beth Dakin  <bdakin@apple.com>
1987
1988         Add localizable strings for inserting list types
1989         https://bugs.webkit.org/show_bug.cgi?id=160233
1990         -and corresponding-
1991         rdar://problem/26102954
1992
1993         Reviewed by Dan Bernstein.
1994
1995         * English.lproj/Localizable.strings:
1996         * platform/LocalizedStrings.cpp:
1997         (WebCore::insertListTypeNone):
1998         (WebCore::insertListTypeNoneAccessibilityTitle):
1999         (WebCore::insertListTypeBulleted):
2000         (WebCore::insertListTypeBulletedAccessibilityTitle):
2001         (WebCore::insertListTypeNumbered):
2002         (WebCore::insertListTypeNumberedAccessibilityTitle):
2003         * platform/LocalizedStrings.h:
2004
2005 2016-07-27  Chris Dumez  <cdumez@apple.com>
2006
2007         Parameters to DOMParser.parseFromString() should be mandatory
2008         https://bugs.webkit.org/show_bug.cgi?id=160268
2009
2010         Reviewed by Ryosuke Niwa.
2011
2012         Parameters to DOMParser.parseFromString() should be mandatory:
2013         - https://www.w3.org/TR/DOM-Parsing/#the-domparser-interface
2014
2015         Firefox and Chrome agree with the specification.
2016
2017         Test: fast/parser/DOMParser-parameters.html
2018
2019         * xml/DOMParser.idl:
2020
2021 2016-07-27  Eric Carlson  <eric.carlson@apple.com>
2022
2023         Captions do not render in PiP window when element is hidden
2024         https://bugs.webkit.org/show_bug.cgi?id=160265
2025         <rdar://problem/27556788>
2026
2027         Reviewed by Simon Fraser.
2028
2029         * html/shadow/MediaControlElements.cpp:
2030         (WebCore::MediaControlTextTrackContainerElement::createTextTrackRepresentationImage): Pass new flag so
2031         caption layers are always rendered.
2032
2033         * rendering/RenderLayer.cpp:
2034         (WebCore::RenderLayer::paintLayerContents): Paint non-visible layers when PaintLayerIgnoreVisibility
2035         flag is set.
2036         * rendering/RenderLayer.h: Define PaintLayerIgnoreVisibility.
2037
2038 2016-07-27  Chris Dumez  <cdumez@apple.com>
2039
2040         Parameter to named property getter should be mandatory
2041         https://bugs.webkit.org/show_bug.cgi?id=160269
2042
2043         Reviewed by Ryosuke Niwa.
2044
2045         Parameter to named property getter should be mandatory:
2046         - https://heycam.github.io/webidl/#idl-named-properties
2047
2048         No new tests, rebaselined existing test.
2049
2050         * Modules/mediastream/RTCStatsResponse.idl:
2051         * bindings/scripts/test/TestOverrideBuiltins.idl:
2052         * html/HTMLOptionsCollection.idl:
2053         * html/HTMLSelectElement.idl:
2054         * plugins/DOMMimeTypeArray.idl:
2055         * plugins/DOMPlugin.idl:
2056         * plugins/DOMPluginArray.idl:
2057
2058 2016-07-27  Chris Dumez  <cdumez@apple.com>
2059
2060         First parameter to Range.createContextualFragment() should be mandatory
2061         https://bugs.webkit.org/show_bug.cgi?id=160266
2062
2063         Reviewed by Ryosuke Niwa.
2064
2065         First parameter to Range.createContextualFragment() should be mandatory:
2066         - https://w3c.github.io/DOM-Parsing/#extensions-to-the-range-interface
2067
2068         Firefox and Chrome agree with the specification.
2069
2070         No new tests, rebaselined existing test.
2071
2072         * dom/Range.idl:
2073
2074 2016-07-27  Chris Dumez  <cdumez@apple.com>
2075
2076         Align MediaList with the CSSOM specification
2077         https://bugs.webkit.org/show_bug.cgi?id=160257
2078
2079         Reviewed by Ryosuke Niwa.
2080
2081         Align MediaList with the CSSOM specification:
2082         - https://www.w3.org/TR/cssom-1/#the-medialist-interface
2083
2084         In particular, the parameter to item() / deleteMedium() and
2085         appendMedium() is now mandatory.
2086
2087         Firefox and Chrome agree with the specification.
2088
2089         Test: fast/css/MediaList-mediaText-null.html
2090               fast/css/MediaList-parameters.html
2091
2092         * css/MediaList.idl:
2093
2094 2016-07-27  Jeremy Jones  <jeremyj@apple.com>
2095
2096         Fullscreen video zoom button does not work after rotating when aspect ratio matches display.
2097         https://bugs.webkit.org/show_bug.cgi?id=160263
2098         rdar://problem/27368872
2099
2100         Reviewed by Eric Carlson.
2101
2102         When video and display aspect ratio match, and rotating from landscape to protrait, the transform used in layout
2103         will be Identity. This means checking the transform for identity is an insufficient test to see if the bounds
2104         need to be resolved.
2105
2106         Instead, always attempt to resolve the bounds and do a more accurate test while doing so.
2107
2108         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
2109         (-[WebAVPlayerLayer layoutSublayers]):
2110         (-[WebAVPlayerLayer resolveBounds]):
2111
2112 2016-07-27  Anders Carlsson  <andersca@apple.com>
2113
2114         Stop accepting the deprecated "requiredShippingAddressFields" and "requiredBillingAddressFields" properties
2115         https://bugs.webkit.org/show_bug.cgi?id=160264
2116         rdar://problem/27574519
2117
2118         Reviewed by Simon Fraser.
2119
2120         * Modules/applepay/ApplePaySession.cpp:
2121         (WebCore::createPaymentRequest):
2122         (WebCore::isValidPaymentRequestPropertyName):
2123
2124 2016-07-27  Chris Dumez  <cdumez@apple.com>
2125
2126         First parameter to indexed property getters should be mandatory
2127         https://bugs.webkit.org/show_bug.cgi?id=160259
2128
2129         Reviewed by Ryosuke Niwa.
2130
2131         First parameter to indexed property getters should be mandatory:
2132         - https://heycam.github.io/webidl/#idl-indexed-properties
2133
2134         No new tests, rebaselined existing tests.
2135
2136         * Modules/gamepad/deprecated/GamepadList.idl:
2137         * bindings/js/JSHTMLAllCollectionCustom.cpp:
2138         (WebCore::JSHTMLAllCollection::item):
2139         * css/CSSRuleList.idl:
2140         * css/CSSValueList.idl:
2141         * css/StyleSheetList.idl:
2142         * css/WebKitCSSFilterValue.idl:
2143         * css/WebKitCSSTransformValue.idl:
2144         * dom/ClientRectList.idl:
2145         * dom/DOMStringList.idl:
2146         * dom/DataTransferItemList.idl:
2147         * html/HTMLAllCollection.idl:
2148         * plugins/DOMMimeTypeArray.idl:
2149         * plugins/DOMPlugin.idl:
2150         * plugins/DOMPluginArray.idl:
2151
2152 2016-07-27  Javier Fernandez  <jfernandez@igalia.com>
2153
2154         [css-grid] The isValidTransition function must not alter the GridSizingData object
2155         https://bugs.webkit.org/show_bug.cgi?id=160252
2156
2157         Reviewed by Darin Adler.
2158
2159         It's not correct that a function which purpose is to check out the
2160         validity of a state modifies such state.
2161
2162         That code was there to allow the extra row track sizing iteration
2163         in the case of a grid container with indefinite height. We need to
2164         do that in order to figure out its intrinsic height, which will be
2165         used then to properly sizing the row tracks.
2166
2167         Since the intrinsic height computation uses directly the
2168         computeUsedBreadthOfGridTracks function, it does not alter the
2169         algorithm state-machine, hence, we can safely remove this code,
2170         which was incorrect in any case.
2171
2172         No new tests, it's just a refactoring with no functionality change.
2173
2174         * rendering/RenderGrid.cpp:
2175         (WebCore::RenderGrid::GridSizingData::isValidTransition):
2176
2177 2016-07-27  Chris Dumez  <cdumez@apple.com>
2178
2179         First parameter to Document.execCommand() / queryCommand*() should be mandatory
2180         https://bugs.webkit.org/show_bug.cgi?id=160258
2181
2182         Reviewed by Darin Adler.
2183
2184         First parameter to Document.execCommand() / queryCommand*() should be mandatory:
2185         - https://w3c.github.io/editing/execCommand.html
2186
2187         Firefox and Chrome agree with the specification.
2188
2189         Test: fast/dom/Document/editing-parameters.html
2190
2191         * dom/Document.idl:
2192
2193 2016-07-27  Chris Dumez  <cdumez@apple.com>
2194
2195         Align CSSSupportsRule with the specification
2196         https://bugs.webkit.org/show_bug.cgi?id=160256
2197
2198         Reviewed by Darin Adler.
2199
2200         Align CSSSupportsRule with the specification:
2201         - https://drafts.csswg.org/css-conditional-3/#csssupportsrule
2202
2203         In particular:
2204         - Make the parameters to insertRule() / deleteRule() mandatory
2205         - Expose CSSSupportsRule on the global Window object
2206
2207         Both Firefox and Chrome agree with the specification here.
2208
2209         Test: fast/css/CSSSupportsRule-parameters.html
2210
2211         * css/CSSSupportsRule.idl:
2212
2213 2016-07-27  Carlos Garcia Campos  <cgarcia@igalia.com>
2214
2215         [Soup] Test http/tests/xmlhttprequest/auth-reject-protection-space.html fails since added in r203743
2216         https://bugs.webkit.org/show_bug.cgi?id=160235
2217
2218         Reviewed by Michael Catanzaro.
2219
2220         It times out in release and crashes in debug due to an ASSERT_NOT_REACHED(). The soup backend doesn't really
2221         support rejecting the protection space and continuing with the next one, but we can at least continue with the
2222         request without crendential to make the test pass.
2223
2224         * platform/network/soup/ResourceHandleSoup.cpp:
2225         (WebCore::ResourceHandle::receivedChallengeRejection):
2226
2227 2016-07-27  Romain Bellessort  <romain.bellessort@crf.canon.fr>
2228
2229         [Streams API] Replace ReadableStreamReader by ReadableStreamDefaultReader
2230         https://bugs.webkit.org/show_bug.cgi?id=160194
2231
2232         Reviewed by Youenn Fablet.
2233
2234         Replaced ReadableStreamReader by ReadableStreamDefaultReader to align
2235         with updated Streams API specification.
2236
2237         No change in functionality.
2238
2239         * CMakeLists.txt:
2240         * DerivedSources.cpp:
2241         * DerivedSources.make:
2242         * Modules/fetch/FetchInternals.js:
2243         (consumeStream):
2244         * Modules/fetch/FetchResponse.js:
2245         (body):
2246         * Modules/streams/ReadableStream.js:
2247         (getReader):
2248         * Modules/streams/ReadableStreamDefaultReader.idl: Renamed from Source/WebCore/Modules/streams/ReadableStreamReader.idl.
2249         * Modules/streams/ReadableStreamDefaultReader.js: Renamed from Source/WebCore/Modules/streams/ReadableStreamReader.js.
2250         (cancel):
2251         (read):
2252         (releaseLock):
2253         (closed):
2254         * Modules/streams/ReadableStreamInternals.js:
2255         (privateInitializeReadableStreamDefaultReader):
2256         (teeReadableStream):
2257         (teeReadableStreamPullFunction):
2258         (isReadableStreamDefaultReader):
2259         (closeReadableStream):
2260         (readFromReadableStreamDefaultReader):
2261         * WebCore.xcodeproj/project.pbxproj:
2262         * bindings/js/JSDOMGlobalObject.cpp:
2263         (WebCore::JSDOMGlobalObject::addBuiltinGlobals):
2264         (WebCore::JSDOMGlobalObject::finishCreation):
2265         * bindings/js/JSReadableStreamPrivateConstructors.cpp:
2266         (WebCore::constructJSReadableStreamDefaultReader):
2267         (WebCore::JSBuiltinReadableStreamDefaultReaderPrivateConstructor::initializeExecutable):
2268         (WebCore::createReadableStreamDefaultReaderPrivateConstructor):
2269         * bindings/js/JSReadableStreamPrivateConstructors.h:
2270         * bindings/js/WebCoreBuiltinNames.h:
2271         * features.json:
2272
2273 2016-07-27  Javier Fernandez  <jfernandez@igalia.com>
2274
2275         [css-grid] Handle alignment with orthogonal flows
2276         https://bugs.webkit.org/show_bug.cgi?id=159295
2277
2278         Reviewed by Darin Adler.
2279
2280         Now that grid sizing and positioning issues wrt orthogonal flows have
2281         been clarified in the last spec draft, we can adapt now our alignment
2282         logic to work with orthogonal flows.
2283
2284         Even though basic alignment would work with orthogonal flows with
2285         this patch, we still doesn't allow stretching in that case. I'll provide a
2286         patch for that feature since it's a complex logic and better have an
2287         isolated change.
2288
2289         Tests: fast/css-grid-layout/grid-item-alignment-with-orthogonal-flows-vertical-lr.html
2290                fast/css-grid-layout/grid-item-alignment-with-orthogonal-flows-vertical-rl.html
2291                fast/css-grid-layout/grid-item-alignment-with-orthogonal-flows.html
2292
2293         * rendering/RenderGrid.cpp:
2294         (WebCore::computeOverflowAlignmentOffset): Using 'size' instead of 'breadth' as concept.
2295         (WebCore::RenderGrid::columnAxisPositionForChild): Dealing with orthogonal flow cases.
2296         (WebCore::RenderGrid::rowAxisPositionForChild): Dealing with orthogonal flow cases.
2297         (WebCore::RenderGrid::columnAxisOffsetForChild): Using 'size' instead of 'breadth' as concept.
2298         (WebCore::RenderGrid::rowAxisOffsetForChild): Using 'size' instead of 'breadth' as concept.
2299         (WebCore::RenderGrid::findChildLogicalPosition): Dealing with orthogonal flow cases.
2300
2301 2016-07-26  Youenn Fablet  <youenn@apple.com>
2302
2303         [Fetch API] Response constructor should be able to take a ReadableStream as body
2304         https://bugs.webkit.org/show_bug.cgi?id=159804
2305
2306         Reviewed by Alex Christensen.
2307
2308         Covered by existing and updated tests.
2309
2310         Introduced FetchBodyConsumer to encapsulate the code responsible to adapt FetchBody internal data to the requests made by user scripts.
2311         This refactoring eases the handling of internal data coming from ReadableStream.
2312
2313         FetchLoader is now delegating conversion from the data to its m_consumer field.
2314         If m_consumer is null, FetchLoader calls FetchLoaderClient::didReceiveData (streaming reception mode).
2315         Clients of FetchLoader needs to pass a FetchBodyConsumer to the FetchLoader to do the data adaptation at loader creation time.
2316
2317         Added support for body data passed as a ReadableStream to Response.
2318         This requires to set @body internal slot of the Response object in the constructor initialization JS built-in.
2319
2320         To actually use that data, Body accessors are also implemented as JS built-in for Response.
2321         Since there is no need to do so for Request, FetchResponse is no longer marked as implementing FetchBody but all
2322         FetchBody IDL description is inlined in FetchResponse.idl.
2323
2324         For each body accessor (arrayBuffer, blob, json, text), the corresponding JS built-in checks whether @body internal slot is set.
2325         If that is not the case, regular handling is done through a new private method called @consume.
2326         If @body internal slot is set, chunks are pumped from the ReadableStream using ReadableStream internal built-ins functions.
2327         Data handling is done in C++ through the private methods @startConsumingStream, @consumeChunk and @finishConsumingStream.
2328
2329         To support cloning of Response with bodies, clone method is also implemented as a JS built-in.
2330         Main clone is done through @cloneFoJS private method implemented in C++.
2331         JS built-in clone code does the teeing of the ReadableStream using ReadableStream JS built-in internal functions.
2332
2333         Introducing a new ReadableStream type for FetchBody to cope with body being stored in a ReadableStream.
2334
2335         Introducing a new Loaded type for FetchBody to cope with body being stored in the FetchBodyConsumer owned by FetchBody.
2336         This allows removing the conversion of data to JSC::ArrayBuffer which was done by defaut at the end of Fetch loading if user script did not request data before.
2337         At the end of a load, the data remains in FetchBodyConsumer and the body is marked as Loaded.
2338         If the user wants to get the data after data finished being loaded, FetchBodyConsumer will do the required conversions.
2339
2340         Introducing DeferredWrapper::resolveWithNewValue to handle the case of resolving promises with new objects.
2341         This allows directly using toJSNewlyCreated instead of toJS.
2342
2343         * CMakeLists.txt: Adding FetchBodyConsumer.cpp. Removing WebCoreJSBuiltins.cpp from CMake list as it is not needed.
2344         * Modules/fetch/FetchBody.cpp: Moving data adaptation code to FetchBodyConsumer.
2345         (WebCore::FetchBody::extract):
2346         (WebCore::FetchBody::arrayBuffer):
2347         (WebCore::FetchBody::blob): Setting contentType in FetchBodyConsumer to handle proper creation of blob.
2348         (WebCore::FetchBody::json):
2349         (WebCore::FetchBody::text):
2350         (WebCore::FetchBody::consume): Refactoring and added case of Loaded bodies.
2351         (WebCore::FetchBody::consumeAsStream): Ditto.
2352         (WebCore::FetchBody::consumeArrayBuffer):
2353         (WebCore::FetchBody::consumeText):
2354         (WebCore::FetchBody::consumeBlob):
2355         (WebCore::FetchBody::loadingFailed):
2356         (WebCore::FetchBody::loadingSucceeded):
2357         (WebCore::FetchBody::loadingType): Deleted.
2358         (WebCore::blobFromArrayBuffer): Deleted.
2359         (WebCore::FetchBody::fulfillTextPromise): Deleted.
2360         (WebCore::FetchBody::loadedAsArrayBuffer): Deleted.
2361         (WebCore::FetchBody::loadedAsText): Deleted.
2362         * Modules/fetch/FetchBody.h:
2363         (WebCore::FetchBody::consumer):
2364         * Modules/fetch/FetchBodyConsumer.cpp: Added, responsible of data adaptation.
2365         (WebCore::blobFromData):
2366         (WebCore::FetchBodyConsumer::resolveWithData):
2367         (WebCore::FetchBodyConsumer::resolve):
2368         (WebCore::FetchBodyConsumer::append):
2369         (WebCore::FetchBodyConsumer::takeData):
2370         (WebCore::FetchBodyConsumer::takeAsArrayBuffer):
2371         (WebCore::FetchBodyConsumer::takeAsBlob):
2372         (WebCore::FetchBodyConsumer::takeAsText):
2373         * Modules/fetch/FetchBodyConsumer.h: Added.
2374         (WebCore::FetchBodyConsumer::FetchBodyConsumer):
2375         (WebCore::FetchBodyConsumer::setContentType):
2376         (WebCore::FetchBodyConsumer::setType):
2377         (WebCore::FetchBodyConsumer::type):
2378         (WebCore::FetchBodyConsumer::clean):
2379         (WebCore::FetchBodyConsumer::hasData):
2380         * Modules/fetch/FetchBodyOwner.cpp:
2381         (WebCore::FetchBodyOwner::loadBlob):
2382         (WebCore::FetchBodyOwner::blobLoadingSucceeded):
2383         (WebCore::FetchBodyOwner::loadedBlobAsText): Deleted.
2384         * Modules/fetch/FetchBodyOwner.h:
2385         (WebCore::FetchBodyOwner::loadedBlobAsArrayBuffer): Deleted.
2386         * Modules/fetch/FetchInternals.js:
2387         (consumeStream): Pump ReadableStream data and send it to FetchResponse to be converted according user need.
2388         * Modules/fetch/FetchLoader.cpp:
2389         (WebCore::FetchLoader::FetchLoader): FetchLoader is simplified as it has two nodes: consumer mode in which case
2390         data is sent to the consumer and no-consumer mode in which case data is passed to loader client. The second mode
2391         is used to conveyy data to ReadableStream source.
2392         (WebCore::FetchLoader::stop):
2393         (WebCore::FetchLoader::startStreaming):
2394         (WebCore::FetchLoader::didReceiveData):
2395         (WebCore::FetchLoader::didFinishLoading): Deleted.
2396         * Modules/fetch/FetchLoader.h:
2397         * Modules/fetch/FetchLoaderClient.h:
2398         (WebCore::FetchLoaderClient::didFinishLoadingAsText): Deleted.
2399         (WebCore::FetchLoaderClient::didFinishLoadingAsArrayBuffer): Deleted.
2400         * Modules/fetch/FetchResponse.cpp:
2401         (WebCore::FetchResponse::cloneForJS):
2402         (WebCore::FetchResponse::BodyLoader::didSucceed):
2403         (WebCore::FetchResponse::BodyLoader::start):
2404         (WebCore::FetchResponse::consume): Introduced to consume data stored in body and not in ReadableStream.
2405         (WebCore::FetchResponse::startConsumingStream): Introduced to start process of consuming data stored in the ReadableStream.
2406         (WebCore::FetchResponse::consumeChunk): Reception of ReadableStream data.
2407         (WebCore::FetchResponse::finishConsumingStream): Doing the final conversion.
2408         (WebCore::FetchResponse::clone): Deleted.
2409         (WebCore::FetchResponse::BodyLoader::didFinishLoadingAsArrayBuffer): Deleted.
2410         * Modules/fetch/FetchResponse.h:
2411         * Modules/fetch/FetchResponse.idl: Inlining of FetchBody methods/attributes and adding private methods.
2412         * Modules/fetch/FetchResponse.js:
2413         (initializeFetchResponse):
2414         (clone):
2415         (arrayBuffer):
2416         (blob):
2417         (formData):
2418         (json):
2419         (text):
2420         * WebCore.xcodeproj/project.pbxproj:
2421         * bindings/js/JSDOMPromise.h:
2422         (WebCore::DeferredWrapper::resolveWithNewValue):
2423         * bindings/js/WebCoreBuiltinNames.h:
2424
2425 2016-07-26  Youenn Fablet  <youennf@gmail.com>
2426
2427         JS Built-ins should throw this-error messages consistently with binding generated code
2428         https://bugs.webkit.org/show_bug.cgi?id=160191
2429
2430         Reviewed by Darin Adler.
2431
2432         Introducing @makeThisTypeError and @makeGetterTypeError to create TypeError objects with a consistent error message.
2433         Making use of these functions in streams API and fetch API related built-in code.
2434
2435         Refactored JSDOMBinding.cpp code by adding makeThisTypeErrorMessage and makeGetterTypeErrorMessage helper routines
2436         These routines are used by both new built-in functions as well as binding generated code helper routine.
2437
2438         Tests: fetch/fetch-error-messages.html
2439                streams/readable-stream-error-messages.html
2440
2441         * Modules/fetch/FetchResponse.js:
2442         (body): Adding an explicit check so that the error message is right. The previous error message was related to the call of Response.@isDisturbed.
2443         * Modules/streams/ReadableStream.js:
2444         (cancel):
2445         (getReader):
2446         (pipeTo):
2447         (tee):
2448         (locked):
2449         * Modules/streams/ReadableStreamController.js:
2450         (enqueue):
2451         (error):
2452         (close):
2453         (desiredSize):
2454         * Modules/streams/ReadableStreamReader.js:
2455         (cancel):
2456         (read):
2457         (releaseLock):
2458         (closed):
2459         * bindings/js/JSDOMBinding.cpp:
2460         (WebCore::makeGetterTypeErrorMessage):
2461         (WebCore::throwGetterTypeError):
2462         (WebCore::makeThisTypeErrorMessage):
2463         (WebCore::throwThisTypeError):
2464         (WebCore::throwSequenceTypeError): Deleted.
2465         (WebCore::throwSetterTypeError): Deleted.
2466         * bindings/js/JSDOMBinding.h:
2467         * bindings/js/JSDOMGlobalObject.cpp:
2468         (WebCore::makeThisTypeErrorForBuiltins):
2469         (WebCore::makeGetterTypeErrorForBuiltins):
2470         (WebCore::JSDOMGlobalObject::addBuiltinGlobals):
2471         * bindings/js/WebCoreBuiltinNames.h:
2472
2473 2016-07-26  Carlos Garcia Campos  <cgarcia@igalia.com>
2474
2475         Unreviewed. Fix GTK+ distcheck build.
2476
2477         wtf/spi/darwin/dyldSPI.h is not included in GTK+ release tarballs.
2478
2479         * html/HTMLObjectElement.cpp: Include wtf/spi/darwin/dyldSPI.h only for iOS.
2480         * html/MediaElementSession.cpp: Ditto.
2481
2482 2016-07-26  Myles C. Maxfield  <mmaxfield@apple.com>
2483
2484         [iOS] SF-Heavy is inaccessible by web content
2485         https://bugs.webkit.org/show_bug.cgi?id=160186
2486         <rdar://problem/27434423>
2487
2488         Reviewed by Dean Jackson.
2489
2490         Once we create the system font, we need to modify it with the appropriate weight.
2491         This is because the CoreText API we use to get the system font on iOS does not
2492         let us choose the exact weight we want.
2493
2494         Test: fast/text/system-font-weight.html
2495
2496         * platform/graphics/ios/FontCacheIOS.mm:
2497         (WebCore::baseSystemFontDescriptor):
2498         (WebCore::systemFontModificationAttributes):
2499         (WebCore::systemFontDescriptor):
2500         (WebCore::platformFontWithFamilySpecialCase):
2501         * platform/spi/cocoa/CoreTextSPI.h:
2502
2503 2016-07-26  Fujii Hironori  <Hironori.Fujii@sony.com>
2504
2505         [GTK] ASSERTION FAILED: !m_adoptionIsRequired when Inspector Server is connected
2506         https://bugs.webkit.org/show_bug.cgi?id=160229
2507
2508         Reviewed by Carlos Garcia Campos.
2509
2510         An assertion fails because refcount of SocketStreamHandle is
2511         incremented before adoptRef, in the constructor of
2512         SocketStreamHandle.  The constructor of SocketStreamHandle needs
2513         to increment recount because it passes this pointer to libsoup.
2514
2515         * platform/network/soup/SocketStreamHandleSoup.cpp:
2516         (WebCore::SocketStreamHandle::SocketStreamHandle): Do
2517         relaxAdoptionRequirement() as well as the another constructor.
2518
2519 2016-07-26  Chris Dumez  <cdumez@apple.com>
2520
2521         Move 'dir' attribute from HTMLDocument to Document
2522         https://bugs.webkit.org/show_bug.cgi?id=160231
2523
2524         Reviewed by Sam Weinig.
2525
2526         Move 'dir' attribute from HTMLDocument to Document to match the
2527         specification:
2528         - https://html.spec.whatwg.org/multipage/dom.html#document
2529
2530         Both Firefox and Chrome have 'dir' on Document already.
2531
2532         No new tests, rebaselined existing test.
2533
2534         * dom/Document.cpp:
2535         (WebCore::Document::dir):
2536         (WebCore::Document::setDir):
2537         * dom/Document.h:
2538         * dom/Document.idl:
2539         * html/HTMLDocument.cpp:
2540         (WebCore::HTMLDocument::dir): Deleted.
2541         (WebCore::HTMLDocument::setDir): Deleted.
2542         * html/HTMLDocument.h:
2543         * html/HTMLDocument.idl:
2544
2545 2016-07-26  Chris Dumez  <cdumez@apple.com>
2546
2547         Second parameter to History.pushState() / replaceState() should be mandatory
2548         https://bugs.webkit.org/show_bug.cgi?id=160230
2549
2550         Reviewed by Sam Weinig.
2551
2552         Second parameter to History.pushState() / replaceState() should be mandatory:
2553         - https://html.spec.whatwg.org/multipage/browsers.html#history-3
2554
2555         Firefox and Chrome agree with the specification.
2556
2557         No new tests, rebaselined existing test.
2558
2559         * bindings/js/JSHistoryCustom.cpp:
2560         (WebCore::JSHistory::pushState):
2561         (WebCore::JSHistory::replaceState):
2562         * page/History.idl:
2563
2564 2016-07-26  Chris Dumez  <cdumez@apple.com>
2565
2566         Align Node.isEqualNode() with the specification
2567         https://bugs.webkit.org/show_bug.cgi?id=160224
2568
2569         Reviewed by Sam Weinig.
2570
2571         Align our implementation for Node.isEqualNode() to match more closely
2572         the text of the specification:
2573         - https://dom.spec.whatwg.org/#dom-node-isequalnode
2574         - https://dom.spec.whatwg.org/#concept-node-equals
2575
2576         This also fixes a bug where isEqualNode() would sometimes return false
2577         wrongly for elements because we were comparing the value returned by
2578         nodeName() which returns the tagName of elements. The issue was that
2579         the tagName's case may differ depending on the element being in an
2580         HTMLDocument or not. We now compare Element::tagQName() instead which
2581         ends up comparing namespace / namespace prefix and localName, as per
2582         the specification. The new behavior matches Firefox and Chrome and
2583         helps us pass an extra W3C test.
2584
2585         No new tests, rebaselined existing test.
2586
2587         * dom/Node.cpp:
2588         (WebCore::Node::isEqualNode):
2589
2590 2016-07-26  Simon Fraser  <simon.fraser@apple.com>
2591
2592         Sort the project files.
2593
2594         * WebCore.xcodeproj/project.pbxproj:
2595
2596 2016-07-26  Chris Dumez  <cdumez@apple.com>
2597
2598         Align CSSKeyframesRule with the specification
2599         https://bugs.webkit.org/show_bug.cgi?id=160219
2600
2601         Reviewed by Darin Adler.
2602
2603         Align CSSKeyframesRule with the specification:
2604         - https://drafts.csswg.org/css-animations/#interface-csskeyframesrule
2605
2606         In particular, the parameter to insertRule() / appendRule() /
2607         deleteRule() / findRule() should be mandatory. Both Firefox and Chrome
2608         agree with the specification here.
2609
2610         Also, the CSSKeyframesRule.name attribute should not be nullable.
2611         Chrome agrees with the specification. However, Firefox, has the
2612         attribute nullable. This patch aligns our behavior with Chrome and
2613         the specification.
2614
2615         Tests: animations/CSSKeyframesRule-name-null.html
2616                animations/CSSKeyframesRule-parameters.html
2617
2618         * css/CSSKeyframesRule.h:
2619         (WebCore::StyleRuleKeyframes::name):
2620         (WebCore::StyleRuleKeyframes::setName):
2621         * css/CSSKeyframesRule.idl:
2622
2623 2016-07-26  Myles C. Maxfield  <mmaxfield@apple.com>
2624
2625         [iPhone] Playing a video on tudou.com plays only sound, no video
2626         https://bugs.webkit.org/show_bug.cgi?id=160178
2627         <rdar://problem/27535468>
2628
2629         Reviewed by Eric Carlson and Dan Bernstein.
2630
2631         This patch re-implements r203520 in a much simpler way which doesn't involve a new SPI.
2632         The biggest problem with r203520 is that it make it impossible for a WKWebView to match
2633         MobileSafari's behavior. Instead of adding this new SPI, a simple version check should
2634         be used to keep old apps working.
2635
2636         The new behavior is characterized by the following table:
2637
2638                                              |                iOS                 |      Non-iOS
2639         =============================================================================================
2640         requiresPlayInlineAttribute == true  | Old app: honor -webkit-playsinline | honor playsinline
2641                                              | New app: honor playsinline         | honor playsinline
2642         ---------------------------------------------------------------------------------------------
2643         requiresPlayInlineAttribute == false | Always inline                      | Always inline
2644
2645         Specifically, this patch reverts r203545 which is the commit which actually removes
2646         the old SPI. As soon as Safari is migrated back to this old SPI, I'll remove the two
2647         new SPIs added in r203520.
2648
2649         Tests: media/video-playsinline.html
2650                media/video-webkit-playsinline.html
2651
2652         * html/MediaElementSession.cpp:
2653         (WebCore::MediaElementSession::requiresFullscreenForVideoPlayback):
2654         * page/Settings.cpp:
2655         * page/Settings.in:
2656         * testing/InternalSettings.cpp:
2657         (WebCore::InternalSettings::Backup::Backup):
2658         (WebCore::InternalSettings::Backup::restoreTo):
2659         (WebCore::InternalSettings::setInlineMediaPlaybackRequiresPlaysInlineAttribute):
2660         * testing/InternalSettings.h:
2661         * testing/InternalSettings.idl:
2662
2663 2016-07-26  Zalan Bujtas  <zalan@apple.com>
2664
2665         Move RenderView::shouldDisableLayoutStateForSubtree to SubtreeLayoutStateMaintainer.
2666         https://bugs.webkit.org/show_bug.cgi?id=160215
2667
2668         Reviewed by Darin Adler and Simon Fraser.
2669
2670         No change in functionality.
2671
2672         * page/FrameView.cpp:
2673         (WebCore::SubtreeLayoutStateMaintainer::SubtreeLayoutStateMaintainer):
2674         * rendering/RenderView.cpp:
2675         (WebCore::RenderView::shouldDisableLayoutStateForSubtree):
2676         * rendering/RenderView.h:
2677
2678 2016-07-26  Simon Fraser  <simon.fraser@apple.com>
2679
2680         Allow LOG macros to be used outside the namespace, and other logging cleanup
2681         https://bugs.webkit.org/show_bug.cgi?id=160216
2682
2683         Reviewed by Anders Carlsson.
2684
2685         Fix some issues with the LOG macros.
2686         
2687         First, they were not usable outside the WebKit namespace in WebKit2 code. Fix by moving
2688         its log channels outside of the namespace (they are protected by a unique prefix anyway).
2689         
2690         Second, allow LOG_WITH_STREAM to be used in WebKit2 by moving that and a helper macro
2691         into LogMacros.h, which is exported from WebCore as a private header.
2692         
2693         Third, split the Logging.h header into two. Logging.h remains for framework-internal
2694         log channels and log macros. Add LogInitialization.h which is external, and used to
2695         initialize the channels.
2696         
2697         Finally unify "initializeLogChannels" and "initializeLoggingChannels" terminology everywhere.
2698
2699         * WebCore.xcodeproj/project.pbxproj:
2700         * platform/LogInitialization.h: Added.
2701         * platform/LogMacros.h: Added.
2702         * platform/Logging.cpp:
2703         (WebCore::initializeLogChannelsIfNecessary):
2704         (WebCore::initializeLoggingChannelsIfNecessary): Deleted.
2705         * platform/Logging.h:
2706         * testing/js/WebCoreTestSupport.cpp:
2707         (WebCoreTestSupport::initializeLogChannelsIfNecessary):
2708         (WebCoreTestSupport::initializeLoggingChannelsIfNecessary): Deleted.
2709         * testing/js/WebCoreTestSupport.h:
2710
2711 2016-07-26  Anders Carlsson  <andersca@apple.com>
2712
2713         onpaymentauthorized callback not received when authorizing for a second time
2714         https://bugs.webkit.org/show_bug.cgi?id=160218
2715         rdar://problem/27527151
2716
2717         Reviewed by Tim Horton.
2718
2719         Only null out the active session if the status is a final state status.
2720
2721         * Modules/applepay/PaymentCoordinator.cpp:
2722         (WebCore::PaymentCoordinator::completePaymentSession):
2723
2724 2016-07-26  Chris Dumez  <cdumez@apple.com>
2725
2726         Range.prototype.compareBoundaryPoints.length should be 2
2727         https://bugs.webkit.org/show_bug.cgi?id=160217
2728
2729         Reviewed by Sam Weinig.
2730
2731         Range.prototype.compareBoundaryPoints.length:
2732         - https://dom.spec.whatwg.org/#interface-range
2733
2734         We had a bug in our IDL which caused length to be 0 even though
2735         both parameters were effectively mandatory.
2736
2737         No new tests, rebaselined existing test.
2738
2739         * dom/Range.idl:
2740
2741 2016-07-26  Chris Dumez  <cdumez@apple.com>
2742
2743         Align CSSStyleDeclaration with the specification
2744         https://bugs.webkit.org/show_bug.cgi?id=160214
2745
2746         Reviewed by Darin Adler.
2747
2748         Align CSSStyleDeclaration with the specification:
2749         - https://drafts.csswg.org/cssom/#the-cssstyledeclaration-interface
2750
2751         In particular, the parameters to removeProperty() / item() and
2752         getPropertyPriority() should be mandatory.
2753
2754         Firefox and Chrome match the specification.
2755
2756         Tests: fast/css/CSSStyleDeclaration-cssText-null.html
2757                fast/css/CSSStyleDeclaration-parameters.html
2758
2759         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
2760         (WebCore::JSCSSStyleDeclaration::getPropertyCSSValue):
2761         * css/CSSStyleDeclaration.idl:
2762
2763 2016-07-26  David Kilzer <ddkilzer@apple.com>
2764
2765         Networking process crash due to missing -[WebCoreAuthenticationClientAsChallengeSender performDefaultHandlingForAuthenticationChallenge:] implementation
2766         https://bugs.webkit.org/show_bug.cgi?id=156947
2767         <rdar://problem/23325160>
2768
2769         Reviewed by Alex Christensen.
2770
2771         Test: http/tests/xmlhttprequest/auth-reject-protection-space.html
2772
2773         * platform/network/mac/AuthenticationMac.mm:
2774         (-[WebCoreAuthenticationClientAsChallengeSender performDefaultHandlingForAuthenticationChallenge:]): Added.
2775         (-[WebCoreAuthenticationClientAsChallengeSender rejectProtectionSpaceAndContinueWithChallenge:]): Added.
2776
2777 2016-07-26  Chris Dumez  <cdumez@apple.com>
2778
2779         Parameters to CSSStyleSheet.insertRule() / deleteRule() should be mandatory
2780         https://bugs.webkit.org/show_bug.cgi?id=160210
2781
2782         Reviewed by Darin Adler.
2783
2784         Parameters to CSSStyleSheet.insertRule() / deleteRule() should be mandatory:
2785         - https://drafts.csswg.org/cssom/#cssstylesheet
2786
2787         They are mandatory in Firefox.
2788         They are mandatory in Chrome except for the second parameter of insertRule()
2789         which merely logs a deprecation warning.
2790
2791         This patch aligns our behavior with Chrome to move towards to specification
2792         while limiting the risk of breakage.
2793
2794         Test: fast/css/stylesheet-parameters.html
2795
2796         * css/CSSStyleSheet.cpp:
2797         (WebCore::CSSStyleSheet::deprecatedInsertRule):
2798         * css/CSSStyleSheet.h:
2799         * css/CSSStyleSheet.idl:
2800
2801 2016-07-26  George Ruan  <gruan@apple.com>
2802
2803         HTMLVideoElement frames do not update on iOS when src is a MediaStream blob
2804         https://bugs.webkit.org/show_bug.cgi?id=159833
2805         <rdar://problem/27379487>
2806
2807         Reviewed by Eric Carlson.
2808
2809         Test: fast/mediastream/MediaStream-video-element-displays-buffer.html
2810
2811         * WebCore.xcodeproj/project.pbxproj:
2812         * platform/cf/CoreMediaSoftLink.cpp: Add CMSampleBufferCreateReadyWithImageBuffer and CMVideoFormatDescriptionCreateForImageBuffer
2813         softlink.
2814         * platform/cf/CoreMediaSoftLink.h: Ditto.
2815         * platform/cocoa/CoreVideoSoftLink.cpp: Add CVPixelBufferCreate, kCVPixelBufferCGBitmapContextCompatibilityKey, and
2816         kCVPixelBufferCGImageCompatibilityKey.
2817         * platform/cocoa/CoreVideoSoftLink.h: Ditto.
2818         * platform/graphics/avfoundation/MediaSampleAVFObjC.h: Change create to return a Ref<T> instead
2819         of RefPtr<T>.
2820         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h: Make observer of
2821         MediaStreamTrackPrivate and make MediaPlayer use an AVSampleBufferDisplayLayer instead of CALayer.
2822         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: Ditto.
2823         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::~MediaPlayerPrivateMediaStreamAVFObjC): Clean up
2824         observers and AVSampleBufferDisplayLayer.
2825         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::isAvailable): Ensures AVSampleBufferDisplayLayer
2826         is available.
2827         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueAudioSampleBufferFromTrack): Placeholder.
2828         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSampleBufferFromTrack): Responsible
2829         for enqueuing sample buffers to the active video track.
2830         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayer): Ensures that an AVSampleBufferDisplayLayer
2831         exists.
2832         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::destroyLayer): Destroys the AVSampleBufferDisplayLayer.
2833         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::platformLayer): Replace CALayer with AVSampleBufferDisplayLayer.
2834         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentDisplayMode): Ditto.
2835         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::play): Call updateReadyState as a deferred task.
2836         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentReadyState): readyState is bumped to HAVE_ENOUGH_DATA
2837         only when the MediaPlayerPrivateMediaStreamAVFObjC has received a media sample.
2838         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::sampleBufferUpdated): Called from MediaStreamTrackPrivate when a
2839         new SampleBuffer is available.
2840         (WebCore::updateTracksOfType): Manage adding and removing self as observer from tracks.
2841         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateTracks): Replace CALayer with AVSampleBufferDisplayLayer
2842         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::acceleratedRenderingStateChanged): Copied from
2843         MediaPlayerPrivateMediaSourceAVFObjC.mm
2844         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::load): Deleted CALayer.
2845         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateDisplayMode): Deleted process of updating CALayer.
2846         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateIntrinsicSize): Deleted CALayer.
2847         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::createPreviewLayers): Deleted.
2848         * platform/mediastream/MediaStreamPrivate.cpp:
2849         (WebCore::MediaStreamPrivate::updateActiveVideoTrack): Remove redundant check.
2850         * platform/mediastream/MediaStreamTrackPrivate.cpp:
2851         (WebCore::MediaStreamTrackPrivate::sourceHasMoreMediaData): Called from RealtimeMediaSource when a new SampleBuffer
2852         is available.
2853         * platform/mediastream/MediaStreamTrackPrivate.h:
2854         (WebCore::MediaStreamTrackPrivate::Observer::sampleBufferUpdated): Relays to MediaPlayerPrivateMediaStreamAVFObjC that
2855         a new SampleBuffer is available to enqueue to the AVSampleBufferDisplayLayer.
2856         * platform/mediastream/RealtimeMediaSource.cpp:
2857         (WebCore::RealtimeMediaSource::settingsDidChange): Fix grammatical mistake in function name settingsDidChanged().
2858         (WebCore::RealtimeMediaSource::mediaDataUpdated): Relays to all observers that a new SampleBuffer is available.
2859         (WebCore::RealtimeMediaSource::settingsDidChanged): Deleted.
2860         * platform/mediastream/RealtimeMediaSource.h:
2861         * platform/mediastream/mac/AVVideoCaptureSource.mm:
2862         (WebCore::AVVideoCaptureSource::processNewFrame): Calls mediaDataUpdated when a new SampleBuffer is captured.
2863         * platform/mediastream/mac/MockRealtimeVideoSourceMac.h:
2864         * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
2865         (WebCore::MockRealtimeVideoSourceMac::CMSampleBufferFromPixelBuffer): Convert CVPixelBuffer to CMSampleBuffer.
2866         (WebCore::MockRealtimeVideoSourceMac::pixelBufferFromCGImage): Convert CGImage to CVPixelBuffer.
2867         (WebCore::MockRealtimeVideoSourceMac::updateSampleBuffer): Creates a CMSampleBuffer from current imageBuffer and
2868         sends the CMSampleBuffer to MediaPlayerPrivateMediaStreamAVFObjC
2869         * platform/mock/MockRealtimeVideoSource.cpp:
2870         (WebCore::MockRealtimeVideoSource::setFrameRate): Fix grammar of settingsDidChanged() to settingsDidChange().
2871         (WebCore::MockRealtimeVideoSource::setSize): Ditto.
2872         (WebCore::MockRealtimeVideoSource::generateFrame): Call updateSampleBuffer().
2873         * platform/mock/MockRealtimeVideoSource.h: Change elapsedTime() from private to protected.
2874         (WebCore::MockRealtimeVideoSource::updateSampleBuffer): Overriden by MockRealtimeVideoSourceMac.
2875
2876 2016-07-26  Zalan Bujtas  <zalan@apple.com>
2877
2878         Move ControlStates HashMap to RenderBox.
2879         https://bugs.webkit.org/show_bug.cgi?id=160206
2880
2881         Reviewed by Simon Fraser.
2882
2883         Move and modernize it.
2884
2885         No change in functionality.
2886
2887         * platform/ControlStates.h:
2888         (WebCore::ControlStates::ControlStates): Deleted.
2889         * rendering/RenderBox.cpp:
2890         (WebCore::controlStatesRendererMap):
2891         (WebCore::controlStatesForRenderer):
2892         (WebCore::removeControlStatesForRenderer):
2893         (WebCore::RenderBox::~RenderBox):
2894         (WebCore::RenderBox::paintBoxDecorations):
2895         * rendering/RenderElement.cpp:
2896         (WebCore::controlStatesRendererMap): Deleted.
2897         (WebCore::RenderElement::hasControlStatesForRenderer): Deleted.
2898         (WebCore::RenderElement::controlStatesForRenderer): Deleted.
2899         (WebCore::RenderElement::removeControlStatesForRenderer): Deleted.
2900         (WebCore::RenderElement::addControlStatesForRenderer): Deleted.
2901         * rendering/RenderElement.h:
2902
2903 2016-07-26  Eric Carlson  <eric.carlson@apple.com>
2904
2905         Occasional crash in WebCore::RenderVTTCue::initializeLayoutParameters
2906         https://bugs.webkit.org/show_bug.cgi?id=160208
2907
2908         Reviewed by Darin Adler.
2909
2910         * rendering/RenderVTTCue.cpp:
2911         (WebCore::RenderVTTCue::initializeLayoutParameters): Return when firstChild is NULL so a
2912         release build will not crash.
2913
2914 2016-07-26  Chris Dumez  <cdumez@apple.com>
2915
2916         Parameters to CustomEvent.initCustomEvent() should be mandatory
2917         https://bugs.webkit.org/show_bug.cgi?id=160205
2918
2919         Reviewed by Ryosuke Niwa.
2920
2921         Parameters to CustomEvent.initCustomEvent() should be mandatory:
2922         - https://dom.spec.whatwg.org/#interface-customevent
2923
2924         Firefox and Chrome agree with the specification.
2925
2926         No new tests, rebaselined existing test.
2927
2928         * dom/CustomEvent.idl:
2929
2930 2016-07-26  Chris Dumez  <cdumez@apple.com>
2931
2932         Second parameter to Range.isPointInRange() / comparePoint() should be mandatory
2933         https://bugs.webkit.org/show_bug.cgi?id=160202
2934
2935         Reviewed by Ryosuke Niwa.
2936
2937         Second parameter to Range.isPointInRange() / comparePoint() should be mandatory
2938         and be of type "unsigned long":
2939         - https://dom.spec.whatwg.org/#interface-range
2940
2941         Firefox and Chrome agree with the specification.
2942
2943         No new tests, rebaselined existing tests.
2944
2945         * accessibility/AXObjectCache.cpp:
2946         (WebCore::AXObjectCache::traverseToOffsetInRange):
2947         * dom/DocumentMarkerController.cpp:
2948         (WebCore::DocumentMarkerController::removeMarkers):
2949         (WebCore::DocumentMarkerController::markersInRange):
2950         (DocumentMarkerController::setMarkersActive):
2951         * dom/Range.cpp:
2952         (WebCore::Range::isPointInRange):
2953         (WebCore::Range::comparePoint):
2954         (WebCore::Range::compareBoundaryPoints):
2955         (WebCore::Range::toString):
2956         (WebCore::Range::absoluteTextRects):
2957         (WebCore::Range::absoluteTextQuads):
2958         (WebCore::boundaryTextNodesMerged):
2959         (WebCore::Range::getBorderAndTextQuads):
2960         * dom/Range.h:
2961         (WebCore::Range::startOffset):
2962         (WebCore::Range::endOffset):
2963         * dom/Range.idl:
2964         * dom/RangeBoundaryPoint.h:
2965         (WebCore::RangeBoundaryPoint::ensureOffsetIsValid):
2966         (WebCore::RangeBoundaryPoint::toPosition):
2967         (WebCore::RangeBoundaryPoint::offset):
2968         (WebCore::RangeBoundaryPoint::setOffset):
2969         (WebCore::RangeBoundaryPoint::setToBeforeChild):
2970         (WebCore::RangeBoundaryPoint::setToAfterChild):
2971         (WebCore::RangeBoundaryPoint::setToEndOfNode):
2972         (WebCore::RangeBoundaryPoint::childBeforeWillBeRemoved):
2973         (WebCore::RangeBoundaryPoint::invalidateOffset):
2974
2975 2016-07-26  Youenn Fablet  <youenn@apple.com>
2976
2977         [Fetch API] Add support for fetch mode, in particular cors
2978         https://bugs.webkit.org/show_bug.cgi?id=156753
2979
2980         Reviewed by Darin Adler.
2981
2982         Covered by rebased tests.
2983
2984         * Modules/fetch/FetchLoader.cpp:
2985         (WebCore::FetchLoader::start): Passing fetch mode to ThreadableLoader.
2986         Disabling as a temp fix credentials in case of CORS mode as credential options is not yet supported and would make several tests fail.
2987
2988 2016-07-26  Chris Dumez  <cdumez@apple.com>
2989
2990         Align NamedNodeMap with the specification
2991         https://bugs.webkit.org/show_bug.cgi?id=160204
2992
2993         Reviewed by Darin Adler.
2994
2995         Align NamedNodeMap with the specification:
2996         - https://dom.spec.whatwg.org/#interface-namednodemap
2997
2998         In particular, mark parameters as mandatory when they should be, and
2999         use tighter "Attr" typing instead of Node.
3000
3001         Chrome and Firefox agree with the specification.
3002
3003         Test: fast/dom/NamedNodeMap-parameters.html
3004
3005         * dom/NamedNodeMap.cpp:
3006         (WebCore::NamedNodeMap::getNamedItem):
3007         (WebCore::NamedNodeMap::getNamedItemNS):
3008         (WebCore::NamedNodeMap::removeNamedItem):
3009         (WebCore::NamedNodeMap::removeNamedItemNS):
3010         (WebCore::NamedNodeMap::setNamedItem):
3011         (WebCore::NamedNodeMap::item):
3012         * dom/NamedNodeMap.h:
3013         * dom/NamedNodeMap.idl:
3014
3015 2016-07-26  Said Abou-Hallawa  <sabouhallawa@apple.com>
3016
3017         Infinite Canvas context save() causes WebKit to crash
3018         https://bugs.webkit.org/show_bug.cgi?id=159586
3019         <rdar://problem/26759984>
3020
3021         Reviewed by Simon Fraser.
3022
3023         Limit the size of the canvas context state stack to 1024 * 16 saves. All
3024         the saves which come after that limit will stay unrealized. The restore() 
3025         should not have any effect till there is no unrealized saves.
3026          
3027         Test: fast/canvas/canvas-context-save-limit.html
3028
3029         * html/canvas/CanvasRenderingContext2D.cpp:
3030         (WebCore::CanvasRenderingContext2D::realizeSaves):
3031         (WebCore::CanvasRenderingContext2D::realizeSavesLoop):
3032         * html/canvas/CanvasRenderingContext2D.h: 
3033
3034 2016-07-26  Youenn Fablet  <youenn@apple.com>
3035
3036         DOMTokenList should be iterable
3037         https://bugs.webkit.org/show_bug.cgi?id=160183
3038
3039         Reviewed by Chris Dumez.
3040
3041         DOMTokenList should be iterable as per https://dom.spec.whatwg.org/#interface-domtokenlist
3042
3043         Test: fast/dom/domTokenListIterator.html
3044
3045         * html/DOMTokenList.idl: Added iterable to the interface description.
3046
3047 2016-07-26  Commit Queue  <commit-queue@webkit.org>
3048
3049         Unreviewed, rolling out r203719.
3050         https://bugs.webkit.org/show_bug.cgi?id=160200
3051
3052         It is breaking win build (Requested by youenn on #webkit).
3053
3054         Reverted changeset:
3055
3056         "[Fetch API] Response constructor should be able to take a
3057         ReadableStream as body"
3058         https://bugs.webkit.org/show_bug.cgi?id=159804
3059         http://trac.webkit.org/changeset/203719
3060
3061 2016-07-26  John Wilander  <wilander@apple.com>
3062
3063         Stop supporting compressed character sets BOCU-1 and SCSU
3064         https://bugs.webkit.org/show_bug.cgi?id=159581
3065
3066         Reviewed by Brent Fulgham.
3067
3068         WebKit should not support the compressed character sets BOCU-1 and SCSU.
3069         Chrome and Firefox don't and these old formats may pass server-side character
3070         filters while still rendering in WebKit.
3071
3072         The HTML specification says "The above prohibits supporting, for example,
3073         CESU-8, UTF-7, BOCU-1, SCSU, EBCDIC, and UTF-32."
3074         https://html.spec.whatwg.org/#character-encodings
3075
3076         Tests: http/tests/misc/char-encoding-bocu-1-blacklisted.html
3077                http/tests/misc/char-encoding-scsu-blacklisted.html
3078
3079         * platform/text/TextEncodingRegistry.cpp:
3080             Blacklisted BOCU-1 and SCSU character sets.
3081
3082 2016-07-26  Carlos Garcia Campos  <cgarcia@igalia.com>
3083
3084         ASSERTION FAILED: !m_frame->page()->defersLoading() || InspectorInstrumentation::isDebuggerPaused(m_frame)
3085         https://bugs.webkit.org/show_bug.cgi?id=160193
3086
3087         Reviewed by Michael Catanzaro.
3088
3089         This is happening in the GTK+ Debug bot when running test loader/load-defer.html (note that the assert is inside
3090         a !USE(CF) block).
3091         The test is creating an iframe with load deferred, then in a timeout it disables the deferred load and checks
3092         that the load actually happens. What happens is that the initial empty document is what calls
3093         DocumentLoader::finishedLoading() when load is still deferred. The onload handler is not called because load
3094         events are disabled for the initial empty document in SubframeLoader::loadSubframe(), but
3095         DocumentLoader::finishedLoading() is called unconditionally from maybeLoadEmpty(). I think it's fine to call
3096         DocumentLoader::finishedLoading() for the initial empty document even when load is deferred, so we can simply
3097         update the assert to handle that case.
3098
3099         * loader/DocumentLoader.cpp:
3100         (WebCore::DocumentLoader::finishedLoading): Do not assert if called for the initial empty document when load is
3101         deferred.
3102
3103 2016-07-26  Youenn Fablet  <youenn@apple.com>
3104
3105         Remove ClientCredentialPolicy cross-origin option from ResourceLoaderOptions
3106         https://bugs.webkit.org/show_bug.cgi?id=159413
3107
3108         Reviewed by Alex Christensen.
3109
3110         ClientCredentialPolicy had three values (not ask, ask, ask only for same origin).
3111         The distinction between allowing cross-origin or same-origin credentials is misleading as it is not supported
3112         for synchronous loads and not supported by Network process.
3113         It is best replaced by a boolean option (ask or not ask).
3114
3115         Same-origin ClientCredentialPolicy option was only used by DocumentThreadableLoader for asynchronous loads.
3116         Since DocumentThreadableLoader is already computing whether the request is cross-origin, it can also compute
3117         whether credentials may be requested or not. In case of cross-origin redirections, credentials are omitted, thus
3118         disabling any possibility for requesting credentials for cross-origin resources after redirections.
3119
3120         Moving ClientCredentialPolicy to ResourceLoaderOptions since it is not used by platform code except for some
3121         mac-specific code that is already using ResourceLoaderOptions.
3122
3123         Covered by existing tests.
3124
3125         * loader/CrossOriginPreflightChecker.cpp:
3126         (WebCore::CrossOriginPreflightChecker::startPreflight): Setting clearly credential mode to Omit credentials.
3127         (WebCore::CrossOriginPreflightChecker::doPreflight): Ditto.
3128         * loader/DocumentLoader.cpp:
3129         (WebCore::DocumentLoader::startLoadingMainResource): AskClientForAllCredentials ->
3130         ClientCredentialPolicy::MayAskClientForCredentials.
3131         * loader/DocumentThreadableLoader.cpp:
3132         (WebCore::DocumentThreadableLoader::loadRequest): Disabling requesting credentials for any cross-origin request.
3133         * loader/FrameLoader.h:
3134         * loader/MediaResourceLoader.cpp:
3135         (WebCore::MediaResourceLoader::requestResource): AskClientForAllCredentials -> ClientCredentialPolicy::MayAskClientForCredentials.
3136         * loader/NetscapePlugInStreamLoader.cpp:
3137         (WebCore::NetscapePlugInStreamLoader::NetscapePlugInStreamLoader): Ditto.
3138         * loader/ResourceLoader.cpp:
3139         (WebCore::ResourceLoader::isAllowedToAskUserForCredentials): Disabling client credential request if ClientCredentialPolicy is CannotAskClientForCredentials.
3140         Otherwise, returns true if fetch credentials mode allows it.
3141         * loader/ResourceLoaderOptions.h:
3142         (WebCore::ResourceLoaderOptions::ResourceLoaderOptions):
3143         (WebCore::ResourceLoaderOptions::clientCredentialPolicy): Deleted.
3144         (WebCore::ResourceLoaderOptions::setClientCredentialPolicy): Deleted.
3145         * loader/cache/CachedResourceLoader.cpp:
3146         (WebCore::CachedResourceLoader::requestUserCSSStyleSheet): AskClientForAllCredentials -> ClientCredentialPolicy::MayAskClientForCredentials.
3147         (WebCore::CachedResourceLoader::defaultCachedResourceOptions): AskClientForAllCredentials -> ClientCredentialPolicy::MayAskClientForCredentials.
3148         * loader/icon/IconLoader.cpp:
3149         (WebCore::IconLoader::startLoading): DoNotAskClientForAnyCredentials -> ClientCredentialPolicy::CannotAskClientForCredentials.
3150         * platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
3151         (WebCore::WebCoreAVCFResourceLoader::startLoading): DoNotAskClientForCrossOriginCredentials -> ClientCredentialPolicy::CannotAskClientForCredentials.
3152         This is ok as credentials mode is omit and stored credentials are not allowed.
3153         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
3154         (WebCore::WebCoreAVFResourceLoader::startLoading): Ditto.
3155         * platform/network/ResourceHandleTypes.h:
3156         * xml/XSLTProcessorLibxslt.cpp: DoNotAskClientForCrossOriginCredentials -> ClientCredentialPolicy::MayAskClientForCredentials.
3157         This is ok as this is a synchronous load.
3158         (WebCore::docLoaderFunc):
3159         * xml/parser/XMLDocumentParserLibxml2.cpp:
3160         (WebCore::openFunc): DoNotAskClientForCrossOriginCredentials -> ClientCredentialPolicy::MayAskClientForCredentials.
3161         This is ok as this is a synchronous load.
3162
3163 2016-07-26  Youenn Fablet  <youenn@apple.com>
3164
3165         [Fetch API] Response constructor should be able to take a ReadableStream as body
3166         https://bugs.webkit.org/show_bug.cgi?id=159804
3167
3168         Reviewed by Alex Christensen.
3169
3170         Covered by existing and updated tests.
3171
3172         Introduced FetchBodyConsumer to encapsulate the code responsible to adapt FetchBody internal data to the requests made by user scripts.
3173         This refactoring eases the handling of internal data coming from ReadableStream.
3174
3175         FetchLoader is now delegating conversion from the data to its m_consumer field.
3176         If m_consumer is null, FetchLoader calls FetchLoaderClient::didReceiveData (streaming reception mode).
3177         Clients of FetchLoader needs to pass a FetchBodyConsumer to the FetchLoader to do the data adaptation at loader creation time.
3178
3179         Added support for body data passed as a ReadableStream to Response.
3180         This requires to set @body internal slot of the Response object in the constructor initialization JS built-in.
3181
3182         To actually use that data, Body accessors are also implemented as JS built-in for Response.
3183         Since there is no need to do so for Request, FetchResponse is no longer marked as implementing FetchBody but all
3184         FetchBody IDL description is inlined in FetchResponse.idl.
3185
3186         For each body accessor (arrayBuffer, blob, json, text), the corresponding JS built-in checks whether @body internal slot is set.
3187         If that is not the case, regular handling is done through a new private method called @consume.
3188         If @body internal slot is set, chunks are pumped from the ReadableStream using ReadableStream internal built-ins functions.
3189         Data handling is done in C++ through the private methods @startConsumingStream, @consumeChunk and @finishConsumingStream.
3190
3191         To support cloning of Response with bodies, clone method is also implemented as a JS built-in.
3192         Main clone is done through @cloneFoJS private method implemented in C++.
3193         JS built-in clone code does the teeing of the ReadableStream using ReadableStream JS built-in internal functions.
3194
3195         Introducing a new ReadableStream type for FetchBody to cope with body being stored in a ReadableStream.
3196
3197         Introducing a new Loaded type for FetchBody to cope with body being stored in the FetchBodyConsumer owned by FetchBody.
3198         This allows removing the conversion of data to JSC::ArrayBuffer which was done by defaut at the end of Fetch loading if user script did not request data before.
3199         At the end of a load, the data remains in FetchBodyConsumer and the body is marked as Loaded.
3200         If the user wants to get the data after data finished being loaded, FetchBodyConsumer will do the required conversions.
3201
3202         Introducing DeferredWrapper::resolveWithNewValue to handle the case of resolving promises with new objects.
3203         This allows directly using toJSNewlyCreated instead of toJS.
3204
3205         * CMakeLists.txt: Adding FetchBodyConsumer.
3206         * Modules/fetch/FetchBody.cpp: Moving data adaptation code to FetchBodyConsumer.
3207         (WebCore::FetchBody::extract):
3208         (WebCore::FetchBody::arrayBuffer):
3209         (WebCore::FetchBody::blob): Setting contentType in FetchBodyConsumer to handle proper creation of blob.
3210         (WebCore::FetchBody::json):
3211         (WebCore::FetchBody::text):
3212         (WebCore::FetchBody::consume): Refactoring and added case of Loaded bodies.
3213         (WebCore::FetchBody::consumeAsStream): Ditto.
3214         (WebCore::FetchBody::consumeArrayBuffer):
3215         (WebCore::FetchBody::consumeText):
3216         (WebCore::FetchBody::consumeBlob):
3217         (WebCore::FetchBody::loadingFailed):
3218         (WebCore::FetchBody::loadingSucceeded):
3219         (WebCore::FetchBody::loadingType): Deleted.
3220         (WebCore::blobFromArrayBuffer): Deleted.
3221         (WebCore::FetchBody::fulfillTextPromise): Deleted.
3222         (WebCore::FetchBody::loadedAsArrayBuffer): Deleted.
3223         (WebCore::FetchBody::loadedAsText): Deleted.
3224         * Modules/fetch/FetchBody.h:
3225         (WebCore::FetchBody::consumer):
3226         * Modules/fetch/FetchBodyConsumer.cpp: Added, responsible of data adaptation.
3227         (WebCore::blobFromData):
3228         (WebCore::FetchBodyConsumer::resolveWithData):
3229         (WebCore::FetchBodyConsumer::resolve):
3230         (WebCore::FetchBodyConsumer::append):
3231         (WebCore::FetchBodyConsumer::takeData):
3232         (WebCore::FetchBodyConsumer::takeAsArrayBuffer):
3233         (WebCore::FetchBodyConsumer::takeAsBlob):
3234         (WebCore::FetchBodyConsumer::takeAsText):
3235         * Modules/fetch/FetchBodyConsumer.h: Added.
3236         (WebCore::FetchBodyConsumer::FetchBodyConsumer):
3237         (WebCore::FetchBodyConsumer::setContentType):
3238         (WebCore::FetchBodyConsumer::setType):
3239         (WebCore::FetchBodyConsumer::type):
3240         (WebCore::FetchBodyConsumer::clean):
3241         (WebCore::FetchBodyConsumer::hasData):
3242         * Modules/fetch/FetchBodyOwner.cpp:
3243         (WebCore::FetchBodyOwner::loadBlob):
3244         (WebCore::FetchBodyOwner::blobLoadingSucceeded):
3245         (WebCore::FetchBodyOwner::loadedBlobAsText): Deleted.
3246         * Modules/fetch/FetchBodyOwner.h:
3247         (WebCore::FetchBodyOwner::loadedBlobAsArrayBuffer): Deleted.
3248         * Modules/fetch/FetchInternals.js:
3249         (consumeStream): Pump ReadableStream data and send it to FetchResponse to be converted according user need.
3250         * Modules/fetch/FetchLoader.cpp:
3251         (WebCore::FetchLoader::FetchLoader): FetchLoader is simplified as it has two nodes: consumer mode in which case
3252         data is sent to the consumer and no-consumer mode in which case data is passed to loader client. The second mode
3253         is used to conveyy data to ReadableStream source.
3254         (WebCore::FetchLoader::stop):
3255         (WebCore::FetchLoader::startStreaming):
3256         (WebCore::FetchLoader::didReceiveData):
3257         (WebCore::FetchLoader::didFinishLoading): Deleted.
3258         * Modules/fetch/FetchLoader.h:
3259         * Modules/fetch/FetchLoaderClient.h:
3260         (WebCore::FetchLoaderClient::didFinishLoadingAsText): Deleted.
3261         (WebCore::FetchLoaderClient::didFinishLoadingAsArrayBuffer): Deleted.
3262         * Modules/fetch/FetchResponse.cpp:
3263         (WebCore::FetchResponse::cloneForJS):
3264         (WebCore::FetchResponse::BodyLoader::didSucceed):
3265         (WebCore::FetchResponse::BodyLoader::start):
3266         (WebCore::FetchResponse::consume): Introduced to consume data stored in body and not in ReadableStream.
3267         (WebCore::FetchResponse::startConsumingStream): Introduced to start process of consuming data stored in the ReadableStream.
3268         (WebCore::FetchResponse::consumeChunk): Reception of ReadableStream data.
3269         (WebCore::FetchResponse::finishConsumingStream): Doing the final conversion.
3270         (WebCore::FetchResponse::clone): Deleted.
3271         (WebCore::FetchResponse::BodyLoader::didFinishLoadingAsArrayBuffer): Deleted.
3272         * Modules/fetch/FetchResponse.h:
3273         * Modules/fetch/FetchResponse.idl: Inlining of FetchBody methods/attributes and adding private methods.
3274         * Modules/fetch/FetchResponse.js:
3275         (initializeFetchResponse):
3276         (clone):
3277         (arrayBuffer):
3278         (blob):
3279         (formData):
3280         (json):
3281         (text):
3282         * WebCore.xcodeproj/project.pbxproj:
3283         * bindings/js/JSDOMPromise.h:
3284         (WebCore::DeferredWrapper::resolveWithNewValue):
3285         * bindings/js/WebCoreBuiltinNames.h:
3286
3287 2016-07-25  Sergio Villar Senin  <svillar@igalia.com>
3288
3289         [css-grid] repeat() syntax should take a <track-list> argument
3290         https://bugs.webkit.org/show_bug.cgi?id=160162
3291
3292         Reviewed by Darin Adler.
3293
3294         The repeat() notation used to allow just 1 <track-size> as second argument. Specs have been
3295         recently modified so that a <track-list> is now supported, meaning that we can pass an
3296         arbitrary number of track sizes and line numbers.
3297
3298         It has been working for some time for repeat() if the first argument was a positive integer,
3299         but it requires some changes for the auto repeat cases (auto-fill and auto-fit).
3300
3301         * css/CSSComputedStyleDeclaration.cpp:
3302         (WebCore::OrderedNamedLinesCollector::OrderedNamedLinesCollector): Store the total number of
3303         auto repeat tracks and the length of a single repetition instead of the number of
3304         repetitions.
3305         (WebCore::OrderedNamedLinesCollector::collectLineNamesForIndex): Do not assume that there is
3306         only 1 repeat track.
3307         (WebCore::valueForGridTrackList):
3308         * css/CSSParser.cpp:
3309         (WebCore::CSSParser::parseGridTrackRepeatFunction): Allow multiple tracks in repeat().
3310         * rendering/RenderGrid.cpp:
3311         (WebCore::RenderGrid::rawGridTrackSize): Renamed repetitions -> autoRepeatTracksCount.
3312         (WebCore::RenderGrid::computeAutoRepeatTracksCount): Use all the repeat tracks to compute
3313         the total track size of a single repetition.
3314         (WebCore::RenderGrid::computeEmptyTracksForAutoRepeat):
3315         * rendering/style/GridPositionsResolver.cpp:
3316         (WebCore::NamedLineCollection::NamedLineCollection): Renamed m_repetitions ->
3317         m_autoRepeatTotalTracks. Added m_autoRepeatTrackListLength (it was always 1 before).
3318         (WebCore::NamedLineCollection::find): Resolve lines inside multiple repeat tracks.
3319         (WebCore::NamedLineCollection::firstPosition): Ditto.
3320         * rendering/style/GridPositionsResolver.h:
3321
3322 2016-07-25  Sergio Villar Senin  <svillar@igalia.com>
3323
3324         [css-grid] grid-auto-flow|row should take a <track-size>+
3325         https://bugs.webkit.org/show_bug.cgi?id=160158
3326
3327         Reviewed by Darin Adler.
3328
3329         * css/CSSComputedStyleDeclaration.cpp:
3330         (WebCore::valueForGridTrackSizeList):
3331         (WebCore::ComputedStyleExtractor::propertyValue): Return a list of <track-size> instead of
3332         just one.
3333         * css/CSSParser.cpp:
3334         (WebCore::CSSParser::parseValue): Use the new values of TrackListType;
3335         (WebCore::CSSParser::parseGridTemplateRowsAndAreasAndColumns): Ditto.
3336         (WebCore::CSSParser::parseGridTemplateShorthand): Ditto.
3337         (WebCore::CSSParser::parseGridShorthand): Ditto.
3338         (WebCore::CSSParser::parseGridTrackList): Changed behavior depending on the value of
3339         TrackSizeList.
3340         * css/CSSParser.h: TrackListType has now 3 different values which determine the behavior of
3341         parseGridTrackList.
3342         * css/CSSPropertyNames.in: Use a new converter for lists.
3343         * css/StyleBuilderConverter.h:
3344         (WebCore::StyleBuilderConverter::convertGridTrackSizeList):
3345         * rendering/RenderGrid.cpp:
3346         (WebCore::RenderGrid::rawGridTrackSize): Resolve the size of the auto track.
3347         * rendering/style/RenderStyle.h:
3348         (WebCore::RenderStyle::gridAutoColumns): Return a Vector.
3349         (WebCore::RenderStyle::gridAutoRows): Ditto.
3350         (WebCore::RenderStyle::setGridAutoColumns): Store a Vector.
3351         (WebCore::RenderStyle::setGridAutoRows): Ditto.
3352         (WebCore::RenderStyle::initialGridAutoColumns): Return a Vector with one auto track.
3353         (WebCore::RenderStyle::initialGridAutoRows): Ditto.
3354         * rendering/style/StyleGridData.h: Store a Vector of GridTrackSize instead of just one.
3355
3356 2016-07-25  Frederic Wang  <fwang@igalia.com>
3357
3358         MathOperator: Add a mapping from combining to non-combining equivalents
3359         https://bugs.webkit.org/show_bug.cgi?id=159513
3360
3361         Reviewed by Darin Adler.
3362
3363         Many math fonts provide stretch variants and assemblies for combining characters but not for
3364         their non-combining equivalent. In the MathML recommendation, it is suggested to use
3365         non-combining charaters, so we allow the operator stretching code to look for constructions
3366         associated to these non-combining characters in order to still be able to stretch the
3367         combining ones.
3368
3369         Test: mathml/presentation/bug159513.html
3370
3371         * rendering/mathml/MathOperator.cpp:
3372         (WebCore::MathOperator::getGlyph): New function extending getBaseGlyph to retrieve the glyph
3373         data for an arbitrary character.
3374         (WebCore::MathOperator::getMathVariantsWithFallback): This helper function calls
3375         getMathVariants for the base glyph. If no constructions are available, it calls
3376         getMathVariants for the glyph associated to equivalent fallback characters as listed in the
3377         small characterFallback table.
3378         (WebCore::MathOperator::calculateStretchyData): Call getMathVariantsWithFallback instead of
3379         getMathVariants. Note that we do not need to do that for calculateDisplayStyleLargeOperator
3380         as we do not use fallback for large operators.
3381         * rendering/mathml/MathOperator.h:
3382         (WebCore::MathOperator::getBaseGlyph): Use getGlyph to implement this function.
3383
3384 2016-07-25  Chris Dumez  <cdumez@apple.com>
3385
3386         Second parameter to Range.setStart() / setEnd() should be mandatory
3387         https://bugs.webkit.org/show_bug.cgi?id=160184
3388
3389         Reviewed by Ryosuke Niwa.
3390
3391         Second parameter to Range.setStart() / setEnd() should be mandatory:
3392         - https://dom.spec.whatwg.org/#interface-range
3393
3394         Also use "unsigned long" instead of "long" type for the parameter,
3395         as per the specification.
3396
3397         Firefox and Chrome agree with the specification.
3398
3399         No new tests, rebaselined existing test.
3400
3401         * dom/Range.cpp:
3402         (WebCore::Range::setStart):
3403         (WebCore::Range::setEnd):
3404         (WebCore::Range::checkNodeWOffset):
3405         * dom/Range.h:
3406         * dom/Range.idl: