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