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