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