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