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