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