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