[DOMJIT] Implement Node::ownerDocument
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-10-26  Yusuke Suzuki  <utatane.tea@gmail.com>
2
3         [DOMJIT] Implement Node::ownerDocument
4         https://bugs.webkit.org/show_bug.cgi?id=164004
5
6         Reviewed by Darin Adler.
7
8         Test: js/dom/domjit-accessor-owner-document.html
9
10         Implement Node.ownerDocument DOMJIT accessor.
11         According to the result of the profiler, jQuery's prop()
12         function is frequently called in Ember.js SpeedoMeter.
13         And this function calls jQuery.isXMLDoc(). And this isXMLDoc()
14         function calls element.ownerDocument accessor. And our WebKit
15         inspector also uses ownerDocument accessor frequently.
16
17         Interesting thing is this ownerDocument functionality is used
18         in CSSJIT, so CSSJIT has similar helper function to look up the
19         owner document of the element. As a result, all the necessary
20         functionality is already implemented, DOMJIT just utilizes it.
21         For example, Node::treeScopeMemoryOffset() and
22         TreeScope::documentScopeMemoryOffset() is implemented before this
23         patch.
24
25         In the future, we will convert CSSJIT's Assembler& to CCallHelpers&
26         and share the code with DOMJIT[1].
27
28         [1]: https://bugs.webkit.org/show_bug.cgi?id=164006
29
30         * dom/Node.idl:
31         * domjit/DOMJITAbstractHeapRepository.h:
32         * domjit/JSNodeDOMJIT.cpp:
33         (WebCore::NodeOwnerDocumentDOMJIT::checkDOM):
34         (WebCore::NodeOwnerDocumentDOMJIT::callDOM):
35
36 2016-10-26  Chris Dumez  <cdumez@apple.com>
37
38         Replace IDBKeyPath with a WTF::Variant
39         https://bugs.webkit.org/show_bug.cgi?id=163909
40
41         Reviewed by Darin Adler.
42
43         Replace IDBKeyPath class with the IDBKeyPathVariant type entirely
44         and rename IDBKeyPathVariant to IDBKeyPath.
45
46         Unfortunately, IDBKeyPath still needs some special handling when
47         returned to the JavaScript because we do not have a toJS() accepting
48         a WTF::Variant as input yet.
49
50         There should be no significant behavior change except that
51         IDBIndex.keyPath / IDBObjectStore.keyPath now returns an array of
52         Strings instead of a DOMStringList object when the IDBKeyPath
53         contains a vector. This is a progression and matches the
54         specification:
55         - https://www.w3.org/TR/IndexedDB/#widl-IDBIndex-keyPath
56         - https://www.w3.org/TR/IndexedDB/#widl-IDBObjectStore-keyPath
57
58         No new tests, rebaselined existing tests.
59
60         * Modules/indexeddb/IDBCursor.cpp:
61         (WebCore::IDBCursor::update):
62         * Modules/indexeddb/IDBDatabase.h:
63         * Modules/indexeddb/IDBGetResult.cpp:
64         (WebCore::IDBGetResult::isolatedCopy):
65         * Modules/indexeddb/IDBKeyPath.cpp:
66         (WebCore::isIDBKeyPathValid):
67         (WebCore::IDBKeyPathIsolatedCopy):
68         * Modules/indexeddb/IDBKeyPath.h:
69         (WebCore::IDBKeyPathIsolatedCopy):
70         * Modules/indexeddb/IDBObjectStore.cpp:
71         (WebCore::IDBObjectStore::keyPath):
72         (WebCore::IDBObjectStore::putOrAdd):
73         (WebCore::IDBObjectStore::createIndex):
74         * Modules/indexeddb/IDBObjectStore.h:
75         * Modules/indexeddb/server/IDBSerialization.cpp:
76         (WebCore::serializeIDBKeyPath):
77         (WebCore::deserializeIDBKeyPath):
78         * Modules/indexeddb/server/IDBSerialization.h:
79         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
80         (WebCore::IDBServer::SQLiteIDBBackingStore::extractExistingDatabaseInfo):
81         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
82         (WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd):
83         * Modules/indexeddb/shared/IDBDatabaseInfo.cpp:
84         (WebCore::IDBDatabaseInfo::createNewObjectStore):
85         * Modules/indexeddb/shared/IDBDatabaseInfo.h:
86         * Modules/indexeddb/shared/IDBIndexInfo.cpp:
87         (WebCore::IDBIndexInfo::IDBIndexInfo):
88         (WebCore::IDBIndexInfo::isolatedCopy):
89         * Modules/indexeddb/shared/IDBIndexInfo.h:
90         * Modules/indexeddb/shared/IDBObjectStoreInfo.cpp:
91         (WebCore::IDBObjectStoreInfo::IDBObjectStoreInfo):
92         (WebCore::IDBObjectStoreInfo::createNewIndex):
93         (WebCore::IDBObjectStoreInfo::isolatedCopy):
94         * Modules/indexeddb/shared/IDBObjectStoreInfo.h:
95         (WebCore::IDBObjectStoreInfo::keyPath):
96         * bindings/js/IDBBindingUtilities.cpp:
97         (WebCore::injectIDBKeyIntoScriptValue):
98         (WebCore::maybeCreateIDBKeyFromScriptValueAndKeyPath):
99         (WebCore::canInjectIDBKeyIntoScriptValue):
100         (WebCore::createKeyPathArray):
101         (WebCore::toJS):
102         * bindings/js/IDBBindingUtilities.h:
103         * inspector/InspectorIndexedDBAgent.cpp:
104
105 2016-10-26  Zalan Bujtas  <zalan@apple.com>
106
107         Ignore out-of-flow siblings when searching for a spanner candidate.
108         https://bugs.webkit.org/show_bug.cgi?id=164042.
109         <rdar://problem/28758456>
110
111         Reviewed by Simon Fraser.
112
113         While searching for the spanner candidates in a flow thread, we have to take into account
114         whether renderers are in- or out-of-flow.
115         What it means is that while traversing the renderer tree to find the the candidate
116         renderer (next sibling/ancestor's next child in pre-order traversal), we have to check if the candidate
117         is in the same layout context too.
118
119         Test: fast/multicol/crash-when-spanner-candidate-is-out-of-flow.html
120
121         * rendering/RenderMultiColumnFlowThread.cpp:
122         (WebCore::spannerPlacehoderCandidate):
123         (WebCore::RenderMultiColumnFlowThread::processPossibleSpannerDescendant):
124
125 2016-10-26  Brian Burg  <bburg@apple.com>
126
127         Web Inspector: remove unused bool return value from FrontendChannel::sendMessageToFrontend
128         https://bugs.webkit.org/show_bug.cgi?id=164046
129
130         Reviewed by Joseph Pecoraro.
131
132         * inspector/InspectorClient.cpp:
133         (WebCore::InspectorClient::doDispatchMessageOnFrontendPage):
134         * inspector/InspectorClient.h:
135         * testing/Internals.cpp:
136         (WebCore::InspectorStubFrontend::sendMessageToFrontend):
137
138 2016-10-26  Chris Dumez  <cdumez@apple.com>
139
140         The URLSearchParams constructor should take a union in parameter
141         https://bugs.webkit.org/show_bug.cgi?id=163906
142
143         Reviewed by Darin Adler.
144
145         The URLSearchParams constructor should take a union in parameter:
146         - https://url.spec.whatwg.org/#urlsearchparams
147
148         No new tests, no web-exposed behavior change.
149
150         * html/URLSearchParams.h:
151         (WebCore::URLSearchParams::create):
152         * html/URLSearchParams.idl:
153
154 2016-10-26  Sam Weinig  <sam@webkit.org>
155
156         [WebIDL] Move more string conversions over to JSDOMConvert
157         https://bugs.webkit.org/show_bug.cgi?id=164021
158
159         Reviewed by Tim Horton.
160
161         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
162         (WebCore::JSCSSStyleDeclaration::putDelegate):
163         * bindings/js/JSDOMWindowCustom.cpp:
164         (WebCore::JSDOMWindow::open):
165         (WebCore::JSDOMWindow::showModalDialog):
166         (WebCore::handlePostMessage):
167         * bindings/js/JSHTMLCanvasElementCustom.cpp:
168         (WebCore::JSHTMLCanvasElement::toDataURL):
169         * bindings/js/JSHistoryCustom.cpp:
170         (WebCore::JSHistory::pushState):
171         (WebCore::JSHistory::replaceState):
172         Switch to convert functions.
173
174         * bindings/js/JSApplePaySessionCustom.cpp:
175         (WebCore::JSApplePaySession::completeShippingMethodSelection):
176         (WebCore::JSApplePaySession::completeShippingContactSelection):
177         * bindings/js/JSCryptoAlgorithmDictionary.cpp:
178         (WebCore::createAesKeyGenParams):
179         (WebCore::createRsaKeyGenParams):
180         * bindings/js/JSDocumentCustom.cpp:
181         (WebCore::JSDocument::getCSSCanvasContext):
182         * bindings/js/JSMockContentFilterSettingsCustom.cpp:
183         (WebCore::JSMockContentFilterSettings::setDecisionPoint):
184         (WebCore::toDecision):
185         * bindings/js/JSNodeFilterCustom.cpp:
186         (WebCore::JSNodeFilter::acceptNode):
187         * bindings/js/JSDOMBinding.cpp:
188         (WebCore::toSmallerInt):
189         (WebCore::toSmallerUInt):
190         (WebCore::toInt8EnforceRange):
191         (WebCore::toUInt8EnforceRange):
192         (WebCore::toInt8Clamp):
193         (WebCore::toUInt8Clamp):
194         (WebCore::toInt8):
195         (WebCore::toUInt8):
196         (WebCore::toInt16EnforceRange):
197         (WebCore::toUInt16EnforceRange):
198         (WebCore::toInt16Clamp):
199         (WebCore::toUInt16Clamp):
200         (WebCore::toInt16):
201         (WebCore::toUInt16):
202         Use updated IntegerConversionConfiguration naming.
203
204         (WebCore::valueToStringTreatingNullAsEmptyString): Deleted.
205         (WebCore::valueToStringWithUndefinedOrNullCheck): Deleted.
206         (WebCore::valueToUSVStringTreatingNullAsEmptyString): Deleted.
207         (WebCore::valueToUSVStringWithUndefinedOrNullCheck): Deleted.
208         * bindings/js/JSDOMBinding.h:
209         Remove unused functions.
210
211         * bindings/js/JSDOMConvert.h:
212         (WebCore::convert):
213         Add StringConversionConfiguration, to match IntegerConversionConfiguration which moved here,
214         and make them both enum classes. Remove SFINAE based overloading of convert<>, which is not
215         needed if we get rid of the default parameter, which we can, since the two parameter convert
216         routes to the right place.
217
218         (WebCore::Converter<IDLNullable<T>>::convert):
219         Add overloads converts that take a Integer/String configuration.
220
221         (WebCore::Converter<IDLByte>::convert):
222         (WebCore::Converter<IDLOctet>::convert):
223         (WebCore::Converter<IDLShort>::convert):
224         (WebCore::Converter<IDLUnsignedShort>::convert):
225         (WebCore::Converter<IDLLong>::convert):
226         (WebCore::Converter<IDLUnsignedLong>::convert):
227         (WebCore::Converter<IDLLongLong>::convert):
228         (WebCore::Converter<IDLUnsignedLongLong>::convert):
229         Use updated IntegerConversionConfiguration naming.
230
231         (WebCore::Converter<IDLDOMString>::convert):
232         (WebCore::Converter<IDLUSVString>::convert):
233         Add a configuration parameter, similar to the one used for integers
234         that changes the behavior of string conversions to return an empty
235         string for null.
236
237         * bindings/js/JSDOMIterator.h:
238         (WebCore::iteratorCreate):
239         (WebCore::IteratorTraits>::asJS):
240         (WebCore::appendForEachArguments):
241         Simplify a bit by extracting the SFINAE helpers into a EnableIfMap and EnableIfSet.
242
243         * bindings/scripts/CodeGeneratorJS.pm:
244         (GetIntegerConversionConfiguration):
245         (GetStringConversionConfiguration):
246         (JSValueToNativeIsHandledByDOMConvert):
247         (JSValueToNative):
248         Add support for converting more string types and passing the StringConversionConfiguration.
249
250 2016-10-26  Dan Bernstein  <mitz@apple.com>
251
252         When pasting web archive, width specifiers in srcset attribute change into density specifiers
253         https://bugs.webkit.org/show_bug.cgi?id=164027
254         <rdar://problem/28964948>
255
256         Reviewed by Tim Horton.
257
258         Updated editing/pasteboard/img-srcset-copy-paste-canonicalization.html.
259
260         * html/HTMLImageElement.cpp:
261         (WebCore::HTMLImageElement::completeURLsInAttributeValue): Use 'w' when writing out a width
262           specifier.
263
264 2016-10-26  Antoine Quint  <graouts@apple.com>
265
266         [Modern Media Controls] Media Controller: playback support
267         https://bugs.webkit.org/show_bug.cgi?id=163678
268         <rdar://problem/27989479>
269
270         Reviewed by Dean Jackson.
271
272         We introduce the PlaybackSupport class which brings support for playing and pausing
273         the media by clicking on the play/pause button in the media controls and correctly
274         reflecting the media's playback state as the media is played or paused via the media API.
275
276         * Modules/modern-media-controls/js-files:
277         * Modules/modern-media-controls/media/media-controller.js:
278         (MediaController):
279         * Modules/modern-media-controls/media/playback-support.js: Copied from Source/WebCore/Modules/modern-media-controls/media/media-controller.js.
280         (PlaybackSupport.prototype.get control):
281         (PlaybackSupport.prototype.get mediaEvents):
282         (PlaybackSupport.prototype.buttonWasClicked):
283         (PlaybackSupport.prototype.syncControl):
284         (PlaybackSupport):
285         * WebCore.xcodeproj/project.pbxproj:
286
287 2016-10-26  Chris Dumez  <cdumez@apple.com>
288
289         Regression(r203848): 百度糯米 app fails to load content due to a JavaScript error
290         https://bugs.webkit.org/show_bug.cgi?id=163967
291         <rdar://problem/28707838>
292
293         Reviewed by Ryosuke Niwa.
294
295         Add quirk for 百度糯米 app making the 2 last parameters to Event.prototype.initEvent()
296         optional.
297
298         No new tests, change only impacts this specific application.
299
300         * bindings/scripts/CodeGeneratorJS.pm:
301         (GeneratePropertiesHashTable):
302         * dom/Event.cpp:
303         (WebCore::Event::initEventForBindings):
304         * dom/Event.h:
305         * dom/Event.idl:
306         * platform/RuntimeApplicationChecks.h:
307         * platform/RuntimeApplicationChecks.mm:
308         (WebCore::IOSApplication::isBaiduNuomi):
309
310 2016-10-26  Chris Dumez  <cdumez@apple.com>
311
312         First parameter to TextTrack.addCue() / removeCue() should not be nullable
313         https://bugs.webkit.org/show_bug.cgi?id=164020
314
315         Reviewed by Eric Carlson.
316
317         First parameter to TextTrack.addCue() / removeCue() should not be nullable:
318         - https://html.spec.whatwg.org/#texttrack
319
320         Firefox and Chrome agree with the specification.
321
322         Test: media/track/texttrack-addCue-null.html
323
324         * html/track/InbandDataTextTrack.cpp:
325         (WebCore::InbandDataTextTrack::removeDataCue):
326         (WebCore::InbandDataTextTrack::removeCue):
327         * html/track/InbandDataTextTrack.h:
328         * html/track/InbandGenericTextTrack.cpp:
329         (WebCore::InbandGenericTextTrack::addGenericCue):
330         (WebCore::InbandGenericTextTrack::removeGenericCue):
331         (WebCore::InbandGenericTextTrack::removeCue):
332         * html/track/InbandGenericTextTrack.h:
333         * html/track/TextTrack.cpp:
334         (WebCore::TextTrack::addCue):
335         (WebCore::TextTrack::removeCue):
336         * html/track/TextTrack.h:
337         * html/track/TextTrack.idl:
338
339 2016-10-26  Antoine Quint  <graouts@apple.com>
340
341         [Modern Media Controls] Media Controller: elapsed and remaining time support
342         https://bugs.webkit.org/show_bug.cgi?id=163679
343         <rdar://problem/28851675>
344
345         Reviewed by Dean Jackson.
346
347         We introduce the ElapsedTimeSupport and RemainingTimeSupport classes which bring
348         support for displaying the elapsed and remaining time in the time control.
349
350         Tests: media/modern-media-controls/elapsed-time-support/elapsed-time-support.html
351                media/modern-media-controls/remaining-time-support/remaining-time-support.html
352
353         * Modules/modern-media-controls/js-files:
354         * Modules/modern-media-controls/media/elapsed-time-support.js: Added.
355         (ElapsedTimeSupport.prototype.get control):
356         (ElapsedTimeSupport.prototype.get mediaEvents):
357         (ElapsedTimeSupport.prototype.syncControl):
358         (ElapsedTimeSupport):
359         * Modules/modern-media-controls/media/media-controller.js:
360         (MediaController):
361         * Modules/modern-media-controls/media/remaining-time-support.js: Added.
362         (RemainingTimeSupport.prototype.get control):
363         (RemainingTimeSupport.prototype.get mediaEvents):
364         (RemainingTimeSupport.prototype.syncControl):
365         (RemainingTimeSupport):
366         * WebCore.xcodeproj/project.pbxproj:
367
368 2016-10-26  Dave Hyatt  <hyatt@apple.com>
369
370         [CSS Parser] Unify CSSCustomPropertyValue and CSSCustomPropertyDeclaration
371         https://bugs.webkit.org/show_bug.cgi?id=164019
372
373         Reviewed by Zalan Bujtas.
374
375         * CMakeLists.txt:
376         * WebCore.xcodeproj/project.pbxproj:
377         * css/CSSCustomPropertyDeclaration.cpp: Removed.
378         * css/CSSCustomPropertyDeclaration.h: Removed.
379         Get rid of CSSCustomPropertyDeclaration.
380
381         * css/CSSCustomPropertyValue.h:
382         Add new constructors to handle the new variable data format (either a CSSValueId or a
383         CSSVariableData object that holds parser tokens).
384
385         * css/CSSValue.cpp:
386         (WebCore::CSSValue::cssText):
387         (WebCore::CSSValue::destroy):
388         * css/CSSValue.h:
389         (WebCore::CSSValue::isCustomPropertyDeclaration): Deleted.
390         Get rid of CSSCustomPropertyDeclaration cases.
391
392         * css/CSSVariableData.h:
393         Switch to CSSCustomPropertyValue.
394
395         * css/StyleResolver.cpp:
396         (WebCore::StyleResolver::applyProperty):
397         We've renamed the old parser variable data to deprecatedValue to make it clear it's going
398         to be removed eventually.
399
400         * css/parser/CSSParserImpl.cpp:
401         (WebCore::filterProperties):
402         (WebCore::CSSParserImpl::consumeVariableValue):
403         * css/parser/CSSVariableParser.cpp:
404         (WebCore::CSSVariableParser::parseDeclarationValue):
405         * css/parser/CSSVariableParser.h:
406         Switch to CSSCustomPropertyValue.
407
408 2016-10-26  Youenn Fablet  <youenn@apple.com>
409
410         Enable SDPProcessor for Mac bots
411         https://bugs.webkit.org/show_bug.cgi?id=163940
412
413         Reviewed by Eric Carlson.
414
415         Covered by activated tests.
416
417         Activating processing of SDPProcessor scripts for Mac bots.
418         Moving platform/mediastream/openwebrtc/SDPProcessorScriptResource.cpp to platform/mediastream/SDPProcessorScriptResource.cpp.
419         This file is not tied to openwebrtc and allows retrieving the SDPProcessor script resource file content.
420
421         * DerivedSources.make:
422         * PlatformGTK.cmake:
423         * WebCore.xcodeproj/project.pbxproj:
424         * platform/mediastream/SDPProcessorScriptResource.cpp:
425         (WebCore::SDPProcessorScriptResource::scriptString):
426         * platform/mediastream/openwebrtc/SDPProcessorScriptResource.cpp: Removed.
427
428 2016-10-26  Dave Hyatt  <hyatt@apple.com>
429
430         [CSS Parser] Get functional pseudos parsing
431         https://bugs.webkit.org/show_bug.cgi?id=164018
432
433         Reviewed by Zalan Bujtas.
434
435         * css/parser/CSSParserValues.cpp:
436         (WebCore::CSSParserSelector::parsePseudoClassSelectorFromStringView):
437         Remove the ( check so that we can parse strings that end in (.
438
439         * css/parser/CSSSelectorParser.cpp:
440         (WebCore::CSSSelectorParser::consumePseudo):
441         Put in a hack that adds a ( to the end of the string so that it will be found in the map.
442
443 2016-10-26  Zan Dobersek  <zdobersek@igalia.com>
444
445         Unreviewed. Fixing compiler warnings in PlaybackPipeline
446         that are popping up in GTK+ builds.
447
448         * platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
449         (WebCore::PlaybackPipeline::addSourceBuffer):
450         (WebCore::PlaybackPipeline::attachTrack):
451
452 2016-10-26  Youenn Fablet  <youennf@gmail.com>
453
454         IceCandidate does not need to be refcounted
455         https://bugs.webkit.org/show_bug.cgi?id=163944
456
457         Reviewed by Eric Carlson.
458
459         No change of behavior.
460
461         Simplifying IceCandidate class into a simple structure, no longer refcounted.
462         Updated call sites accordingly.
463         Updated SDP parsing of candidates to return a Variant instead of having both a return and an out parameter.
464
465         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
466         (WebCore::MediaEndpointPeerConnection::addIceCandidateTask):
467         (WebCore::MediaEndpointPeerConnection::gotIceCandidate):
468         * Modules/mediastream/MediaEndpointPeerConnection.h:
469         * Modules/mediastream/SDPProcessor.cpp:
470         (WebCore::createCandidateObject):
471         (WebCore::createCandidate):
472         (WebCore::iceCandidateFromJSON):
473         (WebCore::configurationToJSON):
474         (WebCore::SDPProcessor::parseCandidateLine):
475         * Modules/mediastream/SDPProcessor.h:
476         (WebCore::SDPProcessor::ParsingResult::parsingStatus):
477         (WebCore::SDPProcessor::ParsingResult::candidate):
478         * platform/mediastream/IceCandidate.h:
479         * platform/mediastream/MediaEndpoint.cpp:
480         * platform/mediastream/MediaEndpoint.h:
481         * platform/mediastream/PeerMediaDescription.h:
482         (WebCore::PeerMediaDescription::iceCandidates):
483         (WebCore::PeerMediaDescription::addIceCandidate):
484         (WebCore::PeerMediaDescription::clone):
485         * platform/mediastream/openwebrtc/MediaEndpointOwr.cpp:
486         (WebCore::MediaEndpointOwr::updateSendConfiguration):
487         (WebCore::MediaEndpointOwr::addRemoteCandidate):
488         (WebCore::MediaEndpointOwr::dispatchNewIceCandidate):
489         (WebCore::MediaEndpointOwr::internalAddRemoteCandidate):
490         * platform/mediastream/openwebrtc/MediaEndpointOwr.h:
491         * platform/mock/MockMediaEndpoint.cpp:
492         (WebCore::MockMediaEndpoint::addRemoteCandidate):
493         (WebCore::MockMediaEndpoint::dispatchFakeIceCandidates):
494         * platform/mock/MockMediaEndpoint.h:
495
496 2016-10-26  Andreas Kling  <akling@apple.com>
497
498         Fix mach port leak in ResourceUsageThread.
499         <https://webkit.org/b/164012>
500
501         Reviewed by Antti Koivisto.
502
503         The threads returned by task_threads() need to be deallocated.
504
505         * page/cocoa/ResourceUsageThreadCocoa.mm:
506         (WebCore::cpuUsage):
507
508 2016-10-26  Nael Ouedraogo  <nael.ouedraogo@crf.canon.fr>
509
510         WebRTC: The RTCTrackEventInit dictionary needs required members
511         https://bugs.webkit.org/show_bug.cgi?id=158536
512
513         Reviewed by Chris Dumez.
514
515         Update RTCTrackEvent IDL as per specification.
516
517         No additional test required, rebase existing tests.
518
519         * Modules/mediastream/RTCTrackEvent.idl:
520
521 2016-10-26  Enrique Ocaña González  <eocanha@igalia.com>
522
523         [GStreamer][GTK+][MSE] Unreviewed debug build fix.
524
525         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
526         (WebCore::AppendPipeline::resetPipeline):
527         * platform/graphics/gstreamer/mse/AppendPipeline.h:
528
529 2016-10-26  Enrique Ocaña González  <eocanha@igalia.com>
530
531         [cmake][GStreamer][MSE][EME] Build MSE and EME code after refactoring
532         https://bugs.webkit.org/show_bug.cgi?id=162928
533
534         Reviewed by Xabier Rodriguez-Calvar.
535
536         Consolidate all the source file tree changes after refactoring.
537
538         This patch is co-authored with Philippe Normand <philn@igalia.com> (EME support).
539
540         * platform/GStreamer.cmake:
541
542 2016-10-26  Enrique Ocaña González  <eocanha@igalia.com>
543
544         [MSE][GStreamer] Enable QUOTA_EXCEEDED_ERR support for GStreamer
545         https://bugs.webkit.org/show_bug.cgi?id=162922
546
547         Reviewed by Xabier Rodriguez-Calvar.
548
549         QUOTA_EXCEEDED_ERR should be reported by SourceBuffer when appropriate, at least on the
550         GStreamer implementation.
551
552         * Modules/mediasource/SourceBuffer.cpp:
553         (WebCore::SourceBuffer::appendBufferInternal):
554
555 2016-10-26  Enrique Ocaña González  <eocanha@igalia.com>
556
557         [MSE] Expose additional MediaSource methods to MediaSourcePrivate
558         https://bugs.webkit.org/show_bug.cgi?id=162920
559
560         Reviewed by Xabier Rodriguez-Calvar.
561
562         The GStreamer MSE platform implementation needs to report duration changes and trigger
563         monitorSourceBuffers() calls.
564
565         * Modules/mediasource/MediaSource.cpp:
566         (WebCore::MediaSource::durationChanged):
567         * Modules/mediasource/MediaSource.h:
568         * platform/graphics/MediaSourcePrivateClient.h:
569
570 2016-10-26  Enrique Ocaña González  <eocanha@igalia.com>
571
572         [GStreamer][EME] ClearKey decryption support
573         https://bugs.webkit.org/show_bug.cgi?id=162918
574
575         Reviewed by Xabier Rodriguez-Calvar.
576
577         This patch is authored by Philippe Normand <philn@igalia.com>.
578
579         * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp: Added.
580         (webkit_media_clear_key_decrypt_class_init):
581         (webkit_media_clear_key_decrypt_init):
582         (webKitMediaClearKeyDecryptorFinalize):
583         (webKitMediaClearKeyDecryptorRequestDecryptionKey):
584         (webKitMediaClearKeyDecryptorHandleKeyResponse):
585         (webKitMediaClearKeyDecryptorSetupCipher):
586         (webKitMediaClearKeyDecryptorDecrypt):
587         (webKitMediaClearKeyDecryptorReleaseCipher):
588         * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.h: Added.
589
590 2016-10-26  Enrique Ocaña González  <eocanha@igalia.com>
591
592         [GStreamer][EME] Base class for decryption support
593         https://bugs.webkit.org/show_bug.cgi?id=162915
594
595         Reviewed by Xabier Rodriguez-Calvar.
596
597         Add common encryption base class.
598
599         This patch is authored by Philippe Normand <philn@igalia.com>.
600
601         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp: Added.
602         (webkit_media_common_encryption_decrypt_class_init):
603         (webkit_media_common_encryption_decrypt_init):
604         (webKitMediaCommonEncryptionDecryptorFinalize):
605         (webkitMediaCommonEncryptionDecryptTransformCaps):
606         (webkitMediaCommonEncryptionDecryptTransformInPlace):
607         (webkitMediaCommonEncryptionDecryptSinkEventHandler):
608         (webKitMediaCommonEncryptionDecryptorChangeState):
609         (webKitMediaCommonEncryptionDecryptDefaultSetupCipher):
610         (webKitMediaCommonEncryptionDecryptDefaultReleaseCipher):
611         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.h: Added.
612
613 2016-10-26  Enrique Ocaña González  <eocanha@igalia.com>
614
615         [GStreamer][EME] Utility function to create decryptor
616         https://bugs.webkit.org/show_bug.cgi?id=162914
617
618         Reviewed by Xabier Rodriguez-Calvar.
619
620         Add a utility function to find a suitable GStreamer decryptor element.
621
622         This patch is authored by Philippe Normand <philn@igalia.com>.
623
624         * platform/graphics/gstreamer/GStreamerUtilities.cpp:
625         (WebCore::createGstDecryptor):
626         (WebCore::gstRegistryHasElementForMediaType): Deleted.
627         * platform/graphics/gstreamer/GStreamerUtilities.h:
628
629 2016-10-26  Enrique Ocaña González  <eocanha@igalia.com>
630
631         [GStreamer][MSE][EME] Remove MSE code from regular player and add EME support
632         https://bugs.webkit.org/show_bug.cgi?id=162911
633
634         Now that the MSE responsibility has been refactored to the dedicated
635         MediaPlayerPrivateGStreamerMSE subclass, the regular player no longer needs the MSE code,
636         just to expose some more methods to the subclass. Float timestamps have been migrated to
637         double. Also, small changes to accomodate the EME support are needed.
638
639         This patch is co-authored with Philippe Normand <philn@igalia.com> (EME support) and
640         Žan Doberšek <zandobersek@gmail.com> (double timestamps).
641
642         Reviewed by Xabier Rodriguez-Calvar.
643
644         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
645         (WebCore::busMessageCallback):
646         (WebCore::MediaPlayerPrivateGStreamer::registerMediaEngine):
647         (WebCore::initializeGStreamerAndRegisterWebKitElements):
648         (WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer):
649         (WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer):
650         (WebCore::MediaPlayerPrivateGStreamer::load):
651         (WebCore::MediaPlayerPrivateGStreamer::playbackPosition):
652         (WebCore::MediaPlayerPrivateGStreamer::durationMediaTime):
653         (WebCore::MediaPlayerPrivateGStreamer::currentMediaTime):
654         (WebCore::MediaPlayerPrivateGStreamer::seek):
655         (WebCore::MediaPlayerPrivateGStreamer::doSeek):
656         (WebCore::MediaPlayerPrivateGStreamer::paused):
657         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideo):
658         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfAudio):
659         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfText):
660         (WebCore::MediaPlayerPrivateGStreamer::buffered):
661         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
662         (WebCore::MediaPlayerPrivateGStreamer::processMpegTsSection):
663         (WebCore::MediaPlayerPrivateGStreamer::fillTimerFired):
664         (WebCore::MediaPlayerPrivateGStreamer::maxTimeSeekable):
665         (WebCore::MediaPlayerPrivateGStreamer::maxTimeLoaded):
666         (WebCore::MediaPlayerPrivateGStreamer::didLoadingProgress):
667         (WebCore::MediaPlayerPrivateGStreamer::sourceChanged):
668         (WebCore::MediaPlayerPrivateGStreamer::didEnd):
669         (WebCore::MediaPlayerPrivateGStreamer::durationChanged):
670         (WebCore::MediaPlayerPrivateGStreamer::supportsType):
671         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
672         (WebCore::MediaPlayerPrivateGStreamer::handleSyncMessage):
673         (WebCore::MediaPlayerPrivateGStreamer::setAudioStreamProperties): Deleted.
674         (WebCore::MediaPlayerPrivateGStreamer::commitLoad): Deleted.
675         (WebCore::MediaPlayerPrivateGStreamer::pause): Deleted.
676         (WebCore::MediaPlayerPrivateGStreamer::videoChangedCallback): Deleted.
677         (WebCore::MediaPlayerPrivateGStreamer::videoSinkCapsChangedCallback): Deleted.
678         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideoCaps): Deleted.
679         (WebCore::MediaPlayerPrivateGStreamer::setRate): Deleted.
680         (WebCore::MediaPlayerPrivateGStreamer::processTableOfContentsEntry): Deleted.
681         (WebCore::MediaPlayerPrivateGStreamer::totalBytes): Deleted.
682         (WebCore::MediaPlayerPrivateGStreamer::loadNextLocation): Deleted.
683         (WebCore::MediaPlayerPrivateGStreamer::loadStateChanged): Deleted.
684         (WebCore::MediaPlayerPrivateGStreamer::timeChanged): Deleted.
685         (WebCore::mimeTypeSet): Deleted.
686         (WebCore::MediaPlayerPrivateGStreamer::createAudioSink): Deleted.
687         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
688         (WebCore::MediaPlayerPrivateGStreamer::configurePlaySink):
689         (WebCore::MediaPlayerPrivateGStreamer::isMediaSource):
690         (WebCore::MediaPlayerPrivateGStreamer::createWeakPtr): Deleted.
691
692 2016-10-26  Enrique Ocaña González  <eocanha@igalia.com>
693
694         [GStreamer][EME] Add EME support to base private player
695         https://bugs.webkit.org/show_bug.cgi?id=162908
696
697         Reviewed by Xabier Rodriguez-Calvar.
698
699         Add encryption key management support.
700
701         This patch is authored by Philippe Normand <philn@igalia.com>.
702
703         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
704         (WebCore::registerWebKitGStreamerElements):
705         (WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage):
706         (WebCore::MediaPlayerPrivateGStreamerBase::needKey):
707         (WebCore::MediaPlayerPrivateGStreamerBase::setCDMSession):
708         (WebCore::MediaPlayerPrivateGStreamerBase::keyAdded):
709         (WebCore::MediaPlayerPrivateGStreamerBase::createSession):
710         (WebCore::MediaPlayerPrivateGStreamerBase::dispatchDecryptionKey):
711         (WebCore::MediaPlayerPrivateGStreamerBase::supportsKeySystem):
712         (WebCore::MediaPlayerPrivateGStreamerBase::extendedSupportsType):
713         (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase): Deleted.
714         (WebCore::MediaPlayerPrivateGStreamerBase::setPipeline): Deleted.
715         (WebCore::MediaPlayerPrivateGStreamerBase::setStreamVolumeElement): Deleted.
716         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
717         (WebCore::MediaPlayerPrivateGStreamerBase::pipeline):
718
719 2016-10-26  Enrique Ocaña González  <eocanha@igalia.com>
720
721         [GStreamer][MSE] WebKitMediaSourceGStreamer refactoring
722         https://bugs.webkit.org/show_bug.cgi?id=162902
723
724         Reviewed by Xabier Rodriguez-Calvar.
725
726         Move WebKitMediaSourceGStreamer to the mse directory, split public and private header
727         sections, manage stream data throttling and seek synchronization, audio/video/text stream
728         counting, improve GStreamer duration query, stream initialization, remove
729         MediaSourceClientGStreamer logic (factored out to its own class in another patch) and
730         interaction with MediaPlayerPrivateGStreamerMSE, PlaybackPipeline and
731         SourceBufferPrivateGStreamer.
732
733         * platform/graphics/gstreamer/WebKitMediaSourceGStreamer.cpp: Removed.
734         * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp: Added.
735         (disabledAppsrcNeedData):
736         (disabledAppsrcEnoughData):
737         (disabledAppsrcSeekData):
738         (enabledAppsrcEnoughData):
739         (enabledAppsrcSeekData):
740         (getStreamByAppsrc):
741         (webkit_media_src_init):
742         (webKitMediaSrcFinalize):
743         (webKitMediaSrcSetProperty):
744         (webKitMediaSrcGetProperty):
745         (webKitMediaSrcDoAsyncStart):
746         (webKitMediaSrcDoAsyncDone):
747         (webKitMediaSrcChangeState):
748         (webKitMediaSrcGetSize):
749         (webKitMediaSrcQueryWithParent):
750         (webKitMediaSrcUpdatePresentationSize):
751         (webKitMediaSrcLinkStreamToSrcPad):
752         (webKitMediaSrcLinkParser):
753         (webKitMediaSrcFreeStream):
754         (webKitMediaSrcCheckAllTracksConfigured):
755         (webKitMediaSrcUriGetType):
756         (webKitMediaSrcGetProtocols):
757         (webKitMediaSrcGetUri):
758         (webKitMediaSrcSetUri):
759         (webKitMediaSrcUriHandlerInit):
760         (seekNeedsDataMainThread):
761         (notifyReadyForMoreSamplesMainThread):
762         (applicationMessageCallback):
763         (webKitMediaSrcSetMediaPlayerPrivate):
764         (webKitMediaSrcSetReadyForSamples):
765         (webKitMediaSrcPrepareSeek):
766         (WTF::adoptGRef):
767         (WTF::refGPtr<WebKitMediaSrc>):
768         (WTF::derefGPtr<WebKitMediaSrc>):
769         * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.h: Renamed from Source/WebCore/platform/graphics/gstreamer/WebKitMediaSourceGStreamer.h.
770         * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamerPrivate.h: Added.
771
772 2016-10-26  Enrique Ocaña González  <eocanha@igalia.com>
773
774         [GStreamer][MSE] Playback pipeline
775         https://bugs.webkit.org/show_bug.cgi?id=162901
776
777         Reviewed by Xabier Rodriguez-Calvar.
778
779         Encapsulate the responsibility to interact with the GStreamer playback pipeline and the
780         different streams managed by the WebKitMediaSrc element into a new PlaybackPipeline class.
781
782         * platform/graphics/gstreamer/mse/PlaybackPipeline.cpp: Added.
783         (getStreamByTrackId):
784         (getStreamBySourceBufferPrivate):
785         (pushSample):
786         (WebCore::PlaybackPipeline::create):
787         (WebCore::PlaybackPipeline::PlaybackPipeline):
788         (WebCore::PlaybackPipeline::~PlaybackPipeline):
789         (WebCore::PlaybackPipeline::setWebKitMediaSrc):
790         (WebCore::PlaybackPipeline::webKitMediaSrc):
791         (WebCore::PlaybackPipeline::addSourceBuffer):
792         (WebCore::PlaybackPipeline::removeSourceBuffer):
793         (WebCore::PlaybackPipeline::attachTrack):
794         (WebCore::PlaybackPipeline::reattachTrack):
795         (WebCore::PlaybackPipeline::notifyDurationChanged):
796         (WebCore::PlaybackPipeline::markEndOfStream):
797         (WebCore::PlaybackPipeline::flushAndEnqueueNonDisplayingSamples):
798         (WebCore::PlaybackPipeline::enqueueSample):
799         (WebCore::PlaybackPipeline::pipeline):
800         * platform/graphics/gstreamer/mse/PlaybackPipeline.h: Added.
801
802 2016-10-26  Enrique Ocaña González  <eocanha@igalia.com>
803
804         [GStreamer][MSE][EME] MSE specialization of Media Player Private for GStreamer
805         https://bugs.webkit.org/show_bug.cgi?id=162900
806
807         Reviewed by Xabier Rodriguez-Calvar.
808
809         Refactor MSE-specific logic to its own GStreamer player. This new MSE player coordinates
810         data appending, media playback and interaction with MediaSource by delegating to
811         AppendPipeline (one instance per SourceBuffer), PlaybackPipeline and
812         MediaSourceClientGStreamerMSE/MediaSourcePrivateClient respectively.
813
814         This patch is co-authored with Philippe Normand <philn@igalia.com> (EME support).
815
816         * platform/graphics/MediaPlayer.cpp:
817         (WebCore::buildMediaEnginesVector):
818         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp: Added.
819         (dumpReadyState):
820         (WebCore::MediaPlayerPrivateGStreamerMSE::registerMediaEngine):
821         (WebCore::initializeGStreamerAndRegisterWebKitMSEElement):
822         (WebCore::MediaPlayerPrivateGStreamerMSE::isAvailable):
823         (WebCore::MediaPlayerPrivateGStreamerMSE::MediaPlayerPrivateGStreamerMSE):
824         (WebCore::MediaPlayerPrivateGStreamerMSE::~MediaPlayerPrivateGStreamerMSE):
825         (WebCore::MediaPlayerPrivateGStreamerMSE::load):
826         (WebCore::MediaPlayerPrivateGStreamerMSE::pause):
827         (WebCore::MediaPlayerPrivateGStreamerMSE::durationMediaTime):
828         (WebCore::MediaPlayerPrivateGStreamerMSE::seek):
829         (WebCore::MediaPlayerPrivateGStreamerMSE::configurePlaySink):
830         (WebCore::MediaPlayerPrivateGStreamerMSE::changePipelineState):
831         (WebCore::MediaPlayerPrivateGStreamerMSE::notifySeekNeedsDataForTime):
832         (WebCore::MediaPlayerPrivateGStreamerMSE::doSeek):
833         (WebCore::MediaPlayerPrivateGStreamerMSE::maybeFinishSeek):
834         (WebCore::MediaPlayerPrivateGStreamerMSE::updatePlaybackRate):
835         (WebCore::MediaPlayerPrivateGStreamerMSE::seeking):
836         (WebCore::MediaPlayerPrivateGStreamerMSE::setReadyState):
837         (WebCore::MediaPlayerPrivateGStreamerMSE::waitForSeekCompleted):
838         (WebCore::MediaPlayerPrivateGStreamerMSE::seekCompleted):
839         (WebCore::MediaPlayerPrivateGStreamerMSE::setRate):
840         (WebCore::MediaPlayerPrivateGStreamerMSE::buffered):
841         (WebCore::MediaPlayerPrivateGStreamerMSE::sourceChanged):
842         (WebCore::MediaPlayerPrivateGStreamerMSE::updateStates):
843         (WebCore::MediaPlayerPrivateGStreamerMSE::asyncStateChangeDone):
844         (WebCore::MediaPlayerPrivateGStreamerMSE::isTimeBuffered):
845         (WebCore::MediaPlayerPrivateGStreamerMSE::setMediaSourceClient):
846         (WebCore::MediaPlayerPrivateGStreamerMSE::mediaSourceClient):
847         (WebCore::MediaPlayerPrivateGStreamerMSE::durationChanged):
848         (WebCore::mimeTypeCache):
849         (WebCore::MediaPlayerPrivateGStreamerMSE::getSupportedTypes):
850         (WebCore::MediaPlayerPrivateGStreamerMSE::trackDetected):
851         (WebCore::MediaPlayerPrivateGStreamerMSE::supportsType):
852         (WebCore::MediaPlayerPrivateGStreamerMSE::dispatchDecryptionKey):
853         (WebCore::MediaPlayerPrivateGStreamerMSE::markEndOfStream):
854         (WebCore::MediaPlayerPrivateGStreamerMSE::currentMediaTime):
855         (WebCore::MediaPlayerPrivateGStreamerMSE::maxTimeSeekable):
856         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h: Added.
857         (WebCore::MediaPlayerPrivateGStreamerMSE::mediaSourcePrivateClient):
858
859 2016-10-26  Enrique Ocaña González  <eocanha@igalia.com>
860
861         [GStreamer][MSE] MediaSourceGStreamer refactoring
862         https://bugs.webkit.org/show_bug.cgi?id=162899
863
864         Reviewed by Žan Doberšek.
865
866         Move MediaSourceGStreamer to the mse directory, manage SourceBufferPrivates and delegate WebKitMediaSrc operations to the MSE private player.
867
868         * platform/graphics/gstreamer/mse/MediaSourceGStreamer.cpp: Renamed from Source/WebCore/platform/graphics/gstreamer/MediaSourceGStreamer.cpp.
869         (WebCore::MediaSourceGStreamer::open):
870         (WebCore::MediaSourceGStreamer::MediaSourceGStreamer):
871         (WebCore::MediaSourceGStreamer::~MediaSourceGStreamer):
872         (WebCore::MediaSourceGStreamer::addSourceBuffer):
873         (WebCore::MediaSourceGStreamer::removeSourceBuffer):
874         (WebCore::MediaSourceGStreamer::durationChanged):
875         (WebCore::MediaSourceGStreamer::markEndOfStream):
876         (WebCore::MediaSourceGStreamer::unmarkEndOfStream):
877         (WebCore::MediaSourceGStreamer::readyState):
878         (WebCore::MediaSourceGStreamer::setReadyState):
879         (WebCore::MediaSourceGStreamer::waitForSeekCompleted):
880         (WebCore::MediaSourceGStreamer::seekCompleted):
881         (WebCore::MediaSourceGStreamer::sourceBufferPrivateDidChangeActiveState):
882         (WebCore::MediaSourceGStreamer::buffered):
883         * platform/graphics/gstreamer/mse/MediaSourceGStreamer.h: Renamed from Source/WebCore/platform/graphics/gstreamer/MediaSourceGStreamer.h.
884
885 2016-10-26  Enrique Ocaña González  <eocanha@igalia.com>
886
887         [GStreamer][MSE] SourceBufferPrivateGStreamer refactoring
888         https://bugs.webkit.org/show_bug.cgi?id=162898
889
890         Reviewed by Xabier Rodriguez-Calvar.
891
892         Moved SourceBufferPrivateGStreamer to an mse directory and added unimplemented features (abort, enqueueing and sample flow control).
893
894         * platform/graphics/gstreamer/SourceBufferPrivateGStreamer.cpp: Removed.
895         * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp: Added.
896         (WebCore::SourceBufferPrivateGStreamer::create):
897         (WebCore::SourceBufferPrivateGStreamer::SourceBufferPrivateGStreamer):
898         (WebCore::SourceBufferPrivateGStreamer::~SourceBufferPrivateGStreamer):
899         (WebCore::SourceBufferPrivateGStreamer::setClient):
900         (WebCore::SourceBufferPrivateGStreamer::append):
901         (WebCore::SourceBufferPrivateGStreamer::abort):
902         (WebCore::SourceBufferPrivateGStreamer::resetParserState):
903         (WebCore::SourceBufferPrivateGStreamer::removedFromMediaSource):
904         (WebCore::SourceBufferPrivateGStreamer::readyState):
905         (WebCore::SourceBufferPrivateGStreamer::setReadyState):
906         (WebCore::SourceBufferPrivateGStreamer::flushAndEnqueueNonDisplayingSamples):
907         (WebCore::SourceBufferPrivateGStreamer::enqueueSample):
908         (WebCore::SourceBufferPrivateGStreamer::isReadyForMoreSamples):
909         (WebCore::SourceBufferPrivateGStreamer::setReadyForMoreSamples):
910         (WebCore::SourceBufferPrivateGStreamer::notifyReadyForMoreSamples):
911         (WebCore::SourceBufferPrivateGStreamer::setActive):
912         (WebCore::SourceBufferPrivateGStreamer::stopAskingForMoreSamples):
913         (WebCore::SourceBufferPrivateGStreamer::notifyClientWhenReadyForMoreSamples):
914         (WebCore::SourceBufferPrivateGStreamer::didReceiveInitializationSegment):
915         (WebCore::SourceBufferPrivateGStreamer::didReceiveSample):
916         (WebCore::SourceBufferPrivateGStreamer::didReceiveAllPendingSamples):
917         * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h: Renamed from Source/WebCore/platform/graphics/gstreamer/SourceBufferPrivateGStreamer.h.
918
919 2016-10-26  Enrique Ocaña González  <eocanha@igalia.com>
920
921         [GStreamer][MSE] MediaSourceClientGStreamerMSE
922         https://bugs.webkit.org/show_bug.cgi?id=162896
923
924         Reviewed by Xabier Rodriguez-Calvar.
925
926         This class encapsulates the MediaSource interaction responsibility for the
927         GStreamer platform.
928
929         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp: Added.
930         (WebCore::MediaSourceClientGStreamerMSE::create):
931         (WebCore::MediaSourceClientGStreamerMSE::MediaSourceClientGStreamerMSE):
932         (WebCore::MediaSourceClientGStreamerMSE::~MediaSourceClientGStreamerMSE):
933         (WebCore::MediaSourceClientGStreamerMSE::addSourceBuffer):
934         (WebCore::MediaSourceClientGStreamerMSE::duration):
935         (WebCore::MediaSourceClientGStreamerMSE::durationChanged):
936         (WebCore::MediaSourceClientGStreamerMSE::abort):
937         (WebCore::MediaSourceClientGStreamerMSE::append):
938         (WebCore::MediaSourceClientGStreamerMSE::markEndOfStream):
939         (WebCore::MediaSourceClientGStreamerMSE::removedFromMediaSource):
940         (WebCore::MediaSourceClientGStreamerMSE::flushAndEnqueueNonDisplayingSamples):
941         (WebCore::MediaSourceClientGStreamerMSE::enqueueSample):
942         (WebCore::MediaSourceClientGStreamerMSE::webKitMediaSrc):
943         (WebCore::MediaSourceClientGStreamerMSE::clearPlayerPrivate):
944         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h: Added.
945
946 2016-10-26  Enrique Ocaña González  <eocanha@igalia.com>
947
948         [GStreamer] GStreamer Media Sample
949         https://bugs.webkit.org/show_bug.cgi?id=162894
950
951         Reviewed by Xabier Rodriguez-Calvar.
952
953         Implement the MediaSample interface for the GStreamer platform.
954
955         * platform/graphics/gstreamer/mse/GStreamerMediaSample.cpp: Added.
956         (WebCore::GStreamerMediaSample::GStreamerMediaSample):
957         (WebCore::GStreamerMediaSample::create):
958         (WebCore::GStreamerMediaSample::createFakeSample):
959         (WebCore::GStreamerMediaSample::applyPtsOffset):
960         (WebCore::GStreamerMediaSample::offsetTimestampsBy):
961         (WebCore::GStreamerMediaSample::~GStreamerMediaSample):
962         * platform/graphics/gstreamer/mse/GStreamerMediaSample.h: Added.
963         (WebCore::GStreamerMediaSample::presentationTime):
964         (WebCore::GStreamerMediaSample::decodeTime):
965         (WebCore::GStreamerMediaSample::duration):
966         (WebCore::GStreamerMediaSample::trackID):
967         (WebCore::GStreamerMediaSample::setTrackID):
968         (WebCore::GStreamerMediaSample::sizeInBytes):
969         (WebCore::GStreamerMediaSample::sample):
970         (WebCore::GStreamerMediaSample::presentationSize):
971         (WebCore::GStreamerMediaSample::setTimestamps):
972         (WebCore::GStreamerMediaSample::isDivisable):
973         (WebCore::GStreamerMediaSample::divide):
974         (WebCore::GStreamerMediaSample::flags):
975         (WebCore::GStreamerMediaSample::platformSample):
976         (WebCore::GStreamerMediaSample::dump):
977
978 2016-10-26  Enrique Ocaña González  <eocanha@igalia.com>
979
980         [GStreamer] GStreamer Media Description
981         https://bugs.webkit.org/show_bug.cgi?id=162893
982
983         Reviewed by Xabier Rodriguez-Calvar.
984
985         Implement the MediaDescription interface for the GStreamer platform.
986
987         * platform/graphics/gstreamer/mse/GStreamerMediaDescription.cpp: Added.
988         (WebCore::GStreamerMediaDescription::codec):
989         (WebCore::GStreamerMediaDescription::isVideo):
990         (WebCore::GStreamerMediaDescription::isAudio):
991         (WebCore::GStreamerMediaDescription::isText):
992         * platform/graphics/gstreamer/mse/GStreamerMediaDescription.h: Added.
993         (WebCore::GStreamerMediaDescription::create):
994         (WebCore::GStreamerMediaDescription::~GStreamerMediaDescription):
995         (WebCore::GStreamerMediaDescription::GStreamerMediaDescription):
996
997 2016-10-26  Enrique Ocaña González  <eocanha@igalia.com>
998
999         [GStreamer][MSE][EME] Append Pipeline
1000         https://bugs.webkit.org/show_bug.cgi?id=162874
1001
1002         Reviewed by Žan Doberšek.
1003
1004         This patch is co-authored with Xabier Rodriguez-Calvar <calvaris@igalia.com> (data starve
1005         and last sample detection, debug features) and Philippe Normand <philn@igalia.com> (EME
1006         support).
1007
1008         * platform/graphics/gstreamer/mse/AppendPipeline.cpp: Added.
1009         (WebCore::dumpAppendState):
1010         (WebCore::appendPipelineElementMessageCallback):
1011         (WebCore::appendPipelineApplicationMessageCallback):
1012         (WebCore::AppendPipeline::AppendPipeline):
1013         (WebCore::AppendPipeline::~AppendPipeline):
1014         (WebCore::AppendPipeline::clearPlayerPrivate):
1015         (WebCore::AppendPipeline::handleElementMessage):
1016         (WebCore::AppendPipeline::handleApplicationMessage):
1017         (WebCore::AppendPipeline::handleAppsrcNeedDataReceived):
1018         (WebCore::AppendPipeline::handleAppsrcAtLeastABufferLeft):
1019         (WebCore::AppendPipeline::id):
1020         (WebCore::AppendPipeline::setAppendState):
1021         (WebCore::AppendPipeline::parseDemuxerSrcPadCaps):
1022         (WebCore::AppendPipeline::appsinkCapsChanged):
1023         (WebCore::AppendPipeline::checkEndOfAppend):
1024         (WebCore::AppendPipeline::appsinkNewSample):
1025         (WebCore::AppendPipeline::appsinkEOS):
1026         (WebCore::AppendPipeline::didReceiveInitializationSegment):
1027         (WebCore::AppendPipeline::trackId):
1028         (WebCore::AppendPipeline::resetPipeline):
1029         (WebCore::AppendPipeline::setAppsrcDataLeavingProbe):
1030         (WebCore::AppendPipeline::removeAppsrcDataLeavingProbe):
1031         (WebCore::AppendPipeline::abort):
1032         (WebCore::AppendPipeline::pushNewBuffer):
1033         (WebCore::AppendPipeline::reportAppsrcAtLeastABufferLeft):
1034         (WebCore::AppendPipeline::reportAppsrcNeedDataReceived):
1035         (WebCore::AppendPipeline::handleNewAppsinkSample):
1036         (WebCore::AppendPipeline::connectDemuxerSrcPadToAppsinkFromAnyThread):
1037         (WebCore::AppendPipeline::connectDemuxerSrcPadToAppsink):
1038         (WebCore::AppendPipeline::disconnectDemuxerSrcPadFromAppsinkFromAnyThread):
1039         (WebCore::appendPipelineAppsinkCapsChanged):
1040         (WebCore::appendPipelineAppsrcDataLeaving):
1041         (WebCore::appendPipelinePadProbeDebugInformation):
1042         (WebCore::appendPipelineAppsrcNeedData):
1043         (WebCore::appendPipelineDemuxerPadAdded):
1044         (WebCore::appendPipelineDemuxerPadRemoved):
1045         (WebCore::appendPipelineAppsinkNewSample):
1046         (WebCore::appendPipelineAppsinkEOS):
1047         * platform/graphics/gstreamer/mse/AppendPipeline.h: Added.
1048         (WebCore::AppendPipeline::appendState):
1049         (WebCore::AppendPipeline::mediaSourceClient):
1050         (WebCore::AppendPipeline::sourceBufferPrivate):
1051         (WebCore::AppendPipeline::bus):
1052         (WebCore::AppendPipeline::pipeline):
1053         (WebCore::AppendPipeline::appsrc):
1054         (WebCore::AppendPipeline::appsink):
1055         (WebCore::AppendPipeline::demuxerSrcPadCaps):
1056         (WebCore::AppendPipeline::appsinkCaps):
1057         (WebCore::AppendPipeline::track):
1058         (WebCore::AppendPipeline::streamType):
1059
1060 2016-10-26  Enrique Ocaña González  <eocanha@igalia.com>
1061
1062         [GStreamer] Drain query support
1063         https://bugs.webkit.org/show_bug.cgi?id=162872
1064
1065         Reviewed by Žan Doberšek.
1066
1067         Under some circumstances, GStreamer deadlocks completely during MSE seeks on OpenGL ES
1068         systems. This is because the video sink still holds samples. Proper DRAIN support
1069         fixes this issue and is also good for all the platforms, not only OpenGL ES.
1070
1071         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1072         (WebCore::MediaPlayerPrivateGStreamerBase::triggerDrain):
1073         (WebCore::MediaPlayerPrivateGStreamerBase::drainCallback):
1074         (WebCore::MediaPlayerPrivateGStreamerBase::createVideoSink):
1075         (WebCore::MediaPlayerPrivateGStreamerBase::createVideoSinkGL): Deleted.
1076         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
1077         * platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
1078         (VideoRenderRequestScheduler::drain):
1079         (webkitVideoSinkQuery):
1080         (webkitVideoSinkEvent):
1081         (webkit_video_sink_class_init):
1082         (VideoRenderRequestScheduler::stop): Deleted.
1083         (webkitVideoSinkProposeAllocation): Deleted.
1084
1085 2016-10-26  Enrique Ocaña González  <eocanha@igalia.com>
1086
1087         [GStreamer] Track enhancements for MSE support
1088         https://bugs.webkit.org/show_bug.cgi?id=162869
1089
1090         Reviewed by Xabier Rodriguez-Calvar.
1091
1092         Add 'id' field to Audio/VideoTrackPrivateGStreamer. Make TrackPrivateBaseGStreamer
1093         work anyway in cases where the demuxer isn't contained in a GstPlaybin.
1094
1095         * platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp:
1096         (WebCore::AudioTrackPrivateGStreamer::AudioTrackPrivateGStreamer):
1097         * platform/graphics/gstreamer/AudioTrackPrivateGStreamer.h:
1098         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
1099         (WebCore::TrackPrivateBaseGStreamer::tagsChanged):
1100         (WebCore::TrackPrivateBaseGStreamer::notifyTrackOfActiveChanged):
1101         * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp:
1102         (WebCore::VideoTrackPrivateGStreamer::VideoTrackPrivateGStreamer):
1103         * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.h:
1104
1105 2016-10-26  Youenn Fablet  <youenn@apple.com>
1106
1107         Make CachedResourceLoader originsMatch check more efficient
1108         https://bugs.webkit.org/show_bug.cgi?id=163938
1109
1110         Reviewed by Darin Adler.
1111
1112         No change of behavior.
1113
1114         * loader/cache/CachedResourceLoader.cpp:
1115         (WebCore::CachedResourceLoader::shouldUpdateCachedResourceWithCurrentRequest):
1116         (WebCore::originsMatch): Moved to SecurityOrigin.cpp.
1117         * page/SecurityOrigin.cpp:
1118         (WebCore::areOriginsMatching): Helper routine to check whether origins are matching.
1119         (WebCore::originsMatch): Ensuring string comparison provides the same result as this function.
1120         * page/SecurityOrigin.h:
1121         (WebCore::SecurityOrigin::protocol):
1122         (WebCore::SecurityOrigin::host):
1123         (WebCore::SecurityOrigin::domain):
1124
1125 2016-10-25  Yusuke Suzuki  <utatane.tea@gmail.com>
1126
1127         [DOMJIT] Tell IDL result type to DFG to drop type checks in AI
1128         https://bugs.webkit.org/show_bug.cgi?id=163900
1129
1130         Reviewed by Sam Weinig.
1131
1132         Add TestDOMJIT.idl for bindings generation tests.
1133
1134         * bindings/scripts/CodeGeneratorJS.pm:
1135         (GetResultTypeFilter):
1136         (GenerateImplementation):
1137         * bindings/scripts/test/JS/JSTestDOMJIT.cpp: Added.
1138         (WebCore::JSTestDOMJITPrototype::create):
1139         (WebCore::JSTestDOMJITPrototype::createStructure):
1140         (WebCore::JSTestDOMJITPrototype::JSTestDOMJITPrototype):
1141         (WebCore::JSTestDOMJITConstructor::prototypeForStructure):
1142         (WebCore::JSTestDOMJITConstructor::initializeProperties):
1143         (WebCore::JSTestDOMJITPrototype::finishCreation):
1144         (WebCore::JSTestDOMJIT::JSTestDOMJIT):
1145         (WebCore::JSTestDOMJIT::createPrototype):
1146         (WebCore::JSTestDOMJIT::prototype):
1147         (WebCore::BindingCaller<JSTestDOMJIT>::castForAttribute):
1148         (WebCore::jsTestDOMJITAnyAttr):
1149         (WebCore::jsTestDOMJITAnyAttrGetter):
1150         (WebCore::TestDOMJITAnyAttrDOMJIT::TestDOMJITAnyAttrDOMJIT):
1151         (WebCore::domJITGetterSetterForTestDOMJITAnyAttr):
1152         (WebCore::jsTestDOMJITBooleanAttr):
1153         (WebCore::jsTestDOMJITBooleanAttrGetter):
1154         (WebCore::TestDOMJITBooleanAttrDOMJIT::TestDOMJITBooleanAttrDOMJIT):
1155         (WebCore::domJITGetterSetterForTestDOMJITBooleanAttr):
1156         (WebCore::jsTestDOMJITByteAttr):
1157         (WebCore::jsTestDOMJITByteAttrGetter):
1158         (WebCore::TestDOMJITByteAttrDOMJIT::TestDOMJITByteAttrDOMJIT):
1159         (WebCore::domJITGetterSetterForTestDOMJITByteAttr):
1160         (WebCore::jsTestDOMJITOctetAttr):
1161         (WebCore::jsTestDOMJITOctetAttrGetter):
1162         (WebCore::TestDOMJITOctetAttrDOMJIT::TestDOMJITOctetAttrDOMJIT):
1163         (WebCore::domJITGetterSetterForTestDOMJITOctetAttr):
1164         (WebCore::jsTestDOMJITShortAttr):
1165         (WebCore::jsTestDOMJITShortAttrGetter):
1166         (WebCore::TestDOMJITShortAttrDOMJIT::TestDOMJITShortAttrDOMJIT):
1167         (WebCore::domJITGetterSetterForTestDOMJITShortAttr):
1168         (WebCore::jsTestDOMJITUnsignedShortAttr):
1169         (WebCore::jsTestDOMJITUnsignedShortAttrGetter):
1170         (WebCore::TestDOMJITUnsignedShortAttrDOMJIT::TestDOMJITUnsignedShortAttrDOMJIT):
1171         (WebCore::domJITGetterSetterForTestDOMJITUnsignedShortAttr):
1172         (WebCore::jsTestDOMJITLongAttr):
1173         (WebCore::jsTestDOMJITLongAttrGetter):
1174         (WebCore::TestDOMJITLongAttrDOMJIT::TestDOMJITLongAttrDOMJIT):
1175         (WebCore::domJITGetterSetterForTestDOMJITLongAttr):
1176         (WebCore::jsTestDOMJITUnsignedLongAttr):
1177         (WebCore::jsTestDOMJITUnsignedLongAttrGetter):
1178         (WebCore::TestDOMJITUnsignedLongAttrDOMJIT::TestDOMJITUnsignedLongAttrDOMJIT):
1179         (WebCore::domJITGetterSetterForTestDOMJITUnsignedLongAttr):
1180         (WebCore::jsTestDOMJITLongLongAttr):
1181         (WebCore::jsTestDOMJITLongLongAttrGetter):
1182         (WebCore::TestDOMJITLongLongAttrDOMJIT::TestDOMJITLongLongAttrDOMJIT):
1183         (WebCore::domJITGetterSetterForTestDOMJITLongLongAttr):
1184         (WebCore::jsTestDOMJITUnsignedLongLongAttr):
1185         (WebCore::jsTestDOMJITUnsignedLongLongAttrGetter):
1186         (WebCore::TestDOMJITUnsignedLongLongAttrDOMJIT::TestDOMJITUnsignedLongLongAttrDOMJIT):
1187         (WebCore::domJITGetterSetterForTestDOMJITUnsignedLongLongAttr):
1188         (WebCore::jsTestDOMJITFloatAttr):
1189         (WebCore::jsTestDOMJITFloatAttrGetter):
1190         (WebCore::TestDOMJITFloatAttrDOMJIT::TestDOMJITFloatAttrDOMJIT):
1191         (WebCore::domJITGetterSetterForTestDOMJITFloatAttr):
1192         (WebCore::jsTestDOMJITUnrestrictedFloatAttr):
1193         (WebCore::jsTestDOMJITUnrestrictedFloatAttrGetter):
1194         (WebCore::TestDOMJITUnrestrictedFloatAttrDOMJIT::TestDOMJITUnrestrictedFloatAttrDOMJIT):
1195         (WebCore::domJITGetterSetterForTestDOMJITUnrestrictedFloatAttr):
1196         (WebCore::jsTestDOMJITDoubleAttr):
1197         (WebCore::jsTestDOMJITDoubleAttrGetter):
1198         (WebCore::TestDOMJITDoubleAttrDOMJIT::TestDOMJITDoubleAttrDOMJIT):
1199         (WebCore::domJITGetterSetterForTestDOMJITDoubleAttr):
1200         (WebCore::jsTestDOMJITUnrestrictedDoubleAttr):
1201         (WebCore::jsTestDOMJITUnrestrictedDoubleAttrGetter):
1202         (WebCore::TestDOMJITUnrestrictedDoubleAttrDOMJIT::TestDOMJITUnrestrictedDoubleAttrDOMJIT):
1203         (WebCore::domJITGetterSetterForTestDOMJITUnrestrictedDoubleAttr):
1204         (WebCore::jsTestDOMJITDomStringAttr):
1205         (WebCore::jsTestDOMJITDomStringAttrGetter):
1206         (WebCore::TestDOMJITDomStringAttrDOMJIT::TestDOMJITDomStringAttrDOMJIT):
1207         (WebCore::domJITGetterSetterForTestDOMJITDomStringAttr):
1208         (WebCore::jsTestDOMJITByteStringAttr):
1209         (WebCore::jsTestDOMJITByteStringAttrGetter):
1210         (WebCore::TestDOMJITByteStringAttrDOMJIT::TestDOMJITByteStringAttrDOMJIT):
1211         (WebCore::domJITGetterSetterForTestDOMJITByteStringAttr):
1212         (WebCore::jsTestDOMJITUsvStringAttr):
1213         (WebCore::jsTestDOMJITUsvStringAttrGetter):
1214         (WebCore::TestDOMJITUsvStringAttrDOMJIT::TestDOMJITUsvStringAttrDOMJIT):
1215         (WebCore::domJITGetterSetterForTestDOMJITUsvStringAttr):
1216         (WebCore::jsTestDOMJITNodeAttr):
1217         (WebCore::jsTestDOMJITNodeAttrGetter):
1218         (WebCore::TestDOMJITNodeAttrDOMJIT::TestDOMJITNodeAttrDOMJIT):
1219         (WebCore::domJITGetterSetterForTestDOMJITNodeAttr):
1220         (WebCore::jsTestDOMJITBooleanNullableAttr):
1221         (WebCore::jsTestDOMJITBooleanNullableAttrGetter):
1222         (WebCore::TestDOMJITBooleanNullableAttrDOMJIT::TestDOMJITBooleanNullableAttrDOMJIT):
1223         (WebCore::domJITGetterSetterForTestDOMJITBooleanNullableAttr):
1224         (WebCore::jsTestDOMJITByteNullableAttr):
1225         (WebCore::jsTestDOMJITByteNullableAttrGetter):
1226         (WebCore::TestDOMJITByteNullableAttrDOMJIT::TestDOMJITByteNullableAttrDOMJIT):
1227         (WebCore::domJITGetterSetterForTestDOMJITByteNullableAttr):
1228         (WebCore::jsTestDOMJITOctetNullableAttr):
1229         (WebCore::jsTestDOMJITOctetNullableAttrGetter):
1230         (WebCore::TestDOMJITOctetNullableAttrDOMJIT::TestDOMJITOctetNullableAttrDOMJIT):
1231         (WebCore::domJITGetterSetterForTestDOMJITOctetNullableAttr):
1232         (WebCore::jsTestDOMJITShortNullableAttr):
1233         (WebCore::jsTestDOMJITShortNullableAttrGetter):
1234         (WebCore::TestDOMJITShortNullableAttrDOMJIT::TestDOMJITShortNullableAttrDOMJIT):
1235         (WebCore::domJITGetterSetterForTestDOMJITShortNullableAttr):
1236         (WebCore::jsTestDOMJITUnsignedShortNullableAttr):
1237         (WebCore::jsTestDOMJITUnsignedShortNullableAttrGetter):
1238         (WebCore::TestDOMJITUnsignedShortNullableAttrDOMJIT::TestDOMJITUnsignedShortNullableAttrDOMJIT):
1239         (WebCore::domJITGetterSetterForTestDOMJITUnsignedShortNullableAttr):
1240         (WebCore::jsTestDOMJITLongNullableAttr):
1241         (WebCore::jsTestDOMJITLongNullableAttrGetter):
1242         (WebCore::TestDOMJITLongNullableAttrDOMJIT::TestDOMJITLongNullableAttrDOMJIT):
1243         (WebCore::domJITGetterSetterForTestDOMJITLongNullableAttr):
1244         (WebCore::jsTestDOMJITUnsignedLongNullableAttr):
1245         (WebCore::jsTestDOMJITUnsignedLongNullableAttrGetter):
1246         (WebCore::TestDOMJITUnsignedLongNullableAttrDOMJIT::TestDOMJITUnsignedLongNullableAttrDOMJIT):
1247         (WebCore::domJITGetterSetterForTestDOMJITUnsignedLongNullableAttr):
1248         (WebCore::jsTestDOMJITLongLongNullableAttr):
1249         (WebCore::jsTestDOMJITLongLongNullableAttrGetter):
1250         (WebCore::TestDOMJITLongLongNullableAttrDOMJIT::TestDOMJITLongLongNullableAttrDOMJIT):
1251         (WebCore::domJITGetterSetterForTestDOMJITLongLongNullableAttr):
1252         (WebCore::jsTestDOMJITUnsignedLongLongNullableAttr):
1253         (WebCore::jsTestDOMJITUnsignedLongLongNullableAttrGetter):
1254         (WebCore::TestDOMJITUnsignedLongLongNullableAttrDOMJIT::TestDOMJITUnsignedLongLongNullableAttrDOMJIT):
1255         (WebCore::domJITGetterSetterForTestDOMJITUnsignedLongLongNullableAttr):
1256         (WebCore::jsTestDOMJITFloatNullableAttr):
1257         (WebCore::jsTestDOMJITFloatNullableAttrGetter):
1258         (WebCore::TestDOMJITFloatNullableAttrDOMJIT::TestDOMJITFloatNullableAttrDOMJIT):
1259         (WebCore::domJITGetterSetterForTestDOMJITFloatNullableAttr):
1260         (WebCore::jsTestDOMJITUnrestrictedFloatNullableAttr):
1261         (WebCore::jsTestDOMJITUnrestrictedFloatNullableAttrGetter):
1262         (WebCore::TestDOMJITUnrestrictedFloatNullableAttrDOMJIT::TestDOMJITUnrestrictedFloatNullableAttrDOMJIT):
1263         (WebCore::domJITGetterSetterForTestDOMJITUnrestrictedFloatNullableAttr):
1264         (WebCore::jsTestDOMJITDoubleNullableAttr):
1265         (WebCore::jsTestDOMJITDoubleNullableAttrGetter):
1266         (WebCore::TestDOMJITDoubleNullableAttrDOMJIT::TestDOMJITDoubleNullableAttrDOMJIT):
1267         (WebCore::domJITGetterSetterForTestDOMJITDoubleNullableAttr):
1268         (WebCore::jsTestDOMJITUnrestrictedDoubleNullableAttr):
1269         (WebCore::jsTestDOMJITUnrestrictedDoubleNullableAttrGetter):
1270         (WebCore::TestDOMJITUnrestrictedDoubleNullableAttrDOMJIT::TestDOMJITUnrestrictedDoubleNullableAttrDOMJIT):
1271         (WebCore::domJITGetterSetterForTestDOMJITUnrestrictedDoubleNullableAttr):
1272         (WebCore::jsTestDOMJITDomStringNullableAttr):
1273         (WebCore::jsTestDOMJITDomStringNullableAttrGetter):
1274         (WebCore::TestDOMJITDomStringNullableAttrDOMJIT::TestDOMJITDomStringNullableAttrDOMJIT):
1275         (WebCore::domJITGetterSetterForTestDOMJITDomStringNullableAttr):
1276         (WebCore::jsTestDOMJITByteStringNullableAttr):
1277         (WebCore::jsTestDOMJITByteStringNullableAttrGetter):
1278         (WebCore::TestDOMJITByteStringNullableAttrDOMJIT::TestDOMJITByteStringNullableAttrDOMJIT):
1279         (WebCore::domJITGetterSetterForTestDOMJITByteStringNullableAttr):
1280         (WebCore::jsTestDOMJITUsvStringNullableAttr):
1281         (WebCore::jsTestDOMJITUsvStringNullableAttrGetter):
1282         (WebCore::TestDOMJITUsvStringNullableAttrDOMJIT::TestDOMJITUsvStringNullableAttrDOMJIT):
1283         (WebCore::domJITGetterSetterForTestDOMJITUsvStringNullableAttr):
1284         (WebCore::jsTestDOMJITNodeNullableAttr):
1285         (WebCore::jsTestDOMJITNodeNullableAttrGetter):
1286         (WebCore::TestDOMJITNodeNullableAttrDOMJIT::TestDOMJITNodeNullableAttrDOMJIT):
1287         (WebCore::domJITGetterSetterForTestDOMJITNodeNullableAttr):
1288         (WebCore::jsTestDOMJITConstructor):
1289         (WebCore::setJSTestDOMJITConstructor):
1290         (WebCore::JSTestDOMJIT::getConstructor):
1291         (WebCore::JSTestDOMJIT::visitChildren):
1292         * bindings/scripts/test/JS/JSTestDOMJIT.h: Added.
1293         (WebCore::JSTestDOMJIT::create):
1294         (WebCore::JSTestDOMJIT::createStructure):
1295         (WebCore::JSTestDOMJIT::wrapped):
1296         (WebCore::JSTestDOMJIT::finishCreation):
1297         * bindings/scripts/test/TestDOMJIT.idl: Added.
1298
1299 2016-10-25  Brent Fulgham  <bfulgham@apple.com>
1300
1301         [Win] Unreviewed build fix.
1302
1303         * platform/graphics/GraphicsContext.h: Add missing declaration.
1304
1305 2016-10-25  Ryosuke Niwa  <rniwa@webkit.org>
1306
1307         Updating attribute by textContent must create a single mutation record and custom element reaction
1308         https://bugs.webkit.org/show_bug.cgi?id=164003
1309
1310         Reviewed by Chris Dumez.
1311
1312         The bug was caused by setTextContent not invoking setNodeValue for Attr nodes.
1313         Use setNodeValue to match the specification: https://dom.spec.whatwg.org/#dom-node-textcontent
1314
1315         Test: fast/dom/MutationObserver/text-content-on-attr.html
1316
1317         * dom/Node.cpp:
1318         (WebCore::Node::setTextContent):
1319
1320 2016-10-25  Brent Fulgham  <bfulgham@apple.com>
1321
1322         [Win][Direct2D] Use smart pointers for Direct2D Path types
1323         https://bugs.webkit.org/show_bug.cgi?id=163994
1324
1325         Reviewed by Alex Christensen.
1326
1327         Tested by existing path tests.
1328
1329         * platform/graphics/Path.h:
1330         (WebCore::Path::platformPath): Use a COMPtr for m_path.
1331         * platform/graphics/win/GraphicsContextDirect2D.cpp:
1332         (WebCore::GraphicsContext::systemFactory): Present better D2D debug output
1333         when running a debug build.
1334         (WebCore::GraphicsContext::platformInit): Initialize a D2D device from a
1335         native GDI device context.
1336         (WebCore::GraphicsContext::platformStrokeStyle): Added.
1337         (WebCore::GraphicsContext::clipBounds): Simplify clip boundary calculations and
1338         avoid doing math on infinities.
1339         * platform/graphics/win/PathDirect2D.cpp:
1340         (WebCore::scratchRenderTarget): Added.
1341         (WebCore::Path::~Path): Switch to COMPtr implementation.
1342         (WebCore::Path::ensurePlatformPath): Ditto.
1343         (WebCore::Path::appendGeometry): Ditto.
1344         (WebCore::Path::operator=): Ditto.
1345         (WebCore::Path::initializePathState): Ditto.
1346         (WebCore::Path::strokeContains): Provide an implementation.
1347         (WebCore::Path::transform): Ditto.
1348         (WebCore::Path::addEllipse): No need for explicit construction of the
1349         D2D1::Point2F object.
1350         (WebCore::Path::clear): Switch to COMPtr implementation.
1351
1352 2016-10-25  Nan Wang  <n_wang@apple.com>
1353
1354         LayoutTest accessibility/mac/meter-gauge-value-description.html failing
1355         https://bugs.webkit.org/show_bug.cgi?id=163997
1356         <rdar://problem/28948637>
1357
1358         Reviewed by Chris Fleizach.
1359
1360         I hand-edited the Localizable.strings file in a previous patch and my changes
1361         were replaced by running update-webkit-localizable-strings script. Changed the
1362         key to be the same as the value to keep consistency with other entries.
1363
1364         Re-enabled the failing test.
1365
1366         * English.lproj/Localizable.strings:
1367         * platform/LocalizedStrings.cpp:
1368         (WebCore::AXMeterGaugeRegionOptimumText):
1369         (WebCore::AXMeterGaugeRegionSuboptimalText):
1370         (WebCore::AXMeterGaugeRegionLessGoodText):
1371
1372 2016-10-25  Filip Pizlo  <fpizlo@apple.com>
1373
1374         HeapTimer should not hardcode all of its subclasses and USE(CF) shouldn't be a bizarre special case
1375         https://bugs.webkit.org/show_bug.cgi?id=163947
1376
1377         Reviewed by Geoffrey Garen.
1378
1379         No new tests because no new behavior.
1380
1381         * platform/ios/WebSafeGCActivityCallbackIOS.h:
1382         * platform/ios/WebSafeIncrementalSweeperIOS.h:
1383
1384 2016-10-25  Dave Hyatt  <hyatt@apple.com>
1385
1386         [CSS Parser] Improvements to selector parsing
1387         https://bugs.webkit.org/show_bug.cgi?id=163964
1388
1389         Reviewed by Zalan Bujtas.
1390
1391         * css/CSSSelector.cpp:
1392         (WebCore::CSSSelector::setAttribute):
1393         (WebCore::CSSSelector::setNth):
1394         * css/CSSSelector.h:
1395         (WebCore::CSSSelector::setAttributeValueMatchingIsCaseInsensitive):
1396         * css/StyleSheetContents.cpp:
1397         (WebCore::StyleSheetContents::StyleSheetContents):
1398         (WebCore::StyleSheetContents::parserAppendRule):
1399         (WebCore::StyleSheetContents::ruleAt):
1400         (WebCore::StyleSheetContents::ruleCount):
1401         (WebCore::StyleSheetContents::clearRules):
1402         (WebCore::StyleSheetContents::wrapperInsertRule):
1403         (WebCore::StyleSheetContents::wrapperDeleteRule):
1404         * css/StyleSheetContents.h:
1405         * css/parser/CSSParser.cpp:
1406         (WebCore::CSSParserContext::CSSParserContext):
1407         (WebCore::CSSParser::parseSelector):
1408         * css/parser/CSSParserValues.h:
1409         (WebCore::CSSParserSelector::setAttribute):
1410         (WebCore::CSSParserSelector::setArgument):
1411         (WebCore::CSSParserSelector::setNth):
1412         * css/parser/CSSSelectorParser.cpp:
1413         (WebCore::consumeLangArgumentList):
1414         (WebCore::CSSSelectorParser::consumeCompoundSelector):
1415         (WebCore::CSSSelectorParser::consumeAttribute):
1416         (WebCore::isPseudoClassFunction):
1417         (WebCore::isPseudoElementFunction):
1418         (WebCore::CSSSelectorParser::consumePseudo):
1419         (WebCore::CSSSelectorParser::consumeCombinator):
1420
1421 2016-10-25  Beth Dakin  <bdakin@apple.com>
1422
1423         Numbered list should be represented without ‘…’
1424         https://bugs.webkit.org/show_bug.cgi?id=163992
1425         -and corresponding-
1426         rdar://problem/28911337
1427
1428         Reviewed by Darin Adler.
1429
1430         * English.lproj/Localizable.strings:
1431         * platform/LocalizedStrings.cpp:
1432         (WebCore::insertListTypeNumbered):
1433
1434 2016-10-25  Daniel Bates  <dabates@apple.com>
1435
1436         REGRESSION (r178265): XSS Auditor fails to block document.write() of incomplete tag
1437         https://bugs.webkit.org/show_bug.cgi?id=163978
1438         <rdar://problem/25962131>
1439
1440         Reviewed by Darin Adler.
1441
1442         During the tokenization process of an HTML tag the start and end positions of each of its
1443         attributes is tracked so that the XSS Auditor can request a snippet around a suspected
1444         injected attribute. We need to take care to consider document.write() boundaries when
1445         tracking the start and end positions of each HTML tag and attribute so that the XSS Auditor
1446         receives the correct snippet. Following r178265 we no longer consider document.write()
1447         boundaries when tracking the start and end positions of attributes. So, the substring
1448         represented by the start and end positions of an attribute may correspond to some other
1449         attribute in the tag. Therefore the XSS Auditor may fail to block an injection because the
1450         snippet it requested may not be the snippet that it intended to request.
1451
1452         Tests: http/tests/security/xssAuditor/dom-write-location-dom-write-open-img-onerror.html
1453                http/tests/security/xssAuditor/dom-write-location-open-img-onerror.html
1454                http/tests/security/xssAuditor/nested-dom-write-location-open-img-onerror.html
1455
1456         * html/parser/HTMLSourceTracker.cpp:
1457         (WebCore::HTMLSourceTracker::startToken): Set the attribute base offset to be the token
1458         start position.
1459         (WebCore::HTMLSourceTracker::source): Use the specified attribute start position as-is. We no
1460         longer adjust it here because it was adjusted with respect to the attribute base offset, which
1461         takes into account document.write() boundaries.
1462         * html/parser/HTMLToken.h:
1463         (WebCore::HTMLToken::setAttributeBaseOffset): Added.
1464         (WebCore::HTMLToken::beginAttribute): Subtract attribute base offset from the specified offset.
1465         (WebCore::HTMLToken::endAttribute): Ditto.
1466         * html/parser/HTMLTokenizer.h:
1467         (WebCore::HTMLTokenizer::setTokenAttributeBaseOffset): Added.
1468
1469 2016-10-25  Chris Dumez  <cdumez@apple.com>
1470
1471         IDBDatabase.transaction() should take a union in parameter
1472         https://bugs.webkit.org/show_bug.cgi?id=163966
1473
1474         Reviewed by Sam Weinig.
1475
1476         IDBDatabase.transaction() should take a union in parameter:
1477         - https://www.w3.org/TR/IndexedDB/#widl-IDBDatabase-transaction-IDBTransaction-DOMString-sequence-DOMString--storeNames-IDBTransactionMode-mode
1478
1479         No new tests, no expected Web-exposed behavior change.
1480
1481         * Modules/indexeddb/IDBDatabase.cpp:
1482         (WebCore::IDBDatabase::transaction):
1483         * Modules/indexeddb/IDBDatabase.h:
1484         * Modules/indexeddb/IDBDatabase.idl:
1485
1486 2016-10-25  Brady Eidson  <beidson@apple.com>
1487
1488         IndexedDB 2.0: Support IDBObjectStore openKeyCursor.
1489         <rdar://problem/28806930> and https://bugs.webkit.org/show_bug.cgi?id=163954
1490
1491         Reviewed by Andy Estes.
1492
1493         No new tests (Covered by changes to existing tests)
1494
1495         * Modules/indexeddb/IDBCursor.cpp:
1496         (WebCore::IDBCursor::create):
1497         * Modules/indexeddb/IDBCursor.h:
1498
1499         * Modules/indexeddb/IDBObjectStore.cpp:
1500         (WebCore::IDBObjectStore::openCursor):
1501         (WebCore::IDBObjectStore::openKeyCursor):
1502         * Modules/indexeddb/IDBObjectStore.h:
1503         * Modules/indexeddb/IDBObjectStore.idl:
1504
1505         * Modules/indexeddb/IDBTransaction.cpp:
1506         (WebCore::IDBTransaction::requestOpenCursor):
1507
1508         * Modules/indexeddb/server/MemoryObjectStoreCursor.cpp:
1509         (WebCore::IDBServer::MemoryObjectStoreCursor::currentData): Only grab the current value
1510           if the cursor is KeyAndValue.
1511
1512         * Modules/indexeddb/server/SQLiteIDBCursor.cpp:
1513         (WebCore::IDBServer::SQLiteIDBCursor::SQLiteIDBCursor):
1514         (WebCore::IDBServer::SQLiteIDBCursor::internalAdvanceOnce): Only save off the data for an
1515           object store cursor if it's both KeyAndValue.
1516         * Modules/indexeddb/server/SQLiteIDBCursor.h:
1517
1518         * Modules/indexeddb/shared/IDBCursorInfo.cpp:
1519         (WebCore::IDBCursorInfo::objectStoreCursor): Allow for a KeyOnly ObjectStoreCursor.
1520         * Modules/indexeddb/shared/IDBCursorInfo.h:
1521
1522 2016-10-25  Wenson Hsieh  <wenson_hsieh@apple.com>
1523
1524         Support InputEvent.dataTransfer for the InputEvent spec
1525         https://bugs.webkit.org/show_bug.cgi?id=163213
1526         <rdar://problem/28700407>
1527
1528         Reviewed by Ryosuke Niwa.
1529
1530         Adds support for the dataTransfer attribute of InputEvent, which contains both HTML and plain text
1531         representations of inserted content corresponding to input types "insertFromPaste", "insertFromDrop" and
1532         "insertReplacementText". The specification calls for the data transfer's drag data item list to contain this
1533         information via two entries with type strings "text/html" and "text/plain". However, WebKit does not yet support
1534         the DataTransfer.items -- in lieu of this, we will provide this information for now via getData("text/plain")
1535         and getData("text/html"), respectively.
1536
1537         To support this attribute, we need a special type of DataTransfer which is readonly and returns canned data
1538         given a type string. To implement this, we introduce StaticPasteboard, a type of Pasteboard which is initialized
1539         with a map of type string to data. When asked for its data via getData, the StaticPasteboard searches its map
1540         for the requested type and returns the result, if any.
1541
1542         An editing command may now create a new DataTransfer via DataTransfer::createForInputEvent from HTML and
1543         plaintext strings, and then vend this information to its dispatched input events by overriding
1544         CompositeEditCommand::inputEventDataTransfer.
1545
1546         Some further work will be needed to ensure that all information exposed via this DataTransfer does not contain
1547         hidden content. To do this, we should create a new Document, "paste" the contents of our copied HTML string into
1548         it, then simulate selecting the content and generating markup from the selection to create a sanitized
1549         DocumentFragment corresponding to the original copied HTML. This will be addressed in a future patch.
1550
1551         Tests: fast/events/input-events-paste-rich-datatransfer.html
1552                fast/events/input-events-spell-checking-datatransfer.html
1553
1554         * PlatformEfl.cmake:
1555         * PlatformGTK.cmake:
1556         * PlatformWin.cmake:
1557
1558         Add StaticPasteboard.cpp.
1559
1560         * WebCore.xcodeproj/project.pbxproj:
1561         * dom/DataTransfer.cpp:
1562         (WebCore::DataTransfer::DataTransfer):
1563         (WebCore::DataTransfer::createForInputEvent):
1564
1565         Initializes a new DataTransfer for the purposes of input events. This takes a HTML and plain text
1566         representations of the data being inserted and creates a new readonly DataTransfer backed by a StaticPasteboard
1567         that only knows how to map the "text/plain" data type to the given plaintext string and "text/html" to the
1568         given HTML text.
1569
1570         * dom/DataTransfer.h:
1571         * dom/InputEvent.cpp:
1572         (WebCore::InputEvent::create):
1573         (WebCore::InputEvent::InputEvent):
1574         (WebCore::InputEvent::dataTransfer):
1575         * dom/InputEvent.h:
1576         * dom/InputEvent.idl:
1577
1578         Add the InputEvent.dataTransfer attribute.
1579
1580         * dom/Node.cpp:
1581         * editing/CompositeEditCommand.cpp:
1582         (WebCore::CompositeEditCommand::inputEventDataTransfer):
1583
1584         Add a new hook for CompositeEditCommands to vend a DataTransfer for the purposes of input events. By default,
1585         this is null.
1586
1587         * editing/CompositeEditCommand.h:
1588         * editing/Editor.cpp:
1589         (WebCore::dispatchBeforeInputEvent):
1590         (WebCore::dispatchInputEvent):
1591         (WebCore::dispatchBeforeInputEvents):
1592         (WebCore::dispatchInputEvents):
1593         (WebCore::Editor::willApplyEditing):
1594         (WebCore::Editor::appliedEditing):
1595         * editing/ReplaceRangeWithTextCommand.cpp:
1596         (WebCore::ReplaceRangeWithTextCommand::willApplyCommand):
1597         (WebCore::ReplaceRangeWithTextCommand::doApply):
1598         (WebCore::ReplaceRangeWithTextCommand::inputEventDataTransfer):
1599         * editing/ReplaceRangeWithTextCommand.h:
1600         * editing/ReplaceSelectionCommand.cpp:
1601         (WebCore::ReplaceSelectionCommand::willApplyCommand):
1602
1603         Initialize the ReplacementFragment here before applying the command, adjusting the DocumentFragment to be
1604         inserted in the process.
1605
1606         (WebCore::ReplaceSelectionCommand::doApply):
1607         (WebCore::ReplaceSelectionCommand::inputEventDataTransfer):
1608         (WebCore::ReplaceSelectionCommand::ensureReplacementFragment):
1609
1610         Returns the ReplacementFragment used to apply the command, initializing it if necessary and stripping extraneous
1611         nodes off of the document fragment in the process. Since ReplaceSelectionCommand may be used as a top-level
1612         editing command or a child of another CompositeEditCommand such as the ReplaceRangeWithTextCommand, the
1613         ReplacementFragment may be initialized either in willApplyCommand or in doApply.
1614
1615         * editing/ReplaceSelectionCommand.h:
1616         * editing/SpellingCorrectionCommand.cpp:
1617         (WebCore::SpellingCorrectionCommand::willApplyCommand):
1618         (WebCore::SpellingCorrectionCommand::doApply):
1619         (WebCore::SpellingCorrectionCommand::inputEventDataTransfer):
1620         * editing/SpellingCorrectionCommand.h:
1621
1622         Using the replacement text fragment, create and return a DataTransfer for input events.
1623
1624         * platform/Pasteboard.h:
1625         * platform/StaticPasteboard.cpp: Added.
1626         (WebCore::StaticPasteboard::create):
1627         (WebCore::StaticPasteboard::StaticPasteboard):
1628         (WebCore::StaticPasteboard::hasData):
1629         (WebCore::StaticPasteboard::types):
1630         (WebCore::StaticPasteboard::readString):
1631         * platform/StaticPasteboard.h: Copied from Source/WebCore/dom/InputEvent.cpp.
1632         * platform/efl/PasteboardEfl.cpp:
1633         (WebCore::Pasteboard::writeMarkup):
1634         (WebCore::Pasteboard::write):
1635         (WebCore::Pasteboard::read):
1636         * platform/gtk/PasteboardGtk.cpp:
1637         (WebCore::Pasteboard::writeMarkup):
1638         * platform/ios/PasteboardIOS.mm:
1639         (WebCore::Pasteboard::writeMarkup):
1640         * platform/mac/PasteboardMac.mm:
1641         (WebCore::Pasteboard::Pasteboard):
1642         (WebCore::Pasteboard::writeMarkup):
1643         * platform/win/PasteboardWin.cpp:
1644         (WebCore::Pasteboard::write):
1645         (WebCore::Pasteboard::read):
1646
1647         To account for virtual methods on Pasteboard, add implementations for methods that were previously defined but
1648         unimplemented on these platforms.
1649
1650 2016-10-25  Andy Estes  <aestes@apple.com>
1651
1652         Implement rel=noopener
1653         https://bugs.webkit.org/show_bug.cgi?id=155166
1654         <rdar://problem/25193787>
1655
1656         Reviewed by Brent Fulgham.
1657
1658         Added support for rel=noopener to a and area elements.
1659
1660         Tests: fast/dom/Window/a-rel-noopener.html
1661                fast/dom/Window/area-rel-noopener.html
1662
1663         * html/HTMLAnchorElement.cpp:
1664         (WebCore::HTMLAnchorElement::HTMLAnchorElement): Stopped initializing m_linkRelations to 0.
1665         (WebCore::HTMLAnchorElement::parseAttribute): Declared static AtomicStrings for "noreferrer"
1666         and "noopener", and created a SpaceSplitString from the rel attribute value to test for these
1667         two values.
1668         (WebCore::HTMLAnchorElement::hasRel): Updated to use OptionSet::contains().
1669         (WebCore::HTMLAnchorElement::relList): Added a check for "noopener".
1670         (WebCore::HTMLAnchorElement::handleClick): Passed NewFrameOpenerPolicy::Suppress to
1671         FrameLoader::urlSelected() if rel=noopener was specified.
1672         * html/HTMLAnchorElement.h: Changed the Relation enum to an enum class, removed unused enum
1673         values, and changed m_linkRelations from a 30-bit unsigned integer to an OptionSet<Relation>
1674         (HTMLAnchorElement is still 128 bytes on 64-bit).
1675         * loader/FrameLoader.cpp:
1676         (WebCore::FrameLoader::urlSelected): Changed to only compute a NewFrameOpenerPolicy from the
1677         referrer policy if an explicit NewFrameOpenerPolicy isn't specified. Removed the version of
1678         urlSelected() that did not take a downloadAttribute parameter.
1679         * loader/FrameLoader.h: Added an Optional<NewFrameOpenerPolicy> parameter to urlSelected(),
1680         and set a default argument for downloadAttribute instead of having a second version of
1681         urlSelected().
1682
1683 2016-10-25  Eric Carlson  <eric.carlson@apple.com>
1684
1685         [MediaStream] Add "has capture device" bit to media state flags
1686         https://bugs.webkit.org/show_bug.cgi?id=163952
1687
1688         Reviewed by Jer Noble.
1689
1690         No new tests, updated fast/mediastream/MediaStream-page-muted.html, media/muted-video-is-playing-audio.html,
1691         and webaudio/web-audio-is-playing.html.
1692
1693         * Modules/mediastream/MediaStream.cpp:
1694         (WebCore::MediaStream::mediaState): Set HasMediaCaptureDevice, only set HasActiveMediaCaptureDevice when
1695           actually producing data.
1696
1697         * page/MediaProducer.h: Add HasMediaCaptureDevice bit.
1698
1699         * testing/Internals.cpp:
1700         (WebCore::Internals::pageMediaState): Return a string representing MediaStateFlags.
1701         (WebCore::Internals::isPagePlayingAudio): Deleted.
1702         * testing/Internals.h:
1703         * testing/Internals.idl:
1704
1705 2016-10-25  Commit Queue  <commit-queue@webkit.org>
1706
1707         Unreviewed, rolling out r207827 and r207828.
1708         https://bugs.webkit.org/show_bug.cgi?id=163965
1709
1710         Caused LayoutTest webaudio/web-audio-is-playing.html to time
1711         out on macOS. (Requested by ryanhaddad on #webkit).
1712
1713         Reverted changesets:
1714
1715         "[MediaStream] Add "has capture device" bit to media state
1716         flags"
1717         https://bugs.webkit.org/show_bug.cgi?id=163952
1718         http://trac.webkit.org/changeset/207827
1719
1720         "[MediaStream] Add "has capture device" bit to media state
1721         flags"
1722         https://bugs.webkit.org/show_bug.cgi?id=163952
1723         http://trac.webkit.org/changeset/207828
1724
1725 2016-10-25  Antoine Quint  <graouts@apple.com>
1726
1727         [Modern Media Controls] Media Controller: skip back support
1728         https://bugs.webkit.org/show_bug.cgi?id=163725
1729         <rdar://problem/27989480>
1730
1731         Reviewed by Dean Jackson.
1732
1733         We introduce the SkipBackSupport class which brings support for skipping back
1734         30 seconds into the media by clicking on the skip back button in the media controls.
1735
1736         Test: http/tests/media/modern-media-controls/skip-back-support/skip-back-support-button-click.html
1737
1738         * Modules/modern-media-controls/js-files:
1739         * Modules/modern-media-controls/media/media-controller.js:
1740         (MediaController):
1741         * Modules/modern-media-controls/media/skip-back-support.js: Copied from Source/WebCore/Modules/modern-media-controls/media/media-controller.js.
1742         (SkipBackSupport.prototype.get control):
1743         (SkipBackSupport.prototype.buttonWasClicked):
1744         (SkipBackSupport):
1745         * WebCore.xcodeproj/project.pbxproj:
1746
1747 2016-10-25  Commit Queue  <commit-queue@webkit.org>
1748
1749         Unreviewed, rolling out r207578.
1750         https://bugs.webkit.org/show_bug.cgi?id=163962
1751
1752         Broke quip.com so that user can no longer type a space
1753         (Requested by rniwa on #webkit).
1754
1755         Reverted changeset:
1756
1757         "Add a plain space instead of &nbsp; between text nodes"
1758         https://bugs.webkit.org/show_bug.cgi?id=123163
1759         http://trac.webkit.org/changeset/207578
1760
1761 2016-10-25  Chris Dumez  <cdumez@apple.com>
1762
1763         LOG_WITH_STREAM() macro should not have a semi colon at the end
1764         https://bugs.webkit.org/show_bug.cgi?id=163951
1765
1766         Reviewed by Simon Fraser.
1767
1768         * platform/LogMacros.h:
1769
1770 2016-10-25  Chris Dumez  <cdumez@apple.com>
1771
1772         IDBObjectStore.createIndex() should take a union in parameter
1773         https://bugs.webkit.org/show_bug.cgi?id=163935
1774
1775         Reviewed by Darin Adler.
1776
1777         IDBObjectStore.createIndex() should take a union in parameter:
1778         - https://www.w3.org/TR/IndexedDB/#idl-def-IDBObjectStore
1779
1780         No new tests, no expected Web-exposed behavior change.
1781
1782         * Modules/indexeddb/IDBDatabase.cpp:
1783         (WebCore::IDBDatabase::createObjectStore):
1784         * Modules/indexeddb/IDBKeyPath.cpp:
1785         (WebCore::isIDBKeyPathValid):
1786         (WebCore::IDBKeyPath::isValid): Deleted.
1787         * Modules/indexeddb/IDBKeyPath.h:
1788         (WebCore::IDBKeyPath::isNull):
1789         * Modules/indexeddb/IDBObjectStore.cpp:
1790         (WebCore::IDBObjectStore::createIndex):
1791         * Modules/indexeddb/IDBObjectStore.h:
1792         * Modules/indexeddb/IDBObjectStore.idl:
1793
1794 2016-10-24  Sam Weinig  <sam@webkit.org>
1795
1796         [WebIDL] Move more types over to the new JSConverter based toJS functions
1797         https://bugs.webkit.org/show_bug.cgi?id=163920
1798
1799         Reviewed by Darin Adler.
1800
1801         - Adds WebIDL-extension type IDLDate, and use it for Date conversions.
1802         - Move JSDOMIterator over to using IDLType based conversions. Make them more
1803           explicit by adding a traits template argument which describes the iterator.
1804         - Add correct parsing for WebIDL iterable, parsing the parameter types into
1805           domTypes.
1806         - Support non-Optional nullable types via trait-like functions on IDLTypes.
1807
1808
1809         * bindings/generic/IDLTypes.h:
1810         (WebCore::IDLType::isNullValue):
1811         (WebCore::IDLType::extractValueFromNullable):
1812         (WebCore::IDLString::isNullValue):
1813         (WebCore::IDLString::extractValueFromNullable):
1814         (WebCore::IDLInterface::isNullValue):
1815         (WebCore::IDLInterface::extractValueFromNullable):
1816         (WebCore::IDLDate::isNullValue):
1817         (WebCore::IDLDate::extractValueFromNullable):
1818         Add isNullValue and extractValueFromNullable functions to allow non-Optional
1819         based nullable types.
1820         
1821         * Modules/plugins/QuickTimePluginReplacement.mm:
1822         (WebCore::QuickTimePluginReplacement::installReplacement):
1823         * bindings/js/IDBBindingUtilities.cpp:
1824         (WebCore::toJS):
1825         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
1826         (WebCore::stylePropertyGetter):
1827         * bindings/js/JSCustomElementInterface.cpp:
1828         (WebCore::JSCustomElementInterface::invokeAttributeChangedCallback):
1829         Switch to IDLType based toJS.
1830
1831         * bindings/js/JSDOMBinding.cpp:
1832         (WebCore::jsStringOrNull): Deleted.
1833         (WebCore::jsDateOrNull): Deleted.
1834         * bindings/js/JSDOMBinding.h:
1835         (WebCore::jsPair): Deleted.
1836         (WebCore::toJSNullableString): Deleted.
1837         Remove now unusued toJS functions.
1838
1839         * bindings/js/JSDOMConvert.h:
1840         (WebCore::JSConverter<IDLNullable<T>>::convert):
1841         Use new functions to detect and extract nullable values.
1842
1843         (WebCore::Converter<IDLBufferSource>::convert):
1844         Moved to be with the other converters.
1845
1846         (WebCore::Converter<IDLDate>::convert):
1847         (WebCore::JSConverter<IDLDate>::convert):
1848         Added.
1849
1850         * bindings/js/JSDOMIterator.h:
1851         (WebCore::jsPair):
1852         (WebCore::iteratorCreate):
1853         (WebCore::IteratorTraits>::asJS):
1854         (WebCore::appendForEachArguments):
1855         (WebCore::iteratorForEach):
1856         (WebCore::IteratorTraits>::destroy):
1857         (WebCore::IteratorTraits>::next):
1858         (WebCore::IteratorTraits>::finishCreation):
1859         (WebCore::IteratorInspector::decltype): Deleted.
1860         (WebCore::IteratorInspector::test): Deleted.
1861         (WebCore::JSDOMIterator<JSWrapper>::asJS): Deleted.
1862         (WebCore::JSDOMIterator<JSWrapper>::destroy): Deleted.
1863         (WebCore::JSDOMIterator<JSWrapper>::next): Deleted.
1864         (WebCore::JSDOMIteratorPrototype<JSWrapper>::next): Deleted.
1865         (WebCore::JSDOMIteratorPrototype<JSWrapper>::finishCreation): Deleted.
1866         Switch to new Traits based model, and have the generated code pass in 
1867         the type (map or set) and key/value types. With the explicit types known,
1868         we can use the new toJS functions.
1869         
1870         Also, moved the jsPair functions here from JSDOMBinding.h, since this was
1871         the only place it was used.
1872
1873         * bindings/scripts/CodeGeneratorJS.pm:
1874         (GenerateImplementationIterableFunctions):
1875         Add iterator trait definition and update for new parameters to JSDOMIterator
1876         and JSDOMIteratorPrototype.
1877
1878         (GetBaseIDLType):
1879         Add IDLDate, and move IDLBufferSource up to the simple path.
1880
1881         (JSValueToNativeIsHandledByDOMConvert):
1882         Allow Date.
1883
1884         (JSValueToNative):
1885         Remove special case for Date.
1886
1887         (NativeToJSValueIsHandledByDOMConvert):
1888         Allow Date and remove restriction of nullable string-like types.
1889
1890         (NativeToJSValueDOMConvertNeedsState):
1891         Add Date to list of types needing state.
1892
1893         (NativeToJSValue):
1894         Remove special cases for Date and nullable-strings.
1895
1896         * bindings/scripts/IDLParser.pm:
1897         (parseOptionalIterableInterface):
1898         Add correct parsing of iterable.
1899
1900         * bindings/scripts/test/JS/JSTestIterable.cpp:
1901         * bindings/scripts/test/JS/JSTestNode.cpp:
1902         * bindings/scripts/test/JS/JSTestObj.cpp:
1903         Update test results.
1904
1905 2016-10-25  Eric Carlson  <eric.carlson@apple.com>
1906
1907         [MediaStream] Add "has capture device" bit to media state flags
1908         https://bugs.webkit.org/show_bug.cgi?id=163952
1909
1910         Reviewed by Jer Noble.
1911
1912         No new tests, updated fast/mediastream/MediaStream-page-muted.html and media/muted-video-is-playing-audio.html.
1913
1914         * Modules/mediastream/MediaStream.cpp:
1915         (WebCore::MediaStream::mediaState): Set HasMediaCaptureDevice, only set HasActiveMediaCaptureDevice when
1916           actually producing data.
1917
1918         * page/MediaProducer.h: Add HasMediaCaptureDevice bit.
1919
1920         * testing/Internals.cpp:
1921         (WebCore::Internals::pageMediaState): Return a string representing MediaStateFlags.
1922         (WebCore::Internals::isPagePlayingAudio): Deleted.
1923         * testing/Internals.h:
1924         * testing/Internals.idl:
1925
1926 2016-10-25  Brady Eidson  <beidson@apple.com>
1927
1928         IndexedDB 2.0: Support new IDBTransaction interfaces.
1929         <rdar://problem/28806928> and https://bugs.webkit.org/show_bug.cgi?id=163927
1930
1931         Reviewed by Sam Weinig.
1932
1933         Tests: storage/indexeddb/modern/idbtransaction-objectstores-1-private.html
1934                storage/indexeddb/modern/idbtransaction-objectstores-1.html
1935                At least partially passing results on 5 previously failed W3C tests.
1936
1937         The "new IDBTransaction interfaces" really just means adding the property IDBTransaction.objectStoreNames.
1938
1939         * Modules/indexeddb/IDBTransaction.cpp:
1940         (WebCore::IDBTransaction::objectStoreNames):
1941         * Modules/indexeddb/IDBTransaction.h:
1942         * Modules/indexeddb/IDBTransaction.idl:
1943
1944 2016-10-25  Youenn Fablet  <youenn@apple.com>
1945
1946         MediaEndpointConfiguration does not need to be refcounted
1947         https://bugs.webkit.org/show_bug.cgi?id=163888
1948
1949         Reviewed by Eric Carlson.
1950
1951         No change of behavior.
1952
1953         Updating MediaEndpoint to take a MediaEndpointConfiguration&& instead of a RefPtr<MediaEndpointConfiguration>&&.
1954         This allows ensuring that the configuration is not null and removes the need to ref-count it.
1955
1956         Removing ref-counting from MediaEndpointConfiguration and its related IceServer that is now a struct.
1957         Updated MediaEndpointOwr and mock implementations accordingly.
1958
1959         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
1960         (WebCore::MediaEndpointPeerConnection::setConfiguration):
1961         * platform/mediastream/MediaEndpoint.cpp:
1962         * platform/mediastream/MediaEndpoint.h:
1963         * platform/mediastream/MediaEndpointConfiguration.cpp:
1964         (WebCore::MediaEndpointConfiguration::MediaEndpointConfiguration):
1965         * platform/mediastream/MediaEndpointConfiguration.h:
1966         (WebCore::MediaEndpointConfiguration::iceServers):
1967         * platform/mediastream/openwebrtc/MediaEndpointOwr.cpp:
1968         (WebCore::MediaEndpointOwr::setConfiguration):
1969         (WebCore::MediaEndpointOwr::ensureTransportAgentAndTransceivers):
1970         * platform/mediastream/openwebrtc/MediaEndpointOwr.h:
1971         * platform/mock/MockMediaEndpoint.cpp:
1972         * platform/mock/MockMediaEndpoint.h:
1973
1974 2016-10-25  Youenn Fablet  <youenn@apple.com>
1975
1976         CachedResourceLoader should set headers of the HTTP request prior checking for the cache
1977         https://bugs.webkit.org/show_bug.cgi?id=163103
1978
1979         Reviewed by Darin Adler.
1980
1981         No expected change of behavior.
1982
1983         Moved referrer, user-agent, and origin headers setting to CachedResourceRequest/CachedResourceLoader before checking the cache.
1984         This allows simplifying vary header checks and is more inline with the fetch specification.
1985
1986         To compute the referrer value, we need to know whether the request is cross-origin.
1987         A helper function isRequestCrossOrigin is added for that purpose and is also used in CachedResource to set its initial response tainting.
1988
1989         We should disable setting user-agent and origin headers by FrameLoader for subresources since this is now done in CachedResourceLoader.
1990         This could be done as a follow-up patch.
1991
1992         * loader/cache/CachedResource.cpp:
1993         (WebCore::CachedResource::CachedResource):
1994         (WebCore::CachedResource::load):
1995         (WebCore::CachedResource::varyHeaderValuesMatch):
1996         (WebCore::addAdditionalRequestHeadersToRequest): Deleted.
1997         (WebCore::CachedResource::addAdditionalRequestHeaders): Deleted.
1998         * loader/cache/CachedResource.h:
1999         * loader/cache/CachedResourceLoader.cpp:
2000         (WebCore::CachedResourceLoader::updateHTTPRequestHeaders):
2001         (WebCore::CachedResourceLoader::requestResource):
2002         (WebCore::CachedResourceLoader::determineRevalidationPolicy):
2003         * loader/cache/CachedResourceLoader.h:
2004         * loader/cache/CachedResourceRequest.cpp:
2005         (WebCore::CachedResourceRequest::updateForAccessControl):
2006         (WebCore::CachedResourceRequest::updateReferrerOriginAndUserAgentHeaders):
2007         (WebCore::isRequestCrossOrigin):
2008         * loader/cache/CachedResourceRequest.h:
2009         (WebCore::CachedResourceRequest::setOrigin):
2010
2011 2016-10-25  Andreas Kling  <akling@apple.com>
2012
2013         More PassRefPtr purging in WebCore.
2014         <https://webkit.org/b/163895>
2015
2016         Reviewed by Antti Koivisto.
2017
2018         Remove PassRefPtr usage in RenderStyle, RenderTheme and Scrollbar, then fix up all the fallout.
2019
2020         * css/CSSComputedStyleDeclaration.cpp:
2021         (WebCore::contentToCSSValue):
2022         (WebCore::shapePropertyValue):
2023         (WebCore::ComputedStyleExtractor::propertyValue):
2024         * css/StyleBuilderConverter.h:
2025         (WebCore::StyleBuilderConverter::convertQuotes):
2026         * html/HTMLSelectElement.cpp:
2027         (WebCore::HTMLSelectElement::usesMenuList):
2028         (WebCore::HTMLSelectElement::platformHandleKeydownEvent):
2029         (WebCore::HTMLSelectElement::menuListDefaultEventHandler):
2030         * html/InputType.cpp:
2031         (WebCore::InputType::themeSupportsDataListUI):
2032         * html/TextFieldInputType.cpp:
2033         (WebCore::TextFieldInputType::shouldHaveSpinButton):
2034         (WebCore::TextFieldInputType::shouldHaveCapsLockIndicator):
2035         * loader/SubframeLoader.cpp:
2036         (WebCore::SubframeLoader::loadPlugin):
2037         * page/FrameView.cpp:
2038         (WebCore::FrameView::createScrollbar):
2039         * page/FrameView.h:
2040         * page/animation/CSSPropertyAnimation.cpp:
2041         (WebCore::RefCountedPropertyWrapper::RefCountedPropertyWrapper):
2042         (WebCore::PropertyWrapperClipPath::PropertyWrapperClipPath):
2043         (WebCore::PropertyWrapperShape::PropertyWrapperShape):
2044         (WebCore::StyleImagePropertyWrapper::StyleImagePropertyWrapper):
2045         (WebCore::FillLayerRefCountedPropertyWrapper::FillLayerRefCountedPropertyWrapper):
2046         (WebCore::FillLayerStyleImagePropertyWrapper::FillLayerStyleImagePropertyWrapper):
2047         * platform/PopupMenuClient.h:
2048         * platform/ScrollView.cpp:
2049         (WebCore::ScrollView::createScrollbar):
2050         * platform/ScrollView.h:
2051         * platform/Scrollbar.cpp:
2052         (WebCore::Scrollbar::createNativeScrollbar):
2053         * platform/Scrollbar.h:
2054         * rendering/FilterEffectRenderer.cpp:
2055         (WebCore::FilterEffectRenderer::buildReferenceFilter):
2056         * rendering/FilterEffectRenderer.h:
2057         * rendering/RenderLayer.cpp:
2058         (WebCore::RenderLayer::createScrollbar):
2059         (WebCore::RenderLayer::createLocalTransformState):
2060         (WebCore::RenderLayer::hitTestLayerByApplyingTransform):
2061         * rendering/RenderLayer.h:
2062         * rendering/RenderListBox.cpp:
2063         (WebCore::RenderListBox::createScrollbar):
2064         * rendering/RenderListBox.h:
2065         * rendering/RenderMenuList.cpp:
2066         (RenderMenuList::createScrollbar):
2067         * rendering/RenderMenuList.h:
2068         * rendering/RenderScrollbar.cpp:
2069         (WebCore::RenderScrollbar::createCustomScrollbar):
2070         * rendering/RenderScrollbar.h:
2071         * rendering/RenderSearchField.cpp:
2072         (WebCore::RenderSearchField::createScrollbar):
2073         * rendering/RenderSearchField.h:
2074         * rendering/RenderTheme.h:
2075         (WebCore::RenderTheme::defaultTheme):
2076         * rendering/RenderThemeEfl.cpp:
2077         (WebCore::RenderThemeEfl::create):
2078         (WebCore::RenderTheme::themeForPage):
2079         * rendering/RenderThemeEfl.h:
2080         * rendering/RenderThemeGtk.cpp:
2081         (WebCore::RenderTheme::themeForPage):
2082         * rendering/RenderThemeIOS.mm:
2083         (WebCore::RenderTheme::themeForPage):
2084         * rendering/RenderThemeMac.mm:
2085         (WebCore::RenderTheme::themeForPage):
2086         * rendering/RenderThemeWin.cpp:
2087         (WebCore::RenderTheme::themeForPage):
2088         * rendering/RenderWidget.cpp:
2089         (WebCore::RenderWidget::setWidget):
2090         * rendering/RenderWidget.h:
2091         * rendering/style/CursorData.h:
2092         (WebCore::CursorData::CursorData):
2093         (WebCore::CursorData::setImage):
2094         * rendering/style/FillLayer.h:
2095         (WebCore::FillLayer::setImage):
2096         * rendering/style/QuotesData.cpp:
2097         (WebCore::QuotesData::create):
2098         * rendering/style/QuotesData.h:
2099         * rendering/style/RenderStyle.cpp:
2100         (WebCore::RenderStyle::addCursor):
2101         (WebCore::RenderStyle::setCursorList):
2102         (WebCore::RenderStyle::setQuotes):
2103         (WebCore::RenderStyle::setWillChange):
2104         (WebCore::RenderStyle::setContent):
2105         (WebCore::RenderStyle::setListStyleImage):
2106         (WebCore::RenderStyle::setBorderImageSource):
2107         * rendering/style/RenderStyle.h:
2108         (WebCore::RenderStyle::setMaskImage):
2109         (WebCore::RenderStyle::setMaskBoxImageSource):
2110         (WebCore::RenderStyle::setBoxReflect):
2111         (WebCore::RenderStyle::setShapeOutside):
2112         (WebCore::RenderStyle::setClipPath):
2113         * rendering/style/StyleCachedImage.cpp:
2114         (WebCore::StyleCachedImage::cssValue):
2115         * rendering/style/StyleCachedImage.h:
2116         * rendering/style/StyleGeneratedImage.cpp:
2117         (WebCore::StyleGeneratedImage::cssValue):
2118         * rendering/style/StyleGeneratedImage.h:
2119         * rendering/style/StyleImage.h:
2120         * rendering/style/StyleMultiColData.h:
2121         * rendering/style/StyleRareInheritedData.h:
2122
2123 2016-10-24  Ryosuke Niwa  <rniwa@webkit.org>
2124
2125         Custom elements reactions should have a queue per element
2126         https://bugs.webkit.org/show_bug.cgi?id=163878
2127
2128         Reviewed by Antti Koivisto.
2129
2130         This patch splits the custom elements reaction queue into per element to match the latest HTML specifications:
2131         https://html.spec.whatwg.org/multipage/scripting.html#custom-element-reaction-queue
2132         and introduces the backup element queue:
2133         https://html.spec.whatwg.org/multipage/scripting.html#backup-element-queue
2134
2135         In terms of code changes, CustomElementReactionStack now holds onto ElementQueue, an ordered list of elements,
2136         and make each ElementRareData keep its own CustomElementReactionQueue. CustomElementReactionQueue is created
2137         for each custom element when it is synchronously constructed or enqueued to upgrade.
2138
2139         Because each reaction queue is now specific to each element, CustomElementReactionQueue instead of
2140         CustomElementReactionQueueItem stores JSCustomElementInterface.
2141
2142         The backup element queue is created as a singleton returned by CustomElementReactionStack's backupElementQueue,
2143         and ensureBackupQueue() schedules a new mirotask to process the backup queue when there isn't already one.
2144
2145         ensureCurrentQueue() now returns a reference to CustomElementReactionQueue instead of a pointer since it can
2146         fallback to the backup queue when the stack is empty as specified:
2147         https://html.spec.whatwg.org/multipage/scripting.html#enqueue-an-element-on-the-appropriate-element-queue
2148
2149         Note that ensureCurrentQueue() may insert the same element multiple times into the element queue for now since
2150         avoiding this duplication would require either doing O(n) iteration on m_elements or adding a HashSet.
2151         We can revisit this in the future if the reaction queue is found to grow beyond a few entries since elements in
2152         the element queue will have duplicates only when each reaction queue has more than one item.
2153
2154         Tests: fast/custom-elements/backup-element-queue.html
2155                fast/custom-elements/custom-element-reaction-queue.html
2156
2157         * bindings/js/JSCustomElementInterface.cpp:
2158         (WebCore::JSCustomElementInterface::upgradeElement):
2159         * dom/CustomElementReactionQueue.cpp:
2160         (WebCore::CustomElementReactionQueueItem::CustomElementReactionQueueItem):
2161         (WebCore::CustomElementReactionQueueItem::invoke): Removed the check for isFailedCustomElement since the queue
2162         is explicitly cleared in Element::setIsFailedCustomElement.
2163         (WebCore::CustomElementReactionQueue::CustomElementReactionQueue): Now takes JSCustomElementInterface since
2164         each item in the queue no longer stores Element or JSCustomElementInterface.
2165         (WebCore::CustomElementReactionQueue::clear):
2166         (WebCore::CustomElementReactionQueue::enqueueElementUpgrade):
2167         (WebCore::CustomElementReactionQueue::enqueueElementUpgradeIfDefined):
2168         (WebCore::CustomElementReactionQueue::enqueueConnectedCallbackIfNeeded):
2169         (WebCore::CustomElementReactionQueue::enqueueDisconnectedCallbackIfNeeded):
2170         (WebCore::CustomElementReactionQueue::enqueueAdoptedCallbackIfNeeded):
2171         (WebCore::CustomElementReactionQueue::enqueueAttributeChangedCallbackIfNeeded):
2172         (WebCore::CustomElementReactionQueue::enqueuePostUpgradeReactions):
2173         (WebCore::CustomElementReactionQueue::invokeAll):
2174         (WebCore::CustomElementReactionStack::ElementQueue::add): Added.
2175         (WebCore::CustomElementReactionStack::ElementQueue::invokeAll): Added.
2176         (WebCore::CustomElementReactionStack::ensureCurrentQueue):
2177         (WebCore::BackupElementQueueMicrotask): Added.
2178         (WebCore::CustomElementReactionStack::ensureBackupQueue): Added.
2179         (WebCore::CustomElementReactionStack::processBackupQueue): Added.
2180         (WebCore::CustomElementReactionStack::backupElementQueue): Added.
2181         * dom/CustomElementReactionQueue.h:
2182         * dom/CustomElementRegistry.cpp:
2183         (WebCore::enqueueUpgradeInShadowIncludingTreeOrder):
2184         * dom/Document.cpp:
2185         (WebCore::createFallbackHTMLElement):
2186         * dom/Element.cpp:
2187         (WebCore::Element::setIsDefinedCustomElement): Create a new reaction queue if there isn't already one; when
2188         this element had been upgraded, the reaction queue have already been created in Element::enqueueToUpgrade.
2189         (WebCore::Element::setIsFailedCustomElement): Clear the reaction queue when the upgrading had failed.
2190         (WebCore::Element::enqueueToUpgrade): Added.
2191         (WebCore::Element::reactionQueue): Added.
2192         * dom/Element.h:
2193         * dom/ElementRareData.h:
2194         (WebCore::ElementRareData::customElementReactionQueue): Replaced customElementInterface.
2195         (WebCore::ElementRareData::setCustomElementReactionQueue): Replaced setCustomElementReactionQueue.
2196
2197 2016-10-24  Jiewen Tan  <jiewen_tan@apple.com>
2198
2199         Update SubtleCrypto::generateKey to match the latest spec
2200         https://bugs.webkit.org/show_bug.cgi?id=163718
2201         <rdar://problem/28864380>
2202
2203         Reviewed by Chris Dumez.
2204
2205         This patch does following few things:
2206         1. It updates the SubtleCrypto::generateKey method to match the latest spec:
2207            https://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-generateKey.
2208            It also refers to the latest Editor's Draft at a certain degree:
2209            https://w3c.github.io/webcrypto/Overview.html#SubtleCrypto-method-generateKey.
2210         2. It implements generateKey operations of following algorithms: AES-CBC, AES-KW,
2211            HMAC, RSAES-PKCS1-V1_5, RSASSA-PKCS1-V1_5, and RSA-OAEP.
2212         3. It replaces SPECIALIZE_TYPE_TRAITS_CRYPTO_ALGORITHM_PARAMETERS with
2213         SPECIALIZE_TYPE_TRAITS_CRYPTO_ALGORITHM_PARAMETERS_DEPRECATED for deprecated params.
2214         4. It fixes https://bugs.webkit.org/show_bug.cgi?id=129750 as well.
2215
2216         Tests: crypto/subtle/aes-cbc-generate-key-length-128.html
2217                crypto/subtle/aes-cbc-generate-key-length-192.html
2218                crypto/subtle/aes-cbc-generate-key-length-256.html
2219                crypto/subtle/aes-generate-key-malformed-parameters.html
2220                crypto/subtle/aes-kw-generate-key.html
2221                crypto/subtle/generate-key-malformed-paramters.html
2222                crypto/subtle/hmac-generate-key-customized-length.html
2223                crypto/subtle/hmac-generate-key-hash-object.html
2224                crypto/subtle/hmac-generate-key-malformed-parameters.html
2225                crypto/subtle/hmac-generate-key-sha1.html
2226                crypto/subtle/hmac-generate-key-sha224.html
2227                crypto/subtle/hmac-generate-key-sha256.html
2228                crypto/subtle/hmac-generate-key-sha384.html
2229                crypto/subtle/hmac-generate-key-sha512.html
2230                crypto/subtle/rsa-generate-key-malformed-parameters.html
2231                crypto/subtle/rsa-oaep-generate-key.html
2232                crypto/subtle/rsaes-pkcs1-v1_5-generate-key-extractable.html
2233                crypto/subtle/rsaes-pkcs1-v1_5-generate-key.html
2234                crypto/subtle/rsassa-pkcs1-v1_5-generate-key.html
2235                crypto/webkitSubtle/hmac-generate-key.html:
2236                crypto/workers/subtle/aes-generate-key.html
2237                crypto/workers/subtle/hmac-generate-key.html
2238                crypto/workers/subtle/rsa-generate-key.html
2239
2240         * CMakeLists.txt:
2241         * DerivedSources.make:
2242         * Modules/encryptedmedia/CDMSessionClearKey.cpp:
2243         * WebCore.xcodeproj/project.pbxproj:
2244         * bindings/js/JSSubtleCryptoCustom.cpp: Added.
2245         (WebCore::toHashIdentifier):
2246         (WebCore::normalizeCryptoAlgorithmParameters):
2247         (WebCore::cryptoKeyUsagesFromJSValue):
2248         (WebCore::createAlgorithm):
2249         (WebCore::rejectWithException):
2250         (WebCore::jsSubtleCryptoFunctionGenerateKeyPromise):
2251         (WebCore::JSSubtleCrypto::generateKey):
2252         * bindings/js/JSWebKitSubtleCryptoCustom.cpp:
2253         (WebCore::JSWebKitSubtleCrypto::generateKey):
2254         * crypto/CryptoAlgorithm.cpp:
2255         (WebCore::CryptoAlgorithm::generateKey):
2256         * crypto/CryptoAlgorithm.h:
2257         * crypto/CryptoAlgorithmParameters.h: Added.
2258         (WebCore::CryptoAlgorithmParameters::CryptoAlgorithmParameters):
2259         (WebCore::CryptoAlgorithmParameters::~CryptoAlgorithmParameters):
2260         (WebCore::CryptoAlgorithmParameters::parametersClass):
2261         * crypto/CryptoAlgorithmParameters.idl: Added.
2262         * crypto/CryptoAlgorithmParametersDeprecated.h:
2263         * crypto/CryptoKey.cpp:
2264         (WebCore::CryptoKey::setUsagesBitmap):
2265         * crypto/CryptoKey.h:
2266         * crypto/CryptoKeyPair.idl:
2267         * crypto/SubtleCrypto.idl:
2268         * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
2269         (WebCore::CryptoAlgorithmAES_CBC::generateKey):
2270         * crypto/algorithms/CryptoAlgorithmAES_CBC.h:
2271         * crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
2272         (WebCore::CryptoAlgorithmAES_KW::generateKey):
2273         * crypto/algorithms/CryptoAlgorithmAES_KW.h:
2274         * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
2275         (WebCore::CryptoAlgorithmHMAC::generateKey):
2276         * crypto/algorithms/CryptoAlgorithmHMAC.h:
2277         * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
2278         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::generateKey):
2279         * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h:
2280         * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
2281         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::generateKey):
2282         * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h:
2283         * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
2284         (WebCore::CryptoAlgorithmRSA_OAEP::generateKey):
2285         * crypto/algorithms/CryptoAlgorithmRSA_OAEP.h:
2286         * crypto/gnutls/CryptoKeyRSAGnuTLS.cpp:
2287         (WebCore::CryptoKeyRSA::generatePair):
2288         * crypto/keys/CryptoKeyAES.cpp:
2289         (WebCore::CryptoKeyAES::generate):
2290         * crypto/keys/CryptoKeyHMAC.cpp:
2291         (WebCore::CryptoKeyHMAC::generate):
2292         * crypto/keys/CryptoKeyRSA.h:
2293         * crypto/mac/CryptoKeyRSAMac.cpp:
2294         (WebCore::CryptoKeyRSA::generatePair):
2295         * crypto/parameters/AesKeyGenParams.idl: Added.
2296         * crypto/parameters/CryptoAlgorithmAesCbcParamsDeprecated.h:
2297         * crypto/parameters/CryptoAlgorithmAesKeyGenParams.h: Added.
2298         * crypto/parameters/CryptoAlgorithmAesKeyGenParamsDeprecated.h:
2299         * crypto/parameters/CryptoAlgorithmHmacKeyGenParams.h: Added.
2300         * crypto/parameters/CryptoAlgorithmHmacKeyParamsDeprecated.h:
2301         * crypto/parameters/CryptoAlgorithmHmacParamsDeprecated.h:
2302         * crypto/parameters/CryptoAlgorithmRsaHashedKeyGenParams.h: Added.
2303         * crypto/parameters/CryptoAlgorithmRsaKeyGenParams.h: Added.
2304         (WebCore::CryptoAlgorithmRsaKeyGenParams::arrayToVector):
2305         * crypto/parameters/CryptoAlgorithmRsaKeyGenParamsDeprecated.h:
2306         * crypto/parameters/CryptoAlgorithmRsaKeyParamsWithHashDeprecated.h:
2307         * crypto/parameters/CryptoAlgorithmRsaOaepParamsDeprecated.h:
2308         * crypto/parameters/CryptoAlgorithmRsaSsaParamsDeprecated.h:
2309         * crypto/parameters/HmacKeyGenParams.idl: Added.
2310         * crypto/parameters/RsaHashedKeyGenParams.idl: Added.
2311         * crypto/parameters/RsaKeyGenParams.idl: Added.
2312
2313 2016-10-24  Chris Dumez  <cdumez@apple.com>
2314
2315         IDBDatabase.createObjectStore() should take a IDBObjectStoreParameters dictionary in parameter
2316         https://bugs.webkit.org/show_bug.cgi?id=163916
2317
2318         Reviewed by Darin Adler.
2319
2320         IDBDatabase.createObjectStore() should take a IDBObjectStoreParameters dictionary in parameter:
2321         - https://www.w3.org/TR/IndexedDB/#idl-def-IDBDatabase
2322         - https://www.w3.org/TR/IndexedDB/#idl-def-IDBObjectStoreParameters
2323
2324         Align our IDL with the specification.
2325
2326         No new tests, no expected Web-exposed behavior change.
2327
2328         * Modules/indexeddb/IDBDatabase.cpp:
2329         (WebCore::IDBDatabase::createObjectStore):
2330         * Modules/indexeddb/IDBDatabase.h:
2331         * Modules/indexeddb/IDBDatabase.idl:
2332         * Modules/indexeddb/IDBKeyPath.cpp:
2333         (WebCore::IDBKeyPath::IDBKeyPath):
2334         * Modules/indexeddb/IDBKeyPath.h:
2335         * WebCore.xcodeproj/project.pbxproj:
2336         * bindings/js/IDBBindingUtilities.cpp:
2337         (WebCore::idbKeyPathFromValue): Deleted.
2338         * bindings/js/IDBBindingUtilities.h:
2339         * bindings/js/JSIDBDatabaseCustom.cpp: Removed.
2340         * bindings/scripts/CodeGeneratorJS.pm:
2341         (GenerateParametersCheck):
2342         (GenerateConstructorDefinition):
2343         * dom/MessageEvent.cpp:
2344         (WebCore::MessageEvent::MessageEvent):
2345         (WebCore::MessageEvent::create):
2346         * dom/MessageEvent.h:
2347         * testing/TypeConversions.h:
2348         (WebCore::TypeConversions::setTypeConversionsDictionary):
2349
2350 2016-10-24  Alex Christensen  <achristensen@webkit.org>
2351
2352         URLParser should match old URL::parse with %2E in path
2353         https://bugs.webkit.org/show_bug.cgi?id=163929
2354
2355         Reviewed by Alexey Proskuryakov.
2356
2357         Covered by updated API tests, which show that URLParser now matches URL::parse in these cases.
2358         Also covered by newly failing web platform tests, which were failing before URLParser was enabled.
2359         If https://github.com/whatwg/url/issues/87 is resolved we can change behavior to match.
2360
2361         * platform/URLParser.cpp:
2362         (WebCore::URLParser::isSingleDotPathSegment):
2363         (WebCore::URLParser::isDoubleDotPathSegment):
2364         (WebCore::URLParser::consumeSingleDotPathSegment):
2365         (WebCore::URLParser::consumeDoubleDotPathSegment):
2366         (WebCore::URLParser::parse):
2367         (WebCore::URLParser::isPercentEncodedDot): Deleted.
2368
2369 2016-10-24  Zalan Bujtas  <zalan@apple.com>
2370
2371         Do not update selection rect on dirty lineboxes.
2372         https://bugs.webkit.org/show_bug.cgi?id=163862
2373         <rdar://problem/28813156>
2374
2375         Reviewed by Simon Fraser.
2376
2377         In certain cases RenderBlock::updateFirstLetter() triggers
2378         unwanted render tree mutation while the caller assumes intact renderers.
2379         This patch ensures that no renderers gets destroyed while computing the preferred widths
2380         when we are outside of layout context.
2381
2382         Test: fast/css-generated-content/dynamic-first-letter-selection-clear-crash.html
2383
2384         * rendering/RenderBlock.cpp:
2385         (WebCore::RenderBlock::computePreferredLogicalWidths):
2386         (WebCore::RenderBlock::updateFirstLetter):
2387         * rendering/RenderBlock.h:
2388         * rendering/RenderListItem.cpp:
2389         (WebCore::RenderListItem::insertOrMoveMarkerRendererIfNeeded):
2390         * rendering/RenderRubyRun.cpp:
2391         (WebCore::RenderRubyRun::updateFirstLetter):
2392         * rendering/RenderRubyRun.h:
2393         * rendering/RenderTable.cpp:
2394         (WebCore::RenderTable::updateFirstLetter):
2395         * rendering/RenderTable.h:
2396         * rendering/svg/RenderSVGText.cpp:
2397         (WebCore::RenderSVGText::updateFirstLetter):
2398         * rendering/svg/RenderSVGText.h:
2399
2400 2016-10-24  Ryan Haddad  <ryanhaddad@apple.com>
2401
2402         Unreviewed, rolling out r207795.
2403
2404         Introduced API test failures on iOS and macOS.
2405
2406         Reverted changeset:
2407
2408         "URLParser should match old URL::parse with %2E in path"
2409         https://bugs.webkit.org/show_bug.cgi?id=163929
2410         http://trac.webkit.org/changeset/207795
2411
2412 2016-10-24  Yusuke Suzuki  <utatane.tea@gmail.com>
2413
2414         Unreviewed, attempt to fix Windows build after r207787
2415         https://bugs.webkit.org/show_bug.cgi?id=163657
2416
2417         Make the constructor public in DOMJIT::AbstractHeapRepository to make Windows bot green.
2418         It's a bit unfortunate that we need to introduce a workaround here.
2419
2420         * domjit/DOMJITAbstractHeapRepository.h:
2421
2422 2016-10-24  Chris Dumez  <cdumez@apple.com>
2423
2424         event.(dataTransfer|clipboardData).getData('text/html') (onpaste, ondrop)
2425         https://bugs.webkit.org/show_bug.cgi?id=19893
2426         <rdar://problem/6055546>
2427
2428         Reviewed by Ryosuke Niwa.
2429
2430         We now write selection as HTML as well to the pasteboard so that
2431         event.(dataTransfer|clipboardData).getData('text/html') now works.
2432
2433         I have verified manually that it is still possible to copy text from
2434         Safari and paste it to Excel 2011 Mac after this change. The text is
2435         now pasted as HTML instead of text, which is fine because Excel can
2436         display HTML.
2437
2438         No new tests, unskipped existing tests.
2439
2440         * editing/Editor.h:
2441         * editing/mac/EditorMac.mm:
2442         (WebCore::Editor::selectionInHTMLFormat):
2443         (WebCore::Editor::writeSelectionToPasteboard):
2444         * platform/Pasteboard.h:
2445         * platform/mac/PasteboardMac.mm:
2446         (WebCore::Pasteboard::write):
2447
2448 2016-10-24  Alex Christensen  <achristensen@webkit.org>
2449
2450         URLParser should match old URL::parse with %2E in path
2451         https://bugs.webkit.org/show_bug.cgi?id=163929
2452
2453         Reviewed by Alexey Proskuryakov.
2454
2455         Covered by updated API tests, which show that URLParser now matches URL::parse in these cases.
2456         Also covered by newly failing web platform tests, which were failing before URLParser was enabled.
2457         If https://github.com/whatwg/url/issues/87 is resolved we can change behavior to match.
2458
2459         * platform/URLParser.cpp:
2460         (WebCore::URLParser::isSingleDotPathSegment):
2461         (WebCore::URLParser::isDoubleDotPathSegment):
2462         (WebCore::URLParser::consumeSingleDotPathSegment):
2463         (WebCore::URLParser::consumeDoubleDotPathSegment):
2464         (WebCore::URLParser::parse):
2465         (WebCore::URLParser::isPercentEncodedDot): Deleted.
2466
2467 2016-10-24  Per Arne Vollan  <pvollan@apple.com>
2468
2469         [Win] CMake build type is not set.
2470         https://bugs.webkit.org/show_bug.cgi?id=163917
2471
2472         Reviewed by Alex Christensen.
2473
2474         The CMAKE_BUILD_TYPE variable should be set to Debug or Release.
2475
2476         * WebCore.vcxproj/WebCore.proj:
2477
2478 2016-10-24  Yusuke Suzuki  <utatane.tea@gmail.com>
2479
2480         Unreviewed, attempt to fix Windows build after r207787
2481         https://bugs.webkit.org/show_bug.cgi?id=163657
2482
2483         According to the similar code in WebKit, I guess that
2484         Visual C++ requires friend class declaration is done
2485         in the private section to access private members.
2486
2487         And I also changed ::instance to ::shared to align to
2488         the existing WebCore code.
2489
2490         * domjit/DOMJITAbstractHeapRepository.cpp:
2491         (WebCore::DOMJIT::AbstractHeapRepository::shared):
2492         (WebCore::DOMJIT::AbstractHeapRepository::instance): Deleted.
2493         * domjit/DOMJITAbstractHeapRepository.h:
2494         * domjit/JSNodeDOMJIT.cpp:
2495         (WebCore::NodeFirstChildDOMJIT::callDOM):
2496         (WebCore::NodeLastChildDOMJIT::callDOM):
2497         (WebCore::NodeNextSiblingDOMJIT::callDOM):
2498         (WebCore::NodePreviousSiblingDOMJIT::callDOM):
2499         (WebCore::NodeParentNodeDOMJIT::callDOM):
2500
2501 2016-10-24  Simon Fraser  <simon.fraser@apple.com>
2502
2503         Fix the lifetime of strings used in LOG_WITH_STREAM
2504         https://bugs.webkit.org/show_bug.cgi?id=163923
2505
2506         Reviewed by Brent Fulgham.
2507
2508         Make sure the const char* passed to WTFLog() outlives the call.
2509
2510         Removed logFunctionResult which wasn't used anywhere else, and encourages this bad
2511         pattern.
2512
2513         * platform/LogMacros.h:
2514         * platform/Logging.cpp:
2515         (WebCore::logFunctionResult): Deleted.
2516
2517 2016-10-24  Chris Dumez  <cdumez@apple.com>
2518
2519         Reduce special handling for typed arrays in JSDOMConvert.h
2520         https://bugs.webkit.org/show_bug.cgi?id=163907
2521
2522         Reviewed by Sam Weinig.
2523
2524         Reduce special handling for typed arrays in JSDOMConvert.h by adding a toWrapped() static
2525         function on JSGenericTypedArrayView, similarly to other wrapper types.
2526
2527         No new tests, no web-exposed behavior change.
2528
2529         * bindings/js/JSDOMConvert.h:
2530         (WebCore::Converter<IDLInterface<JSC::GenericTypedArrayView<Adaptor>>>::convert): Deleted.
2531
2532 2016-10-24  Ryan Haddad  <ryanhaddad@apple.com>
2533
2534         Unreviewed, rolling out r207783.
2535
2536         This change appears to have caused fast/selectors/invalid-
2537         functional-pseudo-class.html to crash on iOS and macOS
2538
2539         Reverted changeset:
2540
2541         "[CSS Parser] Fix :lang argument parsing"
2542         https://bugs.webkit.org/show_bug.cgi?id=163913
2543         http://trac.webkit.org/changeset/207783
2544
2545 2016-10-24  Brady Eidson  <beidson@apple.com>
2546
2547         IndexedDB 2.0: Support new IDBKeyRange interfaces.
2548         <rdar://problem/28806929> and https://bugs.webkit.org/show_bug.cgi?id=163910
2549
2550         Reviewed by Andy Estes.
2551
2552         No new tests (Covered by additions to existing test)
2553
2554         The "new IDBKeyRanges interfaces" really just means adding the instance method IDBKeyRange.contains.
2555
2556         * Modules/indexeddb/IDBKeyRange.cpp:
2557         (WebCore::IDBKeyRange::contains):
2558         * Modules/indexeddb/IDBKeyRange.h:
2559         * Modules/indexeddb/IDBKeyRange.idl:
2560
2561 2016-10-23  Yusuke Suzuki  <utatane.tea@gmail.com>
2562
2563         [DOMJIT] Add a way for DOMJIT::Patchpoint to express effects
2564         https://bugs.webkit.org/show_bug.cgi?id=163657
2565
2566         Reviewed by Saam Barati.
2567
2568         CallDOMPatchpoint now has the way to tell its effects to DFG and FTL compilers.
2569         WebCore DOMJIT::AbstractHeapRepository will construct the hierarchy of the abstract
2570         heap. And then it encodes these information into the pairs of the integers.
2571
2572         And this patch also changes the DOMJIT::PatchpointParams' parameter order.
2573         So we change them in all the DOMJIT::CallDOMPatchpoint sites.
2574
2575         * CMakeLists.txt:
2576         * ForwardingHeaders/domjit/DOMJITAbstractHeap.h: Copied from Source/JavaScriptCore/domjit/DOMJITCallDOMPatchpoint.h.
2577         * ForwardingHeaders/domjit/DOMJITEffect.h: Copied from Source/JavaScriptCore/domjit/DOMJITCallDOMPatchpoint.h.
2578         * ForwardingHeaders/domjit/DOMJITHeapRange.h: Copied from Source/JavaScriptCore/domjit/DOMJITCallDOMPatchpoint.h.
2579         * WebCore.xcodeproj/project.pbxproj:
2580         * domjit/DOMJITAbstractHeapRepository.cpp: Copied from Source/JavaScriptCore/domjit/DOMJITCallDOMPatchpoint.h.
2581         (WebCore::DOMJIT::AbstractHeapRepository::AbstractHeapRepository):
2582         (WebCore::DOMJIT::AbstractHeapRepository::instance):
2583         * domjit/DOMJITAbstractHeapRepository.h: Copied from Source/JavaScriptCore/domjit/DOMJITCallDOMPatchpoint.h.
2584         * domjit/DOMJITHelpers.h:
2585         (WebCore::DOMJITHelpers::branchIfNotWorldIsNormal): Deleted.
2586         (WebCore::DOMJITHelpers::branchIfNotWeakIsLive): Deleted.
2587         (WebCore::DOMJITHelpers::tryLookUpWrapperCache): Deleted.
2588         (WebCore::DOMJITHelpers::toWrapper): Deleted.
2589         (WebCore::DOMJITHelpers::branchIfDOMWrapper): Deleted.
2590         (WebCore::DOMJITHelpers::branchIfNotDOMWrapper): Deleted.
2591         (WebCore::DOMJITHelpers::branchIfNode): Deleted.
2592         (WebCore::DOMJITHelpers::branchIfNotNode): Deleted.
2593         (WebCore::DOMJITHelpers::branchIfElement): Deleted.
2594         (WebCore::DOMJITHelpers::branchIfNotElement): Deleted.
2595         (WebCore::DOMJITHelpers::branchIfDocumentWrapper): Deleted.
2596         (WebCore::DOMJITHelpers::branchIfNotDocumentWrapper): Deleted.
2597         * domjit/JSNodeDOMJIT.cpp:
2598         (WebCore::createCallDOMForOffsetAccess):
2599         (WebCore::checkNode):
2600         (WebCore::NodeFirstChildDOMJIT::checkDOM):
2601         (WebCore::NodeFirstChildDOMJIT::callDOM):
2602         (WebCore::NodeLastChildDOMJIT::checkDOM):
2603         (WebCore::NodeLastChildDOMJIT::callDOM):
2604         (WebCore::NodeNextSiblingDOMJIT::checkDOM):
2605         (WebCore::NodeNextSiblingDOMJIT::callDOM):
2606         (WebCore::NodePreviousSiblingDOMJIT::checkDOM):
2607         (WebCore::NodePreviousSiblingDOMJIT::callDOM):
2608         (WebCore::NodeParentNodeDOMJIT::checkDOM):
2609         (WebCore::NodeParentNodeDOMJIT::callDOM):
2610         (WebCore::NodeNodeTypeDOMJIT::checkDOM):
2611         (WebCore::NodeNodeTypeDOMJIT::callDOM):
2612
2613 2016-10-24  Dave Hyatt  <hyatt@apple.com>
2614
2615         [CSS Parser] Fix :lang argument parsing
2616         https://bugs.webkit.org/show_bug.cgi?id=163913
2617
2618         Reviewed by Zalan Bujtas.
2619
2620         * css/SelectorPseudoClassAndCompatibilityElementMap.in:
2621         Modify the map to support versions of the function pseudos
2622         without the left paren included.
2623
2624         * css/parser/CSSParserValues.cpp:
2625         (WebCore::CSSParserSelector::setLangArgumentList):
2626         * css/parser/CSSParserValues.h:
2627         Add a helper to just directly pass an AtomicString Vector through.
2628
2629         * css/parser/CSSSelectorParser.cpp:
2630         (WebCore::consumeLangArgumentList):
2631         (WebCore::CSSSelectorParser::consumePseudo):
2632         Add a new consumeLangArgumentList to collect the languages into
2633         an AtomicString Vector.
2634
2635 2016-10-24  Alex Christensen  <achristensen@webkit.org>
2636
2637         Fix AppleWin build after r207720.
2638
2639         * html/canvas/OESVertexArrayObject.cpp:
2640
2641 2016-10-24  Alex Christensen  <achristensen@webkit.org>
2642
2643         Fix AppleWin build after r207720.
2644
2645         * bindings/js/JSWebGLRenderingContextBaseCustom.cpp:
2646
2647 2016-10-24  Alex Christensen  <achristensen@webkit.org>
2648
2649         Fix Windows build after r207767 and r207769
2650
2651         * css/CSSAllInOne.cpp:
2652         * platform/network/curl/ResourceHandleManager.cpp:
2653         (WebCore::getProtectionSpace):
2654
2655 2016-10-24  Per Arne Vollan  <pvollan@apple.com>
2656
2657         [Win] AVCF based media engine does not block cross-site/cross-domain loads.
2658         https://bugs.webkit.org/show_bug.cgi?id=163783
2659
2660         Reviewed by Brent Fulgham.
2661
2662         Prevent cross-site/cross-domain loads by setting appropriate AVCF options.
2663
2664         No new tests; covered by media/video-canvas-source.html. Media tests are
2665         currently skipped on Windows.
2666
2667         * platform/graphics/avfoundation/cf/AVFoundationCFSoftLinking.h:
2668         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
2669         (WebCore::MediaPlayerPrivateAVFoundationCF::resolvedURL):
2670         (WebCore::MediaPlayerPrivateAVFoundationCF::hasSingleSecurityOrigin):
2671         (WebCore::AVFWrapper::createAssetForURL):
2672         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h:
2673
2674 2016-10-24  Anders Carlsson  <andersca@apple.com>
2675
2676         Fix build with newer versions of clang
2677         https://bugs.webkit.org/show_bug.cgi?id=163908
2678         rdar://problem/28852016
2679
2680         Reviewed by Tim Horton.
2681
2682         Use the macros that names the soft-linked functions in such a way that they won't conflict with actual functions.
2683
2684         * platform/ios/PlatformScreenIOS.mm:
2685         (WebCore::screenIsMonochrome):
2686         (WebCore::screenHasInvertedColors):
2687         (WebCore::screenSize):
2688         (WebCore::availableScreenSize):
2689         (WebCore::screenScaleFactor):
2690
2691 2016-10-24  Joseph Pecoraro  <pecoraro@apple.com>
2692
2693         Remove unnecessary unused variable stubs
2694         https://bugs.webkit.org/show_bug.cgi?id=163688
2695
2696         Reviewed by Simon Fraser.
2697
2698         * Modules/applepay/cocoa/PaymentCocoa.mm:
2699         (WebCore::toDictionary):
2700         * Modules/applepay/cocoa/PaymentContactCocoa.mm:
2701         (WebCore::toDictionary):
2702
2703 2016-10-24  Alex Christensen  <achristensen@webkit.org>
2704
2705         Try to fix Windows build after r207767
2706         https://bugs.webkit.org/show_bug.cgi?id=163891
2707
2708         * DerivedSources.cpp:
2709
2710 2016-10-24  Zan Dobersek  <zdobersek@igalia.com>
2711
2712         [CodeGenerator] Only allow a single interface or standalone dictionary per WebIDL file
2713         https://bugs.webkit.org/show_bug.cgi?id=163889
2714
2715         Reviewed by Chris Dumez.
2716
2717         Assert that there's only one interface or standalone dictionary
2718         per WebIDL input file, and exit from the generator otherwise.
2719
2720         This avoids potential linking issues where multiple enumeration
2721         and dictionary bindings code can be generated if the source
2722         WebIDL for them is specified in a file that contains multiple
2723         interfaces or standalone dictionaries.
2724
2725         Additionally, the generator now also exits if it fails to
2726         generate code for any interface of standalone dictionary. This
2727         should avoid processing WebIDL files that are empty in
2728         substance.
2729
2730         TestException.idl and TestInterface.idl files have their second
2731         interfaces removed. In place of those a new testing IDL file is
2732         added, TestInterfaceLeadingUnderscore.idl. Like the two removed
2733         interfaces, it tests that the leading underscode in the
2734         identifier is removed by the generator.
2735
2736         * bindings/scripts/CodeGenerator.pm:
2737         (ProcessDocument):
2738         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp: Added.
2739         (WebCore::JSTestInterfaceLeadingUnderscorePrototype::create):
2740         (WebCore::JSTestInterfaceLeadingUnderscorePrototype::createStructure):
2741         (WebCore::JSTestInterfaceLeadingUnderscorePrototype::JSTestInterfaceLeadingUnderscorePrototype):
2742         (WebCore::JSTestInterfaceLeadingUnderscoreConstructor::prototypeForStructure):
2743         (WebCore::JSTestInterfaceLeadingUnderscoreConstructor::initializeProperties):
2744         (WebCore::JSTestInterfaceLeadingUnderscorePrototype::finishCreation):
2745         (WebCore::JSTestInterfaceLeadingUnderscore::JSTestInterfaceLeadingUnderscore):
2746         (WebCore::JSTestInterfaceLeadingUnderscore::createPrototype):
2747         (WebCore::JSTestInterfaceLeadingUnderscore::prototype):
2748         (WebCore::JSTestInterfaceLeadingUnderscore::destroy):
2749         (WebCore::BindingCaller<JSTestInterfaceLeadingUnderscore>::castForAttribute):
2750         (WebCore::jsTestInterfaceLeadingUnderscoreReadonly):
2751         (WebCore::jsTestInterfaceLeadingUnderscoreReadonlyGetter):
2752         (WebCore::jsTestInterfaceLeadingUnderscoreConstructor):
2753         (WebCore::setJSTestInterfaceLeadingUnderscoreConstructor):
2754         (WebCore::JSTestInterfaceLeadingUnderscore::getConstructor):
2755         (WebCore::JSTestInterfaceLeadingUnderscoreOwner::isReachableFromOpaqueRoots):
2756         (WebCore::JSTestInterfaceLeadingUnderscoreOwner::finalize):
2757         (WebCore::toJSNewlyCreated):
2758         (WebCore::toJS):
2759         (WebCore::JSTestInterfaceLeadingUnderscore::toWrapped):
2760         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.h: Renamed from Source/WebCore/bindings/scripts/test/JS/JSreadonly.h.
2761         (WebCore::JSTestInterfaceLeadingUnderscore::create):
2762         (WebCore::JSTestInterfaceLeadingUnderscore::createStructure):
2763         (WebCore::JSTestInterfaceLeadingUnderscore::finishCreation):
2764         (WebCore::wrapperOwner):
2765         (WebCore::wrapperKey):
2766         (WebCore::toJS):
2767         (WebCore::toJSNewlyCreated):
2768         * bindings/scripts/test/JS/JSattribute.cpp: Removed.
2769         * bindings/scripts/test/JS/JSattribute.h: Removed.
2770         * bindings/scripts/test/JS/JSreadonly.cpp: Removed.
2771         * bindings/scripts/test/TestException.idl:
2772         * bindings/scripts/test/TestInterface.idl:
2773         * bindings/scripts/test/TestInterfaceLeadingUnderscore.idl: Copied from Source/WebCore/bindings/scripts/test/TestException.idl.
2774
2775 2016-10-21  Alex Christensen  <achristensen@webkit.org>
2776
2777         URL::port should return Optional<uint16_t>
2778         https://bugs.webkit.org/show_bug.cgi?id=163806
2779
2780         Reviewed by Darin Adler.
2781
2782         A URL without a port is different than a URL with port 0.
2783         This matches the spec, Chrome, and Firefox.
2784
2785         Covered by newly-passing web platform tests.
2786
2787         * Modules/indexeddb/IDBDatabaseIdentifier.h:
2788         (WebCore::IDBDatabaseIdentifier::IDBDatabaseIdentifier):
2789         (WebCore::IDBDatabaseIdentifier::isHashTableDeletedValue):
2790         (WebCore::IDBDatabaseIdentifier::hash):
2791         (WebCore::IDBDatabaseIdentifier::isValid):
2792         (WebCore::IDBDatabaseIdentifier::isEmpty):
2793         * Modules/websockets/WebSocket.cpp:
2794         (WebCore::WebSocket::connect):
2795         * Modules/websockets/WebSocketHandshake.cpp:
2796         (WebCore::hostName):
2797         * contentextensions/ContentExtensionsBackend.cpp:
2798         (WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForLoad):
2799         (WebCore::ContentExtensions::applyBlockedStatusToRequest):
2800         * html/HTMLPlugInImageElement.cpp:
2801         (WebCore::HTMLPlugInImageElement::userDidClickSnapshot):
2802         (WebCore::HTMLPlugInImageElement::subframeLoaderWillCreatePlugIn):
2803         * html/URLUtils.h:
2804         (WebCore::URLUtils<T>::protocol):
2805         (WebCore::URLUtils<T>::host):
2806         (WebCore::URLUtils<T>::port):
2807         * loader/CrossOriginAccessControl.cpp:
2808         (WebCore::isValidCrossOriginRedirectionURL):
2809         * loader/DocumentLoader.cpp:
2810         (WebCore::DocumentLoader::responseReceived):
2811         (WebCore::isRemoteWebArchive):
2812         (WebCore::DocumentLoader::maybeLoadEmpty):
2813         * loader/DocumentThreadableLoader.cpp:
2814         (WebCore::DocumentThreadableLoader::makeSimpleCrossOriginAccessRequest):
2815         * loader/ResourceLoader.cpp:
2816         (WebCore::ResourceLoader::didReceiveResponse):
2817         * loader/cache/CachedResource.cpp:
2818         (WebCore::shouldCacheSchemeIndefinitely):
2819         (WebCore::CachedResource::freshnessLifetime):
2820         * page/Location.cpp:
2821         (WebCore::Location::protocol):
2822         (WebCore::Location::host):
2823         (WebCore::Location::port):
2824         * page/Page.cpp:
2825         (WebCore::Page::userStyleSheetLocationChanged):
2826         * page/SecurityOrigin.cpp:
2827         (WebCore::shouldTreatAsUniqueOrigin):
2828         (WebCore::SecurityOrigin::SecurityOrigin):
2829         (WebCore::SecurityOrigin::isSecure):
2830         (WebCore::SecurityOrigin::canDisplay):
2831         (WebCore::SecurityOrigin::toRawString):
2832         (WebCore::SecurityOrigin::create):
2833         (WebCore::SecurityOrigin::databaseIdentifier):
2834         * page/SecurityOrigin.h:
2835         (WebCore::SecurityOrigin::port):
2836         * page/SecurityOriginData.cpp:
2837         (WebCore::SecurityOriginData::debugString):
2838         * page/SecurityOriginData.h:
2839         (): Deleted.
2840         * page/SecurityOriginHash.h:
2841         (WebCore::SecurityOriginHash::hash):
2842         * page/csp/ContentSecurityPolicy.cpp:
2843         (WebCore::ContentSecurityPolicy::allowObjectFromSource):
2844         (WebCore::ContentSecurityPolicy::allowChildFrameFromSource):
2845         (WebCore::ContentSecurityPolicy::allowResourceFromSource):
2846         (WebCore::ContentSecurityPolicy::allowConnectToSource):
2847         (WebCore::ContentSecurityPolicy::allowBaseURI):
2848         (WebCore::stripURLForUseInReport):
2849         (WebCore::ContentSecurityPolicy::upgradeInsecureRequestIfNeeded):
2850         * page/csp/ContentSecurityPolicySource.cpp:
2851         (WebCore::ContentSecurityPolicySource::ContentSecurityPolicySource):
2852         (WebCore::ContentSecurityPolicySource::portMatches):
2853         * page/csp/ContentSecurityPolicySource.h:
2854         * page/csp/ContentSecurityPolicySourceList.cpp:
2855         (WebCore::ContentSecurityPolicySourceList::parse):
2856         (WebCore::ContentSecurityPolicySourceList::parseSource):
2857         (WebCore::ContentSecurityPolicySourceList::parsePort):
2858         * page/csp/ContentSecurityPolicySourceList.h:
2859         * platform/SchemeRegistry.h:
2860         * platform/URL.cpp:
2861         (WebCore::URL::protocol):
2862         (WebCore::URL::port):
2863         (WebCore::URL::serialize):
2864         (WebCore::portAllowed):
2865         (WebCore::defaultPortsMap): Deleted.
2866         (WebCore::defaultPortForProtocol): Deleted.
2867         (WebCore::isDefaultPortForProtocol): Deleted.
2868         * platform/URL.h:
2869         (WebCore::URL::hasPort): Deleted.
2870         * platform/URLParser.cpp:
2871         (WebCore::defaultPortForProtocol):
2872         (WebCore::isDefaultPortForProtocol):
2873         (WebCore::URLParser::parsePort):
2874         (WebCore::isDefaultPort): Deleted.
2875         * platform/network/CredentialStorage.cpp:
2876         (WebCore::originStringFromURL):
2877         * platform/network/ResourceHandle.cpp:
2878         (WebCore::ResourceHandle::create):
2879         (WebCore::ResourceHandle::loadResourceSynchronously):
2880         * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
2881         (WebCore::SocketStreamHandleImpl::platformClose):
2882         (WebCore::SocketStreamHandleImpl::port):
2883         * workers/WorkerLocation.cpp:
2884         (WebCore::WorkerLocation::protocol):
2885         (WebCore::WorkerLocation::host):
2886         (WebCore::WorkerLocation::port):
2887
2888 2016-10-24  Zan Dobersek  <zdobersek@igalia.com>
2889
2890         [CodeGeneratorJS] Support enums for standalone dictionaries
2891         https://bugs.webkit.org/show_bug.cgi?id=163885
2892
2893         Reviewed by Youenn Fablet.
2894
2895         Add support for enumerations in WebIDL files that specify
2896         standalone dictionaries. Implementation of this is pretty
2897         straight-forward and mirrors interface and callback generators
2898         by calling GenerateEnumerations{Header,Implementation}Content()
2899         functions in GenerateDictionary{Header,Implementation}().
2900
2901         In GenerateEnumerationsImplementationContent(), the
2902         NeverDestroyed.h header is added to the implementation includes
2903         since that class is used to hold an array of possible enum
2904         values.
2905
2906         A test enum is added to the TestStandaloneDictionary.idl file
2907         and the baselines are updated to reflect the new capability.
2908
2909         * bindings/scripts/CodeGenerator.pm:
2910         (ProcessDocument):
2911         * bindings/scripts/CodeGeneratorJS.pm:
2912         (GenerateDictionary):
2913         (GenerateEnumerationsImplementationContent):
2914         (GenerateDictionaryHeader):
2915         (GenerateDictionaryImplementation):
2916         * bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
2917         (WebCore::convertEnumerationToJS):
2918         (WebCore::parseEnumeration<TestStandaloneDictionary::EnumInStandaloneDictionaryFile>):
2919         (WebCore::convertEnumeration<TestStandaloneDictionary::EnumInStandaloneDictionaryFile>):
2920         (WebCore::expectedEnumerationValues<TestStandaloneDictionary::EnumInStandaloneDictionaryFile>):
2921         (WebCore::convertDictionary<DictionaryImplName>):
2922         * bindings/scripts/test/JS/JSTestStandaloneDictionary.h:
2923         * bindings/scripts/test/TestStandaloneDictionary.idl:
2924
2925 2016-10-24  Dave Hyatt  <hyatt@apple.com>
2926
2927         Remove CSSCharsetRule from the CSS OM
2928         https://bugs.webkit.org/show_bug.cgi?id=163891
2929
2930         Reviewed by Darin Adler.
2931
2932         Remove CSSCharsetRule from the CSS OM. All other browser engines have made this
2933         change. This eliminates the weird overloading of isCharsetRule to match both
2934         CSSCharsetRule and StyleRuleCharset (only used by the new parser).
2935
2936         Fix the destroy() method in StyleRuleBase to clean up StyleRuleCharsets created
2937         by the new parser properly.
2938
2939         * CMakeLists.txt:
2940         * DerivedSources.make:
2941         * WebCore.xcodeproj/project.pbxproj:
2942         * bindings/js/JSCSSRuleCustom.cpp:
2943         (WebCore::toJSNewlyCreated):
2944         * css/CSSCharsetRule.cpp: Removed.
2945         * css/CSSCharsetRule.h: Removed.
2946         * css/CSSCharsetRule.idl: Removed.
2947         * css/CSSPropertySourceData.h:
2948         * css/CSSStyleSheet.cpp:
2949         (WebCore::CSSStyleSheet::item):
2950         (WebCore::CSSStyleSheet::rules):
2951         * css/CSSStyleSheet.h:
2952         * css/StyleRule.cpp:
2953         (WebCore::StyleRuleBase::destroy):
2954         * inspector/InspectorStyleSheet.cpp:
2955         (WebCore::asCSSRuleList):
2956
2957 2016-10-24  Zan Dobersek  <zdobersek@igalia.com>
2958
2959         [CodeGeneratorJS] Standalone dictionaries have misplaced build guards
2960         https://bugs.webkit.org/show_bug.cgi?id=163881
2961
2962         Reviewed by Chris Dumez.
2963
2964         Build guards that are generated from the Conditional attribute
2965         on WebIDL dictionary declarations properly guard the relevant
2966         convertDictionary() functions for WebIDL files that also specify
2967         interfaces. But for standalone dictionaries these build guards
2968         should guard the complete header and implementation files, much
2969         like this is done for files that originate from interfaces or
2970         callbacks.
2971
2972         Before this patch, guarding a standalone dictionary resulted in
2973         malformed output because GenerateHeaderContentHeader() and
2974         GenerateImplementationContentHeader() functions both generated
2975         the #if macro that would guard the whole file, but
2976         GenerateDictionary{Header,Implementation}() didn't generate the
2977         closing #endif.
2978
2979         CodeGeneratorJS.pm now passes the conditional string, if any,
2980         to GenerateDictionary{Header,Implementation}Content() functions
2981         in case of a non-standalone dictionary. Otherwise, the
2982         conditional string, if any, is used to guard the complete
2983         header and implementation files.
2984
2985         Generator tests are updated to cover various build guard
2986         combinations on dictionaries in TestObj.idl, and the standalone
2987         dictionary WebIDL file now has a Conditional attribute to check
2988         that the build guards cover complete generated header and
2989         implementation files.
2990
2991         * bindings/scripts/CodeGeneratorJS.pm:
2992         (GenerateDictionaryHeaderContent):
2993         (GenerateDictionariesHeaderContent):
2994         (GenerateDictionaryImplementationContent):
2995         (GenerateDictionariesImplementationContent):
2996         (GenerateDictionaryHeader):
2997         (GenerateDictionaryImplementation):
2998         * bindings/scripts/test/JS/JSTestObj.cpp:
2999         (WebCore::convertDictionary<TestObj::ConditionalDictionaryA>):
3000         (WebCore::convertDictionary<TestObj::ConditionalDictionaryB>):
3001         (WebCore::convertDictionary<TestObj::ConditionalDictionaryC>):
3002         * bindings/scripts/test/JS/JSTestObj.h:
3003         * bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
3004         * bindings/scripts/test/JS/JSTestStandaloneDictionary.h:
3005         * bindings/scripts/test/TestObj.idl:
3006         * bindings/scripts/test/TestStandaloneDictionary.idl:
3007
3008 2016-10-24  Eric Carlson  <eric.carlson@apple.com>
3009
3010         [MediaStream] Separate media capture and audio playback muting
3011         https://bugs.webkit.org/show_bug.cgi?id=163855
3012         <rdar://problem/28827186>
3013
3014         Reviewed by Darin Adler.
3015
3016         Test: fast/mediastream/MediaStream-page-muted.html
3017
3018         Change page.muted from a bool to a bitfield so audio and media capture muted are independent.
3019         Fix a couple of bugs in the mock media capture device uncovered by new test case.
3020         
3021         * Modules/mediastream/MediaStream.cpp:
3022         (WebCore::MediaStream::pageMutedStateDidChange): page.isMuted -> page.mutedState.
3023
3024         * Modules/webaudio/AudioContext.cpp:
3025         (WebCore::AudioContext::pageMutedStateDidChange): Ditto.
3026
3027         * html/HTMLMediaElement.cpp:
3028         (WebCore::HTMLMediaElement::updateVolume): Ditto.
3029         (WebCore::HTMLMediaElement::effectiveMuted): Ditto.
3030
3031         * page/MediaProducer.h: Add MutedState enum.
3032
3033         * page/Page.cpp:
3034         (WebCore::Page::Page):
3035         (WebCore::Page::setMuted): Take MutedStateFlags instead of bool. m_muted -> m_mutedState.
3036         * page/Page.h:
3037
3038         * platform/mock/MockRealtimeMediaSource.cpp:
3039         (WebCore::MockRealtimeMediaSource::startProducingData): Call setMuted.
3040         (WebCore::MockRealtimeMediaSource::stopProducingData): Ditto.
3041         * platform/mock/MockRealtimeMediaSource.h:
3042
3043         * platform/mock/MockRealtimeVideoSource.cpp:
3044         (WebCore::MockRealtimeVideoSource::stopProducingData): Call correct base class method.
3045
3046         * testing/Internals.cpp:
3047         (WebCore::Internals::setPageMuted): Change parameter from a bool to a string.
3048         * testing/Internals.h:
3049
3050         * testing/Internals.idl:
3051
3052 2016-10-24  Darin Adler  <darin@apple.com>
3053
3054         Try to fix Windows build.
3055
3056         * bindings/js/JSWebGL2RenderingContextCustom.cpp: Rearranged includes
3057         so they are inside the conditional as they should be.
3058
3059 2016-10-24  Youenn Fablet  <youenn@apple.com>
3060
3061         Activate WEB_RTC compilation flags for Mac bots
3062         https://bugs.webkit.org/show_bug.cgi?id=163886
3063
3064         Reviewed by Eric Carlson.
3065
3066         Covered by existing tests.
3067
3068         Fixing compilation errors due to missing WEBCORE_EXPORT, missing method and missing override keywords.
3069
3070         * Configurations/FeatureDefines.xcconfig:
3071         * DerivedSources.make:
3072         * Modules/mediastream/MediaEndpointPeerConnection.h:
3073         * Modules/mediastream/RTCPeerConnection.h:
3074         * Modules/mediastream/RTCPeerConnection.idl:
3075         * Modules/mediastream/SDPProcessor.cpp:
3076         (WebCore::SDPProcessor::generate):
3077         (WebCore::SDPProcessor::parse):
3078         * WebCore.xcodeproj/project.pbxproj:
3079         * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
3080         (WebCore::MockRealtimeVideoSource::createMuted):
3081
3082 2016-10-24  Brady Eidson  <beidson@apple.com>
3083
3084         IndexedDB 2.0: Support IDBIndex name assignment.
3085         <rdar://problem/28806932> and https://bugs.webkit.org/show_bug.cgi?id=163805
3086
3087         Reviewed by Alex Christensen.
3088
3089         Tests: storage/indexeddb/modern/index-rename-1-private.html
3090                storage/indexeddb/modern/index-rename-1.html
3091
3092         Touches a *lot* of code sites, but none of them are particularly interesting.
3093         They are all just getting the new name spread out to all of the various objects that need it.
3094
3095         * Modules/indexeddb/IDBDatabase.cpp:
3096         (WebCore::IDBDatabase::renameIndex):
3097         * Modules/indexeddb/IDBDatabase.h:
3098
3099         * Modules/indexeddb/IDBIndex.cpp:
3100         (WebCore::IDBIndex::IDBIndex):
3101         (WebCore::IDBIndex::setName):
3102         (WebCore::IDBIndex::rollbackInfoForVersionChangeAbort):
3103         * Modules/indexeddb/IDBIndex.h:
3104         * Modules/indexeddb/IDBIndex.idl:
3105
3106         * Modules/indexeddb/IDBObjectStore.cpp:
3107         (WebCore::IDBObjectStore::rollbackForVersionChangeAbort):
3108         (WebCore::IDBObjectStore::renameReferencedIndex):
3109         (WebCore::IDBObjectStore::rollbackInfoForVersionChangeAbort): Deleted.
3110         * Modules/indexeddb/IDBObjectStore.h:
3111
3112         * Modules/indexeddb/IDBTransaction.cpp:
3113         (WebCore::IDBTransaction::internalAbort):
3114         (WebCore::IDBTransaction::renameIndex):
3115         (WebCore::IDBTransaction::renameIndexOnServer):
3116         (WebCore::IDBTransaction::didRenameIndexOnServer):
3117         * Modules/indexeddb/IDBTransaction.h:
3118
3119         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
3120         (WebCore::IDBClient::IDBConnectionProxy::renameIndex):
3121         * Modules/indexeddb/client/IDBConnectionProxy.h:
3122
3123         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
3124         (WebCore::IDBClient::IDBConnectionToServer::renameIndex):
3125         (WebCore::IDBClient::IDBConnectionToServer::didRenameIndex):
3126         * Modules/indexeddb/client/IDBConnectionToServer.h:
3127         * Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
3128
3129         * Modules/indexeddb/client/TransactionOperation.h:
3130         (WebCore::IDBClient::createTransactionOperation):
3131
3132         * Modules/indexeddb/server/IDBBackingStore.h:
3133
3134         * Modules/indexeddb/server/IDBConnectionToClient.cpp:
3135         (WebCore::IDBServer::IDBConnectionToClient::didRenameIndex):
3136         * Modules/indexeddb/server/IDBConnectionToClient.h:
3137         * Modules/indexeddb/server/IDBConnectionToClientDelegate.h:
3138
3139         * Modules/indexeddb/server/IDBServer.cpp:
3140         (WebCore::IDBServer::IDBServer::renameIndex):
3141         * Modules/indexeddb/server/IDBServer.h:
3142
3143         * Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
3144         (WebCore::IDBServer::MemoryBackingStoreTransaction::indexRenamed):
3145         (WebCore::IDBServer::MemoryBackingStoreTransaction::abort):
3146         * Modules/indexeddb/server/MemoryBackingStoreTransaction.h:
3147
3148         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
3149         (WebCore::IDBServer::MemoryIDBBackingStore::renameIndex):
3150         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
3151
3152         * Modules/indexeddb/server/MemoryIndex.h:
3153         (WebCore::IDBServer::MemoryIndex::rename):
3154
3155         * Modules/indexeddb/server/MemoryObjectStore.cpp:
3156         (WebCore::IDBServer::MemoryObjectStore::renameIndex):
3157         * Modules/indexeddb/server/MemoryObjectStore.h:
3158
3159         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
3160         (WebCore::IDBServer::SQLiteIDBBackingStore::renameIndex):
3161         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
3162
3163         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
3164         (WebCore::IDBServer::UniqueIDBDatabase::renameIndex):
3165         (WebCore::IDBServer::UniqueIDBDatabase::performRenameIndex):
3166         (WebCore::IDBServer::UniqueIDBDatabase::didPerformRenameIndex):
3167         * Modules/indexeddb/server/UniqueIDBDatabase.h:
3168
3169         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
3170         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didRenameIndex):
3171         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.h:
3172
3173         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
3174         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::renameIndex):
3175         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
3176
3177         * Modules/indexeddb/shared/IDBIndexInfo.h:
3178         (WebCore::IDBIndexInfo::rename):
3179
3180         * Modules/indexeddb/shared/IDBObjectStoreInfo.cpp:
3181         (WebCore::IDBObjectStoreInfo::infoForExistingIndex):
3182         * Modules/indexeddb/shared/IDBObjectStoreInfo.h:
3183
3184         * Modules/indexeddb/shared/IDBResultData.cpp:
3185         (WebCore::IDBResultData::renameIndexSuccess):
3186         * Modules/indexeddb/shared/IDBResultData.h:
3187
3188         * Modules/indexeddb/shared/InProcessIDBServer.cpp:
3189         (WebCore::InProcessIDBServer::didRenameIndex):
3190         (WebCore::InProcessIDBServer::renameIndex):
3191         * Modules/indexeddb/shared/InProcessIDBServer.h:
3192
3193 2016-10-24  Dave Hyatt  <hyatt@apple.com>
3194
3195         [CSS Parser] Fix -webkit-box-reflect parsing
3196         https://bugs.webkit.org/show_bug.cgi?id=163890
3197
3198         Reviewed by Zalan Bujtas.
3199
3200         * css/parser/CSSPropertyParser.cpp:
3201         (WebCore::consumeReflect):
3202         Do a WTFMove on the mask instead of a .releaseNonNull(), since mask can be a nullptr.
3203         Exactly matches the old parser.
3204
3205         * css/parser/CSSPropertyParserHelpers.cpp:
3206         (WebCore::CSSPropertyParserHelpers::CalcParser::consumeValue):
3207         (WebCore::CSSPropertyParserHelpers::CalcParser::consumeNumber):
3208         (WebCore::CSSPropertyParserHelpers::consumeInteger):
3209         (WebCore::CSSPropertyParserHelpers::consumeNumber):
3210         (WebCore::CSSPropertyParserHelpers::consumeLength):
3211         (WebCore::CSSPropertyParserHelpers::consumePercent):
3212         (WebCore::CSSPropertyParserHelpers::consumeAngle):
3213         (WebCore::CSSPropertyParserHelpers::consumeTime):
3214         (WebCore::CSSPropertyParserHelpers::consumeUrl):
3215         (WebCore::CSSPropertyParserHelpers::consumeColor):
3216         (WebCore::CSSPropertyParserHelpers::consumeDeprecatedGradientPoint):
3217         (WebCore::CSSPropertyParserHelpers::consumeDeprecatedGradientColorStop):
3218         (WebCore::CSSPropertyParserHelpers::consumeCrossFade):
3219         (WebCore::CSSPropertyParserHelpers::consumeImageSet):
3220         Clean up all instances of CSSPrimitiveValue::create to use the CSSValuePool.
3221
3222 2016-10-21  Antoine Quint  <graouts@apple.com>
3223
3224         [Modern Media Controls] Concatenate JS and CSS files into a single JS and CSS resources
3225         https://bugs.webkit.org/show_bug.cgi?id=163785
3226         <rdar://problem/28890058>
3227
3228         Reviewed by Darin Adler.
3229
3230         Concatenate CSS and JS resources for modern media controls into single JS and CSS files
3231         during build and load these single resources alone at runtime.
3232
3233         * Modules/modern-media-controls/js-files: Added.
3234         * WebCore.xcodeproj/project.pbxproj:
3235         * rendering/RenderThemeMac.mm:
3236         (WebCore::RenderThemeMac::mediaControlsStyleSheet):
3237         (WebCore::RenderThemeMac::mediaControlsScript):
3238
3239 2016-10-24  Dave Hyatt  <hyatt@apple.com>
3240
3241         [CSS Parser] Unprefix -webkit-writing-mode
3242         https://bugs.webkit.org/show_bug.cgi?id=163870
3243
3244         Reviewed by Zalan Bujtas.
3245
3246         * css/CSSComputedStyleDeclaration.cpp:
3247         (WebCore::ComputedStyleExtractor::propertyValue):
3248         Change -webkit-writing mode to writing-mode.
3249
3250         * css/CSSPrimitiveValueMappings.h:
3251         (WebCore::CSSPrimitiveValue::operator WritingMode):
3252         (WebCore::CSSPrimitiveValue::operator SVGWritingMode): Deleted.
3253         Eliminate the SVGWritingMode converters. Add support for the unique SVG-specific
3254         values to the WritingMode converters.
3255
3256         * css/CSSPropertyNames.in:
3257         Alias -webkit-writing-mode to writing-mode. Move writing-mode up to be
3258         high priority like -webkit-writing mode was. Alias -epub-writing-mode to writing-mode
3259         instead of to -webkit-writing-mode.
3260
3261         * css/SVGCSSComputedStyleDeclaration.cpp:
3262         (WebCore::ComputedStyleExtractor::svgPropertyValue):
3263         Remove writing-mode from SVG computed style, since the base CSSComputedStyleDeclaration handles it.
3264
3265         * css/StyleBuilderCustom.h:
3266         (WebCore::StyleBuilderCustom::applyValueWritingMode):
3267         (WebCore::StyleBuilderCustom::applyValueWebkitWritingMode): Deleted.
3268         Renamed applyValueWebkitWritingMode to applyValueWritingMode. Removed the SVG code, since
3269         the underlying converter for WritingMode now handles those values.
3270
3271         * css/StyleResolver.cpp:
3272         (WebCore::extractDirectionAndWritingMode):
3273         Rename -webkit-writing-mode to writing-mode.
3274
3275         * css/parser/CSSParser.cpp:
3276         (WebCore::isValidKeywordPropertyAndValue):
3277         Eliminate -webkit-writing-mode and make sure writing-mode handles both the SVG values
3278         and the normal values.
3279
3280         * css/parser/CSSParserFastPaths.cpp:
3281         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
3282         (WebCore::CSSParserFastPaths::isKeywordPropertyID):
3283         Same deal here.
3284
3285         * html/track/TextTrackCueGeneric.cpp:
3286         (WebCore::TextTrackCueGenericBoxElement::applyCSSProperties):
3287         * html/track/VTTCue.cpp:
3288         (WebCore::VTTCueBox::applyCSSProperties):
3289         Cue stuff was setting -webkit-writing-mode, so make it set writing-mode instead now.
3290
3291         * rendering/RenderLineBreak.cpp:
3292         (WebCore::RenderLineBreak::collectSelectionRects):
3293         * rendering/RenderText.cpp:
3294         (WebCore::RenderText::collectSelectionRects):
3295         Switch the SVG-specific code here over to accessing the RenderStyle writing-mode and not
3296         the SVG-specific one.
3297
3298         * rendering/style/RenderStyle.h:
3299         (WebCore::RenderStyle::isVerticalWritingMode):
3300         Add a helper function for asking if something is vertical writing mode.
3301
3302         * rendering/style/SVGRenderStyle.cpp:
3303         * rendering/style/SVGRenderStyle.h:
3304         * rendering/style/SVGRenderStyleDefs.h:
3305         (WebCore::SVGRenderStyle::diff):
3306         Remove the SVG writing mode code.
3307
3308         * rendering/svg/RenderSVGInlineText.cpp:
3309         (WebCore::RenderSVGInlineText::computeNewScaledFontForStyle):
3310         Make sure to force SVG font descriptions to be horizontal, since SVG controls
3311         its own glyph orientation.
3312
3313         * rendering/svg/SVGRenderTreeAsText.cpp:
3314         (WebCore::writeSVGInlineTextBox):
3315         * rendering/svg/SVGTextChunk.cpp:
3316         (WebCore::SVGTextChunk::SVGTextChunk):
3317         * rendering/svg/SVGTextLayoutEngine.cpp:
3318         (WebCore::SVGTextLayoutEngine::layoutInlineTextBox):
3319         * rendering/svg/SVGTextQuery.cpp:
3320         (WebCore::SVGTextQuery::executeQuery):
3321         Changed to access the RenderStyle writing mode instead of the SVG-specific one.
3322
3323 2016-10-23  Antti Koivisto  <antti@apple.com>
3324
3325         Avoid unnecessary full style resolution in getComputedStyle for non-inherited properties
3326         https://bugs.webkit.org/show_bug.cgi?id=163875
3327
3328         Reviewed by Andreas Kling.
3329
3330         Test: fast/css/getComputedStyle/getComputedStyle-style-resolution.html
3331
3332         * css/CSSComputedStyleDeclaration.cpp:
3333         (WebCore::hasValidStyleForProperty):
3334
3335             For non-inherited properties we don't need to update style even if some ancestor style is invalid
3336             as long as explicit 'inherit' is not being used.
3337             We still need to update if we find out that the whole subtree we are in is invalid.
3338
3339         (WebCore::updateStyleIfNeededForProperty):
3340
3341             Pass the property.
3342
3343         (WebCore::ComputedStyleExtractor::customPropertyValue):
3344         (WebCore::ComputedStyleExtractor::propertyValue):
3345         (WebCore::CSSComputedStyleDeclaration::length):
3346         (WebCore::elementOrItsAncestorNeedsStyleRecalc): Deleted.
3347         (WebCore::updateStyleIfNeededForElement): Deleted.
3348         * css/StyleResolver.cpp:
3349         (WebCore::StyleResolver::colorFromPrimitiveValue):
3350
3351             Mark style as using explicit inheritance if 'currentcolor' value is used.
3352
3353 2016-10-24  Youenn Fablet  <youenn@apple.com>
3354
3355         ASSERTION FAILED: canvas()->securityOrigin()->toString() == cachedImage.origin()->toString()
3356         https://bugs.webkit.org/show_bug.cgi?id=163242
3357
3358         Reviewed by Darin Adler.
3359
3360         Test: http/tests/security/cross-origin-cached-images-canvas.html
3361
3362         We were previously on Origin HTTP header to check whether requests were made from different origins.
3363         This is fine for CORS enabled requests but not for GET no CORS requests since they will not have any Origin header.
3364
3365         Now that CachedResource and CachedResourceRequest own their origin, it is best to use these directly.
3366
3367         * loader/cache/CachedResourceLoader.cpp:
3368         (WebCore::isRequestMatchingResourceOrigin):
3369         (WebCore::CachedResourceLoader::shouldUpdateCachedResourceWithCurrentRequest):
3370
3371 2016-10-24  Youenn Fablet  <youenn@apple.com>
3372
3373         Remove CachedResource::passesSameOriginPolicyCheck
3374         https://bugs.webkit.org/show_bug.cgi?id=163593
3375
3376         Reviewed by Andreas Kling.
3377
3378         No change of behavior.
3379
3380         Removing no-longer used code.
3381
3382         * loader/cache/CachedResource.cpp:
3383         (WebCore::CachedResource::redirectReceived):
3384         (WebCore::CachedResource::passesAccessControlCheck): Deleted.
3385         (WebCore::CachedResource::passesSameOriginPolicyCheck): Deleted.
3386         (WebCore::CachedResource::responseForSameOriginPolicyChecks): Deleted.
3387         * loader/cache/CachedResource.h:
3388         (WebCore::CachedResource::response):
3389
3390 2016-10-24  Youenn Fablet  <youenn@apple.com>
3391
3392         Redirections should be upgraded if CSP policy says so
3393         https://bugs.webkit.org/show_bug.cgi?id=163544
3394
3395         Reviewed by Darin Adler.
3396
3397         Test: http/tests/security/contentSecurityPolicy/upgrade-insecure-requests/basic-upgrade-after-redirect.https.html
3398
3399         Introducing CachedResourceLoader::updateRequestAfterRedirection to do the checks that CachedResourceLoader is doing
3400         to the initial request, but for redirection requests.
3401
3402         Implemented URL upgrade according CSP policy, as specified by fetch algorithm.
3403         Minor refactoring in CachedResourceRequest to share some code.
3404         Fixing some constness issues.
3405
3406         * loader/SubresourceLoader.cpp:
3407         (WebCore::SubresourceLoader::willSendRequestInternal):
3408         * loader/cache/CachedResourceLoader.cpp:
3409         (WebCore::CachedResourceLoader::allowedByContentSecurityPolicy):
3410         (WebCore::CachedResourceLoader::canRequestAfterRedirection):
3411         (WebCore::CachedResourceLoader::updateRequestAfterRedirection):
3412         * loader/cache/CachedResourceLoader.h:
3413         * loader/cache/CachedResourceRequest.cpp:
3414         (WebCore::upgradeInsecureResourceRequestIfNeeded):
3415         (WebCore::CachedResourceRequest::upgradeInsecureRequestIfNeeded):
3416         * loader/cache/CachedResourceRequest.h:
3417
3418 2016-10-22  Sam Weinig  <sam@webkit.org>
3419
3420         [WebIDL] Add IDLType based toJS conversion
3421         https://bugs.webkit.org/show_bug.cgi?id=163861
3422
3423         Reviewed by Darin Adler.
3424
3425         Adds toJS<IDLType>() functions to be the new way of converting
3426         from implementation types to JS types. These are implemented via
3427         a similar mechanism to the convert<IDL>() functions, though specializations
3428         of a JSConverter struct (rather than the Converter structs). This allows
3429         us to support arbitrarily complex aggregate types easily (e.g. sequence<(Node or DOMString?)>).
3430
3431         * Modules/geolocation/Geoposition.idl:
3432         * dom/Event.idl:
3433         Add typedef for DOMTimeStamp. Eventually, our IDLParser should do this for us, but
3434         for now it allows us to simplify the type system.
3435
3436         * bindings/js/JSDOMBinding.h:
3437         (WebCore::JSValueTraits::arrayJSValue): Deleted.
3438         (WebCore::JSValueTraits<String>::arrayJSValue): Deleted.
3439         (WebCore::JSValueTraits<double>::arrayJSValue): Deleted.
3440         (WebCore::JSValueTraits<float>::arrayJSValue): Deleted.
3441         (WebCore::jsArray): Deleted.
3442         (WebCore::jsFrozenArray): Deleted.
3443         (WebCore::NativeValueTraits<String>::nativeValue): Deleted.
3444         (WebCore::NativeValueTraits<unsigned>::nativeValue): Deleted.
3445         (WebCore::NativeValueTraits<float>::nativeValue): Deleted.
3446         (WebCore::NativeValueTraits<double>::nativeValue): Deleted.
3447         (WebCore::toNullableJSNumber): Deleted.