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