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