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