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