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