Local audio-only stream will not trigger playback to begin
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-02-20  Jer Noble  <jer.noble@apple.com>
2
3         Local audio-only stream will not trigger playback to begin
4         https://bugs.webkit.org/show_bug.cgi?id=168412
5
6         Reviewed by Youenn Fablet.
7
8         Test: fast/mediastream/local-audio-playing-event.html
9
10         With video-bearing streams, the first video sample emitted from the stream causes the
11         readyState to move from HAVE_NOTHING to HAVE_ENOUGH_DATA. Wire up this same behavior for
12         audio-bearing streams. Add a MediaStreamTrackPrivate::Observer callback method
13         audioSamplesAvailable(), which gets passed up to MediaPlayerPrivateMediaStreamAVFObjC.
14         Because this callback may be (and probably will be) called on a background thread, run the
15         updateReadyState() task in a scheduledDeferredTask().
16
17         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
18         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
19         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::audioSamplesAvailable):
20         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateTracks):
21         * platform/mediastream/MediaStreamTrackPrivate.cpp:
22         (WebCore::MediaStreamTrackPrivate::audioSamplesAvailable):
23         * platform/mediastream/MediaStreamTrackPrivate.h:
24         (WebCore::MediaStreamTrackPrivate::Observer::audioSamplesAvailable):
25
26 2017-02-20  Zalan Bujtas  <zalan@apple.com>
27
28         Simple line layout: Implement absoluteQuadsForRange.
29         https://bugs.webkit.org/show_bug.cgi?id=168613
30         <rdar://problem/30614618>
31
32         Reviewed by Simon Fraser.
33
34         This patch ensures that the commonly used Range::getClientRects calls do not
35         throw us off of the simple line layout path.
36
37         Test: fast/dom/Range/simple-line-layout-getclientrects.html
38
39         * rendering/RenderText.cpp:
40         (WebCore::RenderText::absoluteQuadsForRange):
41         * rendering/SimpleLineLayoutFunctions.cpp:
42         (WebCore::SimpleLineLayout::collectAbsoluteQuadsForRange): Special case empty ranges with multiple empty runs.
43         * rendering/SimpleLineLayoutFunctions.h:
44         * rendering/SimpleLineLayoutResolver.cpp:
45         (WebCore::SimpleLineLayout::RunResolver::rangeForRendererWithOffsets):
46         * rendering/SimpleLineLayoutResolver.h:
47
48 2017-02-20  Ryan Haddad  <ryanhaddad@apple.com>
49
50         Unreviewed, rolling out r212685.
51
52         This change broke the 32-bit Sierra build.
53
54         Reverted changeset:
55
56         "Resource Load Statistics: Add alternate classification
57         method"
58         https://bugs.webkit.org/show_bug.cgi?id=168347
59         http://trac.webkit.org/changeset/212685
60
61 2017-02-20  Sam Weinig  <sam@webkit.org>
62
63         [WebIDL] Add support for constructors that have variadic parameters
64         https://bugs.webkit.org/show_bug.cgi?id=168614
65
66         Reviewed by Alex Christensen.
67
68         In preparation of removing some more custom bindings, move the constructor calling
69         code over to using GenerateParametersCheck completely. This required
70         - Removing special case of NamedConstructors automatically getting a Document passed
71           to them. The three named constructors that expected this have been updated to add
72           the required attributes.
73         - Add a version of the GenerateCallWith prologue for constructors.
74         - Remove now unnecessary argumentCount return value from GenerateParametersCheck.
75
76         * bindings/scripts/CodeGeneratorJS.pm:
77         (GenerateImplementation):
78         (GenerateCallWithUsingReferences):
79         (GenerateCallWithUsingPointers):
80         (GenerateConstructorCallWithUsingPointers):
81         (GenerateCallWith):
82         (GenerateParametersCheck):
83         (GenerateConstructorDefinition):
84
85         * bindings/scripts/test/JS/JSTestInterface.cpp:
86         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
87         * bindings/scripts/test/JS/JSTestObj.cpp:
88         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
89         Update results for more consistent placement of ScriptExecutionContext and Document
90         accessors, add UNLIKELY to context checks, and remove automatic Document passing
91         for NamedConstructors.
92
93         * html/HTMLAudioElement.idl:
94         * html/HTMLImageElement.idl:
95         * html/HTMLOptionElement.idl:
96         Add ConstructorCallWith=Document.
97
98 2017-02-20  John Wilander  <wilander@apple.com>
99
100         Resource Load Statistics: Add alternate classification method
101         https://bugs.webkit.org/show_bug.cgi?id=168347
102         <rdar://problem/30352793>
103
104         Reviewed by Alex Christensen.
105
106         This patch only adds test infrastructure in WebCore.
107
108         Tests: http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-mixed-statistics.html
109                http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-sub-frame-under-top-frame-origins.html
110                http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-under-top-frame-origins.html
111                http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-unique-redirects-to.html
112                http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-mixed-statistics.html
113                http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-sub-frame-under-top-frame-origins.html
114                http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-under-top-frame-origins.html
115                http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-unique-redirects-to.html
116
117         * loader/ResourceLoadObserver.cpp:
118         (WebCore::ResourceLoadObserver::setSubframeUnderTopFrameOrigin):
119         (WebCore::ResourceLoadObserver::setSubresourceUnderTopFrameOrigin):
120         (WebCore::ResourceLoadObserver::setSubresourceUniqueRedirectTo):
121         * loader/ResourceLoadObserver.h:
122
123 2017-02-20  Anders Carlsson  <andersca@apple.com>
124
125         Use the new drag code path when dragging links
126         https://bugs.webkit.org/show_bug.cgi?id=168612
127
128         Reviewed by Tim Horton.
129
130         * editing/Editor.cpp:
131         (WebCore::Editor::copyURL):
132         Use userVisibleString instead of fillInUserVisibleForm.
133
134         (WebCore::Editor::pasteboardWriterURL):
135         New function that returns a PasteboardWriterData::URL for a given URL + title.
136
137         * editing/Editor.h:
138         Add new members.
139
140         * editing/mac/EditorMac.mm:
141         (WebCore::Editor::userVisibleString):
142         (WebCore::Editor::fillInUserVisibleForm): Deleted.
143         Add a getter instead of a function that fills in a struct member.
144
145         * page/DragController.cpp:
146         (WebCore::DragController::startDrag):
147         Add the new DragItem code path when dragging links.
148
149         * platform/PasteboardWriterData.cpp:
150         (WebCore::PasteboardWriterData::isEmpty):
151         Check for m_url as well.
152
153         (WebCore::PasteboardWriterData::setURL):
154         Set m_url.
155
156         * platform/PasteboardWriterData.h:
157         Add new members.
158
159         * platform/mac/PasteboardWriter.mm:
160         (WebCore::toUTI):
161         New helper function that returns an UTI from a pasteboard type.
162
163         (WebCore::createPasteboardWriter):
164         Handle converting URLs to the various pasteboard types.
165
166 2017-02-20  Wenson Hsieh  <wenson_hsieh@apple.com>
167
168         Add plumbing to the UI process for TextIndicatorData when computing the drag image
169         https://bugs.webkit.org/show_bug.cgi?id=168583
170         Work towards <rdar://problem/30313681>
171
172         Reviewed by Tim Horton.
173
174         Adds some additional arguments to drag image creation functions to allow platforms to specify TextIndicatorData
175         for a link or selection-based DragImage. This TextIndicatorData is an optional member of the DragImage, and is
176         propagated to the UI process via SetDragImage in the WebDragClient.
177
178         Additionally renames hasDataInteractionAtPosition to hasSelectionAtPosition to better reflect its purpose.
179
180         No new tests, since there is no behavior change.
181
182         * page/DragController.cpp:
183         (WebCore::DragController::startDrag):
184         * page/Page.cpp:
185         (WebCore::Page::hasSelectionAtPosition):
186         (WebCore::Page::hasDataInteractionAtPosition): Deleted.
187         * page/Page.h:
188         * platform/DragImage.cpp:
189         (WebCore::createDragImageForSelection):
190         (WebCore::createDragImageForLink):
191         (WebCore::DragImage::operator=):
192         * platform/DragImage.h:
193         * platform/gtk/DragImageGtk.cpp:
194         (WebCore::createDragImageForLink):
195         * platform/mac/DragImageMac.mm:
196         (WebCore::createDragImageForLink):
197         * platform/win/DragImageWin.cpp:
198         (WebCore::createDragImageForLink):
199
200 2017-02-20  Brent Fulgham  <bfulgham@apple.com>
201
202         Nullptr dereferences when stopping a load
203         https://bugs.webkit.org/show_bug.cgi?id=168608
204         <rdar://problem/29852056>
205
206         Reviewed by Ryosuke Niwa.
207
208         Don't attempt to notify a detached frame's load client that the load is
209         stopped.
210
211         * loader/DocumentLoader.cpp:
212         (WebCore::DocumentLoader::stopLoading): Check for null frame loader and
213         bypass dereferencing it. 
214
215 2017-02-17  Anders Carlsson  <andersca@apple.com>
216
217         Add a new drag code path and use it for dragging plain text
218         https://bugs.webkit.org/show_bug.cgi?id=168534
219
220         Reviewed by Geoffrey Garen.
221
222         The new code path is currently only used for plain text selection dragging.
223
224         * WebCore.xcodeproj/project.pbxproj:
225         * page/DragClient.h:
226         (WebCore::DragClient::useLegacyDragClient):
227         Add a new member function. This currently returns true everywhere except legacy WebKit on Mac.
228
229         (WebCore::DragClient::beginDrag):
230         Add new empty member function.
231
232         * page/DragController.cpp:
233         (WebCore::dragImageAnchorPointForSelectionDrag):
234         Helper function that returns the anchor point for a selection drag image.
235
236         (WebCore::DragController::startDrag):
237         If we can use the new code path, set up a drag item with an image and pasteboard data.
238
239         (WebCore::DragController::beginDrag):
240         New function that calls out to the client.
241
242         * page/DragController.h:
243         Add new members.
244
245         * platform/DragItem.h:
246         Add a new class - it's essentially a tuple of a drag image, an anchor point and the pasteboard data the item represents.
247
248         * platform/mac/PasteboardWriter.h:
249         Rename createPasteboardWriting to createPasteboardWriter.
250
251         * platform/mac/PasteboardWriter.mm:
252         (WebCore::createPasteboardWriter):
253         Use the UTI pasteboard type.
254
255 2017-02-20  Alex Christensen  <achristensen@webkit.org>
256
257         Fix libwebrtc build after r212644.
258         https://bugs.webkit.org/show_bug.cgi?id=168596
259
260         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
261         (WebCore::LibWebRTCMediaEndpoint::StatsCollector::OnStatsDelivered):
262         m_endpoint changed from a c++ reference to a WTF::Ref, so we need to use operator -> instead of .
263
264 2017-02-20  Romain Bellessort  <romain.bellessort@crf.canon.fr>
265
266         [Readable Streams API] Add ReadableByteStreamController byobRequest attribute
267         https://bugs.webkit.org/show_bug.cgi?id=168319
268
269         Reviewed by Youenn Fablet.
270
271         Added ReadableByteStreamController byobRequest attribute.
272
273         Added tests related to ReadableStreamBYOBRequest as a dedicated object
274         and also as an attribute of ReadableByteStreamController.
275
276         * CMakeLists.txt: Added new files.
277         * DerivedSources.cpp: Added new files.
278         * DerivedSources.make: Added new files.
279         * Modules/streams/ReadableByteStreamController.idl: Added byobRequest support.
280         * Modules/streams/ReadableByteStreamController.js: Added byobRequest support.
281         * Modules/streams/ReadableByteStreamInternals.js:
282         (privateInitializeReadableStreamBYOBRequest): Added constructor.
283         * Modules/streams/ReadableStreamBYOBRequest.idl: Added.
284         * Modules/streams/ReadableStreamBYOBRequest.js: Added.
285         (respond): Not implemented yet.
286         (respondWithNewView): Not implemented yet.
287         (view): Not implemented yet.
288         * WebCore.xcodeproj/project.pbxproj: Added new files.
289         * bindings/js/JSDOMGlobalObject.cpp: Added ReadableStreamBYOBRequest support.
290         (WebCore::JSDOMGlobalObject::addBuiltinGlobals):
291         (WebCore::JSDOMGlobalObject::finishCreation):
292         (WebCore::JSDOMGlobalObject::visitChildren):
293         * bindings/js/JSReadableStreamPrivateConstructors.cpp: Added ReadableStreamBYOBRequest support.
294         (WebCore::constructJSReadableByteStreamController):
295         (WebCore::constructJSReadableStreamBYOBRequest):
296         (WebCore::JSBuiltinReadableStreamBYOBRequestPrivateConstructor::initializeExecutable):
297         (WebCore::createReadableStreamBYOBRequestPrivateConstructor):
298         * bindings/js/JSReadableStreamPrivateConstructors.h: Added ReadableStreamBYOBRequest support.
299         * bindings/js/WebCoreBuiltinNames.h: Added ReadableStreamBYOBRequest support.
300
301 2017-02-20  Per Arne Vollan  <pvollan@apple.com>
302
303         [Win] Custom scale factor is not applied in all cases.
304         https://bugs.webkit.org/show_bug.cgi?id=168117
305
306         Reviewed by Brent Fulgham.
307
308         We should not call the function deviceScaleFactorForWindow directly, since this
309         will return the system scale factor, and ignore the custom scale factor.
310
311         * platform/graphics/ca/win/CACFLayerTreeHost.h:
312         * platform/graphics/ca/win/WKCACFViewLayerTreeHost.cpp:
313         (WebCore::WKCACFViewLayerTreeHost::initializeContext):
314         (WebCore::WKCACFViewLayerTreeHost::resize):
315         (WebCore::WKCACFViewLayerTreeHost::setScaleFactor):
316         * platform/graphics/ca/win/WKCACFViewLayerTreeHost.h:
317         * platform/win/GDIUtilities.h:
318         (WebCore::makeScaledPoint):
319         * platform/win/PlatformMouseEventWin.cpp:
320         (WebCore::positionForEvent):
321         * platform/win/PopupMenuWin.cpp:
322         (WebCore::PopupMenuWin::show):
323         (WebCore::PopupMenuWin::wndProc):
324         * platform/win/PopupMenuWin.h:
325
326 2017-02-20  Jon Lee  <jonlee@apple.com>
327
328         Fix build error for iOS. Unreviewed.
329
330         * platform/graphics/GraphicsContext3D.cpp: Move stub function into !PLATFORM(COCOA) instead of !PLATFORM(MAC).
331
332 2017-02-20  Jon Lee  <jonlee@apple.com>
333
334         Unreviewed, rolling out r212639.
335
336         Have a fix for the linker error on iOS.
337
338         Reverted changeset:
339
340         "Unreviewed, rolling out r212637."
341         https://bugs.webkit.org/show_bug.cgi?id=168595
342         http://trac.webkit.org/changeset/212639
343
344 2017-02-20  Youenn Fablet  <youenn@apple.com>
345
346         [WebRTC] Fix some memory leaks in libwebrtc binding code
347         https://bugs.webkit.org/show_bug.cgi?id=168596
348
349         Reviewed by Eric Carlson.
350
351         Covered by manual testing.
352
353         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
354         (WebCore::LibWebRTCMediaEndpoint::StatsCollector::StatsCollector): Using the libwebrtc way of creating such objects.
355         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
356         (WebCore::LibWebRTCMediaEndpoint::StatsCollector::create):
357         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
358         (WebCore::PeerConnectionFactoryAndThreads::OnMessage):
359
360 2017-02-20  Alexey Proskuryakov  <ap@apple.com>
361
362         Clean up how WebKit exports _WebCreateFragment
363         https://bugs.webkit.org/show_bug.cgi?id=168579
364
365         Reviewed by Dan Bernstein.
366
367         * editing/Editor.h: Removed the declaration of _WebCreateFragment, SOFT_LINK doesn't need it.
368         * editing/cocoa/EditorCocoa.mm: Moved a FIXME comment here.
369
370 2017-02-20  Ryan Haddad  <ryanhaddad@apple.com>
371
372         Unreviewed, rolling out r212637.
373
374         This change broke iOS builds.
375
376         Reverted changeset:
377
378         "Add 'webglcontextchanged' WebGLContextEvent"
379         https://bugs.webkit.org/show_bug.cgi?id=168595
380         http://trac.webkit.org/changeset/212637
381
382 2017-02-20  Carlos Garcia Campos  <cgarcia@igalia.com>
383
384         Remove code under USE(GRAPHICS_SURFACE)
385         https://bugs.webkit.org/show_bug.cgi?id=168592
386
387         Reviewed by Michael Catanzaro.
388
389         This was only used by EFL port.
390
391         * platform/TextureMapper.cmake:
392         * platform/graphics/opengl/GLPlatformSurface.cpp: Removed.
393         * platform/graphics/surfaces/GLTransportSurface.cpp: Removed.
394         * platform/graphics/surfaces/GLTransportSurface.h: Removed.
395         * platform/graphics/surfaces/GraphicsSurface.cpp: Removed.
396         * platform/graphics/surfaces/GraphicsSurface.h: Removed.
397         * platform/graphics/surfaces/GraphicsSurfaceToken.h: Removed.
398         * platform/graphics/surfaces/egl/EGLConfigSelector.cpp: Removed.
399         * platform/graphics/surfaces/egl/EGLConfigSelector.h: Removed.
400         * platform/graphics/surfaces/egl/EGLContext.cpp: Removed.
401         * platform/graphics/surfaces/egl/EGLContext.h: Removed.
402         * platform/graphics/surfaces/egl/EGLHelper.cpp: Removed.
403         * platform/graphics/surfaces/egl/EGLHelper.h: Removed.
404         * platform/graphics/surfaces/egl/EGLSurface.cpp: Removed.
405         * platform/graphics/surfaces/egl/EGLSurface.h: Removed.
406         * platform/graphics/surfaces/egl/EGLXSurface.cpp: Removed.
407         * platform/graphics/surfaces/egl/EGLXSurface.h: Removed.
408         * platform/graphics/surfaces/glx/GLXConfigSelector.h: Removed.
409         * platform/graphics/surfaces/glx/GLXContext.cpp: Removed.
410         * platform/graphics/surfaces/glx/GLXContext.h: Removed.
411         * platform/graphics/surfaces/glx/GLXSurface.cpp: Removed.
412         * platform/graphics/surfaces/glx/GLXSurface.h: Removed.
413         * platform/graphics/surfaces/glx/X11Helper.cpp: Removed.
414         * platform/graphics/surfaces/glx/X11Helper.h: Removed.
415         * platform/graphics/texmap/TextureMapperBackingStore.cpp:
416         * platform/graphics/texmap/TextureMapperBackingStore.h:
417         * platform/graphics/texmap/TextureMapperPlatformLayer.h:
418         (WebCore::TextureMapperPlatformLayer::setClient):
419         * platform/graphics/texmap/TextureMapperSurfaceBackingStore.cpp: Removed.
420         * platform/graphics/texmap/TextureMapperSurfaceBackingStore.h: Removed.
421         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
422         (WebCore::CoordinatedGraphicsLayer::CoordinatedGraphicsLayer):
423         (WebCore::CoordinatedGraphicsLayer::setContentsNeedsDisplay):
424         (WebCore::CoordinatedGraphicsLayer::setContentsToPlatformLayer):
425         (WebCore::CoordinatedGraphicsLayer::syncPlatformLayer):
426         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
427         * platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
428         (WebCore::CoordinatedGraphicsLayerState::CoordinatedGraphicsLayerState):
429
430 2017-02-20  Dean Jackson  <dino@apple.com>
431
432         Add 'webglcontextchanged' WebGLContextEvent
433         https://bugs.webkit.org/show_bug.cgi?id=168595
434         <rdar://problem/30604254>
435
436         Reviewed by Antoine Quint.
437
438         Add a new event that is dispatched when the GraphicsContext3D
439         notices that the active GPU has changed.
440
441         Test: fast/canvas/webgl/webglcontextchangedevent.html
442
443         * dom/EventNames.h: Add 'webglcontextchanged'.
444         * html/canvas/WebGLRenderingContextBase.cpp:
445         (WebCore::WebGLRenderingContextBase::dispatchContextChangedEvent): Dispatch the new event.
446         (WebCore::WebGLRenderingContextBase::simulateContextChanged): Tell the GraphicsContext3D to
447         pretend there was a GPU switch. This is called from Internals for testing.
448         * html/canvas/WebGLRenderingContextBase.h:
449         * html/canvas/WebGLRenderingContextBase.idl: Export the interface so Internals can see it.
450
451         * platform/graphics/GraphicsContext3D.cpp:
452         (WebCore::GraphicsContext3D::simulateContextChanged): Tell the GraphicsContext3DManager
453         that it should pretend a GPU change has happened, which causes it to notify all the
454         active contexts.
455         * platform/graphics/GraphicsContext3D.h:
456
457         * platform/graphics/mac/GraphicsContext3DMac.mm:
458         (WebCore::GraphicsContext3DManager::updateAllContexts): Tell the GraphicsContext3Ds
459         to tell their WebGLRenderingContexts to dispatch an event.
460         (WebCore::GraphicsContext3D::simulateContextChanged): Fake the display change.
461         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
462         (WebCore::GraphicsContext3D::dispatchContextChangedNotification): Tell the WebGLRenderingContext
463         that a change has occurred, and that it should dispatch an event. This is a layering
464         violation which will need to be fixed (although with other communication from GC3D back
465         to WebGL).
466         * testing/Internals.cpp:
467         (WebCore::Internals::simulateWebGLContextChanged):
468         * testing/Internals.h:
469         * testing/Internals.idl:
470
471 2017-02-19  Dean Jackson  <dino@apple.com>
472
473         Activate/deactivate high performance GPU when requested
474         https://bugs.webkit.org/show_bug.cgi?id=168559
475         <rdar://problem/30592266>
476
477         Reviewed by Jon Lee.
478
479         Respect the high-performance powerPreference for WebGL, by managing an
480         object that enables the high-performance GPU. If a WebGL context wants
481         high-performance, and it is visible, then a manager class in GraphicsContext3D
482         creates and retains the object, causing all the WebGL contexts to move GPUs.
483         If all the high-performance contexts are not visible, such as in a background tab,
484         then the manager will release the object, allowing the GPU to power down.
485
486         The swapping back from the high-performance GPU happens on a timer, to make
487         sure we don't churn between GPUs if the user is swapping between a lot of tabs,
488         or windows.
489
490         Unfortunately testing this change properly requires hardware with
491         multiple GPUs. I plan to write an API test that fakes most of the
492         system interaction, such as occluding the page. An API test might
493         also be able to verify if the system has more than one GPU. Otherwise
494         I'll have to plumb everything through Internals.
495
496         * html/canvas/WebGLRenderingContextBase.cpp:
497         (WebCore::isHighPerformanceContext): Helper to detect if the GraphicsContext3D actually
498         used high-performance mode.
499         (WebCore::WebGLRenderingContextBase::create): Add logging if we are
500         actually overriding a high-performance request.
501         (WebCore::WebGLRenderingContextBase::WebGLRenderingContextBase): If we are high-performance,
502         then register for activity state changes.
503         (WebCore::WebGLRenderingContextBase::addActivityStateChangeObserverIfNecessary):
504         (WebCore::WebGLRenderingContextBase::removeActivityStateChangeObserver):
505         (WebCore::WebGLRenderingContextBase::destroyGraphicsContext3D): Call removeActivityStateChangeObserver
506         as the GC3D is destroyed.
507         (WebCore::WebGLRenderingContextBase::maybeRestoreContext): If the context was
508         restored successfully, and came back in high-performance, then we need
509         to listen for activity state changes as usual.
510         (WebCore::WebGLRenderingContextBase::activityStateDidChange): If we changed visibility,
511         tell the GC3D.
512         * html/canvas/WebGLRenderingContextBase.h: Class inherits ActivityStateChangeObserver.
513
514         * page/Settings.in: No longer force low-power everywhere.
515
516         * platform/graphics/GraphicsContext3D.cpp:
517         (WebCore::GraphicsContext3D::setContextVisibility): Empty implementation for non-Mac.
518         * platform/graphics/GraphicsContext3D.h:
519         (WebCore::GraphicsContext3D::powerPreferenceUsedForCreation): Tells clients what power preference
520         was actually used during creation (e.g. a single GPU system will use default, even if
521         they requested high-performance).
522
523         * platform/graphics/mac/GraphicsContext3DMac.mm:
524         (WebCore::GraphicsContext3DManager::GraphicsContext3DManager): Helper class to
525         look after all GraphicsContext3Ds.
526         (WebCore::GraphicsContext3DManager::hasTooManyContexts): We have a limit on the
527         number of contexts we can keep alive at any one time.
528         (WebCore::manager): Helper to return the static instance.
529         (WebCore::displayWasReconfigured): Send a message to all the contexts.
530         (WebCore::GraphicsContext3DManager::addContext):
531         (WebCore::GraphicsContext3DManager::removeContext):
532         (WebCore::GraphicsContext3DManager::addContextRequiringHighPerformance):
533         (WebCore::GraphicsContext3DManager::removeContextRequiringHighPerformance):
534         (WebCore::GraphicsContext3DManager::updateHighPerformanceState): Check if the number
535         of contexts requiring high-performance means we need to enable/disable that GPU.
536         (WebCore::GraphicsContext3DManager::disableHighPerformanceGPUTimerFired): Releases our
537         object that keeps the high-performance GPU on.
538         (WebCore::GraphicsContext3DManager::recycleContextIfNecessary): Get rid of the first (oldest)
539         context. This code was in GC3D proper, but it made more sense here in the helper.
540         (WebCore::setPixelFormat): All contexts are created muxable now.
541         (WebCore::GraphicsContext3D::create): Use the manager.
542         (WebCore::GraphicsContext3D::GraphicsContext3D): Ditto.
543         (WebCore::GraphicsContext3D::~GraphicsContext3D): Add logging.
544         (WebCore::GraphicsContext3D::checkGPUStatusIfNecessary): Better logging.
545         (WebCore::GraphicsContext3D::updateCGLContext):
546         (WebCore::GraphicsContext3D::setContextVisibility): This is the responder to the
547         ActivityStateChanges in the WebGLRenderingContext.
548         (WebCore::activeContexts): Deleted.
549         (WebCore::addActiveContext): Deleted.
550         (WebCore::removeActiveContext): Deleted.
551
552 2017-02-20  Manuel Rego Casasnovas  <rego@igalia.com>
553
554         [css-grid] Remove compilation flag ENABLE_CSS_GRID_LAYOUT
555         https://bugs.webkit.org/show_bug.cgi?id=167693
556
557         Reviewed by Sergio Villar Senin.
558
559         * Configurations/FeatureDefines.xcconfig:
560         * css/CSSComputedStyleDeclaration.cpp:
561         (WebCore::valueForGridPosition):
562         (WebCore::isLayoutDependent):
563         (WebCore::resolveJustifySelfAuto):
564         (WebCore::isImplicitlyInheritedGridOrFlexProperty):
565         (WebCore::valueForContentPositionAndDistributionWithOverflowAlignment):
566         (WebCore::ComputedStyleExtractor::propertyValue):
567         * css/CSSGridAutoRepeatValue.cpp:
568         * css/CSSGridAutoRepeatValue.h:
569         * css/CSSGridLineNamesValue.cpp:
570         * css/CSSGridLineNamesValue.h:
571         * css/CSSGridTemplateAreasValue.cpp:
572         * css/CSSGridTemplateAreasValue.h:
573         * css/CSSPrimitiveValueMappings.h:
574         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
575         * css/CSSProperties.json:
576         * css/CSSValue.cpp:
577         (WebCore::CSSValue::equals):
578         (WebCore::CSSValue::cssText):
579         (WebCore::CSSValue::destroy):
580         * css/CSSValue.h:
581         (WebCore::CSSValue::isContentDistributionValue):
582         (WebCore::CSSValue::isGridLineNamesValue):
583         * css/CSSValueKeywords.in:
584         * css/StyleBuilderConverter.h:
585         (WebCore::StyleBuilderConverter::convertGridAutoFlow):
586         (WebCore::StyleBuilderConverter::convertContentAlignmentData):
587         * css/StyleBuilderCustom.h:
588         (WebCore::StyleBuilderCustom::applyValueGridTemplateRows):
589         * css/StyleProperties.cpp:
590         (WebCore::StyleProperties::getPropertyValue):
591         * css/StyleResolver.cpp:
592         (WebCore::equivalentBlockDisplay):
593         * css/StyleResolver.h:
594         * css/parser/CSSParser.cpp:
595         (WebCore::CSSParserContext::CSSParserContext):
596         (WebCore::operator==):
597         * css/parser/CSSParserFastPaths.cpp:
598         (WebCore::isSimpleLengthPropertyID):
599         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
600         (WebCore::CSSParserFastPaths::isKeywordPropertyID):
601         * css/parser/CSSParserMode.h:
602         (WebCore::CSSParserContextHash::hash):
603         * css/parser/CSSPropertyParser.cpp:
604         (WebCore::consumeGridAutoFlow):
605         (WebCore::consumeGridTemplateAreas):
606         (WebCore::CSSPropertyParser::parseSingleValue):
607         (WebCore::CSSPropertyParser::consumeGridShorthand):
608         (WebCore::CSSPropertyParser::parseShorthand):
609         * dom/Document.cpp:
610         * dom/Document.h:
611         * dom/Position.cpp:
612         (WebCore::Position::isCandidate):
613         * page/RuntimeEnabledFeatures.h:
614         (WebCore::RuntimeEnabledFeatures::isCSSGridLayoutEnabled):
615         * rendering/Grid.cpp:
616         * rendering/Grid.h:
617         * rendering/RenderBlock.cpp:
618         (WebCore::RenderBlock::getFirstLetter):
619         * rendering/RenderBox.cpp:
620         (WebCore::RenderBox::~RenderBox):
621         (WebCore::RenderBox::styleDidChange):
622         (WebCore::RenderBox::clearExtraInlineAndBlockOffests):
623         (WebCore::RenderBox::containingBlockLogicalWidthForContent):
624         (WebCore::RenderBox::containingBlockLogicalHeightForContent):
625         (WebCore::RenderBox::perpendicularContainingBlockLogicalHeight):
626         (WebCore::RenderBox::computeLogicalWidthInRegion):
627         (WebCore::RenderBox::sizesLogicalWidthToFitContent):
628         (WebCore::RenderBox::computeLogicalHeight):
629         (WebCore::RenderBox::computePercentageLogicalHeight):
630         (WebCore::RenderBox::containingBlockLogicalWidthForPositioned):
631         (WebCore::RenderBox::containingBlockLogicalHeightForPositioned):
632         (WebCore::RenderBox::computePositionedLogicalWidth):
633         (WebCore::RenderBox::computePositionedLogicalHeight):
634         (WebCore::RenderBox::createsNewFormattingContext):
635         (WebCore::logicalWidthIsResolvable):
636         (WebCore::RenderBox::percentageLogicalHeightIsResolvableFromBlock):
637         (WebCore::RenderBox::hasDefiniteLogicalHeight):
638         * rendering/RenderBox.h:
639         (WebCore::RenderBox::isGridItem):
640         * rendering/RenderElement.cpp:
641         (WebCore::RenderElement::createFor):
642         * rendering/RenderFlexibleBox.cpp:
643         (WebCore::RenderFlexibleBox::alignChildren):
644         * rendering/RenderGrid.cpp:
645         * rendering/RenderGrid.h:
646         * rendering/RenderObject.h:
647         (WebCore::RenderObject::isRenderGrid):
648         * rendering/style/GridArea.h:
649         * rendering/style/GridLength.h:
650         * rendering/style/GridPosition.h:
651         * rendering/style/GridPositionsResolver.cpp:
652         * rendering/style/GridPositionsResolver.h:
653         * rendering/style/GridTrackSize.h:
654         * rendering/style/RenderStyle.cpp:
655         (WebCore::RenderStyle::isCSSGridLayoutEnabled):
656         (WebCore::RenderStyle::changeRequiresLayout):
657         * rendering/style/RenderStyle.h:
658         (WebCore::RenderStyle::gridItemRowEnd):
659         (WebCore::RenderStyle::setGridRowGap):
660         (WebCore::RenderStyle::initialGridItemRowEnd):
661         (WebCore::RenderStyle::isDisplayReplacedType):
662         (WebCore::RenderStyle::isDisplayGridBox):
663         * rendering/style/RenderStyleConstants.h:
664         * rendering/style/StyleGridData.cpp:
665         * rendering/style/StyleGridData.h:
666         * rendering/style/StyleGridItemData.cpp:
667         * rendering/style/StyleGridItemData.h:
668         * rendering/style/StyleRareNonInheritedData.cpp:
669         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
670         (WebCore::StyleRareNonInheritedData::operator==):
671         * rendering/style/StyleRareNonInheritedData.h:
672         * testing/InternalSettings.cpp:
673         (WebCore::InternalSettings::Backup::Backup):
674         (WebCore::InternalSettings::Backup::restoreTo):
675         (WebCore::InternalSettings::setCSSGridLayoutEnabled):
676
677 2017-02-20  Carlos Garcia Campos  <cgarcia@igalia.com>
678
679         REGRESSION(r212345): [GTK] ASSERT(cookieChangeCallbackMap().contains(jar)) failed in WebCore::stopObservingCookieChanges:54
680         https://bugs.webkit.org/show_bug.cgi?id=168375
681
682         Reviewed by Alex Christensen.
683
684         Simplify the way cookie storage is handled in NetworkStorageSessionSoup. Now we always keep a reference to the
685         cookie jar, no matter if we have a session or not, that is always kept in sync with the one actually used by the
686         session. We always connect to the changed signal of the current cookie jar and notify the observer if it has been
687         set.
688
689         * platform/network/NetworkStorageSession.h:
690         * platform/network/soup/CookieStorageSoup.cpp:
691         (WebCore::startObservingCookieChanges): Remove this implementation and add an ASSERT to ensure we don't use this anymore.
692         (WebCore::stopObservingCookieChanges): Ditto.
693         (WebCore::cookieChangeCallbackMap): Deleted.
694         (WebCore::soupCookiesChanged): Deleted.
695         * platform/network/soup/NetworkStorageSessionSoup.cpp:
696         (WebCore::NetworkStorageSession::NetworkStorageSession): Initialize the cookie storage.
697         (WebCore::NetworkStorageSession::~NetworkStorageSession): Disconnect the changed signal.
698         (WebCore::NetworkStorageSession::getOrCreateSoupNetworkSession): Always pass the current cookie storage.
699         (WebCore::NetworkStorageSession::cookiesDidChange): Notify the observer.
700         (WebCore::NetworkStorageSession::cookieStorage): Return the current cookie storage.
701         (WebCore::NetworkStorageSession::setCookieStorage): Update the current cookie storage and update the session if
702         needed too. We always have a valid cookie storage so if nullptr is given we create a new one.
703         (WebCore::NetworkStorageSession::setCookieObserverHandler): Set a cookie observer handler.
704
705 2017-02-19  Chris Dumez  <cdumez@apple.com>
706
707         onbeforeunload event return value coercion is not per-spec
708         https://bugs.webkit.org/show_bug.cgi?id=168382
709
710         Reviewed by Darin Adler.
711
712         Update handling of value returned by onbeforeunload event listeners
713         to match Firefox and the specification:
714         - https://html.spec.whatwg.org/#the-event-handler-processing-algorithm (step 4)
715
716         Namely, the following changes were made:
717         - Only set the event's returnValue attribute to the returned value if the attribute
718           value is the empty string (so as to not override the attribute value if it has
719           explicitly been set by JS).
720         - Cancel the event when the return value is not null by calling preventDefault().
721
722         Additionally, the following changes were made:
723         - Ask the user to confirm the navigation if the event was canceled, not just if the
724           returnValue attribute was set to a non-empty string.
725         as per:
726         - https://html.spec.whatwg.org/#prompt-to-unload-a-document (step 8)
727
728         Tests: fast/events/before-unload-return-string-conversion.html
729                imported/w3c/web-platform-tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-canceling.html
730
731         * bindings/js/JSEventListener.cpp:
732         (WebCore::handleBeforeUnloadEventReturnValue):
733         (WebCore::JSEventListener::handleEvent):
734         * loader/FrameLoader.cpp:
735         (WebCore::shouldAskForNavigationConfirmation):
736         (WebCore::FrameLoader::dispatchBeforeUnloadEvent):
737
738 2017-02-19  Carlos Garcia Campos  <cgarcia@igalia.com>
739
740         [SOUP] Call SoupNetworkSession::setShouldIgnoreTLSErrors when testRunner.setAllowsAnySSLCertificate() is called
741         https://bugs.webkit.org/show_bug.cgi?id=168571
742
743         Reviewed by Michael Catanzaro.
744
745         Fixes: http/tests/ssl/upgrade-origin-usage.html
746
747         * testing/InternalSettings.cpp:
748         (WebCore::InternalSettings::setAllowsAnySSLCertificate):
749
750 2017-02-18  Ryosuke Niwa  <rniwa@webkit.org>
751
752         REGRESSION(r212218): Assertion failures in and after parserRemoveChild
753         https://bugs.webkit.org/show_bug.cgi?id=168458
754
755         Reviewed by Antti Koivisto.
756
757         The bug was caused by parserRemoveChild not preceeding to remove oldChild even when
758         oldChild had been inserted elsewhere during unload evnets of the disconnected frames.
759         Fixed the bug by checking this condition and exiting early.
760
761         Also fixed various callers of parserRemoveChild to not call parserAppendChild when
762         the removed node had already been inserted elsewhere by scripts.
763
764         Tests: fast/parser/adoption-agency-unload-iframe-3.html
765                fast/parser/adoption-agency-unload-iframe-4.html
766                fast/parser/xml-error-unload-iframe.html
767
768         * dom/ContainerNode.cpp:
769         (WebCore::ContainerNode::parserRemoveChild): Exit early when the node had been
770         inserted elsewhere while firing unload events. Also moved the call to
771         notifyRemovePendingSheetIfNeeded outside NoEventDispatchAssertion since it can
772         synchrnously fire a focus event.
773         (WebCore::ContainerNode::parserAppendChild): Moved adoptNode call to inside
774         NoEventDispatchAssertion since adoptNode call here should never mutate DOM.
775         * html/parser/HTMLConstructionSite.cpp:
776         (WebCore::executeReparentTask): Added an early exit when the node had already been
777         inserted elsewhere.
778         (WebCore::executeInsertAlreadyParsedChildTask): Ditto.
779         * xml/XMLErrors.cpp:
780         (WebCore::XMLErrors::insertErrorMessageBlock): Ditto.
781         * xml/parser/XMLDocumentParser.cpp:
782         (WebCore::XMLDocumentParser::end): Fixed a crash unveiled by one of the test cases.
783         Exit early when insertErrorMessageBlock detached the parser (by author scripts).
784         (WebCore::XMLDocumentParser::finish): Keep the parser alive until we exit.
785
786 2017-02-19  Chris Dumez  <cdumez@apple.com>
787
788         <input type=color readonly> doesn't act per spec
789         https://bugs.webkit.org/show_bug.cgi?id=168421
790         <rdar://problem/30593185>
791
792         Reviewed by Ryosuke Niwa.
793
794         The 'readonly' attribute should not apply to <input type=color> as per the
795         HTML specification:
796         - https://html.spec.whatwg.org/#the-input-element:attr-input-readonly-3
797
798         Chrome / Firefox and Edge already behave as per the specification.
799
800         Tests: fast/forms/color/input-color-disabled.html
801                fast/forms/color/input-color-readonly.html
802
803         * html/ColorInputType.cpp:
804         (WebCore::ColorInputType::handleDOMActivateEvent):
805         (WebCore::ColorInputType::didChooseColor):
806
807 2017-02-19  Commit Queue  <commit-queue@webkit.org>
808
809         Unreviewed, rolling out r212466.
810         https://bugs.webkit.org/show_bug.cgi?id=168577
811
812         causes crashes on AArch64 on linux, maybe it's causing crashes
813         on iOS too (Requested by pizlo on #webkit).
814
815         Reverted changeset:
816
817         "The collector thread should only start when the mutator
818         doesn't have heap access"
819         https://bugs.webkit.org/show_bug.cgi?id=167737
820         http://trac.webkit.org/changeset/212466
821
822 2017-02-19  Zalan Bujtas  <zalan@apple.com>
823
824         Simple line layout: Implement positionForPoint.
825         https://bugs.webkit.org/show_bug.cgi?id=168565
826         <rdar://problem/30593370>
827
828         Reviewed by Antti Koivisto.
829
830         With this patch, now we don't need to switch over to line box tree anymore when positionForPoint()
831         is called on a single RenderText content (which is the majority of the simple line content).
832         This patch also adds a new positionForPoint method which returns a Position object instead of VisiblePosition.
833         Some of the positionForPoint() callsites are only interested in the Position object so constructing a VisiblePosition
834         (which could potentially kick off a layout) is a waste. At this point the non-simple line layout codepath still constructs
835         a VisiblePosition and that should be addresses as part of webkit.org/b/168566.
836
837         Covered by existing tests.
838
839         * dom/Document.cpp:
840         (WebCore::Document::caretRangeFromPoint):
841         * rendering/RenderBlockFlow.cpp:
842         (WebCore::RenderBlockFlow::positionForPoint):
843         * rendering/RenderBlockFlow.h:
844         * rendering/RenderObject.cpp:
845         (WebCore::RenderObject::positionForPoint):
846         * rendering/RenderObject.h:
847         * rendering/RenderText.cpp:
848         (WebCore::RenderText::positionForPoint):
849         * rendering/RenderText.h:
850         * rendering/SimpleLineLayoutFunctions.cpp:
851         (WebCore::SimpleLineLayout::positionForPoint):
852         * rendering/SimpleLineLayoutFunctions.h:
853         * rendering/SimpleLineLayoutResolver.cpp:
854         (WebCore::SimpleLineLayout::RunResolver::runForPoint):
855         * rendering/SimpleLineLayoutResolver.h:
856         (WebCore::SimpleLineLayout::RunResolver::Run::logicalLeft):
857         (WebCore::SimpleLineLayout::RunResolver::Run::logicalRight):
858
859 2017-02-19  Antti Koivisto  <antti@apple.com>
860
861         Execute pending scripts asynchronously after stylesheet loads complete
862         https://bugs.webkit.org/show_bug.cgi?id=168367
863         rdar://problem/30561379
864
865         Reviewed by Andreas Kling.
866
867         The current synchronous execution is fragile and creates various problems.
868
869         * css/StyleSheetContents.cpp:
870         (WebCore::StyleSheetContents::checkLoaded):
871         * dom/ContainerNode.cpp:
872         (WebCore::ContainerNode::takeAllChildrenFrom):
873         (WebCore::ContainerNode::notifyChildInserted):
874         (WebCore::ContainerNode::removeChild):
875         (WebCore::ContainerNode::parserRemoveChild):
876         (WebCore::ContainerNode::removeChildren):
877
878             Remove various places where we would trigger delayed synchronous execution.
879
880         * dom/Document.cpp:
881         (WebCore::Document::Document):
882         (WebCore::Document::recalcStyle):
883
884             Trigger scroll to anchor at the end of style resolution instead of when style sheet load completes.
885
886         (WebCore::Document::didRemoveAllPendingStylesheet):
887
888             Call asynchronous script execution function.
889
890         * dom/Document.h:
891         (WebCore::Document::setNeedsNotifyRemoveAllPendingStylesheet): Deleted.
892         (WebCore::Document::notifyRemovePendingSheetIfNeeded): Deleted.
893         * dom/ScriptableDocumentParser.cpp:
894         (WebCore::ScriptableDocumentParser::ScriptableDocumentParser):
895         (WebCore::ScriptableDocumentParser::executeScriptsWaitingForStylesheetsSoon):
896         (WebCore::ScriptableDocumentParser::scriptsWaitingForStylesheetsExecutionTimerFired):
897
898             Add a timer for executing pending scripts.
899
900         (WebCore::ScriptableDocumentParser::detach):
901         * dom/ScriptableDocumentParser.h:
902         (WebCore::ScriptableDocumentParser::executeScriptsWaitingForStylesheets):
903         * html/HTMLLinkElement.cpp:
904         (WebCore::HTMLLinkElement::removedFrom):
905         (WebCore::HTMLLinkElement::removePendingSheet):
906         * html/HTMLLinkElement.h:
907         * html/parser/HTMLDocumentParser.cpp:
908         (WebCore::HTMLDocumentParser::detach):
909         * loader/DocumentLoader.cpp:
910         (WebCore::DocumentLoader::isLoadingInAPISense):
911
912             Stay in loading state if we have a pending script. This matches existing behavior.
913
914         * style/StyleScope.cpp:
915         (WebCore::Style::Scope::removePendingSheet):
916         * style/StyleScope.h:
917
918 2017-02-18  Chris Dumez  <cdumez@apple.com>
919
920         <input type=range readonly> doesn't act per spec
921         https://bugs.webkit.org/show_bug.cgi?id=168422
922         <rdar://problem/30593189>
923
924         Reviewed by Ryosuke Niwa.
925
926         'readonly' attribute should not apply to <input type=range> as per the HTML
927         specification:
928         - https://html.spec.whatwg.org/#the-input-element:attr-input-readonly-3
929
930         Firefox and Edge already behave as per the specification.
931
932         No new tests, updated existing tests.
933
934         * html/RangeInputType.cpp:
935         (WebCore::RangeInputType::handleMouseDownEvent):
936         (WebCore::RangeInputType::handleTouchEvent):
937         (WebCore::RangeInputType::handleKeydownEvent):
938         * html/shadow/SliderThumbElement.cpp:
939         (WebCore::SliderThumbElement::defaultEventHandler):
940         (WebCore::SliderThumbElement::willRespondToMouseMoveEvents):
941         (WebCore::SliderThumbElement::willRespondToMouseClickEvents):
942
943 2017-02-18  Chris Dumez  <cdumez@apple.com>
944
945         Recursive MessagePort.postMessage() calls causes tab to become unresponsive
946         https://bugs.webkit.org/show_bug.cgi?id=168548
947         <rdar://problem/29808005>
948
949         Reviewed by Darin Adler.
950
951         MessagePort::dispatchMessages() was getting messages one by one of the
952         channel's MessageQueue and firing the MessageEvent for each of them.
953         The issue is that we can get stuck in an infinite loop if the
954         MessageEvent handler posts a message on the same post.
955
956         To address the issue, we now takes all messages from the queue before
957         iterating over them to fire the event. This way, if new messages are
958         added to the queue in one of the MessageEvent handlers, they will not
959         be processed until the next event loop iteration, as is expected.
960
961         Test: fast/events/message-port-postMessage-recursive.html
962
963         * dom/MessagePort.cpp:
964         (WebCore::MessagePort::dispatchMessages):
965         * dom/MessagePortChannel.h:
966         (WebCore::MessagePortChannel::EventData::EventData):
967         * dom/default/PlatformMessagePortChannel.cpp:
968         (WebCore::MessagePortChannel::postMessageToRemote):
969         * dom/default/PlatformMessagePortChannel.h:
970         (WebCore::PlatformMessagePortChannel::MessagePortQueue::takeMessage):
971         (WebCore::PlatformMessagePortChannel::MessagePortQueue::takeAllMessages):
972         (WebCore::PlatformMessagePortChannel::MessagePortQueue::appendAndCheckEmpty):
973
974 2017-02-18  Michael Catanzaro  <mcatanzaro@igalia.com>
975
976         Remove COORDINATED_GRAPHICS_MULTIPROCESS
977         https://bugs.webkit.org/show_bug.cgi?id=168514
978
979         Reviewed by Darin Adler.
980
981         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
982         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
983
984 2017-02-17  Simon Fraser  <simon.fraser@apple.com>
985
986         Allow properties in CSSProperties.json that don't trigger code generation
987         https://bugs.webkit.org/show_bug.cgi?id=168535
988
989         Reviewed by Sam Weinig.
990         
991         In order to track the development of CSS properties that we have not yet implemented,
992         support '"skip-codegen" : true' in "codegen-properties".
993
994         Test by adding a few fill-related properties with this attribute.
995
996         * css/CSSProperties.json:
997         * css/makeprop.pl:
998         (isPropertyEnabled):
999         (addProperty):
1000
1001 2017-02-17  Brian Burg  <bburg@apple.com>
1002
1003         Web Inspector: RTL: Inspector window should dock to the left when using RTL layout direction
1004         https://bugs.webkit.org/show_bug.cgi?id=168273
1005         <rdar://problem/29949325>
1006
1007         Reviewed by Matt Baker.
1008
1009         Add the ability to dock Web Inspector to the left of the inspected view.
1010         The frontend decides whether the Dock to Side button docks left or right
1011         based on the current layout direction.
1012
1013         * inspector/InspectorFrontendClient.h:
1014         * inspector/InspectorFrontendClientLocal.cpp:
1015         (WebCore::InspectorFrontendClientLocal::setAttachedWindow):
1016         * inspector/InspectorFrontendHost.cpp:
1017         (WebCore::InspectorFrontendHost::requestSetDockSide):
1018
1019 2017-02-16  Simon Fraser  <simon.fraser@apple.com>
1020
1021         Allow PlatformCALayers to specify that they want deep color backing store
1022         https://bugs.webkit.org/show_bug.cgi?id=168495
1023
1024         Reviewed by Tim Horton.
1025         
1026         Currently capable iOS devices get deep color backing store by virtue of a supports
1027         check in PlatformCALayerCocoa::PlatformCALayerCocoa(), and LegacyTileGridTile.
1028
1029         Future work will make layer contents format selection more complex, so express the need
1030         for deep color on PlatformCALayer, and have the creators of PlatformCALayer (mainly the
1031         flavors of GraphicsLayerCA) choose for them to support deep color. A bit of special-casing
1032         is needed to propagte the state to TileControllers.
1033         
1034         The deep-colorness now propagates from PlatformCALayerRemote to RemoteLayerBackingStore,
1035         instead of RemoteLayerBackingStore looking at the properties of the screen directly.
1036
1037         Remove PlatformCALayer::LayerTypeWebTiledLayer which was only used for the old CATiledLayers
1038         that we no longer use.
1039
1040         An iphone7 test verifies that page tiles, normal layers and tiled layers get the deep
1041         color state set on them.
1042
1043         Test: tiled-drawing/ios/iphone7/compositing-layers-deep-color.html
1044
1045         * platform/graphics/ca/GraphicsLayerCA.cpp:
1046         (WebCore::GraphicsLayerCA::createPlatformCALayer):
1047         (WebCore::GraphicsLayerCA::dumpAdditionalProperties):
1048         * platform/graphics/ca/GraphicsLayerCA.h:
1049         * platform/graphics/ca/PlatformCALayer.cpp:
1050         (WebCore::PlatformCALayer::canHaveBackingStore):
1051         (WebCore::operator<<):
1052         * platform/graphics/ca/PlatformCALayer.h:
1053         * platform/graphics/ca/TileController.cpp:
1054         (WebCore::TileController::setZoomedOutContentsScale):
1055         (WebCore::TileController::setAcceleratesDrawing):
1056         (WebCore::TileController::setWantsDeepColorBackingStore):
1057         (WebCore::TileController::createTileLayer):
1058         * platform/graphics/ca/TileController.h:
1059         * platform/graphics/ca/TileGrid.cpp:
1060         (WebCore::TileGrid::updateTileLayerProperties):
1061         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
1062         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
1063         (PlatformCALayerCocoa::PlatformCALayerCocoa):
1064         (PlatformCALayerCocoa::commonInit):
1065         (PlatformCALayerCocoa::wantsDeepColorBackingStore):
1066         (PlatformCALayerCocoa::setWantsDeepColorBackingStore):
1067         (layerContentsFormat):
1068         (PlatformCALayerCocoa::updateContentsFormat):
1069         * platform/graphics/ca/cocoa/WebTiledBackingLayer.h:
1070         * platform/graphics/ca/cocoa/WebTiledBackingLayer.mm:
1071         (-[WebTiledBackingLayer setWantsDeepColorBackingStore:]):
1072         (-[WebTiledBackingLayer wantsDeepColorBackingStore]):
1073         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
1074         (PlatformCALayerWin::wantsDeepColorBackingStore):
1075         (PlatformCALayerWin::setWantsDeepColorBackingStore):
1076         (printLayer):
1077         * platform/graphics/ca/win/PlatformCALayerWin.h:
1078         * platform/spi/cocoa/QuartzCoreSPI.h:
1079
1080 2017-02-17  Jer Noble  <jer.noble@apple.com>
1081
1082         Refactoring: Make sure to unprepare WebAudioSourceProviderAVFObjC when its owner is destroyed.
1083         https://bugs.webkit.org/show_bug.cgi?id=168532
1084
1085         Reviewed by Youenn Fablet.
1086
1087         Because WebAudioSourceProviderAVFObjC has a back-pointer to the object which creted it, make
1088         sure that back-pointer is invalidated once the creating object is destroyed by calling
1089         WebAudioSOurceProviderAVFObjC::unprepare().
1090
1091         Drive-by Fix: In WebAudioSourceProviderAVFObjC::audioSamplesAvailable(), PlatformAudioData will
1092         always be of the WebAudioBufferList type. If this ever becomes untrue, an invalid downcast will
1093         be caught by downcast<>, so just remove the is<> check.
1094
1095         * platform/mediastream/mac/AVAudioCaptureSource.mm:
1096         (WebCore::AVAudioCaptureSource::~AVAudioCaptureSource):
1097         * platform/mediastream/mac/MockRealtimeAudioSourceMac.h:
1098         * platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
1099         (WebCore::MockRealtimeAudioSourceMac::~MockRealtimeAudioSourceMac):
1100         * platform/mediastream/mac/RealtimeIncomingAudioSource.cpp:
1101         (WebCore::RealtimeIncomingAudioSource::~RealtimeIncomingAudioSource):
1102         * platform/mediastream/mac/RealtimeIncomingAudioSource.h:
1103         * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm:
1104         (WebCore::WebAudioSourceProviderAVFObjC::~WebAudioSourceProviderAVFObjC):
1105         (WebCore::WebAudioSourceProviderAVFObjC::setClient):
1106         (WebCore::WebAudioSourceProviderAVFObjC::unprepare):
1107         (WebCore::WebAudioSourceProviderAVFObjC::audioSamplesAvailable):
1108
1109 2017-02-17  Antoine Quint  <graouts@apple.com>
1110
1111         [Modern Media Controls] Improve handling of <video> with only audio tracks
1112         https://bugs.webkit.org/show_bug.cgi?id=167836
1113         <rdar://problem/30255812>
1114
1115         Reviewed by Dean Jackson.
1116
1117         We now check for the availability of video tracks before considering a <video>
1118         element is displaying an actual video file and turning auto-hide on. We also
1119         check that we have video tracks before enabling the fullscreen button. This
1120         brings the behavior of a <video> pointing to a resource with no video tracks
1121         to be the same as an <audio> element.
1122
1123         Test: media/modern-media-controls/media-controller/media-controller-video-with-only-audio.html
1124
1125         * Modules/modern-media-controls/media/controls-visibility-support.js:
1126         (ControlsVisibilitySupport.prototype.get tracksToMonitor):
1127         (ControlsVisibilitySupport.prototype._updateControls):
1128         (ControlsVisibilitySupport):
1129         * Modules/modern-media-controls/media/fullscreen-support.js:
1130         (FullscreenSupport.prototype.syncControl):
1131         (FullscreenSupport):
1132
1133 2017-02-17  Antoine Quint  <graouts@apple.com>
1134
1135         [Modern Media Controls] Toggle playback when clicking on the video on macOS
1136         https://bugs.webkit.org/show_bug.cgi?id=168515
1137         <rdar://problem/30577441>
1138
1139         Reviewed by Dean Jackson.
1140
1141         Listen to click events on the macOS media controls. Detect any clicks that were on the
1142         background instead of the controls widgets themselves, and tell the delegate (MediaController)
1143         about them.
1144
1145         Tests: media/modern-media-controls/media-controller/media-controller-click-on-video-background-should-pause.html
1146                media/modern-media-controls/media-controller/media-controller-click-on-video-background-to-dismiss-tracks-panel-should-not-toggle-playback.html
1147                media/modern-media-controls/media-controller/media-controller-click-on-video-controls-should-not-pause.html
1148
1149         * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
1150         (MacOSFullscreenMediaControls.prototype._handleMousedown):
1151         * Modules/modern-media-controls/controls/macos-inline-media-controls.js:
1152         (MacOSInlineMediaControls.prototype.handleEvent):
1153         * Modules/modern-media-controls/controls/macos-media-controls.js:
1154         (MacOSMediaControls.prototype.handleEvent):
1155         (MacOSMediaControls):
1156         * Modules/modern-media-controls/media/media-controller.js:
1157         (MediaController.prototype.togglePlayback):
1158         (MediaController.prototype.macOSControlsBackgroundWasClicked):
1159         (MediaController.prototype._updateControlsIfNeeded):
1160         * Modules/modern-media-controls/media/playback-support.js:
1161         (PlaybackSupport.prototype.buttonWasPressed):
1162
1163 2017-02-17  Jer Noble  <jer.noble@apple.com>
1164
1165         Refactoring: Remove AudioSourceObserverObjC and AudioCaptureSourceProviderObjC
1166         https://bugs.webkit.org/show_bug.cgi?id=168520
1167
1168         Reviewed by Youenn Fablet.
1169
1170         Having AudioCaptureSourceProviderObjC as the type provided to WebAudioSourceProviderAVFObjC
1171         (and only ever to WebAudioSourceProviderAVFObjC) makes it impossible for that class to add
1172         an observer on RealtimeMediaSource, of which all classes inheriting from
1173         WebAudioSourceProviderAVFObjC are subclasses. There is no need to treat
1174         WebAudioSourceProviderAVFObjC as an "observer", since the only thing it will ever observe is
1175         the object which created it and hold an explicit reference to it. So replace all instances
1176         of the "observer" pattern with direct calls to the necessary (newly non-virtual) methods.
1177         This allows WebAudioSourceProviderAVFObjC to register as an observer directly on
1178         RealtimeMediaSource, to listen for audioSamplesAvailable() instead of process(), and remove
1179         a lot of unnecessary conversion code and observer duplication.
1180
1181         * WebCore.xcodeproj/project.pbxproj:
1182         * platform/mediastream/RealtimeMediaSource.h:
1183         (WebCore::RealtimeMediaSource::Observer::sourceStopped):
1184         (WebCore::RealtimeMediaSource::Observer::sourceMutedChanged):
1185         (WebCore::RealtimeMediaSource::Observer::sourceEnabledChanged):
1186         (WebCore::RealtimeMediaSource::Observer::sourceSettingsChanged):
1187         (WebCore::RealtimeMediaSource::Observer::preventSourceFromStopping):
1188         * platform/mediastream/mac/AVAudioCaptureSource.h:
1189         * platform/mediastream/mac/AVAudioCaptureSource.mm:
1190         (WebCore::AVAudioCaptureSource::shutdownCaptureSession):
1191         (WebCore::AVAudioCaptureSource::captureOutputDidOutputSampleBufferFromConnection):
1192         (WebCore::AVAudioCaptureSource::addObserver): Deleted.
1193         (WebCore::AVAudioCaptureSource::removeObserver): Deleted.
1194         (WebCore::AVAudioCaptureSource::start): Deleted.
1195         * platform/mediastream/mac/AudioCaptureSourceProviderObjC.h: Removed.
1196         * platform/mediastream/mac/AudioSourceObserverObjC.h: Removed.
1197         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.h:
1198         * platform/mediastream/mac/MockRealtimeAudioSourceMac.h:
1199         * platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
1200         (WebCore::MockRealtimeAudioSourceMac::emitSampleBuffers):
1201         (WebCore::MockRealtimeAudioSourceMac::reconfigure):
1202         (WebCore::MockRealtimeAudioSourceMac::audioSourceProvider):
1203         (WebCore::MockRealtimeAudioSourceMac::addObserver): Deleted.
1204         (WebCore::MockRealtimeAudioSourceMac::removeObserver): Deleted.
1205         (WebCore::MockRealtimeAudioSourceMac::start): Deleted.
1206         * platform/mediastream/mac/RealtimeIncomingAudioSource.cpp:
1207         (WebCore::RealtimeIncomingAudioSource::audioSourceProvider):
1208         (WebCore::RealtimeIncomingAudioSource::addObserver): Deleted.
1209         (WebCore::RealtimeIncomingAudioSource::removeObserver): Deleted.
1210         (WebCore::RealtimeIncomingAudioSource::start): Deleted.
1211         * platform/mediastream/mac/RealtimeIncomingAudioSource.h:
1212         * platform/mediastream/mac/RealtimeOutgoingAudioSource.h:
1213         * platform/mediastream/mac/RealtimeOutgoingVideoSource.h:
1214         * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.h:
1215         * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm:
1216         (WebCore::WebAudioSourceProviderAVFObjC::create):
1217         (WebCore::WebAudioSourceProviderAVFObjC::WebAudioSourceProviderAVFObjC):
1218         (WebCore::WebAudioSourceProviderAVFObjC::setClient):
1219         (WebCore::WebAudioSourceProviderAVFObjC::audioSamplesAvailable):
1220         (WebCore::WebAudioSourceProviderAVFObjC::process): Deleted.
1221
1222 2017-02-17  Antoine Quint  <graouts@apple.com>
1223
1224         REGRESSION: Subtitles menu in media controls allows multiple items to be selected
1225         https://bugs.webkit.org/show_bug.cgi?id=168168
1226         <rdar://problem/30488605>
1227
1228         Reviewed by Dean Jackson.
1229
1230         Ensure that only a single audio track and a single text track can be selected
1231         in the tracks panel at any given point.
1232
1233         * Modules/modern-media-controls/media/tracks-support.js:
1234         (TracksSupport.prototype.tracksPanelSelectionDidChange):
1235         (TracksSupport.prototype._sortedTrackList):
1236         (TracksSupport):
1237
1238 2017-02-17  Jeremy Jones  <jeremyj@apple.com>
1239
1240         Invalidate WebAVSampleBufferStatusChangeListener when MediaPlayerPrivateMediaStreamAVFObjC is deallocated.
1241         https://bugs.webkit.org/show_bug.cgi?id=168488
1242
1243         Reviewed by Jer Noble.
1244
1245         Fixes periodically crashing test: fast/mediastream/MediaStream-video-element-track-stop.html
1246
1247         WebAVSampleBufferStatusChangeListener has an unretained referecne to MediaPlayerPrivateMediaStreamAVFObjC
1248         that must be invaldated when MediaPlayerPrivateMediaStreamAVFObjC is deallocated.
1249
1250         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
1251         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::~MediaPlayerPrivateMediaStreamAVFObjC):
1252
1253 2017-02-17  Antoine Quint  <graouts@apple.com>
1254
1255         [Modern Media Controls] Improve handling of live broadcast video
1256         https://bugs.webkit.org/show_bug.cgi?id=168506
1257         <rdar://problem/30432094>
1258
1259         Reviewed by Dean Jackson.
1260
1261         We improve the handling of live broadcast video by:
1262         
1263             - checking that we have a media source before deciding to show the controls
1264               bar and start button
1265             - support a mode where neither the status text nor the scrubber is visible
1266               in case we're still waiting on sufficient data to determine the video
1267               time and we haven't really started loading data yet
1268             - not showing time labels when we have an infinite duration
1269             - ensuring the status label is left-aligned
1270
1271         Test: media/modern-media-controls/status-label/status-label-text-align.html
1272
1273         * Modules/modern-media-controls/controls/macos-inline-media-controls.js:
1274         (MacOSInlineMediaControls.prototype.layout):
1275         * Modules/modern-media-controls/controls/status-label.css:
1276         (.status-label):
1277         * Modules/modern-media-controls/controls/status-label.js:
1278         (StatusLabel.prototype.get enabled):
1279         (StatusLabel.prototype.set enabled):
1280         * Modules/modern-media-controls/media/controls-visibility-support.js:
1281         (ControlsVisibilitySupport.prototype._updateControls):
1282         (ControlsVisibilitySupport):
1283         * Modules/modern-media-controls/media/status-support.js:
1284         (StatusSupport.prototype.syncControl):
1285         (StatusSupport):
1286         * Modules/modern-media-controls/media/time-labels-support.js:
1287         (TimeLabelsSupport.prototype.syncControl):
1288         (TimeLabelsSupport):
1289
1290 2017-02-17  Anders Carlsson  <andersca@apple.com>
1291
1292         Begin overhauling the pasteboard implementation
1293         https://bugs.webkit.org/show_bug.cgi?id=168525
1294
1295         Reviewed by Tim Horton.
1296
1297         Add a new PasteboardWriterData object. This object will hold data that is going
1298         to be written to the pasteboard at some point. Currently it only supports plain text.
1299
1300         Also add a Mac-only PasteboardWriter class which can convert a PasteboardWriterDataObject
1301         into an object that conforms to NSPasteboardWriting.
1302
1303         The basic idea is that instead of doing a bunch of pasteboard operations,
1304         we'll just package all the pasteboard data up into an object and ship it over to WebKit.
1305
1306         This code is currently unused but will be adopted by a new drag implementation (in an upcoming patch).
1307
1308         * WebCore.xcodeproj/project.pbxproj:
1309         * platform/PasteboardWriterData.cpp: Added.
1310         (WebCore::PasteboardWriterData::PasteboardWriterData):
1311         (WebCore::PasteboardWriterData::~PasteboardWriterData):
1312         (WebCore::PasteboardWriterData::isEmpty):
1313         (WebCore::PasteboardWriterData::setPlainText):
1314         * platform/PasteboardWriterData.h: Added.
1315         * platform/mac/PasteboardWriter.h: Added.
1316         * platform/mac/PasteboardWriter.mm: Added.
1317         (WebCore::createPasteboardWriting):
1318         * platform/spi/mac/NSPasteboardSPI.h: Added.
1319
1320 2017-02-17  Per Arne Vollan  <pvollan@apple.com>
1321
1322         Apply SVG styles paint-order, stroke-linejoin, and stroke-linecap on DOM text.
1323         https://bugs.webkit.org/show_bug.cgi?id=168044
1324         rdar://problem/30165746
1325
1326         Reviewed by Simon Fraser.
1327
1328         This patch moves these styles out of svg, and sets the properties on video cues.
1329
1330         Tests: fast/css/parsing-paint-order.html
1331                fast/css/parsing-stroke-linecap.html
1332                fast/css/parsing-stroke-linejoin.html
1333                fast/css/parsing-stroke-width.html
1334
1335         * css/CSSComputedStyleDeclaration.cpp:
1336         (WebCore::paintOrder):
1337         (WebCore::ComputedStyleExtractor::propertyValue):
1338         * css/CSSProperties.json:
1339         * css/SVGCSSComputedStyleDeclaration.cpp:
1340         (WebCore::ComputedStyleExtractor::svgPropertyValue):
1341         (WebCore::paintOrder): Deleted.
1342         * css/StyleResolver.cpp:
1343         (WebCore::StyleResolver::isValidCueStyleProperty):
1344         * page/CaptionUserPreferencesMediaAF.cpp:
1345         (WebCore::CaptionUserPreferencesMediaAF::cssPropertyWithTextEdgeColor):
1346         * rendering/style/RenderStyle.cpp:
1347         (WebCore::RenderStyle::diff):
1348         (WebCore::RenderStyle::paintTypesForPaintOrder):
1349         * rendering/style/RenderStyle.h:
1350         (WebCore::RenderStyle::setPaintOrder):
1351         (WebCore::RenderStyle::paintOrder):
1352         (WebCore::RenderStyle::initialPaintOrder):
1353         (WebCore::RenderStyle::setCapStyle):
1354         (WebCore::RenderStyle::capStyle):
1355         (WebCore::RenderStyle::initialCapStyle):
1356         (WebCore::RenderStyle::setJoinStyle):
1357         (WebCore::RenderStyle::joinStyle):
1358         (WebCore::RenderStyle::initialJoinStyle):
1359         (WebCore::RenderStyle::strokeWidth):
1360         (WebCore::RenderStyle::setStrokeWidth):
1361         (WebCore::RenderStyle::hasVisibleStroke):
1362         (WebCore::RenderStyle::setStrokeOpacity):
1363         * rendering/style/SVGRenderStyle.cpp:
1364         (WebCore::SVGRenderStyle::diff):
1365         (WebCore::SVGRenderStyle::paintTypesForPaintOrder): Deleted.
1366         * rendering/style/SVGRenderStyle.h:
1367         (WebCore::SVGRenderStyle::initialBufferedRendering):
1368         (WebCore::SVGRenderStyle::initialFillRule):
1369         (WebCore::SVGRenderStyle::initialMaskType):
1370         (WebCore::SVGRenderStyle::setBufferedRendering):
1371         (WebCore::SVGRenderStyle::setFillRule):
1372         (WebCore::SVGRenderStyle::setMaskType):
1373         (WebCore::SVGRenderStyle::bufferedRendering):
1374         (WebCore::SVGRenderStyle::fillRule):
1375         (WebCore::SVGRenderStyle::strokeMiterLimit):
1376         (WebCore::SVGRenderStyle::maskType):
1377         (WebCore::SVGRenderStyle::hasStroke):
1378         (WebCore::SVGRenderStyle::setBitDefaults):
1379         (WebCore::SVGRenderStyle::InheritedFlags::operator==):
1380         (WebCore::SVGRenderStyle::initialCapStyle): Deleted.
1381         (WebCore::SVGRenderStyle::initialJoinStyle): Deleted.
1382         (WebCore::SVGRenderStyle::initialPaintOrder): Deleted.
1383         (WebCore::SVGRenderStyle::setCapStyle): Deleted.
1384         (WebCore::SVGRenderStyle::setJoinStyle): Deleted.
1385         (WebCore::SVGRenderStyle::setPaintOrder): Deleted.
1386         (WebCore::SVGRenderStyle::capStyle): Deleted.
1387         (WebCore::SVGRenderStyle::joinStyle): Deleted.
1388         (WebCore::SVGRenderStyle::strokeWidth): Deleted.
1389         (WebCore::SVGRenderStyle::paintOrder): Deleted.
1390         (WebCore::SVGRenderStyle::hasVisibleStroke): Deleted.
1391         (WebCore::SVGRenderStyle::setStrokeWidth): Deleted.
1392         * rendering/style/SVGRenderStyleDefs.cpp:
1393         (WebCore::StyleStrokeData::StyleStrokeData):
1394         (WebCore::StyleStrokeData::operator==):
1395         * rendering/style/SVGRenderStyleDefs.h:
1396         * rendering/style/StyleRareInheritedData.cpp:
1397         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
1398         (WebCore::StyleRareInheritedData::operator==):
1399         * rendering/style/StyleRareInheritedData.h:
1400         * rendering/svg/RenderSVGEllipse.cpp:
1401         (WebCore::RenderSVGEllipse::strokeShape):
1402         * rendering/svg/RenderSVGPath.cpp:
1403         (WebCore::RenderSVGPath::strokeShape):
1404         (WebCore::RenderSVGPath::shapeDependentStrokeContains):
1405         (WebCore::RenderSVGPath::shouldStrokeZeroLengthSubpath):
1406         (WebCore::RenderSVGPath::zeroLengthLinecapPath):
1407         * rendering/svg/RenderSVGRect.cpp:
1408         (WebCore::RenderSVGRect::strokeShape):
1409         * rendering/svg/RenderSVGShape.cpp:
1410         (WebCore::RenderSVGShape::strokeShape):
1411         (WebCore::RenderSVGShape::fillStrokeMarkers):
1412         (WebCore::RenderSVGShape::strokeWidth):
1413         (WebCore::RenderSVGShape::hasSmoothStroke):
1414         * rendering/svg/RenderSVGText.cpp:
1415         (WebCore::RenderSVGText::strokeBoundingBox):
1416         * rendering/svg/SVGInlineTextBox.cpp:
1417         (WebCore::SVGInlineTextBox::paint):
1418         (WebCore::SVGInlineTextBox::paintDecoration):
1419         * rendering/svg/SVGRenderSupport.cpp:
1420         (WebCore::SVGRenderSupport::applyStrokeStyleToContext):
1421         * rendering/svg/SVGRenderTreeAsText.cpp:
1422         (WebCore::writeStyle):
1423
1424 2017-02-17  Carlos Garcia Campos  <cgarcia@igalia.com>
1425
1426         [SOUP] Handle Settings::allowsAnySSLCertificate() in SSL sockets
1427         https://bugs.webkit.org/show_bug.cgi?id=168521
1428
1429         Reviewed by Michael Catanzaro.
1430
1431         When Settings::allowsAnySSLCertificate() is enabled, connect to accept-certificate signal of the GTlsConnection
1432         to always accept the certificates.
1433
1434         Fixes: http/tests/websocket/tests/hybi/simple-wss.html
1435
1436         * platform/network/soup/SocketStreamHandleImplSoup.cpp:
1437         (WebCore::wssConnectionAcceptCertificateCallback):
1438         (WebCore::wssSocketClientEventCallback):
1439         (WebCore::SocketStreamHandleImpl::create):
1440
1441 2017-02-17  Simon Fraser  <simon.fraser@apple.com>
1442
1443         Fixed elements bounce when rubber-banding at the bottom of the page
1444         https://bugs.webkit.org/show_bug.cgi?id=168493
1445         rdar://problem/30567713
1446
1447         Reviewed by Tim Horton.
1448
1449         FrameView::visibleDocumentRect() was computing a bad visible rect when bottom-rubber-banding,
1450         by adding rubberBandBottom which is negative, rather than subtracting.
1451
1452         Log some more scrolling stuff.
1453
1454         Ironically, the existing test didn't test stick-to-viewport fixed position because
1455         backgroundShouldExtendBeyondPage() is off by default in WTR, so clone it to a test
1456         that sets this, to test both behaviors.
1457
1458         This also revealed that dynamic changes to backgroundShouldExtendBeyondPage() need
1459         to be propagated to the scrolling tree, which is fixed in AsyncScrollingCoordinator::frameViewLayoutUpdated().
1460
1461         Test: fast/visual-viewport/rubberbanding-viewport-rects-extended-background.html
1462
1463         * page/FrameView.cpp:
1464         (WebCore::FrameView::updateLayoutViewport):
1465         (WebCore::FrameView::visibleDocumentRect):
1466         * page/scrolling/AsyncScrollingCoordinator.cpp:
1467         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
1468         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
1469         (WebCore::ScrollingStateFrameScrollingNode::dumpProperties):
1470         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
1471         (WebCore::ScrollingTreeFrameScrollingNode::layoutViewportForScrollPosition):
1472         * page/scrolling/mac/ScrollingCoordinatorMac.mm:
1473         (WebCore::ScrollingCoordinatorMac::scheduleTreeStateCommit):
1474         (WebCore::ScrollingCoordinatorMac::commitTreeState):
1475
1476 2017-02-17  Simon Fraser  <simon.fraser@apple.com>
1477
1478         REGRESSION (209396): Apple Pay buttons do not render
1479         https://bugs.webkit.org/show_bug.cgi?id=168523
1480         rdar://problem/30451563
1481
1482         Reviewed by Geoffrey Garen.
1483
1484         The new CSS parser mistakenly converted -apple-pay-button values to
1485         -webkit-pay-button, breaking -webkit-appearance: -apple-pay-button.
1486
1487         Fix by excluding "-apple-pay" prefixed values from the conversion.
1488
1489         Test: fast/css/appearance-apple-pay-button.html
1490
1491         * css/parser/CSSPropertyParser.cpp:
1492         (WebCore::isAppleLegacyCssValueKeyword):
1493
1494 2017-02-17  Commit Queue  <commit-queue@webkit.org>
1495
1496         Unreviewed, rolling out r212463.
1497         https://bugs.webkit.org/show_bug.cgi?id=168526
1498
1499         Some crashes with GuardMalloc (Requested by anttik on
1500         #webkit).
1501
1502         Reverted changeset:
1503
1504         "Execute pending scripts asynchronously after stylesheet loads
1505         complete"
1506         https://bugs.webkit.org/show_bug.cgi?id=168367
1507         http://trac.webkit.org/changeset/212463
1508
1509 2017-02-16  Brent Fulgham  <bfulgham@apple.com>
1510
1511         RenderView needs to be updated when FrameView changes
1512         https://bugs.webkit.org/show_bug.cgi?id=168481
1513         <rdar://problem/30339638>
1514
1515         Reviewed by Andreas Kling.
1516
1517         The state of the Document's RenderView can get out of sync with the Frame's FrameView.
1518         We need a notification mechanism so that modifications to the Frame's view are properly
1519         relayed to Document so that it can have a correct RenderView.
1520
1521         * dom/Document.cpp:
1522         (WebCore::Document::didBecomeCurrentDocumentInView): Create an updated render tree (if
1523         one does not already exist).
1524         (WebCore::Document::destroyRenderTree): Remove an incorrect ASSERT. We may enter this
1525         code when the Frame uses 'setView(nullptr)', which happens during certain  updates.
1526         * dom/Document.h:
1527         * page/Frame.cpp:
1528         (WebCore::Frame::setView): Destroy the old render tree (if present) before switching to
1529         the new view. Then notify the document that it is now the current document in the new view.
1530
1531 2017-02-17  Enrique Ocaña González  <eocanha@igalia.com>
1532
1533         [GStreamer] Fast replay on video hide/unhide on platforms with limited video buffer pools
1534         https://bugs.webkit.org/show_bug.cgi?id=168505
1535
1536         Reviewed by Žan Doberšek.
1537
1538         The WebKit code isn't consuming the video samples when the video layer is hidden,
1539         so the buffers aren't being returned to the pool and starve the decoder when the
1540         buffer pool runs out of buffers (on platforms using a buffer pool and a custom
1541         allocator, such as OMX on the Raspberry Pi 2). When the video layer is restored,
1542         the pipeline tries to catch up and the user sees the video "going fast forward".
1543
1544         The added code "consumes" (removes and unrefs) the buffer in that case. However,
1545         the sample isn't completely removed because it still holds important info (eg:
1546         caps) needed for the proper operation of the video element.
1547
1548         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1549         (WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor):
1550
1551 2017-02-17  Carlos Garcia Campos  <cgarcia@igalia.com>
1552
1553         [SOUP] Stop removing the fragment identifier from resource requests
1554         https://bugs.webkit.org/show_bug.cgi?id=168509
1555
1556         Reviewed by Sergio Villar Senin.
1557
1558         I don't know why, but have always removed the fragment identifier from the URL when creating the SoupURI that
1559         is passed to libsoup. Maybe it was a bug in a very old version of libsoup, but it doesn't look necessary anymore
1560         and it's causing several layout test failures.
1561
1562         Fixes: http/tests/svg/svg-use-external.html
1563                imported/w3c/web-platform-tests/html/webappapis/scripting/processing-model-2/compile-error-same-origin-with-hash.html
1564                imported/w3c/web-platform-tests/html/webappapis/scripting/processing-model-2/runtime-error-same-origin-with-hash.html
1565
1566         * platform/network/soup/ResourceRequestSoup.cpp:
1567         (WebCore::ResourceRequest::createSoupURI): Do not remove the fragment identifier from the URL.
1568
1569 2017-02-16  Yusuke Suzuki  <utatane.tea@gmail.com>
1570
1571         [JSC] Drop PassRefPtr from ArrayBuffer
1572         https://bugs.webkit.org/show_bug.cgi?id=168455
1573
1574         Reviewed by Geoffrey Garen.
1575
1576         * bindings/js/SerializedScriptValue.cpp:
1577         (WebCore::CloneDeserializer::readArrayBufferView):
1578         * css/FontFace.cpp:
1579         (WebCore::FontFace::create):
1580         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
1581         (WebCore::MediaPlayerPrivateAVFoundation::extractKeyURIKeyIDAndCertificateFromInitData):
1582         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
1583         (WebCore::AVFWrapper::shouldWaitForLoadingOfResource):
1584         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
1585         (WebCore::CDMSessionAVFoundationObjC::generateKeyRequest):
1586         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1587         (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource):
1588
1589 2017-02-16  Simon Fraser  <simon.fraser@apple.com>
1590
1591         REGRESSION(r212439): Web Inspector Toolbar / Window appears broken
1592         https://bugs.webkit.org/show_bug.cgi?id=168494
1593
1594         Reviewed by Joseph Pecoraro.
1595
1596         Missed one conversion from acceleratesDrawing to drawsAsynchronously, which
1597         caused non-Whippet GrpahicsContext shadow drawing to happen unexpectedly.
1598
1599         * platform/graphics/ca/cocoa/WebTiledBackingLayer.mm:
1600         (-[WebTiledBackingLayer drawsAsynchronously]):
1601         (-[WebTiledBackingLayer acceleratesDrawing]): Deleted.
1602
1603 2017-02-16  Chris Dumez  <cdumez@apple.com>
1604
1605         <input>.labels is empty if type changes from text->hidden->checkbox
1606         https://bugs.webkit.org/show_bug.cgi?id=168358
1607
1608         Reviewed by Ryosuke Niwa.
1609
1610         We were invalidating LabelsNodeLists on 'for' attribute change.
1611         We now also invalidate them of 'type' attribute change since
1612         HTMLInputElements whose type is 'hidden' do not support labels.
1613
1614         No new tests, updated existing test.
1615
1616         * dom/Document.h:
1617         * dom/LiveNodeList.h:
1618         (WebCore::shouldInvalidateTypeOnAttributeChange):
1619         * html/LabelsNodeList.cpp:
1620         (WebCore::LabelsNodeList::LabelsNodeList):
1621
1622 2017-02-16  Michael Catanzaro  <mcatanzaro@igalia.com>
1623
1624         Remove even more EFL from WebCore
1625         https://bugs.webkit.org/show_bug.cgi?id=168485
1626
1627         Reviewed by Alex Christensen.
1628
1629         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
1630         (webkitAccessibleGetAttributes):
1631         (atkRole):
1632         * css/StyleRule.cpp:
1633         (WebCore::StyleRuleBase::copy):
1634         * platform/ContextMenuItem.h:
1635         * platform/graphics/OpenGLESShims.h:
1636         * platform/graphics/PlatformDisplay.cpp:
1637         (WebCore::PlatformDisplay::createPlatformDisplay):
1638         * platform/graphics/PlatformDisplay.h:
1639         * platform/graphics/cairo/ImageBufferCairo.cpp:
1640         * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
1641         (WebCore::Font::platformInit):
1642         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1643         (WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer):
1644         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
1645         (WebCore::GraphicsLayerTextureMapper::setContentsToImage):
1646         * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.cpp:
1647         * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.h:
1648         * platform/network/soup/ResourceErrorSoup.cpp:
1649         (WebCore::ResourceError::timeoutError):
1650         * platform/network/soup/SoupNetworkSession.cpp:
1651         (WebCore::SoupNetworkSession::setProxySettingsFromEnvironment): Deleted.
1652         * platform/network/soup/SoupNetworkSession.h:
1653
1654 2017-02-16  Daniel Bates  <dabates@apple.com>
1655
1656         Remove Chromium-specific code to call FrameLoaderClient::redirectDataToPlugin(nullptr)
1657         https://bugs.webkit.org/show_bug.cgi?id=168417
1658         <rdar://problem/30541748>
1659
1660         Reviewed by Brent Fulgham.
1661
1662         Remove Chromium-specific code that was added in r125500 to call FrameLoaderClient::redirectDataToPlugin(nullptr)
1663         in PluginDocument::detachFromPluginElement(). Calling redirectDataToPlugin() with nullptr was used by the
1664         Chromium port to signify that the plugin document was being destroyed so that they could tear down their
1665         plugin widget. And PluginDocument::detachFromPluginElement() is the only place that calls redirectDataToPlugin()
1666         passing nullptr. No other port made use of this machinery and the Chromium port has long since been removed
1667         from the Open Source WebKit Project. We should remove this code.
1668
1669         * html/PluginDocument.cpp:
1670         (WebCore::PluginDocumentParser::appendBytes): Pass the plugin widget by reference.
1671         (WebCore::PluginDocument::detachFromPluginElement): Remove call to FrameLoaderClient::redirectDataToPlugin().
1672         This call was only used by the Chromium port as means to be notified when the plugin document was being
1673         destroyed. No other port made use of this notification or needed such a notification.
1674         * loader/EmptyClients.cpp: Change argument of redirectDataToPlugin() from Widget* to Widget& to convey
1675         that this function always takes a valid Widget. Also remove unnecessary argument name as the data type
1676         of the argument and the name of the function sufficiently describes the purpose of the argument.
1677         * loader/FrameLoaderClient.h: Ditto.
1678
1679 2017-02-16  Myles C. Maxfield  <mmaxfield@apple.com>
1680
1681         font-weight in @font-face can cause a font to be downloaded even when it's not used
1682         https://bugs.webkit.org/show_bug.cgi?id=168114
1683         <rdar://problem/30301317>
1684
1685         Reviewed by Darin Adler.
1686
1687         There were two problems with our font loading code.
1688
1689         When we are in the middle of a download, we will use a special interstitial font,
1690         and this special font has a flag set which will cause it to be invisible when it is
1691         drawn. However, when we start using this font during the load, we give it a
1692         unicode-range of U+0-0 which means that it will never be used, and fallback will
1693         happen to other weights immediately. 
1694
1695         The second problem with the font loading code is that this interstital font is just
1696         Times. Times doesn't support every character, which means that if we are trying
1697         to render some exotic character, we fall back to other weights. The solution here
1698         is to use LastResort as the interstitial font, because it supports all characters.
1699         Because its metrics are reasonable and we don't ever actually paint this
1700         interstitial font, this choice is no worse than Times.
1701
1702         Tests: fast/text/font-style-download.html
1703                fast/text/font-weight-download-2.html
1704                fast/text/font-weight-download.html
1705                fast/text/font-weight-fallback.html
1706
1707         * css/CSSFontFace.cpp:
1708         (WebCore::CSSFontFace::font):
1709         * css/CSSSegmentedFontFace.cpp:
1710         (WebCore::appendFont):
1711         (WebCore::CSSSegmentedFontFace::fontRanges):
1712         (WebCore::appendFontWithInvalidUnicodeRangeIfLoading): Deleted.
1713         * platform/graphics/Font.h:
1714         (WebCore::Font::widthForGlyph):
1715         * platform/graphics/FontCache.h:
1716         * platform/graphics/freetype/FontCacheFreeType.cpp:
1717         (WebCore::FontCache::lastResortFallbackFontForEveryCharacter):
1718         * platform/graphics/mac/FontCacheMac.mm:
1719         (WebCore::FontCache::lastResortFallbackFontForEveryCharacter):
1720         * platform/graphics/win/FontCacheWin.cpp:
1721         (WebCore::FontCache::lastResortFallbackFontForEveryCharacter):
1722
1723 2017-02-16  Alex Christensen  <achristensen@webkit.org>
1724
1725         Remove EFL-specific files in Source.
1726
1727         Rubber-stamped by Anders Carlsson.
1728
1729         * editing/efl: Removed.
1730         * page/efl: Removed.
1731         * platform/audio/efl: Removed.
1732         * platform/efl: Removed.
1733         * platform/efl/DefaultTheme: Removed.
1734         * platform/efl/DefaultTheme/widget: Removed.
1735         * platform/efl/DefaultTheme/widget/button: Removed.
1736         * platform/efl/DefaultTheme/widget/check: Removed.
1737         * platform/efl/DefaultTheme/widget/combo: Removed.
1738         * platform/efl/DefaultTheme/widget/entry: Removed.
1739         * platform/efl/DefaultTheme/widget/progressbar: Removed.
1740         * platform/efl/DefaultTheme/widget/radio: Removed.
1741         * platform/efl/DefaultTheme/widget/scrollbar: Removed.
1742         * platform/efl/DefaultTheme/widget/search: Removed.
1743         * platform/efl/DefaultTheme/widget/search/cancel: Removed.
1744         * platform/efl/DefaultTheme/widget/search/decoration: Removed.
1745         * platform/efl/DefaultTheme/widget/search/field: Removed.
1746         * platform/efl/DefaultTheme/widget/slider: Removed.
1747         * platform/efl/DefaultTheme/widget/spinner: Removed.
1748         * platform/gamepad/efl: Removed.
1749         * platform/graphics/efl: Removed.
1750         * platform/graphics/surfaces/efl: Removed.
1751         * platform/network/efl: Removed.
1752
1753 2017-02-16  Simon Fraser  <simon.fraser@apple.com>
1754
1755         Add WebUSB to features.json as a "Not Considering".
1756
1757         * features.json:
1758
1759 2017-02-16  Alex Christensen  <achristensen@webkit.org>
1760
1761         Remove old URL parser
1762         https://bugs.webkit.org/show_bug.cgi?id=168483
1763
1764         Reviewed by Tim Horton.
1765
1766         * platform/URL.cpp:
1767         (WebCore::isSchemeFirstChar):
1768         (WebCore::isSchemeChar):
1769         (WebCore::URL::URL):
1770         (WebCore::URL::setProtocol):
1771         (WebCore::URL::setHost):
1772         (WebCore::URL::removePort):
1773         (WebCore::URL::setPort):
1774         (WebCore::URL::setHostAndPort):
1775         (WebCore::URL::setUser):
1776         (WebCore::URL::setPass):
1777         (WebCore::URL::setFragmentIdentifier):
1778         (WebCore::URL::setQuery):
1779         (WebCore::URL::setPath):
1780         (WebCore::URL::serialize):
1781         (WebCore::isUserInfoChar): Deleted.
1782         (WebCore::isHostnameChar): Deleted.
1783         (WebCore::isIPv6Char): Deleted.
1784         (WebCore::isPathSegmentEndChar): Deleted.
1785         (WebCore::appendASCII): Deleted.
1786         (WebCore::findFirstOf): Deleted.
1787         (WebCore::checkEncodedString): Deleted.
1788         (WebCore::URL::init): Deleted.
1789         (WebCore::appendEscapingBadChars): Deleted.
1790         (WebCore::escapeAndAppendNonHierarchicalPart): Deleted.
1791         (WebCore::copyPathRemovingDots): Deleted.
1792         (WebCore::hasSlashDotOrDotDot): Deleted.
1793         (WebCore::URL::parse): Deleted.
1794         (WebCore::cannotBeABaseURL): Deleted.
1795         (WebCore::isDefaultPortForScheme): Deleted.
1796         (WebCore::hostPortIsEmptyButCredentialsArePresent): Deleted.
1797         (WebCore::isNonFileHierarchicalScheme): Deleted.
1798         (WebCore::isCanonicalHostnameLowercaseForScheme): Deleted.
1799         (WebCore::findHostnamesInMailToURL): Deleted.
1800         (WebCore::findHostnameInHierarchicalURL): Deleted.
1801         (WebCore::encodeHostnames): Deleted.
1802         (WebCore::encodeRelativeString): Deleted.
1803         (WebCore::substituteBackslashes): Deleted.
1804         * platform/URLParser.cpp:
1805         (WebCore::URLParser::URLParser):
1806         (WebCore::URLParser::setEnabled): Deleted.
1807         (WebCore::URLParser::enabled): Deleted.
1808         * platform/URLParser.h:
1809         * platform/cf/URLCF.cpp:
1810         (WebCore::URL::URL):
1811         * platform/mac/URLMac.mm:
1812         (WebCore::URL::URL):
1813
1814 2017-02-16  Anders Carlsson  <andersca@apple.com>
1815
1816         Build fixes.
1817
1818         * page/gtk/EventHandlerGtk.cpp:
1819         (WebCore::EventHandler::createDraggingDataTransfer):
1820         * page/win/EventHandlerWin.cpp:
1821         (WebCore::EventHandler::createDraggingDataTransfer):
1822
1823 2017-02-16  Anders Carlsson  <andersca@apple.com>
1824
1825         Remove EFL from WebCore
1826         https://bugs.webkit.org/show_bug.cgi?id=168477
1827
1828         Reviewed by Brian Burg.
1829
1830         * accessibility/AccessibilityList.cpp:
1831         (WebCore::AccessibilityList::childHasPseudoVisibleListItemMarkers):
1832         * accessibility/AccessibilityNodeObject.cpp:
1833         (WebCore::AccessibilityNodeObject::canSetValueAttribute):
1834         * accessibility/AccessibilityObject.cpp:
1835         (WebCore::AccessibilityObject::AccessibilityObject):
1836         (WebCore::AccessibilityObject::textIteratorBehaviorForTextRange):
1837         * accessibility/AccessibilityObject.h:
1838         * accessibility/AccessibilityRenderObject.cpp:
1839         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
1840         * accessibility/AccessibilityTableColumn.cpp:
1841         (WebCore::AccessibilityTableColumn::computeAccessibilityIsIgnored):
1842         * accessibility/AccessibilityTableHeaderContainer.cpp:
1843         (WebCore::AccessibilityTableHeaderContainer::computeAccessibilityIsIgnored):
1844         * crypto/CryptoKey.cpp:
1845         * crypto/keys/CryptoKeyRSA.h:
1846         * dom/Document.cpp:
1847         (WebCore::Document::implicitClose):
1848         * editing/Editor.cpp:
1849         (WebCore::Editor::performCutOrCopy):
1850         (WebCore::Editor::copyImage):
1851         * editing/Editor.h:
1852         * editing/FrameSelection.h:
1853         * html/HTMLCanvasElement.cpp:
1854         (WebCore::requiresAcceleratedCompositingForWebGL):
1855         * inspector/InspectorFrontendHost.cpp:
1856         (WebCore::InspectorFrontendHost::port):
1857         * loader/HistoryController.cpp:
1858         (WebCore::HistoryController::restoreScrollPositionAndViewState):
1859         * loader/icon/IconDatabase.cpp:
1860         (WebCore::IconDatabase::performURLImport):
1861         * page/ContextMenuController.cpp:
1862         (WebCore::ContextMenuController::contextMenuItemSelected):
1863         (WebCore::ContextMenuController::populate):
1864         (WebCore::ContextMenuController::checkOrEnableIfNeeded):
1865         * page/DragController.cpp:
1866         (WebCore::DragController::startDrag):
1867         * page/EventHandler.cpp:
1868         (WebCore::EventHandler::eventInvertsTabsToLinksClientCallResult):
1869         * page/FrameView.cpp:
1870         (WebCore::FrameView::layout):
1871         * platform/ContextMenuItem.h:
1872         * platform/Cursor.h:
1873         * platform/DragData.h:
1874         * platform/DragImage.h:
1875         * platform/FileSystem.h:
1876         * platform/LocalizedStrings.h:
1877         * platform/MIMETypeRegistry.cpp:
1878         (WebCore::initializeSupportedImageMIMETypesForEncoding):
1879         * platform/NotImplemented.h:
1880         * platform/Pasteboard.h:
1881         * platform/PlatformKeyboardEvent.h:
1882         * platform/PlatformMouseEvent.h:
1883         * platform/PlatformSpeechSynthesizer.h:
1884         * platform/PlatformWheelEvent.h:
1885         * platform/Widget.h:
1886         * platform/graphics/ANGLEWebKitBridge.h:
1887         * platform/graphics/BitmapImage.h:
1888         * platform/graphics/GraphicsContext3D.h:
1889         * platform/graphics/Icon.h:
1890         * platform/graphics/Image.h:
1891         (WebCore::Image::getEvasObject): Deleted.
1892         * platform/graphics/IntPoint.h:
1893         * platform/graphics/IntRect.h:
1894         * platform/graphics/opengl/Extensions3DOpenGL.cpp:
1895         (WebCore::Extensions3DOpenGL::createVertexArrayOES):
1896         (WebCore::Extensions3DOpenGL::deleteVertexArrayOES):
1897         (WebCore::Extensions3DOpenGL::isVertexArrayOES):
1898         (WebCore::Extensions3DOpenGL::bindVertexArrayOES):
1899         (WebCore::Extensions3DOpenGL::supportsExtension):
1900         * platform/graphics/opengl/Extensions3DOpenGL.h:
1901         * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
1902         * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
1903         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
1904         (WebCore::GraphicsContext3D::createForCurrentGLContext):
1905         (WebCore::GraphicsContext3D::reshape):
1906         (WebCore::GraphicsContext3D::createVertexArray):
1907         (WebCore::GraphicsContext3D::deleteVertexArray):
1908         (WebCore::GraphicsContext3D::isVertexArray):
1909         (WebCore::GraphicsContext3D::bindVertexArray):
1910         * platform/graphics/opengl/TemporaryOpenGLSetting.cpp:
1911         * platform/network/NetworkStateNotifier.h:
1912         * platform/posix/FileSystemPOSIX.cpp:
1913         * rendering/RenderLayerCompositor.cpp:
1914         (WebCore::RenderLayerCompositor::ensureRootLayer):
1915         * rendering/RenderText.cpp:
1916         (WebCore::RenderText::previousOffsetForBackwardDeletion):
1917         * xml/XSLStyleSheetLibxslt.cpp:
1918         * xml/XSLTExtensions.cpp:
1919         * xml/XSLTProcessorLibxslt.cpp:
1920         * xml/XSLTUnicodeSort.cpp:
1921
1922 2017-02-16  Zalan Bujtas  <zalan@apple.com>
1923
1924         Simple line layout: Add forced line layout info to coverage print.
1925         https://bugs.webkit.org/show_bug.cgi?id=168470
1926
1927         Reviewed by Simon Fraser.
1928
1929         This is about potential vs. actual coverage:
1930
1931         Simple line layout potential coverage: 65.05%
1932         Simple line layout actual coverage: 46.60%
1933         Forced line layout blocks: 4 content length: 57(18.45%)
1934
1935         Not testable.
1936
1937         * rendering/SimpleLineLayout.cpp:
1938         (WebCore::SimpleLineLayout::printSimpleLineLayoutCoverage):
1939
1940 2017-02-16  Anders Carlsson  <andersca@apple.com>
1941
1942         Rename DataTransfer functions to indicate whether they are for dragging or dropping
1943         https://bugs.webkit.org/show_bug.cgi?id=168478
1944
1945         Reviewed by Tim Horton.
1946
1947         * dom/DataTransfer.cpp:
1948         (WebCore::DataTransfer::createForDrag):
1949         (WebCore::DataTransfer::createForDrop):
1950         (WebCore::DataTransfer::createForDragAndDrop): Deleted.
1951         * dom/DataTransfer.h:
1952         * page/DragController.cpp:
1953         (WebCore::DragController::dragExited):
1954         (WebCore::DragController::performDragOperation):
1955         (WebCore::DragController::tryDHTMLDrag):
1956         * page/mac/EventHandlerMac.mm:
1957         (WebCore::EventHandler::createDraggingDataTransfer):
1958
1959 2017-02-16  Anders Carlsson  <andersca@apple.com>
1960
1961         Rename EventHandler::freeDataTransfer to invalidateDataTransfer
1962         https://bugs.webkit.org/show_bug.cgi?id=168472
1963
1964         Reviewed by Tim Horton.
1965
1966         The code doesn't necessarily free the data transfer object, so rename the member function
1967         to reflect that. Also, get rid of a goto.
1968
1969         * page/EventHandler.cpp:
1970         (WebCore::EventHandler::invalidateDataTransfer):
1971         (WebCore::EventHandler::dragSourceEndedAt):
1972         (WebCore::EventHandler::handleDrag):
1973         (WebCore::EventHandler::freeDataTransfer): Deleted.
1974         * page/EventHandler.h:
1975
1976 2017-02-16  Alex Christensen  <achristensen@webkit.org>
1977
1978         Special URLs without a host are invalid
1979         https://bugs.webkit.org/show_bug.cgi?id=168461
1980
1981         Reviewed by Tim Horton.
1982
1983         http://? should be invalid.  This matches Chrome and the spec and the intent of my implementation
1984         of URLParser which already fails with urls like http:// and this was just an oversight.
1985         Covered by newly passing web platform tests.  Updated API tests.
1986
1987         * platform/URLParser.cpp:
1988         (WebCore::URLParser::parse):
1989
1990 2017-02-16  Zalan Bujtas  <zalan@apple.com>
1991
1992         Simple line layout: Add support for pagination.
1993         https://bugs.webkit.org/show_bug.cgi?id=168355
1994         <rdar://problem/30119769>
1995
1996         Reviewed by David Hyatt.
1997
1998         This patch adds basic support for paginated content including widows and orphans.
1999
2000         This is based on the normal line layout pagination logic. However there are 2 major
2001         advantages here (and they allow us to have a much simpler logic):
2002         1. all the lines are positioned by the time we start paginating them and
2003         2. lines always have uniform heights. 
2004
2005         This is not enabled yet.
2006
2007         * rendering/RenderBlockFlow.h:
2008         * rendering/SimpleLineLayout.cpp:
2009         (WebCore::SimpleLineLayout::computeLineTopAndBottomWithOverflow):
2010         (WebCore::SimpleLineLayout::computeLineBreakIndex):
2011         (WebCore::SimpleLineLayout::setPageBreakForLine):
2012         (WebCore::SimpleLineLayout::computeOffsetAfterLineBreak):
2013         (WebCore::SimpleLineLayout::updateMinimumPageHeight):
2014         (WebCore::SimpleLineLayout::adjustLinePositionsForPagination):
2015         (WebCore::SimpleLineLayout::create):
2016         (WebCore::SimpleLineLayout::Layout::create):
2017         (WebCore::SimpleLineLayout::Layout::Layout):
2018         * rendering/SimpleLineLayout.h:
2019         (WebCore::SimpleLineLayout::Layout::isPaginated):
2020         (WebCore::SimpleLineLayout::Layout::struts):
2021         * rendering/SimpleLineLayoutFunctions.h:
2022         (WebCore::SimpleLineLayout::computeFlowHeight):
2023         * rendering/SimpleLineLayoutResolver.h:
2024         (WebCore::SimpleLineLayout::RunResolver::Run::computeBaselinePosition):
2025
2026 2017-02-11  Filip Pizlo  <fpizlo@apple.com>
2027
2028         The collector thread should only start when the mutator doesn't have heap access
2029         https://bugs.webkit.org/show_bug.cgi?id=167737
2030
2031         Reviewed by Keith Miller.
2032
2033         Added new tests in JSTests and LayoutTests.
2034         
2035         The WebCore changes involve:
2036         
2037         - Refactoring around new header discipline.
2038         
2039         - Adding crazy GC APIs to window.internals to enable us to test the GC's runloop discipline.
2040
2041         * ForwardingHeaders/heap/GCFinalizationCallback.h: Added.
2042         * ForwardingHeaders/heap/IncrementalSweeper.h: Added.
2043         * ForwardingHeaders/heap/MachineStackMarker.h: Added.
2044         * ForwardingHeaders/heap/RunningScope.h: Added.
2045         * bindings/js/CommonVM.cpp:
2046         * testing/Internals.cpp:
2047         (WebCore::Internals::parserMetaData):
2048         (WebCore::Internals::isReadableStreamDisturbed):
2049         (WebCore::Internals::isGCRunning):
2050         (WebCore::Internals::addGCFinalizationCallback):
2051         (WebCore::Internals::stopSweeping):
2052         (WebCore::Internals::startSweeping):
2053         * testing/Internals.h:
2054         * testing/Internals.idl:
2055
2056 2017-02-16  Jiewen Tan  <jiewen_tan@apple.com>
2057
2058         [WebCrypto] remove toJSValueFromJsonWebKey from custom SubtleCrypto binding codes
2059         https://bugs.webkit.org/show_bug.cgi?id=167026
2060
2061         Reviewed by Chris Dumez.
2062
2063         Covered by existing tests.
2064
2065         * bindings/js/JSSubtleCryptoCustom.cpp:
2066         (WebCore::jsSubtleCryptoFunctionExportKeyPromise):
2067         (WebCore::jsSubtleCryptoFunctionWrapKeyPromise):
2068         (WebCore::toJSValueFromJsonWebKey): Deleted.
2069         * crypto/JsonWebKey.h:
2070         * crypto/JsonWebKey.idl:
2071         * crypto/RsaOtherPrimesInfo.idl:
2072         Change std::optional<String> to String in order to use toJS<IDLDictionary<JsonWebKey>>.
2073         * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
2074         (WebCore::CryptoAlgorithmAES_CBC::importKey):
2075         * crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
2076         (WebCore::CryptoAlgorithmAES_KW::importKey):
2077         * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
2078         (WebCore::CryptoAlgorithmHMAC::importKey):
2079         * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
2080         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::importKey):
2081         * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
2082         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey):
2083         * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
2084         (WebCore::CryptoAlgorithmRSA_OAEP::importKey):
2085         * crypto/keys/CryptoKeyAES.cpp:
2086         (WebCore::CryptoKeyAES::importJwk):
2087         Only check if key_ops contains all of the specified usages when key_ops field of jwk is present,
2088         as per the specification: https://www.w3.org/TR/WebCryptoAPI/#aes-cbc-operations
2089         * crypto/keys/CryptoKeyAES.h:
2090         * crypto/keys/CryptoKeyHMAC.cpp:
2091         (WebCore::CryptoKeyHMAC::importJwk):
2092         * crypto/keys/CryptoKeyHMAC.h:
2093         * crypto/keys/CryptoKeyRSA.cpp:
2094         (WebCore::CryptoKeyRSA::importJwk):
2095         Accommodate the change from std::optional<String> to String.
2096         * crypto/mac/CryptoKeyRSAMac.cpp:
2097         (WebCore::CryptoKeyRSA::create):
2098         Add a null check for p.
2099
2100 2017-02-16  Antti Koivisto  <antti@apple.com>
2101
2102         Execute pending scripts asynchronously after stylesheet loads complete
2103         https://bugs.webkit.org/show_bug.cgi?id=168367
2104         rdar://problem/30561379
2105
2106         Reviewed by Andreas Kling.
2107
2108         The current synchronous execution is fragile and creates various problems.
2109
2110         * css/StyleSheetContents.cpp:
2111         (WebCore::StyleSheetContents::checkLoaded):
2112         * dom/ContainerNode.cpp:
2113         (WebCore::ContainerNode::takeAllChildrenFrom):
2114         (WebCore::ContainerNode::notifyChildInserted):
2115         (WebCore::ContainerNode::removeChild):
2116         (WebCore::ContainerNode::parserRemoveChild):
2117         (WebCore::ContainerNode::removeChildren):
2118
2119             Remove various places where we would trigger delayed synchronous execution.
2120
2121         * dom/Document.cpp:
2122         (WebCore::Document::Document):
2123         (WebCore::Document::recalcStyle):
2124
2125             Trigger scroll to anchor at the end of style resolution instead of when style sheet load completes.
2126
2127         (WebCore::Document::didRemoveAllPendingStylesheet):
2128
2129             Call asynchronous script execution function.
2130
2131         * dom/Document.h:
2132         (WebCore::Document::setNeedsNotifyRemoveAllPendingStylesheet): Deleted.
2133         (WebCore::Document::notifyRemovePendingSheetIfNeeded): Deleted.
2134         * dom/ScriptableDocumentParser.cpp:
2135         (WebCore::ScriptableDocumentParser::ScriptableDocumentParser):
2136         (WebCore::ScriptableDocumentParser::executeScriptsWaitingForStylesheetsSoon):
2137         (WebCore::ScriptableDocumentParser::scriptsWaitingForStylesheetsExecutionTimerFired):
2138
2139             Add a timer for executing pending scripts.
2140
2141         (WebCore::ScriptableDocumentParser::detach):
2142         * dom/ScriptableDocumentParser.h:
2143         (WebCore::ScriptableDocumentParser::executeScriptsWaitingForStylesheets):
2144         * html/HTMLLinkElement.cpp:
2145         (WebCore::HTMLLinkElement::removedFrom):
2146         (WebCore::HTMLLinkElement::removePendingSheet):
2147         * html/HTMLLinkElement.h:
2148         * html/parser/HTMLDocumentParser.cpp:
2149         (WebCore::HTMLDocumentParser::detach):
2150         * loader/DocumentLoader.cpp:
2151         (WebCore::DocumentLoader::isLoadingInAPISense):
2152
2153             Stay in loading state if we have a pending script. This matches existing behavior.
2154
2155         * style/StyleScope.cpp:
2156         (WebCore::Style::Scope::removePendingSheet):
2157         * style/StyleScope.h:
2158
2159 2017-02-16  Anders Carlsson  <andersca@apple.com>
2160
2161         Set the DHTML drag image in the DHTML type check
2162         https://bugs.webkit.org/show_bug.cgi?id=168451
2163
2164         Reviewed by Wenson Hsieh.
2165
2166         * page/DragController.cpp:
2167         (WebCore::DragController::startDrag):
2168
2169 2017-02-16  Anders Carlsson  <andersca@apple.com>
2170
2171         Begin removing EFL code from WebCore.
2172
2173         Rubber-stamped by Alex Christensen.
2174
2175         * PlatformEfl.cmake: Removed.
2176         * editing/efl/EditorEfl.cpp: Removed.
2177         * page/efl/DragControllerEfl.cpp: Removed.
2178         * page/efl/EventHandlerEfl.cpp: Removed.
2179         * platform/audio/efl/AudioBusEfl.cpp: Removed.
2180         * platform/efl/CursorEfl.cpp: Removed.
2181         * platform/efl/DefaultTheme/CMakeLists.txt: Removed.
2182         * platform/efl/DefaultTheme/default.edc: Removed.
2183         * platform/efl/DefaultTheme/widget/button/button.edc: Removed.
2184         * platform/efl/DefaultTheme/widget/button/img_button_focus.png: Removed.
2185         * platform/efl/DefaultTheme/widget/button/img_button_hover.png: Removed.
2186         * platform/efl/DefaultTheme/widget/button/img_button_normal.png: Removed.
2187         * platform/efl/DefaultTheme/widget/button/img_button_press.png: Removed.
2188         * platform/efl/DefaultTheme/widget/check/check.edc: Removed.
2189         * platform/efl/DefaultTheme/widget/check/img_check_bg_disabled.png: Removed.
2190         * platform/efl/DefaultTheme/widget/check/img_check_bg_enabled.png: Removed.
2191         * platform/efl/DefaultTheme/widget/check/img_check_off.png: Removed.
2192         * platform/efl/DefaultTheme/widget/check/img_check_off_focus.png: Removed.
2193         * platform/efl/DefaultTheme/widget/check/img_check_off_hover.png: Removed.
2194         * platform/efl/DefaultTheme/widget/check/img_check_on.png: Removed.
2195         * platform/efl/DefaultTheme/widget/check/img_check_on_focus.png: Removed.
2196         * platform/efl/DefaultTheme/widget/check/img_check_on_hover.png: Removed.
2197         * platform/efl/DefaultTheme/widget/combo/combo.edc: Removed.
2198         * platform/efl/DefaultTheme/widget/combo/combo_focus.png: Removed.
2199         * platform/efl/DefaultTheme/widget/combo/combo_focus_button.png: Removed.
2200         * platform/efl/DefaultTheme/widget/combo/combo_focus_button_transparent.png: Removed.
2201         * platform/efl/DefaultTheme/widget/combo/combo_focus_transparent.png: Removed.
2202         * platform/efl/DefaultTheme/widget/combo/combo_hover.png: Removed.
2203         * platform/efl/DefaultTheme/widget/combo/combo_hover_button.png: Removed.
2204         * platform/efl/DefaultTheme/widget/combo/combo_hover_button_transparent.png: Removed.
2205         * platform/efl/DefaultTheme/widget/combo/combo_hover_transparent.png: Removed.
2206         * platform/efl/DefaultTheme/widget/combo/combo_normal.png: Removed.
2207         * platform/efl/DefaultTheme/widget/combo/combo_normal_button.png: Removed.
2208         * platform/efl/DefaultTheme/widget/combo/combo_normal_button_transparent.png: Removed.
2209         * platform/efl/DefaultTheme/widget/combo/combo_normal_transparent.png: Removed.
2210         * platform/efl/DefaultTheme/widget/combo/combo_press.png: Removed.
2211         * platform/efl/DefaultTheme/widget/combo/combo_press_button.png: Removed.
2212         * platform/efl/DefaultTheme/widget/combo/combo_press_button_transparent.png: Removed.
2213         * platform/efl/DefaultTheme/widget/combo/combo_press_transparent.png: Removed.
2214         * platform/efl/DefaultTheme/widget/combo/icon.png: Removed.
2215         * platform/efl/DefaultTheme/widget/entry/entry.edc: Removed.
2216         * platform/efl/DefaultTheme/widget/entry/img_focused.png: Removed.
2217         * platform/efl/DefaultTheme/widget/entry/img_hovered.png: Removed.
2218         * platform/efl/DefaultTheme/widget/entry/img_normal.png: Removed.
2219         * platform/efl/DefaultTheme/widget/progressbar/bt_base.png: Removed.
2220         * platform/efl/DefaultTheme/widget/progressbar/progressbar.edc: Removed.
2221         * platform/efl/DefaultTheme/widget/progressbar/shelf_inset.png: Removed.
2222         * platform/efl/DefaultTheme/widget/radio/img_radio_bg_disabled.png: Removed.
2223         * platform/efl/DefaultTheme/widget/radio/img_radio_bg_enabled.png: Removed.
2224         * platform/efl/DefaultTheme/widget/radio/img_radio_off.png: Removed.
2225         * platform/efl/DefaultTheme/widget/radio/img_radio_off_focus.png: Removed.
2226         * platform/efl/DefaultTheme/widget/radio/img_radio_off_hover.png: Removed.
2227         * platform/efl/DefaultTheme/widget/radio/img_radio_on.png: Removed.
2228         * platform/efl/DefaultTheme/widget/radio/img_radio_on_focus.png: Removed.
2229         * platform/efl/DefaultTheme/widget/radio/img_radio_on_hover.png: Removed.
2230         * platform/efl/DefaultTheme/widget/radio/radio.edc: Removed.
2231         * platform/efl/DefaultTheme/widget/scrollbar/scrollbar.edc: Removed.
2232         * platform/efl/DefaultTheme/widget/scrollbar/scrollbar_bg_horizontal.png: Removed.
2233         * platform/efl/DefaultTheme/widget/scrollbar/scrollbar_bg_vertical.png: Removed.
2234         * platform/efl/DefaultTheme/widget/scrollbar/scrollbar_thumb_horizontal.png: Removed.
2235         * platform/efl/DefaultTheme/widget/scrollbar/scrollbar_thumb_vertical.png: Removed.
2236         * platform/efl/DefaultTheme/widget/search/cancel/cancel_normal_button.png: Removed.
2237         * platform/efl/DefaultTheme/widget/search/cancel/cancel_normal_button2.png: Removed.
2238         * platform/efl/DefaultTheme/widget/search/cancel/search_cancel.edc: Removed.
2239         * platform/efl/DefaultTheme/widget/search/decoration/decoration_normal_button.png: Removed.
2240         * platform/efl/DefaultTheme/widget/search/decoration/search_decoration.edc: Removed.
2241         * platform/efl/DefaultTheme/widget/search/field/field_focused.png: Removed.
2242         * platform/efl/DefaultTheme/widget/search/field/field_hovered.png: Removed.
2243         * platform/efl/DefaultTheme/widget/search/field/field_normal.png: Removed.
2244         * platform/efl/DefaultTheme/widget/search/field/search_field.edc: Removed.
2245         * platform/efl/DefaultTheme/widget/slider/slider.edc: Removed.
2246         * platform/efl/DefaultTheme/widget/slider/slider_fill_h.png: Removed.
2247         * platform/efl/DefaultTheme/widget/slider/slider_fill_v.png: Removed.
2248         * platform/efl/DefaultTheme/widget/slider/slider_h.png: Removed.
2249         * platform/efl/DefaultTheme/widget/slider/slider_thumb_h.png: Removed.
2250         * platform/efl/DefaultTheme/widget/slider/slider_thumb_press_h.png: Removed.
2251         * platform/efl/DefaultTheme/widget/slider/slider_thumb_press_v.png: Removed.
2252         * platform/efl/DefaultTheme/widget/slider/slider_thumb_v.png: Removed.
2253         * platform/efl/DefaultTheme/widget/slider/slider_v.png: Removed.
2254         * platform/efl/DefaultTheme/widget/spinner/sp_bg.png: Removed.
2255         * platform/efl/DefaultTheme/widget/spinner/sp_down_default.png: Removed.
2256         * platform/efl/DefaultTheme/widget/spinner/sp_down_hover.png: Removed.
2257         * platform/efl/DefaultTheme/widget/spinner/sp_down_pressed.png: Removed.
2258         * platform/efl/DefaultTheme/widget/spinner/sp_up_default.png: Removed.
2259         * platform/efl/DefaultTheme/widget/spinner/sp_up_hover.png: Removed.
2260         * platform/efl/DefaultTheme/widget/spinner/sp_up_pressed.png: Removed.
2261         * platform/efl/DefaultTheme/widget/spinner/spinner.edc: Removed.
2262         * platform/efl/DragDataEfl.cpp: Removed.
2263         * platform/efl/DragImageEfl.cpp: Removed.
2264         * platform/efl/EflInspectorUtilities.cpp: Removed.
2265         * platform/efl/EflInspectorUtilities.h: Removed.
2266         * platform/efl/EflKeyboardUtilities.cpp: Removed.
2267         * platform/efl/EflKeyboardUtilities.h: Removed.
2268         * platform/efl/EflScreenUtilities.cpp: Removed.
2269         * platform/efl/EflScreenUtilities.h: Removed.
2270         * platform/efl/ErrorsEfl.cpp: Removed.
2271         * platform/efl/ErrorsEfl.h: Removed.
2272         * platform/efl/EventLoopEfl.cpp: Removed.
2273         * platform/efl/FileSystemEfl.cpp: Removed.
2274         * platform/efl/LocalizedStringsEfl.cpp: Removed.
2275         * platform/efl/MIMETypeRegistryEfl.cpp: Removed.
2276         * platform/efl/MainThreadSharedTimerEfl.cpp: Removed.
2277         * platform/efl/PasteboardEfl.cpp: Removed.
2278         * platform/efl/PlatformKeyboardEventEfl.cpp: Removed.
2279         * platform/efl/PlatformMouseEventEfl.cpp: Removed.
2280         * platform/efl/PlatformScreenEfl.cpp: Removed.
2281         * platform/efl/PlatformSpeechSynthesisProviderEfl.cpp: Removed.
2282         * platform/efl/PlatformSpeechSynthesisProviderEfl.h: Removed.
2283         * platform/efl/PlatformSpeechSynthesizerEfl.cpp: Removed.
2284         * platform/efl/PlatformWheelEventEfl.cpp: Removed.
2285         * platform/efl/ScrollbarThemeEfl.cpp: Removed.
2286         * platform/efl/ScrollbarThemeEfl.h: Removed.
2287         * platform/efl/SoundEfl.cpp: Removed.
2288         * platform/efl/TemporaryLinkStubs.cpp: Removed.
2289         * platform/efl/UserAgentEfl.cpp: Removed.
2290         * platform/efl/WidgetEfl.cpp: Removed.
2291         * platform/gamepad/efl/GamepadsEfl.cpp: Removed.
2292         * platform/graphics/efl/CairoUtilitiesEfl.cpp: Removed.
2293         * platform/graphics/efl/CairoUtilitiesEfl.h: Removed.
2294         * platform/graphics/efl/EvasGLContext.cpp: Removed.
2295         * platform/graphics/efl/EvasGLContext.h: Removed.
2296         * platform/graphics/efl/EvasGLSurface.cpp: Removed.
2297         * platform/graphics/efl/EvasGLSurface.h: Removed.
2298         * platform/graphics/efl/GraphicsContext3DEfl.cpp: Removed.
2299         * platform/graphics/efl/GraphicsContext3DPrivate.cpp: Removed.
2300         * platform/graphics/efl/GraphicsContext3DPrivate.h: Removed.
2301         * platform/graphics/efl/IconEfl.cpp: Removed.
2302         * platform/graphics/efl/ImageBufferEfl.cpp: Removed.
2303         * platform/graphics/efl/ImageEfl.cpp: Removed.
2304         * platform/graphics/efl/IntPointEfl.cpp: Removed.
2305         * platform/graphics/efl/IntRectEfl.cpp: Removed.
2306         * platform/graphics/surfaces/efl/GraphicsSurfaceCommon.cpp: Removed.
2307         * platform/network/efl/NetworkStateNotifierEfl.cpp: Removed.
2308         * rendering/RenderThemeEfl.cpp: Removed.
2309         * rendering/RenderThemeEfl.h: Removed.
2310
2311 2017-02-16  Joseph Pecoraro  <pecoraro@apple.com>
2312
2313         [Resource Timing] Support Resource Timing in Workers
2314         https://bugs.webkit.org/show_bug.cgi?id=168086
2315         <rdar://problem/30430117>
2316
2317         Reviewed by Alex Christensen.
2318
2319         Worker's load resources through the Document that loaded them. However,
2320         their PerformanceResourceTiming entries should be added to the Performance
2321         object inside the Worker context, not the Document's context.
2322
2323         This change adds an InitiatorContext to ResourceLoadOptions so that loaders
2324         can determine if the load was initiated by the Document or a Worker. This
2325         allows loaders to then know if the ResourceTiming data they collect should
2326         be added to the Document's Performance object or forwarded on to the Worker's.
2327
2328         This adds a new ThreadableLoaderClient method intended only for the purpose
2329         of adding the ResourceTiming information to the Worker's Performance object.
2330         Unlike other ThreadableLoaderClient methods that are bridged and forwarded
2331         on to a client inside the worker (e.g. XMLHttpRequest or FetchLoader) this
2332         method never needs to be handled by clients and can be uniformly handled by
2333         the WorkerThreadableLoader itself.
2334
2335         We also add a new ResourceTiming object that encapsulates all of the data
2336         ultimately needed for a PerformanceResourceTimingEntry object. This allows
2337         for all of the information to be gathered while loading on the Document
2338         before serializing across to the Worker. That includes the Timing-Allow-Origin
2339         check which uses the SecurityOrigin of the Worker.
2340
2341         This also modernizes and addresses issues in the Resource Timing implementation.
2342         Better handling cases like loading from the Cache, Synchronous Loads, and
2343         improving initiatorType information.
2344
2345         Tests: imported/w3c/web-platform-tests/resource-timing/rt-cors.html
2346                imported/w3c/web-platform-tests/resource-timing/rt-cors.worker.html
2347                imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-css.html
2348                imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-element.html
2349                imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-fetch.html
2350                imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-media.html
2351                imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-other.html
2352                imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-script-module.html
2353                imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-xmlhttprequest.html
2354                imported/w3c/web-platform-tests/resource-timing/rt-initiatorType.worker.html
2355                imported/w3c/web-platform-tests/resource-timing/rt-performance-extensions.html
2356                imported/w3c/web-platform-tests/resource-timing/rt-performance-extensions.worker.html
2357                imported/w3c/web-platform-tests/resource-timing/rt-resource-errors.html
2358                imported/w3c/web-platform-tests/resource-timing/rt-resource-ignored.html
2359                imported/w3c/web-platform-tests/resource-timing/rt-resources-per-frame.html
2360                imported/w3c/web-platform-tests/resource-timing/rt-resources-per-worker.html
2361                imported/w3c/web-platform-tests/resource-timing/rt-serialization.html
2362                imported/w3c/web-platform-tests/resource-timing/rt-shared-resource-in-frames.html
2363                imported/w3c/web-platform-tests/resource-timing/rt-shared-resource-in-workers.html
2364                performance-api/resource-timing-apis.html
2365
2366         * CMakeLists.txt:
2367         * WebCore.xcodeproj/project.pbxproj:
2368         New files.
2369
2370         * platform/network/NetworkLoadTiming.h:
2371         (WebCore::NetworkLoadTiming::reset): Deleted.
2372         We no longer need to reset.
2373
2374         * loader/ResourceTiming.cpp: Added.
2375         (WebCore::passesTimingAllowCheck):
2376         (WebCore::ResourceTiming::fromCache):
2377         (WebCore::ResourceTiming::fromLoad):
2378         (WebCore::ResourceTiming::fromSynchronousLoad):
2379         (WebCore::ResourceTiming::ResourceTiming):
2380         (WebCore::ResourceTiming::isolatedCopy):
2381         * loader/ResourceTiming.h: Added.
2382         (WebCore::ResourceTiming::url):
2383         (WebCore::ResourceTiming::initiator):
2384         (WebCore::ResourceTiming::loadTiming):
2385         (WebCore::ResourceTiming::networkLoadTiming):
2386         (WebCore::ResourceTiming::allowTimingDetails):
2387         (WebCore::ResourceTiming::overrideInitiatorName):
2388         (WebCore::ResourceTiming::ResourceTiming):
2389         Class that encapsulates all of the data needed for a PerformanceResourceTiming entry.
2390         There are three static constructors indicating the different ways this object can
2391         be constructed and the different data available at the time of construction.
2392
2393         * loader/ResourceLoaderOptions.h:
2394         Add the new InitiatorContext, default to Document.
2395
2396         * loader/ThreadableLoaderClient.h:
2397         (WebCore::ThreadableLoaderClient::didFinishTiming):
2398         New client method only used by WorkerThreadableLoader.
2399
2400         * loader/WorkerThreadableLoader.h:
2401         * loader/WorkerThreadableLoader.cpp:
2402         (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge):
2403         (WebCore::WorkerThreadableLoader::MainThreadBridge::didFinishTiming):
2404         All loads initiated in a WorkerThreadableLoader get identified as InitiatorContext::Worker.
2405         Add timing information to the Performance object when received. No need to inform clients.
2406
2407         * loader/DocumentThreadableLoader.h:
2408         * loader/DocumentThreadableLoader.cpp:
2409         (WebCore::DocumentThreadableLoader::finishedTimingForWorkerLoad):
2410         (WebCore::DocumentThreadableLoader::loadRequest):
2411         Provide APIs to pass timing data on to a WorkerThreadableLoader.
2412         Create ResourceTiming data for synchronous loads.
2413
2414         * loader/LoadTiming.h:
2415         * loader/LoadTiming.cpp:
2416         (WebCore::LoadTiming::isolatedCopy):
2417         Add isolatedCopy to allow this data to be passed across to a Worker.
2418
2419         * loader/ResourceTimingInformation.h:
2420         * loader/ResourceTimingInformation.cpp:
2421         (WebCore::ResourceTimingInformation::shouldAddResourceTiming):
2422         (WebCore::ResourceTimingInformation::addResourceTiming):
2423         (WebCore::ResourceTimingInformation::storeResourceTimingInitiatorInformation):
2424         Refactor to remove unused / unnecessary bits. Extract out some helpful code.
2425         Changed this to match when Blink decides when to add or ignore entries, however
2426         this may change over time.
2427
2428         * loader/SubresourceLoader.cpp:
2429         (WebCore::SubresourceLoader::didFinishLoading):
2430         (WebCore::SubresourceLoader::notifyDone):
2431         (WebCore::SubresourceLoader::reportResourceTiming):
2432         * loader/SubresourceLoader.h:
2433         * loader/cache/CachedRawResource.cpp:
2434         (WebCore::CachedRawResource::finishedTimingForWorkerLoad):
2435         * loader/cache/CachedRawResource.h:
2436         * loader/cache/CachedRawResourceClient.h:
2437         (WebCore::CachedRawResourceClient::finishedTimingForWorkerLoad):
2438         Plumbing to report timing information to Worker if this resource was loaded for a Worker.
2439
2440         * loader/cache/CachedResource.cpp:
2441         (WebCore::CachedResource::CachedResource):
2442         * loader/cache/CachedResource.h:
2443         (WebCore::CachedResource::initiatorName):
2444         Store the initiator name on the CachedResource like other data added to the original
2445         CachedResourceRequest. This is a bit of a hack but follows an existing pattern, and
2446         cleans up other hacks that worked around this later on.
2447
2448         * loader/cache/CachedResourceLoader.h:
2449         * loader/cache/CachedResourceLoader.cpp:
2450         (WebCore::CachedResourceLoader::requestResource):
2451         (WebCore::CachedResourceLoader::revalidateResource):
2452         (WebCore::CachedResourceLoader::loadResource):
2453         Simply the creation of a ResourceTiming object for cache hits.
2454         Report timing information to Worker if this resource was loaded for a Worker.
2455
2456         (WebCore::CachedResourceLoader::loadDone):
2457         Eliminate this redundant point attempting to add a ResourceTiming entry.
2458
2459         * loader/cache/CachedResourceRequest.cpp:
2460         (WebCore::CachedResourceRequest::initiatorName):
2461         Update to match the spec. The fallback is "other".
2462
2463         * page/Performance.h:
2464         * page/Performance.cpp:
2465         (WebCore::Performance::setResourceTimingBufferSize):
2466         (WebCore::Performance::addResourceTiming):
2467         Update to support PerformanceObservers.
2468         Update to match spec (event should bubble).
2469
2470         * page/PerformanceResourceTiming.h:
2471         * page/PerformanceResourceTiming.cpp:
2472         (WebCore::PerformanceResourceTiming::create):
2473         (WebCore::PerformanceResourceTiming::PerformanceResourceTiming):
2474         (WebCore::PerformanceResourceTiming::fetchStart):
2475         (WebCore::PerformanceResourceTiming::domainLookupStart):
2476         (WebCore::PerformanceResourceTiming::domainLookupEnd):
2477         (WebCore::PerformanceResourceTiming::connectStart):
2478         (WebCore::PerformanceResourceTiming::connectEnd):
2479         (WebCore::PerformanceResourceTiming::secureConnectionStart):
2480         (WebCore::PerformanceResourceTiming::requestStart):
2481         (WebCore::PerformanceResourceTiming::responseStart):
2482         (WebCore::PerformanceResourceTiming::responseEnd):
2483         (WebCore::PerformanceResourceTiming::networkLoadTimeToDOMHighResTimeStamp):
2484         Construct with a ResourceTiming object containing all the data we need for the entry.
2485         Update to match spec for what is required, should fallback, should be zero, etc.
2486
2487         (WebCore::passesTimingAllowCheck): Deleted.
2488         Extracted this to ResourceTiming creation time in the loading context,
2489         since this can't be determined on the Worker context without also having
2490         all of the header information from each resource response.
2491
2492         * page/PerformanceResourceTiming.idl:
2493         Expose to Workers!
2494
2495 2017-02-16  Yusuke Suzuki  <utatane.tea@gmail.com>
2496
2497         [JSC] Drop PassRefPtr in inspector/
2498         https://bugs.webkit.org/show_bug.cgi?id=168420
2499
2500         Reviewed by Alex Christensen.
2501
2502         Use Ref<Inspector::ScriptArguments> and Ref<ScriptCallStack> as much as possible.
2503         It drops some unnecessary null checks.
2504
2505         * bindings/scripts/CodeGeneratorJS.pm:
2506         (GenerateCallWith):
2507         * bindings/scripts/test/JS/JSTestObj.cpp:
2508         (WebCore::jsTestObjPrototypeFunctionWithScriptArgumentsAndCallStackCaller):
2509         * dom/ScriptExecutionContext.cpp:
2510         (WebCore::ScriptExecutionContext::PendingException::PendingException):
2511         * inspector/InspectorInstrumentation.cpp:
2512         (WebCore::InspectorInstrumentation::consoleCountImpl):
2513         (WebCore::InspectorInstrumentation::stopConsoleTimingImpl):
2514         (WebCore::InspectorInstrumentation::consoleTimeStampImpl):
2515         * inspector/InspectorInstrumentation.h:
2516         (WebCore::InspectorInstrumentation::consoleCount):
2517         (WebCore::InspectorInstrumentation::stopConsoleTiming):
2518         (WebCore::InspectorInstrumentation::consoleTimeStamp):
2519         * inspector/InspectorNetworkAgent.cpp:
2520         (WebCore::InspectorNetworkAgent::buildInitiatorObject):
2521         * inspector/TimelineRecordFactory.cpp:
2522         (WebCore::TimelineRecordFactory::createGenericRecord):
2523         * inspector/WebInjectedScriptManager.cpp:
2524         (WebCore::WebInjectedScriptManager::WebInjectedScriptManager):
2525         * inspector/WebInjectedScriptManager.h:
2526         * page/DOMWindow.cpp:
2527         (WebCore::DOMWindow::postMessageTimerFired):
2528         We dispatch appropriate addMessage function according to whether
2529         `timer.stackTrace()` is nullptr.
2530
2531         * page/PageConsoleClient.cpp:
2532         (WebCore::PageConsoleClient::addMessage):
2533         (WebCore::PageConsoleClient::messageWithTypeAndLevel):
2534         (WebCore::PageConsoleClient::count):
2535         (WebCore::PageConsoleClient::timeEnd):
2536         (WebCore::PageConsoleClient::timeStamp):
2537         * page/PageConsoleClient.h:
2538         * workers/WorkerConsoleClient.cpp:
2539         (WebCore::WorkerConsoleClient::messageWithTypeAndLevel):
2540         (WebCore::WorkerConsoleClient::count):
2541         (WebCore::WorkerConsoleClient::timeEnd):
2542         (WebCore::WorkerConsoleClient::timeStamp):
2543         * workers/WorkerConsoleClient.h:
2544         * workers/WorkerGlobalScope.cpp:
2545         (WebCore::WorkerGlobalScope::addMessage):
2546
2547 2017-02-16  Chris Fleizach  <cfleizach@apple.com>
2548
2549         AX: Make form validation accessible on iOS
2550         https://bugs.webkit.org/show_bug.cgi?id=168400
2551
2552         Reviewed by Chris Dumez.
2553
2554         Hide the popover content of form validation from accessibility (since its not interactable)
2555         and instead announce the message.
2556
2557         * platform/ios/ValidationBubbleIOS.mm:
2558         (WebCore::ValidationBubble::show):
2559
2560 2017-02-16  Simon Fraser  <simon.fraser@apple.com>
2561
2562         Clean up use of some CALayer-related SPI
2563         https://bugs.webkit.org/show_bug.cgi?id=168401
2564
2565         Reviewed by Tim Horton.
2566
2567         Use -setDrawsAsynchronously: rather than the old -setAcceleratesDrawing: SPI.
2568
2569         Remove CATiledLayer-related stuff from QuartzCoreSPI.h, since we don't use it any more.
2570
2571         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
2572         (PlatformCALayerCocoa::acceleratesDrawing):
2573         (PlatformCALayerCocoa::setAcceleratesDrawing):
2574         * platform/graphics/ca/cocoa/WebTiledBackingLayer.mm:
2575         (-[WebTiledBackingLayer setDrawsAsynchronously:]): This override passes the state
2576         onto the TileController.
2577         (-[WebTiledBackingLayer setAcceleratesDrawing:]): Deleted.
2578         * platform/ios/LegacyTileGridTile.mm:
2579         (WebCore::LegacyTileGridTile::LegacyTileGridTile):
2580         * platform/spi/cocoa/QuartzCoreSPI.h:
2581
2582 2017-02-16  Yusuke Suzuki  <utatane.tea@gmail.com>
2583
2584         Web Inspector: allow import() inside the inspector
2585         https://bugs.webkit.org/show_bug.cgi?id=167457
2586
2587         Reviewed by Ryosuke Niwa.
2588
2589         When evaluating `import("...")`, we need the caller's context to resolve
2590         the module specifier correctly. For example, if `import("./cocoa.js")` is
2591         evaluated in the script "drinks/hot.js", this module name is resolved to
2592         "drinks/cocoa.js". If the same import operator is evaluated in the script
2593         "menu/all.js", the module specifier becomes "menu/cocoa.js".
2594
2595         Previously we reject the import operator if the caller does not have such
2596         a context. These context is SourceOrigin and its ScriptFetcher. While they
2597         are offered in the script tag and other code evaluations, the inspector
2598         console does not offer that. These class are offered in the WebCore side
2599         and we should not touch these classes in the JSC's inspector code.
2600
2601         Now we relax the above restriction. If the above caller information is not
2602         offered, we fallback to the default one. In the web page, we use the page's
2603         URL as the caller's source origin. This allows us to evaluate the import
2604         operator in the inspector console.
2605
2606         And as of r167698, the console recognizes `await import("...")` form. We use
2607         this to test this `import()` in the console functionality.
2608
2609         Test: inspector/controller/runtime-controller-import.html
2610
2611         * bindings/js/ScriptModuleLoader.cpp:
2612         (WebCore::ScriptModuleLoader::importModule):
2613
2614 2017-02-16  Miguel Gomez  <magomez@igalia.com>
2615
2616         [GTK] scroll with transparent background not repainted after scrollY >= 32768
2617         https://bugs.webkit.org/show_bug.cgi?id=154283
2618
2619         Reviewed by Carlos Garcia Campos.
2620
2621         Due to a limitation of the pixman backend, which uses 16 bits to hold signed integers, cairo is
2622         not able to draw anything when using transformation matrices with values bigger than 32768. When
2623         drawing patterns into large pages, the matrices values can overflow those 16 bits, so cairo doesn't
2624         draw anything in, which causes the reported transparent backgrounds.
2625
2626         The patch modifies the transformation matrices both from the current context and the pattern we
2627         are painting, to avoid them to hold values that cannot stored in 16 bits.
2628
2629         There's still the possibility that this happens, but it would require using a pattern with a size
2630         bigger than 32768.
2631
2632         Based on a previous patch by Gwang Yoon Hwang  <yoon@igalia.com>.
2633
2634         Test: fast/backgrounds/background-repeat-long-scroll.html
2635
2636         * platform/graphics/cairo/CairoUtilities.cpp:
2637         (WebCore::drawPatternToCairoContext):
2638
2639 2017-02-16  Carlos Garcia Campos  <cgarcia@igalia.com>
2640
2641         [GTK] Images are never read from the clipboard
2642         https://bugs.webkit.org/show_bug.cgi?id=168419
2643
2644         Reviewed by Sergio Villar Senin.
2645
2646         We write images in the clipboard, but we don't read them.
2647
2648         Fixes: editing/pasteboard/paste-image-using-image-data.html
2649
2650         * editing/Editor.cpp:
2651         (WebCore::Editor::createFragmentForImageAndURL): Moved from EditorMac.mm since it's cross-platform code.
2652         * editing/Editor.h:
2653         * editing/gtk/EditorGtk.cpp:
2654         (WebCore::createFragmentFromPasteboardData): Check if there's an image in the selection, and use
2655         Editor::createFragmentForImageAndURL in that case.
2656         * editing/mac/EditorMac.mm:
2657         (WebCore::Editor::createFragmentForImageAndURL): Deleted.
2658         * platform/gtk/PasteboardHelper.cpp:
2659         (WebCore::PasteboardHelper::getClipboardContents): Check also if there's an image in the clipboard.
2660
2661 2017-02-15  Jer Noble  <jer.noble@apple.com>
2662
2663         REGRESSION (r212311): NULL-dereference in HTMLMediaElement::prepareToPlay()
2664         https://bugs.webkit.org/show_bug.cgi?id=168404
2665         <rdar://problem/30547188>
2666
2667         Reviewed by Brian Weinstein.
2668
2669         Prior to r212311, m_player was always guaranteed to be initialized when calling
2670         prepareToPlay(). r212311 began calling prepareToPlay() on a subsequent run-loop iteration
2671         after creating m_player. So now check whether m_player is NULL before calling methods on it.
2672
2673         * html/HTMLMediaElement.cpp:
2674         (WebCore::HTMLMediaElement::prepareToPlay):
2675
2676 2017-02-15  Eric Carlson  <eric.carlson@apple.com>
2677
2678         [MediaStream] delete CaptureDeviceInfo struct
2679         https://bugs.webkit.org/show_bug.cgi?id=168395
2680
2681         The CaptureDeviceInfo struct and CaptureDevice class were almost identical, so
2682         add an "enabled" field to the later, delete the former, and switch all uses of
2683         CaptureDeviceInfo to CaptureDevice.
2684
2685         Do some minor drive-by cleanup of AVCaptureDeviceManager::refreshCaptureDevices
2686         and CaptureDeviceManager::captureDeviceFromDeviceID.
2687         
2688         Reviewed by Sam Weinig.
2689
2690         No new tests, no behavior change.
2691
2692         * Modules/mediastream/MediaDevicesRequest.cpp:
2693         (WebCore::MediaDevicesRequest::start): SourceKind -> DeviceType
2694         * platform/mediastream/CaptureDevice.h:
2695         (WebCore::CaptureDevice::CaptureDevice):
2696         (WebCore::CaptureDevice::type): Renamed from kind.
2697         (WebCore::CaptureDevice::setType):
2698         (WebCore::CaptureDevice::enabled): Added.
2699         (WebCore::CaptureDevice::setEnabled):
2700         (WebCore::CaptureDevice::kind): Deleted.
2701         (WebCore::CaptureDevice::setKind): Deleted.
2702
2703         * platform/mediastream/CaptureDeviceManager.cpp:
2704         (CaptureDeviceManager::getSourcesInfo):
2705         (CaptureDeviceManager::captureDeviceFromDeviceID): Don't call sourceWithUID.
2706         (CaptureDeviceManager::bestSourcesForTypeAndConstraints):
2707         (CaptureDeviceManager::sourceWithUID):
2708         * platform/mediastream/CaptureDeviceManager.h:
2709         (WebCore::CaptureDeviceManager::refreshCaptureDevices):
2710         (WebCore::CaptureDeviceManager::refreshCaptureDeviceList): Deleted.
2711
2712         * platform/mediastream/mac/AVCaptureDeviceManager.h:
2713         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
2714         (WebCore::AVCaptureDeviceManager::captureDevices):
2715         (WebCore::deviceIsAvailable):
2716         (WebCore::AVCaptureDeviceManager::refreshCaptureDevices):
2717         (WebCore::AVCaptureDeviceManager::createMediaSourceForCaptureDeviceWithConstraints):
2718         (WebCore::AVCaptureDeviceManager::deviceConnected):
2719         (WebCore::AVCaptureDeviceManager::deviceDisconnected):
2720         (WebCore::AVCaptureDeviceManager::captureDeviceList): Deleted.
2721         (WebCore::shouldConsiderDeviceInDeviceList): Deleted.
2722         (WebCore::AVCaptureDeviceManager::refreshCaptureDeviceList): Deleted.
2723         * platform/mock/MockRealtimeMediaSource.cpp:
2724         (WebCore::MockRealtimeMediaSource::audioDeviceInfo):
2725         (WebCore::MockRealtimeMediaSource::videoDeviceInfo):
2726
2727 2017-02-15  Sam Weinig  <sam@webkit.org>
2728
2729         [WebIDL] Remove custom conversion from FontFace code by using a Variant
2730         https://bugs.webkit.org/show_bug.cgi?id=168384
2731
2732         Reviewed by Alex Christensen.
2733
2734         Match the font face spec and use a union rather than any in the FontFace constructor.
2735
2736         Test: Added additional cases to fast/text/font-face-javascript.html.
2737
2738         * css/FontFace.cpp:
2739         (WebCore::FontFace::create):
2740         * css/FontFace.h:
2741         * css/FontFace.idl:
2742
2743 2017-02-15  Jer Noble  <jer.noble@apple.com>
2744
2745         Disabled Media Sources should render black/silence
2746         https://bugs.webkit.org/show_bug.cgi?id=168281
2747
2748         Reviewed by Eric Carlson.
2749
2750         Test: webrtc/video-disabled-black.html
2751
2752         Pass the enabled flag setting down from the MediaStreamTrackPrivate to its underlying
2753         source, including RealtimeMediaSource and RealtimeOutgoingAudio/VideoSource. When either
2754         enabled is cleared or muted is set, generate empty (black or silent) media, as opposed to
2755         pausing media or (worse) continuing to send generated media.
2756
2757         * platform/mediastream/MediaStreamTrackPrivate.cpp:
2758         (WebCore::MediaStreamTrackPrivate::setEnabled):
2759         (WebCore::MediaStreamTrackPrivate::sourceEnabledChanged):
2760         * platform/mediastream/MediaStreamTrackPrivate.h:
2761         * platform/mediastream/RealtimeMediaSource.cpp:
2762         (WebCore::RealtimeMediaSource::setEnabled):
2763         * platform/mediastream/RealtimeMediaSource.h:
2764         (WebCore::RealtimeMediaSource::enabled):
2765         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.h:
2766         * platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
2767         (WebCore::MockRealtimeAudioSourceMac::render):
2768         * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
2769         (WebCore::RealtimeOutgoingAudioSource::sourceMutedChanged):
2770         (WebCore::RealtimeOutgoingAudioSource::sourceEnabledChanged):
2771         (WebCore::RealtimeOutgoingAudioSource::pullAudioData):
2772         * platform/mediastream/mac/RealtimeOutgoingAudioSource.h:
2773         * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:
2774         (WebCore::RealtimeOutgoingVideoSource::sourceMutedChanged):
2775         (WebCore::RealtimeOutgoingVideoSource::sourceEnabledChanged):
2776         (WebCore::RealtimeOutgoingVideoSource::videoSampleAvailable):
2777         * platform/mediastream/mac/RealtimeOutgoingVideoSource.h:
2778         * platform/mock/MockRealtimeVideoSource.cpp:
2779         (WebCore::MockRealtimeVideoSource::generateFrame):
2780
2781 2017-02-15  Wenson Hsieh  <wenson_hsieh@apple.com>
2782
2783         Editing history scripts should not add the contenteditable attribute or override key events
2784         https://bugs.webkit.org/show_bug.cgi?id=168389
2785         <rdar://problem/30529945>
2786
2787         Reviewed by Dan Bernstein.
2788
2789         Clients that hook into editing history tracking should handle setting the contenteditable attribute on the body
2790         rather than have the script add it to the body. Additionally, this script should NOT be overriding any keydown
2791         events. These were initially added for compatibility with a test harness early on, and should have been removed
2792         earlier.
2793
2794         * Scripts/DumpEditingHistory.js:
2795
2796 2017-02-15  Jer Noble  <jer.noble@apple.com>
2797
2798         Pass "RequiresCustomURLLoading" in AVURLAsset options dictionary
2799         https://bugs.webkit.org/show_bug.cgi?id=168381
2800
2801         Reviewed by Eric Carlson.
2802
2803         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2804         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL):
2805
2806 2017-02-15  Anders Carlsson  <andersca@apple.com>
2807
2808         Fix build.
2809
2810         * page/DragController.cpp:
2811         (WebCore::DragController::doSystemDrag):
2812
2813 2017-02-15  Anders Carlsson  <andersca@apple.com>
2814
2815         Modernize DragClient::startDrag somewhat
2816         https://bugs.webkit.org/show_bug.cgi?id=168379
2817
2818         Reviewed by Tim Horton.
2819
2820         Change DragClient::startDrag to take a DragImage instead of a DragImageRef, and to pass along the source action
2821         instead of whether it's a link or not.
2822
2823         * loader/EmptyClients.cpp:
2824         * page/DragClient.h:
2825         * page/DragController.cpp:
2826         (WebCore::DragController::startDrag):
2827         (WebCore::DragController::doImageDrag):
2828         (WebCore::DragController::doSystemDrag):
2829         * page/DragController.h:
2830
2831 2017-02-15  Chris Dumez  <cdumez@apple.com>
2832
2833         Expose Symbol.toPrimitive / valueOf on Location instances
2834         https://bugs.webkit.org/show_bug.cgi?id=168295
2835
2836         Reviewed by Geoffrey Garen, Keith Miller and Mark Lam.
2837
2838         Expose Symbol.toPrimitive / valueOf on Location instances as per:
2839         - https://html.spec.whatwg.org/#the-location-interface
2840
2841         Firefox and Chrome already comply with the specification.
2842
2843         Tests: fast/dom/location-valueOf-after-object-prototype-update.html
2844                fast/dom/location-valueOf-after-object-prototype-update2.html
2845                imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-symbol-toprimitive.html
2846                imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-valueof.html
2847
2848         * bindings/scripts/CodeGeneratorJS.pm:
2849         (GenerateImplementation):
2850
2851 2017-02-15  Aakash Jain  <aakash_jain@apple.com>
2852
2853         Remove WebIOSEvent interface
2854         https://bugs.webkit.org/show_bug.cgi?id=168368
2855
2856         Reviewed by Tim Horton.
2857
2858         * platform/ios/WebEvent.h: Removed WebIOSEvent.
2859
2860 2017-02-15  Chris Dumez  <cdumez@apple.com>
2861
2862         [iOS] Form Validation Bubble should be sensitive to Dynamic Type
2863         https://bugs.webkit.org/show_bug.cgi?id=168291
2864         <rdar://problem/30508593>
2865
2866         Reviewed by Tim Horton.
2867
2868         Update ValidationBubble implementation on iOS to stop obeying the
2869         minimum font size setting, given that this setting is not exposed
2870         on iOS. Instead, we now rely on
2871         [UIFont preferredFontForTextStyle:UIFontTextStyleCallout], which
2872         will give us a font whose size obeys Dynamic Type [1] setting on iOS.
2873
2874         [1] https://developer.apple.com/ios/human-interface-guidelines/visual-design/typography/
2875
2876         No new tests, no easily testable.
2877
2878         * platform/ios/ValidationBubbleIOS.mm:
2879         (WebCore::ValidationBubble::ValidationBubble):
2880
2881 2017-02-15  Yusuke Suzuki  <utatane.tea@gmail.com>
2882
2883         [JSC] Drop PassRefPtr
2884         https://bugs.webkit.org/show_bug.cgi?id=168320
2885
2886         Reviewed by Saam Barati.
2887
2888         * bindings/js/ScriptSourceCode.h:
2889         (WebCore::ScriptSourceCode::ScriptSourceCode):
2890         Use Ref and pass it to SourceCode.
2891
2892         * replay/ReplayController.cpp:
2893         (WebCore::ReplayController::frameNavigated):
2894         Pass reference.
2895
2896 2017-02-15  Xabier Rodriguez Calvar  <calvaris@igalia.com>
2897
2898         [GStreamer][MSE][EME] Handle protection event also at decryptor level
2899         https://bugs.webkit.org/show_bug.cgi?id=168316
2900
2901         Reviewed by Žan Doberšek.
2902
2903         So far in MSE pipeline we were handling the encryption events
2904         only when they arrived at the demuxer but this won't work in any
2905         kind of key renegotiation as the event will never arrive. Now we
2906         connect to the element messages, check for the drm id and send it
2907         to the private player for processing.
2908
2909         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
2910         (WebCore::appendPipelineElementMessageCallback):
2911         (WebCore::AppendPipeline::AppendPipeline):
2912         (WebCore::AppendPipeline::handleElementMessage):
2913         * platform/graphics/gstreamer/mse/AppendPipeline.h:
2914
2915 2017-02-15  Zan Dobersek  <zdobersek@igalia.com>
2916
2917         [EME] MediaKeys::setServerCertificate() must resolve with 'false' when certificates aren't supported
2918         https://bugs.webkit.org/show_bug.cgi?id=168362
2919
2920         Reviewed by Xabier Rodriguez-Calvar.
2921
2922         In MediaKeys::setServerCertificate(), when the CDM implementation
2923         doesn't support server certificates, it should resolve the promise
2924         with the 'false' value, as mandated by the specification, and not
2925         reject it.
2926
2927         A test case in mock-MediaKeys-setServerCertificate.html is updated.
2928
2929         * Modules/encryptedmedia/MediaKeys.cpp:
2930         (WebCore::MediaKeys::setServerCertificate):
2931
2932 2017-02-15  Carlos Garcia Campos  <cgarcia@igalia.com>
2933
2934         REGRESSION (r206014): HTTPHeaderMap does not consistently use comma without space to separate values of header fields
2935         https://bugs.webkit.org/show_bug.cgi?id=168115
2936
2937         Reviewed by Darin Adler.
2938
2939         In r206014 HTTPHeaderMap::add() was updated to combine common headers with ',' instead of ", " to match the
2940         fetch specification, but the uncommon headers are still combined with ", ".
2941
2942         * platform/network/HTTPHeaderMap.cpp:
2943         (WebCore::HTTPHeaderMap::add):
2944
2945 2017-02-14  Ryosuke Niwa  <rniwa@webkit.org>
2946
2947         An assertion failure inside removeChildren
2948         https://bugs.webkit.org/show_bug.cgi?id=168069
2949
2950         Reviewed by Brent Fulgham.
2951
2952         The bug was caused by notifyRemovePendingSheet executing scripts synchronously where it shouldn't.
2953
2954         Removed the call to notifyRemovePendingSheetIfNeeded in notifyChildNodeRemoved. Instead, invoke it
2955         in its call sites when they're safe.
2956
2957         Test: http/tests/security/move-iframe-within-focus-handler-inside-removal.html
2958
2959         * dom/ContainerNode.cpp:
2960         (WebCore::ContainerNode::takeAllChildrenFrom):
2961         (WebCore::ContainerNode::notifyChildInserted):
2962         (WebCore::ContainerNode::removeChild):
2963         (WebCore::ContainerNode::parserRemoveChild):
2964         (WebCore::ContainerNode::replaceAllChildren):
2965         (WebCore::ContainerNode::removeChildren):
2966         * dom/ContainerNodeAlgorithms.cpp:
2967         (WebCore::notifyChildNodeRemoved):
2968
2969 2017-02-15  Carlos Garcia Campos  <cgarcia@igalia.com>
2970
2971         [GStreamer] Several tests are timing out after r212349
2972         https://bugs.webkit.org/show_bug.cgi?id=168359
2973
2974         Reviewed by Žan Doberšek.
2975
2976         This is because they are failing the cross origin check. Those tests are not using WebKitWebSrc, but
2977         GstFileSrc. I didn't consider the case of source not being a WebKitWebSrc.
2978
2979         Fixes several timeout instroduced in r212349.
2980
2981         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2982         (WebCore::MediaPlayerPrivateGStreamer::hasSingleSecurityOrigin): Split the source check in two. First check if
2983         it's nullptr, and return false. Then check if it's a WebKitWebSrc and return true if it isn't.
2984
2985 2017-02-14  Brent Fulgham  <bfulgham@apple.com>
2986
2987         Revalidate URL after events that could trigger navigations
2988         https://bugs.webkit.org/show_bug.cgi?id=168071
2989         <rdar://problem/30450379>
2990
2991         Reviewed by Ryosuke Niwa.
2992
2993         When arbitary javascript runs during a load, we should revalidate
2994         the URLs involved to make sure they are still valid.
2995
2996         Tests: http/tests/plugins/navigation-during-load-embed.html
2997                http/tests/plugins/navigation-during-load.html
2998
2999         * html/HTMLEmbedElement.cpp:
3000         (WebCore::HTMLEmbedElement::updateWidget): Confirm we are still allowed to
3001         load the URL after executing JS callbacks.
3002         * html/HTMLFrameElementBase.cpp:
3003         (WebCore::HTMLFrameElementBase::isURLAllowed): Split existing function into
3004         existing protected method, and a new public method that checks a passed URL
3005         for validity.
3006         * html/HTMLFrameElementBase.h:
3007         * html/HTMLFrameOwnerElement.h:
3008         (WebCore::HTMLFrameOwnerElement::isURLAllowed):
3009         * html/HTMLObjectElement.cpp:
3010         (WebCore::HTMLObjectElement::updateWidget): Confirm we are still allowed to
3011         load the URL after executing JS callbacks.
3012         * loader/SubframeLoader.cpp:
3013         (WebCore::SubframeLoader::requestFrame): Ditto.
3014
3015 2017-02-14  Carlos Garcia Campos  <cgarcia@igalia.com>
3016
3017         [GStreamer] Implement MediaPlayerPrivate::hasSingleSecurityOrigin()
3018         https://bugs.webkit.org/show_bug.cgi?id=168322
3019
3020         Reviewed by Žan Doberšek.
3021
3022         It currently returns true unconditionally. Add resolved-location property to WebKitWebSourceGStreamer to track
3023         the resolved url returned by the server and use that from MediaPlayerPrivate to check if there was a cross
3024         origin redirection.
3025
3026         Fixes: http/tests/security/canvas-remote-read-remote-video-redirect.html
3027
3028         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3029         (WebCore::MediaPlayerPrivateGStreamer::hasSingleSecurityOrigin):
3030         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
3031         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
3032         (webKitWebSrcFinalize):
3033         (webKitWebSrcGetProperty):
3034         (webKitWebSrcStart):
3035         (webKitWebSrcQueryWithParent):
3036         (webKitWebSrcGetUri):
3037         (webKitWebSrcSetUri):
3038         (StreamingClient::handleResponseReceived):
3039         (ResourceHandleStreamingClient::wasBlocked):
3040         (ResourceHandleStreamingClient::cannotShowURL):
3041
3042 2017-02-14  Carlos Garcia Campos  <cgarcia@igalia.com>
3043
3044         Unreviewed, rolling out r211967.
3045
3046         Caused rendering issues in HiDPI
3047
3048         Reverted changeset:
3049
3050         "[GTK] scroll with transparent background not repainted after
3051         scrollY >= 32768"
3052         https://bugs.webkit.org/show_bug.cgi?id=154283
3053         http://trac.webkit.org/changeset/211967
3054
3055 2017-02-14  Carlos Garcia Campos  <cgarcia@igalia.com>
3056
3057         [GTK] Update cookie manager API to properly work with ephemeral sessions
3058         https://bugs.webkit.org/show_bug.cgi?id=168230
3059
3060         Reviewed by Michael Catanzaro.
3061
3062         Add implementation for deleteAllCookiesModifiedSince. Note that this only works when the timespan is 0, we need
3063         new libsoup API to support removing recently modified cookies.
3064
3065         * platform/network/soup/CookieJarSoup.cpp:
3066         (WebCore::deleteAllCookiesModifiedSince):
3067
3068 2017-02-14  Joseph Pecoraro  <pecoraro@apple.com>
3069
3070         [WebIDL] Improve serializer = { inherit }
3071         https://bugs.webkit.org/show_bug.cgi?id=168293
3072
3073         Reviewed by Youenn Fablet.
3074
3075         * bindings/scripts/CodeGeneratorJS.pm:
3076         (GenerateHeader):
3077         Expose a serialize() method on the interface.
3078
3079         (GenerateSerializerFunction):
3080         (GenerateSerializerAttributesForInterface): Deleted.
3081         Subclasses that have `serializer = { inherit }` can use
3082         their parent's serialize() method to get the initial object.
3083         We can now collapse everything back into a single function
3084         because we only generate code for our own attributes.
3085
3086         * bindings/scripts/test/JS/JSTestNode.cpp:
3087         (WebCore::JSTestNode::serialize):
3088         (WebCore::jsTestNodePrototypeFunctionToJSONCaller):
3089         * bindings/scripts/test/JS/JSTestNode.h:
3090         * bindings/scripts/test/JS/JSTestObj.cpp:
3091         (WebCore::JSTestObj::serialize):
3092         (WebCore::jsTestObjPrototypeFunctionToJSONCaller):
3093         * bindings/scripts/test/JS/JSTestObj.h:
3094         * bindings/scripts/test/JS/JSTestSerialization.cpp:
3095         (WebCore::JSTestSerialization::serialize):
3096         (WebCore::jsTestSerializationPrototypeFunctionToJSONCaller):
3097         * bindings/scripts/test/JS/JSTestSerialization.h:
3098         * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
3099         (WebCore::JSTestSerializationInherit::serialize):
3100         (WebCore::jsTestSerializationInheritPrototypeFunctionToJSONCaller):
3101         * bindings/scripts/test/JS/JSTestSerializationInherit.h:
3102         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
3103         (WebCore::JSTestSerializationInheritFinal::serialize):
3104         (WebCore::jsTestSerializationInheritFinalPrototypeFunctionToJSONCaller):
3105         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.h:
3106         Updated results.
3107
3108 2017-02-14  Aakash Jain  <aakash_jain@apple.com>
3109
3110         Move methods from WebCoreThread.h to WebCoreThreadInternal.h
3111         https://bugs.webkit.org/show_bug.cgi?id=168326
3112
3113         Reviewed by Alexey Proskuryakov.
3114
3115         * platform/ios/wak/WebCoreThread.h: Move methods WebThreadRunLoop and WebThreadCurrentContext to WebCoreThreadInternal.h
3116         * platform/ios/wak/WebCoreThreadInternal.h: Ditto.
3117         * platform/ios/wak/WebCoreThreadRun.cpp: Removed WebCoreThread.h as it is already included by WebCoreThreadInternal.h
3118         * platform/ios/wak/WKGraphics.mm: Included WebCoreThreadInternal.h, it subsequently includes WebCoreThread.h
3119         * inspector/InspectorTimelineAgent.cpp: Ditto.
3120         * page/mac/PageMac.mm: Ditto.
3121         * platform/cf/MainThreadSharedTimerCF.cpp: Ditto.
3122         * platform/cocoa/MemoryPressureHandlerCocoa.mm: Ditto.
3123         * platform/graphics/ca/cocoa/LayerFlushSchedulerMac.cpp: Ditto.
3124         * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp: Ditto.
3125         * bindings/js/CommonVM.cpp: included WebCoreThreadInternal.h
3126
3127 2017-02-14  Wenson Hsieh  <wenson_hsieh@apple.com>
3128
3129         [WK2] Support data interaction on links
3130         https://bugs.webkit.org/show_bug.cgi?id=168331
3131         <rdar://problem/30200837>
3132
3133         Reviewed by Tim Horton.
3134
3135         Adds support for data interaction on links at the WebCore layer, refactoring some drag-and-drop code on the Mac
3136         along the way. Also adds two new TestWebKitAPI unit tests in DataInteractionTests.mm: LinkToInput and
3137         BackgroundImageLinkToInput (see Tools/ChangeLog for more information).
3138
3139         * page/DragController.cpp:
3140         (WebCore::DragController::startDrag):
3141         (WebCore::DragController::doImageDrag):
3142         (WebCore::DragController::doSystemDrag):
3143
3144         Introduce platformAdjustDragImageForDeviceScaleFactor, and special-case drag images for links to anchor at the
3145         bottom center.
3146
3147         * platform/DragImage.cpp:
3148         (WebCore::platformAdjustDragImageForDeviceScaleFactor):
3149
3150         Scale the drag image up by the device scale factor. In WebDragClient, we scale the image back down to the
3151         original size. It seems the reason we do this extra dance is because the image sizing heuristic in between
3152         assumes that the image dimensions are for a non-retina device, but this work should really not be necessary if
3153         we tweak the heuristic to account for deviceScaleFactor. We should address this in a separate patch.
3154
3155         * platform/DragImage.h:
3156         * platform/graphics/Path.h:
3157
3158 2017-02-14  Basuke Suzuki  <Basuke.Suzuki@am.sony.com>
3159
3160         [CURL] ResourceError created with error information should have default type Type::General
3161         https://bugs.webkit.org/show_bug.cgi?id=168345
3162
3163         Reviewed by Alex Christensen.
3164
3165         ResourceError has separate implementaion for each platform
3166         so that the interface should be same.
3167         On CURL port, the constructor with error information has
3168         different default value on `type` parameter. It is Type::Null but other implementaitons have Type::General.
3169         This causes some ResourceError is created inconsistent. 
3170
3171         * platform/network/curl/ResourceError.h:
3172         (WebCore::ResourceError::ResourceError):
3173
3174 2017-02-14  Youenn Fablet  <youennf@gmail.com>
3175
3176         [WebRTC] Add support for libwebrtc negotiation needed event
3177         https://bugs.webkit.org/show_bug.cgi?id=168267
3178
3179         Reviewed by Eric Carlson.
3180
3181         Test: webrtc/negotiatedneeded-event-addStream.html
3182
3183         Moving generic code (markAsNeedingNegotiation) from MediaEndpointPeerConnection to PeerConnectionBackend.
3184         This code handles the control of sending or not the negotiationneeded event.
3185
3186         Updating mock to use markAsNeedingNegotiation when streams are changed.
3187         Updating libwebrtc backend to call markAsNeedingNegotiation when required by libwebrtc implementation.
3188
3189         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
3190         (WebCore::MediaEndpointPeerConnection::setLocalDescriptionTask):
3191         * Modules/mediastream/MediaEndpointPeerConnection.h:
3192         * Modules/mediastream/PeerConnectionBackend.cpp:
3193         (WebCore::PeerConnectionBackend::markAsNeedingNegotiation):
3194         * Modules/mediastream/PeerConnectionBackend.h:
3195         (WebCore::PeerConnectionBackend::isNegotiationNeeded):
3196         (WebCore::PeerConnectionBackend::clearNegotiationNeededState):
3197         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
3198         (WebCore::LibWebRTCMediaEndpoint::OnRenegotiationNeeded):
3199         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
3200         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
3201         * testing/MockLibWebRTCPeerConnection.cpp:
3202         (WebCore::MockLibWebRTCPeerConnection::AddStream):
3203         (WebCore::MockLibWebRTCPeerConnection::RemoveStream):
3204
3205 2017-02-14  Brady Eidson  <beidson@apple.com>
3206
3207         Unreviewed followup to r212330 to fix Debug builds
3208
3209         * loader/DocumentThreadableLoader.cpp:
3210         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader): Add call to relaxAdoptionRequirement().
3211
3212 2017-02-14  Matt Rajca  <mrajca@apple.com>
3213
3214         Website policies: iframes should respect the autoplay policy of the top-level document
3215         https://bugs.webkit.org/show_bug.cgi?id=168333
3216
3217         Reviewed by Alex Christensen.
3218
3219         API tests were added.
3220
3221         * html/HTMLMediaElement.cpp:
3222         (WebCore::HTMLMediaElement::HTMLMediaElement):
3223
3224 2017-02-14  Dean Jackson  <dino@apple.com>
3225
3226         Rename preferLowPowerWebGLRendering setting to forceWebGLUsesLowPower
3227         https://bugs.webkit.org/show_bug.cgi?id=168339
3228         <rdar://problem/30522092>
3229
3230         Reviewed by Simon Fraser.
3231
3232         Use a setting name that more clearly reflects what it is doing. It's not
3233         preferring to use the low-power GPU, it's forcing it.
3234
3235         * html/canvas/WebGLRenderingContextBase.cpp:
3236         (WebCore::WebGLRenderingContextBase::create):
3237         * page/Settings.in:
3238
3239 2017-02-14  Brady Eidson  <beidson@apple.com>
3240
3241         Speculative fix for: Crash in DocumentThreadableLoader::redirectReceived.
3242         <rdar://problem/29899473> and https://bugs.webkit.org/show_bug.cgi?id=168337
3243
3244         Reviewed by Geoffrey Garen.
3245
3246         No new tests (Unable to find a reproduction).
3247
3248         * loader/DocumentThreadableLoader.cpp:
3249         (WebCore::DocumentThreadableLoader::loadRequest):
3250
3251 2017-02-14  Youenn Fablet  <youenn@apple.com>
3252
3253         [WebRTC] Remove obsolete WebRTC stats API
3254         https://bugs.webkit.org/show_bug.cgi?id=167910
3255
3256         Reviewed by Alex Christensen.
3257
3258         No change of behavior as removed constructs are not functional.
3259         Removing RTCStatsResponse which no longer exists and made RTCStatsReport an empty container for now.
3260
3261         * CMakeLists.txt:
3262         * DerivedSources.cpp:
3263         * DerivedSources.make:
3264         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
3265         (WebCore::MediaEndpointPeerConnection::getStats):
3266         * Modules/mediastream/MediaEndpointPeerConnection.h:
3267         * Modules/mediastream/PeerConnectionBackend.h:
3268         * Modules/mediastream/RTCPeerConnection.cpp:
3269         (WebCore::RTCPeerConnection::getStats):
3270         * Modules/mediastream/RTCStatsReport.cpp:
3271         (WebCore::RTCStatsReport::create): Deleted.
3272         (WebCore::RTCStatsReport::RTCStatsReport): Deleted.
3273         (WebCore::RTCStatsReport::names): Deleted.
3274         (WebCore::RTCStatsReport::local): Deleted.
3275         (WebCore::RTCStatsReport::remote): Deleted.
3276         (WebCore::RTCStatsReport::addStatistic): Deleted.
3277         * Modules/mediastream/RTCStatsReport.h:
3278         (WebCore::RTCStatsReport::create):
3279         (WebCore::RTCStatsReport::timestamp): Deleted.
3280         (WebCore::RTCStatsReport::id): Deleted.
3281         (WebCore::RTCStatsReport::type): Deleted.
3282         (WebCore::RTCStatsReport::stat): Deleted.
3283         * Modules/mediastream/RTCStatsReport.idl:
3284         * Modules/mediastream/RTCStatsResponse.cpp: Removed.
3285         * Modules/mediastream/RTCStatsResponse.h: Removed.
3286         * Modules/mediastream/RTCStatsResponse.idl: Removed.
3287         * WebCore.xcodeproj/project.pbxproj:
3288         * platform/mediastream/MediaEndpoint.h:
3289         (WebCore::MediaEndpoint::getStats):
3290         * platform/mediastream/RTCStatsRequest.h: Removed.
3291         * platform/mediastream/RTCStatsResponseBase.h: Removed.
3292
3293 2017-02-14  Karim H  <karim@karhm.com>
3294
3295         Removed unused methods of WebCore::FileStream
3296         https://bugs.webkit.org/show_bug.cgi?id=168025
3297
3298         Reviewed by Michael Catanzaro.
3299
3300         * fileapi/AsyncFileStream.cpp:
3301         (WebCore::AsyncFileStream::openForWrite): Deleted.
3302         (WebCore::AsyncFileStream::write): Deleted.
3303         (WebCore::AsyncFileStream::truncate): Deleted.
3304         * fileapi/AsyncFileStream.h:
3305         * platform/FileStream.cpp:
3306         (WebCore::FileStream::openForWrite): Deleted.
3307         (WebCore::FileStream::write): Deleted.
3308         (WebCore::FileStream::truncate): Deleted.
3309         * platform/FileStream.h:
3310
3311 2017-02-14  Chris Dumez  <cdumez@apple.com>
3312
3313         HTML Form Validation bubble should take minimum font size setting into consideration
3314         https://bugs.webkit.org/show_bug.cgi?id=168271
3315         <rdar://problem/29869869>
3316
3317         Reviewed by Simon Fraser.
3318
3319         HTML Form Validation bubble should take minimum font size setting into consideration
3320         for better accessibility.
3321
3322         Test: fast/forms/validation-message-minimum-font-size.html
3323
3324         * platform/ValidationBubble.h:
3325         (WebCore::ValidationBubble::create):
3326         (WebCore::ValidationBubble::fontSize):
3327         * platform/ios/ValidationBubbleIOS.mm:
3328         (WebCore::ValidationBubble::ValidationBubble):
3329         * platform/mac/ValidationBubbleMac.mm:
3330         (WebCore::ValidationBubble::ValidationBubble):
3331         Update the ValidationBubble constructor to take in Settings. For now, there is a
3332         single setting that is the minimum font size and that is taken into account when
3333         setting the font size of the validation bubble text.
3334
3335 2017-02-14  Eric Carlson  <eric.carlson@apple.com>
3336
3337         [MediaStream] add navigator.getUserMedia for compatibility with legacy content
3338         https://bugs.webkit.org/show_bug.cgi?id=168324
3339         <rdar://problem/30513125>
3340
3341         Reviewed by Youenn Fablet.
3342
3343         Tests: fast/mediastream/argument-types.html
3344                fast/mediastream/getusermedia.html
3345                fast/mediastream/webkitGetUserMedia-shadowing-then.html
3346
3347         * CMakeLists.txt:
3348         * DerivedSources.cpp:
3349         * DerivedSources.make:
3350         * Modules/mediastream/MediaDevices.idl:
3351         * Modules/mediastream/NavigatorUserMedia.idl: Added.
3352         * Modules/mediastream/NavigatorUserMedia.js: Added.
3353         * WebCore.xcodeproj/project.pbxproj:
3354         * bindings/js/WebCoreBuiltinNames.h:
3355         * page/Navigator.idl:
3356
3357 2017-02-14  Chris Dumez  <cdumez@apple.com>
3358
3359         Fallback to legacy type only when event is trusted
3360         https://bugs.webkit.org/show_bug.cgi?id=168301
3361
3362         Reviewed by Ryosuke Niwa.
3363
3364         Fallback to legacy type only when event is trusted as per a recent
3365         DOM specification change:
3366         - https://github.com/whatwg/dom/issues/404
3367         - https://github.com/whatwg/dom/pull/406
3368
3369         No new tests, rebaselined existing test.
3370
3371         * dom/EventTarget.cpp:
3372         (WebCore::legacyType):
3373         (WebCore::EventTarget::fireEventListeners):
3374
3375 2017-02-13  Dean Jackson  <dino@apple.com>
3376
3377         Rename preferLowPowerToHighPerformance to powerPreference
3378         https://bugs.webkit.org/show_bug.cgi?id=168269
3379         <rdar://problem/30504444>
3380
3381         Reviewed by Chris Dumez.
3382
3383         Based on the discussion in https://github.com/KhronosGroup/WebGL/pull/2283.
3384
3385         Change WebGLContextAttributes's preferLowPowerToHighPerformance boolean
3386         into a powerPreference enum taking three values. The implementation
3387         of the enum is in GraphicsContext3DAttributes.
3388
3389         While the name and values have changed, there should be no change in
3390         behaviour caused by this patch.
3391
3392         * html/canvas/WebGLContextAttributes.h: Use GraphicsContext3DAttributes
3393         enum GraphicsContext3DPowerPreference.
3394         * html/canvas/WebGLContextAttributes.idl: Rename and add the WebIDL enum.
3395         * html/canvas/WebGLRenderingContextBase.cpp: Use the new values.
3396         (WebCore::WebGLRenderingContextBase::create):
3397         (WebCore::WebGLRenderingContextBase::registerWithWebGLStateTracker):
3398         * platform/WebGLStateTracker.cpp:
3399         * platform/WebGLStateTracker.h: Update the state tracker to use the new
3400         values.
3401         * platform/graphics/GraphicsContext3DAttributes.h:
3402         * platform/graphics/mac/GraphicsContext3DMac.mm:
3403         (WebCore::setPixelFormat): Accept GraphicsContext3DPowerPreference as a parameter.
3404         (WebCore::GraphicsContext3D::GraphicsContext3D):
3405
3406 2017-02-14  Youenn Fablet  <youennf@gmail.com>
3407
3408         [WebRTC] Implement description getters for libwebrtc RTCPeerConnection
3409         https://bugs.webkit.org/show_bug.cgi?id=168234
3410
3411         Reviewed by Alex Christensen.
3412
3413         Allows passing W3C webrtc tests.
3414
3415         Implementing localDescription/remoteDescription using libwebrtc backend.
3416         current and pending description getters are made the same as local/remote getters for the moment.
3417         This should be fixed when upgrading to latest libwebrtc revision.
3418
3419         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
3420         (WebCore::toSessionDescriptionType):
3421         (WebCore::fromSessionDescriptionType):
3422         (WebCore::fromSessionDescription):
3423         (WebCore::LibWebRTCMediaEndpoint::localDescription):
3424         (WebCore::LibWebRTCMediaEndpoint::remoteDescription):
3425         (WebCore::LibWebRTCMediaEndpoint::doSetLocalDescription):
3426         (WebCore::LibWebRTCMediaEndpoint::doSetRemoteDescription):
3427         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
3428         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
3429         (WebCore::LibWebRTCPeerConnectionBackend::localDescription):
3430         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
3431
3432 2017-02-14  Jeremy Jones  <jeremyj@apple.com>
3433
3434         When playing inline after fullscreen, set a flag instead of adding attribute plays inline, and use in requiresFullscreenForVideoPlayback.
3435         https://bugs.webkit.org/show_bug.cgi?id=167815
3436         rdar://problem/27685077
3437
3438         Reviewed by Jer Noble.
3439
3440         Test: media/media-fullscreen-loop-inline.html
3441
3442         When video is allowed to play inline after fullscreen. Looped video causes play state to update, which can send video back to fullscreen when
3443         allowsInline is false. This change will set a new flag when allowsInlineMediaPlaybackAfterFullscreen allows inline playback that can be tested
3444         in requiresFullscreenForVideoPlayback to prevent sending video back into fullscreen when video loops.
3445
3446         * html/HTMLMediaElement.cpp:
3447         (WebCore::HTMLMediaElement::enterFullscreen):
3448         (WebCore::HTMLMediaElement::exitFullscreen):
3449         * html/HTMLMediaElement.h:
3450         (WebCore::HTMLMediaElement::isTemporarilyAllowingInlinePlaybackAfterFullscreen): Added.
3451         * html/MediaElementSession.cpp:
3452         (WebCore::MediaElementSession::requiresFullscreenForVideoPlayback):
3453
3454 2017-02-14  Jer Noble  <jer.noble@apple.com>
3455
3456         Video elements with MediaSource objects set by srcObject are not cleared when srcObject is set to null
3457         https://bugs.webkit.org/show_bug.cgi?id=168268
3458
3459         Reviewed by Eric Carlson.
3460
3461         Test: fast/mediastream/MediaStream-MediaElement-setObject-null.html
3462
3463         Make the setSrcObject() operation compliant with the HTML spec. Since the specification defines
3464         srcObject in terms of either a MediaSource, MediaStream, or Blob object, add the variant typedef
3465         to HTMLMediaElement and move the definition out of the Modules/mediastream extension IDL and into
3466         HTMLMediaElement.idl. Then bring the "media elements load" and "resource selection" algorithms up
3467         to their most recent definitions in the HTML5 spec.
3468
3469         Drive-by fix: Allow the (admittedly weird) single-element-union type in IDL.
3470
3471         * CMakeLists.txt:
3472         * DerivedSources.cpp:
3473         * DerivedSources.make:
3474         * Modules/mediastream/HTMLMediaElementMediaStream.cpp: Removed.
3475         * Modules/mediastream/HTMLMediaElementMediaStream.h: Removed.
3476         * Modules/mediastream/HTMLMediaElementMediaStream.idl: Removed.
3477         * WebCore.xcodeproj/project.pbxproj:
3478         * bindings/scripts/IDLParser.pm:
3479         (parseUnionType):
3480         * html/HTMLAudioElement.cpp:
3481         (WebCore::HTMLAudioElement::createForJSConstructor):
3482         * html/HTMLMediaElement.cpp:
3483         (WebCore::actionName):
3484         (WebCore::HTMLMediaElement::parseAttribute):
3485         (WebCore::HTMLMediaElement::insertedInto):
3486         (WebCore::HTMLMediaElement::scheduleDelayedAction):
3487         (WebCore::HTMLMediaElement::scheduleNextSourceChild):
3488         (WebCore::HTMLMediaElement::pendingActionTimerFired):
3489         (WebCore::HTMLMediaElement::setSrcObject):
3490         (WebCore::HTMLMediaElement::load):
3491         (WebCore::HTMLMediaElement::prepareForLoad):
3492         (WebCore::HTMLMediaElement::selectMediaResource):
3493         (WebCore::HTMLMediaElement::loadResource):
3494         (WebCore::HTMLMediaElement::playInternal):
3495         (WebCore::HTMLMediaElement::pauseInternal):
3496         (WebCore::HTMLMediaElement::sourceWasAdded):
3497         (WebCore::HTMLMediaElement::clearMediaPlayer):
3498         (WebCore::HTMLMediaElement::resume):
3499         (WebCore::HTMLMediaElement::mediaCanStart):
3500         (WebCore::HTMLMediaElement::createMediaPlayer):
3501         (WebCore::HTMLMediaElement::loadInternal): Deleted.
3502         * html/HTMLMediaElement.h:
3503         (WebCore::HTMLMediaElement::srcObject):
3504         * html/HTMLMediaElement.idl:
3505         * platform/ContentType.h:
3506
3507 2017-02-14  Aakash Jain  <aakash_jain@apple.com>
3508
3509         Remove unused WebThreadContextIsCurrent method from WebCoreThread.h
3510         https://bugs.webkit.org/show_bug.cgi?id=168254
3511
3512         Reviewed by Dan Bernstein.
3513
3514         * platform/ios/wak/WebCoreThread.h: Removed unused WebThreadContextIsCurrent.
3515         * platform/ios/wak/WebCoreThread.mm:
3516         (WebThreadContextIsCurrent): Deleted.
3517
3518 2017-02-14  Alexey Proskuryakov  <ap@apple.com>
3519
3520         WebCore shouldn't export SystemMemory.h
3521         https://bugs.webkit.org/show_bug.cgi?id=168285
3522
3523         Reviewed by Alex Christensen.
3524
3525         * WebCore.xcodeproj/project.pbxproj:
3526
3527 2017-02-13  Filip Pizlo  <fpizlo@apple.com>
3528
3529         worker.postMessage should throw a TypeError if a SharedArrayBuffer is in the transfer list
3530         https://bugs.webkit.org/show_bug.cgi?id=168277
3531
3532         Reviewed by Mark Lam.
3533
3534         Test: workers/sab/postMessage-transfer-type-error.html
3535         
3536         This is a simple spec compliance change. The title says it all.
3537
3538         * bindings/js/SerializedScriptValue.cpp:
3539         (WebCore::SerializedScriptValue::create):
3540
3541 2017-02-14  Zan Dobersek  <zdobersek@igalia.com>
3542
3543         HTMLMediaElement: WebKitMediaKeys member name should be prefixed
3544         https://bugs.webkit.org/show_bug.cgi?id=168297
3545
3546         Reviewed by Xabier Rodriguez-Calvar.
3547
3548         Rename the LEGACY_ENCRYPTED_MEDIA m_mediaKeys variable to m_webkitMediaKeys
3549         so that it contains the legacy prefix, just like the API. This will make
3550         room for the MediaKeys member variable that will be implemented under
3551         the ENCRYPTED_MEDIA guards.
3552
3553         * html/HTMLMediaElement.cpp:
3554         (WebCore::HTMLMediaElement::mediaPlayerCachedKeyForKeyId):
3555         (WebCore::HTMLMediaElement::webkitSetMediaKeys):
3556         * html/HTMLMediaElement.h:
3557         (WebCore::HTMLMediaElement::webkitKeys):
3558
3559 2017-02-14  Carlos Garcia Campos  <cgarcia@igalia.com>
3560
3561         [GTK] Make DragImageRef a RefPtr instead of a plain pointer
3562         https://bugs.webkit.org/show_bug.cgi?id=168296
3563
3564         Reviewed by Sergio Villar Senin.
3565
3566         Use RefPtr<cairo_surface_t> as DragImageRef for GTK+ port to avoid memory leaks.
3567
3568         * platform/DragImage.h:
3569         * platform/gtk/DragImageGtk.cpp:
3570         (WebCore::dragImageSize):
3571         (WebCore::deleteDragImage):
3572         (WebCore::scaleDragImage):
3573         (WebCore::dissolveDragImageToFraction):
3574         (WebCore::createDragImageFromImage):
3575         (WebCore::createDragImageIconForCachedImageFilename):
3576
3577 2017-02-14  Vanessa Chipirrás Navalón  <vchipirras@igalia.com>
3578
3579         [GStreamer][MSE] Some GStreamer log messages are generated with the 'default' category
3580         https://bugs.webkit.org/show_bug.cgi?id=168015
3581
3582         Reviewed by Xabier Rodriguez-Calvar.
3583
3584         The elements AppendPipeline, PlaybackPipeline, MediaSourceClientGstreamerMSE do not have
3585         a defined Gstreamer log category, then the webkitmse category has been added to them.
3586         WebKitMediaSourceGstreamer has its own category but was not declared at the beginning of
3587         the .cpp file.
3588
3589         * platform/graphics/gstreamer/mse/AppendPipeline.cpp: Added webkitmse category.
3590         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
3591         Added webkitmse category and gst header.
3592         * platform/graphics/gstreamer/mse/PlaybackPipeline.cpp: Added webkitmse category.
3593         * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:
3594         Added webkitmediasrc category.
3595
3596 2017-02-14  Carlos Garcia Campos  <cgarcia@igalia.com>
3597
3598         CookieManager only works with the default session
3599         https://bugs.webkit.org/show_bug.cgi?id=168229
3600
3601         Reviewed by Alex Christensen.
3602
3603         Update cookie observer API to use a std::function instead of a function pointer and make it work with multiple
3604         sessions in the backends that support it.
3605
3606         * platform/network/CookieStorage.h:
3607         * platform/network/cf/CookieStorageCFNet.cpp:
3608         (WebCore::cookieChangeCallbackMap):
3609         (WebCore::notifyCookiesChanged):
3610         (WebCore::startObservingCookieChanges):
3611         (WebCore::stopObservingCookieChanges):
3612         * platform/network/mac/CookieStorageMac.mm:
3613         (-[WebCookieStorageObjCAdapter startListeningForCookieChangeNotificationsWithCallback:]):
3614         (-[WebCookieStorageObjCAdapter stopListeningForCookieChangeNotifications]):
3615         (WebCore::startObservingCookieChanges):
3616         (WebCore::stopObservingCookieChanges):
3617         * platform/network/soup/CookieStorageSoup.cpp:
3618         (WebCore::cookieChangeCallbackMap):
3619         (WebCore::soupCookiesChanged):
3620         (WebCore::startObservingCookieChanges):
3621         (WebCore::stopObservingCookieChanges):
3622
3623 2017-02-13  Antoine Quint  <graouts@apple.com>
3624
3625         REGRESSION: Update volume and scrubbing slider to match HI designs
3626         https://bugs.webkit.org/show_bug.cgi?id=168170
3627         <rdar://problem/28095266>
3628
3629         Reviewed by Dean Jackson.
3630
3631         We bring the designs of the control's background materials, scrubber and
3632         volume slider up to spec.
3633
3634         The first important set of changes is that, on macOS, the materials and colors
3635         were incorrect. Buttons and time labels now set a mix-blend-mode to correctly
3636         appear vibrant against the media, and the controls bar, volume container
3637         and tracks menu now use a new BackgroundTint node to correctly apply both
3638         a backdrop-filter and blended tint above it.
3639
3640         The second important set of changes is the rendering of the sliders. Up to now
3641         we would simply style the <input type="range"> track and thumb, applying solid
3642         fills and strokes. We now draw sliders in two ways depending on the platform.
3643         
3644         On macOS, we draw the whole slider with a <canvas> element with "mix-blend-mode"
3645         set to "plus-lighter". On iOS, we draw the track as a <div> with "mix-blend-mode"
3646         set to "plus-darker" and draw the fill (up to the thumb) in the <canvas> with
3647         no blend mode to obtain a pure white color, finally the thumb is rendered by the
3648         <input> element. We couldn't draw the pure white color with the track in the
3649         same <canvas> due to the "plus-darker" blend mode.
3650
3651         Test: media/modern-media-controls/background-tint/background-tint.html
3652
3653         * Modules/modern-media-controls/controls/airplay-button.css:
3654         (button.airplay.on):
3655         * Modules/modern-media-controls/controls/background-tint.css: Added.
3656         (.background-tint):
3657         (.background-tint,):
3658         (.background-tint > .blur):
3659         (.background-tint > .tint):
3660         * Modules/modern-media-controls/controls/background-tint.js: Added.
3661         (BackgroundTint):
3662         * Modules/modern-media-controls/controls/ios-inline-media-controls.css:
3663         (.media-controls.ios.inline .scrubber.slider):
3664         (.media-controls.ios.inline .scrubber.slider > div):
3665         (.media-controls.ios.inline .scrubber.slider > input::-webkit-slider-thumb):
3666         (.media-controls.ios.inline .scrubber.slider > .fill): Deleted.
3667         * Modules/modern-media-controls/controls/macos-compact-inline-media-controls.css:
3668         (.media-controls.mac.inline.compact .volume-slider-container):
3669         (.media-controls.mac.inline.compact .volume.slider):
3670         (.media-controls.mac.inline.compact .scrubber.slider > input::-webkit-slider-thumb): Deleted.
3671         * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.css:
3672         (.media-controls.mac.fullscreen > .controls-bar):
3673         (.media-controls.mac.fullscreen > .controls-bar > .background-tint > div):
3674         (.media-controls.mac.fullscreen .volume.slider):
3675         (.media-controls.mac.fullscreen button.volume-up):
3676         (.media-controls.mac.fullscreen button.rewind):
3677         (.media-controls.mac.fullscreen button.forward):
3678         (.media-controls.mac.fullscreen .buttons-container.right button):
3679         (.media-controls.mac.fullscreen .scrubber):
3680         (.media-controls.mac.fullscreen > .controls-bar button): Deleted.
3681         (.media-controls.mac.fullscreen button.airplay): Deleted.
3682         (.media-controls.mac.fullscreen button.aspect-ratio): Deleted.
3683         (.media-controls.mac.fullscreen button.pip): Deleted.
3684         (.media-controls.mac.fullscreen button.tracks): Deleted.
3685         (.media-controls.mac.fullscreen button.fullscreen): Deleted.
3686         * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
3687         * Modules/modern-media-controls/controls/macos-inline-media-controls.css:
3688         (.media-controls.mac.inline .scrubber.slider):
3689         (.media-controls.mac.inline .volume-slider-container):
3690         (.media-controls.mac.inline .volume-slider-container > .background-tint):
3691         (.media-controls.mac.inline .volume-slider-container > .background-tint > div):
3692         (.media-controls.mac.inline .volume.slider):
3693         (.media-controls.mac.inline button): Deleted.
3694         (.media-controls.mac.inline button:active): Deleted.
3695         (.media-controls.mac.inline > .controls-bar button): Deleted.
3696         (.media-controls.mac.inline > .controls-bar,): Deleted.
3697         (.media-controls.mac.inline .volume-slider-container:before): Deleted.
3698         * Modules/modern-media-controls/controls/macos-inline-media-controls.js:
3699         (MacOSInlineMediaControls.prototype.layout):
3700         * Modules/modern-media-controls/controls/macos-media-controls.css: Added.
3701         (.media-controls.mac button:active):
3702         (.media-controls.mac > .controls-bar button):
3703         (.media-controls.mac > .controls-bar .time-label):
3704         (.media-controls.mac > .controls-bar .slider > canvas):
3705         (.media-controls.mac > .controls-bar .slider > input::-webkit-slider-thumb):
3706         * Modules/modern-media-controls/controls/scrubber.css: Removed.
3707         * Modules/modern-media-controls/controls/scrubber.js:
3708         (Scrubber):
3709         (Scrubber.prototype.get buffered):
3710         (Scrubber.prototype.set buffered):
3711         (Scrubber.prototype.draw):
3712         (Scrubber.prototype._drawMacOS):
3713         (Scrubber.prototype._drawiOS):
3714         * Modules/modern-media-controls/controls/slider.css:
3715         (.slider):
3716         (.slider > canvas,):
3717         (.slider > canvas):
3718         (.slider > input):
3719         (.slider > input,): Deleted.
3720         (.slider > .fill): Deleted.
3721         (.slider > input::-webkit-slider-thumb): Deleted.
3722         * Modules/modern-media-controls/controls/slider.js:
3723         (Slider.prototype.set value):
3724         (Slider.prototype.set width):
3725         (Slider.prototype.commitProperty):
3726         (Slider.prototype.layout):
3727         (Slider.prototype.draw):
3728         (Slider.prototype._handleInputEvent):
3729         (Slider.prototype._handleChangeEvent):
3730         (addRoundedRect):
3731         (Slider.prototype._updateFill): Deleted.
3732         * Modules/modern-media-controls/controls/start-button.css:
3733         (button.start):
3734         * Modules/modern-media-controls/controls/time-control.js:
3735         * Modules/modern-media-controls/controls/time-label.css:
3736         (.time-label):
3737         * Modules/modern-media-controls/controls/tracks-panel.css:
3738         (.tracks-panel):
3739         (.tracks-panel > .background-tint > div):
3740         (.tracks-panel > section):
3741         (.tracks-panel > section:first-of-type):
3742         (.tracks-panel > section > h3):
3743         (.tracks-panel > section > ul):
3744         (.tracks-panel > section > ul > li):
3745         (.tracks-panel > section > ul > li:focus):
3746         (.tracks-panel > section > ul > li.selected:before):
3747         (.tracks-panel > section > ul > li.animated):
3748         (.tracks-panel-section): Deleted.
3749         (.tracks-panel-section:first-of-type): Deleted.
3750         (.tracks-panel-section > h3): Deleted.
3751         (.tracks-panel-section > ul): Deleted.
3752         (.tracks-panel-section > ul > li): Deleted.
3753         (.tracks-panel-section > ul > li:focus): Deleted.
3754         (.tracks-panel-section > ul > li.selected:before): Deleted.
3755         (.tracks-panel-section > ul > li.animated): Deleted.
3756         * Modules/modern-media-controls/controls/tracks-panel.js:
3757         (TracksPanel.prototype._childrenFromDataSource):
3758         (TracksPanel.prototype._childrenFromDataSource.): Deleted.
3759         * Modules/modern-media-controls/controls/volume-slider.js:
3760         (VolumeSlider):
3761         (VolumeSlider.prototype.handleEvent):
3762         (VolumeSlider.prototype.draw):
3763         * Modules/modern-media-controls/js-files:
3764         * Modules/modern-media-controls/media/scrubbing-support.js:
3765         (ScrubbingSupport.prototype.get mediaEvents):
3766         (ScrubbingSupport.prototype.syncControl):
3767         (ScrubbingSupport):
3768
3769 2017-02-13  Alex Christensen  <achristensen@webkit.org>
3770
3771         URLs with an invalid IPv4 address should be invalid
3772         https://bugs.webkit.org/show_bug.cgi?id=168260
3773
3774         Reviewed by Tim Horton.
3775
3776         All URL hosts are fed through the IPv4 parser.  https://webkit.org/ doesn't
3777         look enough like an IPv4 address to be considered an invalid IPv4 address, so 
3778         we continue to the String host processing.  http://127.0.0.257 does, though, and
3779         according to https://url.spec.whatwg.org/#concept-ipv4-parser parsing that URL
3780         should fail.
3781
3782         Covered by newly passing web platform tests.
3783
3784         * platform/URLParser.cpp:
3785         (WebCore::URLParser::parseIPv4Host):
3786         (WebCore::URLParser::parseHostAndPort):
3787         * platform/URLParser.h:
3788
3789 2017-02-13  Dan Bernstein  <mitz@apple.com>
3790
3791         Reverted r212275. It still breaks some Apple-internal builds.
3792
3793         * platform/spi/mac/TUCallSPI.h:
3794
3795 2017-02-13  Joseph Pecoraro  <pecoraro@apple.com>
3796
3797         Address ESLint warnings in modern-media-controls
3798         https://bugs.webkit.org/show_bug.cgi?id=168224
3799
3800         Reviewed by Alexey Proskuryakov.
3801
3802         * Modules/modern-media-controls/controls/controls-bar.js:
3803         * Modules/modern-media-controls/controls/fullscreen-button.js:
3804         * Modules/modern-media-controls/controls/layout-node.js:
3805         * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
3806         * Modules/modern-media-controls/controls/media-controls.js:
3807         * Modules/modern-media-controls/controls/scheduler.js:
3808         * Modules/modern-media-controls/controls/seek-button.js:
3809         * Modules/modern-media-controls/controls/tracks-panel.js:
3810         * Modules/modern-media-controls/controls/volume-slider.js:
3811         * Modules/modern-media-controls/gesture-recognizers/gesture-recognizer.js:
3812         * Modules/modern-media-controls/gesture-recognizers/pinch.js:
3813         * Modules/modern-media-controls/media/fullscreen-support.js:
3814         * Modules/modern-media-controls/media/media-controller.js:
3815         * Modules/modern-media-controls/media/placard-support.js:
3816         * Modules/modern-media-controls/media/status-support.js:
3817         Address pedantic warnings.
3818
3819 2017-02-13  Dan Bernstein  <mitz@apple.com>
3820
3821         Restored changes from r212210 in a way that does not break the build.
3822
3823         * platform/spi/mac/TUCallSPI.h:
3824
3825 2017-02-13  Zalan Bujtas  <zalan@apple.com>
3826
3827         FontCascade::widthForSimpleText should skip applyTransforms() when kerning and ligatures are off.
3828         https://bugs.webkit.org/show_bug.cgi?id=168251
3829         <rdar://problem/30498102>
3830
3831         Reviewed by Antti Koivisto.
3832
3833         Covered by existing (perf)tests.
3834
3835         * platform/graphics/FontCascade.cpp:
3836         (WebCore::FontCascade::widthForSimpleText):
3837
3838 2017-02-12  Brian Burg  <bburg@apple.com>
3839
3840         Web Inspector: expose system user interface layout direction through InspectorFrontendHost
3841         https://bugs.webkit.org/show_bug.cgi?id=168209
3842         <rdar://problem/11573736>
3843
3844         Reviewed by Joseph Pecoraro.
3845
3846         Forward the UserInterfaceLayoutDirection of the inspector page. If the WebKit client has
3847         properly set the UI directionality from system settings in PageClient, this will get inherited
3848         automatically by the Inspector's WebPage instance.
3849
3850         * inspector/InspectorFrontendClient.h:
3851         * inspector/InspectorFrontendClientLocal.cpp:
3852         (WebCore::InspectorFrontendClientLocal::userInterfaceLayoutDirection):
3853         * inspector/InspectorFrontendClientLocal.h:
3854
3855         * inspector/InspectorFrontendHost.h:
3856         * inspector/InspectorFrontendHost.idl:
3857         * inspector/InspectorFrontendHost.cpp:
3858         (WebCore::InspectorFrontendHost::userInterfaceLayoutDirection):
3859         Expose the directionality to the frontend as "ltr" or "rtl" strings.
3860
3861 2017-02-13  Zalan Bujtas  <zalan@apple.com>
3862
3863         Simple line layout: Do not measure runs with trailing whitespace when kerning and ligatures are off.
3864         https://bugs.webkit.org/show_bug.cgi?id=168247
3865         <rdar://problem/30497288>
3866
3867         Reviewed by Antti Koivisto.
3868
3869         The width of the run is supposed to be the same with or without the trailing whitespace.
3870
3871         Covered by performance test.
3872
3873         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
3874         (WebCore::SimpleLineLayout::TextFragmentIterator::Style::Style):
3875         (WebCore::SimpleLineLayout::TextFragmentIterator::textWidth):
3876         * rendering/SimpleLineLayoutTextFragmentIterator.h:
3877
3878 2017-02-13  Karim H  <karim@karhm.com>
3879
3880         Added the other missing BSTR roles tag names.
3881         https://bugs.webkit.org/show_bug.cgi?id=165545
3882
3883         Reviewed by Chris Fleizach.
3884
3885         Test: accessibility/win/bstr-elements-role.html
3886
3887         * accessibility/AccessibilityRenderObject.cpp:
3888         (WebCore::shouldReturnTagNameAsRoleForMSAA):
3889
3890 2017-02-13  Youenn Fablet  <youennf@gmail.com>
3891
3892         [WebRTC] Creating RTCPeerConnection with libwebrtc backend is crashing on rwt
3893         https://bugs.webkit.org/show_bug.cgi?id=168250
3894
3895         Reviewed by Alex Christensen.
3896
3897         Covered by webrtc tests in LayoutTests and in web-platform-tests.
3898         Making mock peer connection factory keep a ref of the real libwebrtc peer connection factory.
3899         That way, it can create real libwebrtc backends whenever requested by tests.
3900
3901         Moving LibWebRTCUtils.h routines as static LibWebRTCProvider methods.
3902         In the future, we should make them no longer static.
3903
3904         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
3905         (WebCore::LibWebRTCMediaEndpoint::doCreateOffer):
3906         (WebCore::LibWebRTCMediaEndpoint::doCreateAnswer):
3907         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
3908         * WebCore.xcodeproj/project.pbxproj:
3909         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp: Renamed from Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCUtils.cpp.
3910         (WebCore::LibWebRTCProvider::callOnWebRTCNetworkThread):
3911         (WebCore::LibWebRTCProvider::callOnWebRTCSignalingThread):
3912         (WebCore::LibWebRTCProvider::factory):
3913         (WebCore::LibWebRTCProvider::setPeerConnectionFactory):
3914         (WebCore::createActualPeerConnection):
3915         (WebCore::LibWebRTCProvider::createPeerConnection):
3916         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
3917         * platform/mediastream/libwebrtc/LibWebRTCUtils.h: Removed.
3918         * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
3919         (WebCore::RealtimeOutgoingAudioSource::audioSamplesAvailable):
3920         * testing/Internals.cpp:
3921         * testing/MockLibWebRTCPeerConnection.cpp:
3922         (WebCore::useMockRTCPeerConnectionFactory):
3923         (WebCore::MockLibWebRTCPeerConnectionForIceCandidates::gotLocalDescription):
3924         (WebCore::releaseInNetworkThread):
3925         (WebCore::MockLibWebRTCPeerConnection::SetLocalDescription):
3926         (WebCore::MockLibWebRTCPeerConnection::SetRemoteDescription):
3927         (WebCore::MockLibWebRTCPeerConnection::CreateOffer):
3928         (WebCore::MockLibWebRTCPeerConnection::CreateAnswer):
3929
3930 2017-02-13  Anders Carlsson  <andersca@apple.com>
3931
3932         Simplify DragController::startDrag
3933         https://bugs.webkit.org/show_bug.cgi?id=168240
3934
3935         Reviewed by Tim Horton.
3936
3937         Use early returns instead of assigning to a variable that's returned at the end of the function.
3938
3939         * page/DragController.cpp:
3940         (WebCore::DragController::startDrag):
3941
3942 2017-02-13  Said Abou-Hallawa  <sabouhallawa@apple.com>
3943
3944         The current frame of an image should not deleted if another frame is asynchronously being decoded
3945         https://bugs.webkit.org/show_bug.cgi?id=167618
3946
3947         Reviewed by Simon Fraser.
3948
3949         Test: fast/images/animated-image-draw-while-decode.html
3950
3951         If the memory cache asks the BitmapImage to destroy all its frames while
3952         the next frame is being decoded, a thread contention may happen. This can
3953         happen when BitmapImage::draw() is called and the next frame is not ready
3954         yet for drawing, so the current frame has to be drawn. This will invoke
3955         a frame decoding in the same image from the drawing committing thread.
3956
3957         We can avoid that by destroying all the frames except the current frame if
3958         the image is asynchronously decoding its frames. This should not add extra
3959         memory overhead because building the image frame cache and then destroying
3960         it, when needed, is an on-going process. The frames will be allocated and
3961         decoded all the time and all of them can be destroyed except the current one.
3962         
3963         * platform/graphics/BitmapImage.cpp:
3964         (WebCore::BitmapImage::destroyDecodedData):
3965         (WebCore::BitmapImage::destroyDecodedDataIfNecessary):
3966         The logic of destroying the ImageFrames was split among BitmapImage, ImageSource
3967         and ImageFrameCache. Move all the logic to BitmapImage and have ImageFrameCache
3968         be responsible only for destroying a range of ImageFrames.
3969
3970         (WebCore::BitmapImage::draw): add an ASSERT_IMPLIES to ensure the current frame
3971