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