9a9763504eb80c0cbe98054e1d259ea6dd9ab864
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-05-11  Romain Bellessort  <romain.bellessort@crf.canon.fr>
2
3         [Readable Streams API] Implement ReadableStreamBYOBReader cancel()
4         https://bugs.webkit.org/show_bug.cgi?id=171919
5
6         Reviewed by Youenn Fablet.
7
8         Implemented ReadableStreamBYOBReader cancel() method.
9
10         Added tests checking cancel().
11
12         * Modules/streams/ReadableStreamBYOBReader.js:
13         (cancel): Implemented.
14         * Modules/streams/ReadableStreamInternals.js:
15         (readableStreamError): Updated to support ReadableStreamBYOBReader case.
16
17 2017-05-11  Chris Dumez  <cdumez@apple.com>
18
19         Stop using PassRefPtr in WebGPU code
20         https://bugs.webkit.org/show_bug.cgi?id=171965
21
22         Reviewed by Alex Christensen.
23
24         Stop using PassRefPtr in WebGPU code.
25
26         * html/canvas/WebGPUDrawable.cpp:
27         (WebCore::WebGPUDrawable::WebGPUDrawable):
28         * html/canvas/WebGPURenderingContext.cpp:
29         (WebCore::WebGPURenderingContext::create):
30         (WebCore::WebGPURenderingContext::WebGPURenderingContext):
31         * html/canvas/WebGPURenderingContext.h:
32         * html/canvas/WebGPUTexture.cpp:
33         (WebCore::WebGPUTexture::createFromDrawableTexture):
34         (WebCore::WebGPUTexture::WebGPUTexture):
35         * html/canvas/WebGPUTexture.h:
36
37 2017-05-11  Youenn Fablet  <youenn@apple.com>
38
39         Name WebRTC Threads
40         https://bugs.webkit.org/show_bug.cgi?id=171975
41
42         Reviewed by Eric Carlson.
43
44         No change of behavior.
45
46         * platform/mediastream/libwebrtc/LibWebRTCAudioModule.cpp:
47         (WebCore::LibWebRTCAudioModule::LibWebRTCAudioModule): Setting audio module thread name.
48         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
49         (WebCore::initializePeerConnectionFactoryAndThreads): Setting signaling and networking thread names.
50
51 2017-05-11  Chris Dumez  <cdumez@apple.com>
52
53         Stop using PassRefPtr in platform/audio
54         https://bugs.webkit.org/show_bug.cgi?id=171966
55
56         Reviewed by Ryosuke Niwa.
57
58         Stop using PassRefPtr in platform/audio.
59
60         * platform/audio/AudioBus.h:
61         (WebCore::AudioBus::AudioBus):
62         * platform/audio/AudioFileReader.h:
63         * platform/audio/HRTFDatabaseLoader.cpp:
64         (WebCore::HRTFDatabaseLoader::createAndLoadAsynchronouslyIfNecessary):
65         * platform/audio/HRTFDatabaseLoader.h:
66         * platform/audio/HRTFKernel.cpp:
67         (WebCore::HRTFKernel::createInterpolatedKernel):
68         * platform/audio/HRTFKernel.h:
69         (WebCore::HRTFKernel::create):
70         * platform/audio/glib/AudioBusGLib.cpp:
71         (WebCore::AudioBus::loadPlatformResource):
72         * platform/audio/gstreamer/AudioFileReaderGStreamer.cpp:
73         (WebCore::AudioFileReader::createBus):
74         (WebCore::createBusFromAudioFile):
75         (WebCore::createBusFromInMemoryAudioFile):
76         * platform/audio/ios/AudioFileReaderIOS.cpp:
77         (WebCore::AudioFileReader::createBus):
78         (WebCore::createBusFromAudioFile):
79         (WebCore::createBusFromInMemoryAudioFile):
80         * platform/audio/ios/AudioFileReaderIOS.h:
81         * platform/audio/mac/AudioBusMac.mm:
82         (WebCore::AudioBus::loadPlatformResource):
83         * platform/audio/mac/AudioFileReaderMac.cpp:
84         (WebCore::AudioFileReader::createBus):
85         (WebCore::createBusFromAudioFile):
86         (WebCore::createBusFromInMemoryAudioFile):
87         * platform/audio/mac/AudioFileReaderMac.h:
88
89 2017-05-11  Mark Lam  <mark.lam@apple.com>
90
91         WorkerThread::stop() should call scheduleExecutionTermination() last.
92         https://bugs.webkit.org/show_bug.cgi?id=171775
93         <rdar://problem/30975761>
94
95         Reviewed by Geoffrey Garen.
96
97         Currently, WorkerThread::stop() calls scheduleExecutionTermination() to terminate
98         JS execution first, followed by posting a cleanup task to the worker, and lastly,
99         it invokes terminate() on the WorkerRunLoop.
100
101         As a result, before run loop is terminate, the worker thread may observe the
102         TerminatedExecutionException in JS code, bail out, see another JS task to run,
103         re-enters the VM to run said JS code, and fails with an assertion due to the
104         TerminatedExecutionException still being pending on VM entry.
105
106         WorkerRunLoop::Task::performTask() already has a check to only allow a task to
107         run if and only if !runLoop.terminated() and the task is not a clean up task.
108         We'll fix the above race by ensuring that having WorkerThread::stop() terminate
109         the run loop before it scheduleExecutionTermination() which throws the
110         TerminatedExecutionException.  This way, by the time JS code unwinds out of the
111         VM due to the TerminatedExecutionException, runLoop.terminated() is guaranteed
112         to be true and thereby prevents re-entry into the VM.
113
114         This issue is covered by an existing test that I just unskipped in TestExpectations.
115
116         * bindings/js/JSDOMPromiseDeferred.cpp:
117         (WebCore::DeferredPromise::callFunction):
118         * workers/WorkerThread.cpp:
119         (WebCore::WorkerThread::stop):
120
121 2017-05-11  Chris Dumez  <cdumez@apple.com>
122
123         Drop custom bindings code for HTMLFormControlsCollection's named property getter
124         https://bugs.webkit.org/show_bug.cgi?id=171964
125
126         Reviewed by Sam Weinig.
127
128         Drop custom bindings code for HTMLFormControlsCollection's named property getter as
129         we are able to generate it.
130
131         No new tests, no expected Web-facing behavior change.
132
133         * CMakeLists.txt:
134         * WebCore.xcodeproj/project.pbxproj:
135         * bindings/js/JSBindingsAllInOne.cpp:
136         * bindings/js/JSHTMLFormControlsCollectionCustom.cpp: Removed.
137         * bindings/scripts/CodeGeneratorJS.pm:
138         (GenerateNamedGetter):
139         * html/HTMLFormControlsCollection.cpp:
140         (WebCore::HTMLFormControlsCollection::namedItemOrItems):
141         * html/HTMLFormControlsCollection.h:
142         * html/HTMLFormControlsCollection.idl:
143
144 2017-05-10  Eric Carlson  <eric.carlson@apple.com>
145
146         [MediaStream] CoreAudioCaptureSource claims to never be muted
147         https://bugs.webkit.org/show_bug.cgi?id=171946
148         <rdar://problem/32111991>
149
150         Reviewed by Jer Noble.
151
152         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
153         (WebCore::CoreAudioCaptureSource::stopProducingData): Set m_muted to true.
154
155 2017-05-10  Jer Noble  <jer.noble@apple.com>
156
157         RELEASE_ASSERT at WebAudioSourceProviderAVFObjC::provideInput()
158         https://bugs.webkit.org/show_bug.cgi?id=171711
159
160         Reviewed by Youenn Fablet.
161
162         Before iterating over the channels in either the WebAudioBufferList or the AudioBus, ensure
163         we don't walk over the end of either by only iterating over the minimum length of either.
164         Also, when the internal format of WebAudioSourceProviderAVFObjC changes, notify the
165         MediaStreamAudioSourceNode that the number of channels and sample rate have changed.
166
167         * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm:
168         (WebCore::WebAudioSourceProviderAVFObjC::provideInput):
169         (WebCore::WebAudioSourceProviderAVFObjC::prepare):
170
171 2017-05-10  Andy Estes  <aestes@apple.com>
172
173         REGRESSION (r167845): ASSERT(!m_renderView.needsLayout()) in svg/custom/bug79798.html
174         https://bugs.webkit.org/show_bug.cgi?id=132297
175
176         Reviewed by Simon Fraser.
177
178         We don't know why m_renderView needs layout in this case, but we know that we don't need to
179         assert if the client hasn't set the ScrollableInnerFrameTrigger compositing trigger.
180
181         * rendering/RenderLayerCompositor.cpp:
182         (WebCore::RenderLayerCompositor::requiresCompositingForScrollableFrame):
183
184 2017-05-10  Ryan Haddad  <ryanhaddad@apple.com>
185
186         Unreviewed, rolling out r216630.
187
188         This change caused assertion failures with webrtc LayoutTests.
189
190         Reverted changeset:
191
192         "RELEASE_ASSERT at
193         WebAudioSourceProviderAVFObjC::provideInput()"
194         https://bugs.webkit.org/show_bug.cgi?id=171711
195         http://trac.webkit.org/changeset/216630
196
197 2017-05-09  Sam Weinig  <sam@webkit.org>
198
199         Remove support for legacy Notifications
200         https://bugs.webkit.org/show_bug.cgi?id=171487
201
202         Reviewed by Jon Lee.
203
204         * CMakeLists.txt:
205         * WebCore.xcodeproj/project.pbxproj:
206         Remove files.
207
208         * Configurations/FeatureDefines.xcconfig:
209         Remove definition of ENABLE_LEGACY_NOTIFICATIONS.
210
211         * DerivedSources.make:
212         Remove IDL files.
213
214         * Modules/notifications/DOMWindowNotifications.cpp: Removed.
215         * Modules/notifications/DOMWindowNotifications.h: Removed.
216         * Modules/notifications/DOMWindowNotifications.idl: Removed.
217         * Modules/notifications/NotificationCenter.cpp: Removed.
218         * Modules/notifications/NotificationCenter.h: Removed.
219         * Modules/notifications/NotificationCenter.idl: Removed.
220         * Modules/notifications/NotificationClient.h:
221         * Modules/notifications/NotificationController.cpp:
222         * Modules/notifications/NotificationController.h:
223         * Modules/notifications/WorkerGlobalScopeNotifications.cpp: Removed.
224         * Modules/notifications/WorkerGlobalScopeNotifications.h: Removed.
225         * Modules/notifications/WorkerGlobalScopeNotifications.idl: Removed.
226         * Modules/notifications/Notification.idl:
227         * Modules/notifications/Notification.cpp:
228         * Modules/notifications/Notification.h:
229         * dom/EventTargetFactory.in:
230         * page/DOMWindow.cpp:
231         * workers/WorkerThread.h:
232         Remove code legacy Notification code. Replace use of NotificationCenter with direct
233         calls to the NotificationClient.
234
235 2017-05-10  Commit Queue  <commit-queue@webkit.org>
236
237         Unreviewed, rolling out r216635.
238         https://bugs.webkit.org/show_bug.cgi?id=171953
239
240         "Some worker tests are failing". (Requested by mlam on #webkit).
241
242         Reverted changeset:
243
244         "WorkerThread::stop() should call
245         scheduleExecutionTermination() last."
246         https://bugs.webkit.org/show_bug.cgi?id=171775
247         http://trac.webkit.org/changeset/216635
248
249 2017-05-10  Mark Lam  <mark.lam@apple.com>
250
251         WorkerThread::stop() should call scheduleExecutionTermination() last.
252         https://bugs.webkit.org/show_bug.cgi?id=171775
253         <rdar://problem/30975761>
254
255         Reviewed by Geoffrey Garen.
256
257         Currently, WorkerThread::stop() calls scheduleExecutionTermination() to terminate
258         JS execution first, followed by posting a cleanup task to the worker, and lastly,
259         it invokes terminate() on the WorkerRunLoop.
260
261         As a result, before run loop is terminate, the worker thread may observe the
262         TerminatedExecutionException in JS code, bail out, see another JS task to run,
263         re-enters the VM to run said JS code, and fails with an assertion due to the
264         TerminatedExecutionException still being pending on VM entry.
265
266         WorkerRunLoop::Task::performTask() already has a check to only allow a task to
267         run if and only if !runLoop.terminated() and the task is not a clean up task.
268         We'll fix the above race by ensuring that having WorkerThread::stop() terminate
269         the run loop before it scheduleExecutionTermination() which throws the
270         TerminatedExecutionException.  This way, by the time JS code unwinds out of the
271         VM due to the TerminatedExecutionException, runLoop.terminated() is guaranteed
272         to be true and thereby prevents re-entry into the VM.
273
274         This issue is covered by an existing test that I just unskipped in TestExpectations.
275
276         * bindings/js/JSDOMPromiseDeferred.cpp:
277         (WebCore::DeferredPromise::callFunction):
278         * workers/WorkerThread.cpp:
279         (WebCore::WorkerThread::stop):
280
281 2017-05-10  Tim Horton  <timothy_horton@apple.com>
282
283         Add an experimental feature flag for viewport-fit
284         https://bugs.webkit.org/show_bug.cgi?id=171948
285         <rdar://problem/31995518>
286
287         Reviewed by Simon Fraser.
288
289         * dom/ViewportArguments.cpp:
290         (WebCore::setViewportFeature):
291         * page/Settings.in:
292         Disable parsing of viewport-fit if the experimental feature is disabled.
293
294 2017-05-10  Chris Dumez  <cdumez@apple.com>
295
296         Simplify relationship between Attr and Element now that Attr is childless
297         https://bugs.webkit.org/show_bug.cgi?id=171909
298
299         Reviewed by Ryosuke Niwa.
300
301         Simplify relationship between Attr and Element now that Attr is childless
302         after r216259.
303
304         No new tests, no Web facing behavior change.
305
306         * dom/Attr.cpp:
307         (WebCore::Attr::setValue):
308         Attr::setValue() was only called by Element::setAttributeInternal() to make sure
309         we updated the Attr node's Text child. However, now that Attr has no Text child,
310         Element no longer needs to update the Attr node's value.
311         Attr::setValueForBindings() was thus renamed to setValue(). Its implementation
312         was also simplified by calling Element::setAttribute() on its ownerElement, if
313         it has one, instead of duplicating a bunch of code from Element::setAttributeInternal().
314
315         (WebCore::Attr::setNodeValue):
316         Call setValue() instead of setValueForBindings() now that it has been renamed.
317
318         * dom/Attr.h:
319         * dom/Attr.idl:
320         Rename valueForBindings / setValueForBindings to value / setValue.
321
322         * dom/Document.h:
323         Split shouldInvalidateNodeListAndCollectionCaches() into 2 methods, one taking an Attr name
324         and another that does not. There are now 2 calls sites instead of one, so we no longer need
325         to branch in this function.
326
327         * dom/Element.cpp:
328         (WebCore::Element::setAttributeInternal):
329         Drop code calling Attr::setValue() on the Attr node since Attr::setValue() was only
330         duplicating logic from Element::setAttributeInternal() after r216259. There is nothing
331         on Attr that needs updating when an element attribute gets updated.
332
333         (WebCore::Element::attributeChanged):
334         Call the new invalidateNodeListAndCollectionCachesInAncestorsForAttribute(). This
335         is the only call site that passes an attribute name.
336
337         * dom/Node.cpp:
338         (WebCore::Document::shouldInvalidateNodeListAndCollectionCaches):
339         (WebCore::Document::shouldInvalidateNodeListAndCollectionCachesForAttribute):
340         Split into 2 to avoid branching, as explained above.
341
342         (WebCore::Node::invalidateNodeListAndCollectionCachesInAncestors):
343         (WebCore::Node::invalidateNodeListAndCollectionCachesInAncestorsForAttribute):
344         - invalidateNodeListAndCollectionCachesInAncestors() used to invalidate childNodeLists
345           if the Node was an attribute node. Drop this as this is no longer needed as of r216259.
346         - After the change to Attr::setValue(), call sites for
347           invalidateNodeListAndCollectionCachesInAncestors() either had no parameters, or both
348           parameters present and non-null. There is therefore no longer any need to handle
349           having an attrName but no attributeOwnerElement. To make this obvious, I split this
350           into 2 methods: invalidateNodeListAndCollectionCachesInAncestors() and
351           invalidateNodeListAndCollectionCachesInAncestorsForAttribute(attrName). We no longer
352           need the attributeOwnerElement parameter as it was only used to exit early.
353
354         * dom/Node.h:
355
356 2017-05-10  Antti Koivisto  <antti@apple.com>
357
358         REGRESSION (r207372) Visibility property is not inherited when used in an animation
359         https://bugs.webkit.org/show_bug.cgi?id=171883
360         <rdar://problem/32086550>
361
362         Reviewed by Simon Fraser.
363
364         The problem here is that our animation code is tied to renderers. We don't have renderers during
365         the initial style resolution so animations are not applied yet. When constructing renderers we set
366         their style to the initial animated style but this step can't implement inheritance.
367
368         Normally this is invisible as the first animation frame will immediately inherit the style correctly.
369         However in this case the animation is discrete and the first frame is the same as the initial state.
370         With r207372 we optimize the descendant style change away.
371
372         This patch fixes the problem by tracking that the renderer has initial animated style and inheriting
373         it to descendants during next style resolution even if it doesn't change.
374
375         Test: animations/animation-initial-inheritance.html
376
377         * rendering/RenderElement.cpp:
378         (WebCore::RenderElement::RenderElement):
379         * rendering/RenderElement.h:
380         (WebCore::RenderElement::hasInitialAnimatedStyle):
381         (WebCore::RenderElement::setHasInitialAnimatedStyle):
382         * style/RenderTreeUpdater.cpp:
383         (WebCore::RenderTreeUpdater::createRenderer):
384
385             Set a bit on renderer indicating it has initial animated style.
386
387         * style/StyleTreeResolver.cpp:
388         (WebCore::Style::TreeResolver::createAnimatedElementUpdate):
389
390             Return at least 'Inherit' for style change when updating renderer with initial animated style.
391
392 2017-05-10  Jer Noble  <jer.noble@apple.com>
393
394         RELEASE_ASSERT at WebAudioSourceProviderAVFObjC::provideInput()
395         https://bugs.webkit.org/show_bug.cgi?id=171711
396
397         Reviewed by Youenn Fablet.
398
399         Before iterating over the channels in either the WebAudioBufferList or the AudioBus, ensure
400         we don't walk over the end of either by only iterating over the minimum length of either.
401         Also, when the internal format of WebAudioSourceProviderAVFObjC changes, notify the
402         MediaStreamAudioSourceNode that the number of channels and sample rate have changed.
403
404         * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm:
405         (WebCore::WebAudioSourceProviderAVFObjC::provideInput):
406         (WebCore::WebAudioSourceProviderAVFObjC::prepare):
407
408 2017-05-04  Filip Pizlo  <fpizlo@apple.com>
409
410         GCController.cpp's collect() should be Async
411         https://bugs.webkit.org/show_bug.cgi?id=171708
412
413         Reviewed by Saam Barati and Geoffrey Garen.
414
415         No new tests because no change in behavior.
416         
417         This is one step towards not requesting sync GCs in WebCore. I'm landing this incrementally to
418         make bisecting super easy.
419         
420         This is a ~7% JetStream iOS "regression", because JetStream has a bug where it allows trunk
421         to sneakily hide GC work between when JetStream measures time. After this change, we are no
422         longer trying to be sneaky.
423
424         * bindings/js/GCController.cpp:
425         (WebCore::collect):
426
427 2017-05-10  Jer Noble  <jer.noble@apple.com>
428
429         CoreAudioCaptureSource reports 3 or 5 channel audio output; actually only mono
430         https://bugs.webkit.org/show_bug.cgi?id=171940
431
432         Reviewed by Eric Carlson.
433
434         Asking for the Input VPIO stream format will return the internal mic format, before processing. Instead
435         ask for the input bus's output format, which is post processing, which will return the correct number
436         of channels (one).
437
438         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
439         (WebCore::CoreAudioSharedUnit::configureMicrophoneProc):
440
441 2017-05-10  Ryan Haddad  <ryanhaddad@apple.com>
442
443         Unreviewed, rolling out r216591.
444
445         This change broke an internal build.
446
447         Reverted changeset:
448
449         "REGRESSION (r207372) Visibility property is not inherited
450         when used in an animation"
451         https://bugs.webkit.org/show_bug.cgi?id=171883
452         http://trac.webkit.org/changeset/216591
453
454 2017-05-10  Chris Dumez  <cdumez@apple.com>
455
456         Drop custom bindings code now window.open()
457         https://bugs.webkit.org/show_bug.cgi?id=171933
458
459         Reviewed by Geoffrey Garen.
460
461         Drop custom bindings code now window.open() as it is not doing anything special.
462
463         * bindings/js/JSDOMWindowCustom.cpp:
464         (WebCore::JSDOMWindow::open): Deleted.
465         * page/DOMWindow.cpp:
466         (WebCore::DOMWindow::open):
467         * page/DOMWindow.h:
468         * page/DOMWindow.idl:
469         * testing/Internals.cpp:
470         (WebCore::Internals::openDummyInspectorFrontend):
471
472 2017-05-10  Tim Horton  <timothy_horton@apple.com>
473
474         Add an experimental feature flag for constant properties
475         https://bugs.webkit.org/show_bug.cgi?id=171913
476         <rdar://problem/31995518>
477
478         Reviewed by Ryosuke Niwa.
479
480         * css/parser/CSSParser.cpp:
481         (WebCore::CSSParserContext::CSSParserContext):
482         (WebCore::operator==):
483         * css/parser/CSSParserImpl.cpp:
484         (WebCore::CSSParserImpl::consumeCustomPropertyValue):
485         * css/parser/CSSParserMode.h:
486         * css/parser/CSSPropertyParser.cpp:
487         (WebCore::CSSPropertyParser::parseValueStart):
488         * css/parser/CSSVariableParser.cpp:
489         (WebCore::classifyBlock):
490         (WebCore::isValidVariableReference):
491         (WebCore::isValidConstantReference):
492         (WebCore::classifyVariableRange):
493         (WebCore::CSSVariableParser::containsValidVariableReferences):
494         (WebCore::CSSVariableParser::parseDeclarationValue):
495         * css/parser/CSSVariableParser.h:
496         Plumb the experimental feature flag down into CSSVariableParser by way
497         of CSSParserContext.
498
499         * page/Settings.in:
500
501 2017-05-10  Chris Dumez  <cdumez@apple.com>
502
503         REGRESSION (r206960): Possible null pointer dereference under DOMSelection::getRangeAt()
504         https://bugs.webkit.org/show_bug.cgi?id=171925
505         <rdar://problem/29931223>
506
507         Reviewed by Wenson Hsieh.
508
509         We have evidence that selection().firstRange() can return null in DOMSelection::getRangeAt().
510         When this happens, we now throw an INDEX_SIZE_ERR instead of dereferencing it.
511
512         I believe this can happen if the VisibleSelection is orphaned but not none, because
513         rangeCount() only checks for isNone() but VisibleSelection::firstRange() can return null
514         if isNoneOrOrphaned().
515
516         No new tests, I do not know how to reproduce.
517
518         * page/DOMSelection.cpp:
519         (WebCore::DOMSelection::getRangeAt):
520
521 2017-05-10  Matt Rajca  <mrajca@apple.com>
522
523         DumpRenderTree crashed in com.apple.WebCore: std::optional<WTF::MediaTime>::operator-> + 71 :: CRASHING TEST: fullscreen/video-controls-timeline.html
524         https://bugs.webkit.org/show_bug.cgi?id=171932
525
526         Reviewed by Eric Carlson.
527
528         Explicitly initialize m_playbackWithoutUserGesture to "None".
529
530         * html/HTMLMediaElement.h:
531
532 2017-05-10  Andy Estes  <aestes@apple.com>
533
534         Keyboard input suppression should extend to subframes
535         https://bugs.webkit.org/show_bug.cgi?id=171880
536         <rdar://problem/31201793>
537
538         Reviewed by Ryosuke Niwa.
539
540         Test: http/tests/navigation/keyboard-events-during-provisional-subframe-navigation.html
541
542         * dom/EventDispatcher.cpp:
543         (WebCore::shouldSuppressEventDispatchInDOM): Changed to call shouldSuppressKeyboardInput()
544         on the main frame's loader.
545         * editing/Editor.cpp:
546         (WebCore::Editor::shouldInsertText): Ditto.
547
548 2017-05-10  Matt Lewis  <jlewis3@apple.com>
549
550         Unreviewed, rolling out r216563.
551
552         Revision caused 2 api failures
553
554         Reverted changeset:
555
556         "[MediaStream] deviceId constraint doesn't work with
557         getUserMedia"
558         https://bugs.webkit.org/show_bug.cgi?id=171877
559         http://trac.webkit.org/changeset/216563
560
561 2017-05-10  Frederic Wang  <fwang@igalia.com>
562
563         Refactor ScrollingCoordinator::setSynchronousScrollingReasons to accept a FrameView
564         https://bugs.webkit.org/show_bug.cgi?id=171923
565
566         Reviewed by Simon Fraser.
567
568         Currently ScrollingCoordinator::setSynchronousScrollingReasons implementations assumes
569         SynchronousScrollingReasons apply to the main frame. This commit allows to specify
570         a FrameView in order to prepare support for fast scrolling of frames.
571
572         No new tests, no behavior changes.
573
574         * page/scrolling/AsyncScrollingCoordinator.cpp:
575         (WebCore::AsyncScrollingCoordinator::setSynchronousScrollingReasons): Use the FrameView to
576         find the state node.
577         (WebCore::AsyncScrollingCoordinator::updateScrollLayerPosition): Rename this function
578         updateMainFrameScrollLayerPosition and use the specified FrameView.
579         * page/scrolling/AsyncScrollingCoordinator.h: Add FrameView parameter.
580         * page/scrolling/ScrollingCoordinator.cpp:
581         (WebCore::ScrollingCoordinator::updateSynchronousScrollingReasons): Remove the const since
582         AsyncScrollingCoordinator uses scrollLayerForFrameView. Pass the frameView to
583         setSynchronousScrollingReasons.
584         * page/scrolling/ScrollingCoordinator.h:
585         (WebCore::ScrollingCoordinator::setSynchronousScrollingReasons): Add FrameView parameter.
586
587 2017-05-10  Antti Koivisto  <antti@apple.com>
588
589         REGRESSION (r207372) Visibility property is not inherited when used in an animation
590         https://bugs.webkit.org/show_bug.cgi?id=171883
591         <rdar://problem/32086550>
592
593         Reviewed by Simon Fraser.
594
595         The problem here is that our animation code is tied to renderers. We don't have renderers during
596         the initial style resolution so animations are not applied yet. When constructing renderers we set
597         their style to the initial animated style but this step can't implement inheritance.
598
599         Normally this is invisible as the first animation frame will immediately inherit the style correctly.
600         However in this case the animation is discrete and the first frame is the same as the initial state.
601         With r207372 we optimize the descendant style change away.
602
603         This patch fixes the problem by tracking that the renderer has initial animated style and inheriting
604         it to descendants during next style resolution even if it doesn't change.
605
606         Test: animations/animation-initial-inheritance.html
607
608         * rendering/RenderElement.cpp:
609         (WebCore::RenderElement::RenderElement):
610         * rendering/RenderElement.h:
611         (WebCore::RenderElement::hasInitialAnimatedStyle):
612         (WebCore::RenderElement::setHasInitialAnimatedStyle):
613         * style/RenderTreeUpdater.cpp:
614         (WebCore::RenderTreeUpdater::createRenderer):
615
616             Set a bit on renderer indicating it has initial animated style.
617
618         * style/StyleTreeResolver.cpp:
619         (WebCore::Style::TreeResolver::createAnimatedElementUpdate):
620
621             Return at least 'Inherit' for style change when updating renderer with initial animated style.
622
623 2017-05-10  Myles C. Maxfield  <mmaxfield@apple.com>
624
625         Tiny cleanup in Font::DerivedFonts
626         https://bugs.webkit.org/show_bug.cgi?id=171893
627
628         Reviewed by Jon Lee.
629
630         This variable was written to but never read.
631
632         No new tests because there is no behavior change.
633
634         * css/CSSFontFaceSource.cpp:
635         (WebCore::CSSFontFaceSource::font):
636         * platform/graphics/Font.cpp:
637         (WebCore::Font::verticalRightOrientationFont):
638         (WebCore::Font::uprightOrientationFont):
639         (WebCore::Font::smallCapsFont):
640         (WebCore::Font::noSynthesizableFeaturesFont):
641         (WebCore::Font::emphasisMarkFont):
642         (WebCore::Font::brokenIdeographFont):
643         (WebCore::Font::DerivedFonts::~DerivedFonts): Deleted.
644         * platform/graphics/Font.h:
645         (WebCore::Font::DerivedFonts::DerivedFonts): Deleted.
646
647 2017-05-10  Michael Catanzaro  <mcatanzaro@igalia.com>
648
649         Remove user agent quirk for Slack
650         https://bugs.webkit.org/show_bug.cgi?id=171869
651
652         Reviewed by Carlos Garcia Campos.
653
654         The user agent quirk for Slack does not seem to be necessary anymore. I am able to use Slack
655         without difficulty using our default user agent.
656
657         * platform/UserAgentQuirks.cpp:
658         (WebCore::urlRequiresChromeBrowser):
659
660 2017-05-10  Hyungwook Lee  <hyungwook.lee@navercorp.com>
661
662         [GTK] Fix compile warnings in CryptoKeyECGCrypt.cpp
663         https://bugs.webkit.org/show_bug.cgi?id=171851
664
665         Reviewed by Alex Christensen.
666
667         * crypto/gcrypt/CryptoKeyECGCrypt.cpp:
668         (WebCore::curveSize):
669         (WebCore::curveName):
670         (WebCore::uncompressedPointSizeForCurve):
671         (WebCore::uncompressedFieldElementSizeForCurve):
672
673 2017-05-08  Sergio Villar Senin  <svillar@igalia.com>
674
675         [css-grid] Remove Blink-specific code for handling orthogonal grid items
676         https://bugs.webkit.org/show_bug.cgi?id=171807
677
678         Reviewed by Darin Adler.
679
680         This code was added in r203252 as part of a patch improving the handling of
681         {min|max}-content with orthogonal flows. The original code came from Blink which performs a
682         pre-layout of orthogonal boxes in FrameView. That is not true in the case of WebKit so we do
683         not need this code at all. Actually it was causing incorrect renderings in some tests.
684
685         I'm also removing an invalid return statement just after another return.
686
687         * rendering/GridTrackSizingAlgorithm.cpp:
688         (WebCore::GridTrackSizingAlgorithmStrategy::minContentForChild):
689         (WebCore::GridTrackSizingAlgorithmStrategy::maxContentForChild):
690
691 2017-05-09  Zan Dobersek  <zdobersek@igalia.com>
692
693         Unreviewed build fix.
694
695         * platform/wpe/WidgetWPE.cpp:
696         (WebCore::Widget::paint): Add the missing SecurityOriginPaintPolicy parameter.
697
698 2017-05-09  Eric Carlson  <eric.carlson@apple.com>
699
700         [MediaStream] deviceId constraint doesn't work with getUserMedia
701         https://bugs.webkit.org/show_bug.cgi?id=171877
702         <rdar://problem/31899730>
703
704         Reviewed by Jer Noble.
705
706         Test: fast/mediastream/get-user-media-device-id.html
707
708         * Modules/mediastream/MediaConstraintsImpl.h:
709         (WebCore::MediaConstraintsData::MediaConstraintsData): Add a constructor that 
710         takes a const MediaConstraints&.
711
712         * Modules/mediastream/MediaDevicesEnumerationRequest.cpp:
713         (WebCore::MediaDevicesEnumerationRequest::topLevelDocumentOrigin): Don't return
714         NULL for the main frame so the origin matches that returned for a UserMediaRequest.
715
716         * Modules/mediastream/UserMediaController.h:
717         (WebCore::UserMediaController::setDeviceIDHashSalt): Deleted, not used.
718         (WebCore::UserMediaController::deviceIDHashSalt): Deleted, not used.
719
720         * Modules/mediastream/UserMediaRequest.cpp:
721         (WebCore::UserMediaRequest::allow): Add device ID hash salt parameter, set it on
722         constraints.
723         * Modules/mediastream/UserMediaRequest.h:
724
725         * platform/mediastream/MediaConstraints.h:
726         * platform/mediastream/RealtimeMediaSource.cpp:
727         (WebCore::RealtimeMediaSource::fitnessDistance): ASSERT if called for DeviceId.
728         (WebCore::RealtimeMediaSource::selectSettings): Special case DeviceId because it
729         we have to hash the device ID before comparing, and because the DeviceId can't be
730         changed so it should never be added to the flattened constraints.
731
732         * platform/mediastream/RealtimeMediaSourceSupportedConstraints.cpp:
733         (WebCore::RealtimeMediaSourceSupportedConstraints::nameForConstraint): Deleted, unused.
734         (WebCore::RealtimeMediaSourceSupportedConstraints::constraintFromName): Deleted, unused.
735         * platform/mediastream/RealtimeMediaSourceSupportedConstraints.h:
736
737         * platform/mediastream/mac/AVVideoCaptureSource.mm:
738         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
739         (WebCore::RealtimeMediaSourceCenterMac::bestSourcesForTypeAndConstraints): Pass device
740         id, not empty string.
741
742 2017-05-09  Jeremy Jones  <jeremyj@apple.com>
743
744         Video fullscreen window level should be below status bar.
745         https://bugs.webkit.org/show_bug.cgi?id=171892
746         rdar://problem/31771707
747
748         Reviewed by Jer Noble.
749
750         No new tests because it only affects platform window level.
751
752         Move the fullscreen window below the status bar, but above the input field window level.
753
754         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
755         (WebVideoFullscreenInterfaceAVKit::setupFullscreen):
756
757 2017-05-09  Sam Weinig  <sam@webkit.org>
758
759         Implement Subresource Integrity (SRI) [Part 2 - Fetch]
760         https://bugs.webkit.org/show_bug.cgi?id=148363
761         <rdar://problem/18945879>
762
763         Reviewed by Youenn Fablet.
764
765         Tests: http/tests/subresource-integrity/sri-fetch-worker.html
766                http/tests/subresource-integrity/sri-fetch.html
767
768         * loader/FetchOptions.h:
769         * loader/ThreadableLoader.cpp:
770         (WebCore::ThreadableLoaderOptions::isolatedCopy):
771         * loader/ThreadableLoader.h:
772         * loader/WorkerThreadableLoader.cpp:
773         (WebCore::LoaderTaskOptions::LoaderTaskOptions):
774         Add integrity metadata to the fetch options, and fix the implementation of
775         ThreadableLoaderOptions::isolatedCopy to work correctly (it was missing isolated
776         copy derivedCachedDataTypesToRetrieve).
777
778         * Modules/fetch/FetchRequest.cpp:
779         (WebCore::buildOptions):
780         (WebCore::FetchRequest::initializeOptions):
781         * Modules/fetch/FetchRequest.h:
782         Switch to using the integrity metadata on the fetchOptions, removing the need to
783         store them directly on the internal request.
784
785         * loader/DocumentThreadableLoader.cpp:
786         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
787         (WebCore::DocumentThreadableLoader::didReceiveResponse):
788         (WebCore::DocumentThreadableLoader::didReceiveData):
789         (WebCore::DocumentThreadableLoader::didFinishLoading):
790         (WebCore::DocumentThreadableLoader::loadRequest):
791         (WebCore::DocumentThreadableLoader::reportIntegrityMetadataError):
792         * loader/DocumentThreadableLoader.h:
793         Add a new flag, m_delayCallbacksForIntegrityCheck, which is used when integrity metadata
794         is present, so we can implement the 'wait' concept from the fetch spec, and delay informing
795         the clients until we have validated the integrity metadata.
796
797 2017-05-09  Commit Queue  <commit-queue@webkit.org>
798
799         Unreviewed, rolling out r216545.
800         https://bugs.webkit.org/show_bug.cgi?id=171889
801
802         Caused a test failure (Requested by eric_carlson on #webkit).
803
804         Reverted changeset:
805
806         "[MediaStream] deviceId constraint doesn't work with
807         getUserMedia"
808         https://bugs.webkit.org/show_bug.cgi?id=171877
809         http://trac.webkit.org/changeset/216545
810
811 2017-05-09  Zalan Bujtas  <zalan@apple.com>
812
813         resetFlowThreadContainingBlockAndChildInfoIncludingDescendants should not ignore RenderElement subtrees.
814         https://bugs.webkit.org/show_bug.cgi?id=171873
815         <rdar://problem/32004954>
816
817         Reviewed by Simon Fraser.
818
819         Normally a RenderBlock's parent is another RenderBlock, but In some cases (e.g. tables) a RenderBlock can
820         have a non-RenderBlock(RenderBox) ancestor.
821         While updating the flow thread state on a subtree, we should descent into subtrees with RenderElement
822         roots and not just RenderBlocks so that we clear the state on the entire subtree.
823
824         Test: fast/multicol/crash-when-column-inside-table.html
825
826         * rendering/RenderBlock.cpp:
827         (WebCore::RenderBlock::resetFlowThreadContainingBlockAndChildInfoIncludingDescendants):
828         * rendering/RenderBlock.h:
829         * rendering/RenderElement.cpp:
830         (WebCore::RenderElement::resetFlowThreadContainingBlockAndChildInfoIncludingDescendants):
831         * rendering/RenderElement.h:
832
833 2017-05-09  Eric Carlson  <eric.carlson@apple.com>
834
835         [MediaStream] deviceId constraint doesn't work with getUserMedia
836         https://bugs.webkit.org/show_bug.cgi?id=171877
837         <rdar://problem/31899730>
838
839         Reviewed by Jer Noble.
840
841         Test: fast/mediastream/get-user-media-device-id.html
842
843         * Modules/mediastream/MediaConstraintsImpl.h:
844         (WebCore::MediaConstraintsData::MediaConstraintsData): Add a constructor that 
845         takes a const MediaConstraints&.
846
847         * Modules/mediastream/MediaDevicesEnumerationRequest.cpp:
848         (WebCore::MediaDevicesEnumerationRequest::topLevelDocumentOrigin): Don't return
849         NULL for the main frame so the origin matches that returned for a UserMediaRequest.
850
851         * Modules/mediastream/UserMediaController.h:
852         (WebCore::UserMediaController::setDeviceIDHashSalt): Deleted, not used.
853         (WebCore::UserMediaController::deviceIDHashSalt): Deleted, not used.
854
855         * Modules/mediastream/UserMediaRequest.cpp:
856         (WebCore::UserMediaRequest::allow): Add device ID hash salt parameter, set it on
857         constraints.
858         * Modules/mediastream/UserMediaRequest.h:
859
860         * platform/mediastream/MediaConstraints.h:
861         * platform/mediastream/RealtimeMediaSource.cpp:
862         (WebCore::RealtimeMediaSource::fitnessDistance): ASSERT if called for DeviceId.
863         (WebCore::RealtimeMediaSource::selectSettings): Special case DeviceId because it
864         we have to hash the device ID before comparing, and because the DeviceId can't be
865         changed so it should never be added to the flattened constraints.
866
867         * platform/mediastream/RealtimeMediaSourceSupportedConstraints.cpp:
868         (WebCore::RealtimeMediaSourceSupportedConstraints::nameForConstraint): Deleted, unused.
869         (WebCore::RealtimeMediaSourceSupportedConstraints::constraintFromName): Deleted, unused.
870         * platform/mediastream/RealtimeMediaSourceSupportedConstraints.h:
871
872         * platform/mediastream/mac/AVVideoCaptureSource.mm:
873         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
874         (WebCore::RealtimeMediaSourceCenterMac::bestSourcesForTypeAndConstraints): Pass device
875         id, not empty string.
876
877 2017-05-09  Antoine Quint  <graouts@apple.com>
878
879         [Modern Media Controls] Localized strings aren't loaded
880         https://bugs.webkit.org/show_bug.cgi?id=171884
881
882         Reviewed by Dean Jackson.
883
884         Remove the extraneous file extension in the file name.
885
886         * rendering/RenderThemeIOS.mm:
887         (WebCore::RenderThemeIOS::mediaControlsScript):
888         * rendering/RenderThemeMac.mm:
889         (WebCore::RenderThemeMac::mediaControlsScript):
890
891 2017-05-09  Chris Dumez  <cdumez@apple.com>
892
893         Introduce DocumentAndElementEventHandlers IDL interface
894         https://bugs.webkit.org/show_bug.cgi?id=171879
895
896         Reviewed by Simon Fraser and Ryosuke Niwa.
897
898         Introduce DocumentAndElementEventHandlers IDL interface:
899         - https://html.spec.whatwg.org/#documentandelementeventhandlers
900
901         This avoids duplication between Document.idl and Element.idl.
902
903         Also mark oncopy / oncut / onpaste EventHandlers as enumerable to match
904         the specification.
905
906         Test: fast/events/DocumentAndElementEventHandlers.html
907
908         * CMakeLists.txt:
909         * DerivedSources.make:
910         * WebCore.xcodeproj/project.pbxproj:
911         * dom/Document.idl:
912         * dom/DocumentAndElementEventHandlers.idl: Added.
913         * dom/Element.idl:
914
915 2017-05-10  Dean Jackson  <dino@apple.com>
916
917         Restrict SVG filters to accessible security origins
918         https://bugs.webkit.org/show_bug.cgi?id=118689
919         <rdar://problem/27362159>
920
921         Reviewed by Brent Fulgham.
922
923         Certain SVG filters should only be allowed to operate
924         on content that is has SecurityOrigin access to. Implement
925         this by including a flag in PaintInfo and LayerPaintingInfo,
926         and have RenderWidget make sure the documents have acceptable
927         SecurityOrigins as it goes to paint.
928
929         This could be used as the first step in a "safe painting"
930         strategy, allowing some content to be rendered into a 
931         canvas or via the element() CSS function... but it is only
932         a small first step.
933
934         Test: http/tests/css/filters-on-iframes.html
935
936         * page/FrameView.cpp:
937         (WebCore::FrameView::paintContents):
938         * page/FrameView.h:
939         * platform/ScrollView.cpp:
940         (WebCore::ScrollView::paint):
941         * platform/ScrollView.h:
942         * platform/Scrollbar.cpp:
943         (WebCore::Scrollbar::paint):
944         * platform/Scrollbar.h:
945         * platform/Widget.h:
946         * platform/graphics/filters/FilterOperation.h:
947         (WebCore::FilterOperation::shouldBeRestrictedBySecurityOrigin):
948         * platform/graphics/filters/FilterOperations.cpp:
949         (WebCore::FilterOperations::hasFilterThatShouldBeRestrictedBySecurityOrigin):
950         * platform/graphics/filters/FilterOperations.h:
951         * platform/mac/WidgetMac.mm:
952         (WebCore::Widget::paint):
953         * rendering/FilterEffectRenderer.cpp:
954         (WebCore::FilterEffectRenderer::build):
955         * rendering/FilterEffectRenderer.h:
956         * rendering/PaintInfo.h:
957         (WebCore::PaintInfo::PaintInfo):
958         * rendering/RenderLayer.cpp:
959         (WebCore::RenderLayer::paint):
960         (WebCore::RenderLayer::setupFilters):
961         (WebCore::RenderLayer::paintForegroundForFragmentsWithPhase):
962         * rendering/RenderLayer.h:
963         * rendering/RenderScrollbar.cpp:
964         (WebCore::RenderScrollbar::paint):
965         * rendering/RenderScrollbar.h:
966         * rendering/RenderWidget.cpp:
967         (WebCore::RenderWidget::paintContents):
968
969 2017-05-09  Chris Dumez  <cdumez@apple.com>
970
971         Move onanimation* EventHandlers to GlobalEventHandlers
972         https://bugs.webkit.org/show_bug.cgi?id=171874
973
974         Reviewed by Simon Fraser.
975
976         Move onanimation* EventHandlers to GlobalEventHandlers to match the specification:
977         - https://drafts.csswg.org/css-animations/#interface-globaleventhandlers-idl
978
979         We previously have those on Window and Element only. Firefox complies with the
980         specification.
981
982         Test: fast/css/onanimation-eventhandlers.html
983
984         * dom/Element.idl:
985         * dom/GlobalEventHandlers.idl:
986         * page/DOMWindow.idl:
987
988 2017-05-09  Youenn Fablet  <youenn@apple.com>
989
990         Refresh webrtc WPT tests
991         https://bugs.webkit.org/show_bug.cgi?id=171878
992
993         Reviewed by Eric Carlson.
994
995         Tests: imported/w3c/web-platform-tests/webrtc/RTCConfiguration-iceCandidatePoolSize.html
996                imported/w3c/web-platform-tests/webrtc/RTCDataChannel-id.html
997                imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-canTrickleIceCandidates.html
998                imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-constructor.html
999                imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-createDataChannel.html
1000                imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-iceGatheringState.html
1001                imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-idl.html
1002                imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-setRemoteDescription.html
1003                imported/w3c/web-platform-tests/webrtc/datachannel-idlharness.html
1004                imported/w3c/web-platform-tests/webrtc/getstats.html
1005                imported/w3c/web-platform-tests/webrtc/interfaces.html
1006
1007         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1008         (WebCore::LibWebRTCMediaEndpoint::createDataChannel): exiting early if libwebrtc is not creating a data channel.
1009
1010 2017-05-09  Javier Fernandez  <jfernandez@igalia.com>
1011
1012         space-evenly misbehaves with flexbox
1013         https://bugs.webkit.org/show_bug.cgi?id=170445
1014
1015         Reviewed by David Hyatt.
1016
1017         The CSS Box Alignment specification defines the <content-distribution>
1018         set as some of the allowed values for the Content Distribution
1019         properties, align-content and justify-content. The 'space-evenly' value
1020         is not among the ones allowed for these properties according to the CSS
1021         Flexible Box specification.
1022
1023         The CSS Flexbible box specification states that it must follow the CSS
1024         Box Alignment specification, so this new value must be considered as
1025         part of an upgraded level of the spec, which should be implemented
1026         eventually.
1027
1028         Since we have already shipped an implementation of the new CSS Box
1029         Alignment values for CSS Grid Layout, we need to implement it for
1030         Flexbox as well.
1031
1032         No new tests, but several new test cases added.
1033
1034         * rendering/RenderFlexibleBox.cpp:
1035         (WebCore::initialJustifyContentOffset):
1036         (WebCore::justifyContentSpaceBetweenChildren):
1037         (WebCore::initialAlignContentOffset):
1038         (WebCore::alignContentSpaceBetweenChildren):
1039
1040 2017-05-09  Michael Catanzaro  <mcatanzaro@igalia.com>
1041
1042         Avoid -Wformat warnings in RenderLayerCompositor.cpp and RenderLayerBacking.cpp
1043         https://bugs.webkit.org/show_bug.cgi?id=171875
1044
1045         Reviewed by Simon Fraser.
1046
1047         * rendering/RenderLayerBacking.cpp:
1048         (WebCore::RenderLayerBacking::detachFromScrollingCoordinator):
1049         * rendering/RenderLayerCompositor.cpp:
1050         (WebCore::RenderLayerCompositor::logLayerInfo):
1051         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
1052
1053 2017-05-09  Chris Dumez  <cdumez@apple.com>
1054
1055         Drop custom bindings code for Window.location setter
1056         https://bugs.webkit.org/show_bug.cgi?id=171846
1057
1058         Reviewed by Sam Weinig.
1059
1060         Drop custom bindings code for Window.location setter as the custom code was merely needed
1061         to address a very old Mac widget that has long been fixed (rdar://problem/5695330).
1062
1063         No new tests, no Web-facing behavior change.
1064
1065         * bindings/js/JSDOMWindowCustom.cpp:
1066         (WebCore::JSDOMWindow::setLocation): Deleted.
1067         Drop custom code.
1068
1069         * page/DOMWindow.idl:
1070         Align Window.location with https://html.spec.whatwg.org/#the-window-object:
1071         - Mark property as readonly.
1072         - Add [PutsForward=href] IDL extended attribute.
1073         Also, we need to mark the atribute as nullable as this reflects our current implementation.
1074         We currently return null if the associated Window does not have a frame. This does not match
1075         the specification and we should update our implementation in the future to never return null.
1076
1077 2017-05-09  Matt Lewis  <jlewis3@apple.com>
1078
1079         Unreviewed, rolling out r216508.
1080
1081         The layout test enabled in this change is failing on Sierra.
1082
1083         Reverted changeset:
1084
1085         "Invalid MediaSource duration value should throw TyperError
1086         instead of InvalidStateError"
1087         https://bugs.webkit.org/show_bug.cgi?id=171653
1088         http://trac.webkit.org/changeset/216508
1089
1090 2017-05-09  Michael Catanzaro  <mcatanzaro@igalia.com>
1091
1092         Update Chrome and Firefox versions in user agent quirks
1093         https://bugs.webkit.org/show_bug.cgi?id=171823
1094
1095         Reviewed by Carlos Alberto Lopez Perez.
1096
1097         * platform/UserAgentQuirks.cpp:
1098         (WebCore::UserAgentQuirks::stringForQuirk):
1099         (WebCore::UserAgentQuirks::firefoxRevisionString):
1100
1101 2017-05-09  Youenn Fablet  <youenn@apple.com>
1102
1103         RealtimeOutgoingAudioSource is crashing when given data with more than two channels
1104         https://bugs.webkit.org/show_bug.cgi?id=171868
1105
1106         Reviewed by Eric Carlson.
1107
1108         Manual testing.
1109
1110         * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
1111         (WebCore::libwebrtcAudioFormat): Capping the number of channels to 2.
1112         (WebCore::RealtimeOutgoingAudioSource::audioSamplesAvailable):
1113
1114 2017-05-09  Myles C. Maxfield  <mmaxfield@apple.com>
1115
1116         font-stretch: normal selects expanded fonts instead of condensed fonts
1117         https://bugs.webkit.org/show_bug.cgi?id=171838
1118         <rdar://problem/31005481>
1119
1120         Reviewed by Jon Lee.
1121
1122         CSS Fonts level 3 says: "If the value of ‘font-stretch’ is ‘normal’ or one of the condensed
1123         values, narrower width values are checked first, then wider values."
1124
1125         CSS Fonts level 4 erroneously was incompatible with this, but was updated in
1126         https://github.com/w3c/csswg-drafts/commit/4559389d183bbaaf3321af5ba1c924caa7c488bb
1127         to be consistent with this.
1128
1129         Now, CSS Fonts level 4 states: "If the desired stretch value is less than or equal to100,
1130         stretch values below the desired stretch value are checked in descending order followed by
1131         stretch values above the desired stretch value in ascending order"
1132
1133         Test: fast/text/font-width-100.html
1134
1135         * platform/graphics/FontSelectionAlgorithm.cpp:
1136
1137 2017-05-09  Romain Bellessort  <romain.bellessort@crf.canon.fr>
1138
1139         [Readable Streams API] Enable creation of ReadableStreamBYOBReader
1140         https://bugs.webkit.org/show_bug.cgi?id=171665
1141
1142         Reviewed by Youenn Fablet.
1143
1144         Enabled the creation of ReadableStreamBYOBReader.
1145
1146         Test: streams/readable-stream-byob-reader.html
1147
1148         * CMakeLists.txt: Updated to support ReadableStreamBYOBReader.
1149         * DerivedSources.cpp: Updated to support ReadableStreamBYOBReader.
1150         * DerivedSources.make: Updated to support ReadableStreamBYOBReader.
1151         * Modules/streams/ReadableByteStreamInternals.js: Updated to support ReadableStreamBYOBReader.
1152         (privateInitializeReadableStreamBYOBReader):
1153         (isReadableStreamBYOBReader):
1154         * Modules/streams/ReadableStream.js: Updated to support ReadableStreamBYOBReader.
1155         (getReader):
1156         * Modules/streams/ReadableStreamBYOBReader.idl: Added.
1157         * Modules/streams/ReadableStreamBYOBReader.js: Added.
1158         (cancel): To be implemented.
1159         (read): To be implemented.
1160         (releaseLock): To be implemented.
1161         (closed): To be implemented.
1162         * WebCore.xcodeproj/project.pbxproj: Updated to support ReadableStreamBYOBReader.
1163         * bindings/js/JSDOMGlobalObject.cpp: Updated to support ReadableStreamBYOBReader.
1164         (WebCore::JSDOMGlobalObject::addBuiltinGlobals):
1165         * bindings/js/JSReadableStreamPrivateConstructors.cpp: Updated to support ReadableStreamBYOBReader.
1166         (WebCore::constructJSReadableStreamReaderGeneric):
1167         (WebCore::constructJSReadableStreamDefaultReader):
1168         (WebCore::constructJSReadableStreamBYOBReader):
1169         (WebCore::JSBuiltinReadableStreamBYOBReaderPrivateConstructor::initializeExecutable):
1170         (WebCore::createReadableStreamBYOBReaderPrivateConstructor):
1171         * bindings/js/JSReadableStreamPrivateConstructors.h: Updated to support ReadableStreamBYOBReader.
1172         * bindings/js/WebCoreBuiltinNames.h: Updated to support ReadableStreamBYOBReader.
1173
1174 2017-05-09  Frederic Wang  <fwang@igalia.com>
1175
1176         Print more properties in the output of scrolling trees
1177         https://bugs.webkit.org/show_bug.cgi?id=171858
1178
1179         Reviewed by Simon Fraser.
1180
1181         No new tests, no behavior changes.
1182
1183         * page/scrolling/ScrollingCoordinator.cpp: Implement << operator to print ScrollableAreaParameters.
1184         (WebCore::operator<<):
1185         * page/scrolling/ScrollingCoordinator.h: Declare new << operator.
1186         * page/scrolling/ScrollingStateFrameScrollingNode.cpp: Print new properties.
1187         (WebCore::ScrollingStateFrameScrollingNode::dumpProperties):
1188         * page/scrolling/ScrollingStateScrollingNode.cpp: ditto.
1189         (WebCore::ScrollingStateScrollingNode::dumpProperties):
1190         * page/scrolling/ScrollingTreeScrollingNode.cpp: ditto.
1191         (WebCore::ScrollingTreeScrollingNode::dumpProperties):
1192
1193 2017-05-09  Chris Dumez  <cdumez@apple.com>
1194
1195         ontransitionend eventHandler should be in GlobalEventHandlers
1196         https://bugs.webkit.org/show_bug.cgi?id=171836
1197
1198         Reviewed by Ryosuke Niwa.
1199
1200         ontransitionend eventHandler should be in GlobalEventHandlers:
1201         - https://drafts.csswg.org/css-transitions/#interface-globaleventhandlers-idl
1202
1203         WebKit currently has in on Window and Element only. Firefox matches the specification.
1204
1205         Test: fast/css/ontransitionend-eventhandler.html
1206
1207         * dom/Element.idl:
1208         * dom/GlobalEventHandlers.idl:
1209         * page/DOMWindow.idl:
1210
1211 2017-05-09  Nael Ouedraogo  <nael.ouedraogo@crf.canon.fr>
1212
1213         MediaSource.readyState should use an IDL enum
1214         https://bugs.webkit.org/show_bug.cgi?id=171672
1215
1216         Reviewed by Eric Carlson and Chris Dumez.
1217
1218         MediaSource.readyState should use an IDL enum as per specification
1219         (https://www.w3.org/TR/2016/CR-media-source-20160503/#idl-def-ReadyState).
1220
1221         No new tests required since no behavior change.
1222
1223         * Modules/mediasource/MediaSource.cpp:
1224         (WebCore::toString):
1225         (WebCore::MediaSource::MediaSource):
1226         (WebCore::MediaSource::setPrivateAndOpen):
1227         (WebCore::MediaSource::buffered):
1228         (WebCore::MediaSource::setReadyState):
1229         (WebCore::MediaSource::streamEndedWithError):
1230         (WebCore::MediaSource::isOpen):
1231         (WebCore::MediaSource::isClosed):
1232         (WebCore::MediaSource::isEnded):
1233         (WebCore::MediaSource::detachFromElement):
1234         (WebCore::MediaSource::openIfInEndedState):
1235         (WebCore::MediaSource::stop):
1236         (WebCore::MediaSource::onReadyStateChange):
1237         * Modules/mediasource/MediaSource.h:
1238         * Modules/mediasource/MediaSource.idl:
1239
1240 2017-05-09  Nael Ouedraogo  <nael.ouedraogo@crf.canon.fr>
1241
1242         Invalid MediaSource duration value should throw TyperError instead of InvalidStateError
1243         https://bugs.webkit.org/show_bug.cgi?id=171653
1244
1245         Reviewed by Youenn Fablet.
1246
1247         Modify MediaSource::setDuration to throw a TypeError when duration value is invalid as per MSE specification
1248         (https://www.w3.org/TR/2016/REC-media-source-20161117/#dom-mediasource-duration).
1249
1250         Update expectation of corresponding WPT test.
1251
1252         * Modules/mediasource/MediaSource.cpp:
1253         (WebCore::MediaSource::setDuration):
1254         (WebCore::MediaSource::setDurationInternal):
1255
1256 2017-05-09  Yusuke Suzuki  <utatane.tea@gmail.com>
1257
1258         Unreviewed, update binding-tests results
1259         https://bugs.webkit.org/show_bug.cgi?id=166752
1260
1261         * bindings/scripts/test/JS/JSTestNode.cpp:
1262         * bindings/scripts/test/JS/JSTestObj.cpp:
1263
1264 2017-05-09  Chris Dumez  <cdumez@apple.com>
1265
1266         Update DocumentOrShadowRoot.idl to match specifications
1267         https://bugs.webkit.org/show_bug.cgi?id=171845
1268
1269         Reviewed by Ryosuke Niwa.
1270
1271         Update DocumentOrShadowRoot.idl to match specifications:
1272         - https://dom.spec.whatwg.org/#mixin-documentorshadowroot
1273         - https://w3c.github.io/webcomponents/spec/shadow/#extensions-to-the-documentorshadowroot-mixin
1274         - https://w3c.github.io/pointerlock/#extensions-to-the-documentorshadowroot-mixin
1275
1276         No Web-facing behavior change. Things that do not match the specification were merely
1277         annotated with FIXME comments.
1278
1279         * dom/Document.idl:
1280         * dom/DocumentOrShadowRoot.idl:
1281
1282 2017-05-09  Yusuke Suzuki  <utatane.tea@gmail.com>
1283
1284         Unreviewed, attempt to fix macOS ports using ApplePay
1285         https://bugs.webkit.org/show_bug.cgi?id=166752
1286
1287         * bindings/scripts/CodeGeneratorJS.pm:
1288         (GenerateImplementation):
1289
1290 2017-05-09  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>
1291
1292         [Coordinated Graphics] Debug Visuals don't hide
1293         https://bugs.webkit.org/show_bug.cgi?id=162704
1294
1295         Reviewed by Žan Doberšek.
1296
1297         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
1298         (WebCore::CoordinatedGraphicsLayer::setShowDebugBorder):
1299         (WebCore::CoordinatedGraphicsLayer::setShowRepaintCounter):
1300         (WebCore::CoordinatedGraphicsLayer::syncLayerState):
1301         (WebCore::CoordinatedGraphicsLayer::setDebugBorder):
1302         showDebugBorders() and showRepaintCounter() of CoordinatedGraphicsLayer should reflect
1303         the "show" argument to the layer state.
1304
1305         * platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
1306         (WebCore::DebugVisuals::DebugVisuals):
1307         (WebCore::CoordinatedGraphicsLayerState::CoordinatedGraphicsLayerState):
1308         To set the debug visuals of a layer, the visibility flags of the borders and the repaint
1309         counters as well as the border width and color are needed. Thus a new bundle struct
1310         DebugVisuals and its change flag debugVisualsChanged have been introduced in order to
1311         send the information at once.
1312
1313 2017-05-09  Yusuke Suzuki  <utatane.tea@gmail.com>
1314
1315         Handle IDLPromise<> properly
1316         https://bugs.webkit.org/show_bug.cgi?id=166752
1317
1318         Reviewed by Youenn Fablet.
1319
1320         This patch implements WebIDL Promise type conversion. According to the spec,
1321         Promise takes a value and convert it to Promise by using Promise.resolve function.
1322         We implement JSPromise::resolve in JSC and use it in JSDOMConvertPromise.
1323
1324         In conversion phase, we just convert the value to JSC::JSPromise* and hold it in
1325         PromiseRejectionEvent. On the other hand, In this patch, we newly introduce a new
1326         type DOMPromise and use it in RejectedPromiseTracker. And we also rename the previous
1327         DOMPromise to DOMPromiseDeferred since it is corresponding to JSPromiseDeferred.
1328         DOMPromise is DOMGuarded object. So it is strongly referenced from ScriptExecutionContext
1329         and it is weakly referenced from the object itself. This is important since Strong<JSPromise>
1330         reference in C++ object that has a wrapper (in this case, PromiseRejectionEvent) easily causes
1331         cyclic reference. We hold it as DOMPromise instead of Strong<JSPromise> in RejectedPromiseTracker
1332         to break the cyclic reference edge with weak reference.
1333
1334         In the meantime, we still use JSC::Strong<> in PromiseRejectionEvent. It leaks memory if promise
1335         refers the wrapper object of PromiseRejectionEvent. CustomEvent also has the same problem.
1336         This is a general problem that `attribute any` can create cyclic reference. And they should be
1337         fixed in a different patch.
1338
1339         Currently, we do not take the following approach. e.g. There is C++ object that represents Promise.
1340         And its wrapper object is JSPromise thing. When exposing the C++ object, it will be converted to a
1341         wrapper object. We do not take this approach because PromiseRejectionEvent can take user-provided promise.
1342         For example, users can create PromiseRejectionEvent in a form
1343         `new PromiseRejectionEvent("...", { promise: promise })`. In this case, `event.promise === promise`
1344         is required. And this is not suitable for the above C++ object model.
1345
1346         Large part of this patch is mechanical one to replace DOMPromise with DOMPromiseDeferred.
1347
1348         * CMakeLists.txt:
1349         * Modules/applepay/ApplePaySession.cpp:
1350         * Modules/encryptedmedia/MediaKeySession.h:
1351         * Modules/encryptedmedia/MediaKeySystemAccess.h:
1352         * Modules/encryptedmedia/MediaKeys.h:
1353         * Modules/encryptedmedia/NavigatorEME.h:
1354         * Modules/fetch/DOMWindowFetch.h:
1355         * Modules/fetch/FetchBody.h:
1356         * Modules/fetch/FetchBodyConsumer.h:
1357         * Modules/fetch/FetchResponse.h:
1358         * Modules/fetch/WorkerGlobalScopeFetch.h:
1359         * Modules/mediastream/MediaDevices.h:
1360         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
1361         (WebCore::MediaEndpointPeerConnection::replaceTrack):
1362         (WebCore::MediaEndpointPeerConnection::replaceTrackTask):
1363         * Modules/mediastream/MediaEndpointPeerConnection.h:
1364         * Modules/mediastream/MediaStreamTrack.cpp:
1365         (WebCore::MediaStreamTrack::applyConstraints):
1366         * Modules/mediastream/MediaStreamTrack.h:
1367         * Modules/mediastream/PeerConnectionBackend.cpp:
1368         (WebCore::PeerConnectionBackend::setLocalDescription):
1369         (WebCore::PeerConnectionBackend::setRemoteDescription):
1370         (WebCore::PeerConnectionBackend::addIceCandidate):
1371         * Modules/mediastream/PeerConnectionBackend.h:
1372         (WebCore::PeerConnectionBackend::endOfIceCandidates):
1373         * Modules/mediastream/RTCPeerConnection.cpp:
1374         (WebCore::RTCPeerConnection::queuedSetLocalDescription):
1375         (WebCore::RTCPeerConnection::queuedSetRemoteDescription):
1376         (WebCore::RTCPeerConnection::queuedAddIceCandidate):
1377         (WebCore::RTCPeerConnection::enqueueReplaceTrackTask):
1378         (WebCore::RTCPeerConnection::replaceTrack):
1379         * Modules/mediastream/RTCPeerConnection.h:
1380         * Modules/mediastream/RTCRtpSender.cpp:
1381         (WebCore::RTCRtpSender::replaceTrack):
1382         * Modules/mediastream/RTCRtpSender.h:
1383         * Modules/mediastream/UserMediaRequest.cpp:
1384         (WebCore::UserMediaRequest::start):
1385         (WebCore::UserMediaRequest::UserMediaRequest):
1386         * Modules/mediastream/UserMediaRequest.h:
1387         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
1388         (WebCore::LibWebRTCPeerConnectionBackend::replaceTrack):
1389         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
1390         * Modules/streams/ReadableStreamSource.h:
1391         (WebCore::ReadableStreamSource::start):
1392         (WebCore::ReadableStreamSource::pull):
1393         * Modules/webaudio/AudioContext.cpp:
1394         (WebCore::AudioContext::addReaction):
1395         (WebCore::AudioContext::setState):
1396         (WebCore::AudioContext::suspend):
1397         (WebCore::AudioContext::resume):
1398         (WebCore::AudioContext::close):
1399         * Modules/webaudio/AudioContext.h:
1400         * WebCore.xcodeproj/project.pbxproj:
1401         * bindings/IDLTypes.h:
1402         * bindings/js/CachedModuleScriptLoaderClient.h:
1403         * bindings/js/JSBindingsAllInOne.cpp:
1404         * bindings/js/JSCustomElementRegistryCustom.cpp:
1405         * bindings/js/JSDOMConvertPromise.h:
1406         (WebCore::Converter<IDLPromise<T>>::convert):
1407         (WebCore::JSConverter<IDLPromise<T>>::convert):
1408         * bindings/js/JSDOMExceptionHandling.cpp:
1409         * bindings/js/JSDOMGlobalObject.cpp:
1410         * bindings/js/JSDOMGuardedObject.h:
1411         * bindings/js/JSDOMPromise.h:
1412         (WebCore::DOMPromise::create):
1413         (WebCore::DOMPromise::promise):
1414         (WebCore::DOMPromise::DOMPromise):
1415         (WebCore::DeferredPromise::create): Deleted.
1416         (WebCore::DeferredPromise::resolve): Deleted.
1417         (WebCore::DeferredPromise::resolveWithNewlyCreated): Deleted.
1418         (WebCore::DeferredPromise::reject): Deleted.
1419         (WebCore::DeferredPromise::resolveWithCallback): Deleted.
1420         (WebCore::DeferredPromise::rejectWithCallback): Deleted.
1421         (WebCore::DeferredPromise::DeferredPromise): Deleted.
1422         (WebCore::DeferredPromise::deferred): Deleted.
1423         (WebCore::DOMPromiseBase::DOMPromiseBase): Deleted.
1424         (WebCore::DOMPromiseBase::operator=): Deleted.
1425         (WebCore::DOMPromiseBase::reject): Deleted.
1426         (WebCore::DOMPromiseBase::rejectType): Deleted.
1427         (WebCore::DOMPromiseBase::promise): Deleted.
1428         (WebCore::DOMPromise::resolve): Deleted.
1429         (WebCore::DOMPromise<void>::resolve): Deleted.
1430         (WebCore::callPromiseFunction): Deleted.
1431         (WebCore::bindingPromiseFunctionAdapter): Deleted.
1432         * bindings/js/JSDOMPromiseDeferred.cpp: Renamed from Source/WebCore/bindings/js/JSDOMPromise.cpp.
1433         (WebCore::DeferredPromise::promise):
1434         (WebCore::DeferredPromise::callFunction):
1435         (WebCore::DeferredPromise::reject):
1436         (WebCore::rejectPromiseWithExceptionIfAny):
1437         (WebCore::createDeferredPromise):
1438         (WebCore::createRejectedPromiseWithTypeError):
1439         (WebCore::parseAsJSON):
1440         (WebCore::fulfillPromiseWithJSON):
1441         (WebCore::fulfillPromiseWithArrayBuffer):
1442         * bindings/js/JSDOMPromiseDeferred.h: Copied from Source/WebCore/bindings/js/JSDOMPromise.h.
1443         (WebCore::DeferredPromise::create):
1444         (WebCore::DeferredPromise::resolve):
1445         (WebCore::DeferredPromise::resolveWithNewlyCreated):
1446         (WebCore::DeferredPromise::reject):
1447         (WebCore::DeferredPromise::resolveWithCallback):
1448         (WebCore::DeferredPromise::rejectWithCallback):
1449         (WebCore::DeferredPromise::DeferredPromise):
1450         (WebCore::DeferredPromise::deferred):
1451         (WebCore::DOMPromiseDeferredBase::DOMPromiseDeferredBase):
1452         (WebCore::DOMPromiseDeferredBase::operator=):
1453         (WebCore::DOMPromiseDeferredBase::reject):
1454         (WebCore::DOMPromiseDeferredBase::rejectType):
1455         (WebCore::DOMPromiseDeferredBase::promise):
1456         (WebCore::DOMPromiseDeferred::resolve):
1457         (WebCore::DOMPromiseDeferred<void>::resolve):
1458         (WebCore::callPromiseFunction):
1459         (WebCore::bindingPromiseFunctionAdapter):
1460         * bindings/js/JSSubtleCryptoCustom.cpp:
1461         * bindings/js/JSWebGPUCommandBufferCustom.cpp:
1462         * bindings/js/JSWebKitSubtleCryptoCustom.cpp:
1463         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp: Added.
1464         (WebCore::convertDictionary<TestPromiseRejectionEvent::Init>):
1465         (WebCore::JSTestPromiseRejectionEventPrototype::create):
1466         (WebCore::JSTestPromiseRejectionEventPrototype::createStructure):
1467         (WebCore::JSTestPromiseRejectionEventPrototype::JSTestPromiseRejectionEventPrototype):
1468         (WebCore::JSTestPromiseRejectionEventConstructor::construct):
1469         (WebCore::JSTestPromiseRejectionEventConstructor::prototypeForStructure):
1470         (WebCore::JSTestPromiseRejectionEventConstructor::initializeProperties):
1471         (WebCore::JSTestPromiseRejectionEventPrototype::finishCreation):
1472         (WebCore::JSTestPromiseRejectionEvent::JSTestPromiseRejectionEvent):
1473         (WebCore::JSTestPromiseRejectionEvent::finishCreation):
1474         (WebCore::JSTestPromiseRejectionEvent::createPrototype):
1475         (WebCore::JSTestPromiseRejectionEvent::prototype):
1476         (WebCore::BindingCaller<JSTestPromiseRejectionEvent>::castForAttribute):
1477         (WebCore::jsTestPromiseRejectionEventPromise):
1478         (WebCore::jsTestPromiseRejectionEventPromiseGetter):
1479         (WebCore::jsTestPromiseRejectionEventReason):
1480         (WebCore::jsTestPromiseRejectionEventReasonGetter):
1481         (WebCore::jsTestPromiseRejectionEventConstructor):
1482         (WebCore::setJSTestPromiseRejectionEventConstructor):
1483         (WebCore::JSTestPromiseRejectionEvent::getConstructor):
1484         (WebCore::toJSNewlyCreated):
1485         (WebCore::toJS):
1486         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.h: Added.
1487         (WebCore::JSTestPromiseRejectionEvent::create):
1488         (WebCore::JSTestPromiseRejectionEvent::createStructure):
1489         (WebCore::JSTestPromiseRejectionEvent::wrapped):
1490         (WebCore::toJS):
1491         (WebCore::toJSNewlyCreated):
1492         * bindings/scripts/test/TestPromiseRejectionEvent.idl: Copied from Source/WebCore/bindings/js/CachedModuleScriptLoaderClient.h.
1493         * css/FontFace.h:
1494         * css/FontFaceSet.h:
1495         * dom/CustomElementRegistry.h:
1496         * dom/PromiseRejectionEvent.h:
1497         * dom/RejectedPromiseTracker.cpp:
1498         (WebCore::UnhandledPromise::UnhandledPromise):
1499         (WebCore::UnhandledPromise::callStack):
1500         (WebCore::UnhandledPromise::promise):
1501         (WebCore::RejectedPromiseTracker::promiseRejected):
1502         (WebCore::RejectedPromiseTracker::promiseHandled):
1503         (WebCore::RejectedPromiseTracker::reportUnhandledRejections):
1504         (WebCore::RejectedPromiseTracker::reportRejectionHandled):
1505         (WebCore::RejectedPromise::RejectedPromise): Deleted.
1506         (WebCore::RejectedPromise::globalObject): Deleted.
1507         (WebCore::RejectedPromise::promise): Deleted.
1508         * dom/RejectedPromiseTracker.h:
1509         * html/HTMLMediaElement.cpp:
1510         (WebCore::HTMLMediaElement::rejectPendingPlayPromises):
1511         (WebCore::HTMLMediaElement::resolvePendingPlayPromises):
1512         (WebCore::HTMLMediaElement::play):
1513         * html/HTMLMediaElement.h:
1514         * platform/graphics/gpu/GPUCommandBuffer.h:
1515         * testing/Internals.h:
1516
1517 2017-05-09  Zan Dobersek  <zdobersek@igalia.com>
1518
1519         Upstream the WPE port
1520         https://bugs.webkit.org/show_bug.cgi?id=171110
1521
1522         Reviewed by Alex Christensen.
1523
1524         webkit-dev thread:
1525         https://lists.webkit.org/pipermail/webkit-dev/2017-April/028923.html
1526
1527         Existing files mostly changed to properly use PLATFORM(WPE) build guards.
1528         In-file changes removed from this ChangeLog entry for brevity.
1529
1530         * CMakeLists.txt:
1531         * PlatformWPE.cmake: Added.
1532         * accessibility/AccessibilityObject.h:
1533         * accessibility/wpe/AXObjectCacheWPE.cpp: Added.
1534         * accessibility/wpe/AccessibilityObjectWPE.cpp: Copied from Source/WebCore/platform/audio/glib/AudioBusGLib.cpp.
1535         * config.h:
1536         * crypto/keys/CryptoKeyEC.h:
1537         * crypto/keys/CryptoKeyRSA.h:
1538         * editing/Editor.cpp:
1539         * editing/Editor.h:
1540         * editing/wpe/EditorWPE.cpp: Added.
1541         * page/EventHandler.cpp:
1542         * page/wpe/EventHandlerWPE.cpp: Added.
1543         * platform/Cursor.h:
1544         * platform/DragData.h:
1545         * platform/DragImage.h:
1546         * platform/FileSystem.h:
1547         * platform/MainThreadSharedTimer.cpp:
1548         * platform/MainThreadSharedTimer.h:
1549         * platform/Pasteboard.h:
1550         * platform/PasteboardStrategy.h:
1551         * platform/PlatformPasteboard.h:
1552         * platform/SchemeRegistry.cpp:
1553         * platform/Widget.h:
1554         * platform/audio/glib/AudioBusGLib.cpp:
1555         * platform/glib/FileSystemGlib.cpp:
1556         * platform/graphics/ANGLEWebKitBridge.h:
1557         * platform/graphics/GLContext.cpp:
1558         * platform/graphics/GLContext.h:
1559         * platform/graphics/GraphicsContext3D.h:
1560         * platform/graphics/OpenGLESShims.h:
1561         * platform/graphics/PlatformDisplay.cpp:
1562         * platform/graphics/PlatformDisplay.h:
1563         * platform/graphics/egl/GLContextEGL.cpp:
1564         * platform/graphics/egl/GLContextEGL.h:
1565         * platform/graphics/egl/GLContextEGLWPE.cpp: Copied from Source/WebCore/platform/audio/glib/AudioBusGLib.cpp.
1566         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1567         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
1568         * platform/graphics/wpe/IconWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
1569         * platform/graphics/wpe/ImageWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
1570         * platform/graphics/wpe/PlatformDisplayWPE.cpp: Added.
1571         * platform/graphics/wpe/PlatformDisplayWPE.h: Added.
1572         * platform/wpe/CursorWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
1573         * platform/wpe/LocalizedStringsWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
1574         * platform/wpe/PasteboardWPE.cpp: Added.
1575         * platform/wpe/PlatformKeyboardEventWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
1576         * platform/wpe/PlatformPasteboardWPE.cpp: Added.
1577         * platform/wpe/PlatformScreenWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
1578         * platform/wpe/RenderThemeWPE.cpp: Copied from Source/WebKit2/Shared/NativeWebWheelEvent.h.
1579         * platform/wpe/RenderThemeWPE.h: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
1580         * platform/wpe/ScrollbarThemeWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
1581         * platform/wpe/ScrollbarThemeWPE.h: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
1582         * platform/wpe/SoundWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
1583         * platform/wpe/ThemeWPE.cpp: Added.
1584         * platform/wpe/ThemeWPE.h: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
1585         * platform/wpe/WidgetWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
1586
1587 2017-05-09  Frederic Wang  <fwang@igalia.com>
1588
1589         Fix property names in ScrollingTreeScrollingNode::dumpProperties
1590         https://bugs.webkit.org/show_bug.cgi?id=171848
1591
1592         Reviewed by Gyuyoung Kim.
1593
1594         No new tests, this function is only used for debugging purpose.
1595
1596         * page/scrolling/ScrollingTreeScrollingNode.cpp:
1597         (WebCore::ScrollingTreeScrollingNode::dumpProperties):
1598
1599 2017-05-09  Carlos Garcia Campos  <cgarcia@igalia.com>
1600
1601         [GTK] Building Webkit2Gtk without OpenGL fails.
1602         https://bugs.webkit.org/show_bug.cgi?id=170959
1603
1604         Reviewed by Žan Doberšek.
1605
1606         * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.cpp:
1607         * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.h:
1608         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h:
1609
1610 2017-05-09  Fujii Hironori  <Hironori.Fujii@sony.com>
1611
1612         [AppleWin] CaptureDeviceManager.cpp: error C2813: #import is not supported with /MP
1613         https://bugs.webkit.org/show_bug.cgi?id=171849
1614
1615         Reviewed by Per Arne Vollan.
1616
1617         * platform/mediastream/CaptureDeviceManager.cpp: Replaced #import with #include.
1618
1619 2017-05-08  Chris Dumez  <cdumez@apple.com>
1620
1621         Refactor / Clean up DOMWindow.idl
1622         https://bugs.webkit.org/show_bug.cgi?id=171843
1623
1624         Reviewed by Ryosuke Niwa.
1625
1626         Refactor / Clean up DOMWindow.idl to match the specification more closely:
1627         - https://html.spec.whatwg.org/#the-window-object
1628
1629         No expected Web-facing change. Things that do not match the specification
1630         have been annotated with FIXME comments.
1631
1632         * page/DOMWindow.idl:
1633
1634 2017-05-08  Frederic Wang  <fwang@igalia.com>
1635
1636         Simplify ScrollingStateNode::scrollingStateTreeAsText
1637         https://bugs.webkit.org/show_bug.cgi?id=171802
1638
1639         Reviewed by Simon Fraser.
1640
1641         The following simplifications are performed:
1642         - Rely on TextStream's internal value to manage indentation.
1643         - Use TextStream::dumpProperty and << to print simple properties.
1644         - Try and use TextStream::GroupScope for groups.
1645
1646         No new tests, only minor format changes in the dumped tree.
1647
1648         * page/scrolling/ScrollingStateFixedNode.cpp:
1649         (WebCore::ScrollingStateFixedNode::dumpProperties):
1650         * page/scrolling/ScrollingStateFixedNode.h:
1651         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
1652         (WebCore::ScrollingStateFrameScrollingNode::dumpProperties):
1653         * page/scrolling/ScrollingStateFrameScrollingNode.h:
1654         * page/scrolling/ScrollingStateNode.cpp:
1655         (WebCore::ScrollingStateNode::dumpProperties):
1656         (WebCore::ScrollingStateNode::dump):
1657         (WebCore::ScrollingStateNode::scrollingStateTreeAsText):
1658         * page/scrolling/ScrollingStateNode.h:
1659         * page/scrolling/ScrollingStateOverflowScrollingNode.cpp:
1660         (WebCore::ScrollingStateOverflowScrollingNode::dumpProperties):
1661         * page/scrolling/ScrollingStateOverflowScrollingNode.h:
1662         * page/scrolling/ScrollingStateScrollingNode.cpp:
1663         (WebCore::ScrollingStateScrollingNode::dumpProperties):
1664         * page/scrolling/ScrollingStateScrollingNode.h:
1665         * page/scrolling/ScrollingStateStickyNode.cpp:
1666         (WebCore::ScrollingStateStickyNode::dumpProperties):
1667         * page/scrolling/ScrollingStateStickyNode.h:
1668
1669 2017-05-08  Youenn Fablet  <youenn@apple.com>
1670
1671         Follow-up to bug 171710: use more references and reject if either audio or video source creation is failing
1672         https://bugs.webkit.org/show_bug.cgi?id=171824
1673
1674         Reviewed by Alex Christensen.
1675
1676         Refactoring to use more references.
1677         Only behavioral change is the rejection of the getUserMedia promise if either audio or video source creation is
1678         failing. Previously, if audio source creation was failing, the promise would still resolve if video source was
1679         sucessfully created.
1680
1681         * platform/mediastream/RealtimeMediaSourceCenter.cpp:
1682         (WebCore::RealtimeMediaSourceCenter::audioFactory):
1683         (WebCore::RealtimeMediaSourceCenter::videoFactory):
1684         (WebCore::RealtimeMediaSourceCenter::audioCaptureDeviceManager):
1685         (WebCore::RealtimeMediaSourceCenter::videoCaptureDeviceManager):
1686         * platform/mediastream/RealtimeMediaSourceCenter.h:
1687         (WebCore::RealtimeMediaSourceCenter::defaultAudioFactory): Deleted.
1688         (WebCore::RealtimeMediaSourceCenter::defaultVideoFactory): Deleted.
1689         (WebCore::RealtimeMediaSourceCenter::defaultAudioCaptureDeviceManager): Deleted.
1690         (WebCore::RealtimeMediaSourceCenter::defaultVideoCaptureDeviceManager): Deleted.
1691         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
1692         (WebCore::RealtimeMediaSourceCenterMac::createMediaStream):
1693         (WebCore::RealtimeMediaSourceCenterMac::getMediaStreamDevices):
1694         (WebCore::RealtimeMediaSourceCenterMac::bestSourcesForTypeAndConstraints):
1695         (WebCore::RealtimeMediaSourceCenterMac::defaultAudioFactory):
1696         (WebCore::RealtimeMediaSourceCenterMac::defaultVideoFactory):
1697         (WebCore::RealtimeMediaSourceCenterMac::defaultAudioCaptureDeviceManager):
1698         (WebCore::RealtimeMediaSourceCenterMac::defaultVideoCaptureDeviceManager):
1699         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.h:
1700         * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.h:
1701         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
1702         (WebCore::MockRealtimeMediaSourceCenter::defaultAudioFactory):
1703         (WebCore::MockRealtimeMediaSourceCenter::defaultVideoFactory):
1704         (WebCore::MockRealtimeMediaSourceCenter::defaultAudioCaptureDeviceManager):
1705         (WebCore::MockRealtimeMediaSourceCenter::defaultVideoCaptureDeviceManager):
1706         * platform/mock/MockRealtimeMediaSourceCenter.h:
1707
1708 2017-05-08  Chris Dumez  <cdumez@apple.com>
1709
1710         Drop [CEReactions] from CharacterData operations
1711         https://bugs.webkit.org/show_bug.cgi?id=171813
1712
1713         Reviewed by Ryosuke Niwa.
1714
1715         Drop [CEReactions] from CharacterData operations to match the DOM specification:
1716         - https://dom.spec.whatwg.org/#interface-characterdata
1717
1718         I believe WebKit had this because Attr used to have Text child nodes. Therefore, modifying
1719         those Text child nodes via the CharacterData API could modify the value of an attribute,
1720         requiring us to run attributeChangedCallback for Custom Elements. However, as of
1721         <https://trac.webkit.org/r216259>, Attr can no longer have Text child nodes.
1722
1723         I have also verified that Blink does not have [CEReactions] for those methods.
1724
1725         No new tests, no expected Web-facing behavior change.
1726
1727         * dom/CharacterData.idl:
1728
1729 2017-05-08  Jeremy Jones  <jeremyj@apple.com>
1730
1731         Remove black background from video layer while in fullscreen.
1732         https://bugs.webkit.org/show_bug.cgi?id=171816
1733
1734         Reviewed by Eric Carlson.
1735
1736         No new tests because no new behavior in DOM.
1737
1738         This changes the background of the video layer to clear when it goes into fullscreen
1739         and back to black when it returns to inline to better facilitate fullsceen animations.
1740
1741         * platform/graphics/avfoundation/objc/VideoFullscreenLayerManager.mm:
1742         (WebCore::VideoFullscreenLayerManager::setVideoLayer):
1743         (WebCore::VideoFullscreenLayerManager::setVideoFullscreenLayer):
1744
1745 2017-05-08  Said Abou-Hallawa  <sabouhallawa@apple.com>
1746
1747         The Incomplete asynchronously decoded image frame should be decoded every time it's drawn
1748         https://bugs.webkit.org/show_bug.cgi?id=170836
1749
1750         Reviewed by Tim Horton.
1751
1752         The asynchronously decoded image frames has to be cached to prevent flickering,
1753         but we have to keep requesting new decoding for the incomplete frame every time
1754         it's drawn. This is to avoid drawing an incomplete image frame even after all
1755         its encoded data is received.
1756
1757         * platform/graphics/BitmapImage.cpp:
1758         (WebCore::BitmapImage::draw):
1759         * platform/graphics/ImageFrameCache.cpp:
1760         (WebCore::ImageFrameCache::cacheAsyncFrameNativeImageAtIndex):
1761         (WebCore::ImageFrameCache::requestFrameAsyncDecodingAtIndex):
1762
1763 2017-05-08  Wenson Hsieh  <wenson_hsieh@apple.com>
1764
1765         Guard DragController::cleanupAfterSystemDrag to only clear drag state on Mac
1766         https://bugs.webkit.org/show_bug.cgi?id=171771
1767         <rdar://problem/32019149>
1768
1769         Reviewed by Tim Horton.
1770
1771         The call to dragEnded here seems to have been added because a client could override Mac WK1
1772         WebUIDelegate methods to cause this cleanup to never be performed. Since this limitation only
1773         applies to Mac, guard it as such.
1774
1775         * page/mac/DragControllerMac.mm:
1776         (WebCore::DragController::cleanupAfterSystemDrag):
1777
1778 2017-05-08  Commit Queue  <commit-queue@webkit.org>
1779
1780         Unreviewed, rolling out r216262.
1781         https://bugs.webkit.org/show_bug.cgi?id=171842
1782
1783         "It regressed JetStream on iOS by 7%" (Requested by saamyjoon
1784         on #webkit).
1785
1786         Reverted changeset:
1787
1788         "GCController.cpp's collect() should be Async"
1789         https://bugs.webkit.org/show_bug.cgi?id=171708
1790         http://trac.webkit.org/changeset/216262
1791
1792 2017-05-08  Chris Dumez  <cdumez@apple.com>
1793
1794         Move offsetParent / offsetLeft / offsetTop / offsetWidth / offsetHeight from Element to HTMLElement
1795         https://bugs.webkit.org/show_bug.cgi?id=171829
1796
1797         Reviewed by Simon Fraser.
1798
1799         Move offsetParent / offsetLeft / offsetTop / offsetWidth / offsetHeight from Element to HTMLElement,
1800         as per the specification:
1801         - https://drafts.csswg.org/cssom-view/#extensions-to-the-htmlelement-interface
1802
1803         Both Firefox and Chrome match the specification and also do not have the corresponding API on
1804         SVGElement.
1805
1806         Bug tracking the similar move in Blink (completed over 1 year ago):
1807         - https://bugs.chromium.org/p/chromium/issues/detail?id=463116
1808
1809         Note that for the inner SVG elements like <rect> and <circle> these attributes were returning 0,
1810         because those aren't part of the CSS box model. They did return correct values for the <svg>
1811         element itself, however.
1812
1813         Test: fast/css/htmlelement-offset-properties.html
1814
1815         * dom/Element.idl:
1816         - Drop offset* attributes, now that they are on HTMLElement.
1817
1818         * html/HTMLElement.idl:
1819         - Resync HTMLElement.idl with the specification: https://html.spec.whatwg.org/#htmlelement
1820           No behavior change besides what's indicated in the Changelog above. Things that do not match
1821           the spec have been annotated with FIXME comments.
1822         - Add offset* attributes that used to be on Element.
1823
1824 2017-05-08  Youenn Fablet  <youenn@apple.com>
1825
1826         Add support for reading and writing settings from UIProcess audio capture
1827         https://bugs.webkit.org/show_bug.cgi?id=171633
1828
1829         Reviewed by Eric Carlson.
1830
1831         Covered by manual testing and existing test sets.
1832
1833         Moving success/failure callbacks for applyConstraints.
1834         Making main RealtimeMediaSource::applyConstraints virtual so that WebProcess source proxies can implement it by
1835         doing an IPC call directly. Doing so for UIProcess CoreAudioCaptureSource.
1836
1837         Adding support for volume to CoreAudioCaptureSource by applying gain post-capturing.
1838         Adding support for toggling echo cancellation in CoreAudioCaptureSource.
1839         Adding support to change echo cancellation and sample rate by scheduling a reconfiguration of the audio unit.
1840         To do so, we stop producing data, delete the audio unit and restart producing data.
1841         Removing CoreAudioCaptureSource::supportedConstraints as it is redundant with
1842         RealtimeMediaSourceSettings::supportedConstraints.
1843
1844         Setting sample rate only to the following values: 8000, 16000, 32000, 44100, 48000.
1845
1846         * Modules/mediastream/MediaStreamTrack.cpp:
1847         (WebCore::MediaStreamTrack::applyConstraints):
1848         * platform/mediastream/MediaStreamTrackPrivate.cpp:
1849         (WebCore::MediaStreamTrackPrivate::applyConstraints):
1850         * platform/mediastream/MediaStreamTrackPrivate.h:
1851         * platform/mediastream/RealtimeMediaSource.cpp:
1852         (WebCore::RealtimeMediaSource::applyConstraints):
1853         * platform/mediastream/RealtimeMediaSource.h:
1854         * platform/mediastream/RealtimeMediaSourceSettings.h:
1855         (WebCore::RealtimeMediaSourceSettings::supportedConstraints):
1856         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
1857         (WebCore::CoreAudioCaptureSource::~CoreAudioCaptureSource):
1858         (WebCore::CoreAudioCaptureSource::processMicrophoneSamples):
1859         (WebCore::CoreAudioCaptureSource::cleanupAudioUnit):
1860         (WebCore::CoreAudioCaptureSource::createAudioUnit):
1861         (WebCore::CoreAudioCaptureSource::configureAudioUnit):
1862         (WebCore::CoreAudioCaptureSource::startProducingData):
1863         (WebCore::CoreAudioCaptureSource::capabilities):
1864         (WebCore::CoreAudioCaptureSource::settings):
1865         (WebCore::CoreAudioCaptureSource::applySampleRate):
1866         (WebCore::CoreAudioCaptureSource::applyEchoCancellation):
1867         (WebCore::CoreAudioCaptureSource::scheduleReconfiguration):
1868         (WebCore::CoreAudioCaptureSource::cleanupAudioUnits): Deleted.
1869         (WebCore::CoreAudioCaptureSource::setupAudioUnits): Deleted.
1870         * platform/mediastream/mac/CoreAudioCaptureSource.h:
1871
1872 2017-05-08  Chris Dumez  <cdumez@apple.com>
1873
1874         Drop non-standard document.implementation.createCSSStyleSheet() API
1875         https://bugs.webkit.org/show_bug.cgi?id=171825
1876
1877         Reviewed by Simon Fraser.
1878
1879         Drop non-standard document.implementation.createCSSStyleSheet() API.
1880
1881         This was never-implemented by Firefox and they actually rejected implementing it:
1882         - Drop non-standard document.implementation.createCSSStyleSheet() API
1883
1884         Blink dropped this API back in 2014 after getting UseCounter data showing this was not used:
1885         - https://bugs.chromium.org/p/chromium/issues/detail?id=363561
1886         - https://groups.google.com/a/chromium.org/forum/#!msg/blink-dev/uDjkuGA9gQs/zytnzJ6WryYJ
1887
1888         The API is not useful in its current state because even though
1889         document.implementation.createCSSStyleSheet() allows you to create a stylesheet, there is
1890         currently no way to associate it with the document.
1891
1892         Test: fast/css/DOMImplementation.createCSSStyleSheet-obsolete.html
1893
1894         * dom/DOMImplementation.idl:
1895
1896 2017-05-08  Joanmarie Diggs  <jdiggs@igalia.com>
1897
1898         AX: don't expose empty roledescription
1899         https://bugs.webkit.org/show_bug.cgi?id=163647
1900
1901         Reviewed by Chris Fleizach.
1902
1903         If the value of aria-roledescription is empty or contains only whitespace
1904         characters, ignore the value. Also strip out leading or trailing whitespace
1905         characters in the value.
1906
1907         No new tests: We already had coverage for an empty aria-roledescription value.
1908         That test was updated to reflect the new behavior. New test cases were added
1909         to cover a value that contains only whitespace characters, and a value with
1910         leading and trailing whitespace characters.
1911
1912         * accessibility/AccessibilityObject.cpp:
1913         (WebCore::AccessibilityObject::roleDescription):
1914         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1915         (-[WebAccessibilityObjectWrapper roleDescription]):
1916
1917 2017-05-08  Chris Dumez  <cdumez@apple.com>
1918
1919         Drop non-standard Element.scrollByLines() / scrollByPages()
1920         https://bugs.webkit.org/show_bug.cgi?id=171820
1921
1922         Reviewed by Simon Fraser.
1923
1924         Drop non-standard Element.scrollByLines() / scrollByPages().
1925
1926         Those were added a very long time ago (https://trac.webkit.org/changeset/7901/webkit)
1927         for Safari RSS but does not seem to be used anymore.
1928
1929         Blink has already dropped it without issue back in 2014:
1930         - https://bugs.chromium.org/p/chromium/issues/detail?id=398356
1931
1932         Their UseCounter data showed no usage:
1933         - https://www.chromestatus.com/metrics/feature/timeline/popularity/390
1934
1935         Test: fast/css/element-scrollByLines-scrollByPages-obsolete.html
1936
1937         * dom/Element.idl:
1938
1939 2017-05-08  Youenn Fablet  <youenn@apple.com>
1940
1941         CoreAudioSharedUnit should own its configuration parameters
1942         https://bugs.webkit.org/show_bug.cgi?id=171812
1943
1944         Reviewed by Eric Carlson.
1945
1946         Covered by manual tests.
1947
1948         Add sampleRate, volume and echoCancellation parameters to the shared audio unit.
1949         Set default values when creating the shared audio unit and use those for the creation of new sources.
1950         Add support for volume.
1951         Add support for disabling echo cancellation.
1952         Check valid sample rates when trying to apply a sample rate.
1953
1954         * platform/mediastream/RealtimeMediaSource.h:
1955         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
1956         (WebCore::CoreAudioSharedUnit::volume):
1957         (WebCore::CoreAudioSharedUnit::sampleRate):
1958         (WebCore::CoreAudioSharedUnit::enableEchoCancellation):
1959         (WebCore::CoreAudioSharedUnit::setVolume):
1960         (WebCore::CoreAudioSharedUnit::setSampleRate):
1961         (WebCore::CoreAudioSharedUnit::setEnableEchoCancellation):
1962         (WebCore::CoreAudioSharedUnit::CoreAudioSharedUnit):
1963         (WebCore::CoreAudioSharedUnit::setupAudioUnits):
1964         (WebCore::CoreAudioSharedUnit::configureMicrophoneProc):
1965         (WebCore::CoreAudioSharedUnit::configureSpeakerProc):
1966         (WebCore::CoreAudioSharedUnit::processMicrophoneSamples):
1967         (WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource):
1968         (WebCore::CoreAudioCaptureSource::applySampleRate):
1969         (WebCore::CoreAudioCaptureSource::applyEchoCancellation):
1970         * platform/mediastream/mac/CoreAudioCaptureSource.h:
1971
1972 2017-05-08  Joanmarie Diggs  <jdiggs@igalia.com>
1973
1974         AX: Setting aria-orientation="horizontal" on a listbox is being overridden on the Mac
1975         https://bugs.webkit.org/show_bug.cgi?id=171821
1976
1977         Reviewed by Chris Fleizach.
1978
1979         The Mac's AccessibilityObject wrapper was unconditionally returning vertical
1980         as the orientation of listbox. Removing this override causes the author-specified
1981         value to be exposed, with the default/implicit orientation continuing to be vertical.
1982
1983         No new tests. We already have coverage for the default/implicit orientation on a
1984         listbox. A new test case was added to aria-orientation.html so that we would have
1985         coverage for aria-orientation="horizontal" on a listbox.
1986
1987         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1988         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
1989
1990 2017-05-08  Said Abou-Hallawa  <sabouhallawa@apple.com>
1991
1992         [CG] To decode an image frame asynchronously, pass the native size of the image to CGImageSourceCreateThumbnailAtIndex() if it's smaller than the sizeForDrawing
1993         https://bugs.webkit.org/show_bug.cgi?id=170864
1994  
1995         Reviewed by Simon Fraser.
1996
1997         Tests: Existing tests were modified to test this patch.
1998  
1999         The maxPixelSize was omitted when calling CGImageSourceCreateThumbnailAtIndex()
2000         for the nativeSize image or when areaOf(nativeSize) < areaOf(sizeForDrawing).
2001         The assumption was if we don't pass maxPixelSize, CG will create an image with the
2002         nativeSize regardless how big this size is. It turns out this is wrong. CG has an
2003         optimization to return a scaled down image if areaOf(nativeSize) is greater than
2004         some maximum value.
2005  
2006         This is not what we want for asynchronously image decoding. We want the decoded
2007         frame to have the size we ask for, not some scaled down frame. The fix is to pass
2008         always maxPixelSize to CGImageSourceCreateThumbnailAtIndex(). maxPixelSize will be
2009         equal to maxDimension(sizeForDrawing) if sizeForDrawing is valid it is less than
2010         maxDimension(nativeSize). Otherwise it will be equal to maxDimension(nativeSize).
2011
2012         * platform/graphics/DecodingOptions.h:
2013         * platform/graphics/cg/ImageDecoderCG.cpp:
2014         (WebCore::appendImageSourceOption):
2015         (WebCore::appendImageSourceOptions):
2016         (WebCore::imageSourceAsyncOptions):
2017         (WebCore::ImageDecoder::createFrameImageAtIndex):
2018
2019 2017-05-08  Beth Dakin  <bdakin@apple.com>
2020
2021         WebKit should default to using sRGB with NSColor conversion instead of device 
2022         color space
2023         https://bugs.webkit.org/show_bug.cgi?id=171745
2024         -and corresponding-
2025         rdar://problem/28314183
2026
2027         Reviewed by Tim Horton.
2028
2029         * platform/graphics/mac/ColorMac.mm:
2030         (WebCore::makeRGBAFromNSColor):
2031         (WebCore::nsColor):
2032
2033 2017-05-08  Alex Christensen  <achristensen@webkit.org>
2034
2035         Reduce PassRefPtr use
2036         https://bugs.webkit.org/show_bug.cgi?id=171809
2037
2038         Reviewed by Chris Dumez.
2039
2040         * platform/graphics/ca/PlatformCALayer.cpp:
2041         (WebCore::PlatformCALayer::createCompatibleLayerOrTakeFromPool):
2042         * platform/graphics/ca/PlatformCALayer.h:
2043         * platform/graphics/ca/TileCoverageMap.cpp:
2044         (WebCore::TileCoverageMap::TileCoverageMap):
2045         * platform/graphics/ca/TileGrid.cpp:
2046         (WebCore::TileGrid::TileGrid):
2047         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
2048         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
2049         (PlatformCALayerCocoa::create):
2050         (PlatformCALayerCocoa::clone):
2051         (PlatformCALayerCocoa::animationForKey):
2052         (PlatformCALayerCocoa::createCompatibleLayer):
2053
2054 2017-05-08  Jer Noble  <jer.noble@apple.com>
2055
2056         [Mac] Audio capture fails when shouldCaptureAudioInUIProcess is set.
2057         https://bugs.webkit.org/show_bug.cgi?id=171710
2058
2059         Reviewed by Eric Carlson.
2060
2061         Both the shouldCaptureAudioInUIProcess setting and useAVFoundationAudioCapture setting were trying to set
2062         the audio factory for RealtimeMediaSourceCenter, and were stomping on each others' changes. Change the way
2063         the useAVFoundationAudioCapture works so that it only affects the defaultAudioFactory, allowing that default
2064         to be overridden by the shuoldCaptureAudioInUIProcess setting when it calls setAudioFactory().
2065
2066         * page/Settings.cpp:
2067         (WebCore::Settings::setUseAVFoundationAudioCapture):
2068         * platform/mediastream/RealtimeMediaSourceCenter.cpp:
2069         (WebCore::RealtimeMediaSourceCenter::audioFactory):
2070         (WebCore::RealtimeMediaSourceCenter::videoFactory):
2071         (WebCore::RealtimeMediaSourceCenter::audioCaptureDeviceManager):
2072         (WebCore::RealtimeMediaSourceCenter::videoCaptureDeviceManager):
2073         * platform/mediastream/RealtimeMediaSourceCenter.h:
2074         (WebCore::RealtimeMediaSourceCenter::audioFactory): Deleted.
2075         (WebCore::RealtimeMediaSourceCenter::videoFactory): Deleted.
2076         (WebCore::RealtimeMediaSourceCenter::audioCaptureDeviceManager): Deleted.
2077         (WebCore::RealtimeMediaSourceCenter::videoCaptureDeviceManager): Deleted.
2078         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
2079         (WebCore::RealtimeMediaSourceCenterMac::setUseAVFoundationAudioCapture):
2080         (WebCore::RealtimeMediaSourceCenterMac::singleton):
2081         (WebCore::RealtimeMediaSourceCenter::platformCenter):
2082         (WebCore::RealtimeMediaSourceCenterMac::defaultAudioFactory):
2083         (WebCore::RealtimeMediaSourceCenterMac::defaultAudioCaptureDeviceManager):
2084         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.h:
2085
2086 2017-05-04  Jiewen Tan  <jiewen_tan@apple.com>
2087
2088         Search events should not fire synchronously for search type input elements with incremental attribute set
2089         https://bugs.webkit.org/show_bug.cgi?id=171376
2090         <rdar://problem/31863296>
2091
2092         Reviewed by Chris Dumez.
2093
2094         For some reasons, we fire search events immediately for search type input elements with incremental
2095         attribute set only when the length of the input equals to zero. This behaviour should be prevented
2096         as event listeners in the middle might perform unexpectedly.
2097
2098         Test: fast/forms/search/search-incremental-crash.html
2099
2100         * html/SearchInputType.cpp:
2101         (WebCore::SearchInputType::startSearchEventTimer):
2102
2103 2017-05-08  Zalan Bujtas  <zalan@apple.com>
2104
2105         Text overlaps on http://www.duden.de/rechtschreibung/Acre
2106         https://bugs.webkit.org/show_bug.cgi?id=171796
2107         <rdar://problem/31036028>
2108
2109         Reviewed by Simon Fraser.
2110
2111         Simple line layout pre-measures space using the primary font,
2112         even if the space glyph requires a fallback font (and even if the string does not have a space in it at all).
2113         When this width gets cached (see WidthCache) we might end up using it later during normal line layout and
2114         it could produce incorrect layout.
2115         This patch removes the space width caching from Simple line layout, since Font already caches it.
2116
2117         Test: fast/text/simple-line-layout-fallback-space-glyph.html
2118
2119         * rendering/SimpleLineLayout.cpp:
2120         (WebCore::SimpleLineLayout::createLineRuns):
2121         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
2122         (WebCore::SimpleLineLayout::TextFragmentIterator::Style::Style):
2123         (WebCore::SimpleLineLayout::TextFragmentIterator::skipToNextPosition):
2124         (WebCore::SimpleLineLayout::TextFragmentIterator::textWidth):
2125         * rendering/SimpleLineLayoutTextFragmentIterator.h:
2126
2127 2017-05-08  Chris Dumez  <cdumez@apple.com>
2128
2129         Refactor ImageInputType::width() / height() for clarity
2130         https://bugs.webkit.org/show_bug.cgi?id=171810
2131
2132         Reviewed by Zalan Bujtas.
2133
2134         Refactor ImageInputType::width() / height() for clarity.
2135
2136         * html/ImageInputType.cpp:
2137         (WebCore::ImageInputType::height):
2138         (WebCore::ImageInputType::width):
2139
2140 2017-05-08  Zalan Bujtas  <zalan@apple.com>
2141
2142         Bail out of simple line layout when hyphen needs a fallback font.
2143         https://bugs.webkit.org/show_bug.cgi?id=171811
2144
2145         Reviewed by Antti Koivisto.
2146
2147         With hyphen: auto is set, we don't know if the hypen string is going to be used, until
2148         after we started laying out the content and figured that the text overflows the line.
2149         However it's too late to bail out of simple line layout at this point, so let's just
2150         pre-check if the hyphen string needs a fallback font.
2151
2152         * rendering/SimpleLineLayout.cpp:
2153         (WebCore::SimpleLineLayout::canUseForStyle):
2154
2155 2017-05-08  Youenn Fablet  <youenn@apple.com>
2156
2157         TURNS gathering is not working properly
2158         https://bugs.webkit.org/show_bug.cgi?id=171747
2159
2160         Reviewed by Eric Carlson.
2161
2162         Covered by manual tests.
2163
2164         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
2165         (WebCore::configurationFromMediaEndpointConfiguration): Reveting TURNS ice server skipping.
2166
2167 2017-05-08  Michael Catanzaro  <mcatanzaro@igalia.com>
2168
2169         Unreviewed, rolling out r216419.
2170
2171         Broke 70 layout tests on GTK bot
2172
2173         Reverted changeset:
2174
2175         "Ensure clean tree before AX cache update."
2176         https://bugs.webkit.org/show_bug.cgi?id=171546
2177         http://trac.webkit.org/changeset/216419
2178
2179 2017-05-08  Youenn Fablet  <youenn@apple.com>
2180
2181         CoreAudioCaptureSource should not modify its shared unit if already started/stopped
2182         https://bugs.webkit.org/show_bug.cgi?id=171804
2183
2184         Reviewed by Jer Noble.
2185
2186         Manual testing only since CoreAudioSharedUnit is not mocked.
2187
2188         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
2189         (WebCore::CoreAudioCaptureSource::startProducingData): Exit early if source is already started.
2190         (WebCore::CoreAudioCaptureSource::stopProducingData): Exit early if source is already stopped.
2191
2192 2017-05-08  Antti Koivisto  <antti@apple.com>
2193
2194         ComposedTreeIterator does not traverse all slotted children if the traversal root is a slot element.
2195         https://bugs.webkit.org/show_bug.cgi?id=171375
2196         <rdar://problem/31863184>
2197
2198         Reviewed by Zalan Bujtas.
2199
2200         We were hitting an assert when using details element with a flow thread. The root cause for this turned
2201         out to be that we only traversed the first slotted child if the traversal root was a slot element.
2202
2203         Test: fast/html/details-flow-thread.html
2204
2205         * dom/ComposedTreeIterator.cpp:
2206         (WebCore::ComposedTreeIterator::traverseNextLeavingContext):
2207
2208             Try to traverse to the next slotted child before testing if we at the end of the current context.
2209
2210 2017-05-08  Mark Lam  <mark.lam@apple.com>
2211
2212         Introduce ExceptionScope::assertNoException() and releaseAssertNoException().
2213         https://bugs.webkit.org/show_bug.cgi?id=171776
2214
2215         Reviewed by Keith Miller.
2216
2217         No new tests because there's no behavior change in functionality.  We're only
2218         refactoring the code to use the new assertion utility function.
2219
2220         * Modules/plugins/QuickTimePluginReplacement.mm:
2221         (WebCore::QuickTimePluginReplacement::installReplacement):
2222         * bindings/js/JSCryptoKeySerializationJWK.cpp:
2223         (WebCore::getJSArrayFromJSON):
2224         (WebCore::getStringFromJSON):
2225         (WebCore::getBooleanFromJSON):
2226         * bindings/js/JSCustomElementRegistryCustom.cpp:
2227         (WebCore::JSCustomElementRegistry::whenDefined):
2228         * bindings/js/JSDOMExceptionHandling.cpp:
2229         (WebCore::propagateExceptionSlowPath):
2230         (WebCore::throwNotSupportedError):
2231         (WebCore::throwInvalidStateError):
2232         (WebCore::throwSecurityError):
2233         (WebCore::throwDOMSyntaxError):
2234         (WebCore::throwDataCloneError):
2235         (WebCore::throwIndexSizeError):
2236         (WebCore::throwTypeMismatchError):
2237         * bindings/js/JSDOMGlobalObject.cpp:
2238         (WebCore::makeThisTypeErrorForBuiltins):
2239         (WebCore::makeGetterTypeErrorForBuiltins):
2240         * bindings/js/JSDOMGlobalObjectTask.cpp:
2241         * bindings/js/JSDOMPromise.h:
2242         (WebCore::callPromiseFunction):
2243         * bindings/js/JSDOMWindowBase.cpp:
2244         (WebCore::JSDOMWindowMicrotaskCallback::call):
2245         * bindings/js/JSMainThreadExecState.h:
2246         (WebCore::JSMainThreadExecState::~JSMainThreadExecState):
2247         * bindings/js/ReadableStreamDefaultController.cpp:
2248         (WebCore::ReadableStreamDefaultController::isControlledReadableStreamLocked):
2249         * bindings/js/ReadableStreamDefaultController.h:
2250         (WebCore::ReadableStreamDefaultController::enqueue):
2251         * bindings/js/SerializedScriptValue.cpp:
2252         (WebCore::CloneDeserializer::readTerminal):
2253         * bindings/scripts/CodeGeneratorJS.pm:
2254         (GenerateSerializerFunction):
2255         * bindings/scripts/test/JS/JSTestNode.cpp:
2256         (WebCore::JSTestNode::serialize):
2257         * bindings/scripts/test/JS/JSTestObj.cpp:
2258         (WebCore::JSTestObj::serialize):
2259         * bindings/scripts/test/JS/JSTestSerialization.cpp:
2260         (WebCore::JSTestSerialization::serialize):
2261         * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
2262         (WebCore::JSTestSerializationInherit::serialize):
2263         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
2264         (WebCore::JSTestSerializationInheritFinal::serialize):
2265         * contentextensions/ContentExtensionParser.cpp:
2266         (WebCore::ContentExtensions::getTypeFlags):
2267         * html/HTMLMediaElement.cpp:
2268         (WebCore::HTMLMediaElement::didAddUserAgentShadowRoot):
2269         (WebCore::HTMLMediaElement::updateMediaControlsAfterPresentationModeChange):
2270         (WebCore::HTMLMediaElement::getCurrentMediaControlsStatus):
2271         * html/HTMLPlugInImageElement.cpp:
2272         (WebCore::HTMLPlugInImageElement::didAddUserAgentShadowRoot):
2273
2274 2017-05-08  Chris Dumez  <cdumez@apple.com>
2275
2276         Move 'style' from Element to HTMLElement / SVGElement and make it settable
2277         https://bugs.webkit.org/show_bug.cgi?id=171795
2278
2279         Reviewed by Alex Christensen.
2280
2281         Move 'style' from Element to HTMLElement / SVGElement and make it settable
2282         as per:
2283         - https://drafts.csswg.org/cssom/#the-elementcssinlinestyle-interface
2284
2285         Both Firefox and Chrome already match the specification (both for the
2286         property location and having it settable).
2287
2288         Test: fast/css/Element-style.html
2289
2290         * CMakeLists.txt:
2291         * DerivedSources.make:
2292         * WebCore.xcodeproj/project.pbxproj:
2293         * css/ElementCSSInlineStyle.idl: Added.
2294         * css/PropertySetCSSStyleDeclaration.h:
2295         * css/StyleProperties.cpp:
2296         (WebCore::MutableStyleProperties::ensureCSSStyleDeclaration):
2297         (WebCore::MutableStyleProperties::ensureInlineCSSStyleDeclaration):
2298         * css/StyleProperties.h:
2299         * dom/Attr.cpp:
2300         (WebCore::Attr::style):
2301         * dom/Document.cpp:
2302         (WebCore::Document::createCSSStyleDeclaration):
2303         * dom/Element.cpp:
2304         * dom/Element.h:
2305         * dom/Element.idl:
2306         * dom/StyledElement.cpp:
2307         (WebCore::StyledElement::cssomStyle):
2308         * dom/StyledElement.h:
2309         * editing/Editor.cpp:
2310         (WebCore::Editor::applyEditingStyleToElement):
2311         * editing/ReplaceSelectionCommand.cpp:
2312         (WebCore::ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline):
2313         * html/HTMLElement.idl:
2314
2315         * html/ImageInputType.cpp:
2316         (WebCore::ImageInputType::height):
2317         (WebCore::ImageInputType::width):
2318         Fix bug that was found by fast/forms/input-width-height-attributes-without-renderer-loaded-image.html.
2319         That test relied on setting HTMLElement.style which did not work until now. Call updateLayout()
2320         *before* doing the renderer check.
2321
2322         * inspector/InspectorCSSAgent.cpp:
2323         (WebCore::InspectorCSSAgent::getMatchedStylesForNode):
2324         (WebCore::InspectorCSSAgent::getInlineStylesForNode):
2325         (WebCore::InspectorCSSAgent::getComputedStyleForNode):
2326         (WebCore::InspectorCSSAgent::asInspectorStyleSheet):
2327         (WebCore::InspectorCSSAgent::buildObjectForAttributesStyle):
2328         * inspector/InspectorCSSAgent.h:
2329         * inspector/InspectorStyleSheet.cpp:
2330         (WebCore::InspectorStyle::create):
2331         (WebCore::InspectorStyle::InspectorStyle):
2332         (WebCore::InspectorStyle::extractSourceData):
2333         (WebCore::InspectorStyle::setText):
2334         (WebCore::InspectorStyleSheet::inspectorStyleForId):
2335         (WebCore::InspectorStyleSheetForInlineStyle::create):
2336         (WebCore::InspectorStyleSheetForInlineStyle::InspectorStyleSheetForInlineStyle):
2337         (WebCore::InspectorStyleSheetForInlineStyle::didModifyElementAttribute):
2338         (WebCore::InspectorStyleSheetForInlineStyle::setStyleText):
2339         (WebCore::InspectorStyleSheetForInlineStyle::ensureParsedDataReady):
2340         (WebCore::InspectorStyleSheetForInlineStyle::inlineStyle):
2341         * inspector/InspectorStyleSheet.h:
2342         * svg/SVGElement.idl:
2343
2344 2017-05-08  Joanmarie Diggs  <jdiggs@igalia.com>
2345
2346         AX: Propagate aria-readonly to grid descendants
2347         https://bugs.webkit.org/show_bug.cgi?id=171189
2348
2349         Reviewed by Chris Fleizach.
2350
2351         Propagate aria-readonly to grid descendants if the property is not
2352         explicitly set on the descendant.
2353
2354         Test: accessibility/gtk/aria-readonly-propagated.html
2355               Additional test cases also added to accessibility/aria-readonly.html
2356
2357         * accessibility/AccessibilityARIAGridCell.cpp:
2358         (WebCore::AccessibilityARIAGridCell::ariaReadOnlyValue):
2359         * accessibility/AccessibilityARIAGridCell.h:
2360         * accessibility/AccessibilityObject.h:
2361
2362 2017-05-06  Zalan Bujtas  <zalan@apple.com>
2363
2364         Ensure clean tree before AX cache update.
2365         https://bugs.webkit.org/show_bug.cgi?id=171546
2366         <rdar://problem/31934942>
2367
2368         While updating an accessibility object state, we might
2369         perform unintentional style updates. This style update could
2370         end up destroying renderes that are still referenced by function calls 
2371         on the callstack.
2372         To avoid that, AXObjectCache should operate on a clean tree only. 
2373
2374         Reviewed by Chris Fleizach.
2375
2376         Test: accessibility/crash-when-render-tree-is-not-clean.html
2377
2378         * accessibility/AXObjectCache.cpp:
2379         (WebCore::AXObjectCache::checkedStateChanged):
2380         (WebCore::AXObjectCache::selectedChildrenChanged):
2381         (WebCore::AXObjectCache::handleAriaExpandedChange):
2382         (WebCore::AXObjectCache::handleActiveDescendantChanged):
2383         (WebCore::AXObjectCache::handleAriaRoleChanged):
2384         (WebCore::AXObjectCache::handleAttributeChanged):
2385         (WebCore::AXObjectCache::handleAriaModalChange):
2386         (WebCore::AXObjectCache::labelChanged):
2387         * accessibility/AXObjectCache.h:
2388         (WebCore::AXObjectCache::checkedStateChanged):
2389         (WebCore::AXObjectCache::handleActiveDescendantChanged):
2390         (WebCore::AXObjectCache::handleAriaExpandedChange):
2391         (WebCore::AXObjectCache::handleAriaRoleChanged):
2392         (WebCore::AXObjectCache::handleAriaModalChange):
2393         (WebCore::AXObjectCache::handleAttributeChanged):
2394         (WebCore::AXObjectCache::selectedChildrenChanged):
2395         * accessibility/AccessibilityRenderObject.cpp:
2396         (WebCore::AccessibilityRenderObject::handleAriaExpandedChanged):
2397         * dom/Element.cpp:
2398         (WebCore::Element::attributeChanged):
2399         * html/HTMLInputElement.cpp:
2400         (WebCore::HTMLInputElement::setChecked):
2401
2402 2017-05-08  Myles C. Maxfield  <mmaxfield@apple.com>
2403
2404         Unprefix unicode-bidi CSS values
2405         https://bugs.webkit.org/show_bug.cgi?id=171761
2406
2407         Reviewed by Simon Fraser.
2408
2409         Create new values which parse to the same internal state as the
2410         prefixed values.
2411
2412         Tests: fast/text/bidi-unprefix.html
2413                imported/w3c/i18n/bidi/bidi-embed-001.html
2414                imported/w3c/i18n/bidi/bidi-embed-002.html
2415                imported/w3c/i18n/bidi/bidi-embed-003.html
2416                imported/w3c/i18n/bidi/bidi-embed-004.html
2417                imported/w3c/i18n/bidi/bidi-embed-005.html
2418                imported/w3c/i18n/bidi/bidi-embed-006.html
2419                imported/w3c/i18n/bidi/bidi-embed-007.html
2420                imported/w3c/i18n/bidi/bidi-embed-008.html
2421                imported/w3c/i18n/bidi/bidi-embed-009.html
2422                imported/w3c/i18n/bidi/bidi-embed-010.html
2423                imported/w3c/i18n/bidi/bidi-embed-011.html
2424                imported/w3c/i18n/bidi/bidi-isolate-001.html
2425                imported/w3c/i18n/bidi/bidi-isolate-002.html
2426                imported/w3c/i18n/bidi/bidi-isolate-003.html
2427                imported/w3c/i18n/bidi/bidi-isolate-004.html
2428                imported/w3c/i18n/bidi/bidi-isolate-005.html
2429                imported/w3c/i18n/bidi/bidi-isolate-006.html
2430                imported/w3c/i18n/bidi/bidi-isolate-007.html
2431                imported/w3c/i18n/bidi/bidi-isolate-008.html
2432                imported/w3c/i18n/bidi/bidi-isolate-009.html
2433                imported/w3c/i18n/bidi/bidi-isolate-010.html
2434                imported/w3c/i18n/bidi/bidi-isolate-011.html
2435                imported/w3c/i18n/bidi/bidi-isolate-override-001.html
2436                imported/w3c/i18n/bidi/bidi-isolate-override-002.html
2437                imported/w3c/i18n/bidi/bidi-isolate-override-003.html
2438                imported/w3c/i18n/bidi/bidi-isolate-override-004.html
2439                imported/w3c/i18n/bidi/bidi-isolate-override-005.html
2440                imported/w3c/i18n/bidi/bidi-isolate-override-006.html
2441                imported/w3c/i18n/bidi/bidi-isolate-override-007.html
2442                imported/w3c/i18n/bidi/bidi-isolate-override-008.html
2443                imported/w3c/i18n/bidi/bidi-isolate-override-009.html
2444                imported/w3c/i18n/bidi/bidi-isolate-override-010.html
2445                imported/w3c/i18n/bidi/bidi-isolate-override-011.html
2446                imported/w3c/i18n/bidi/bidi-isolate-override-012.html
2447                imported/w3c/i18n/bidi/bidi-normal-001.html
2448                imported/w3c/i18n/bidi/bidi-normal-002.html
2449                imported/w3c/i18n/bidi/bidi-normal-003.html
2450                imported/w3c/i18n/bidi/bidi-normal-004.html
2451                imported/w3c/i18n/bidi/bidi-normal-005.html
2452                imported/w3c/i18n/bidi/bidi-normal-006.html
2453                imported/w3c/i18n/bidi/bidi-normal-007.html
2454                imported/w3c/i18n/bidi/bidi-normal-008.html
2455                imported/w3c/i18n/bidi/bidi-normal-009.html
2456                imported/w3c/i18n/bidi/bidi-normal-010.html
2457                imported/w3c/i18n/bidi/bidi-normal-011.html
2458                imported/w3c/i18n/bidi/bidi-override-001.html
2459                imported/w3c/i18n/bidi/bidi-override-002.html
2460                imported/w3c/i18n/bidi/bidi-override-003.html
2461                imported/w3c/i18n/bidi/bidi-override-004.html
2462                imported/w3c/i18n/bidi/bidi-override-005.html
2463                imported/w3c/i18n/bidi/bidi-override-006.html
2464                imported/w3c/i18n/bidi/bidi-override-007.html
2465                imported/w3c/i18n/bidi/bidi-override-008.html
2466                imported/w3c/i18n/bidi/bidi-override-009.html
2467                imported/w3c/i18n/bidi/bidi-override-010.html
2468                imported/w3c/i18n/bidi/bidi-override-011.html
2469                imported/w3c/i18n/bidi/bidi-override-012.html
2470                imported/w3c/i18n/bidi/bidi-plaintext-001.html
2471                imported/w3c/i18n/bidi/bidi-plaintext-003.html
2472                imported/w3c/i18n/bidi/bidi-plaintext-005.html
2473                imported/w3c/i18n/bidi/bidi-plaintext-006.html
2474                imported/w3c/i18n/bidi/bidi-plaintext-007.html
2475                imported/w3c/i18n/bidi/bidi-plaintext-008.html
2476                imported/w3c/i18n/bidi/bidi-plaintext-009.html
2477                imported/w3c/i18n/bidi/bidi-plaintext-010.html
2478                imported/w3c/i18n/bidi/bidi-plaintext-011.html
2479                imported/w3c/i18n/bidi/bidi-table-001.html
2480                imported/w3c/i18n/bidi/bidi-unset-001.html
2481                imported/w3c/i18n/bidi/bidi-unset-002.html
2482                imported/w3c/i18n/bidi/bidi-unset-003.html
2483                imported/w3c/i18n/bidi/bidi-unset-004.html
2484                imported/w3c/i18n/bidi/bidi-unset-005.html
2485                imported/w3c/i18n/bidi/bidi-unset-006.html
2486                imported/w3c/i18n/bidi/bidi-unset-007.html
2487                imported/w3c/i18n/bidi/bidi-unset-008.html
2488                imported/w3c/i18n/bidi/bidi-unset-009.html
2489                imported/w3c/i18n/bidi/bidi-unset-010.html
2490                imported/w3c/i18n/bidi/block-embed-001.html
2491                imported/w3c/i18n/bidi/block-embed-002.html
2492                imported/w3c/i18n/bidi/block-embed-003.html
2493                imported/w3c/i18n/bidi/block-override-001.html
2494                imported/w3c/i18n/bidi/block-override-002.html
2495                imported/w3c/i18n/bidi/block-override-003.html
2496                imported/w3c/i18n/bidi/block-override-004.html
2497                imported/w3c/i18n/bidi/block-override-isolate-001.html
2498                imported/w3c/i18n/bidi/block-override-isolate-002.html
2499                imported/w3c/i18n/bidi/block-override-isolate-003.html
2500                imported/w3c/i18n/bidi/block-override-isolate-004.html
2501                imported/w3c/i18n/bidi/block-plaintext-001.html
2502                imported/w3c/i18n/bidi/block-plaintext-002.html
2503                imported/w3c/i18n/bidi/block-plaintext-003.html
2504                imported/w3c/i18n/bidi/block-plaintext-004.html
2505                imported/w3c/i18n/bidi/block-plaintext-005.html
2506                imported/w3c/i18n/bidi/block-plaintext-006.html
2507
2508         * css/CSSPrimitiveValueMappings.h:
2509         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
2510         (WebCore::CSSPrimitiveValue::operator EUnicodeBidi):
2511         * css/CSSProperties.json:
2512         * css/CSSValueKeywords.in:
2513         * css/html.css:
2514         (bdi, output):
2515         * css/parser/CSSParserFastPaths.cpp:
2516         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
2517         * html/HTMLElement.cpp:
2518         (WebCore::unicodeBidiAttributeForDirAuto):
2519         * html/track/TextTrackCueGeneric.cpp:
2520         (WebCore::TextTrackCueGenericBoxElement::applyCSSProperties):
2521         * html/track/VTTCue.cpp:
2522         (WebCore::VTTCueBox::applyCSSProperties):
2523
2524 2017-05-07  Ben Kelly  <ben@wanderview.com>
2525
2526         Set the Response.blob() type based on the content-type header value.
2527         https://bugs.webkit.org/show_bug.cgi?id=170849
2528
2529         Reviewed by Youenn Fablet.
2530
2531         There are two problems to fix here:
2532
2533         1.  Currently the FetchResponse class only called updateContentType()
2534         when first created even though all the headers were not available.  This
2535         patch calls updateContentType() again after the headers are populated.
2536
2537         2.  The fetch design requires propagating the normalized blob
2538         type to FetchBodyConsumer as well.  Currently this is only done if
2539         Response.blob() is called after the body is completely loaded.  If
2540         we hit the consumeOnceLoadingFinished() path, then the type is not
2541         passed.  This is similar to what was happening in bug 171489 with
2542         ReadableStream bodies.  This patch sets the type on the
2543         FetchBodyConsumer in consumeOnceLoadingFinished() as well.
2544
2545         Theses changes allow WebKit to pass the "Consume response's body: from
2546         fetch to blob" case in the WPT response-consume.html test.
2547
2548         Test: http://w3c-test.org/fetch/api/response/response-consume.html
2549
2550         * Modules/fetch/FetchResponse.cpp:
2551         (WebCore::FetchResponse::BodyLoader::didReceiveResponse): Modified to
2552         call FetchBodyOwner::updateContentType() after filling m_headers.
2553         (WebCore::FetchBody::consumeOnceLoadingFinished): Call
2554         FetchBodyConsumer::setContentType() when being consumed as
2555         a blob.
2556         * Modules/fetch/FetchBody.h: Modify consumeOnceLoadingFinished()
2557         to take the content type string.
2558         * Modules/fetch/FetchBodyOwner.cpp:
2559         (WebCore::FetchBodyOwner::consumeOnceLoadingFinished): Pass
2560         the content type string down to FetchBody so it can be
2561         propagated to the FetchBodyConsumer.
2562
2563 2017-05-07  Simon Fraser  <simon.fraser@apple.com>
2564
2565         [iOS] REGRESSION (r209409): getBoundingClientRect is wrong for fixed-position elements in resize/orientationchange
2566         https://bugs.webkit.org/show_bug.cgi?id=171140
2567
2568         Reviewed by Sam Weinig.
2569
2570         WebPage::dynamicViewportSizeUpdate() is called during rotation, and does a layout which needs to have
2571         an up-to-date layout viewport, since the layout viewport state is detectable in orientationchange and
2572         resize events via fetching the client rect of fixed elements. Normally we send in the layout viewport
2573         from the UI process, but in this case we need to compute one in the web process. So factor code
2574         into FrameView to do the computation, called from both places.
2575
2576         Tests: fast/events/ios/rotation/layout-viewport-during-rotation.html
2577                fast/events/ios/rotation/layout-viewport-during-safari-type-rotation.html
2578
2579         * page/FrameView.cpp:
2580         (WebCore::FrameView::computeUpdatedLayoutViewportRect):
2581         * page/FrameView.h:
2582
2583 2017-05-07  Chris Dumez  <cdumez@apple.com>
2584
2585         Drop remaining uses of PassRefPtr in editing code
2586         https://bugs.webkit.org/show_bug.cgi?id=171787
2587
2588         Reviewed by Darin Adler.
2589
2590         Drop remaining uses of PassRefPtr in editing code.
2591
2592         * editing/AlternativeTextController.cpp:
2593         (WebCore::AlternativeTextController::timerFired):
2594         * editing/ApplyStyleCommand.cpp:
2595         (WebCore::toIdentifier):
2596         * editing/CompositeEditCommand.cpp:
2597         (WebCore::CompositeEditCommand::didApplyCommand):
2598         (WebCore::CompositeEditCommand::moveParagraphs):
2599         * editing/CompositeEditCommand.h:
2600         * editing/Editor.cpp:
2601         (WebCore::Editor::shouldInsertFragment):
2602         (WebCore::Editor::replaceSelectionWithFragment):
2603         (WebCore::Editor::appliedEditing):
2604         (WebCore::Editor::performCutOrCopy):
2605         (WebCore::Editor::willWriteSelectionToPasteboard):
2606         (WebCore::Editor::advanceToNextMisspelling):
2607         (WebCore::Editor::isSelectionUngrammatical):
2608         (WebCore::Editor::guessesForMisspelledOrUngrammatical):
2609         (WebCore::Editor::markMisspellingsOrBadGrammar):
2610         (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges):
2611         (WebCore::correctSpellcheckingPreservingTextCheckingParagraph):
2612         (WebCore::Editor::markAndReplaceFor):
2613         (WebCore::Editor::changeBackToReplacedString):
2614         * editing/Editor.h:
2615         * editing/EditorCommand.cpp:
2616         (WebCore::executeInsertFragment):
2617         (WebCore::Editor::command):
2618         (WebCore::Editor::Command::Command):
2619         * editing/FormatBlockCommand.cpp:
2620         (WebCore::FormatBlockCommand::formatRange):
2621         * editing/IndentOutdentCommand.cpp:
2622         (WebCore::IndentOutdentCommand::indentIntoBlockquote):
2623         (WebCore::IndentOutdentCommand::outdentParagraph):
2624         * editing/InsertListCommand.cpp:
2625         (WebCore::InsertListCommand::fixOrphanedListChild):
2626         (WebCore::InsertListCommand::mergeWithNeighboringLists):
2627         (WebCore::InsertListCommand::doApplyForSingleParagraph):
2628         (WebCore::InsertListCommand::unlistifyParagraph):
2629         (WebCore::InsertListCommand::listifyParagraph):
2630         * editing/InsertListCommand.h:
2631         * editing/InsertParagraphSeparatorCommand.cpp:
2632         (WebCore::InsertParagraphSeparatorCommand::doApply):
2633         * editing/InsertTextCommand.cpp:
2634         (WebCore::InsertTextCommand::InsertTextCommand):
2635         * editing/InsertTextCommand.h:
2636         (WebCore::InsertTextCommand::createWithMarkerSupplier):
2637         * editing/MoveSelectionCommand.cpp:
2638         (WebCore::MoveSelectionCommand::MoveSelectionCommand):
2639         * editing/MoveSelectionCommand.h:
2640         (WebCore::MoveSelectionCommand::create):
2641         * editing/ReplaceSelectionCommand.cpp:
2642         (WebCore::ReplacementFragment::removeNodePreservingChildren):
2643         (WebCore::ReplacementFragment::removeNode):
2644         (WebCore::ReplacementFragment::insertNodeBefore):
2645         (WebCore::ReplacementFragment::restoreAndRemoveTestRenderingNodesToFragment):
2646         (WebCore::ReplacementFragment::removeUnrenderedNodes):
2647         (WebCore::ReplacementFragment::removeInterchangeNodes):
2648         (WebCore::ReplaceSelectionCommand::makeInsertedContentRoundTrippableWithHTMLTreeBuilder):
2649         (WebCore::ReplaceSelectionCommand::moveNodeOutOfAncestor):
2650         (WebCore::removeHeadContents):
2651         (WebCore::ReplaceSelectionCommand::doApply):
2652         (WebCore::ReplaceSelectionCommand::insertAsListItems):
2653         * editing/ReplaceSelectionCommand.h:
2654         * editing/SpellChecker.cpp:
2655         (WebCore::SpellCheckRequest::SpellCheckRequest):
2656         (WebCore::SpellCheckRequest::create):
2657         (WebCore::SpellChecker::canCheckAsynchronously):
2658         (WebCore::SpellChecker::isCheckable):
2659         (WebCore::SpellChecker::requestCheckingFor):
2660         (WebCore::SpellChecker::invokeRequest):
2661         (WebCore::SpellChecker::enqueueRequest):
2662         (WebCore::SpellChecker::didCheck):
2663         * editing/SpellChecker.h:
2664         (WebCore::SpellCheckRequest::checkingRange):
2665         (WebCore::SpellCheckRequest::paragraphRange):
2666         * editing/TextCheckingHelper.cpp:
2667         (WebCore::expandToParagraphBoundary):
2668         (WebCore::TextCheckingParagraph::TextCheckingParagraph):
2669         (WebCore::TextCheckingParagraph::expandRangeToNextEnd):
2670         (WebCore::TextCheckingParagraph::rangeLength):
2671         (WebCore::TextCheckingParagraph::paragraphRange):
2672         (WebCore::TextCheckingParagraph::subrange):
2673         (WebCore::TextCheckingParagraph::offsetTo):
2674         (WebCore::TextCheckingParagraph::offsetAsRange):
2675         (WebCore::TextCheckingParagraph::text):
2676         (WebCore::TextCheckingParagraph::checkingStart):
2677         (WebCore::TextCheckingParagraph::checkingEnd):
2678         (WebCore::TextCheckingParagraph::checkingLength):
2679         (WebCore::TextCheckingHelper::TextCheckingHelper):
2680         (WebCore::TextCheckingHelper::findFirstMisspelling):
2681         (WebCore::TextCheckingHelper::findFirstMisspellingOrBadGrammar):
2682         (WebCore::TextCheckingHelper::findFirstGrammarDetail):
2683         (WebCore::TextCheckingHelper::findFirstBadGrammar):
2684         (WebCore::TextCheckingHelper::isUngrammatical):
2685         (WebCore::TextCheckingHelper::guessesForMisspelledOrUngrammaticalRange):
2686         (WebCore::TextCheckingHelper::unifiedTextCheckerEnabled):
2687         * editing/TextCheckingHelper.h:
2688         * editing/TypingCommand.cpp:
2689         (WebCore::TypingCommand::typingAddedToOpenCommand):
2690         * editing/cocoa/EditorCocoa.mm:
2691         (WebCore::Editor::replaceSelectionWithAttributedString):
2692         * editing/gtk/EditorGtk.cpp:
2693         (WebCore::Editor::pasteWithPasteboard):
2694         * editing/ios/EditorIOS.mm:
2695         (WebCore::Editor::pasteWithPasteboard):
2696         * editing/mac/EditorMac.mm:
2697         (WebCore::Editor::pasteWithPasteboard):
2698         (WebCore::Editor::replaceNodeFromPasteboard):
2699         * editing/win/EditorWin.cpp:
2700         (WebCore::Editor::pasteWithPasteboard):
2701         (WebCore::createFragmentFromPlatformData):
2702         * page/DragController.cpp:
2703         (WebCore::DragController::concludeEditDrag):
2704         (WebCore::DragController::startDrag):
2705
2706 2017-05-07  Youenn Fablet  <youenn@apple.com>
2707
2708         [MediaStream] r216197 caused some webrtc tests to fail
2709         https://bugs.webkit.org/show_bug.cgi?id=171728
2710
2711         Reviewed by Eric Carlson.
2712
2713         Covered by existing tests.
2714
2715         Rename MediaStream::endStream to MediaStream::endCaptureTracks and only stopping capture tracks.
2716         Using it when Document is asked to stop media capture.
2717
2718         Adding the ability to have only one active capture source at a time in a WebProcess.
2719         This is done by keeping in its related factory the active capture source.
2720         When a new source is created and started, it replaces the active capture source which becomes muted.
2721         Using that mechanism for iOS.
2722
2723         * Modules/mediastream/MediaStream.cpp:
2724         (WebCore::MediaStream::endCaptureTracks):
2725         (WebCore::MediaStream::endStream): Deleted.
2726         * Modules/mediastream/MediaStream.h:
2727         * Modules/mediastream/MediaStreamTrack.h:
2728         (WebCore::MediaStreamTrack::isCaptureTrack):
2729         * dom/Document.cpp:
2730         (WebCore::Document::stopMediaCapture):
2731         * platform/mediastream/mac/AVAudioCaptureSource.mm:
2732         (WebCore::AVAudioCaptureSourceFactory::setActiveSource):
2733         (WebCore::AVAudioCaptureSource::setupCaptureSession):
2734         * platform/mediastream/mac/AVVideoCaptureSource.mm:
2735         (WebCore::AVVideoCaptureSourceFactory::setActiveSource):
2736         (WebCore::AVVideoCaptureSource::setupCaptureSession):
2737         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
2738         (WebCore::CoreAudioCaptureSourceFactory::setActiveSource):
2739         (WebCore::CoreAudioSharedUnit::startProducingData):
2740
2741 2017-05-07  Tim Horton  <timothy_horton@apple.com>
2742
2743         Clean up some WebProcessProxy, WebPage, and message handler includes
2744         https://bugs.webkit.org/show_bug.cgi?id=171791
2745
2746         Reviewed by Sam Weinig.
2747
2748         * WebCore.xcodeproj/project.pbxproj:
2749         * editing/CompositionUnderline.h: Added.
2750         (WebCore::CompositionUnderline::CompositionUnderline):
2751         * editing/Editor.h:
2752         (WebCore::CompositionUnderline::CompositionUnderline): Deleted.
2753         Move CompositionUnderline out of Editor.h, so that other files can
2754         include that without Editor.h (which is quite large). Also, modernize it slightly.
2755
2756 2017-05-07  Sam Weinig  <sam@webkit.org>
2757
2758         Implement Subresource Integrity (SRI)
2759         https://bugs.webkit.org/show_bug.cgi?id=148363
2760         <rdar://problem/18945879>
2761
2762         Reviewed by Daniel Bates.
2763
2764         Tests: http/tests/subresource-integrity/sri-disabled-with-setting.html
2765                http/tests/subresource-integrity/sri-enabled-with-setting.html
2766                http/tests/subresource-integrity/sri-script-cors.html
2767                http/tests/subresource-integrity/sri-style-cors.html
2768
2769         * CMakeLists.txt:
2770         * WebCore.xcodeproj/project.pbxproj:
2771         Add new files.
2772
2773         * dom/LoadableClassicScript.cpp:
2774         (WebCore::LoadableClassicScript::create):
2775         (WebCore::LoadableClassicScript::notifyFinished):
2776         * dom/LoadableClassicScript.h:
2777         * dom/LoadableScript.h:
2778         * dom/ScriptElement.cpp:
2779         (WebCore::ScriptElement::requestClassicScript):
2780         Store integrity metadata in the script fetcher so it can be passed to
2781         the checked when script load finishes.
2782
2783         * html/HTMLAttributeNames.in:
2784         Add 'integrity'.
2785
2786         * html/HTMLLinkElement.cpp:
2787         (WebCore::HTMLLinkElement::process):
2788         When requesting a stylesheet, cache the integrity metadata so it can
2789         be used when the load completes (accessing the attribute at load completion
2790         time is incorrect, as a script might have changed the attributes value since
2791         the request was made).
2792
2793         (WebCore::HTMLLinkElement::setCSSStyleSheet):
2794         Add an integrity check using the cached integrity metadata when a load
2795         finishes.
2796
2797         * html/HTMLLinkElement.h:
2798         Add cached integrity metadata member.
2799
2800         * html/HTMLLinkElement.idl:
2801         * html/HTMLScriptElement.idl:
2802         Add integrity property.
2803
2804         * html/parser/HTMLParserIdioms.h:
2805         (WebCore::isNotHTMLSpace):
2806         Templatize isNotHTMLSpace so it can work for both UChar and LChar.
2807
2808         * loader/ResourceCryptographicDigest.cpp:
2809         (WebCore::parseCryptographicDigestImpl):
2810         (WebCore::parseEncodedCryptographicDigestImpl):
2811         (WebCore::parseEncodedCryptographicDigest):
2812         (WebCore::decodeEncodedResourceCryptographicDigest):
2813         * loader/ResourceCryptographicDigest.h:
2814         Add concept of an encoded digest to more closely model the spec so that hashes
2815         that match the grammar but are invalid (say, mixing base64 and base64URL) make
2816         it through the algorithm longer, and don't cause us to load something that should
2817         be blocked.
2818
2819         * loader/SubresourceIntegrity.cpp: Added.
2820         * loader/SubresourceIntegrity.h: Added.
2821         Add implementation of Subresource Integrity metadata validation allowing
2822         for a CachedResource and integrity metadata to be passed for validation.
2823
2824         * page/Settings.in:
2825         Add setting for Subresource Integrity, defaulted to enabled.
2826
2827 2017-05-07  Michael Catanzaro  <mcatanzaro@igalia.com>
2828
2829         [GTK] Cannot sign in with new Google sign-in page
2830         https://bugs.webkit.org/show_bug.cgi?id=171770
2831
2832         Reviewed by Carlos Garcia Campos.
2833
2834         Google's new authentication page does not work with the Firefox user
2835         agent that's required to make various Google websites work. Special-case
2836         accounts.google.com so that it receives our standard user agent.
2837
2838         * platform/UserAgentQuirks.cpp:
2839         (WebCore::isGoogle):
2840         (WebCore::urlRequiresFirefoxBrowser):
2841
2842 2017-05-06  Myles C. Maxfield  <mmaxfield@apple.com>
2843
2844         [Cocoa] CTFontDescriptorCreateMatchingFontDescriptor() is not case insensitive
2845         https://bugs.webkit.org/show_bug.cgi?id=171636
2846         <rdar://problem/30811218>
2847
2848         Reviewed by Dean Jackson.
2849
2850         LastResort is the only name which needs to be looked up case-sensitively. We can handle
2851         this in our existing function which handles special font names (like -apple-system) to
2852         make sure that we always do the right thing.
2853
2854         Test: fast/text/lastResort.html
2855
2856         * platform/graphics/ios/FontCacheIOS.mm:
2857         (WebCore::platformFontWithFamilySpecialCase):
2858         * platform/graphics/mac/FontCacheMac.mm:
2859         (WebCore::platformFontWithFamilySpecialCase):
2860         * platform/spi/cocoa/CoreTextSPI.h:
2861
2862 2017-05-06  Chris Dumez  <cdumez@apple.com>
2863
2864         Implement the concept of cookie-averse document
2865         https://bugs.webkit.org/show_bug.cgi?id=171746
2866         <rdar://problem/32004466>
2867
2868         Reviewed by Sam Weinig.
2869
2870         Implement the concept of cookie-averse document:
2871         - https://html.spec.whatwg.org/#cookie-averse-document-object
2872
2873         Test: fast/cookies/cookie-averse-document.html
2874
2875         * dom/Document.cpp:
2876         (WebCore::Document::isCookieAverse):
2877         (WebCore::Document::cookie):
2878         (WebCore::Document::setCookie):
2879         * dom/Document.h:
2880
2881 2017-05-06  Chris Dumez  <cdumez@apple.com>
2882
2883         Unreviewed build fix after r216339.
2884
2885         * dom/Document.h:
2886         (WebCore::Document::readyState):
2887
2888 2017-05-06  Chris Dumez  <cdumez@apple.com>
2889
2890         Align our IDL files with the latest DOM specification
2891         https://bugs.webkit.org/show_bug.cgi?id=171777
2892
2893         Reviewed by Sam Weinig.
2894
2895         Align our IDL files with the latest DOM specification:
2896         - https://dom.spec.whatwg.org
2897
2898         No Web-facing behavior change. Things that do not match the specification
2899         have been annotated with FIXME comments.
2900
2901         * dom/CharacterData.idl:
2902         * dom/Comment.idl:
2903         * dom/CustomEvent.idl:
2904         * dom/DOMImplementation.idl:
2905         * dom/Document.cpp:
2906         * dom/Document.h:
2907         (WebCore::Document::readyState):
2908         * dom/Document.idl:
2909         * dom/MutationObserver.idl:
2910         * dom/NamedNodeMap.idl:
2911         * dom/NodeFilter.idl:
2912         * dom/NodeIterator.idl:
2913         * dom/NodeList.idl:
2914         * dom/NonDocumentTypeChildNode.idl:
2915         * dom/ParentNode.idl:
2916         * dom/ProcessingInstruction.idl:
2917         * dom/Range.idl:
2918         * dom/ShadowRoot.idl:
2919         * dom/Text.idl:
2920         * dom/TreeWalker.idl:
2921         * html/DOMTokenList.idl:
2922
2923 2017-05-06  Tim Horton  <timothy_horton@apple.com>
2924
2925         Reduce the number of includes in WebPage.h and WebProcess.h
2926         https://bugs.webkit.org/show_bug.cgi?id=171779
2927
2928         Reviewed by Sam Weinig.
2929
2930         * page/TextIndicator.h:
2931
2932 2017-05-06  Alexey Proskuryakov  <ap@apple.com>
2933
2934         REGRESSION (r216294): The new test fails on WebKit1
2935         https://bugs.webkit.org/show_bug.cgi?id=171780
2936
2937         Rolling back https://trac.webkit.org/r216294, https://trac.webkit.org/r216296,
2938         https://trac.webkit.org/216299, https://trac.webkit.org/216330
2939
2940         * page/FrameView.cpp:
2941         (WebCore::FrameView::paintContents):
2942         * page/FrameView.h:
2943         * platform/ScrollView.cpp:
2944         (WebCore::ScrollView::paint):
2945         * platform/ScrollView.h:
2946         * platform/Scrollbar.cpp:
2947         (WebCore::Scrollbar::paint):
2948         * platform/Scrollbar.h:
2949         * platform/Widget.h:
2950         * platform/graphics/filters/FilterOperation.h:
2951         (WebCore::FilterOperation::movesPixels):
2952         (WebCore::FilterOperation::shouldBeRestrictedBySecurityOrigin): Deleted.
2953         * platform/graphics/filters/FilterOperations.cpp:
2954         (WebCore::FilterOperations::hasFilterThatShouldBeRestrictedBySecurityOrigin): Deleted.
2955         * platform/graphics/filters/FilterOperations.h:
2956         * platform/gtk/WidgetGtk.cpp:
2957         (WebCore::Widget::paint):
2958         * platform/ios/WidgetIOS.mm:
2959         (WebCore::Widget::paint):
2960         * platform/mac/WidgetMac.mm:
2961         (WebCore::Widget::paint):
2962         * platform/win/WidgetWin.cpp:
2963         (WebCore::Widget::paint):
2964         * rendering/FilterEffectRenderer.cpp:
2965         (WebCore::FilterEffectRenderer::build):
2966         * rendering/FilterEffectRenderer.h:
2967         * rendering/PaintInfo.h:
2968         (WebCore::PaintInfo::PaintInfo):
2969         (): Deleted.
2970         * rendering/RenderLayer.cpp:
2971         (WebCore::RenderLayer::paint):
2972         (WebCore::RenderLayer::setupFilters):
2973         (WebCore::RenderLayer::paintForegroundForFragmentsWithPhase):
2974         * rendering/RenderLayer.h:
2975         * rendering/RenderScrollbar.cpp:
2976         (WebCore::RenderScrollbar::paint):
2977         * rendering/RenderScrollbar.h:
2978         * rendering/RenderWidget.cpp:
2979         (WebCore::RenderWidget::paintContents):
2980
2981 2017-05-06  Chris Dumez  <cdumez@apple.com>
2982
2983         Unreviewed, rolling out r216333.
2984
2985         Caused layout test failures
2986
2987         Reverted changeset:
2988
2989         "Implement the concept of cookie-averse document"
2990         https://bugs.webkit.org/show_bug.cgi?id=171746
2991         http://trac.webkit.org/changeset/216333
2992
2993 2017-05-06  Chris Dumez  <cdumez@apple.com>
2994
2995         Implement the concept of cookie-averse document
2996         https://bugs.webkit.org/show_bug.cgi?id=171746
2997         <rdar://problem/32004466>
2998
2999         Reviewed by Sam Weinig.
3000
3001         Implement the concept of cookie-averse document:
3002         - https://html.spec.whatwg.org/#cookie-averse-document-object
3003
3004         Test: fast/cookies/cookie-averse-document.html
3005
3006         * dom/Document.cpp:
3007         (WebCore::Document::isCookieAverse):
3008         (WebCore::Document::cookie):
3009         (WebCore::Document::setCookie):
3010         * dom/Document.h:
3011
3012 2017-05-06  Myles C. Maxfield  <mmaxfield@apple.com>
3013
3014         REGERSSION(r213499): Emoji with Fitzpatrick modifiers are drawn as two separate glyphs
3015         https://bugs.webkit.org/show_bug.cgi?id=171750
3016         <rdar://problem/31122612>
3017
3018         Reviewed by Zalan Bujtas.
3019
3020         Emoji with Fitzpatrick modifiers need to take our complex text codepath. When looking through
3021         the string to determine which code path to use, we ask if a particular codepoint is an emoji
3022         group candidate. r213499 expanded the set of these candidates to include Fitzpatrick modifiers,
3023         which means the next "if" statement would never be hit. Instead, we should check that "if"
3024         statement first (because order is not important here). The next checks do not intersect with
3025         any emoji group candidates.
3026
3027         Test: fast/text/fitzpatrick-combination.html
3028
3029         * platform/graphics/FontCascade.cpp:
3030         (WebCore::FontCascade::characterRangeCodePath):
3031
3032 2017-05-06  Youenn Fablet  <youenn@apple.com>
3033
3034         RealtimeMediaSourceCenter callbacks should be passed as r-values
3035         https://bugs.webkit.org/show_bug.cgi?id=171407
3036
3037         Reviewed by Eric Carlson.
3038
3039         No change of behavior, this is mostly style here.
3040
3041         * platform/mediastream/RealtimeMediaSourceCenter.h:
3042         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
3043         (WebCore::RealtimeMediaSourceCenterMac::validateRequestConstraints):
3044         (WebCore::RealtimeMediaSourceCenterMac::createMediaStream):
3045         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.h:
3046         * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp:
3047         (WebCore::RealtimeMediaSourceCenterOwr::validateRequestConstraints):
3048         * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.h:
3049         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
3050         (WebCore::MockRealtimeMediaSourceCenter::validateRequestConstraints):
3051         (WebCore::MockRealtimeMediaSourceCenter::createMediaStream):
3052         * platform/mock/MockRealtimeMediaSourceCenter.h:
3053
3054 2017-05-05  Zalan Bujtas  <zalan@apple.com>
3055
3056         Renderers being destroyed should not be added to AX's deferred list.
3057         https://bugs.webkit.org/show_bug.cgi?id=171768
3058         <rdar://problem/31955660>
3059
3060         Reviewed by Simon Fraser.
3061
3062         In certain cases, when custom scrollbars are present, while destroying the scrollbars' block parent, we
3063           - first remove the block from the AX's deferred list (AXObjectCache::remove)
3064           - destroy the render layer that owns the custom scrollbars (RenderLayer::destroyLayer) 
3065           - detach the scrollbars from the parent (block) (RenderObject::removeFromParent)
3066             - clean up the block's lines (RenderBlock::deleteLines)
3067               - push the block back to the AX's deferred list (AXObjectCache::recomputeDeferredIsIgnored)
3068         At this point no one will remove the current block from AX's deferred list.
3069
3070         Test: accessibility/crash-when-renderers-are-added-back-to-deferred-list.html
3071
3072         * accessibility/AXObjectCache.cpp:
3073         (WebCore::AXObjectCache::recomputeDeferredIsIgnored):
3074         (WebCore::AXObjectCache::deferTextChanged):
3075
3076 2017-05-05  Said Abou-Hallawa  <sabouhallawa@apple.com>
3077
3078         Crash in ImageFrameCache::decodedSizeChanged() after image load cancellation
3079         https://bugs.webkit.org/show_bug.cgi?id=171736
3080
3081         Reviewed by Tim Horton.
3082
3083         Tests: Covered by run-webkit-tests fast/images/image-formats-support.html
3084         --guard-malloc.
3085
3086         Because an image format is not supported, the ImageObserver of the Image
3087         is deleted then the Image itself is deleted. In BitmapImage destructor,
3088         we make a call which ends up accessing the deleted ImageObserver.
3089
3090         To fix this, we need to change the BitImage destructor to avoid calling 
3091         ImageFrameCache::decodedSizeChanged() since it is not really needed.
3092
3093         * platform/graphics/BitmapImage.cpp:
3094         (WebCore::BitmapImage::~BitmapImage):
3095
3096 2017-05-05  Timothy Horton  <timothy_horton@apple.com>
3097
3098         [Mac] Adjust cursor position for dragged link (and stop it from moving based on how fast you are dragging)
3099         https://bugs.webkit.org/show_bug.cgi?id=171764
3100         <rdar://problem/32005865>
3101
3102         Reviewed by Simon Fraser.
3103
3104         * page/DragController.cpp:
3105         (WebCore::DragController::startDrag):
3106         Compute dragImageAnchorPoint only if it is needed.
3107         Don't compute a random unused imageRect.
3108         Factor link drag image offset computation out into DragImage functions
3109         for platforms to override.
3110
3111         Pass dragOrigin (the mouseDown point), not mouseDraggedPoint, to
3112         doSystemDrag, just like all the other drag types. This plus the
3113         WebKit2 change makes the link stable vs. the cursor, instead of
3114         positioned based on how fast you move after the mouse down.
3115
3116         * page/DragController.h:
3117         * page/gtk/DragControllerGtk.cpp:
3118         * page/mac/DragControllerMac.mm:
3119         * page/win/DragControllerWin.cpp:
3120         Move LinkDragBorderInset into DragImage, and share between the non-Mac platforms.
3121
3122         * platform/DragImage.cpp:
3123         (WebCore::dragOffsetForLinkDragImage):
3124         (WebCore::anchorPointForLinkDragImage):
3125         * platform/DragImage.h:
3126         As previously mentioned, move the computation of drag image offset here.
3127
3128         * platform/mac/DragImageMac.mm:
3129         (WebCore::dragOffsetForLinkDragImage):
3130         (WebCore::anchorPointForLinkDragImage):
3131         Put the new drag image to the bottom right of the cursor.
3132
3133 2017-05-05  Dean Jackson  <dino@apple.com>
3134
3135         ...and now the GTK and Windows builds.
3136
3137         * platform/gtk/WidgetGtk.cpp:
3138         (WebCore::Widget::paint):
3139         * platform/win/WidgetWin.cpp:
3140         (WebCore::Widget::paint):
3141
3142 2017-05-05  Brady Eidson  <beidson@apple.com>
3143
3144         API test WebKit2.WebsiteDataStoreCustomPaths is failing on ios-simulator.
3145         <rdar://problem/31977294> and https://bugs.webkit.org/show_bug.cgi?id=171513
3146
3147         Reviewed by Andy Estes.
3148
3149         Covered by API test.
3150
3151         * platform/spi/cf/CFNetworkSPI.h:
3152
3153 2017-05-05  Dean Jackson  <dino@apple.com>
3154
3155         Try to fix iOS build.
3156
3157         * platform/ios/WidgetIOS.mm:
3158         (WebCore::Widget::paint):
3159
3160 2017-05-05  Dean Jackson  <dino@apple.com>
3161
3162         Restrict SVG filters to accessible security origins
3163         https://bugs.webkit.org/show_bug.cgi?id=118689
3164         <rdar://problem/27362159>
3165
3166         Reviewed by Brent Fulgham.
3167
3168         Certain SVG filters should only be allowed to operate
3169         on content that is has SecurityOrigin access to. Implement
3170         this by including a flag in PaintInfo and LayerPaintingInfo,
3171         and have RenderWidget make sure the documents have acceptable
3172         SecurityOrigins as it goes to paint.
3173
3174         This could be used as the first step in a "safe painting"
3175         strategy, allowing some content to be rendered into a 
3176         canvas or via the element() CSS function... but it is only
3177         a small first step.
3178
3179         Test: http/tests/css/filters-on-iframes.html
3180
3181         * page/FrameView.cpp:
3182         (WebCore::FrameView::paintContents):
3183         * page/FrameView.h:
3184         * platform/ScrollView.cpp:
3185         (WebCore::ScrollView::paint):
3186         * platform/ScrollView.h:
3187         * platform/Scrollbar.cpp:
3188         (WebCore::Scrollbar::paint):
3189         * platform/Scrollbar.h:
3190         * platform/Widget.h:
3191         * platform/graphics/filters/FilterOperation.h:
3192         (WebCore::FilterOperation::shouldBeRestrictedBySecurityOrigin):
3193         * platform/graphics/filters/FilterOperations.cpp:
3194         (WebCore::FilterOperations::hasFilterThatShouldBeRestrictedBySecurityOrigin):
3195         * platform/graphics/filters/FilterOperations.h:
3196         * platform/mac/WidgetMac.mm:
3197         (WebCore::Widget::paint):
3198         * rendering/FilterEffectRenderer.cpp:
3199         (WebCore::FilterEffectRenderer::build):
3200         * rendering/FilterEffectRenderer.h:
3201         * rendering/PaintInfo.h:
3202         (WebCore::PaintInfo::PaintInfo):
3203         * rendering/RenderLayer.cpp:
3204         (WebCore::RenderLayer::paint):
3205         (WebCore::RenderLayer::setupFilters):
3206         (WebCore::RenderLayer::paintForegroundForFragmentsWithPhase):
3207         * rendering/RenderLayer.h:
3208         * rendering/RenderScrollbar.cpp:
3209         (WebCore::RenderScrollbar::paint):
3210         * rendering/RenderScrollbar.h:
3211         * rendering/RenderWidget.cpp:
3212         (WebCore::RenderWidget::paintContents):
3213
3214 2017-05-05  Ryan Haddad  <ryanhaddad@apple.com>
3215
3216         Unreviewed, rolling out r216273.
3217
3218         This change caused an assertion failure on WK1.
3219
3220         Reverted changeset:
3221
3222         "Crash in ImageFrameCache::decodedSizeChanged() after image
3223         load cancellation"
3224         https://bugs.webkit.org/show_bug.cgi?id=171736
3225         http://trac.webkit.org/changeset/216273
3226
3227 2017-05-05  Brian Burg  <bburg@apple.com>
3228
3229         [Cocoa] Converting from WebCore::Cookie to NSHTTPCookie always marks cookies as session cookies
3230         https://bugs.webkit.org/show_bug.cgi?id=171748
3231         <rdar://problem/32027327>
3232
3233         Reviewed by Michael Catanzaro.
3234
3235         The function that we use to convert from WebCore::Cookie to NSHTTPCookie was
3236         also misusing the NSHTTPCookieDiscard property. If any value is provided for
3237         this key, even @NO, CFNetwork interprets that to mean that the cookie has the
3238         "session" flag.
3239
3240         This is known to affect cookies set via WebCookieManager, WKHTTPCookieStore,
3241         and WebAutomationSession.
3242
3243         This is covered by existing test WebKit2.WKHTTPCookieStore.
3244
3245         * platform/network/cocoa/CookieCocoa.mm:
3246         (WebCore::Cookie::operator NSHTTPCookie *):
3247         Don't include the property if the cookie is not a session cookie.
3248
3249 2017-05-05  Youenn Fablet  <youenn@apple.com>
3250
3251         TURNS gathering is not working properly
3252         https://bugs.webkit.org/show_bug.cgi?id=171747
3253
3254         Reviewed by Eric Carlson.
3255
3256         Did manual testing on real TURNS servers.
3257
3258         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
3259         (WebCore::configurationFromMediaEndpointConfiguration): Disabling TURNS servers gathering.
3260
3261 2017-05-05  Ryan Haddad  <ryanhaddad@apple.com>
3262
3263         Unreviewed, rolling out r216275.
3264
3265         This change broke internal builds.
3266
3267         Reverted changeset:
3268
3269         "[Cocoa] CTFontDescriptorCreateMatchingFontDescriptor() is not
3270         case insensitive"
3271         https://bugs.webkit.org/show_bug.cgi?id=171636
3272         http://trac.webkit.org/changeset/216275
3273
3274 2017-05-05  Myles C. Maxfield  <mmaxfield@apple.com>
3275
3276         [Cocoa] CTFontDescriptorCreateMatchingFontDescriptor() is not case insensitive
3277         https://bugs.webkit.org/show_bug.cgi?id=171636
3278         <rdar://problem/30811218>
3279
3280         Reviewed by Dean Jackson.
3281
3282         LastResort is the only name which needs to be looked up case-sensitively. We can handle
3283         this in our existing function which handles special font names (like -apple-system) to
3284         make sure that we always do the right thing.
3285
3286         Test: fast/text/lastResort.html
3287
3288         * platform/spi/cocoa/CoreTextSPI.h:
3289         * platform/graphics/ios/FontCacheIOS.mm:
3290         (WebCore::platformFontWithFamilySpecialCase):
3291         * platform/graphics/mac/FontCacheMac.mm:
3292         (WebCore::platformFontWithFamilySpecialCase):
3293
3294 2017-05-05  Said Abou-Hallawa  <sabouhallawa@apple.com>
3295
3296         Crash in ImageFrameCache::decodedSizeChanged() after image load cancellation
3297         https://bugs.webkit.org/show_bug.cgi?id=171736
3298
3299         Reviewed by Tim Horton.
3300
3301         Tests: Covered by run-webkit-tests fast/images/image-formats-support.html
3302         --guard-malloc.
3303
3304         Because an image format is not supported, the ImageObserver of the Image
3305         is deleted then the Image itself is deleted. In BitmapImage destructor,
3306         we make a call which ends up accessing the deleted ImageObserver.
3307
3308         To fix this, we need to setImageObsever of the Image to-be-deleted to 
3309         nullptr. So the Image can avoid accessing its ImageObserver, while it is
3310         being deleted. Also we can change the BitImage destructor to avoid calling 
3311         ImageFrameCache::decodedSizeChanged() since it is not really needed.
3312
3313         * loader/cache/CachedImage.cpp:
3314         (WebCore::CachedImage::clearImage):
3315         * platform/graphics/BitmapImage.cpp:
3316         (WebCore::BitmapImage::~BitmapImage):
3317
3318 2017-05-05  Brian Burg  <bburg@apple.com>
3319
3320         CrashTracer: [USER] com.apple.WebKit.WebContent.Development at com.apple.WebCore: WebCore::commonVMSlow + 57
3321         https://bugs.webkit.org/show_bug.cgi?id=171669
3322         <rdar://problem/31967684>
3323
3324         Reviewed by Mark Lam.
3325
3326         * bindings/js/CommonVM.h:
3327         (WebCore::commonVMOrNull):
3328         Add an inline accessor function to expose the global variable.
3329
3330 2017-05-05  Filip Pizlo  <fpizlo@apple.com>
3331
3332         GCController.cpp's collect() should be Async
3333         https://bugs.webkit.org/show_bug.cgi?id=171708
3334
3335         Reviewed by Saam Barati.
3336
3337         No new tests because no change in behavior.
3338         
3339         This is one step towards not requesting sync GCs in WebCore. I'm landing this incrementally to
3340         make bisecting super easy.
3341
3342         * bindings/js/GCController.cpp:
3343         (WebCore::collect):
3344
3345 2017-05-05  Chris Dumez  <cdumez@apple.com>
3346
3347         Attr Nodes should not have children
3348         https://bugs.webkit.org/show_bug.cgi?id=171688
3349         <rdar://problem/31998412>
3350
3351         Reviewed by Andreas Kling.
3352
3353         Attr Nodes should not have children as per the latest DOM specification:
3354         - https://dom.spec.whatwg.org/#interface-attr
3355         - https://dom.spec.whatwg.org/#dom-attr-value
3356         - https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity (Step 1)
3357
3358         Firefox and Chrome both have been matching the DOM specification for a while so I think
3359         we should do the same. This aligns us with other browsers, simplifies the code, is
3360         more efficient and the code being removed has been prone to security bugs.
3361
3362         Test: fast/dom/Attr/cannot-have-children.html
3363
3364         * dom/Attr.cpp:
3365         (WebCore::Attr::Attr):
3366         (WebCore::Attr::create):
3367         (WebCore::Attr::setValue):
3368         (WebCore::Attr::cloneNodeInternal):
3369         * dom/Attr.h:
3370         - Have Attr subclass Node instead of ContainerNode as it can no longer have children.
3371         - Drop logic to dealing with children / creating a Text child.
3372
3373         * dom/CharacterData.cpp:
3374         (WebCore::CharacterData::notifyParentAfterChange):
3375         Drop useless check found by the compiler. parentNode() can no longer be an Attr node.
3376
3377         * dom/Node.cpp:
3378         (WebCore::appendTextContent):
3379         appendTextContent() is called by Node.TextContent(). For Attr Nodes, we should no longer traverse
3380         its subtree to gather Text Nodes. Instead, we now return Attr.value, as per the specification:
3381         - https://dom.spec.whatwg.org/#dom-node-textcontent
3382
3383         * dom/Range.cpp:
3384         (WebCore::lengthOfContentsInNode):
3385         As per https://dom.spec.whatwg.org/#concept-node-length, we should return the number of children
3386         for Attr Nodes, which will always be 0.
3387
3388         * xml/XPathUtil.cpp:
3389         (WebCore::XPath::isValidContextNode):
3390         Always return true for TEXT_NODE as the !(node->parentNode() && node->parentNode()->isAttributeNode())
3391         check will also with true now. This is because a parentNode() cannot be an Attribute Node.
3392
3393 2017-05-05  Brian Burg  <bburg@apple.com>
3394
3395         [Cocoa] Converting from WebCore::Cookie to NSHTTPCookie always marks cookies as secure
3396         https://bugs.webkit.org/show_bug.cgi?id=171700
3397         <rdar://problem/32017975>
3398
3399         Reviewed by Brady Eidson.
3400
3401         The function that we use to convert from WebCore::Cookie to NSHTTPCookie was
3402         misusing the NSHTTPCookieSecure property. If any value is provided for this key,
3403         even @NO, CFNetwork interprets that to mean that the cookie has the "secure" flag.
3404         Thus, in some cases we would store an "insecure" cookie on a site that uses the
3405         http:// protocol, and be unable to later retrieve the cookie. This is known to
3406         affect cookies set via WebCookieManager, WKHTTPCookieStore, and WebAutomationSession.
3407
3408         This is covered by existing test WebKit2.WKHTTPCookieStore.
3409         The test had a bug that masked this problem.
3410
3411         * platform/network/cocoa/CookieCocoa.mm:
3412         (WebCore::Cookie::operator NSHTTPCookie *):
3413         Don't include the property if the cookie is not secure.
3414
3415 2017-05-05  Wenson Hsieh  <wenson_hsieh@apple.com>
3416
3417         Add SPI to WebItemProviderPasteboard to synchronously load data with a given timeout
3418         https://bugs.webkit.org/show_bug.cgi?id=171725
3419         <rdar://problem/32014052>
3420
3421         Reviewed by Beth Dakin.
3422
3423         Adds a synchronousTimeout: argument to doAfterLoadingProvidedContentIntoFileURLs:. If a positive timeout
3424         interval is specified by the client, then we will block the main thread for at most that amount of time after
3425         beginning to load from the item providers.
3426
3427         To do this, we introduce another `dispatch_group_t` in parallel to the `fileLoadingGroup` that is entered and
3428         left in the same places. However, instead of attaching a handler block, we simply perform a synchronous wait for
3429         either the time limit to be reached, or the item providers to finish loading.
3430
3431         No new tests -- no change in behavior yet.
3432
3433         * platform/ios/WebItemProviderPasteboard.h:
3434         * platform/ios/WebItemProviderPasteboard.mm:
3435         (-[WebItemProviderPasteboard doAfterLoadingProvidedContentIntoFileURLs:]):
3436         (-[WebItemProviderPasteboard doAfterLoadingProvidedContentIntoFileURLs:synchronousTimeout:]):
3437
3438 2017-05-05  Chris Dumez  <cdumez@apple.com>
3439
3440         Clean up Attr.idl
3441         https://bugs.webkit.org/show_bug.cgi?id=171691
3442
3443         Reviewed by Andreas Kling.
3444
3445         Clean up Attr.idl to match the spec:
3446         - https://dom.spec.whatwg.org/#interface-attr
3447
3448         No Web-facing behavior change except for Attr properties being enumerated
3449         in a slightly different order.
3450
3451         * dom/Attr.idl:
3452
3453 2017-05-05  Antti Koivisto  <antti@apple.com>
3454
3455         ASSERTION FAILED: !frame().document()->inRenderTreeUpdate() in WebCore::FrameView::layout(bool)
3456         https://bugs.webkit.org/show_bug.cgi?id=171717
3457
3458         Reviewed by Brent Fulgham.
3459
3460         * loader/FrameLoader.cpp:
3461         (WebCore::FrameLoader::checkCompleted):
3462
3463             Don't allow frame load to complete in the middle of a render tree update. Instead delay the check.
3464
3465 2017-05-05  Chris Dumez  <cdumez@apple.com>
3466
3467         Refactor / Clean up Element.idl
3468         https://bugs.webkit.org/show_bug.cgi?id=171734
3469
3470         Reviewed by Sam Weinig.
3471
3472         Refactor / Clean up Element.idl to match the latest specification:
3473         - https://dom.spec.whatwg.org/#interface-element
3474
3475         There is no Web-facing behavior change in this patch besides the Element properties
3476         being enumerated in a slightly different order. Things that do not match the
3477         specification have merely been annotated with FIXME comments for now. This makes
3478         it much more obvious what's standard, what's not and what needs fixing.
3479
3480         * dom/Element.idl:
3481
3482 2017-05-05  Tim Horton  <timothy_horton@apple.com>
3483
3484         Link drag images for apple.com front page links have a lot of spurious whitespace
3485         https://bugs.webkit.org/show_bug.cgi?id=171719
3486         <rdar://problem/32010854>
3487
3488         Reviewed by Wenson Hsieh.
3489
3490         * page/DragController.cpp:
3491         (WebCore::DragController::startDrag):
3492         Use the white-space-simplified string that we put on the pasteboard
3493         for the drag image, too!
3494
3495 2017-05-04  Mark Lam  <mark.lam@apple.com>
3496
3497         DRT's setAudioResultCallback() and IDBRequest::setResult() need to acquire the JSLock.
3498         https://bugs.webkit.org/show_bug.cgi?id=171716
3499         <rdar://problem/30878027>
3500
3501         Reviewed by Saam Barati.
3502
3503         No new tests.  This issue was caught by existing tests.
3504
3505         IDBRequest::setResult() needs to acquire the JSLock before calling toJS() (which
3506         does JS conversion and therefore, potentially JS allocations).
3507
3508         * Modules/indexeddb/IDBRequest.cpp:
3509         (WebCore::IDBRequest::setResult):
3510         (WebCore::IDBRequest::setResultToStructuredClone):
3511
3512 2017-05-05  Carlos Garcia Campos  <cgarcia@igalia.com>
3513
3514         [GStreamer] Do not report more errors after the first one
3515         https://bugs.webkit.org/show_bug.cgi?id=171722
3516
3517         Reviewed by Xabier Rodriguez-Calvar.
3518
3519         We can receive several error messages for the same error from different elements. That's not expected by the
3520         media source selection algorithm implementation. I don't know if didn't happen with previous versions of GST,
3521         but since the upgrade to 1.10.4 several tests are failing because of this.
3522
3523         Fixes: media/video-error-does-not-exist.html
3524                media/video-load-networkState.html
3525                media/video-source-error.html
3526                media/video-source-none-supported.html
3527                media/video-source-moved.html
3528
3529         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3530         (WebCore::MediaPlayerPrivateGStreamer::handleMessage): Return early also when an error already occured.
3531
3532 2017-05-05  Carlos Garcia Campos  <cgarcia@igalia.com>
3533
3534         [GStreamer] Fix handling of gst errors in MediaPlayerPrivateGStreamer::handleMessage
3535         https://bugs.webkit.org/show_bug.cgi?id=171721
3536
3537         Reviewed by Xabier Rodriguez-Calvar.
3538
3539         We are checking the GError only comparing the code, and ignoring the domain in some cases. Use g_error_matches()
3540         in those cases instead of only checking the code.
3541
3542         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3543         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
3544
3545 2017-05-04  Commit Queue  <commit-queue@webkit.org>
3546
3547         Unreviewed, rolling out r216206.
3548         https://bugs.webkit.org/show_bug.cgi?id=171714
3549
3550         Multiple LayoutTests crashing in Document::page() (Requested
3551         by ap on #webkit).
3552
3553         Reverted changeset:
3554
3555         "Remove support for legacy Notifications"
3556         https://bugs.webkit.org/show_bug.cgi?id=171487
3557         http://trac.webkit.org/changeset/216206
3558
3559 2017-05-04  Chris Dumez  <cdumez@apple.com>
3560
3561         Drop remaining uses of PassRefPtr from CompositeEditCommand
3562         https://bugs.webkit.org/show_bug.cgi?id=171645
3563
3564         Reviewed by Darin Adler.
3565
3566         Drop remaining uses of PassRefPtr from CompositeEditCommand.
3567
3568         * editing/ApplyBlockElementCommand.cpp:
3569         (WebCore::ApplyBlockElementCommand::rangeForParagraphSplittingTextNodesIfNeeded):
3570         (WebCore::ApplyBlockElementCommand::endOfNextParagraphSplittingTextNodesIfNeeded):
3571         * editing/ApplyStyleCommand.cpp:
3572         (WebCore::ApplyStyleCommand::applyRelativeFontStyleChange):
3573         (WebCore::ApplyStyleCommand::cleanupUnstyledAppleStyleSpans):
3574         (WebCore::ApplyStyleCommand::splitAncestorsWithUnicodeBidi):
3575         (WebCore::ApplyStyleCommand::removeEmbeddingUpToEnclosingBlock):
3576         (WebCore::ApplyStyleCommand::applyInlineStyleToNodeRange):
3577         (WebCore::ApplyStyleCommand::removeInlineStyleFromElement):
3578         (WebCore::ApplyStyleCommand::replaceWithSpanOrRemoveIfWithoutAttributes):
3579         (WebCore::ApplyStyleCommand::removeImplicitlyStyledElement):
3580         (WebCore::ApplyStyleCommand::removeCSSStyle):
3581         (WebCore::ApplyStyleCommand::applyInlineStyleToPushDown):
3582         (WebCore::ApplyStyleCommand::splitTextAtStart):
3583         (WebCore::ApplyStyleCommand::splitTextAtEnd):
3584         (WebCore::ApplyStyleCommand::splitTextElementAtStart):
3585         (WebCore::ApplyStyleCommand::splitTextElementAtEnd):
3586         (WebCore::ApplyStyleCommand::surroundNodeRangeWithElement):
3587         (WebCore::ApplyStyleCommand::addBlockStyle):
3588         (WebCore::ApplyStyleCommand::addInlineStyleIfNeeded):
3589         (WebCore::ApplyStyleCommand::applyInlineStyleChange):
3590         (WebCore::ApplyStyleCommand::joinChildTextNodes):
3591         * editing/BreakBlockquoteCommand.cpp:
3592         (WebCore::BreakBlockquoteCommand::doApply):
3593         * editing/CompositeEditCommand.cpp:
3594         (WebCore::applyCommand):
3595         (WebCore::CompositeEditCommand::insertNodeAt):
3596         (WebCore::CompositeEditCommand::removeChildrenInRange):
3597         (WebCore::CompositeEditCommand::removeNode):
3598         (WebCore::CompositeEditCommand::removeNodePreservingChildren):
3599         (WebCore::CompositeEditCommand::removeNodeAndPruneAncestors):
3600         (WebCore::CompositeEditCommand::moveRemainingSiblingsToNewParent):
3601         (WebCore::CompositeEditCommand::replaceElementWithSpanPreservingChildrenAndAttributes):
3602         (WebCore::CompositeEditCommand::prune):
3603         (WebCore::CompositeEditCommand::splitTextNode):
3604         (WebCore::CompositeEditCommand::splitElement):
3605         (WebCore::CompositeEditCommand::mergeIdenticalElements):
3606         (WebCore::CompositeEditCommand::splitTextNodeContainingElement):
3607         (WebCore::CompositeEditCommand::positionOutsideTabSpan):
3608         (WebCore::CompositeEditCommand::removeNodeAttribute):
3609         (WebCore::CompositeEditCommand::setNodeAttribute):
3610         (WebCore::CompositeEditCommand::deleteInsignificantText):
3611         (WebCore::CompositeEditCommand::removePlaceholderAt):
3612         (WebCore::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary):
3613         (WebCore::CompositeEditCommand::pushAnchorElementDown):
3614         (WebCore::CompositeEditCommand::cleanupAfterDeletion):
3615         (WebCore::CompositeEditCommand::moveParagraphs):
3616         * editing/CompositeEditCommand.h:
3617         * editing/DeleteSelectionCommand.cpp:
3618         (WebCore::DeleteSelectionCommand::handleSpecialCaseBRDelete):
3619         (WebCore::DeleteSelectionCommand::removeNodeUpdatingStates):
3620         (WebCore::DeleteSelectionCommand::removeNode):
3621         (WebCore::DeleteSelectionCommand::makeStylingElementsDirectChildrenOfEditableRootToPreventStyleLoss):
3622         (WebCore::DeleteSelectionCommand::handleGeneralDelete):
3623         (WebCore::DeleteSelectionCommand::mergeParagraphs):
3624         (WebCore::DeleteSelectionCommand::removePreviouslySelectedEmptyTableRows):
3625         (WebCore::DeleteSelectionCommand::removeRedundantBlocks):
3626         * editing/DeleteSelectionCommand.h:
3627         * editing/Editor.cpp:
3628         (WebCore::ClearTextCommand::CreateAndApply):
3629         (WebCore::Editor::replaceSelectionWithFragment):
3630         (WebCore::Editor::handleAcceptedCandidate):
3631         * editing/EditorCommand.cpp:
3632         (WebCore::executeFormatBlock):
3633         * editing/IndentOutdentCommand.cpp:
3634         (WebCore::IndentOutdentCommand::outdentParagraph):
3635         * editing/InsertLineBreakCommand.cpp:
3636         (WebCore::InsertLineBreakCommand::doApply):
3637         * editing/InsertListCommand.cpp:
3638         (WebCore::InsertListCommand::fixOrphanedListChild):
3639         (WebCore::InsertListCommand::doApplyForSingleParagraph):
3640         (WebCore::InsertListCommand::unlistifyParagraph):
3641         * editing/InsertParagraphSeparatorCommand.cpp:
3642         (WebCore::InsertParagraphSeparatorCommand::doApply):
3643         * editing/InsertTextCommand.cpp:
3644         (WebCore::InsertTextCommand::insertTab):
3645         * editing/ModifySelectionListLevel.cpp:
3646         (WebCore::ModifySelectionListLevelCommand::insertSiblingNodeRangeBefore):
3647         (WebCore::ModifySelectionListLevelCommand::insertSiblingNodeRangeAfter):
3648         (WebCore::ModifySelectionListLevelCommand::appendSiblingNodeRange):
3649         (WebCore::DecreaseSelectionListLevelCommand::doApply):
3650         * editing/RemoveNodePreservingChildrenCommand.cpp:
3651         (WebCore::RemoveNodePreservingChildrenCommand::RemoveNodePreservingChildrenCommand):
3652         (WebCore::RemoveNodePreservingChildrenCommand::doApply):
3653         * editing/RemoveNodePreservingChildrenCommand.h:
3654         (WebCore::RemoveNodePreservingChildrenCommand::create):
3655         * editing/ReplaceNodeWithSpanCommand.cpp:
3656         (WebCore::ReplaceNodeWithSpanCommand::ReplaceNodeWithSpanCommand):
3657         (WebCore::ReplaceNodeWithSpanCommand::doApply):
3658         (WebCore::ReplaceNodeWithSpanCommand::doUnapply):
3659         (WebCore::ReplaceNodeWithSpanCommand::getNodesInCommand):
3660         * editing/ReplaceNodeWithSpanCommand.h:
3661         (WebCore::ReplaceNodeWithSpanCommand::create):
3662         * editing/ReplaceSelectionCommand.cpp:
3663         (WebCore::ReplacementFragment::removeNodePreservingChildren):
3664         (WebCore::ReplacementFragment::removeInterchangeNodes):
3665         (WebCore::ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline):
3666         (WebCore::ReplaceSelectionCommand::makeInsertedContentRoundTrippableWithHTMLTreeBuilder):
3667         (WebCore::ReplaceSelectionCommand::moveNodeOutOfAncestor):
3668         (WebCore::ReplaceSelectionCommand::removeUnrenderedTextNodesAtEnds):
3669         (WebCore::handleStyleSpansBeforeInsertion):
3670         (WebCore::ReplaceSelectionCommand::handleStyleSpans):
3671         (WebCore::ReplaceSelectionCommand::doApply):
3672         (WebCore::ReplaceSelectionCommand::mergeTextNodesAroundPosition):
3673         (WebCore::ReplaceSelectionCommand::insertAsListItems):
3674         (WebCore::ReplaceSelectionCommand::performTrivialReplace):
3675         * editing/SetNodeAttributeCommand.cpp:
3676         (WebCore::SetNodeAttributeCommand::SetNodeAttributeCommand):
3677         (WebCore::SetNodeAttributeCommand::getNodesInCommand):
3678         * editing/SetNodeAttributeCommand.h:
3679         (WebCore::SetNodeAttributeCommand::create):
3680         * editing/SimplifyMarkupCommand.cpp:
3681         (WebCore::SimplifyMarkupCommand::doApply):
3682         (WebCore::SimplifyMarkupCommand::pruneSubsequentAncestorsToRemove):
3683         * editing/SimplifyMarkupCommand.h:
3684         * editing/SplitElementCommand.cpp:
3685         (WebCore::SplitElementCommand::SplitElementCommand):
3686         (WebCore::SplitElementCommand::executeApply):
3687         (WebCore::SplitElementCommand::getNodesInCommand):
3688         * editing/SplitElementCommand.h:
3689         (WebCore::SplitElementCommand::create):
3690         * editing/SplitTextNodeCommand.cpp:
3691         (WebCore::SplitTextNodeCommand::SplitTextNodeCommand):
3692         (WebCore::SplitTextNodeCommand::doApply):
3693         (WebCore::SplitTextNodeCommand::doUnapply):
3694         (WebCore::SplitTextNodeCommand::doReapply):
3695         (WebCore::SplitTextNodeCommand::insertText1AndTrimText2):
3696         * editing/SplitTextNodeCommand.h:
3697         (WebCore::SplitTextNodeCommand::create):
3698         * editing/SplitTextNodeContainingElementCommand.cpp:
3699         (WebCore::SplitTextNodeContainingElementCommand::SplitTextNodeContainingElementCommand):
3700         (WebCore::SplitTextNodeContainingElementCommand::doApply):
3701         * editing/SplitTextNodeContainingElementCommand.h:
3702         (WebCore::SplitTextNodeContainingElementCommand::create):
3703         * editing/TextInsertionBaseCommand.cpp:
3704         (WebCore::TextInsertionBaseCommand::applyTextInsertionCommand):
3705         * editing/TypingCommand.cpp:
3706         (WebCore::TypingCommand::makeEditableRootEmpty):
3707         * page/ContextMenuController.cpp:
3708         (WebCore::ContextMenuController::contextMenuItemSelected):
3709
3710 2017-05-04  Daniel Bates  <dabates@apple.com>
3711
3712         Fix misspelled word "interrupt" as pointed out by Darin Adler
3713         in <https://bugs.webkit.org/show_bug.cgi?id=171577>.
3714
3715         * loader/FrameLoader.cpp:
3716         (WebCore::FrameLoader::transitionToCommitted):
3717
3718 2017-05-04  Jeremy Jones  <jeremyj@apple.com>
3719
3720         UIColor +whiteColor and +clearColor are ambiguous and need to be casted when soft linked.
3721         https://bugs.webkit.org/show_bug.cgi?id=171704
3722
3723         Reviewed by Jer Noble.
3724
3725         No new tests because no behavior change.
3726
3727         Fix build by casting result of +clearColor to UIColor.
3728
3729         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
3730         (clearUIColor):
3731         (WebVideoFullscreenInterfaceAVKit::setupFullscreen):
3732         (WebVideoFullscreenInterfaceAVKit::exitFullscreen):
3733         (WebVideoFullscreenInterfaceAVKit::didStopPictureInPicture):
3734
3735 2017-05-04  Chris Dumez  <cdumez@apple.com>
3736
3737         Element.slot should be marked as [Unscopable]
3738         https://bugs.webkit.org/show_bug.cgi?id=171683
3739
3740         Reviewed by Darin Adler.
3741
3742         Element.slot should be marked as [Unscopable]:
3743         - https://dom.spec.whatwg.org/#interface-element
3744         - https://heycam.github.io/webidl/#Unscopable
3745
3746         Test: fast/shadow-dom/Element-slot-unscopable.html
3747
3748         * dom/Element.idl:
3749
3750 2017-05-04  Don Olmstead  <don.olmstead@am.sony.com>
3751
3752         [Win] Remove redundant macros that are set in the CMake config
3753         https://bugs.webkit.org/show_bug.cgi?id=171571
3754
3755         Reviewed by Brent Fulgham.
3756
3757         No new tests. No change in behavior.
3758
3759         * WebCorePrefix.h:
3760         * config.h:
3761         * platform/win/COMPtr.h:
3762         * platform/win/WindowsTouch.h:
3763         * testing/js/WebCoreTestSupportPrefix.h:
3764
3765 2017-05-04  Tim Horton  <timothy_horton@apple.com>
3766
3767         [Mac] Modernize image for dragged link
3768         https://bugs.webkit.org/show_bug.cgi?id=171701
3769         <rdar://problem/31978818>
3770
3771         Reviewed by Simon Fraser.
3772
3773         * WebCore.xcodeproj/project.pbxproj:
3774         * page/mac/DragControllerMac.mm:
3775         * platform/mac/DragImageMac.mm:
3776         (WebCore::dragImageSize):
3777         (WebCore::scaleDragImage):
3778         (WebCore::dissolveDragImageToFraction):
3779         (WebCore::createDragImageFromImage):
3780         (WebCore::LinkImageLayout::LinkImageLayout):
3781         (WebCore::LinkImageLayout::layOutText):
3782         (WebCore::LinkImageLayout::addLine):
3783         (WebCore::createDragImageForLink):
3784         (WebCore::fontFromNSFont): Deleted.
3785         (WebCore::canUseFastRenderer): Deleted.
3786         (WebCore::widthWithFont): Deleted.
3787         (WebCore::drawAtPoint): Deleted.
3788         (WebCore::drawDoubledAtPoint): Deleted.
3789         * platform/spi/cocoa/LinkPresentationSPI.h: Added.
3790         Improve the design of URL drag images.
3791         The margins are increased, the background is now white, the text is
3792         not drawn doubled-up, the title will now wrap to two lines, and the
3793         domain name will appear simplified and de-punycoded.
3794
3795         Much of the implementation of text painting is borrowed from
3796         <attachment> for now, but we should figure out how to generalize
3797         it for UI-like parts of WebKit in the future.
3798
3799 2017-05-04  Commit Queue  <commit-queue@webkit.org>
3800
3801         Unreviewed, rolling out r216223.
3802         https://bugs.webkit.org/show_bug.cgi?id=171706
3803
3804         not quite ready (Requested by thorton on #webkit).
3805
3806         Reverted changeset:
3807
3808         "[Mac] Modernize image for dragged link"
3809         https://bugs.webkit.org/show_bug.cgi?id=171701
3810         http://trac.webkit.org/changeset/216223
3811
3812 2017-05-04  Tim Horton  <timothy_horton@apple.com>
3813
3814         [Mac] Modernize image for dragged link
3815         https://bugs.webkit.org/show_bug.cgi?id=171701
3816         <rdar://problem/31978818>
3817
3818         Reviewed by Simon Fraser.
3819
3820         * page/mac/DragControllerMac.mm:
3821         * platform/mac/DragImageMac.mm:
3822         (WebCore::dragImageSize):
3823         (WebCore::scaleDragImage):
3824         (WebCore::dissolveDragImageToFraction):
3825         (WebCore::createDragImageFromImage):
3826         (WebCore::LinkImageLayout::LinkImageLayout):
3827         (WebCore::LinkImageLayout::addLine):
3828         (WebCore::createDragImageForLink):
3829         (WebCore::fontFromNSFont): Deleted.
3830         (WebCore::canUseFastRenderer): Deleted.
3831         (WebCore::widthWithFont): Deleted.
3832         (WebCore::drawAtPoint): Deleted.
3833         (WebCore::drawDoubledAtPoint): Deleted.
3834         Improve the design of URL drag images.
3835         The margins are increased, the background is now white, the text is
3836         not drawn doubled-up, the title will now wrap to two lines, and the
3837         domain name will appear simplified and de-punycoded.
3838
3839         Much of the implementation of text painting is borrowed from
3840         <attachment> for now, but we should figure out how to generalize
3841         it for UI-like parts of WebKit in the future.
3842
3843 2017-05-04  Jeremy Jones  <jeremyj@apple.com>
3844
3845         Use if instead of return early for 13 places in WebAVPlayerController
3846         https://bugs.webkit.org/show_bug.cgi?id=171692
3847
3848         Reviewed by Jer Noble.
3849
3850         No new tests because no behavior change.
3851
3852         * platform/ios/WebAVPlayerController.mm:
3853         (-[WebAVPlayerController play:]):
3854         (-[WebAVPlayerController pause:]):
3855         (-[WebAVPlayerController togglePlayback:]):
3856         (-[WebAVPlayerController beginScrubbing:]):
3857         (-[WebAVPlayerController endScrubbing:]):
3858         (-[WebAVPlayerController seekToTime:]):
3859         (-[WebAVPlayerController beginScanningForward:]):
3860         (-[WebAVPlayerController endScanningForward:]):
3861         (-[WebAVPlayerController beginScanningBackward:]):
3862         (-[WebAVPlayerController endScanningBackward:]):
3863         (-[WebAVPlayerController seekToBeginning:]):
3864         (-[WebAVPlayerController seekToEnd:]):
3865         (-[WebAVPlayerController toggleMuted:]):
3866
3867 2017-05-04  Filip Pizlo  <fpizlo@apple.com>
3868
3869         JSC::Heap should expose a richer API for requesting GCs
3870         https://bugs.webkit.org/show_bug.cgi?id=171690
3871
3872         Reviewed by Geoffrey Garen.
3873
3874         No new tests because this is just a refactoring.
3875         
3876         Change some function calls now that some JSC::Heap APIs got renamed.
3877
3878         * bindings/js/GCController.cpp:
3879         (WebCore::collect):
3880         (WebCore::GCController::garbageCollectNow):
3881         (WebCore::GCController::garbageCollectNowIfNotDoneRecently):
3882
3883 2017-05-04  Mark Lam  <mark.lam@apple.com>
3884
3885         NeverDestroyed<String>(ASCIILiteral(...)) is not thread safe.
3886         https://bugs.webkit.org/show_bug.cgi?id=171586
3887         <rdar://problem/31873190>
3888
3889         Reviewed by Yusuke Suzuki.
3890
3891         No new tests because we're just converting uses of ASCIILiteral (in the
3892         instantiation of NeverDestroyed<String> and NeverDestroyed<const String>) to
3893         MAKE_STATIC_STRING_IMPL.
3894
3895         The correctness of using MAKE_STATIC_STRING_IMPL is tested in the newly added
3896         API test in this patch.
3897
3898         Also changed "static NeverDestroyed<ASCIILiteral>" instances in
3899         SQLiteIDBBackingStore.cpp to "static const char* const" because they are only
3900         ever used to get the underlying const char*.
3901
3902         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
3903         (WebCore::IDBServer::SQLiteIDBBackingStore::getRecord):
3904         (WebCore::IDBServer::SQLiteIDBBackingStore::cachedStatementForGetAllObjectStoreRecords):
3905         * Modules/mediastream/MediaEndpointSessionDescription.cpp:
3906         * Modules/mediastream/RTCRtpTransceiver.cpp:
3907         * Modules/mediastream/SDPProcessor.cpp:
3908         * Modules/navigatorcontentutils/NavigatorContentUtils.cpp:
3909         (WebCore::customHandlersStateString):
3910         (WebCore::NavigatorContentUtils::isProtocolHandlerRegistered):
3911         * Modules/speech/SpeechSynthesis.cpp:
3912         (WebCore::SpeechSynthesis::boundaryEventOccurred):
3913         * accessibility/AccessibilityMediaControls.cpp:
3914         (WebCore::AccessibilityMediaControl::controlTypeName):
3915         (WebCore::AccessibilityMediaControl::title):
3916         (WebCore::AccessibilityMediaControlsContainer::elementTypeName):
3917         (WebCore::AccessibilityMediaTimeline::helpText):
3918         (WebCore::AccessibilityMediaTimeDisplay::accessibilityDescription):
3919         * bindings/js/JSLazyEventListener.cpp:
3920         (WebCore::eventParameterName):
3921         * contentextensions/ContentExtensionsBackend.cpp:
3922         (WebCore::ContentExtensions::ContentExtensionsBackend::displayNoneCSSRule):
3923         * css/CSSDefaultStyleSheets.cpp:
3924         (WebCore::screenEval):
3925         (WebCore::printEval):
3926         * css/MediaList.cpp:
3927         (WebCore::addResolutionWarningMessageToConsole):
3928         * css/StyleSheetContents.cpp:
3929         (WebCore::StyleSheetContents::parseAuthorStyleSheet):
3930         * dom/Document.cpp:
3931         (WebCore::Document::readyState):
3932         * dom/LoadableClassicScript.cpp:
3933         (WebCore::LoadableClassicScript::notifyFinished):
3934         * dom/PseudoElement.cpp:
3935         (WebCore::PseudoElement::pseudoElementNameForEvents):
3936         * editing/MarkupAccumulator.cpp:
3937         (WebCore::MarkupAccumulator::shouldAddNamespaceElement):
3938         * editing/cocoa/DataDetection.mm:
3939         (WebCore::DataDetection::dataDetectorURLProtocol):
3940         * editing/markup.cpp:
3941         (WebCore::StyledMarkupAccumulator::styleNodeCloseTag):
3942         (WebCore::createMarkupInternal):
3943         * html/FormController.cpp:
3944         (WebCore::formStateSignature):
3945         * html/ImageInputType.cpp:
3946         (WebCore::ImageInputType::appendFormData):
3947         * html/canvas/CanvasRenderingContext2D.cpp:
3948         (WebCore::CanvasRenderingContext2D::realizeSaves):
3949         (WebCore::CanvasRenderingContext2D::getImageData):
3950         * html/parser/XSSAuditor.cpp:
3951         (WebCore::XSSAuditor::init):
3952         (WebCore::XSSAuditor::eraseDangerousAttributesIfInjected):
3953         * html/track/VTTCue.cpp:
3954         (WebCore::startKeyword):
3955         (WebCore::middleKeyword):
3956         (WebCore::endKeyword):
3957         (WebCore::leftKeyword):
3958         (WebCore::rightKeyword):
3959         (WebCore::verticalGrowingLeftKeyword):
3960         (WebCore::verticalGrowingRightKeyword):
3961         (WebCore::VTTCue::determineTextDirection):
3962         (WebCore::VTTCue::markFutureAndPastNodes):
3963         * inspector/InspectorCSSAgent.cpp:
3964         (WebCore::computePseudoClassMask):
3965         * inspector/InspectorIndexedDBAgent.cpp:
3966         * inspector/InspectorPageAgent.cpp:
3967         (WebCore::InspectorPageAgent::sourceMapURLForResource):
3968         * inspector/PageDebuggerAgent.cpp:
3969         (WebCore::PageDebuggerAgent::sourceMapURLForScript):
3970         * loader/ImageLoader.cpp:
3971         (WebCore::ImageLoader::notifyFinished):
3972         * loader/TextTrackLoader.cpp:
3973         (WebCore::TextTrackLoader::corsPolicyPreventedLoad):
3974         * loader/icon/IconDatabase.cpp:
3975         (WebCore::IconDatabase::defaultDatabaseFilename):
3976         * page/CaptionUserPreferencesMediaAF.cpp:
3977         (WebCore::CaptionUserPreferencesMediaAF::captionsTextEdgeCSS):
3978         * page/SecurityOrigin.cpp:
3979         (WebCore::SecurityOrigin::urlWithUniqueSecurityOrigin):
3980         * page/UserContentURLPattern.cpp:
3981         (WebCore::UserContentURLPattern::parse):
3982         * platform/MIMETypeRegistry.cpp:
3983         (WebCore::defaultMIMEType):
3984         * platform/animation/Animation.cpp:
3985         (WebCore::Animation::initialName):
3986         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
3987         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::engineDescription):
3988         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
3989         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::engineDescription):
3990         * platform/graphics/cocoa/FontCacheCoreText.cpp:
3991         (WebCore::FontCache::similarFont):
3992         * platform/gtk/UserAgentGtk.cpp:
3993         (WebCore::platformVersionForUAString):
3994         * platform/mock/mediasource/MockBox.cpp:
3995         (WebCore::MockTrackBox::type):
3996         (WebCore::MockInitializationBox::type):
3997         (WebCore::MockSampleBox::type):
3998         * platform/network/HTTPHeaderValues.cpp:
3999         (WebCore::HTTPHeaderValues::textPlainContentType):
4000         (WebCore::HTTPHeaderValues::formURLEncodedContentType):
4001         (WebCore::HTTPHeaderValues::noCache):
4002         (WebCore::HTTPHeaderValues::maxAge0):
4003         * platform/network/HTTPParsers.cpp:
4004         (WebCore::parseXSSProtectionHeader):
4005         * replay/MemoizedDOMResult.cpp:
4006         (JSC::InputTraits<MemoizedDOMResultBase>::type):
4007         * svg/SVGTransformValue.cpp:
4008         (WebCore::SVGTransformValue::transformTypePrefixForParsing):
4009
4010 2017-05-04  Jeremy Jones  <jeremyj@apple.com>
4011
4012         Add muted to WebPlaybackSessionModel.
4013         https://bugs.webkit.org/show_bug.cgi?id=171592
4014         rdar://problem/31814074
4015
4016         Reviewed by Jer Noble.
4017
4018         No behavior change. This just adds the ability for UI to mute.
4019
4020         * platform/cocoa/WebPlaybackSessionModel.h:
4021         (WebCore::WebPlaybackSessionModelClient::mutedChanged):
4022         * platform/cocoa/WebPlaybackSessionModelMediaElement.h:
4023         * platform/cocoa/WebPlaybackSessionModelMediaElement.mm:
4024         (WebCore::WebPlaybackSessionModelMediaElement::updateForEventName):
4025         (WebCore::WebPlaybackSessionModelMediaElement::toggleMuted):
4026         (WebCore::WebPlaybackSessionModelMediaElement::observedEventNames):
4027         (WebCore::WebPlaybackSessionModelMediaElement::isMuted):
4028         * platform/ios/WebAVPlayerController.h:
4029         * platform/ios/WebAVPlayerController.mm:
4030         (-[WebAVPlayerController toggleMuted:]):
4031         * platform/ios/WebPlaybackSessionInterfaceAVKit.h:
4032         * platform/ios/WebPlaybackSessionInterfaceAVKit.mm:
4033         (WebCore::WebPlaybackSessionInterfaceAVKit::mutedChanged):
4034         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
4035         (WebVideoFullscreenControllerContext::mutedChanged):
4036         (WebVideoFullscreenControllerContext::isMuted):
4037         (WebVideoFullscreenControllerContext::toggleMuted):
4038         * platform/spi/ios/MediaPlayerSPI.h:
4039
4040 2017-05-04  Joseph Pecoraro  <pecoraro@apple.com>
4041