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