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