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