[Modern Media Controls] Adhere to tight padding on iOS
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-02-27  Antoine Quint  <graouts@apple.com>
2
3         [Modern Media Controls] Adhere to tight padding on iOS
4         https://bugs.webkit.org/show_bug.cgi?id=168949
5         <rdar://problem/30746164>
6
7         Reviewed by Jon Lee.
8
9         We used to only support custom margins on macOS, to support this on iOS as
10         well, we promote the notification when the layoutTraits property is set to
11         MediaControls and expose a new protected method layoutTraitsDidChange() for
12         subclasses to implement. IOSInlineMediaControls now implements that method
13         and will use tighter margins for the TightPadding layout trait.
14
15         Test: media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-tight-padding.html
16
17         * Modules/modern-media-controls/controls/ios-inline-media-controls.js:
18         (IOSInlineMediaControls.prototype.layoutTraitsDidChange):
19         (IOSInlineMediaControls):
20         * Modules/modern-media-controls/controls/macos-inline-media-controls.js:
21         (MacOSInlineMediaControls.prototype.get layoutTraits): Deleted.
22         (MacOSInlineMediaControls.prototype.set layoutTraits): Deleted.
23         (MacOSInlineMediaControls.prototype._matchLayoutTraits): Deleted.
24         * Modules/modern-media-controls/controls/media-controls.js:
25         (MediaControls.prototype.get layoutTraits):
26         (MediaControls.prototype.set layoutTraits):
27         (MediaControls.prototype.layoutTraitsDidChange):
28
29 2017-02-27  Youenn Fablet  <youenn@apple.com>
30
31         [WebRTC] Support modern RTCStatsReport
32         https://bugs.webkit.org/show_bug.cgi?id=166916
33         <rdar://problem/30293780>
34
35         Reviewed by Alex Christensen.
36
37         Updating binding generator and IDL parser to handle maplike.
38         Covered by binding tests.
39
40         Added support for maplike binding from JS wrapper to DOM class.
41         The principle is to have the JSXX wrapper having a @backingMap slot containing a Map.
42         All maplike methods are forwarded to the corresponding Map methods.
43         The XX object is responsible to add key/value pairs using a helper routine.
44         The creation of the Map is done at creation of the JSXX wrapper.
45
46         DOM class is interacting with the map through DOMMapLike.
47         Extracted DOMGuarded from DOM promise implementation.
48         This allows reusing this code for DOMMapLike.
49
50         Covered by binding tests and manual tests.
51
52         * CMakeLists.txt:
53         * DerivedSources.make:
54         * Modules/mediastream/RTCStatsReport.h:
55         (WebCore::RTCStatsReport::InboundRTPStreamStats::InboundRTPStreamStats):
56         (WebCore::RTCStatsReport::OutboundRTPStreamStats::OutboundRTPStreamStats):
57         (WebCore::RTCStatsReport::create):
58         (WebCore::RTCStatsReport::synchronizeBackingMap):
59         (WebCore::RTCStatsReport::backingMap):
60         (WebCore::RTCStatsReport::addStats):
61         * Modules/mediastream/RTCStatsReport.idl:
62         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
63         (WebCore::fromStdString):
64         (WebCore::fillRTCStats):
65         (WebCore::fillRTCRTPStreamStats):
66         (WebCore::fillInboundRTPStreamStats):
67         (WebCore::fillOutboundRTPStreamStats):
68         (WebCore::LibWebRTCMediaEndpoint::StatsCollector::OnStatsDelivered):
69         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
70         * WebCore.xcodeproj/project.pbxproj:
71         * bindings/js/JSDOMBindingInternals.js: Added.
72         (mapLikeForEach):
73         * bindings/js/JSDOMGlobalObject.cpp:
74         (WebCore::JSDOMGlobalObject::visitChildren):
75         * bindings/js/JSDOMGlobalObject.h:
76         * bindings/js/JSDOMGuardedObject.cpp: Added.
77         (WebCore::DOMGuardedObject::DOMGuardedObject):
78         (WebCore::DOMGuardedObject::~DOMGuardedObject):
79         (WebCore::DOMGuardedObject::clear):
80         (WebCore::DOMGuardedObject::contextDestroyed):
81         * bindings/js/JSDOMGuardedObject.h: Added.
82         (WebCore::DOMGuardedObject::isSuspended):
83         (WebCore::DOMGuardedObject::visitAggregate):
84         (WebCore::DOMGuardedObject::guardedObject):
85         (WebCore::DOMGuardedObject::globalObject):
86         (WebCore::DOMGuardedObject::isEmpty):
87         (WebCore::DOMGuarded::DOMGuarded):
88         (WebCore::DOMGuarded::guarded):
89         * bindings/js/JSDOMMapLike.cpp: Added.
90         (WebCore::getBackingMap):
91         (WebCore::initializeBackingMap):
92         (WebCore::createBackingMap):
93         (WebCore::forwardAttributeGetterToBackingMap):
94         (WebCore::forwardFunctionCallToBackingMap):
95         (WebCore::forwardForEachCallToBackingMap):
96         * bindings/js/JSDOMMapLike.h: Added.
97         (WebCore::DOMMapLike::set):
98         (WebCore::synchronizeBackingMap):
99         (WebCore::forwardSizeToMapLike):
100         (WebCore::forwardEntriesToMapLike):
101         (WebCore::forwardKeysToMapLike):
102         (WebCore::forwardValuesToMapLike):
103         (WebCore::forwardClearToMapLike):
104         (WebCore::forwardForEachToMapLike):
105         (WebCore::forwardHasToMapLike):
106         (WebCore::forwardAddToMapLike):
107         (WebCore::forwardDeleteToMapLike):
108         * bindings/js/JSDOMPromise.cpp:
109         (WebCore::DeferredPromise::promise):
110         (WebCore::DeferredPromise::reject):
111         * bindings/js/JSDOMPromise.h:
112         (WebCore::DeferredPromise::resolve):
113         (WebCore::DeferredPromise::resolveWithNewlyCreated):
114         (WebCore::DeferredPromise::reject):
115         (WebCore::DeferredPromise::resolveWithCallback):
116         (WebCore::DeferredPromise::rejectWithCallback):
117         (WebCore::DeferredPromise::DeferredPromise):
118         (WebCore::DeferredPromise::deferred):
119         * bindings/js/WebCoreBuiltinNames.h:
120         * bindings/scripts/CodeGeneratorJS.pm:
121         (PrototypeFunctionCount):
122         (GeneratePropertiesHashTable):
123         (InterfaceNeedsIterator):
124         (GenerateImplementation):
125         (GenerateParametersCheck):
126         * bindings/scripts/IDLParser.pm:
127         (assert):
128         (parseAttributeOrOperationOrIterator):
129         (parseSerializer):
130         (parseAttributeOrOperationRest):
131         (parseAttribute):
132         (parseAttributeRest):
133         (parseOperationOrIterator):
134         (parseOptionalIterableInterface):
135         (parseMapLikeRest):
136         (parseMapLikeProperties):
137         (parseOperationRest):
138         (applyMemberList):
139         * bindings/scripts/test/JS/JSMapLike.cpp: Added.
140         * bindings/scripts/test/JS/JSMapLike.h: Added.
141         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp: Added.
142         * bindings/scripts/test/JS/JSReadOnlyMapLike.h: Added.
143         * bindings/scripts/test/TestMapLike.idl: Added.
144         * bindings/scripts/test/TestReadOnlyMapLike.idl: Added.
145
146 2017-02-27  Mark Lam  <mark.lam@apple.com>
147
148         Introduce a VM Traps mechanism and refactor Watchdog to use it.
149         https://bugs.webkit.org/show_bug.cgi?id=168842
150
151         Reviewed by Filip Pizlo.
152
153         No new tests needed because this is a re-implementation of existing functionality.
154
155         * bindings/js/WorkerScriptController.cpp:
156         (WebCore::WorkerScriptController::WorkerScriptController):
157         (WebCore::WorkerScriptController::scheduleExecutionTermination):
158
159 2017-02-27  Andy Estes  <aestes@apple.com>
160
161         [Cocoa] Rename FileMac.mm to FileCocoa.mm
162         https://bugs.webkit.org/show_bug.cgi?id=168947
163
164         Reviewed by Zalan Bujtas.
165
166         * PlatformMac.cmake:
167         * WebCore.xcodeproj/project.pbxproj:
168         * fileapi/FileCocoa.mm: Renamed from Source/WebCore/fileapi/FileMac.mm.
169
170 2017-02-27  Andy Estes  <aestes@apple.com>
171
172         [iOS] Enable file replacement
173         https://bugs.webkit.org/show_bug.cgi?id=168907
174         <rdar://problem/22258242>
175
176         Reviewed by David Kilzer.
177
178         Covered by existing tests.
179
180         * fileapi/FileMac.mm:
181         (WebCore::File::shouldReplaceFile): Stop using Carbon and AppKit API for determining if a
182         file path is a file package. Use NSURL and CoreServices instead, which exist on Mac and iOS.
183
184 2017-02-27  Antoine Quint  <graouts@apple.com>
185
186         [Modern Media Controls] Use a solid background for <audio> controls on macOS
187         https://bugs.webkit.org/show_bug.cgi?id=168941
188         <rdar://problem/30744316>
189
190         Reviewed by Dean Jackson.
191
192         Use a solid background for <audio> elements on macOS, the same way we do on iOS.
193
194         Test: media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-audio-background.html
195
196         * Modules/modern-media-controls/controls/macos-media-controls.css:
197         (:host(audio) .media-controls.mac.inline > .controls-bar):
198         (:host(audio) .media-controls.mac.inline > .controls-bar > .background-tint):
199
200 2017-02-27  Antoine Quint  <graouts@apple.com>
201
202         [Modern Media Controls] StatusLabel should use similar properties to TimeLabel
203         https://bugs.webkit.org/show_bug.cgi?id=168938
204         <rdar://problem/30743185>
205
206         Reviewed by Dean Jackson.
207
208         Ensure we use the same styling properties for StatusLabel and TimeLabel.
209
210         Tests: media/modern-media-controls/status-label/status-label-ios.html
211                media/modern-media-controls/status-label/status-label-macos.html
212
213         * Modules/modern-media-controls/controls/ios-inline-media-controls.css:
214         (.media-controls.ios.inline .time-label,):
215         (.media-controls.ios.inline .time-label): Deleted.
216         * Modules/modern-media-controls/controls/macos-media-controls.css:
217         (.media-controls.mac > .controls-bar .time-label,):
218         (.media-controls.mac > .controls-bar .time-label): Deleted.
219         * Modules/modern-media-controls/controls/status-label.css:
220         (.status-label):
221
222 2017-02-27  Myles C. Maxfield  <mmaxfield@apple.com>
223
224         Rename ICU cursor iterator to caret iterator
225         https://bugs.webkit.org/show_bug.cgi?id=168206
226
227         Reviewed by Simon Fraser.
228
229         Mechanical find/replace.
230
231         No new tests because there is no behavior change.
232
233         * platform/graphics/ComplexTextController.cpp:
234         (WebCore::ComplexTextController::offsetForPosition):
235         * rendering/RenderText.cpp:
236         (WebCore::RenderText::previousOffset):
237         (WebCore::RenderText::nextOffset):
238
239 2017-02-27  Myles C. Maxfield  <mmaxfield@apple.com>
240
241         Unprefix -webkit-line-break
242         https://bugs.webkit.org/show_bug.cgi?id=168213
243
244         Reviewed by Darin Adler.
245
246         We support the property as specced.
247
248         Test: fast/text/line-break-unprefixed.html
249
250         * css/CSSComputedStyleDeclaration.cpp:
251         (WebCore::ComputedStyleExtractor::propertyValue):
252         * css/CSSProperties.json:
253         * css/parser/CSSParserFastPaths.cpp:
254         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
255         (WebCore::CSSParserFastPaths::isKeywordPropertyID):
256         * editing/Editor.cpp:
257         (WebCore::Editor::applyEditingStyleToElement):
258         * html/HTMLElement.cpp:
259         (WebCore::HTMLElement::collectStyleForPresentationAttribute):
260
261 2017-02-27  Myles C. Maxfield  <mmaxfield@apple.com>
262
263         Use RAII for ICU breaking iterators
264         https://bugs.webkit.org/show_bug.cgi?id=168203
265
266         Reviewed by Simon Fraser.
267
268         No new tests because there is no behavior change.
269
270         * platform/graphics/ComplexTextController.cpp:
271         (WebCore::ComplexTextController::offsetForPosition):
272         * rendering/RenderText.cpp:
273         (WebCore::RenderText::previousOffset):
274         (WebCore::RenderText::nextOffset):
275
276 2017-02-27  Basuke Suzuki  <Basuke.Suzuki@am.sony.com>
277
278         [WinCairo][MiniBrowser] Add ca-bundle to display secure pages
279         https://bugs.webkit.org/show_bug.cgi?id=168486
280
281         Reviewed by Alex Christensen.
282
283         change the order of path location search to make it possible to 
284         configure with environment variable because bundled ca-bundle is
285         always available now.
286
287         * platform/network/curl/ResourceHandleManager.cpp:
288         (WebCore::certificatePath):
289
290 2017-02-27  Antoine Quint  <graouts@apple.com>
291
292         [Modern Media Controls] Status text does not appear on iOS
293         https://bugs.webkit.org/show_bug.cgi?id=168918
294         <rdar://problem/30737644>
295
296         Reviewed by Dean Jackson.
297
298         We refactor the layout code out of MacOSInlineMediaControls and into a new
299         InlineLayoutSupport class which IOSInlineMediaControls uses as well. Now
300         both the macOS and iOS inline media controls run the same layout logic to
301         control whether the status label or scrubber should be displayed, and which
302         controls should be dropped due to space constraints.
303
304         Test: media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-status-label.html
305
306         * Modules/modern-media-controls/controls/inline-layout-support.js: Added.
307         (InlineLayoutSupport):
308         (InlineLayoutSupport.prototype.childrenAfterPerformingLayout):
309         * Modules/modern-media-controls/controls/ios-inline-media-controls.js:
310         (IOSInlineMediaControls.prototype.layout):
311         (IOSInlineMediaControls):
312         * Modules/modern-media-controls/controls/macos-inline-media-controls.js:
313         (MacOSInlineMediaControls.prototype.layout):
314         * Modules/modern-media-controls/js-files:
315
316 2017-02-27  Simon Fraser  <simon.fraser@apple.com>
317
318         Add specification and status metadata to CSSProperties.json, and validate it
319         https://bugs.webkit.org/show_bug.cgi?id=168901
320
321         Reviewed by Darin Adler.
322
323         Annotate CSS properties with data about the WebKit development status, and
324         where they are specified. A property has a canonical specification reference,
325         but individual values may have a reference to a more recent spec.
326
327         Add a list of specifications to the JSON that properties reference by key.
328
329         Enhance check-webkit-style to validate the status and spec data.
330
331         * css/CSSProperties.json:
332
333 2017-02-27  Jiewen Tan  <jiewen_tan@apple.com>
334
335         [CredentialManagement] Add IDL definitions for Credential, SiteBoundCredential, and PasswordCredential
336         https://bugs.webkit.org/show_bug.cgi?id=168616
337         <rdar://problem/30167149>
338
339         Reviewed by Daniel Bates.
340
341         This patch adds IDL definitions for:
342         1. Credential(https://w3c.github.io/webappsec-credential-management/#interfaces-credential-types-credential),
343         2. SiteBoundCredential(https://w3c.github.io/webappsec-credential-management/#interfaces-credential-types-siteboundcredential), and
344         3. PasswordCredential(https://w3c.github.io/webappsec-credential-management/#interfaces-credential-types-passwordcredential).
345
346         Test: credentials/idlharness.html
347
348         * CMakeLists.txt:
349         * DerivedSources.make:
350         * Modules/credentials/BasicCredential.cpp: Added.
351         (WebCore::BasicCredential::BasicCredential):
352         (WebCore::BasicCredential::~BasicCredential):
353         (WebCore::BasicCredential::type):
354         * Modules/credentials/BasicCredential.h: Added.
355         (WebCore::BasicCredential::id):
356         * Modules/credentials/BasicCredential.idl: Added.
357         * Modules/credentials/CredentialData.h: Added.
358         * Modules/credentials/CredentialData.idl: Added.
359         * Modules/credentials/PasswordCredential.cpp: Added.
360         (WebCore::PasswordCredential::PasswordCredential):
361         (WebCore::PasswordCredential::PasswordCredential):
362         Dummy constructors for now.
363         * Modules/credentials/PasswordCredential.h: Added.
364         (WebCore::PasswordCredential::create):
365         (WebCore::PasswordCredential::create):
366         (WebCore::PasswordCredential::setIdName):
367         (WebCore::PasswordCredential::idName):
368         (WebCore::PasswordCredential::setPasswordName):
369         (WebCore::PasswordCredential::passwordName):
370         (WebCore::PasswordCredential::setAdditionalData):
371         (WebCore::PasswordCredential::additionalData):
372         * Modules/credentials/PasswordCredential.idl: Added.
373         * Modules/credentials/SiteBoundCredential.cpp: Added.
374         (WebCore::SiteBoundCredential::SiteBoundCredential):
375         (WebCore::SiteBoundCredential::~SiteBoundCredential):
376         * Modules/credentials/SiteBoundCredential.h: Added.
377         (WebCore::SiteBoundCredential::name):
378         (WebCore::SiteBoundCredential::iconURL):
379         (WebCore::SiteBoundCredential::setOrigin):
380         (WebCore::SiteBoundCredential::origin):
381         * Modules/credentials/SiteBoundCredential.idl: Added.
382         * Modules/credentials/SiteBoundCredentialData.h: Added.
383         * Modules/credentials/SiteBoundCredentialData.idl: Added.
384         * WebCore.xcodeproj/project.pbxproj:
385
386 2017-02-27  Jer Noble  <jer.noble@apple.com>
387
388         [WebRTC] Fix remote audio rendering
389         https://bugs.webkit.org/show_bug.cgi?id=168898
390
391         Reviewed by Eric Carlson.
392
393         Test: webrtc/audio-peer-connection-webaudio.html
394
395         Fix MediaStreamAudioSourceNode by not bailing out early if the input sample rate doesn't match
396         the AudioContext's sample rate; there's code in setFormat() to do the sample rate conversion
397         correctly.
398
399         * Modules/webaudio/MediaStreamAudioSourceNode.cpp:
400         (WebCore::MediaStreamAudioSourceNode::setFormat):
401
402         Fix AudioSampleBufferList by making the AudioConverter input proc a free function, and passing
403         its refCon a struct containing only the information it needs to perform its task. Because the
404         conversion may result in a different number of output samples than input ones, just ask to
405         generate the entire capacity of the scratch buffer, and signal that the input buffer was fully
406         converted with a special return value.
407
408         * platform/audio/mac/AudioSampleBufferList.cpp:
409         (WebCore::audioConverterFromABLCallback):
410         (WebCore::AudioSampleBufferList::copyFrom):
411         (WebCore::AudioSampleBufferList::convertInput): Deleted.
412         (WebCore::AudioSampleBufferList::audioConverterCallback): Deleted.
413         * platform/audio/mac/AudioSampleBufferList.h:
414
415         Fix AudioSampleDataSource by updating both the sampleCount and the sampleTime after doing
416         a sample rate conversion to take into account that both the number of samples may have changed,
417         as well as the timeScale of the sampleTime. This may result in small off-by-one rounding errors
418         due to the sample rate conversion of sampleTime, so remember what the next expected sampleTime
419         should be, and correct sampleTime if it is indeed off-by-one. If the pull operation has gotten
420         ahead of the push operation, delay the next pull by the empty amount by rolling back the
421         m_outputSampleOffset. Introduce the same offset behavior during pull operations.
422
423         * platform/audio/mac/AudioSampleDataSource.h:
424         * platform/audio/mac/AudioSampleDataSource.mm:
425         (WebCore::AudioSampleDataSource::pushSamplesInternal):
426         (WebCore::AudioSampleDataSource::pullSamplesInternal):
427         (WebCore::AudioSampleDataSource::pullAvalaibleSamplesAsChunks):
428
429         Fix MediaPlayerPrivateMediaStreamAVFObjC by obeying the m_muted property.
430
431         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
432         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setVolume):
433         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setMuted):
434
435         Fix LibWebRTCAudioModule by sleeping for the correct amount after emitting frames. Previously,
436         LibWebRTCAudioModule would sleep for a fixed amount of time, which meant it would get slowly out
437         of sync when emitting frames took a non-zero amount of time. Now, the amount of time before the
438         next cycle starts is correctly calculated, and then LibWebRTCAudioModule sleeps for a dynamic amount
439         of time in order to wake up correctly at the beginning of the next cycle.
440
441         * platform/mediastream/libwebrtc/LibWebRTCAudioModule.cpp:
442         (WebCore::LibWebRTCAudioModule::StartPlayoutOnAudioThread):
443
444         Fix AudioTrackPrivateMediaStreamCocoa by just using the output unit's preferred format
445         description (with the current system sample rate), rather than whatever is the current
446         input description.
447
448         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
449         (WebCore::AudioTrackPrivateMediaStreamCocoa::createAudioUnit):
450         (WebCore::AudioTrackPrivateMediaStreamCocoa::audioSamplesAvailable):
451         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.h:
452
453         Fix RealtimeIncomingAudioSource by actually creating an AudioSourceProvider when asked.
454
455         * platform/mediastream/mac/RealtimeIncomingAudioSource.cpp:
456         (WebCore::RealtimeIncomingAudioSource::OnData):
457         (WebCore::RealtimeIncomingAudioSource::audioSourceProvider):
458         * platform/mediastream/mac/RealtimeIncomingAudioSource.h:
459
460         Fix RealtimeOutgoingAudioSource by using the outgoing format description rather than the
461         incoming one to determine the sample rate, channel count, sample byte size, etc., to use
462         when delivering data upstream to libWebRTC.
463
464         * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
465         (WebCore::RealtimeOutgoingAudioSource::audioSamplesAvailable):
466         (WebCore::RealtimeOutgoingAudioSource::pullAudioData):
467         * platform/mediastream/mac/RealtimeOutgoingAudioSource.h:
468
469         Fix WebAudioSourceProviderAVFObjC by using a AudioSampleDataSource to do format and sample
470         rate conversion rather than trying to duplicate all that code and use a CARingBuffer and 
471         AudioConverter directly.
472
473         * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.h:
474         * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm:
475         (WebCore::WebAudioSourceProviderAVFObjC::~WebAudioSourceProviderAVFObjC):
476         (WebCore::WebAudioSourceProviderAVFObjC::provideInput):
477         (WebCore::WebAudioSourceProviderAVFObjC::prepare):
478         (WebCore::WebAudioSourceProviderAVFObjC::unprepare):
479         (WebCore::WebAudioSourceProviderAVFObjC::audioSamplesAvailable):
480
481         Fix the MockLibWebRTCAudioTrack by passing along the AddSink() sink to its AudioSourceInterface,
482         allowing the RealtimeOutgoingAudioSource to push data into the libWebRTC network stack. Also,
483         make sure m_enabled is initialized to a good value.
484
485         * testing/MockLibWebRTCPeerConnection.h:
486
487 2017-02-21  Jer Noble  <jer.noble@apple.com>
488
489         AudioSampleDataSource should not exclusively lock its read and write threads.
490         https://bugs.webkit.org/show_bug.cgi?id=168646
491
492         Reviewed by Eric Carlson.
493
494         Locking the write thread causes the read thread to drop audio samples and generates audible
495         glitches, and the realtime audio thread backing the read thread should never block. There's
496         no real reason to lock these threads against one another here; they both rely on the
497         CARingBuffer to safely and simultaneously read and write data.
498
499         * platform/audio/mac/AudioSampleDataSource.cpp:
500         (WebCore::AudioSampleDataSource::setPaused):
501         (WebCore::AudioSampleDataSource::pushSamplesInternal):
502         (WebCore::AudioSampleDataSource::pushSamples):
503         (WebCore::AudioSampleDataSource::pullSamplesInternal):
504         (WebCore::AudioSampleDataSource::pullAvalaibleSamplesAsChunks):
505         (WebCore::AudioSampleDataSource::pullSamples):
506         * platform/audio/mac/AudioSampleDataSource.h:
507
508 2017-02-21  Jer Noble  <jer.noble@apple.com>
509
510         AudioTrackPrivateMediaStreamCocoa should not exclusively lock its read and write threads.
511         https://bugs.webkit.org/show_bug.cgi?id=168643
512
513         Reviewed by Eric Carlson.
514
515         Locking the write thread causes the read thread to drop audio samples and generates audible
516         glitches, and the realtime audio thread backing the read thread should never block. There's
517         no real reason to lock these threads against one another here; they both rely on the
518         AudioSampleDataSource and it's CARingBuffer to safely and simultaneously read and write
519         data.
520
521         The one piece which locks previously protected against unsafe access was during creation of
522         the audio unit.  Without a lock, the audio unit could begin playback after the unit was
523         created and assigned to m_remoteIOUnit but before the ring buffer was created. To protect
524         against this possibility, create the unit, set the input and output descriptions, but only
525         assign the new audio unit to m_remoteIOUnit after the ring buffer has been created and
526         initialized.
527
528         * platform/audio/mac/CAAudioStreamDescription.h:
529         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
530         (WebCore::AudioTrackPrivateMediaStreamCocoa::~AudioTrackPrivateMediaStreamCocoa):
531         (WebCore::AudioTrackPrivateMediaStreamCocoa::playInternal):
532         (WebCore::AudioTrackPrivateMediaStreamCocoa::play):
533         (WebCore::AudioTrackPrivateMediaStreamCocoa::pause):
534         (WebCore::AudioTrackPrivateMediaStreamCocoa::setVolume):
535         (WebCore::AudioTrackPrivateMediaStreamCocoa::createAudioUnit):
536         (WebCore::AudioTrackPrivateMediaStreamCocoa::setupAudioUnit): Renamed to createAudioUnit()
537         (WebCore::AudioTrackPrivateMediaStreamCocoa::audioSamplesAvailable):
538         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.h:
539
540 2017-02-27  Youenn Fablet  <youenn@apple.com>
541
542         [WebRTC] RealtimOutgoingVideoSource should not need to do image conversion
543         https://bugs.webkit.org/show_bug.cgi?id=168802
544
545         Reviewed by Jon Lee.
546
547         Covered by manual testing as mock sources do not hit the same code path.
548
549         * platform/mediastream/mac/AVVideoCaptureSource.h:
550         * platform/mediastream/mac/AVVideoCaptureSource.mm:
551         (WebCore::AVVideoCaptureSource::currentFrameCGImage):
552         * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:
553         (WebCore::RealtimeOutgoingVideoSource::sendFrame):
554         (WebCore::RealtimeOutgoingVideoSource::videoSampleAvailable):
555         * platform/mediastream/mac/RealtimeOutgoingVideoSource.h:
556
557 2017-02-27  Carlos Garcia Campos  <cgarcia@igalia.com>
558
559         [GTK] Downloads attributes tests are failing
560         https://bugs.webkit.org/show_bug.cgi?id=168871
561
562         Reviewed by Michael Catanzaro.
563
564         Use libsoup to get the suggested filename from the Content-Disposition header instead of buggy
565         filenameFromHTTPContentDisposition().
566
567         Fixes: fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-doublequote.html
568                fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-unicode.html
569
570         * platform/network/soup/ResourceResponseSoup.cpp:
571         (WebCore::ResourceResponse::platformSuggestedFilename):
572
573 2017-02-27  Antoine Quint  <graouts@apple.com>
574
575         [Modern Media Controls] Dragging controls in fullscreen on macOS prevents scrubbing or interacting with controls
576         https://bugs.webkit.org/show_bug.cgi?id=168820
577         <rdar://problem/30690281>
578
579         Reviewed by Jon Lee.
580
581         We broke this in https://bugs.webkit.org/show_bug.cgi?id=168755. We restore the check that the
582         event target when initiating a drag is the controls bar itself and not some of its content.
583
584         Since this wasn't caught by our existing tests, we add a test that attemps to initiate a drag
585         starting over one of the controls and notice that no dragging occurs.
586
587         We also fix an issue where we wouldn't update the layout of the left container as its icon
588         buttons would load, which would cause the layout width of the left container to be incorrect
589         and the related tests to time out.
590
591         Test: media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-drag-is-prevented-over-button.html
592
593         * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
594         (MacOSFullscreenMediaControls.prototype.layout):
595         (MacOSFullscreenMediaControls.prototype._handleMousedown):
596
597 2017-02-27  Alex Christensen  <achristensen@webkit.org>
598
599         [libwebrtc] Enable WebRTC in some Production Builds
600         https://bugs.webkit.org/show_bug.cgi?id=168858
601
602         * Configurations/FeatureDefines.xcconfig:
603
604 2017-02-27  Zan Dobersek  <zdobersek@igalia.com>
605
606         [TextureMapper] Clean up BitmapTextureGL construction
607         https://bugs.webkit.org/show_bug.cgi?id=168909
608
609         Reviewed by Carlos Garcia Campos.
610
611         Have the BitmapTextureGL constructor accept an rvalue reference pointer
612         to the GraphicsContext3D object. A static create() method is also added
613         to help with constructing these objects. Construction sites are updated
614         appropriately.
615
616         The BitmapTextureGL constructor is further cleaned up by moving default
617         member initializations together with the member declarations.
618
619         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
620         (WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor):
621         * platform/graphics/texmap/BitmapTextureGL.cpp:
622         (WebCore::BitmapTextureGL::BitmapTextureGL):
623         * platform/graphics/texmap/BitmapTextureGL.h:
624         * platform/graphics/texmap/BitmapTexturePool.cpp:
625         (WebCore::BitmapTexturePool::createTexture):
626         * platform/graphics/texmap/TextureMapperGL.cpp:
627         (WebCore::TextureMapperGL::createTexture):
628
629 2017-02-27  Zan Dobersek  <zdobersek@igalia.com>
630
631         [TextureMapper] Remove InterpolationQuality, TextDrawingModeFlags member variables
632         https://bugs.webkit.org/show_bug.cgi?id=168906
633
634         Reviewed by Carlos Garcia Campos.
635
636         Remove the InterpolationQuality and TextDrawingModeFlags member variables from the
637         TextureMapper class. These weren't modified anywhere in the code.
638
639         BitmapTexture::updateContents() still sets the image interpolation quality and
640         drawing mode on the ImageBuffer's GraphicsContext, but now uses the default
641         InterpolationDefault and TextModeFill values.
642
643         * platform/graphics/texmap/BitmapTexture.cpp:
644         (WebCore::BitmapTexture::updateContents):
645         * platform/graphics/texmap/TextureMapper.cpp:
646         (WebCore::TextureMapper::TextureMapper): Deleted.
647         (WebCore::TextureMapper::~TextureMapper): Deleted.
648         * platform/graphics/texmap/TextureMapper.h:
649         (WebCore::TextureMapper::setImageInterpolationQuality): Deleted.
650         (WebCore::TextureMapper::setTextDrawingMode): Deleted.
651         (WebCore::TextureMapper::imageInterpolationQuality): Deleted.
652         (WebCore::TextureMapper::textDrawingMode): Deleted.
653
654 2017-02-26  Zan Dobersek  <zdobersek@igalia.com>
655
656         [CoordinatedGraphics] Remove CoordinatedGraphicsScene::paintToGraphicsContext()
657         https://bugs.webkit.org/show_bug.cgi?id=168903
658
659         Reviewed by Carlos Garcia Campos.
660
661         Remove the GraphicsContext pointer member from the TextureMapper class
662         since the getter and setter methods are not used anywhere.
663
664         * platform/graphics/texmap/TextureMapper.cpp:
665         (WebCore::TextureMapper::TextureMapper):
666         * platform/graphics/texmap/TextureMapper.h:
667         (WebCore::TextureMapper::setGraphicsContext): Deleted.
668         (WebCore::TextureMapper::graphicsContext): Deleted.
669
670 2017-02-26  Myles C. Maxfield  <mmaxfield@apple.com>
671
672         Stop compiling our own cursorMovementIterator()
673         https://bugs.webkit.org/show_bug.cgi?id=168211
674
675         Reviewed by David Hyatt.
676
677         Covered by existing tests.
678
679         Hook up the caret iterator.
680
681         * platform/graphics/ComplexTextController.cpp:
682         (WebCore::ComplexTextController::offsetForPosition):
683         * rendering/RenderText.cpp:
684         (WebCore::RenderText::previousOffset):
685         (WebCore::RenderText::nextOffset):
686         * rendering/RenderText.h:
687
688 2017-02-26  Commit Queue  <commit-queue@webkit.org>
689
690         Unreviewed, rolling out r212942.
691         https://bugs.webkit.org/show_bug.cgi?id=168882
692
693         Made EWS very flaky (Requested by ap on #webkit).
694
695         Reverted changeset:
696
697         "[Modern Media Controls] Dragging controls in fullscreen on
698         macOS prevents scrubbing or interacting with controls"
699         https://bugs.webkit.org/show_bug.cgi?id=168820
700         http://trac.webkit.org/changeset/212942
701
702 2017-02-26  Chris Dumez  <cdumez@apple.com>
703
704         HitTestResult's linkSuggestedFilename should sanitize download attribute
705         https://bugs.webkit.org/show_bug.cgi?id=168856
706         <rdar://problem/30683109>
707
708         Reviewed by Antti Koivisto.
709
710         HitTestResult's linkSuggestedFilename should sanitize download attribute.
711         This is used by the context menu's "Download Linked File" & "Download Linked
712         File As..." actions.
713
714         * rendering/HitTestResult.cpp:
715         (WebCore::HitTestResult::linkSuggestedFilename):
716         * rendering/HitTestResult.h:
717
718 2017-02-25  Zalan Bujtas  <zalan@apple.com>
719
720         Simple line layout: Move coverage functions out of SimpleLineLayout.cpp
721         https://bugs.webkit.org/show_bug.cgi?id=168872
722         
723         Reviewed by Simon Fraser.
724
725         SimpleLineLayout.cpp is for core functions only.
726
727         No change in functionality.
728
729         * CMakeLists.txt:
730         * WebCore.xcodeproj/project.pbxproj:
731         * rendering/RenderingAllInOne.cpp:
732         * rendering/SimpleLineLayout.cpp:
733         (WebCore::SimpleLineLayout::canUseForWithReason):
734         (WebCore::SimpleLineLayout::printReason): Deleted.
735         (WebCore::SimpleLineLayout::printReasons): Deleted.
736         (WebCore::SimpleLineLayout::printTextForSubtree): Deleted.
737         (WebCore::SimpleLineLayout::textLengthForSubtree): Deleted.
738         (WebCore::SimpleLineLayout::collectNonEmptyLeafRenderBlockFlows): Deleted.
739         (WebCore::SimpleLineLayout::collectNonEmptyLeafRenderBlockFlowsForCurrentPage): Deleted.
740         (WebCore::SimpleLineLayout::toggleSimpleLineLayout): Deleted.
741         (WebCore::SimpleLineLayout::printSimpleLineLayoutBlockList): Deleted.
742         (WebCore::SimpleLineLayout::printSimpleLineLayoutCoverage): Deleted.
743         * rendering/SimpleLineLayout.h:
744         * rendering/SimpleLineLayoutCoverage.cpp: Added.
745         (WebCore::SimpleLineLayout::printReason):
746         (WebCore::SimpleLineLayout::printReasons):
747         (WebCore::SimpleLineLayout::printTextForSubtree):
748         (WebCore::SimpleLineLayout::textLengthForSubtree):
749         (WebCore::SimpleLineLayout::collectNonEmptyLeafRenderBlockFlows):
750         (WebCore::SimpleLineLayout::collectNonEmptyLeafRenderBlockFlowsForCurrentPage):
751         (WebCore::SimpleLineLayout::toggleSimpleLineLayout):
752         (WebCore::SimpleLineLayout::printSimpleLineLayoutBlockList):
753         (WebCore::SimpleLineLayout::printSimpleLineLayoutCoverage):
754         * rendering/SimpleLineLayoutCoverage.h: Added.
755
756 2017-02-25  Zalan Bujtas  <zalan@apple.com>
757
758         Text might wrap when its preferred logical width is used for sizing the containing block.
759         https://bugs.webkit.org/show_bug.cgi?id=168864
760         <rdar://problem/30690734>
761
762         Reviewed by Antti Koivisto.
763
764         In certain cases we end up measuring a text run in 2 different ways.
765         1. preferred width computation -> slow path FontCascade::width() 
766         2. line breaking logic -> fast path FontCascade::widthForSimpleText()
767  
768         FontCascade::width() and ::widthForSimpleText() might return different results for the same run even when
769         the individual glyph widths are measured to be the same. It's because they run diffrent set of
770         arithmetics on the float values and for certain values these arithmetics produce different results due to the floating point
771         precision.
772         Since RenderText::computePreferredLogicalWidths() currently forces us to use the slow path
773         (to retrieve fontfallback and glyph overflow information) the only alternative solution is to turn off the fast path
774         for all runs that have been already measured using the slow path (which would be just wasteful).
775
776         Test: fast/text/fast-run-width-vs-slow-run-width.html
777
778         * platform/graphics/FontCascade.cpp:
779         (WebCore::FontCascade::widthForSimpleText): Mimics WidthIterator::applyFontTransforms. Use the same set of arithmetics here.  
780
781 2017-02-24  Simon Fraser  <simon.fraser@apple.com>
782
783         Improve how multiple codegen-properties are handled in CSSProperties.json
784         https://bugs.webkit.org/show_bug.cgi?id=168867
785
786         Reviewed by Zalan Bujtas.
787
788         To make upcoming metadata storage easier, it's better if property entries in CSSProperties.json
789         are always hashes. One property (line-height) used an array, in order to represent settings for
790         two different build flags (ENABLE_TEXT_AUTOSIZING and !ENABLE_TEXT_AUTOSIZING).
791
792         Fix by making "codegen-properties" optionally be an array. The relevant item is selected in
793         removeInactiveCodegenProperties() and used to replace the array.
794
795         Sort @internalProprerties when generating code, otherwise the contents of isInternalCSSProperty()
796         are unstable (the order in @allNames is not stable because it's the keys in a hash).
797
798         * css/CSSProperties.json:
799         * css/makeprop.pl:
800         (matchEnableFlags):
801         (removeInactiveCodegenProperties):
802         (isPropertyEnabled):
803
804 2017-02-24  Joseph Pecoraro  <pecoraro@apple.com>
805
806         [Resource Timing] Media elements initiated loads should set the initiatorType to their element name (video/audio)
807         https://bugs.webkit.org/show_bug.cgi?id=168680
808
809         Reviewed by Youenn Fablet.
810
811         * html/HTMLMediaElement.cpp:
812         (WebCore::HTMLMediaElement::mediaPlayerCreateResourceLoader):
813         Pass in the element so it may be used as the initiator.
814
815         * html/HTMLVideoElement.h:
816         Export create() for TestWebKitAPI to use.
817
818         * loader/MediaResourceLoader.cpp:
819         (WebCore::MediaResourceLoader::MediaResourceLoader):
820         (WebCore::MediaResourceLoader::contextDestroyed):
821         (WebCore::MediaResourceLoader::requestResource):
822         * loader/MediaResourceLoader.h:
823         Include the HTMLMediaElement as the initiator.
824
825 2017-02-24  Joseph Pecoraro  <pecoraro@apple.com>
826
827         [Resource Timing] Gather timing information with reliable responseEnd time
828         https://bugs.webkit.org/show_bug.cgi?id=168351
829
830         Reviewed by Alex Christensen.
831
832         This patch replaces the unused `double finishTime` in ResourceLoader's
833         didFinishLoad with a complete WebCore::NetworkLoadMetrics object. This
834         allows the NetworkProcess to give complete timing information, and more
835         final metrics about the load, to WebCore. Currently this is only used
836         by ResourceTiming, but it will soon be used by Web Inspector as well.
837         We may also end up extending this to the didFail path as well, since it
838         is possible that we have some metrics for load failures.
839
840         At the same time we want to start moving away from the legacy path that
841         populated a subset of this information in ResourceResponse's NetworkLoadMetrics.
842         It doesn't make sense to store this information on the ResourceResponse
843         for a few reasons: We don't want to store the metrics in our Network Cache and
844         not all of the load timing metrics have been populated yet (responseEnd).
845         In an effort to move off of this data we've renamed the accessor to
846         "deprecatedNetworkLoadMetrics". There are a few remaining clients
847         (ResourceHandle, PerformanceTiming, InspectorNetworkAgent) which can be
848         migrated separately from this patch.
849
850         Having both the legacy and new code paths adds a little bit of complexity.
851         One advantage of the new path is that the complete load timing data
852         (fetchStart -> dns -> connect -> request -> response -> responseEnd) can
853         be packaged together. The legacy path could not include a responseEnd, so
854         WebCore faked that value with its own timestamp. Having the fake responseEnd
855         caused issues as timestamps / clocks are different between processes. In order
856         for PerformanceResponseTiming to know whether or not the NetworkLoadMetrics
857         has the complete network timing metrics it checks isComplete(). If true
858         it knows it can use the responseEnd time from NetworkLoadMetrics, otherwise
859         it must fallback to the legacy value from LoadTiming. Once all of the
860         deprecatedNetworkLoadMetrics clients go away, we should always have the
861         complete data and this can be eliminated.
862
863         Tests: imported/w3c/web-platform-tests/resource-timing/rt-nextHopProtocol.html
864                imported/w3c/web-platform-tests/resource-timing/rt-nextHopProtocol.worker.html
865
866         * PlatformMac.cmake:
867         * WebCore.xcodeproj/project.pbxproj:
868         Rename NetworkLoadTiming -> NetworkLoadMetrics.
869
870         * page/PerformanceResourceTiming.cpp:
871         (WebCore::entryStartTime):
872         (WebCore::entryEndTime):
873         (WebCore::PerformanceResourceTiming::PerformanceResourceTiming):
874         (WebCore::PerformanceResourceTiming::nextHopProtocol):
875         (WebCore::PerformanceResourceTiming::domainLookupStart):
876         (WebCore::PerformanceResourceTiming::domainLookupEnd):
877         (WebCore::PerformanceResourceTiming::connectStart):
878         (WebCore::PerformanceResourceTiming::connectEnd):
879         (WebCore::PerformanceResourceTiming::secureConnectionStart):
880         (WebCore::PerformanceResourceTiming::requestStart):
881         (WebCore::PerformanceResourceTiming::responseStart):
882         (WebCore::PerformanceResourceTiming::responseEnd):
883         (WebCore::PerformanceResourceTiming::networkLoadTimeToDOMHighResTimeStamp):
884         * page/PerformanceResourceTiming.h:
885         Mostly just updating names and types. This does however need to get the
886         correct endTime based on whether the NetworkLoadMetrics are complete
887         (meaning includes responseEnd) or not (legacy, use LoadTiming value).
888
889         * page/PerformanceResourceTiming.idl:
890         Add nextHopProtocol.
891
892         * page/PerformanceTiming.cpp:
893         (WebCore::PerformanceTiming::domainLookupStart):
894         (WebCore::PerformanceTiming::domainLookupEnd):
895         (WebCore::PerformanceTiming::connectStart):
896         (WebCore::PerformanceTiming::connectEnd):
897         (WebCore::PerformanceTiming::secureConnectionStart):
898         (WebCore::PerformanceTiming::requestStart):
899         (WebCore::PerformanceTiming::responseStart):
900         (WebCore::PerformanceTiming::resourceLoadTimeRelativeToFetchStart):
901         * page/PerformanceTiming.h:
902         Navigation Timing values still uses the NetworkLoadTiming values stored on
903         the DocumentLoader. This should be moved off of the deprecated path separately.
904
905         * platform/network/NetworkLoadMetrics.h: Renamed from Source/WebCore/platform/network/NetworkLoadTiming.h.
906         (WebCore::NetworkLoadMetrics::NetworkLoadMetrics):
907         (WebCore::NetworkLoadMetrics::isolatedCopy):
908         (WebCore::NetworkLoadMetrics::reset):
909         (WebCore::NetworkLoadMetrics::operator==):
910         (WebCore::NetworkLoadMetrics::operator!=):
911         (WebCore::NetworkLoadMetrics::isComplete):
912         (WebCore::NetworkLoadMetrics::markComplete):
913         (WebCore::NetworkLoadMetrics::encode):
914         (WebCore::NetworkLoadMetrics::decode):
915         Re-introduce a reset() method (for NetworkLoadSoup to reset between redirects).
916         Add protocolName and "complete" boolean.
917
918         * platform/network/cocoa/NetworkLoadMetrics.mm: Renamed from Source/WebCore/platform/network/cocoa/NetworkLoadTiming.mm.
919         (WebCore::timingValue):
920         (WebCore::copyTimingData):
921         (WebCore::setCollectsTimingData):
922         Use this opportunity to convert NetworkLoadTiming timestamps to WTF::Seconds.
923         Since we already have to modify all the clients this moves us to use the more
924         strongly typed units that are less ambiguous then "double". The rest of the
925         Performance API has already moved to these units.
926
927         * inspector/InspectorNetworkAgent.cpp:
928         (WebCore::InspectorNetworkAgent::buildObjectForTiming):
929         (WebCore::InspectorNetworkAgent::buildObjectForResourceResponse):
930         (WebCore::InspectorNetworkAgent::didFinishLoading):
931         * inspector/InspectorNetworkAgent.h:
932         Inspector was the only client of the finishTime, and since the value was
933         erratically coming from clients in different ways it was almost certainly
934         inaccurate. Simplify this in preparation for using NetworkLoadMetrics.
935
936         * Modules/fetch/FetchLoader.cpp:
937         (WebCore::FetchLoader::didFinishLoading):
938         * Modules/fetch/FetchLoader.h:
939         * fileapi/FileReaderLoader.cpp:
940         (WebCore::FileReaderLoader::didFinishLoading):
941         * fileapi/FileReaderLoader.h:
942         * html/MediaFragmentURIParser.cpp:
943         (WebCore::MediaFragmentURIParser::parseNPTTime):
944         * inspector/InspectorInstrumentation.cpp:
945         (WebCore::InspectorInstrumentation::didFinishLoadingImpl):
946         * inspector/InspectorInstrumentation.h:
947         (WebCore::InspectorInstrumentation::didFinishLoading):
948         * loader/CrossOriginPreflightChecker.cpp:
949         (WebCore::CrossOriginPreflightChecker::validatePreflightResponse):
950         * loader/DocumentLoader.cpp:
951         (WebCore::DocumentLoader::notifyFinished):
952         (WebCore::DocumentLoader::finishedLoading):
953         (WebCore::DocumentLoader::continueAfterContentPolicy):
954         (WebCore::DocumentLoader::maybeLoadEmpty):
955         * loader/DocumentLoader.h:
956         * loader/DocumentThreadableLoader.cpp:
957         (WebCore::DocumentThreadableLoader::didReceiveResponse):
958         (WebCore::DocumentThreadableLoader::notifyFinished):
959         (WebCore::DocumentThreadableLoader::didFinishLoading):
960         (WebCore::DocumentThreadableLoader::loadRequest):
961         * loader/DocumentThreadableLoader.h:
962         * loader/NetscapePlugInStreamLoader.cpp:
963         (WebCore::NetscapePlugInStreamLoader::didFinishLoading):
964         * loader/NetscapePlugInStreamLoader.h:
965         * loader/ResourceLoadNotifier.cpp:
966         (WebCore::ResourceLoadNotifier::didFinishLoad):
967         (WebCore::ResourceLoadNotifier::dispatchDidFinishLoading):
968         (WebCore::ResourceLoadNotifier::sendRemainingDelegateMessages):
969         * loader/ResourceLoadNotifier.h:
970         * loader/ResourceLoader.cpp:
971         (WebCore::ResourceLoader::deliverResponseAndData):
972         (WebCore::ResourceLoader::loadDataURL):
973         (WebCore::ResourceLoader::didFinishLoading):
974         (WebCore::ResourceLoader::didFinishLoadingOnePart):
975         * loader/ResourceLoader.h:
976         * loader/ResourceTiming.cpp:
977         (WebCore::ResourceTiming::fromLoad):
978         (WebCore::ResourceTiming::fromSynchronousLoad):
979         (WebCore::ResourceTiming::ResourceTiming):
980         (WebCore::ResourceTiming::isolatedCopy):
981         * loader/ResourceTiming.h:
982         (WebCore::ResourceTiming::networkLoadMetrics):
983         (WebCore::ResourceTiming::ResourceTiming):
984         (WebCore::ResourceTiming::networkLoadTiming): Deleted.
985         * loader/SubresourceLoader.cpp:
986         (WebCore::SubresourceLoader::SubresourceLoader):
987         (WebCore::SubresourceLoader::willSendRequestInternal):
988         (WebCore::SubresourceLoader::didReceiveResponse):
989         (WebCore::SubresourceLoader::didFinishLoading):
990         (WebCore::SubresourceLoader::reportResourceTiming):
991         * loader/SubresourceLoader.h:
992         * loader/ThreadableLoaderClient.h:
993         (WebCore::ThreadableLoaderClient::didFinishLoading):
994         * loader/ThreadableLoaderClientWrapper.h:
995         (WebCore::ThreadableLoaderClientWrapper::didFinishLoading):
996         * loader/WorkerThreadableLoader.cpp:
997         (WebCore::WorkerThreadableLoader::MainThreadBridge::didFinishLoading):
998         * loader/WorkerThreadableLoader.h:
999         * loader/appcache/ApplicationCacheGroup.cpp:
1000         (WebCore::ApplicationCacheGroup::didFinishLoading):
1001         * loader/appcache/ApplicationCacheGroup.h:
1002         * loader/cache/CachedResource.h:
1003         (WebCore::CachedResource::setLoadFinishTime):
1004         * loader/ios/QuickLook.mm:
1005         (-[WebPreviewLoader connectionDidFinishLoading:]):
1006         * page/EventSource.cpp:
1007         (WebCore::EventSource::didFinishLoading):
1008         * page/EventSource.h:
1009         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
1010         (ResourceHandleStreamingClient::didFinishLoading):
1011         * platform/network/BlobResourceHandle.cpp:
1012         (WebCore::doNotifyFinish):
1013         * platform/network/PingHandle.h:
1014         * platform/network/ResourceHandle.h:
1015         * platform/network/ResourceHandleClient.h:
1016         (WebCore::ResourceHandleClient::didFinishLoading):
1017         * platform/network/ResourceResponseBase.cpp:
1018         (WebCore::ResourceResponseBase::crossThreadData):
1019         (WebCore::ResourceResponseBase::fromCrossThreadData):
1020         (WebCore::ResourceResponseBase::compare):
1021         * platform/network/ResourceResponseBase.h:
1022         (WebCore::ResourceResponseBase::deprecatedNetworkLoadMetrics):
1023         (WebCore::ResourceResponseBase::encode):
1024         (WebCore::ResourceResponseBase::decode):
1025         (WebCore::ResourceResponseBase::networkLoadTiming): Deleted.
1026         * platform/network/SynchronousLoaderClient.cpp:
1027         (WebCore::SynchronousLoaderClient::didFinishLoading):
1028         * platform/network/SynchronousLoaderClient.h:
1029         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
1030         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
1031         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didFinishLoading):
1032         * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
1033         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveResponse):
1034         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didFinishLoading):
1035         * platform/network/curl/ResourceHandleCurl.cpp:
1036         (WebCore::WebCoreSynchronousLoader::didFinishLoading):
1037         * platform/network/curl/ResourceHandleManager.cpp:
1038         (WebCore::calculateWebTimingInformations):
1039         (WebCore::ResourceHandleManager::downloadTimerCallback):
1040         (WebCore::handleDataURL):
1041         (WebCore::milisecondsSinceRequest): Deleted.
1042         * platform/network/mac/ResourceHandleMac.mm:
1043         (WebCore::ResourceHandle::getConnectionTimingData):
1044         * platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
1045         (-[WebCoreResourceHandleAsDelegate connection:didReceiveResponse:]):
1046         (-[WebCoreResourceHandleAsDelegate connectionDidFinishLoading:]):
1047         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
1048         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]):
1049         (-[WebCoreResourceHandleAsOperationQueueDelegate connectionDidFinishLoading:]):
1050         * platform/network/soup/ResourceHandleSoup.cpp:
1051         (WebCore::restartedCallback):
1052         (WebCore::nextMultipartResponsePartCallback):
1053         (WebCore::sendRequestCallback):
1054         (WebCore::ResourceHandle::didStartRequest):
1055         (WebCore::networkEventCallback):
1056         (WebCore::ResourceHandle::sendPendingRequest):
1057         (WebCore::readCallback):
1058         (WebCore::milisecondsSinceRequest): Deleted.
1059         * workers/WorkerScriptLoader.cpp:
1060         (WebCore::WorkerScriptLoader::didFinishLoading):
1061         * workers/WorkerScriptLoader.h:
1062         * xml/XMLHttpRequest.cpp:
1063         (WebCore::XMLHttpRequest::didFinishLoading):
1064         * xml/XMLHttpRequest.h:
1065         Eliminate the unused finishTime double.
1066
1067 2017-02-24  Chris Dumez  <cdumez@apple.com>
1068
1069         Unreviewed GTK build fix after r212965
1070
1071         * CMakeLists.txt:
1072
1073 2017-02-24  Chris Dumez  <cdumez@apple.com>
1074
1075         Unreviewed, rolling out r212944.
1076
1077         Caused a lot of failures on the debug bots
1078
1079         Reverted changeset:
1080
1081         "[Resource Timing] Gather timing information with reliable
1082         responseEnd time"
1083         https://bugs.webkit.org/show_bug.cgi?id=168351
1084         http://trac.webkit.org/changeset/212944
1085
1086 2017-02-24  Chris Dumez  <cdumez@apple.com>
1087
1088         Unreviewed, follow-up fix after r212972.
1089
1090         Fixes a few assertions on the debug build bots.
1091         URL needs to be exactly the same as the parsed one given
1092         that we are calling the ParsedURLString constructor.
1093
1094         * platform/network/ResourceResponseBase.cpp:
1095         (WebCore::ResourceResponseBase::sanitizeSuggestedFilename):
1096
1097 2017-02-24  Zalan Bujtas  <zalan@apple.com>
1098
1099         Simple line layout: Re-adjust paginated lines when block height changes.
1100         https://bugs.webkit.org/show_bug.cgi?id=168838
1101         <rdar://problem/30701233>
1102
1103         Reviewed by Antti Koivisto.
1104
1105         When the estimated block height is wrong, we issue an additional layout on the inline children
1106         so that we get the pagination right (this layout is setChildNeedsLayout(MarkOnlyThis) only).
1107         Since the height change only affects the struts and page breaks (and again, the relayoutChildren flag is false)
1108         we don't need to re-layout the content, but instead we just need to re-adjust the pagination for the simple lines. 
1109         This patch also moves the pagination logic to SimpleLineLayoutPagination.cpp.
1110
1111         Not enabled yet.
1112
1113         * CMakeLists.txt:
1114         * WebCore.xcodeproj/project.pbxproj:
1115         * rendering/RenderBlockFlow.cpp:
1116         (WebCore::RenderBlockFlow::layoutSimpleLines):
1117         * rendering/RenderingAllInOne.cpp:
1118         * rendering/SimpleLineLayout.cpp:
1119         (WebCore::SimpleLineLayout::canUseForWithReason):
1120         (WebCore::SimpleLineLayout::create):
1121         (WebCore::SimpleLineLayout::Layout::create):
1122         (WebCore::SimpleLineLayout::Layout::Layout):
1123         (WebCore::SimpleLineLayout::computeLineTopAndBottomWithOverflow): Deleted.
1124         (WebCore::SimpleLineLayout::computeLineBreakIndex): Deleted.
1125         (WebCore::SimpleLineLayout::computeOffsetAfterLineBreak): Deleted.
1126         (WebCore::SimpleLineLayout::setPageBreakForLine): Deleted.
1127         (WebCore::SimpleLineLayout::updateMinimumPageHeight): Deleted.
1128         (WebCore::SimpleLineLayout::adjustLinePositionsForPagination): Deleted.
1129         * rendering/SimpleLineLayout.h:
1130         (WebCore::SimpleLineLayout::Layout::setIsPaginated):
1131         (WebCore::SimpleLineLayout::Layout::setLineStruts):
1132         * rendering/SimpleLineLayoutPagination.cpp: Added.
1133         (WebCore::SimpleLineLayout::computeLineTopAndBottomWithOverflow):
1134         (WebCore::SimpleLineLayout::computeLineBreakIndex):
1135         (WebCore::SimpleLineLayout::computeOffsetAfterLineBreak):
1136         (WebCore::SimpleLineLayout::setPageBreakForLine):
1137         (WebCore::SimpleLineLayout::updateMinimumPageHeight):
1138         (WebCore::SimpleLineLayout::adjustLinePositionsForPagination):
1139         * rendering/SimpleLineLayoutPagination.h: Added.
1140
1141 2017-02-24  Jon Lee  <jonlee@apple.com>
1142
1143         Alias "system-ui" for the System font name
1144         https://bugs.webkit.org/show_bug.cgi?id=151493
1145
1146         Reviewed by Tim Horton and Joseph Pecoraro.
1147
1148         Updated existing tests.
1149
1150         * WebCore.xcodeproj/project.pbxproj: Add WebKitFontFamilyNames.in for
1151         convenience.
1152         * css/CSSValueKeywords.in: Add system-ui as a keyword.
1153         * css/WebKitFontFamilyNames.in: Add system-ui.
1154
1155         * platform/graphics/ios/FontCacheIOS.mm:
1156         (WebCore::platformFontWithFamilySpecialCase): Include "system-ui" as an
1157         alias.
1158         * platform/graphics/mac/FontCacheMac.mm:
1159         (WebCore::platformFontWithFamilySpecialCase): Ditto.
1160
1161         * rendering/RenderThemeMac.mm:
1162         (WebCore::RenderThemeMac::updateCachedSystemFontDescription): Update
1163         serialization to "system-ui" from "-apple-system".
1164
1165         * css/CSSComputedStyleDeclaration.cpp:
1166         (WebCore::identifierForFamily):
1167         * css/CSSFontFaceSet.cpp:
1168         (WebCore::CSSFontFaceSet::familyNameFromPrimitive):
1169         * css/StyleBuilderCustom.h:
1170         (WebCore::StyleBuilderCustom::applyValueFontFamily):
1171
1172 2017-02-24  Matt Rajca  <mrajca@apple.com>
1173
1174         Media: notify clients when autoplay is denied
1175         https://bugs.webkit.org/show_bug.cgi?id=168840
1176
1177         Reviewed by Alex Christensen.
1178
1179         Added API tests.
1180
1181         * WebCore.xcodeproj/project.pbxproj:
1182         * html/HTMLMediaElement.cpp:
1183         (WebCore::HTMLMediaElement::setReadyState):
1184         (WebCore::HTMLMediaElement::play):
1185         (WebCore::HTMLMediaElement::playInternal):
1186         * page/AutoplayEvent.h: Added.
1187         * page/ChromeClient.h:
1188
1189 2017-02-24  Basuke Suzuki  <Basuke.Suzuki@am.sony.com>
1190
1191         curl: Improve errors by including the domain
1192         https://bugs.webkit.org/show_bug.cgi?id=134340
1193
1194         Reviewed by Alex Christensen.
1195
1196         Added proper error domain to ResourceError created by
1197         Curl problem.
1198
1199         * platform/network/curl/ResourceHandleManager.cpp:
1200         (WebCore::ResourceHandleManager::downloadTimerCallback):
1201         (WebCore::ResourceHandleManager::dispatchSynchronousJob):
1202
1203 2017-02-24  Antoine Quint  <graouts@apple.com>
1204
1205         [Modern Media Controls] <audio> controls should center in their container when the page is scaled
1206         https://bugs.webkit.org/show_bug.cgi?id=168841
1207         <rdar://problem/28612794>
1208
1209         Reviewed by Eric Carlson.
1210
1211         When dealing with <audio> elements, we vertically center the controls relative to their containing
1212         media element such that if the controls visually overflow, they overflow equally above and below
1213         to minimize the likelihood of overlap with surrounding elements.
1214
1215         Test: media/modern-media-controls/media-controller/media-controller-scale-factor-audio.html
1216
1217         * Modules/modern-media-controls/controls/media-controls.js:
1218         (MediaControls.prototype.get shouldCenterControlsVertically):
1219         (MediaControls.prototype.set shouldCenterControlsVertically):
1220         (MediaControls.prototype.commitProperty):
1221         * Modules/modern-media-controls/media/media-controller.js:
1222         (MediaController.prototype.get isAudio):
1223         (MediaController.prototype.get layoutTraits):
1224         (MediaController.prototype._updateControlsSize):
1225
1226 2017-02-24  Alex Christensen  <achristensen@webkit.org>
1227
1228         Non-special relative URLs should not ignore extra slashes
1229         https://bugs.webkit.org/show_bug.cgi?id=168834
1230
1231         Reviewed by Sam Weinig.
1232
1233         Special authority ignore slashes state should, as its name implies,
1234         only be reached by special URLs.  See https://url.spec.whatwg.org/#relative-slash-state
1235
1236         Covered by newly passing web platform tests.
1237
1238         * platform/URLParser.cpp:
1239         (WebCore::URLParser::parse):
1240
1241 2017-02-24  Alexey Proskuryakov  <ap@apple.com>
1242
1243         Build fix for newer clang
1244         https://bugs.webkit.org/show_bug.cgi?id=168849
1245         rdar://problem/30638741
1246
1247         Reviewed by Ryosuke Niwa.
1248
1249         * dom/Range.cpp: (WebCore::Range::toString): std::max(0, <unsigned>) is not meaningful,
1250         and now triggers a warning.
1251
1252 2017-02-24  Chris Dumez  <cdumez@apple.com>
1253
1254         Download attribute should be sanitized before being used as suggested filename
1255         https://bugs.webkit.org/show_bug.cgi?id=168839
1256         <rdar://problem/30683109>
1257
1258         Reviewed by Darin Adler.
1259
1260         Sanitize Download attribute before using it as a suggested filename for the download.
1261         We rely on ResourceResponse's sanitizing of the suggested filename to do so, which has
1262         the benefit of being consistent with downloads without the download attribute.
1263
1264         Tests: fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-doublequote.html
1265                fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-slashes.html
1266                fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-unicode.html
1267
1268         * html/HTMLAnchorElement.cpp:
1269         (WebCore::HTMLAnchorElement::handleClick):
1270         * platform/network/ResourceResponseBase.cpp:
1271         (WebCore::ResourceResponseBase::sanitizeSuggestedFilename):
1272         * platform/network/ResourceResponseBase.h:
1273
1274 2017-02-24  Miguel Gomez  <magomez@igalia.com>
1275
1276         [GTK] WebkitWebProcess crashes on exit on nvidia if threaded compositing is enabled
1277         https://bugs.webkit.org/show_bug.cgi?id=165522
1278
1279         Reviewed by Carlos Garcia Campos.
1280
1281         Before destrying a GLContextGLX we need to set the default framebufer to avoid a bug
1282         in some nvidia drivers. Ensure that we set the context as current before performing
1283         that operation, and set the appropriate current context after doing so.
1284
1285         No new tests.
1286
1287         * platform/graphics/glx/GLContextGLX.cpp:
1288         (WebCore::GLContextGLX::~GLContextGLX):
1289
1290 2017-02-24  Chris Dumez  <cdumez@apple.com>
1291
1292         [iOS][WK2] Disable network cache speculative revalidation / loading in low power mode
1293         https://bugs.webkit.org/show_bug.cgi?id=168832
1294         <rdar://problem/30697911>
1295
1296         Reviewed by Antti Koivisto.
1297
1298         Add LowPowerModeNotifier class to monitor low power mode state on iOS.
1299
1300         * WebCore.xcodeproj/project.pbxproj:
1301         * platform/LowPowerModeNotifier.cpp: Added.
1302         (WebCore::LowPowerModeNotifier::LowPowerModeNotifier):
1303         (WebCore::LowPowerModeNotifier::isLowPowerModeEnabled):
1304         * platform/LowPowerModeNotifier.h: Added.
1305         * platform/ios/LowPowerModeNotifierIOS.mm: Added.
1306         (-[WebLowPowerModeObserver initWithNotifier:]):
1307         (-[WebLowPowerModeObserver dealloc]):
1308         (-[WebLowPowerModeObserver _didReceiveLowPowerModeChange]):
1309         (WebCore::LowPowerModeNotifier::LowPowerModeNotifier):
1310         (WebCore::LowPowerModeNotifier::isLowPowerModeEnabled):
1311         (WebCore::LowPowerModeNotifier::notifyLowPowerModeChanged):
1312         (WebCore::notifyLowPowerModeChanged):
1313
1314 2017-02-24  Chris Dumez  <cdumez@apple.com>
1315
1316         [Mac] Report domains using abnormally high memory usage via enhanced privacy logging
1317         https://bugs.webkit.org/show_bug.cgi?id=168797
1318         <rdar://problem/29964017>
1319
1320         Reviewed by Andreas Kling.
1321
1322         Report domains using abnormally high memory usage (> 2GB) via enhanced privacy
1323         logging on Mac.
1324
1325         * page/DiagnosticLoggingKeys.cpp:
1326         (WebCore::DiagnosticLoggingKeys::domainCausingJetsamKey):
1327         * page/DiagnosticLoggingKeys.h:
1328         * page/PerformanceMonitor.cpp:
1329         (WebCore::reportPageOverPostLoadResourceThreshold):
1330         (WebCore::PerformanceMonitor::measurePostLoadCPUUsage):
1331         (WebCore::PerformanceMonitor::measurePostLoadMemoryUsage):
1332         (WebCore::reportPageOverPostLoadCPUUsageThreshold): Deleted.
1333
1334 2017-02-24  Alex Christensen  <achristensen@webkit.org>
1335
1336         .. should not remove windows drive letters in paths of file URLs
1337         https://bugs.webkit.org/show_bug.cgi?id=168824
1338
1339         Reviewed by Youenn Fablet.
1340
1341         It's specified in https://url.spec.whatwg.org/#shorten-a-urls-path and helps behavior for browsers on Windows.
1342         It can't hurt to pass a few more web platform tests, though.
1343
1344         * platform/URLParser.cpp:
1345         (WebCore::URLParser::copyURLPartsUntil):
1346         (WebCore::URLParser::shouldPopPath):
1347         (WebCore::URLParser::popPath):
1348         (WebCore::URLParser::parse):
1349         * platform/URLParser.h:
1350
1351 2017-02-24  Csaba Osztrogon√°c  <ossy@webkit.org>
1352
1353         [Mac][cmake] Unreviewed buildfix after r212736.
1354
1355         * PlatformMac.cmake:
1356
1357 2017-02-24  John Wilander  <wilander@apple.com>
1358
1359         Resource Load Statistics: Add alternate classification method
1360         https://bugs.webkit.org/show_bug.cgi?id=168347
1361         <rdar://problem/30352793>
1362         <rdar://problem/30646710>
1363         <rdar://problem/30660708>
1364
1365         Reviewed by Alex Christensen.
1366
1367         This patch only adds test infrastructure in WebCore.
1368
1369         Tests: http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-mixed-statistics.html
1370                http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-sub-frame-under-top-frame-origins.html
1371                http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-under-top-frame-origins.html
1372                http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-unique-redirects-to.html
1373                http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-mixed-statistics.html
1374                http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-sub-frame-under-top-frame-origins.html
1375                http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-under-top-frame-origins.html
1376                http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-unique-redirects-to.html
1377
1378         * loader/ResourceLoadObserver.cpp:
1379         (WebCore::ResourceLoadObserver::setSubframeUnderTopFrameOrigin):
1380         (WebCore::ResourceLoadObserver::setSubresourceUnderTopFrameOrigin):
1381         (WebCore::ResourceLoadObserver::setSubresourceUniqueRedirectTo):
1382         * loader/ResourceLoadObserver.h:
1383
1384 2017-02-23  Antoine Quint  <graouts@apple.com>
1385
1386         [Modern Media Controls] No controls are shown for <audio preload="none">
1387         https://bugs.webkit.org/show_bug.cgi?id=168800
1388         <rdar://problem/30652142>
1389
1390         Reviewed by Eric Carlson.
1391
1392         A media element's currentSrc property will only be set when data has started
1393         to load. In the case where preload="none" is used, regardless of whether a
1394         source is specified, currentSrc would be the empty string and we wouldn't
1395         show controls at all. Identifying whether a source is specified is a little
1396         tricky because it could be specified in a variety of ways and dynamically
1397         as well.
1398
1399         So instead we optimistically show controls always provided the "controls"
1400         attribute is set.
1401
1402         * Modules/modern-media-controls/media/controls-visibility-support.js:
1403         (ControlsVisibilitySupport.prototype._updateControls):
1404         (ControlsVisibilitySupport):
1405         * Modules/modern-media-controls/media/start-support.js:
1406         (StartSupport.prototype._shouldShowStartButton):
1407         (StartSupport):
1408
1409 2017-02-23  Joseph Pecoraro  <pecoraro@apple.com>
1410
1411         [Resource Timing] Gather timing information with reliable responseEnd time
1412         https://bugs.webkit.org/show_bug.cgi?id=168351
1413
1414         Reviewed by Alex Christensen.
1415
1416         This patch replaces the unused `double finishTime` in ResourceLoader's
1417         didFinishLoad with a complete WebCore::NetworkLoadMetrics object. This
1418         allows the NetworkProcess to give complete timing information, and more
1419         final metrics about the load, to WebCore. Currently this is only used
1420         by ResourceTiming, but it will soon be used by Web Inspector as well.
1421         We may also end up extending this to the didFail path as well, since it
1422         is possible that we have some metrics for load failures.
1423
1424         At the same time we want to start moving away from the legacy path that
1425         populated a subset of this information in ResourceResponse's NetworkLoadMetrics.
1426         It doesn't make sense to store this information on the ResourceResponse
1427         for a few reasons: We don't want to store the metrics in our Network Cache and
1428         not all of the load timing metrics have been populated yet (responseEnd).
1429         In an effort to move off of this data we've renamed the accessor to
1430         "deprecatedNetworkLoadMetrics". There are a few remaining clients
1431         (ResourceHandle, PerformanceTiming, InspectorNetworkAgent) which can be
1432         migrated separately from this patch.
1433
1434         Having both the legacy and new code paths adds a little bit of complexity.
1435         One advantage of the new path is that the complete load timing data
1436         (fetchStart -> dns -> connect -> request -> response -> responseEnd) can
1437         be packaged together. The legacy path could not include a responseEnd, so
1438         WebCore faked that value with its own timestamp. Having the fake responseEnd
1439         caused issues as timestamps / clocks are different between processes. In order
1440         for PerformanceResponseTiming to know whether or not the NetworkLoadMetrics
1441         has the complete network timing metrics it checks isComplete(). If true
1442         it knows it can use the responseEnd time from NetworkLoadMetrics, otherwise
1443         it must fallback to the legacy value from LoadTiming. Once all of the
1444         deprecatedNetworkLoadMetrics clients go away, we should always have the
1445         complete data and this can be eliminated.
1446
1447         Tests: imported/w3c/web-platform-tests/resource-timing/rt-nextHopProtocol.html
1448                imported/w3c/web-platform-tests/resource-timing/rt-nextHopProtocol.worker.html
1449
1450         * PlatformMac.cmake:
1451         * WebCore.xcodeproj/project.pbxproj:
1452         Rename NetworkLoadTiming -> NetworkLoadMetrics.
1453
1454         * page/PerformanceResourceTiming.cpp:
1455         (WebCore::entryStartTime):
1456         (WebCore::entryEndTime):
1457         (WebCore::PerformanceResourceTiming::PerformanceResourceTiming):
1458         (WebCore::PerformanceResourceTiming::nextHopProtocol):
1459         (WebCore::PerformanceResourceTiming::domainLookupStart):
1460         (WebCore::PerformanceResourceTiming::domainLookupEnd):
1461         (WebCore::PerformanceResourceTiming::connectStart):
1462         (WebCore::PerformanceResourceTiming::connectEnd):
1463         (WebCore::PerformanceResourceTiming::secureConnectionStart):
1464         (WebCore::PerformanceResourceTiming::requestStart):
1465         (WebCore::PerformanceResourceTiming::responseStart):
1466         (WebCore::PerformanceResourceTiming::responseEnd):
1467         (WebCore::PerformanceResourceTiming::networkLoadTimeToDOMHighResTimeStamp):
1468         * page/PerformanceResourceTiming.h:
1469         Mostly just updating names and types. This does however need to get the
1470         correct endTime based on whether the NetworkLoadMetrics are complete
1471         (meaning includes responseEnd) or not (legacy, use LoadTiming value).
1472
1473         * page/PerformanceResourceTiming.idl:
1474         Add nextHopProtocol.
1475
1476         * page/PerformanceTiming.cpp:
1477         (WebCore::PerformanceTiming::domainLookupStart):
1478         (WebCore::PerformanceTiming::domainLookupEnd):
1479         (WebCore::PerformanceTiming::connectStart):
1480         (WebCore::PerformanceTiming::connectEnd):
1481         (WebCore::PerformanceTiming::secureConnectionStart):
1482         (WebCore::PerformanceTiming::requestStart):
1483         (WebCore::PerformanceTiming::responseStart):
1484         (WebCore::PerformanceTiming::resourceLoadTimeRelativeToFetchStart):
1485         * page/PerformanceTiming.h:
1486         Navigation Timing values still uses the NetworkLoadTiming values stored on
1487         the DocumentLoader. This should be moved off of the deprecated path separately.
1488
1489         * platform/network/NetworkLoadMetrics.h: Renamed from Source/WebCore/platform/network/NetworkLoadTiming.h.
1490         (WebCore::NetworkLoadMetrics::NetworkLoadMetrics):
1491         (WebCore::NetworkLoadMetrics::isolatedCopy):
1492         (WebCore::NetworkLoadMetrics::reset):
1493         (WebCore::NetworkLoadMetrics::operator==):
1494         (WebCore::NetworkLoadMetrics::operator!=):
1495         (WebCore::NetworkLoadMetrics::isComplete):
1496         (WebCore::NetworkLoadMetrics::markComplete):
1497         (WebCore::NetworkLoadMetrics::encode):
1498         (WebCore::NetworkLoadMetrics::decode):
1499         Re-introduce a reset() method (for NetworkLoadSoup to reset between redirects).
1500         Add protocolName and "complete" boolean.
1501
1502         * platform/network/cocoa/NetworkLoadMetrics.mm: Renamed from Source/WebCore/platform/network/cocoa/NetworkLoadTiming.mm.
1503         (WebCore::timingValue):
1504         (WebCore::copyTimingData):
1505         (WebCore::setCollectsTimingData):
1506         Use this opportunity to convert NetworkLoadTiming timestamps to WTF::Seconds.
1507         Since we already have to modify all the clients this moves us to use the more
1508         strongly typed units that are less ambiguous then "double". The rest of the
1509         Performance API has already moved to these units.
1510
1511         * inspector/InspectorNetworkAgent.cpp:
1512         (WebCore::InspectorNetworkAgent::buildObjectForTiming):
1513         (WebCore::InspectorNetworkAgent::buildObjectForResourceResponse):
1514         (WebCore::InspectorNetworkAgent::didFinishLoading):
1515         * inspector/InspectorNetworkAgent.h:
1516         Inspector was the only client of the finishTime, and since the value was
1517         erratically coming from clients in different ways it was almost certainly
1518         inaccurate. Simplify this in preparation for using NetworkLoadMetrics.
1519
1520         * Modules/fetch/FetchLoader.cpp:
1521         (WebCore::FetchLoader::didFinishLoading):
1522         * Modules/fetch/FetchLoader.h:
1523         * fileapi/FileReaderLoader.cpp:
1524         (WebCore::FileReaderLoader::didFinishLoading):
1525         * fileapi/FileReaderLoader.h:
1526         * html/MediaFragmentURIParser.cpp:
1527         (WebCore::MediaFragmentURIParser::parseNPTTime):
1528         * inspector/InspectorInstrumentation.cpp:
1529         (WebCore::InspectorInstrumentation::didFinishLoadingImpl):
1530         * inspector/InspectorInstrumentation.h:
1531         (WebCore::InspectorInstrumentation::didFinishLoading):
1532         * loader/CrossOriginPreflightChecker.cpp:
1533         (WebCore::CrossOriginPreflightChecker::validatePreflightResponse):
1534         * loader/DocumentLoader.cpp:
1535         (WebCore::DocumentLoader::notifyFinished):
1536         (WebCore::DocumentLoader::finishedLoading):
1537         (WebCore::DocumentLoader::continueAfterContentPolicy):
1538         (WebCore::DocumentLoader::maybeLoadEmpty):
1539         * loader/DocumentLoader.h:
1540         * loader/DocumentThreadableLoader.cpp:
1541         (WebCore::DocumentThreadableLoader::didReceiveResponse):
1542         (WebCore::DocumentThreadableLoader::notifyFinished):
1543         (WebCore::DocumentThreadableLoader::didFinishLoading):
1544         (WebCore::DocumentThreadableLoader::loadRequest):
1545         * loader/DocumentThreadableLoader.h:
1546         * loader/NetscapePlugInStreamLoader.cpp:
1547         (WebCore::NetscapePlugInStreamLoader::didFinishLoading):
1548         * loader/NetscapePlugInStreamLoader.h:
1549         * loader/ResourceLoadNotifier.cpp:
1550         (WebCore::ResourceLoadNotifier::didFinishLoad):
1551         (WebCore::ResourceLoadNotifier::dispatchDidFinishLoading):
1552         (WebCore::ResourceLoadNotifier::sendRemainingDelegateMessages):
1553         * loader/ResourceLoadNotifier.h:
1554         * loader/ResourceLoader.cpp:
1555         (WebCore::ResourceLoader::deliverResponseAndData):
1556         (WebCore::ResourceLoader::loadDataURL):
1557         (WebCore::ResourceLoader::didFinishLoading):
1558         (WebCore::ResourceLoader::didFinishLoadingOnePart):
1559         * loader/ResourceLoader.h:
1560         * loader/ResourceTiming.cpp:
1561         (WebCore::ResourceTiming::fromLoad):
1562         (WebCore::ResourceTiming::fromSynchronousLoad):
1563         (WebCore::ResourceTiming::ResourceTiming):
1564         (WebCore::ResourceTiming::isolatedCopy):
1565         * loader/ResourceTiming.h:
1566         (WebCore::ResourceTiming::networkLoadMetrics):
1567         (WebCore::ResourceTiming::ResourceTiming):
1568         (WebCore::ResourceTiming::networkLoadTiming): Deleted.
1569         * loader/SubresourceLoader.cpp:
1570         (WebCore::SubresourceLoader::SubresourceLoader):
1571         (WebCore::SubresourceLoader::willSendRequestInternal):
1572         (WebCore::SubresourceLoader::didReceiveResponse):
1573         (WebCore::SubresourceLoader::didFinishLoading):
1574         (WebCore::SubresourceLoader::reportResourceTiming):
1575         * loader/SubresourceLoader.h:
1576         * loader/ThreadableLoaderClient.h:
1577         (WebCore::ThreadableLoaderClient::didFinishLoading):
1578         * loader/ThreadableLoaderClientWrapper.h:
1579         (WebCore::ThreadableLoaderClientWrapper::didFinishLoading):
1580         * loader/WorkerThreadableLoader.cpp:
1581         (WebCore::WorkerThreadableLoader::MainThreadBridge::didFinishLoading):
1582         * loader/WorkerThreadableLoader.h:
1583         * loader/appcache/ApplicationCacheGroup.cpp:
1584         (WebCore::ApplicationCacheGroup::didFinishLoading):
1585         * loader/appcache/ApplicationCacheGroup.h:
1586         * loader/cache/CachedResource.h:
1587         (WebCore::CachedResource::setLoadFinishTime):
1588         * loader/ios/QuickLook.mm:
1589         (-[WebPreviewLoader connectionDidFinishLoading:]):
1590         * page/EventSource.cpp:
1591         (WebCore::EventSource::didFinishLoading):
1592         * page/EventSource.h:
1593         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
1594         (ResourceHandleStreamingClient::didFinishLoading):
1595         * platform/network/BlobResourceHandle.cpp:
1596         (WebCore::doNotifyFinish):
1597         * platform/network/PingHandle.h:
1598         * platform/network/ResourceHandle.h:
1599         * platform/network/ResourceHandleClient.h:
1600         (WebCore::ResourceHandleClient::didFinishLoading):
1601         * platform/network/ResourceResponseBase.cpp:
1602         (WebCore::ResourceResponseBase::crossThreadData):
1603         (WebCore::ResourceResponseBase::fromCrossThreadData):
1604         (WebCore::ResourceResponseBase::compare):
1605         * platform/network/ResourceResponseBase.h:
1606         (WebCore::ResourceResponseBase::deprecatedNetworkLoadMetrics):
1607         (WebCore::ResourceResponseBase::encode):
1608         (WebCore::ResourceResponseBase::decode):
1609         (WebCore::ResourceResponseBase::networkLoadTiming): Deleted.
1610         * platform/network/SynchronousLoaderClient.cpp:
1611         (WebCore::SynchronousLoaderClient::didFinishLoading):
1612         * platform/network/SynchronousLoaderClient.h:
1613         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
1614         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
1615         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didFinishLoading):
1616         * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
1617         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveResponse):
1618         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didFinishLoading):
1619         * platform/network/curl/ResourceHandleCurl.cpp:
1620         (WebCore::WebCoreSynchronousLoader::didFinishLoading):
1621         * platform/network/curl/ResourceHandleManager.cpp:
1622         (WebCore::calculateWebTimingInformations):
1623         (WebCore::ResourceHandleManager::downloadTimerCallback):
1624         (WebCore::handleDataURL):
1625         (WebCore::milisecondsSinceRequest): Deleted.
1626         * platform/network/mac/ResourceHandleMac.mm:
1627         (WebCore::ResourceHandle::getConnectionTimingData):
1628         * platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
1629         (-[WebCoreResourceHandleAsDelegate connection:didReceiveResponse:]):
1630         (-[WebCoreResourceHandleAsDelegate connectionDidFinishLoading:]):
1631         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
1632         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]):
1633         (-[WebCoreResourceHandleAsOperationQueueDelegate connectionDidFinishLoading:]):
1634         * platform/network/soup/ResourceHandleSoup.cpp:
1635         (WebCore::restartedCallback):
1636         (WebCore::nextMultipartResponsePartCallback):
1637         (WebCore::sendRequestCallback):
1638         (WebCore::ResourceHandle::didStartRequest):
1639         (WebCore::networkEventCallback):
1640         (WebCore::ResourceHandle::sendPendingRequest):
1641         (WebCore::readCallback):
1642         (WebCore::milisecondsSinceRequest): Deleted.
1643         * workers/WorkerScriptLoader.cpp:
1644         (WebCore::WorkerScriptLoader::didFinishLoading):
1645         * workers/WorkerScriptLoader.h:
1646         * xml/XMLHttpRequest.cpp:
1647         (WebCore::XMLHttpRequest::didFinishLoading):
1648         * xml/XMLHttpRequest.h:
1649         Eliminate the unused finishTime double.
1650
1651 2017-02-23  Antoine Quint  <graouts@apple.com>
1652
1653         [Modern Media Controls] Controls overflow when media element has border or padding
1654         https://bugs.webkit.org/show_bug.cgi?id=168818
1655         <rdar://problem/30689780>
1656
1657         Reviewed by Jon Lee.
1658
1659         We used to query the media element's layout size to compute the size of the media controls,
1660         which would account for border and padding. Instead, we should use the size of the container,
1661         at the root of the ShadowRoot, which will always match the size of the media.
1662
1663         Test: media/modern-media-controls/media-controller/media-controller-controls-sizing-with-border-and-padding.html
1664
1665         * Modules/modern-media-controls/controls/media-controls.css:
1666         (.media-controls-container,):
1667         * Modules/modern-media-controls/media/media-controller.js:
1668         (MediaController.prototype._updateControlsSize):
1669         (MediaController.prototype._controlsWidth):
1670
1671 2017-02-23  Antoine Quint  <graouts@apple.com>
1672
1673         [Modern Media Controls] Dragging controls in fullscreen on macOS prevents scrubbing or interacting with controls
1674         https://bugs.webkit.org/show_bug.cgi?id=168820
1675         <rdar://problem/30690281>
1676
1677         Reviewed by Jon Lee.
1678
1679         We broke this in https://bugs.webkit.org/show_bug.cgi?id=168755. We restore the check that the
1680         event target when initiating a drag is the controls bar itself and not some of its content.
1681
1682         Since this wasn't caught by our existing tests, we add a test that attemps to initiate a drag
1683         starting over one of the controls and notice that no dragging occurs.
1684
1685         Test: media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-drag-is-prevented-over-button.html
1686
1687         * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
1688         (MacOSFullscreenMediaControls.prototype._handleMousedown):
1689
1690 2017-02-23  Simon Fraser  <simon.fraser@apple.com>
1691
1692         REGRESSION (r211305): Masks on composited elements with preserve-3d broken
1693         https://bugs.webkit.org/show_bug.cgi?id=168815
1694         rdar://problem/30676846
1695
1696         Reviewed by Jon Lee.
1697
1698         r211305 moved the mask layer to be on the structural layer if there is one, to fix
1699         masking backdrops. However, with preserve-3d the structural layer can be a CATransformLayer,
1700         which doesn't take a mask, so limit the previous change to backdrops only.
1701
1702         Test: compositing/masks/mask-with-preserve-3d.html
1703
1704         * platform/graphics/ca/GraphicsLayerCA.cpp:
1705         (WebCore::GraphicsLayerCA::updateMaskLayer):
1706
1707 2017-02-23  Antoine Quint  <graouts@apple.com>
1708
1709         [Modern Media Controls] Show "Loading" until playback starts
1710         https://bugs.webkit.org/show_bug.cgi?id=168809
1711         <rdar://problem/30687468>
1712
1713         Reviewed by Jon Lee.
1714
1715         We now display the "Loading" status as soon as we've started loading and
1716         until we've obtained enough data to play. No test provided since we don't
1717         have a way to specifically set networkState and readyState to the satisfactory
1718         values.
1719
1720         * Modules/modern-media-controls/media/status-support.js:
1721         (StatusSupport.prototype.syncControl):
1722         (StatusSupport):
1723
1724 2017-02-23  Antoine Quint  <graouts@apple.com>
1725
1726         [Modern Media Controls] Enforce a minimum layout height of 50pt for <audio>
1727         https://bugs.webkit.org/show_bug.cgi?id=168801
1728         <rdar://problem/30683453>
1729
1730         Reviewed by Eric Carlson.
1731
1732         We enforce a 50pt minimum layout height for <audio> elements. There is no way
1733         for the page author to override this value since the min-height property is set
1734         as !important in a <style> element contained in a ShadowRoot.
1735
1736         * Modules/modern-media-controls/controls/media-controls.css:
1737         (:host(audio)):
1738
1739 2017-02-23  Youenn Fablet  <youenn@apple.com>
1740
1741         [WebRTC] Outgoing video quality is poor
1742         https://bugs.webkit.org/show_bug.cgi?id=168778
1743         <rdar://problem/30674673>
1744
1745         Reviewed by Eric Carlson.
1746
1747         Covered by manually ensuring the voice process thread is not spinning.
1748
1749         * platform/mediastream/libwebrtc/LibWebRTCAudioModule.h: Setting the next call to max was not a good idea since the thread process is adding some value to it, making it a negative value.
1750
1751 2017-02-23  Wenson Hsieh  <wenson_hsieh@apple.com>
1752
1753         Data interaction with a URL should navigate the page if the operation is not handled
1754         https://bugs.webkit.org/show_bug.cgi?id=168798
1755         <rdar://problem/30665969>
1756
1757         Reviewed by Tim Horton.
1758
1759         Refactors some drag and drop code on the Mac, and implements PlatformPasteboard::stringForType.
1760
1761         * page/DragController.cpp:
1762         (WebCore::DragController::performDragOperation):
1763         * platform/ios/PlatformPasteboardIOS.mm:
1764         (WebCore::PlatformPasteboard::stringForType):
1765         * platform/mac/DragDataMac.mm:
1766
1767 2017-02-23  Youenn Fablet  <youenn@apple.com>
1768
1769         [WebRTC] RealtimeOutgoingAudioSource does not need to upsample audio buffers
1770         https://bugs.webkit.org/show_bug.cgi?id=168796
1771
1772         Reviewed by Jer Noble.
1773
1774         Covered by manual testing.
1775         Limiting RealtimeOutgoingAudioSource conversion to interleaving and float-to-integer.
1776         Removed the sample rate conversion.
1777
1778         * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
1779         (WebCore::libwebrtcAudioFormat):
1780         (WebCore::RealtimeOutgoingAudioSource::audioSamplesAvailable):
1781         (WebCore::RealtimeOutgoingAudioSource::pullAudioData):
1782
1783 2017-02-23  Alex Christensen  <achristensen@webkit.org>
1784
1785         Re-soft-link CoreVideo after r212906
1786         https://bugs.webkit.org/show_bug.cgi?id=168803
1787
1788         Reviewed by Jer Noble.
1789
1790         CoreVideo should be soft linked to reduce startup time.
1791         Linking against the framework just for a few symbols used in one file was the wrong solution.
1792
1793         * Configurations/WebCore.xcconfig:
1794         * platform/cocoa/CoreVideoSoftLink.cpp:
1795         * platform/cocoa/CoreVideoSoftLink.h:
1796         * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:
1797
1798 2017-02-23  Chris Dumez  <cdumez@apple.com>
1799
1800         Report domains using abnormally high CPU usage via enhanced privacy logging
1801         https://bugs.webkit.org/show_bug.cgi?id=168794
1802         <rdar://problem/29964018>
1803
1804         Reviewed by Ryosuke Niwa.
1805
1806         Report domains using abnormally high CPU usage (> 20%) via enhanced privacy
1807         logging.
1808
1809         * page/DiagnosticLoggingKeys.cpp:
1810         (WebCore::DiagnosticLoggingKeys::domainCausingEnergyDrainKey):
1811         * page/DiagnosticLoggingKeys.h:
1812         * page/PerformanceMonitor.cpp:
1813         (WebCore::reportPageOverPostLoadCPUUsageThreshold):
1814         (WebCore::PerformanceMonitor::measurePostLoadCPUUsage):
1815
1816 2017-02-23  Zalan Bujtas  <zalan@apple.com>
1817
1818         Simple line layout: Adjust RunResolver::lineIndexForHeight with line struts.
1819         https://bugs.webkit.org/show_bug.cgi?id=168783
1820         <rdar://problem/30676449>
1821
1822         Reviewed by Antti Koivisto.
1823
1824         When there's a pagination gap between lines the simple lineIndex = y / lineHeight formula does not work anymore.
1825         This patch takes the line gaps into account by offsetting the y position accordingly.
1826
1827         Not enabled yet.
1828
1829         * rendering/SimpleLineLayoutResolver.cpp:
1830         (WebCore::SimpleLineLayout::RunResolver::lineIndexForHeight):
1831
1832 2017-02-23  Alex Christensen  <achristensen@webkit.org>
1833
1834         Fix iOS WebRTC build after r212812
1835         https://bugs.webkit.org/show_bug.cgi?id=168790
1836
1837         Reviewed by Tim Horton.
1838
1839         * Configurations/WebCore.xcconfig:
1840
1841 2017-02-23  Carlos Garcia Campos  <cgarcia@igalia.com>
1842
1843         [GStreamer] Several layout tests trigger GStreamer-CRITICAL **: gst_bin_get_by_name: assertion 'GST_IS_BIN (bin)' failed
1844         https://bugs.webkit.org/show_bug.cgi?id=167016
1845
1846         Reviewed by Xabier Rodriguez-Calvar.
1847
1848         This is because we create AudioSourceProviderGStreamer objects that are never loaded. In the destructor the
1849         AudioSourceProviderGStreamer calls gst_bin_get_by_name() on its m_audioSinkBin that is nullptr. We could simply
1850         check m_audioSinkBin in the destructor, but I think it's better to simply not create
1851         AudioSourceProviderGStreamer for nothing. MediaPlayerPrivateGStreamer should create the AudioSourceProvider on demand.
1852
1853         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1854         (WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer): Do not create the AudioSourceProvider.
1855         (WebCore::MediaPlayerPrivateGStreamer::createAudioSink): Call ensureAudioSourceProvider() before using m_audioSourceProvider.
1856         (WebCore::MediaPlayerPrivateGStreamer::ensureAudioSourceProvider): Create the AudioSourceProvider if needed.
1857         (WebCore::MediaPlayerPrivateGStreamer::audioSourceProvider): Ensure and return the m_audioSourceProvider.
1858         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
1859
1860 2017-02-23  Tomas Popela  <tpopela@redhat.com>
1861
1862         [GTK] Drag and drop is always moving the content even if copy is requested
1863         https://bugs.webkit.org/show_bug.cgi?id=168424
1864
1865         Reviewed by Carlos Garcia Campos.
1866
1867         Drag and drop is always moving the content around even if the copy is
1868         requested (i.e. by pressing the Control key).
1869
1870         Test: editing/pasteboard/drag-drop-copy-content.html
1871
1872         * page/gtk/DragControllerGtk.cpp:
1873         (WebCore::DragController::isCopyKeyDown):
1874
1875 2017-02-22  Myles C. Maxfield  <mmaxfield@apple.com>
1876
1877         [Cocoa] Remove Yosemite-specific font lookup code
1878         https://bugs.webkit.org/show_bug.cgi?id=168682
1879
1880         Reviewed by Zalan Bujtas.
1881
1882         No new tests because there is no behavior change.
1883
1884         * platform/graphics/cocoa/FontCacheCoreText.cpp:
1885         (WebCore::platformFontLookupWithFamily):
1886         (WebCore::fontWithFamily):
1887         * platform/graphics/mac/FontCacheMac.mm:
1888         (WebCore::platformInvalidateFontCache):
1889         (WebCore::acceptableChoice): Deleted.
1890         (WebCore::betterChoice): Deleted.
1891         (WebCore::desiredFamilyToAvailableFamilyMap): Deleted.
1892         (WebCore::hasDesiredFamilyToAvailableFamilyMapping): Deleted.
1893         (WebCore::rememberDesiredFamilyToAvailableFamilyMapping): Deleted.
1894         (WebCore::toAppKitFontWeight): Deleted.
1895         (WebCore::appkitWeightToFontWeight): Deleted.
1896         (WebCore::toNSFontTraits): Deleted.
1897         (WebCore::platformFontWithFamily): Deleted.
1898
1899 2017-02-22  Antoine Quint  <graouts@apple.com>
1900
1901         [Modern Media Controls] Clicking on the video doesn't toggle playback state in fullscreen on macOS
1902         https://bugs.webkit.org/show_bug.cgi?id=168755
1903         <rdar://problem/30664484>
1904
1905         Reviewed by Dean Jackson.
1906
1907         We now call super in the handleEvent() method of MacOSFullscreenMediaControls if we're not dealing
1908         with an event type and target combination that was specifically registered in this class's scope.
1909         We had mistakenly added the call to super.handleEvent(event) in the wrong method when fixing
1910         https://bugs.webkit.org/show_bug.cgi?id=168515.
1911
1912         Test: media/modern-media-controls/media-controller/media-controller-click-on-video-background-should-pause-fullscreen.html
1913
1914         * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
1915         (MacOSFullscreenMediaControls.prototype.handleEvent):
1916         (MacOSFullscreenMediaControls.prototype._handleMousedown):
1917         * Modules/modern-media-controls/controls/macos-media-controls.js:
1918         (MacOSMediaControls.prototype.handleEvent):
1919         (MacOSMediaControls):
1920
1921 2017-02-22  Antoine Quint  <graouts@apple.com>
1922
1923         [Modern Media Controls] Scrubber stops moving while scrubbing on macOS
1924         https://bugs.webkit.org/show_bug.cgi?id=168518
1925         <rdar://problem/30577637>
1926
1927         Reviewed by Dean Jackson.
1928
1929         As we start to scrub, controlValueWillStartChanging() is called on
1930         ScrubberSupport and pauses the media if it's not already paused. This
1931         causes the play/pause button to change icon and for layout() to be
1932         called on MacOSInlineMediaControls. This in turns sets the .children
1933         property on the .controlsBar and eventually yields a DOM manipulation
1934         which re-inserts the scrubber's DOM hierarchy, causing stutters during
1935         user interaction.
1936
1937         Our solution is to make the .children setter smarter about identifying
1938         that the children list hasn't changed and that no DOM invalidation is
1939         necessary.
1940
1941         * Modules/modern-media-controls/controls/layout-node.js:
1942         (LayoutNode.prototype.set children):
1943
1944 2017-02-22  Antoine Quint  <graouts@apple.com>
1945
1946         [Modern Media Controls] Controls bar may disappear while captions menu is visible
1947         https://bugs.webkit.org/show_bug.cgi?id=168751
1948         <rdar://problem/30663411>
1949
1950         Reviewed by Dean Jackson.
1951
1952         We now prevent the controls bar from fading out due to the auto-hide timer firing
1953         when the tracks panel is up, and wait until the track panel is hidden before fading
1954         the controls bar.
1955
1956         Test: media/modern-media-controls/tracks-panel/tracks-panel-prevent-controls-bar-from-fading.html
1957
1958         * Modules/modern-media-controls/controls/controls-bar.js:
1959         (ControlsBar.prototype.set userInteractionEnabled):
1960         (ControlsBar.prototype._autoHideTimerFired):
1961
1962 2017-02-22  Antoine Quint  <graouts@apple.com>
1963
1964         [Modern Media Controls] Can't set the volume slider with macOS inline controls
1965         https://bugs.webkit.org/show_bug.cgi?id=168747
1966         <rdar://problem/30605528>
1967
1968         Reviewed by Dean Jackson.
1969
1970         Only call super for events we haven't registered specifically in the context
1971         of this class. Otherwise we'd invalidate the volume container visibility for
1972         a "mousedown" event registered by the MacOSMediaControls, the super class.
1973
1974         * Modules/modern-media-controls/controls/macos-inline-media-controls.js:
1975         (MacOSInlineMediaControls.prototype.handleEvent):
1976
1977 2017-02-22  Antti Koivisto  <antti@apple.com>
1978
1979         Replace SimpleLineLayout::Range by WTF::IteratorRange
1980         https://bugs.webkit.org/show_bug.cgi?id=168742
1981
1982         Reviewed by Zalan Bujtas.
1983
1984         Kill a redundant custom type.
1985
1986         * rendering/SimpleLineLayoutResolver.cpp:
1987         (WebCore::SimpleLineLayout::RunResolver::rangeForRect):
1988         (WebCore::SimpleLineLayout::RunResolver::rangeForRenderer):
1989         (WebCore::SimpleLineLayout::RunResolver::rangeForRendererWithOffsets):
1990         * rendering/SimpleLineLayoutResolver.h:
1991         (WebCore::SimpleLineLayout::LineResolver::rangeForRect):
1992         (WebCore::SimpleLineLayout::Range::Range): Deleted.
1993         (WebCore::SimpleLineLayout::Range::begin): Deleted.
1994         (WebCore::SimpleLineLayout::Range::end): Deleted.
1995
1996 2017-02-22  Simon Fraser  <simon.fraser@apple.com>
1997
1998         Add the Web Authentication API as "Under Consideration".
1999
2000         * features.json:
2001
2002 2017-02-22  Zalan Bujtas  <zalan@apple.com>
2003
2004         Simple line layout: Set the pagination strut on the flow when the first line does not fit the page.
2005         https://bugs.webkit.org/show_bug.cgi?id=168738
2006         <rdar://problem/30659469>
2007
2008         Reviewed by Antti Koivisto.
2009
2010         The pagination strut for the first line is tracked by the parent RenderBlockFlow and not by
2011         the line itself (see RenderBlockFlow::adjustLinePositionForPagination()). Also renamed *PaginationStrut* to
2012         *LineStrut* to make sure we don't confuse it with the block level strut.
2013
2014         Not enabled yet.
2015
2016         * rendering/SimpleLineLayout.cpp:
2017         (WebCore::SimpleLineLayout::computeLineTopAndBottomWithOverflow):
2018         (WebCore::SimpleLineLayout::computeLineBreakIndex):
2019         (WebCore::SimpleLineLayout::setPageBreakForLine):
2020         (WebCore::SimpleLineLayout::adjustLinePositionsForPagination):
2021         (WebCore::SimpleLineLayout::create):
2022         (WebCore::SimpleLineLayout::Layout::create):
2023         (WebCore::SimpleLineLayout::Layout::Layout):
2024         * rendering/SimpleLineLayout.h:
2025         (WebCore::SimpleLineLayout::Layout::hasLineStruts):
2026         (WebCore::SimpleLineLayout::Layout::struts):
2027         (WebCore::SimpleLineLayout::Layout::hasPaginationStruts): Deleted.
2028         * rendering/SimpleLineLayoutFunctions.cpp:
2029         (WebCore::SimpleLineLayout::paintFlow):
2030         * rendering/SimpleLineLayoutFunctions.h:
2031         (WebCore::SimpleLineLayout::computeFlowHeight):
2032         * rendering/SimpleLineLayoutResolver.h:
2033         (WebCore::SimpleLineLayout::RunResolver::Run::computeBaselinePosition):
2034
2035 2017-02-22  Youenn Fablet  <youenn@apple.com>
2036
2037         [WebRTC] Disable libwebrtc stderr logging in release mode
2038         https://bugs.webkit.org/show_bug.cgi?id=168734
2039
2040         Reviewed by Tim Horton.
2041
2042         No change of behavior.
2043
2044         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
2045         (WebCore::initializePeerConnectionFactoryAndThreads):
2046
2047 2017-02-22  Jer Noble  <jer.noble@apple.com>
2048
2049         MediaStreamSourceNode never receives audio from MockRealtimeAudioSourceMac.
2050         https://bugs.webkit.org/show_bug.cgi?id=168731
2051
2052         Reviewed by Eric Carlson.
2053
2054         Test: fast/mediastream/mock-media-source-webaudio.html
2055
2056         Because the audioSourceProvider can be created before the mock source is configured, explicitly configure the
2057         source if necessary after creating the audioSourceProvider.
2058
2059         * platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
2060         (WebCore::MockRealtimeAudioSourceMac::audioSourceProvider):
2061
2062 2017-02-22  Chris Dumez  <cdumez@apple.com>
2063
2064         Do not aggressively throttle DOM timers until they've reached their max nesting level
2065         https://bugs.webkit.org/show_bug.cgi?id=168700
2066         <rdar://problem/29808005>
2067
2068         Reviewed by Simon Fraser.
2069
2070         Do not aggressively throttle DOM timers until they've actually areached their max
2071         nesting level (5). This overly aggressive throttling of non-nested timers is what
2072         was causing Google Maps to use 100% CPU in background tabs for several minutes.
2073
2074         Test: fast/dom/timer-throttling-hidden-page-non-nested.html
2075
2076         * dom/Document.cpp:
2077         (WebCore::Document::timerAlignmentInterval):
2078
2079 2017-02-22  Eric Carlson  <eric.carlson@apple.com>
2080
2081         [MediaStream iOS] Respond to capture interruptions and notifications
2082         https://bugs.webkit.org/show_bug.cgi?id=168610
2083
2084         Reviewed by Jer Noble.
2085
2086         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
2087         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayer): Drive-by cleanup: don't create
2088         a sample buffer display layer unless there is an active video track.
2089
2090         * platform/mediastream/mac/AVMediaCaptureSource.h:
2091         * platform/mediastream/mac/AVMediaCaptureSource.mm:
2092         (WebCore::AVMediaCaptureSource::AVMediaCaptureSource): Add static_asserts to ensure that
2093         WebCore::InterruptionReason values map directly to AVCaptureSessionInterruptionReason values.
2094         (WebCore::AVMediaCaptureSource::~AVMediaCaptureSource): Minor cleanup.
2095         (WebCore::AVMediaCaptureSource::startProducingData): Start listening for notifications before
2096         starting the session.
2097         (WebCore::AVMediaCaptureSource::stopProducingData): Remove the notification observers before
2098         stopping the session.
2099         (WebCore::AVMediaCaptureSource::setupSession): Minor style cleanup.
2100         (WebCore::AVMediaCaptureSource::captureSessionRuntimeError): New. When the error is AVErrorMediaServicesWereReset,
2101         sometimes caused by a mediaserverd crash, try to restart the session one time.
2102         (WebCore::AVMediaCaptureSource::captureSessionBeginInterruption): Store the interruption reason.
2103         (WebCore::AVMediaCaptureSource::captureSessionEndInterruption): Try to restart the session if
2104         it was interrupted because the app went into multi-app layout mode.
2105         (WebCore::sessionKVOProperties): Drive-by cleanup.
2106         (-[WebCoreAVMediaCaptureSourceObserver initWithCallback:]):
2107         (-[WebCoreAVMediaCaptureSourceObserver disconnect]):
2108         (-[WebCoreAVMediaCaptureSourceObserver addNotificationObservers]):
2109         (-[WebCoreAVMediaCaptureSourceObserver removeNotificationObservers]):
2110         (-[WebCoreAVMediaCaptureSourceObserver sessionRuntimeError:]):
2111         (-[WebCoreAVMediaCaptureSourceObserver beginSessionInterrupted:]):
2112         (-[WebCoreAVMediaCaptureSourceObserver endSessionInterrupted:]):
2113
2114         * platform/mediastream/mac/AVVideoCaptureSource.mm:
2115         (WebCore::AVVideoCaptureSource::initializeCapabilities): Not all AVCaptureSession preset strings
2116         are available on all platforms so load with SOFT_LINK_POINTER_OPTIONAL and NULL check before use.
2117         (WebCore::sizeForPreset): Ditto.
2118         (WebCore::AVVideoCaptureSource::bestSessionPresetForVideoDimensions): Ditto.
2119
2120 2017-02-22  Zalan Bujtas  <zalan@apple.com>
2121
2122         Simple line layout: ensureLineBoxes for paginated content.
2123         https://bugs.webkit.org/show_bug.cgi?id=168729
2124         <rdar://problem/30654400>
2125
2126         Reviewed by Antti Koivisto.
2127
2128         This patch sets the layout state bits for paginated subtree layout, when we are switching
2129         over from simple line runs to inline tree. 
2130
2131         Not enabled yet.
2132
2133         * rendering/RenderBlockFlow.cpp:
2134         (WebCore::RenderBlockFlow::ensureLineBoxes):
2135         * rendering/RenderView.cpp:
2136         (WebCore::RenderView::pushLayoutStateForPagination): LayoutUnit(1) is not the real height, it's just
2137         an indicator that we've got paginated content.
2138         * rendering/RenderView.h:
2139         * rendering/SimpleLineLayout.cpp:
2140         (WebCore::SimpleLineLayout::create):
2141         (WebCore::SimpleLineLayout::Layout::create):
2142         (WebCore::SimpleLineLayout::Layout::Layout):
2143         * rendering/SimpleLineLayout.h:
2144         (WebCore::SimpleLineLayout::Layout::isPaginated):
2145         (WebCore::SimpleLineLayout::Layout::hasPaginationStruts):
2146         * rendering/SimpleLineLayoutFunctions.h:
2147         (WebCore::SimpleLineLayout::computeFlowHeight):
2148         * rendering/SimpleLineLayoutResolver.h:
2149         (WebCore::SimpleLineLayout::RunResolver::Run::computeBaselinePosition):
2150
2151 2017-02-22  Per Arne Vollan  <pvollan@apple.com>
2152
2153         [Win] Compile fix.
2154         https://bugs.webkit.org/show_bug.cgi?id=168713
2155
2156         Reviewed by Brent Fulgham.
2157
2158         The include file <ANGLE/ShaderLang.h> is not found.
2159
2160         * testing/Internals.cpp:
2161
2162 2017-02-22  Xabier Rodriguez Calvar  <calvaris@igalia.com>
2163
2164         [GStreamer][EME] Fix issue with allowed systems extraction
2165         https://bugs.webkit.org/show_bug.cgi?id=168717
2166
2167         Reviewed by Carlos Garcia Campos.
2168
2169         The allowed systems were not being extracted from the need-context
2170         message because the loop was not stopping on the right condition.
2171
2172         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2173         (WebCore::extractEventsAndSystemsFromMessage): Fix wrong
2174         condition.
2175         (WebCore::MediaPlayerPrivateGStreamerBase::handleProtectionEvent):
2176         Add better debug category.
2177
2178 2017-02-22  Antti Koivisto  <antti@apple.com>
2179
2180         REGRESSION(r207669): Crash after mutating selector text
2181         https://bugs.webkit.org/show_bug.cgi?id=168655
2182         <rdar://problem/30632111>
2183
2184         Reviewed by Andreas Kling.
2185
2186         Test: fast/css/selector-text-mutation-crash.html
2187
2188         * style/StyleScope.cpp:
2189         (WebCore::Style::Scope::resolver):
2190         (WebCore::Style::Scope::updateStyleResolver):
2191
2192         Protect against entering scheduleUpdate and wiping style resolver while updating it.
2193         Extension stylesheets can trigger this.
2194
2195         (WebCore::Style::Scope::scheduleUpdate):
2196
2197         Clear the style resolver immediately if style sheet content changes. The resolver may
2198         have data structures that point to the old sheet contents.
2199
2200         The resolver would get wiped anyway when the scheduled update actually occurs.
2201
2202         * style/StyleScope.h:
2203
2204 2017-02-08  Sergio Villar Senin  <svillar@igalia.com>
2205
2206         [css-grid] Move the track sizing algorithm to its own class
2207         https://bugs.webkit.org/show_bug.cgi?id=167988
2208
2209         Reviewed by Manuel Rego Casasnovas.
2210
2211         This is about moving the track sizing algorithm code out of RenderGrid to a new class
2212         GridTrackSizingAlgorithm, making RenderGrid more compact and easy to maintain. A nice side
2213         effect of this patch is the removal of the GridSizingData structure as it is no longer
2214         needed. All the data structures in that class were transferred to GridTrackSizingAlgorithm
2215         as private attribute members. The GridTrack class was also moved to the new file.
2216
2217         The algorithm execution starts with the call to run(). It's mandatory to call setup() before
2218         any call to run() in order to properly configure the behaviour of the algorithm. You can
2219         call setup() & run() multiple times for a single layout operation (normally twice, one for
2220         columns and another one for rows). The algorithm uses a state machine to verify that the
2221         client issues the calls in the proper order (i.e. first columns and then rows). After
2222         finishing the layout, the client should call reset() to allow the algorithm to perform
2223         cleanups and to prepare itself for another round of calls.
2224
2225         In order to implement the different behaviours of the algorithm depending on whether the
2226         available size is definite or not, a strategy pattern was implemented in the
2227         GridTrackSizingAlgorithmStrategy class. It has two subclasses, one for definite sizes and
2228         another one for indefinite ones.
2229
2230         We took advantage of this change to perform some renames of the track sizing algorithm
2231         methods that were still using the names from the first versions of the specs. Not only that,
2232         the original track sizing algorithm method (computeUsedBreadthOfGridTracks) was split in 4
2233         different parts representing the 4 steps of the algorithm.
2234
2235         No new tests as this is about moving code and refactoring.
2236
2237         * CMakeLists.txt:
2238         * WebCore.xcodeproj/project.pbxproj:
2239         * rendering/GridTrackSizingAlgorithm.cpp: Added.
2240         (WebCore::GridTrack::baseSize):
2241         (WebCore::GridTrack::growthLimit):
2242         (WebCore::GridTrack::setBaseSize):
2243         (WebCore::GridTrack::setGrowthLimit):
2244         (WebCore::GridTrack::growthLimitIfNotInfinite):
2245         (WebCore::GridTrack::setTempSize):
2246         (WebCore::GridTrack::growTempSize):
2247         (WebCore::GridTrack::setGrowthLimitCap):
2248         (WebCore::GridTrack::ensureGrowthLimitIsBiggerThanBaseSize):
2249         (WebCore::shouldClearOverrideContainingBlockContentSizeForChild):
2250         (WebCore::hasOverrideContainingBlockContentSizeForChild):
2251         (WebCore::setOverrideContainingBlockContentSizeForChild):
2252         (WebCore::flowAwareDirectionForChild):
2253         (WebCore::overrideContainingBlockContentSizeForChild):
2254         (WebCore::computeMarginLogicalSizeForChild):
2255         (WebCore::marginIntrinsicLogicalWidthForChild):
2256         (WebCore::GridTrackSizingAlgorithm::setFreeSpace):
2257         (WebCore::GridTrackSizingAlgorithm::rawGridTrackSize):
2258         (WebCore::GridTrackSizingAlgorithm::computeTrackBasedSize):
2259         (WebCore::GridTrackSizingAlgorithm::initialBaseSize):
2260         (WebCore::GridTrackSizingAlgorithm::initialGrowthLimit):
2261         (WebCore::GridTrackSizingAlgorithm::sizeTrackToFitNonSpanningItem):
2262         (WebCore::GridTrackSizingAlgorithm::spanningItemCrossesFlexibleSizedTracks):
2263         (WebCore::GridItemWithSpan::GridItemWithSpan):
2264         (WebCore::GridItemWithSpan::gridItem):
2265         (WebCore::GridItemWithSpan::span):
2266         (WebCore::GridItemWithSpan::operator<):
2267         (WebCore::GridTrackSizingAlgorithm::itemSizeForTrackSizeComputationPhase):
2268         (WebCore::shouldProcessTrackForTrackSizeComputationPhase):
2269         (WebCore::trackSizeForTrackSizeComputationPhase):
2270         (WebCore::updateTrackSizeForTrackSizeComputationPhase):
2271         (WebCore::trackShouldGrowBeyondGrowthLimitsForTrackSizeComputationPhase):
2272         (WebCore::markAsInfinitelyGrowableForTrackSizeComputationPhase):
2273         (WebCore::GridTrackSizingAlgorithm::increaseSizesToAccommodateSpanningItems):
2274         (WebCore::sortByGridTrackGrowthPotential):
2275         (WebCore::clampGrowthShareIfNeeded):
2276         (WebCore::GridTrackSizingAlgorithm::distributeSpaceToTracks):
2277         (WebCore::GridTrackSizingAlgorithm::assumedRowsSizeForOrthogonalChild):
2278         (WebCore::GridTrackSizingAlgorithm::gridAreaBreadthForChild):
2279         (WebCore::GridTrackSizingAlgorithm::gridTrackSize):
2280         (WebCore::GridTrackSizingAlgorithm::computeFlexFactorUnitSize):
2281         (WebCore::GridTrackSizingAlgorithm::computeFlexSizedTracksGrowth):
2282         (WebCore::GridTrackSizingAlgorithm::findFrUnitSize):
2283         (WebCore::GridTrackSizingAlgorithm::computeGridContainerIntrinsicSizes):
2284         (WebCore::GridTrackSizingAlgorithmStrategy::logicalHeightForChild):
2285         (WebCore::GridTrackSizingAlgorithmStrategy::minContentForChild):
2286         (WebCore::GridTrackSizingAlgorithmStrategy::maxContentForChild):
2287         (WebCore::GridTrackSizingAlgorithmStrategy::minSizeForChild):
2288         (WebCore::GridTrackSizingAlgorithmStrategy::updateOverrideContainingBlockContentSizeForChild):
2289         (WebCore::IndefiniteSizeStrategy::minLogicalWidthForChild):
2290         (WebCore::IndefiniteSizeStrategy::layoutGridItemForMinSizeComputation):
2291         (WebCore::IndefiniteSizeStrategy::maximizeTracks):
2292         (WebCore::normalizedFlexFraction):
2293         (WebCore::IndefiniteSizeStrategy::findUsedFlexFraction):
2294         (WebCore::IndefiniteSizeStrategy::recomputeUsedFlexFractionIfNeeded):
2295         (WebCore::DefiniteSizeStrategy::minLogicalWidthForChild):
2296         (WebCore::DefiniteSizeStrategy::maximizeTracks):
2297         (WebCore::DefiniteSizeStrategy::layoutGridItemForMinSizeComputation):
2298         (WebCore::DefiniteSizeStrategy::findUsedFlexFraction):
2299         (WebCore::DefiniteSizeStrategy::recomputeUsedFlexFractionIfNeeded):
2300         (WebCore::GridTrackSizingAlgorithm::initializeTrackSizes):
2301         (WebCore::GridTrackSizingAlgorithm::resolveIntrinsicTrackSizes):
2302         (WebCore::GridTrackSizingAlgorithm::stretchFlexibleTracks):
2303         (WebCore::GridTrackSizingAlgorithm::advanceNextState):
2304         (WebCore::GridTrackSizingAlgorithm::isValidTransition):
2305         (WebCore::GridTrackSizingAlgorithm::setup):
2306         (WebCore::GridTrackSizingAlgorithm::run):
2307         (WebCore::GridTrackSizingAlgorithm::reset):
2308         (WebCore::GridTrackSizingAlgorithm::tracksAreWiderThanMinTrackBreadth):
2309         (WebCore::GridTrackSizingAlgorithm::StateMachine::StateMachine):
2310         (WebCore::GridTrackSizingAlgorithm::StateMachine::~StateMachine):
2311         * rendering/GridTrackSizingAlgorithm.h: Added.
2312         (WebCore::GridTrack::GridTrack):
2313         (WebCore::GridTrack::infiniteGrowthPotential):
2314         (WebCore::GridTrack::plannedSize):
2315         (WebCore::GridTrack::setPlannedSize):
2316         (WebCore::GridTrack::tempSize):
2317         (WebCore::GridTrack::infinitelyGrowable):
2318         (WebCore::GridTrack::setInfinitelyGrowable):
2319         (WebCore::GridTrack::growthLimitCap):
2320         (WebCore::GridTrack::growthLimitIsInfinite):
2321         (WebCore::GridTrack::isGrowthLimitBiggerThanBaseSize):
2322         (WebCore::GridTrackSizingAlgorithmStrategy::GridTrackSizingAlgorithmStrategy):
2323         (WebCore::GridTrackSizingAlgorithmStrategy::computeTrackBasedSize):
2324         (WebCore::GridTrackSizingAlgorithmStrategy::direction):
2325         (WebCore::GridTrackSizingAlgorithmStrategy::findFrUnitSize):
2326         (WebCore::GridTrackSizingAlgorithmStrategy::distributeSpaceToTracks):
2327         (WebCore::GridTrackSizingAlgorithmStrategy::renderGrid):
2328         * rendering/RenderGrid.cpp:
2329         (WebCore::RenderGrid::RenderGrid):
2330         (WebCore::RenderGrid::computeTrackBasedLogicalHeight):
2331         (WebCore::RenderGrid::computeTrackSizesForDefiniteSize):
2332         (WebCore::RenderGrid::repeatTracksSizingIfNeeded):
2333         (WebCore::RenderGrid::layoutBlock):
2334         (WebCore::RenderGrid::computeIntrinsicLogicalWidths):
2335         (WebCore::RenderGrid::computeTrackSizesForIndefiniteSize):
2336         (WebCore::RenderGrid::placeSpecifiedMajorAxisItemsOnGrid):
2337         (WebCore::RenderGrid::applyStretchAlignmentToTracksIfNeeded):
2338         (WebCore::RenderGrid::layoutGridItems):
2339         (WebCore::RenderGrid::gridAreaBreadthForChildIncludingAlignmentOffsets):
2340         (WebCore::RenderGrid::populateGridPositionsForDirection):
2341         (WebCore::RenderGrid::columnAxisOffsetForChild):
2342         (WebCore::RenderGrid::rowAxisOffsetForChild):
2343         (WebCore::RenderGrid::findChildLogicalPosition):
2344         (WebCore::GridTrack::GridTrack): Deleted.
2345         (WebCore::GridTrack::baseSize): Deleted.
2346         (WebCore::GridTrack::growthLimit): Deleted.
2347         (WebCore::GridTrack::setBaseSize): Deleted.
2348         (WebCore::GridTrack::setGrowthLimit): Deleted.
2349         (WebCore::GridTrack::infiniteGrowthPotential): Deleted.
2350         (WebCore::GridTrack::growthLimitIfNotInfinite): Deleted.
2351         (WebCore::GridTrack::plannedSize): Deleted.
2352         (WebCore::GridTrack::setPlannedSize): Deleted.
2353         (WebCore::GridTrack::tempSize): Deleted.
2354         (WebCore::GridTrack::setTempSize): Deleted.
2355         (WebCore::GridTrack::growTempSize): Deleted.
2356         (WebCore::GridTrack::infinitelyGrowable): Deleted.
2357         (WebCore::GridTrack::setInfinitelyGrowable): Deleted.
2358         (WebCore::GridTrack::setGrowthLimitCap): Deleted.
2359         (WebCore::GridTrack::growthLimitCap): Deleted.
2360         (WebCore::GridTrack::growthLimitIsInfinite): Deleted.
2361         (WebCore::GridTrack::isGrowthLimitBiggerThanBaseSize): Deleted.
2362         (WebCore::GridTrack::ensureGrowthLimitIsBiggerThanBaseSize): Deleted.
2363         (WebCore::RenderGrid::GridSizingData::GridSizingData): Deleted.
2364         (WebCore::RenderGrid::GridSizingData::freeSpace): Deleted.
2365         (WebCore::RenderGrid::GridSizingData::availableSpace): Deleted.
2366         (WebCore::RenderGrid::GridSizingData::setAvailableSpace): Deleted.
2367         (WebCore::RenderGrid::GridSizingData::advanceNextState): Deleted.
2368         (WebCore::RenderGrid::GridSizingData::isValidTransition): Deleted.
2369         (WebCore::RenderGrid::GridSizingData::grid): Deleted.
2370         (WebCore::RenderGrid::GridSizingData::setFreeSpace): Deleted.
2371         (WebCore::RenderGrid::computeTrackSizesForDirection): Deleted.
2372         (WebCore::RenderGrid::computeIntrinsicLogicalHeight): Deleted.
2373         (WebCore::normalizedFlexFraction): Deleted.
2374         (WebCore::RenderGrid::computeUsedBreadthOfGridTracks): Deleted.
2375         (WebCore::RenderGrid::computeFlexSizedTracksGrowth): Deleted.
2376         (WebCore::RenderGrid::computeUsedBreadthOfMinLength): Deleted.
2377         (WebCore::RenderGrid::computeUsedBreadthOfMaxLength): Deleted.
2378         (WebCore::RenderGrid::computeFlexFactorUnitSize): Deleted.
2379         (WebCore::RenderGrid::findFlexFactorUnitSize): Deleted.
2380         (WebCore::hasOverrideContainingBlockContentSizeForChild): Deleted.
2381         (WebCore::setOverrideContainingBlockContentSizeForChild): Deleted.
2382         (WebCore::shouldClearOverrideContainingBlockContentSizeForChild): Deleted.
2383         (WebCore::RenderGrid::rawGridTrackSize): Deleted.
2384         (WebCore::RenderGrid::gridTrackSize): Deleted.
2385         (WebCore::RenderGrid::logicalHeightForChild): Deleted.
2386         (WebCore::RenderGrid::minSizeForChild): Deleted.
2387         (WebCore::RenderGrid::updateOverrideContainingBlockContentSizeForChild): Deleted.
2388         (WebCore::RenderGrid::minContentForChild): Deleted.
2389         (WebCore::RenderGrid::maxContentForChild): Deleted.
2390         (WebCore::GridItemWithSpan::GridItemWithSpan): Deleted.
2391         (WebCore::GridItemWithSpan::gridItem): Deleted.
2392         (WebCore::GridItemWithSpan::span): Deleted.
2393         (WebCore::GridItemWithSpan::operator<): Deleted.
2394         (WebCore::RenderGrid::spanningItemCrossesFlexibleSizedTracks): Deleted.
2395         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctions): Deleted.
2396         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForNonSpanningItems): Deleted.
2397         (WebCore::trackSizeForTrackSizeComputationPhase): Deleted.
2398         (WebCore::RenderGrid::shouldProcessTrackForTrackSizeComputationPhase): Deleted.
2399         (WebCore::RenderGrid::trackShouldGrowBeyondGrowthLimitsForTrackSizeComputationPhase): Deleted.
2400         (WebCore::RenderGrid::markAsInfinitelyGrowableForTrackSizeComputationPhase): Deleted.
2401         (WebCore::RenderGrid::updateTrackSizeForTrackSizeComputationPhase): Deleted.
2402         (WebCore::RenderGrid::currentItemSizeForTrackSizeComputationPhase): Deleted.
2403         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForItems): Deleted.
2404         (WebCore::sortByGridTrackGrowthPotential): Deleted.
2405         (WebCore::clampGrowthShareIfNeeded): Deleted.
2406         (WebCore::RenderGrid::distributeSpaceToTracks): Deleted.
2407         (WebCore::RenderGrid::tracksAreWiderThanMinTrackBreadth): Deleted.
2408         (WebCore::RenderGrid::assumedRowsSizeForOrthogonalChild): Deleted.
2409         (WebCore::RenderGrid::gridAreaBreadthForChild): Deleted.
2410         * rendering/RenderGrid.h:
2411
2412 2017-02-22  Per Arne Vollan  <pvollan@apple.com>
2413
2414         [Win] Crash under CACFLayerTreeHost::acceleratedCompositingAvailable().
2415         https://bugs.webkit.org/show_bug.cgi?id=168711
2416
2417         Reviewed by Alex Christensen.
2418
2419         Add null pointer check.
2420
2421         * platform/graphics/ca/win/CACFLayerTreeHost.cpp:
2422         (WebCore::CACFLayerTreeHost::acceleratedCompositingAvailable):
2423
2424 2017-02-22  Carlos Garcia Campos  <cgarcia@igalia.com>
2425
2426         [GStreamer] Crash in MediaPlayerPrivateGStreamerMSE::buffered() when MEDIA_STREAM is disabled
2427         https://bugs.webkit.org/show_bug.cgi?id=168662
2428
2429         Reviewed by Michael Catanzaro.
2430
2431         When MEDIA_STREAM is disabled, if MediaPlayer::loadWithNextMediaEngine is called with a current engine and
2432         there's no type specified, the next media engine that is used is the MSE one. Since there's no actually a media
2433         stream, the engine is created but never loaded. When buffered is called it tries to use its media source that is
2434         nullptr. It doesn't happen when MEDIA_STREAM is enabled, because the next media engine returned is Owr that
2435         doesn't implement buffered and always returns an empty PlatformTimeRanges.
2436
2437         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
2438         (WebCore::MediaPlayerPrivateGStreamerMSE::buffered): Return an empty PlatformTimeRanges if m_mediaSource is nullptr.
2439
2440 2017-02-21  Youenn Fablet  <youenn@apple.com>
2441
2442         [WebRTC][Mac] Activate libwebrtc
2443         https://bugs.webkit.org/show_bug.cgi?id=167293
2444
2445         Reviewed by Alex Christensen.
2446
2447         * Configurations/WebCore.xcconfig:
2448         * Configurations/WebCoreTestSupport.xcconfig:
2449         * Configurations/FeatureDefines.xcconfig:
2450
2451 2017-02-21  Carlos Garcia Campos  <cgarcia@igalia.com>
2452
2453         Unreviewed. Fix WinCairo build after r212703.
2454
2455         * platform/TextureMapper.cmake:
2456
2457 2017-02-21  Per Arne Vollan  <pvollan@apple.com>
2458
2459         Add support for CSS properties paint-order, stroke-linecap, and stroke-linejoin in text rendering.
2460         https://bugs.webkit.org/show_bug.cgi?id=168601
2461         rdar://problem/30583872
2462
2463         Reviewed by Simon Fraser.
2464
2465         Text rendering should respect the CSS properties paint-order, stroke-linecap, and stroke-linejoin,
2466         see https://drafts.fxtf.org/paint/. The text rendering changes are mainly in the TextPainter class,
2467         where text is painted in three phases (fill, stroke, markers), where the order follows the
2468         paint-order property. The linecap and linejoin properties are set on the graphics context before
2469         rendering the text.
2470
2471         Tests: fast/css/paint-order.html
2472                fast/css/paint-order-shadow.html
2473
2474         * css/CSSComputedStyleDeclaration.cpp:
2475         (WebCore::paintOrder):
2476         * css/StyleBuilderConverter.h:
2477         (WebCore::StyleBuilderConverter::convertPaintOrder):
2478         * rendering/TextPaintStyle.cpp:
2479         (WebCore::computeTextPaintStyle):
2480         (WebCore::updateGraphicsContext):
2481         * rendering/TextPaintStyle.h:
2482         * rendering/TextPainter.cpp:
2483         (WebCore::TextPainter::paintTextAndEmphasisMarksIfNeeded):
2484         * rendering/style/RenderStyle.cpp:
2485         (WebCore::RenderStyle::paintTypesForPaintOrder):
2486         * rendering/style/RenderStyle.h:
2487         (WebCore::RenderStyle::setPaintOrder):
2488         (WebCore::RenderStyle::initialPaintOrder):
2489         * rendering/style/RenderStyleConstants.h:
2490         * rendering/style/SVGRenderStyleDefs.h:
2491         * rendering/style/StyleRareInheritedData.cpp:
2492         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
2493         * rendering/svg/RenderSVGShape.cpp:
2494         (WebCore::RenderSVGShape::fillStrokeMarkers):
2495         * rendering/svg/SVGInlineTextBox.cpp:
2496         (WebCore::SVGInlineTextBox::paint):
2497
2498 2017-02-21  Joseph Pecoraro  <pecoraro@apple.com>
2499
2500         [User Timing] Throw a SyntaxError for performance.measure if mark name is not found
2501         https://bugs.webkit.org/show_bug.cgi?id=168707
2502
2503         Reviewed by Ryosuke Niwa.
2504
2505         Test: performance-api/performance-measure-name.html
2506
2507         * page/PerformanceUserTiming.cpp:
2508         (WebCore::UserTiming::findExistingMarkStartTime):
2509         Instead of returning zero, throw a SyntaxError. This is more in line
2510         with User Timing Level 1 and behavior in Window. This is an issue with
2511         the Level 2 spec: https://github.com/w3c/user-timing/issues/21
2512
2513 2017-02-21  Ryan Haddad  <ryanhaddad@apple.com>
2514
2515         Unreviewed attempt to fix the Windows build.
2516
2517         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
2518         (PlatformCALayerWin::supportsSubpixelAntialiasedText):
2519
2520 2017-02-21  Ryan Haddad  <ryanhaddad@apple.com>
2521
2522         Unreviewed, rolling out r212737.
2523
2524         This change caused an existing LayoutTest to crash.
2525
2526         Reverted changeset:
2527
2528         "REGRESSION(r207669): Crash after mutating selector text"
2529         https://bugs.webkit.org/show_bug.cgi?id=168655
2530         http://trac.webkit.org/changeset/212737
2531
2532 2017-02-21  Chris Dumez  <cdumez@apple.com>
2533
2534         REGRESSION (r207720): /more/conformance/conformance/quickCheckAPI-S_V.html test fails
2535         https://bugs.webkit.org/show_bug.cgi?id=168632
2536         <rdar://problem/30620129>
2537
2538         Reviewed by Darin Adler.
2539
2540         After r207720, the following WebGL conformance tests started failing:
2541         - /more/conformance/conformance/quickCheckAPI-S_V.html
2542         - /context/context-lost.html
2543
2544         We started throwing security errors in case where we did not before.
2545         Chrome and Firefox are both passing these tests so our new behavior was not interoperable.
2546
2547         This patch reverts part of r207720 to restore our previous behavior.
2548
2549         * html/canvas/WebGLRenderingContextBase.cpp:
2550         (WebCore::WebGLRenderingContextBase::texSubImage2D):
2551         (WebCore::WebGLRenderingContextBase::texImage2D):
2552         (WebCore::WebGLRenderingContextBase::validateHTMLImageElement):
2553         (WebCore::WebGLRenderingContextBase::validateHTMLCanvasElement):
2554         (WebCore::WebGLRenderingContextBase::validateHTMLVideoElement):
2555         * html/canvas/WebGLRenderingContextBase.h:
2556
2557 2017-02-21  Dean Jackson  <dino@apple.com>
2558
2559         No need for static attributes when creating a pixel format
2560         https://bugs.webkit.org/show_bug.cgi?id=168688
2561         <rdar://problem/30642256>
2562
2563         Reviewed by Myles Maxfield.
2564
2565         Just create the attributes when needed.
2566
2567         * platform/graphics/mac/GraphicsContext3DMac.mm:
2568         (WebCore::GraphicsContext3DManager::updateHighPerformanceState):
2569
2570 2017-02-20  Filip Pizlo  <fpizlo@apple.com>
2571
2572         The collector thread should only start when the mutator doesn't have heap access
2573         https://bugs.webkit.org/show_bug.cgi?id=167737
2574
2575         Reviewed by Keith Miller.
2576
2577         Added new tests in JSTests.
2578         
2579         The WebCore changes involve:
2580         
2581         - Refactoring around new header discipline.
2582         
2583         - Adding crazy GC APIs to window.internals to enable us to test the GC's runloop discipline.
2584
2585         * ForwardingHeaders/heap/GCFinalizationCallback.h: Added.
2586         * ForwardingHeaders/heap/IncrementalSweeper.h: Added.
2587         * ForwardingHeaders/heap/MachineStackMarker.h: Added.
2588         * ForwardingHeaders/heap/RunningScope.h: Added.
2589         * bindings/js/CommonVM.cpp:
2590         * testing/Internals.cpp:
2591         (WebCore::Internals::parserMetaData):
2592         (WebCore::Internals::isReadableStreamDisturbed):
2593         (WebCore::Internals::isGCRunning):
2594         (WebCore::Internals::addGCFinalizationCallback):
2595         (WebCore::Internals::stopSweeping):
2596         (WebCore::Internals::startSweeping):
2597         * testing/Internals.h:
2598         * testing/Internals.idl:
2599
2600 2017-02-20  Simon Fraser  <simon.fraser@apple.com>
2601
2602         Add support to PlatformCALayer/GraphicsLayerCA for subpixel-antialiased text, with a Setting and a MiniBrowser switch
2603         https://bugs.webkit.org/show_bug.cgi?id=168620
2604         <rdar://problem/30617772>
2605
2606         Reviewed by Tim Horton.
2607
2608         Add a Setting for subpixel-antialiased layer text. Plumb this through GraphicsLayerCA and
2609         PlatformCALayer, where it ultimately affects the layer contents format.
2610         
2611         TileControllers are slightly special because we communicate with them via an Obj-C
2612         WebTiledBackingLayer.
2613
2614         Test: compositing/contents-format/subpixel-antialiased-text-enabled.html
2615
2616         * page/Settings.in:
2617         * platform/graphics/GraphicsLayer.cpp:
2618         (WebCore::GraphicsLayer::GraphicsLayer):
2619         (WebCore::GraphicsLayer::dumpProperties):
2620         * platform/graphics/GraphicsLayer.h:
2621         (WebCore::GraphicsLayer::supportsSubpixelAntialiasedText):
2622         (WebCore::GraphicsLayer::setSupportsSubpixelAntialiasedText):
2623         * platform/graphics/ca/GraphicsLayerCA.cpp:
2624         (WebCore::GraphicsLayerCA::setSupportsSubpixelAntialiasedText):
2625         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
2626         (WebCore::GraphicsLayerCA::updateSupportsSubpixelAntialiasedText):
2627         * platform/graphics/ca/GraphicsLayerCA.h:
2628         * platform/graphics/ca/PlatformCALayer.cpp:
2629         (WebCore::PlatformCALayer::drawRepaintIndicator):
2630         * platform/graphics/ca/PlatformCALayer.h:
2631         * platform/graphics/ca/TileController.cpp:
2632         (WebCore::TileController::setWantsDeepColorBackingStore):
2633         (WebCore::TileController::setSupportsSubpixelAntialiasedText):
2634         (WebCore::TileController::setTilesOpaque):
2635         * platform/graphics/ca/TileController.h:
2636         * platform/graphics/ca/TileGrid.cpp:
2637         (WebCore::TileGrid::updateTileLayerProperties):
2638         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
2639         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
2640         (PlatformCALayerCocoa::supportsSubpixelAntialiasedText):
2641         (PlatformCALayerCocoa::setSupportsSubpixelAntialiasedText):
2642         (layerContentsFormat):
2643         (PlatformCALayerCocoa::updateContentsFormat):
2644         (PlatformCALayer::drawLayerContents):
2645         * platform/graphics/ca/cocoa/WebTiledBackingLayer.h:
2646         * platform/graphics/ca/cocoa/WebTiledBackingLayer.mm:
2647         (-[WebTiledBackingLayer drawsAsynchronously]):
2648         (-[WebTiledBackingLayer setSupportsSubpixelAntialiasedText:]):
2649         (-[WebTiledBackingLayer supportsSubpixelAntialiasedText]):
2650         * platform/spi/cocoa/QuartzCoreSPI.h:
2651         * rendering/RenderLayerBacking.cpp:
2652         (WebCore::RenderLayerBacking::createGraphicsLayer):
2653
2654 2017-02-21  Chris Dumez  <cdumez@apple.com>
2655
2656         REGRESSION (203941): iAd Producer: Clicking buttons in Preview does not work
2657         https://bugs.webkit.org/show_bug.cgi?id=168677
2658         <rdar://problem/30640101>
2659
2660         Reviewed by Ryosuke Niwa.
2661
2662         Add quirk to initMouseEvent to unbreak iAd Producer.
2663
2664         * dom/MouseEvent.cpp:
2665         (WebCore::MouseEvent::initMouseEventQuirk):
2666         * dom/MouseEvent.h:
2667         * dom/MouseEvent.idl:
2668         * platform/RuntimeApplicationChecks.h:
2669         * platform/RuntimeApplicationChecks.mm:
2670         (WebCore::MacApplication::isIADProducer):
2671
2672 2017-02-21  Jer Noble  <jer.noble@apple.com>
2673
2674         AudioSampleDataSource doesn't need to use the m_scratchBuffer on the pulling thread
2675         https://bugs.webkit.org/show_bug.cgi?id=168640
2676
2677         Reviewed by Eric Carlson.
2678
2679         Rather than copying the pulled data into a scratch buffer, applying a volume transformation
2680         and then copying back out, just do the volume transformation in-place in the destination
2681         buffer.
2682
2683         * platform/audio/mac/AudioSampleDataSource.cpp:
2684         (WebCore::AudioSampleDataSource::pullSamplesInternal):
2685
2686 2017-02-21  Youenn Fablet  <youenn@apple.com>
2687
2688         [WebRTC] Implement Incoming libwebrtc audio source support.
2689         https://bugs.webkit.org/show_bug.cgi?id=167961
2690
2691         Reviewed by Eric Carlson.
2692
2693         Hook libwebrtc incoming audio source into WebCore audio rendering path.
2694         Manually testing that muted sources produce data with zeros and unmuted sources provide data with non zeros.
2695
2696         * platform/mediastream/mac/RealtimeIncomingAudioSource.cpp:
2697         (WebCore::RealtimeIncomingAudioSource::create):
2698         (WebCore::streamDescription):
2699         (WebCore::RealtimeIncomingAudioSource::OnData):
2700         (WebCore::RealtimeIncomingAudioSource::audioSourceProvider):
2701         * platform/mediastream/mac/RealtimeIncomingAudioSource.h:
2702
2703 2017-02-21  Simon Fraser  <simon.fraser@apple.com>
2704
2705         Fix ImageBitmap comment to not insert a <canvas>.
2706
2707         * features.json:
2708
2709 2017-02-21  Alex Christensen  <achristensen@webkit.org>
2710
2711         Fix CMake build.
2712
2713         * PlatformMac.cmake:
2714
2715 2017-02-21  Simon Fraser  <simon.fraser@apple.com>
2716
2717         Add Media Streams and Capture to features.json.
2718
2719         * features.json:
2720
2721 2017-02-21  Jiewen Tan  <jiewen_tan@apple.com>
2722
2723         Clarify the status of 'webkitSubtle' and 'subtle' attributes on the WebCrypto API.
2724
2725         * features.json:
2726
2727 2017-02-21  Romain Bellessort  <romain.bellessort@crf.canon.fr>
2728
2729         [Readable Streams API] Add ReadableStreamBYOBRequest view getter
2730         https://bugs.webkit.org/show_bug.cgi?id=168652
2731
2732         Reviewed by Youenn Fablet.
2733
2734         Implemented getter for ReadableStreamBYOBRequest view attribute.
2735         
2736         Added 1 test checking that view length corresponds to autoAllocateChunkSize.
2737         Also updated test expectations for W3C imported tests.
2738
2739         * Modules/streams/ReadableByteStreamInternals.js:
2740         (isReadableStreamBYOBRequest): Added.
2741         * Modules/streams/ReadableStreamBYOBRequest.js:
2742         (view): Added.
2743
2744 2017-02-21  Simon Fraser  <simon.fraser@apple.com>
2745
2746         Clarify the status of 'webkitSubtle' and 'subtle' attributes on the WebCrypto API.
2747
2748         * features.json:
2749
2750 2017-02-21  Youenn Fablet  <youenn@apple.com>
2751
2752         [WebRTC] ICE candidates should be filtered according a policy
2753         https://bugs.webkit.org/show_bug.cgi?id=168348
2754
2755         Reviewed by Alex Christensen.
2756
2757         Covered by manual tests. Should be covered in the future by layout tests with dedicated internals API.
2758
2759         Adding support for ICE candidate filtering at RTCPeerConnection level.
2760         If ICE candidate filtering is on (by default), host candidates are stored and not sent immediately.
2761         Reflexive candidates are purged from raddr information to not leak the host IP address.
2762
2763         Stored candidates may be advertised to the JS layer if RTCController is notified of a change of filtering policy.
2764         To implement that, PeerConnectionBackend stores all filtered out candidates and RTCPeerConnection register
2765         themselves to RTCController to get notifications of filtering policy changes.
2766
2767         Making RTCPeerConnection use setPendingActivity throughout its lifetime.
2768         This ensures it does not get collected until the page is off or close() is called on the object.
2769
2770         Adding support for enumerating or not all interfaces at libwebrtc level.
2771         This choice is done at creation of the peer connection.
2772
2773         * Modules/mediastream/PeerConnectionBackend.cpp:
2774         (WebCore::PeerConnectionBackend::enableICECandidateFiltering):
2775         (WebCore::PeerConnectionBackend::disableICECandidateFiltering):
2776         (WebCore::filterICECandidate):
2777         (WebCore::PeerConnectionBackend::newICECandidate):
2778         * Modules/mediastream/PeerConnectionBackend.h:
2779         * Modules/mediastream/RTCController.cpp: Added.
2780         (WebCore::RTCController::remove):
2781         (WebCore::RTCController::add):
2782         (WebCore::RTCController::disableICECandidateFiltering):
2783         (WebCore::RTCController::enableICECandidateFiltering):
2784         * Modules/mediastream/RTCController.h: Added.
2785         * Modules/mediastream/RTCPeerConnection.cpp:
2786         (WebCore::RTCPeerConnection::create):
2787         (WebCore::RTCPeerConnection::close):
2788         (WebCore::RTCPeerConnection::rtcController):
2789         (WebCore::RTCPeerConnection::registerToController):
2790         (WebCore::RTCPeerConnection::unregisterFromController):
2791         * Modules/mediastream/RTCPeerConnection.h:
2792         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
2793         (WebCore::LibWebRTCMediaEndpoint::OnIceCandidate):
2794         * WebCore.xcodeproj/project.pbxproj:
2795         * page/Page.h:
2796         (WebCore::Page::rtcController):
2797         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
2798         (WebCore::LibWebRTCProvider::createPeerConnection):
2799         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
2800
2801 2017-02-21  Jiewen Tan  <jiewen_tan@apple.com>
2802
2803         Unreviewed, update WebCrypto API feature status.
2804
2805         * features.json:
2806
2807 2017-02-21  Simon Fraser  <simon.fraser@apple.com>
2808
2809         Fix the bad JSON.
2810
2811         * features.json:
2812
2813 2017-02-21  Andreas Kling  <akling@apple.com>
2814
2815         [iOS] WebKit1 should use shared memory pressure handler code.
2816         <https://webkit.org/b/168653>
2817
2818         Reviewed by Antti Koivisto.
2819
2820         Remove iOS WebKit1 specific members and code from MemoryPressureHandler in favor
2821         of using the same code that iOS WebKit2 and macOS WebKit uses.
2822
2823         * page/cocoa/MemoryReleaseCocoa.mm:
2824         (WebCore::platformReleaseMemory): Add two cleanup calls that were only in the iOS WebView code.
2825         * platform/MemoryPressureHandler.h:
2826         (WebCore::MemoryPressureHandler::m_releaseMemoryBlock): Deleted.
2827         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
2828         (WebCore::respondToMemoryPressureCallback): Deleted.
2829         (WebCore::MemoryPressureHandler::installMemoryReleaseBlock): Deleted.
2830         (WebCore::MemoryPressureHandler::setReceivedMemoryPressure): Deleted.
2831         (WebCore::MemoryPressureHandler::clearMemoryPressure): Deleted.
2832         (WebCore::MemoryPressureHandler::shouldWaitForMemoryClearMessage): Deleted.
2833         (WebCore::MemoryPressureHandler::respondToMemoryPressureIfNeeded): Deleted.
2834
2835 2017-02-21  Anders Carlsson  <andersca@apple.com>
2836
2837         Fix two failing WebKit legacy tests
2838         https://bugs.webkit.org/show_bug.cgi?id=168667
2839
2840         Reviewed by Tim Horton.
2841
2842         Handle the NSPasteboardTypeString type.
2843
2844         * platform/mac/PasteboardMac.mm:
2845         (WebCore::Pasteboard::read):
2846         (WebCore::addHTMLClipboardTypesForCocoaType):
2847
2848 2017-02-21  Simon Fraser  <simon.fraser@apple.com>
2849
2850         Add Web Audio and Web MIDI to features.json.
2851
2852         * features.json:
2853
2854 2017-02-21  Antti Koivisto  <antti@apple.com>
2855
2856         REGRESSION(r207669): Crash after mutating selector text
2857         https://bugs.webkit.org/show_bug.cgi?id=168655
2858         <rdar://problem/30632111>
2859
2860         Reviewed by Brent Fulgham.
2861
2862         Test: fast/css/selector-text-mutation-crash.html
2863
2864         * style/StyleScope.cpp:
2865         (WebCore::Style::Scope::scheduleUpdate):
2866
2867         Clear the style resolver immediately if style sheet content changes. The resolver may
2868         have data structures that point to the old sheet contents.
2869
2870         The resolver would get wiped anyway when the scheduled update actually occurs.
2871
2872 2017-02-21  Jiewen Tan  <jiewen_tan@apple.com>
2873
2874         [WebCrypto] Add support for AES-CFB
2875         https://bugs.webkit.org/show_bug.cgi?id=168344
2876         <rdar://problem/20940221>
2877
2878         Reviewed by Brent Fulgham.
2879
2880         This patch adds support for AES-CFB. Operations of AES-CFB include: encrypt, decrypt, generateKey,
2881         importKey, exportKey, wrapKey, and unwrapKey. This implementation follows a slightly old version
2882         of WebCryptoAPI spec: https://www.w3.org/TR/2014/CR-WebCryptoAPI-20141211/#aes-cfb.
2883
2884         Tests: crypto/subtle/aes-cbc-cfb-decrypt-malformed-parameters.html
2885                crypto/subtle/aes-cbc-cfb-encrypt-malformed-parameters.html
2886                crypto/subtle/aes-cbc-import-key-unwrap-jwk-rsa-key-public.html
2887                crypto/subtle/aes-cfb-generate-export-key-jwk-length-128.html
2888                crypto/subtle/aes-cfb-generate-export-key-jwk-length-192.html
2889                crypto/subtle/aes-cfb-generate-export-key-jwk-length-256.html
2890                crypto/subtle/aes-cfb-generate-export-raw-key.html
2891                crypto/subtle/aes-cfb-generate-key-encrypt-decrypt.html
2892                crypto/subtle/aes-cfb-generate-key.html
2893                crypto/subtle/aes-cfb-import-jwk-key-length-128.html
2894                crypto/subtle/aes-cfb-import-jwk-key-length-192.html
2895                crypto/subtle/aes-cfb-import-jwk-key-length-256.html
2896                crypto/subtle/aes-cfb-import-key-decrypt.html
2897                crypto/subtle/aes-cfb-import-key-encrypt.html
2898                crypto/subtle/aes-cfb-import-key-unwrap-jwk-key.html
2899                crypto/subtle/aes-cfb-import-key-unwrap-raw-key.html
2900                crypto/subtle/aes-cfb-import-key-wrap-jwk-key.html
2901                crypto/subtle/aes-cfb-import-key-wrap-raw-key.html
2902                crypto/subtle/aes-cfb-import-raw-key.html
2903                crypto/workers/subtle/aes-cfb-import-key-decrypt.html
2904                crypto/workers/subtle/aes-cfb-import-key-encrypt.html
2905                crypto/workers/subtle/aes-cfb-import-key-unwrap-key.html
2906                crypto/workers/subtle/aes-cfb-import-key-wrap-key.html
2907
2908         * CMakeLists.txt:
2909         * DerivedSources.make:
2910         * PlatformGTK.cmake:
2911         * PlatformMac.cmake:
2912         * WebCore.xcodeproj/project.pbxproj:
2913         Add CryptoAlgorithmAES_CFB.cpp,
2914         change AesCbcParams.idl to AesCbcCfbParams.idl.
2915         * bindings/js/JSSubtleCryptoCustom.cpp:
2916         (WebCore::normalizeCryptoAlgorithmParameters):
2917         Add support for AES-CFB.
2918         * crypto/CryptoAlgorithm.h:
2919         Include <wtf/Variant.h>.
2920         * crypto/CryptoAlgorithmParameters.h:
2921         Add support for AES-CFB.
2922         * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
2923         (WebCore::CryptoAlgorithmAES_CBC::encrypt):
2924         (WebCore::CryptoAlgorithmAES_CBC::decrypt):
2925         Rename CryptoAlgorithmAesCbcParams to CryptoAlgorithmAesCbcCfbParams.
2926         * crypto/algorithms/CryptoAlgorithmAES_CFB.cpp: Added.
2927         (WebCore::usagesAreInvalidForCryptoAlgorithmAES_CFB):
2928         (WebCore::CryptoAlgorithmAES_CFB::create):
2929         (WebCore::CryptoAlgorithmAES_CFB::identifier):
2930         (WebCore::CryptoAlgorithmAES_CFB::encrypt):
2931         (WebCore::CryptoAlgorithmAES_CFB::decrypt):
2932         (WebCore::CryptoAlgorithmAES_CFB::generateKey):
2933         (WebCore::CryptoAlgorithmAES_CFB::importKey):
2934         (WebCore::CryptoAlgorithmAES_CFB::exportKey):
2935         * crypto/algorithms/CryptoAlgorithmAES_CFB.h: Added.
2936         * crypto/gnutls/CryptoAlgorithmAES_CFBGnuTLS.cpp: Added.
2937         (WebCore::CryptoAlgorithmAES_CFB::platformEncrypt):
2938         (WebCore::CryptoAlgorithmAES_CFB::platformDecrypt):
2939         Add dummy support of AES_CFB for GTK+.
2940         * crypto/mac/CryptoAlgorithmAES_CBCMac.cpp:
2941         (WebCore::transformAES_CBC):
2942         Drop conditional PLATFORM(COCOA).
2943         (WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
2944         (WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
2945         Rename CryptoAlgorithmAesCbcParams to CryptoAlgorithmAesCbcCfbParams.
2946         * crypto/mac/CryptoAlgorithmAES_CFBMac.cpp: Added.
2947         (WebCore::transformAES_CFB):
2948         (WebCore::CryptoAlgorithmAES_CFB::platformEncrypt):
2949         (WebCore::CryptoAlgorithmAES_CFB::platformDecrypt):
2950         * crypto/mac/CryptoAlgorithmRegistryMac.cpp:
2951         (WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms):
2952         Add support for AES-CFB.
2953         * crypto/parameters/AesCbcCfbParams.idl: Renamed from Source/WebCore/crypto/parameters/AesCbcParams.idl.
2954         * crypto/parameters/CryptoAlgorithmAesCbcCfbParams.h: Renamed from Source/WebCore/crypto/parameters/CryptoAlgorithmAesCbcParams.h.
2955         Since dictionaries AesCbcParams and AesCfbParams are essentially the same, I combine them together in our implementations.
2956
2957 2017-02-21  Wenson Hsieh  <wenson_hsieh@apple.com>
2958
2959         Unreviewed, fix the ToT iOS build
2960
2961         Adopt updated UIKit SPI and remove calls to the deprecated version.
2962
2963         * platform/ios/WebItemProviderPasteboard.mm:
2964         (-[WebItemProviderPasteboard setItems:]):
2965
2966 2017-02-21  Per Arne Vollan  <pvollan@apple.com>
2967
2968         [Win] WebView is not painting in accelerated compositing mode.
2969         https://bugs.webkit.org/show_bug.cgi?id=168654
2970
2971         Reviewed by Brent Fulgham.
2972
2973         Initializing the uncommitted layer change flags to CoverageRectChanged in GraphicsLayerCA,
2974         stops WebView painting in accelerated mode.
2975
2976         Covered by existing tests.
2977
2978         * platform/graphics/ca/GraphicsLayerCA.h:
2979
2980 2017-02-21  Jer Noble  <jer.noble@apple.com>
2981
2982         Make logging in high-priority audio threads less expensive
2983         https://bugs.webkit.org/show_bug.cgi?id=168639
2984
2985         Reviewed by Jon Lee.
2986
2987         Logging from inside a high-priority audio thread will make a number of calls to malloc, block, and
2988         therefore cause audio glitches. Make this logging less expensive by dispatching to the main thread
2989         before creating and outputting the log string.
2990
2991         * WebCore.xcodeproj/project.pbxproj:
2992         * platform/audio/mac/AudioSampleDataSource.mm: Renamed from Source/WebCore/platform/audio/mac/AudioSampleDataSource.cpp.
2993         (WebCore::AudioSampleDataSource::pushSamplesInternal):
2994         (WebCore::AudioSampleDataSource::pullSamplesInternal):
2995
2996 2017-02-21  Jer Noble  <jer.noble@apple.com>
2997
2998         Give the Mock audio input a "hum" to make drop-outs more detectable
2999         https://bugs.webkit.org/show_bug.cgi?id=168641
3000
3001         Reviewed by Eric Carlson.
3002
3003         Add two helper functions to generate waveforms: addHum() and writeHum(). Use these methods
3004         to create a bip-bop audio buffer which can be used to "blit" a portion the waveform into the
3005         destination buffer during rendering. The background hum must be seamless across multiple
3006         pull operations, so add the hum sound during rendering.
3007
3008         To ensure the waveform buffer is created, initialize the sampleRate to zero, then call
3009         applySampleRate() with the desired default rate, 44.1kHz.
3010
3011         * platform/mediastream/mac/MockRealtimeAudioSourceMac.h:
3012         * platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
3013         (WebCore::writeHum):
3014         (WebCore::addHum):
3015         (WebCore::MockRealtimeAudioSource::create):
3016         (WebCore::MockRealtimeAudioSourceMac::render):
3017         (WebCore::MockRealtimeAudioSourceMac::applySampleRate):
3018
3019 2017-02-21  Jer Noble  <jer.noble@apple.com>
3020
3021         Make TrackPrivateBase ThreadSafeRefCounted, so that it can be retained in non-main threads
3022         https://bugs.webkit.org/show_bug.cgi?id=168642
3023
3024         Reviewed by Eric Carlson.
3025
3026         AudioTrackPrivateMediaStreamCocoa has two entry points from background threads:
3027         audioSamplesAvailable() and render(). Protect against being destroyed mid-execution by
3028         retaining this for the duration of those methods.
3029
3030         * platform/graphics/TrackPrivateBase.h:
3031         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
3032         (WebCore::AudioTrackPrivateMediaStreamCocoa::audioSamplesAvailable):
3033         (WebCore::AudioTrackPrivateMediaStreamCocoa::render):
3034
3035 2017-02-21  Jer Noble  <jer.noble@apple.com>
3036
3037         Pulling too quickly from an AudioSampleDataSource should increase the pre-buffer amount
3038         https://bugs.webkit.org/show_bug.cgi?id=168645
3039
3040         Reviewed by Eric Carlson.
3041
3042         If a pull operation runs past the end of the buffered range of a CARingBuffer, the underrun
3043         is zero-filled, causing an audible glitch.  In this case, bias m_outputSampleOffset by the
3044         amount of the underrun, which should keep the underrun from reoccurring.
3045
3046         * platform/audio/mac/AudioSampleDataSource.cpp:
3047         (WebCore::AudioSampleDataSource::pullSamplesInternal):
3048
3049 2017-02-21  Jer Noble  <jer.noble@apple.com>
3050
3051         AudioSampleBufferList::zeroABL() takes a byte-count, not a sample-count.
3052         https://bugs.webkit.org/show_bug.cgi?id=168635
3053
3054         Reviewed by Jon Lee.
3055
3056         * platform/audio/mac/AudioSampleDataSource.cpp:
3057         (WebCore::AudioSampleDataSource::pullSamplesInternal):
3058         (WebCore::AudioSampleDataSource::pullAvalaibleSamplesAsChunks):
3059
3060 2017-02-21  Carlos Garcia Campos  <cgarcia@igalia.com>
3061
3062         REGRESSION(r212681): Crash when dragging links without a drag image
3063         https://bugs.webkit.org/show_bug.cgi?id=168648
3064
3065         Reviewed by Tim Horton.
3066
3067         This happens in GTK+ port, because we don't use a drag image for links.
3068
3069         Fixes: editing/pasteboard/drop-link.html
3070                editing/pasteboard/drop-text-without-selection.html
3071                editing/pasteboard/files-during-page-drags.html
3072                fast/events/content-changed-during-drop.html
3073                fast/events/drag-and-drop-link-fast-multiple-times-does-not-crash.html
3074                fast/events/drag-and-drop-link-into-focused-contenteditable.html
3075                fast/events/drag-and-drop-link.html
3076                fast/events/drag-in-frames.html
3077                fast/events/drag-parent-node.html
3078                fast/events/shift-drag-selection-on-link-triggers-drag-n-drop.html
3079
3080         * page/DragController.cpp:
3081         (WebCore::DragController::startDrag): Do not try to use drag image and its size when createDragImageForLink
3082         returns nullptr.
3083
3084 2017-02-21  Alex Christensen  <achristensen@webkit.org>
3085
3086         Unreviewed, rolling out r212699.
3087
3088         Internal build not ready
3089
3090         Reverted changeset:
3091
3092         "[WebRTC][Mac] Activate libwebrtc"
3093         https://bugs.webkit.org/show_bug.cgi?id=167293
3094         http://trac.webkit.org/changeset/212699
3095
3096 2017-02-20  Carlos Garcia Campos  <cgarcia@igalia.com>
3097
3098         Remove ENABLE_THREADED_COMPOSITOR build option
3099         https://bugs.webkit.org/show_bug.cgi?id=168606
3100
3101         Reviewed by Michael Catanzaro.
3102
3103         * platform/TextureMapper.cmake:
3104
3105 2017-02-20  Alex Christensen  <achristensen@webkit.org>
3106
3107         Fix some 32-bit builds after r212699
3108
3109         * platform/mediastream/mac/RealtimeIncomingVideoSource.cpp:
3110         (WebCore::RealtimeIncomingVideoSource::OnFrame):
3111         Explicitly cast OSStatus to int for logging.
3112
3113 2017-02-20  Joseph Pecoraro  <pecoraro@apple.com>
3114
3115         Remove unnecessary PerformanceEntry virtual methods
3116         https://bugs.webkit.org/show_bug.cgi?id=168633
3117
3118         Reviewed by Ryosuke Niwa.
3119
3120         * page/PerformanceEntry.h:
3121         (WebCore::PerformanceEntry::isResource):
3122         (WebCore::PerformanceEntry::isMark):
3123         (WebCore::PerformanceEntry::isMeasure):
3124         Implement based on the Type.
3125
3126         * page/PerformanceMark.h:
3127         * page/PerformanceMeasure.h:
3128         * page/PerformanceResourceTiming.h:
3129         Remove virtual overrides.
3130
3131 2017-02-20  Youenn Fablet  <youenn@apple.com>
3132
3133         [WebRTC][Mac] Activate libwebrtc
3134         https://bugs.webkit.org/show_bug.cgi?id=167293
3135
3136         Reviewed by Alex Christensen.
3137
3138         * Configurations/WebCore.xcconfig:
3139         * Configurations/WebCoreTestSupport.xcconfig:
3140
3141 2017-02-20  Joseph Pecoraro  <pecoraro@apple.com>
3142
3143         ASSERTION FAILED: m_normalWorld->hasOneRef() under WorkerThread::stop
3144         https://bugs.webkit.org/show_bug.cgi?id=168356
3145         <rdar://problem/30592486>
3146
3147         Reviewed by Ryosuke Niwa.
3148
3149         * page/DOMWindow.cpp:
3150         (WebCore::DOMWindow::removeAllEventListeners):
3151         Remove Performance object EventListeners.
3152
3153         * workers/WorkerGlobalScope.cpp:
3154         (WebCore::WorkerGlobalScope::~WorkerGlobalScope):
3155         (WebCore::WorkerGlobalScope::removeAllEventListeners):
3156         (WebCore::WorkerGlobalScope::performance):
3157         * workers/WorkerGlobalScope.h:
3158         Remove Performance object EventListeners.
3159         Also clear Performance early in destruction since its ContextDestructionObserver
3160         destruction makes checks about the WorkerThread.
3161
3162 2017-02-20  Jer Noble  <jer.noble@apple.com>
3163
3164         Local audio-only stream will not trigger playback to begin
3165         https://bugs.webkit.org/show_bug.cgi?id=168412
3166
3167         Reviewed by Youenn Fablet.
3168
3169         Test: fast/mediastream/local-audio-playing-event.html
3170
3171         With video-bearing streams, the first video sample emitted from the stream causes the
3172         readyState to move from HAVE_NOTHING to HAVE_ENOUGH_DATA. Wire up this same behavior for
3173         audio-bearing streams. Add a MediaStreamTrackPrivate::Observer callback method
3174         audioSamplesAvailable(), which gets passed up to MediaPlayerPrivateMediaStreamAVFObjC.
3175         Because this callback may be (and probably will be) called on a background thread, run the
3176         updateReadyState() task in a scheduledDeferredTask().
3177
3178         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
3179         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
3180         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::audioSamplesAvailable):
3181         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateTracks):
3182         * platform/mediastream/MediaStreamTrackPrivate.cpp:
3183         (WebCore::MediaStreamTrackPrivate::audioSamplesAvailable):
3184         * platform/mediastream/MediaStreamTrackPrivate.h:
3185         (WebCore::MediaStreamTrackPrivate::Observer::audioSamplesAvailable):
3186
3187 2017-02-20  Zalan Bujtas  <zalan@apple.com>
3188
3189         Simple line layout: Implement absoluteQuadsForRange.
3190         https://bugs.webkit.org/show_bug.cgi?id=168613
3191         <rdar://problem/30614618>
3192
3193         Reviewed by Simon Fraser.
3194
3195         This patch ensures that the commonly used Range::getClientRects calls do not
3196         throw us off of the simple line layout path.
3197
3198         Test: fast/dom/Range/simple-line-layout-getclientrects.html
3199
3200         * rendering/RenderText.cpp:
3201         (WebCore::RenderText::absoluteQuadsForRange):
3202         * rendering/SimpleLineLayoutFunctions.cpp:
3203         (WebCore::SimpleLineLayout::collectAbsoluteQuadsForRange): Special case empty ranges with multiple empty runs.
3204         * rendering/SimpleLineLayoutFunctions.h:
3205         * rendering/SimpleLineLayoutResolver.cpp:
3206         (WebCore::SimpleLineLayout::RunResolver::rangeForRendererWithOffsets):
3207         * rendering/SimpleLineLayoutResolver.h:
3208
3209 2017-02-20  Ryan Haddad  <ryanhaddad@apple.com>
3210
3211         Unreviewed, rolling out r212685.
3212
3213         This change broke the 32-bit Sierra build.
3214
3215         Reverted changeset:
3216
3217         "Resource Load Statistics: Add alternate classification
3218         method"
3219         https://bugs.webkit.org/show_bug.cgi?id=168347
3220         http://trac.webkit.org/changeset/212685
3221
3222 2017-02-20  Sam Weinig  <sam@webkit.org>
3223
3224         [WebIDL] Add support for constructors that have variadic parameters
3225         https://bugs.webkit.org/show_bug.cgi?id=168614
3226
3227         Reviewed by Alex Christensen.
3228
3229         In preparation of removing some more custom bindings, move the constructor calling
3230         code over to using GenerateParametersCheck completely. This required
3231         - Removing special case of NamedConstructors automatically getting a Document passed
3232           to them. The three named constructors that expected this have been updated to add
3233           the required attributes.
3234         - Add a version of the GenerateCallWith prologue for constructors.
3235         - Remove now unnecessary argumentCount return value from GenerateParametersCheck.
3236
3237         * bindings/scripts/CodeGeneratorJS.pm:
3238         (GenerateImplementation):
3239         (GenerateCallWithUsingReferences):
3240         (GenerateCallWithUsingPointers):
3241         (GenerateConstructorCallWithUsingPointers):
3242         (GenerateCallWith):
3243         (GenerateParametersCheck):
3244         (GenerateConstructorDefinition):
3245
3246         * bindings/scripts/test/JS/JSTestInterface.cpp:
3247         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
3248         * bindings/scripts/test/JS/JSTestObj.cpp:
3249         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
3250         Update results for more consistent placement of ScriptExecutionContext and Document
3251         accessors, add UNLIKELY to context checks, and remove automatic Document passing
3252         for NamedConstructors.
3253
3254         * html/HTMLAudioElement.idl:
3255         * html/HTMLImageElement.idl:
3256         * html/HTMLOptionElement.idl:
3257         Add ConstructorCallWith=Document.
3258
3259 2017-02-20  John Wilander  <wilander@apple.com>
3260
3261         Resource Load Statistics: Add alternate classification method
3262         https://bugs.webkit.org/show_bug.cgi?id=168347
3263         <rdar://problem/30352793>
3264
3265         Reviewed by Alex Christensen.
3266
3267         This patch only adds test infrastructure in WebCore.
3268
3269         Tests: http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-mixed-statistics.html
3270                http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-sub-frame-under-top-frame-origins.html
3271                http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-under-top-frame-origins.html
3272                http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-unique-redirects-to.html
3273                http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-mixed-statistics.html
3274                http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-sub-frame-under-top-frame-origins.html
3275                http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-under-top-frame-origins.html
3276                http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-unique-redirects-to.html
3277
3278         * loader/ResourceLoadObserver.cpp:
3279         (WebCore::ResourceLoadObserver::setSubframeUnderTopFrameOrigin):
3280         (WebCore::ResourceLoadObserver::setSubresourceUnderTopFrameOrigin):
3281         (WebCore::ResourceLoadObserver::setSubresourceUniqueRedirectTo):
3282         * loader/ResourceLoadObserver.h:
3283
3284 2017-02-20  Anders Carlsson  <andersca@apple.com>
3285
3286         Use the new drag code path when dragging links
3287         https://bugs.webkit.org/show_bug.cgi?id=168612
3288
3289         Reviewed by Tim Horton.
3290
3291         * editing/Editor.cpp:
3292         (WebCore::Editor::copyURL):
3293         Use userVisibleString instead of fillInUserVisibleForm.
3294
3295         (WebCore::Editor::pasteboardWriterURL):
3296         New function that returns a PasteboardWriterData::URL for a given URL + title.
3297
3298         * editing/Editor.h:
3299         Add new members.
3300
3301         * editing/mac/EditorMac.mm:
3302         (WebCore::Editor::userVisibleString):
3303         (WebCore::Editor::fillInUserVisibleForm): Deleted.
3304         Add a getter instead of a function that fills in a struct member.
3305
3306         * page/DragController.cpp:
3307         (WebCore::DragController::startDrag):
3308         Add the new DragItem code path when dragging links.
3309
3310         * platform/PasteboardWriterData.cpp:
3311         (WebCore::PasteboardWriterData::isEmpty):
3312         Check for m_url as well.
3313
3314         (WebCore::PasteboardWriterData::setURL):
3315         Set m_url.
3316
3317         * platform/PasteboardWriterData.h:
3318         Add new members.
3319
3320         * platform/mac/PasteboardWriter.mm:
3321         (WebCore::toUTI):
3322         New helper function that returns an UTI from a pasteboard type.
3323
3324         (WebCore::createPasteboardWriter):
3325         Handle converting URLs to the various pasteboard types.
3326
3327 2017-02-20  Wenson Hsieh  <wenson_hsieh@apple.com>
3328
3329         Add plumbing to the UI process for TextIndicatorData when computing the drag image
3330         https://bugs.webkit.org/show_bug.cgi?id=168583
3331         Work towards <rdar://problem/30313681>
3332
3333         Reviewed by Tim Horton.
3334
3335         Adds some additional arguments to drag image creation functions to allow platforms to specify TextIndicatorData
3336         for a link or selection-based DragImage. This TextIndicatorData is an optional member of the DragImage, and is
3337         propagated to the UI process via SetDragImage in the WebDragClient.
3338
3339         Additionally renames hasDataInteractionAtPosition to hasSelectionAtPosition to better reflect its purpose.
3340
3341         No new tests, since there is no behavior change.
3342
3343         * page/DragController.cpp:
3344         (WebCore::DragController::startDrag):
3345         * page/Page.cpp:
3346         (WebCore::Page::hasSelectionAtPosition):
3347         (WebCore::Page::hasDataInteractionAtPosition): Deleted.
3348         * page/Page.h:
3349         * platform/DragImage.cpp:
3350         (WebCore::createDragImageForSelection):
3351         (WebCore::createDragImageForLink):
3352         (WebCore::DragImage::operator=):
3353         * platform/DragImage.h:
3354         * platform/gtk/DragImageGtk.cpp:
3355         (WebCore::createDragImageForLink):
3356         * platform/mac/DragImageMac.mm:
3357         (WebCore::createDragImageForLink):
3358         * platform/win/DragImageWin.cpp:
3359         (WebCore::createDragImageForLink):
3360
3361 2017-02-20  Brent Fulgham  <bfulgham@apple.com>
3362
3363         Nullptr dereferences when stopping a load
3364         https://bugs.webkit.org/show_bug.cgi?id=168608
3365         <rdar://problem/29852056>
3366
3367         Reviewed by Ryosuke Niwa.
3368
3369         Don't attempt to notify a detached frame's load client that the load is
3370         stopped.
3371
3372         * loader/DocumentLoader.cpp:
3373         (WebCore::DocumentLoader::stopLoading): Check for null frame loader and
3374         bypass dereferencing it. 
3375
3376 2017-02-17  Anders Carlsson  <andersca@apple.com>
3377
3378         Add a new drag code path and use it for dragging plain text
3379         https://bugs.webkit.org/show_bug.cgi?id=168534
3380
3381         Reviewed by Geoffrey Garen.
3382
3383         The new code path is currently only used for plain text selection dragging.
3384
3385         * WebCore.xcodeproj/project.pbxproj:
3386         * page/DragClient.h:
3387         (WebCore::DragClient::useLegacyDragClient):
3388         Add a new member function. This currently returns true everywhere except legacy WebKit on Mac.
3389
3390         (WebCore::DragClient::beginDrag):
3391         Add new empty member function.
3392
3393         * page/DragController.cpp:
3394         (WebCore::dragImageAnchorPointForSelectionDrag):
3395         Helper function that returns the anchor point for a selection drag image.
3396
3397         (WebCore::DragController::startDrag):
3398         If we can use the new code path, set up a drag item with an image and pasteboard data.
3399
3400         (WebCore::DragController::beginDrag):
3401         New function that calls out to the client.
3402
3403         * page/DragController.h:
3404         Add new members.
3405
3406         * platform/DragItem.h:
3407         Add a new class - it's essentially a tuple of a drag image, an anchor point and the pasteboard data the item represents.
3408
3409         * platform/mac/PasteboardWriter.h:
3410         Rename createPasteboardWriting to createPasteboardWriter.
3411
3412         * platform/mac/PasteboardWriter.mm:
3413         (WebCore::createPasteboardWriter):
3414         Use the UTI pasteboard type.
3415
3416 2017-02-20  Alex Christensen  <achristensen@webkit.org>
3417
3418         Fix libwebrtc build after r212644.
3419         https://bugs.webkit.org/show_bug.cgi?id=168596
3420
3421         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
3422         (WebCore::LibWebRTCMediaEndpoint::StatsCollector::OnStatsDelivered):
3423         m_endpoint changed from a c++ reference to a WTF::Ref, so we need to use operator -> instead of .
3424
3425 2017-02-20  Romain Bellessort  <romain.bellessort@crf.canon.fr>
3426
3427         [Readable Streams API] Add ReadableByteStreamController byobRequest attribute
3428         https://bugs.webkit.org/show_bug.cgi?id=168319
3429
3430         Reviewed by Youenn Fablet.
3431
3432         Added ReadableByteStreamController byobRequest attribute.
3433
3434         Added tests related to ReadableStreamBYOBRequest as a dedicated object
3435         and also as an attribute of ReadableByteStreamController.
3436
3437         * CMakeLists.txt: Added new files.
3438         * DerivedSources.cpp: Added new files.
3439         * DerivedSources.make: Added new files.
3440         * Modules/streams/ReadableByteStreamController.idl: Added byobRequest support.
3441         * Modules/streams/ReadableByteStreamController.js: Added byobRequest support.
3442         * Modules/streams/ReadableByteStreamInternals.js:
3443         (privateInitializeReadableStreamBYOBRequest): Added constructor.
3444         * Modules/streams/ReadableStreamBYOBRequest.idl: Added.
3445         * Modules/streams/ReadableStreamBYOBRequest.js: Added.
3446         (respond): Not implemented yet.
3447         (respondWithNewView): Not implemented yet.
3448         (view): Not implemented yet.
3449         * WebCore.xcodeproj/project.pbxproj: Added new files.
3450         * bindings/js/JSDOMGlobalObject.cpp: Added ReadableStreamBYOBRequest support.
3451         (WebCore::JSDOMGlobalObject::addBuiltinGlobals):
3452         (WebCore::JSDOMGlobalObject::finishCreation):
3453         (WebCore::JSDOMGlobalObject::visitChildren):
3454         * bindings/js/JSReadableStreamPrivateConstructors.cpp: Added ReadableStreamBYOBRequest support.
3455         (WebCore::constructJSReadableByteStreamController):
3456         (WebCore::constructJSReadableStreamBYOBRequest):
3457         (WebCore::JSBuiltinReadableStreamBYOBRequestPrivateConstructor::initializeExecutable):
3458         (WebCore::createReadableStreamBYOBRequestPrivateConstructor):
3459         * bindings/js/JSReadableStreamPrivateConstructors.h: Added ReadableStreamBYOBRequest support.
3460         * bindings/js/WebCoreBuiltinNames.h: Added ReadableStreamBYOBRequest support.
3461
3462 2017-02-20  Per Arne Vollan  <pvollan@apple.com>
3463
3464         [Win] Custom scale factor is not applied in all cases.
3465         https://bugs.webkit.org/show_bug.cgi?id=168117
3466
3467         Reviewed by Brent Fulgham.
3468
3469         We should not call the function deviceScaleFactorForWindow directly, since this
3470         will return the system scale factor, and ignore the custom scale factor.
3471
3472         * platform/graphics/ca/win/CACFLayerTreeHost.h:
3473         * platform/graphics/ca/win/WKCACFViewLayerTreeHost.cpp:
3474         (WebCore::WKCACFViewLayerTreeHost::initializeContext):
3475         (WebCore::WKCACFViewLayerTreeHost::resize):
3476         (WebCore::WKCACFViewLayerTreeHost::setScaleFactor):
3477         * platform/graphics/ca/win/WKCACFViewLayerTreeHost.h:
3478         * platform/win/GDIUtilities.h:
3479         (WebCore::makeScaledPoint):
3480         * platform/win/PlatformMouseEventWin.cpp:
3481         (WebCore::positionForEvent):
3482         * platform/win/PopupMenuWin.cpp:
3483         (WebCore::PopupMenuWin::show):
3484         (WebCore::PopupMenuWin::wndProc):
3485         * platform/win/PopupMenuWin.h:
3486
3487 2017-02-20  Jon Lee  <jonlee@apple.com>
3488
3489         Fix build error for iOS. Unreviewed.
3490
3491         * platform/graphics/GraphicsContext3D.cpp: Move stub function into !PLATFORM(COCOA) instead of !PLATFORM(MAC).
3492
3493 2017-02-20  Jon Lee  <jonlee@apple.com>
3494
3495         Unreviewed, rolling out r212639.
3496
3497         Have a fix for the linker error on iOS.
3498
3499         Reverted changeset:
3500
3501         "Unreviewed, rolling out r212637."
3502         https://bugs.webkit.org/show_bug.cgi?id=168595
3503         http://trac.webkit.org/changeset/212639
3504
3505 2017-02-20  Youenn Fablet  <youenn@apple.com>
3506
3507         [WebRTC] Fix some memory leaks in libwebrtc binding code
3508         https://bugs.webkit.org/show_bug.cgi?id=168596
3509
3510         Reviewed by Eric Carlson.
3511
3512         Covered by manual testing.
3513
3514         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
3515         (WebCore::LibWebRTCMediaEndpoint::StatsCollector::StatsCollector): Using the libwebrtc way of creating such objects.
3516         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
3517         (WebCore::LibWebRTCMediaEndpoint::StatsCollector::create):
3518         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
3519         (WebCore::PeerConnectionFactoryAndThreads::OnMessage):
3520
3521 2017-02-20  Alexey Proskuryakov  <ap@apple.com>
3522
3523         Clean up how WebKit exports _WebCreateFragment
3524         https://bugs.webkit.org/show_bug.cgi?id=168579
3525
3526         Reviewed by Dan Bernstein.
3527
3528         * editing/Editor.h: Removed the declaration of _WebCreateFragment, SOFT_LINK doesn't need it.
3529         * editing/cocoa/EditorCocoa.mm: Moved a FIXME comment here.
3530
3531 2017-02-20  Ryan Haddad  <ryanhaddad@apple.com>
3532
3533         Unreviewed, rolling out r212637.
3534
3535         This change broke iOS builds.
3536
3537         Reverted changeset:
3538
3539         "Add 'webglcontextchanged' WebGLContextEvent"
3540         https://bugs.webkit.org/show_bug.cgi?id=168595
3541         http://trac.webkit.org/changeset/212637
3542
3543 2017-02-20  Carlos Garcia Campos  <cgarcia@igalia.com>
3544
3545         Remove code under USE(GRAPHICS_SURFACE)
3546         https://bugs.webkit.org/show_bug.cgi?id=168592
3547
3548         Reviewed by Michael Catanzaro.
3549
3550         This was only used by EFL port.
3551
3552         * platform/TextureMapper.cmake:
3553         * platform/graphics/opengl/GLPlatformSurface.cpp: Removed.
3554         * platform/graphics/surfaces/GLTransportSurface.cpp: Removed.
3555         * platform/graphics/surfaces/GLTransportSurface.h: Removed.
3556         * platform/graphics/surfaces/GraphicsSurface.cpp: Removed.
3557         * platform/graphics/surfaces/GraphicsSurface.h: Removed.
3558         * platform/graphics/surfaces/GraphicsSurfaceToken.h: Removed.
3559         * platform/graphics/surfaces/egl/EGLConfigSelector.cpp: Removed.
3560         * platform/graphics/surfaces/egl/EGLConfigSelector.h: Removed.
3561         * platform/graphics/surfaces/egl/EGLContext.cpp: Removed.
3562         * platform/graphics/surfaces/egl/EGLContext.h: Removed.
3563         * platform/graphics/surfaces/egl/EGLHelper.cpp: Removed.
3564         * platform/graphics/surfaces/egl/EGLHelper.h: Removed.
3565         * platform/graphics/surfaces/egl/EGLSurface.cpp: Removed.
3566         * platform/graphics/surfaces/egl/EGLSurface.h: Removed.
3567         * platform/graphics/surfaces/egl/EGLXSurface.cpp: Removed.
3568         * platform/graphics/surfaces/egl/EGLXSurface.h: Removed.
3569         * platform/graphics/surfaces/glx/GLXConfigSelector.h: Removed.
3570         * platform/graphics/surfaces/glx/GLXContext.cpp: Removed.
3571         * platform/graphics/surfaces/glx/GLXContext.h: Removed.
3572         * platform/graphics/surfaces/glx/GLXSurface.cpp: Removed.
3573         * platform/graphics/surfaces/glx/GLXSurface.h: Removed.
3574         * platform/graphics/surfaces/glx/X11Helper.cpp: Removed.
3575         * platform/graphics/surfaces/glx/X11Helper.h: Removed.
3576         * platform/graphics/texmap/TextureMapperBackingStore.cpp:
3577         * platform/graphics/texmap/TextureMapperBackingStore.h:
3578         * platform/graphics/texmap/TextureMapperPlatformLayer.h:
3579         (WebCore::TextureMapperPlatformLayer::setClient):
3580         * platform/graphics/texmap/TextureMapperSurfaceBackingStore.cpp: Removed.
3581         * platform/graphics/texmap/TextureMapperSurfaceBackingStore.h: Removed.
3582         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
3583         (WebCore::CoordinatedGraphicsLayer::CoordinatedGraphicsLayer):
3584         (WebCore::CoordinatedGraphicsLayer::setContentsNeedsDisplay):
3585         (WebCore::CoordinatedGraphicsLayer::setContentsToPlatformLayer):
3586         (WebCore::CoordinatedGraphicsLayer::syncPlatformLayer):
3587         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
3588         * platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
3589         (WebCore::CoordinatedGraphicsLayerState::CoordinatedGraphicsLayerState):
3590
3591 2017-02-20  Dean Jackson  <dino@apple.com>
3592
3593         Add 'webglcontextchanged' WebGLContextEvent
3594         https://bugs.webkit.org/show_bug.cgi?id=168595
3595         <rdar://problem/30604254>
3596
3597         Reviewed by Antoine Quint.
3598
3599         Add a new event that is dispatched when the GraphicsContext3D
3600         notices that the active GPU has changed.
3601
3602         Test: fast/canvas/webgl/webglcontextchangedevent.html
3603
3604         * dom/EventNames.h: Add 'webglcontextchanged'.
3605         * html/canvas/WebGLRenderingContextBase.cpp:
3606         (WebCore::WebGLRenderingContextBase::dispatchContextChangedEvent): Dispatch the new event.
3607         (WebCore::WebGLRenderingContextBase::simulateContextChanged): Tell the GraphicsContext3D to
3608         pretend there was a GPU switch. This is called from Internals for testing.
3609         * html/canvas/WebGLRenderingContextBase.h:
3610         * html/canvas/WebGLRenderingContextBase.idl: Export the interface so Internals can see it.
3611
3612         * platform/graphics/GraphicsContext3D.cpp:
3613         (WebCore::GraphicsContext3D::simulateContextChanged): Tell the GraphicsContext3DManager
3614         that it should pretend a GPU change has happened, which causes it to notify all the
3615         active contexts.
3616         * platform/graphics/GraphicsContext3D.h:
3617
3618         * platform/graphics/mac/GraphicsContext3DMac.mm:
3619         (WebCore::GraphicsContext3DManager::updateAllContexts): Tell the GraphicsContext3Ds
3620         to tell their WebGLRenderingContexts to dispatch an event.
3621         (WebCore::GraphicsContext3D::simulateContextChanged): Fake the display change.
3622         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
3623         (WebCore::GraphicsContext3D::dispatchContextChangedNotification): Tell the WebGLRenderingContext
3624         that a change has occurred, and that it should dispatch an event. This is a layering
3625         violation which will need to be fixed (although with other communication from GC3D back
3626         to WebGL).
3627         * testing/Internals.cpp:
3628         (WebCore::Internals::simulateWebGLContextChanged):
3629         * testing/Internals.h:
3630         * testing/Internals.idl:
3631
3632 2017-02-19  Dean Jackson  <dino@apple.com>
3633
3634         Activate/deactivate high performance GPU when requested
3635         https://bugs.webkit.org/show_bug.cgi?id=168559
3636         <rdar://problem/30592266>
3637
3638         Reviewed by Jon Lee.
3639
3640         Respect the high-performance powerPreference for WebGL, by managing an
3641         object that enables the high-performance GPU. If a WebGL context wants
3642         high-performance, and it is visible, then a manager class in GraphicsContext3D
3643         creates and retains the object, causing all the WebGL contexts to move GPUs.
3644         If all the high-performance contexts are not visible, such as in a background tab,
3645         then the manager will release the object, allowing the GPU to power down.
3646
3647         The swapping back from the high-performance GPU happens on a timer, to make
3648         sure we don't churn between GPUs if the user is swapping between a lot of tabs,
3649         or windows.
3650
3651         Unfortunately testing this change properly requires hardware with
3652         multiple GPUs. I plan to write an API test that fakes most of the
3653         system interaction, such as occluding the page. An API test might
3654         also be able to verify if the system has more than one GPU. Otherwise
3655         I'll have to plumb everything through Internals.
3656
3657         * html/canvas/WebGLRenderingContextBase.cpp:
3658         (WebCore::isHighPerformanceContext): Helper to detect if the GraphicsContext3D actually
3659         used high-performance mode.
3660         (WebCore::WebGLRenderingContextBase::create): Add logging if we are
3661         actually overriding a high-performance request.
3662         (WebCore::WebGLRenderingContextBase::WebGLRenderingContextBase): If we are high-performance,
3663         then register for activity state changes.
3664         (WebCore::WebGLRenderingContextBase::addActivityStateChangeObserverIfNecessary):
3665         (WebCore::WebGLRenderingContextBase::removeActivityStateChangeObserver):
3666         (WebCore::WebGLRenderingContextBase::destroyGraphicsContext3D): Call removeActivityStateChangeObserver
3667         as the GC3D is destroyed.
3668         (WebCore::WebGLRenderingContextBase::maybeRestoreContext): If the context was
3669         restored successfully, and came back in high-performance, then we need
3670         to listen for activity state changes as usual.
3671         (WebCore::WebGLRenderingContextBase::activityStateDidChange): If we changed visibility,
3672         tell the GC3D.
3673         * html/canvas/WebGLRenderingContextBase.h: Class inherits ActivityStateChangeObserver.
3674
3675         * page/Settings.in: No longer force low-power everywhere.
3676
3677         * platform/graphics/GraphicsContext3D.cpp:
3678         (WebCore::GraphicsContext3D::setContextVisibility): Empty implementation for non-Mac.
3679         * platform/graphics/GraphicsContext3D.h:
3680         (WebCore::GraphicsContext3D::powerPreferenceUsedForCreation): Tells clients what power preference
3681         was actually used during creation (e.g. a single GPU system will use default, even if
3682         they requested high-performance).
3683
3684         * platform/graphics/mac/GraphicsContext3DMac.mm:
3685         (WebCore::GraphicsContext3DManager::GraphicsContext3DManager): Helper class to
3686         look after all GraphicsContext3Ds.
3687         (WebCore::GraphicsContext3DManager::hasTooManyContexts): We have a limit on the
3688         number of contexts we can keep alive at any one time.
3689         (WebCore::manager): Helper to return the static instance.
3690         (WebCore::displayWasReconfigured): Send a message to all the contexts.
3691         (WebCore::GraphicsContext3DManager::addContext):
3692         (WebCore::GraphicsContext3DManager::removeContext):
3693         (WebCore::GraphicsContext3DManager::addContextRequiringHighPerformance):
3694         (WebCore::GraphicsContext3DManager::removeContextRequiringHighPerformance):
3695         (WebCore::GraphicsContext3DManager::updateHighPerformanceState): Check if the number
3696         of contexts requiring high-performance means we need to enable/disable that GPU.
3697         (WebCore::GraphicsContext3DManager::disableHighPerformanceGPUTimerFired): Releases our
3698         object that keeps the high-performance GPU on.
3699         (WebCore::GraphicsContext3DManager::recycleContextIfNecessary): Get rid of the first (oldest)
3700         context. This code was in GC3D proper, but it made more sense here in the helper.
3701         (WebCore::setPixelFormat): All contexts are created muxable now.
3702         (WebCore::GraphicsContext3D::create): Use the manager.
3703         (WebCore::GraphicsContext3D::GraphicsContext3D): Ditto.
3704         (WebCore::GraphicsContext3D::~GraphicsContext3D): Add logging.
3705         (WebCore::GraphicsContext3D::checkGPUStatusIfNecessary): Better logging.
3706         (WebCore::GraphicsContext3D::updateCGLContext):
3707         (WebCore::GraphicsContext3D::setContextVisibility): This is the responder to the
3708         ActivityStateChanges in the WebGLRenderingContext.
3709         (WebCore::activeContexts): Deleted.
3710         (WebCore::addActiveContext): Deleted.
3711         (WebCore::removeActiveContext): Deleted.
3712
3713 2017-02-20  Manuel Rego Casasnovas  <rego@igalia.com>
3714
3715         [css-grid] Remove compilation flag ENABLE_CSS_GRID_LAYOUT
3716         https://bugs.webkit.org/show_bug.cgi?id=167693
3717
3718         Reviewed by Sergio Villar Senin.
3719
3720         * Configurations/FeatureDefines.xcconfig:
3721         * css/CSSComputedStyleDeclaration.cpp:
3722         (WebCore::valueForGridPosition):
3723         (WebCore::isLayoutDependent):
3724         (WebCore::resolveJustifySelfAuto):
3725         (WebCore::isImplicitlyInheritedGridOrFlexProperty):
3726         (WebCore::valueForContentPositionAndDistributionWithOverflowAlignment):
3727         (WebCore::ComputedStyleExtractor::propertyValue):
3728         * css/CSSGridAutoRepeatValue.cpp:
3729         * css/CSSGridAutoRepeatValue.h:
3730         * css/CSSGridLineNamesValue.cpp:
3731         * css/CSSGridLineNamesValue.h:
3732         * css/CSSGridTemplateAreasValue.cpp:
3733         * css/CSSGridTemplateAreasValue.h:
3734         * css/CSSPrimitiveValueMappings.h:
3735         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
3736         * css/CSSProperties.json:
3737         * css/CSSValue.cpp:
3738         (WebCore::CSSValue::equals):
3739         (WebCore::CSSValue::cssText):
3740         (WebCore::CSSValue::destroy):
3741         * css/CSSValue.h:
3742         (WebCore::CSSValue::isContentDistributionValue):
3743         (WebCore::CSSValue::isGridLineNamesValue):
3744         * css/CSSValueKeywords.in:
3745         * css/StyleBuilderConverter.h:
3746         (WebCore::StyleBuilderConverter::convertGridAutoFlow):
3747         (WebCore::StyleBuilderConverter::convertContentAlignmentData):
3748         * css/StyleBuilderCustom.h:
3749         (WebCore::StyleBuilderCustom::applyValueGridTemplateRows):
3750         * css/StyleProperties.cpp:
3751         (WebCore::StyleProperties::getPropertyValue):
3752         * css/StyleResolver.cpp:
3753         (WebCore::equivalentBlockDisplay):
3754         * css/StyleResolver.h:
3755         * css/parser/CSSParser.cpp:
3756         (WebCore::CSSParserContext::CSSParserContext):
3757         (WebCore::operator==):
3758         * css/parser/CSSParserFastPaths.cpp:
3759         (WebCore::isSimpleLengthPropertyID):
3760         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
3761         (WebCore::CSSParserFastPaths::isKeywordPropertyID):
3762         * css/parser/CSSParserMode.h:
3763         (WebCore::CSSParserContextHash::hash):
3764         * css/parser/CSSPropertyParser.cpp:
3765         (WebCore::consumeGridAutoFlow):
3766         (WebCore::consumeGridTemplateAreas):
3767         (WebCore::CSSPropertyParser::parseSingleValue):
3768         (WebCore::CSSPropertyParser::consumeGridShorthand):
3769         (WebCore::CSSPropertyParser::parseShorthand):
3770         * dom/Document.cpp:
3771         * dom/Document.h:
3772         * dom/Position.cpp:
3773         (WebCore::Position::isCandidate):
3774         * page/RuntimeEnabledFeatures.h:
3775         (WebCore::RuntimeEnabledFeatures::isCSSGridLayoutEnabled):
3776         * rendering/Grid.cpp:
3777         * rendering/Grid.h:
3778         * rendering/RenderBlock.cpp:
3779         (WebCore::RenderBlock::getFirstLetter):
3780         * rendering/RenderBox.cpp:
3781         (WebCore::RenderBox::~RenderBox):
3782         (WebCore::RenderBox::styleDidChange):
3783         (WebCore::RenderBox::clearExtraInlineAndBlockOffests):
3784         (WebCore::RenderBox::containingBlockLogicalWidthForContent):
3785         (WebCore::RenderBox::containingBlockLogicalHeightForContent):
3786         (WebCore::RenderBox::perpendicularContainingBlockLogicalHeight):
3787         (WebCore::RenderBox::computeLogicalWidthInRegion):
3788         (WebCore::RenderBox::sizesLogicalWidthToFitContent):
3789         (WebCore::RenderBox::computeLogicalHeight):
3790         (WebCore::RenderBox::computePercentageLogicalHeight):
3791         (WebCore::RenderBox::containingBlockLogicalWidthForPositioned):
3792         (WebCore::RenderBox::containingBlockLogicalHeightForPositioned):
3793         (WebCore::RenderBox::computePositionedLogicalWidth):
3794         (WebCore::RenderBox::computePositionedLogicalHeight):
3795         (WebCore::RenderBox::createsNewFormattingContext):
3796         (WebCore::logicalWidthIsResolvable):
3797         (WebCore::RenderBox::percentageLogicalHeightIsResolvableFromBlock):
3798         (WebCore::RenderBox::hasDefiniteLogicalHeight):
3799         * rendering/RenderBox.h:
3800         (WebCore::RenderBox::isGridItem):
3801         * rendering/RenderElement.cpp:
3802         (WebCore::RenderElement::createFor):
3803         * rendering/RenderFlexibleBox.cpp:
3804         (WebCore::RenderFlexibleBox::alignChildren):
3805         * rendering/RenderGrid.cpp:
3806         * rendering/RenderGrid.h:
3807         * rendering/RenderObject.h:
3808         (WebCore::RenderObject::isRenderGrid):
3809         * rendering/style/GridArea.h:
3810         * rendering/style/GridLength.h:
3811         * rendering/style/GridPosition.h:
3812         * rendering/style/GridPositionsResolver.cpp:
3813         * rendering/style/GridPositionsResolver.h:
3814         * rendering/style/GridTrackSize.h:
3815         * rendering/style/RenderStyle.cpp:
3816         (WebCore::RenderStyle::isCSSGridLayoutEnabled):
3817         (WebCore::RenderStyle::changeRequiresLayout):
3818         * rendering/style/RenderStyle.h:
3819         (WebCore::RenderStyle::gridItemRowEnd):
3820         (WebCore::RenderStyle::setGridRowGap):
3821         (WebCore::RenderStyle::initialGridItemRowEnd):
3822         (WebCore::RenderStyle::isDisplayReplacedType):
3823         (WebCore::RenderStyle::isDisplayGridBox):
3824         * rendering/style/RenderStyleConstants.h:
3825         * rendering/style/StyleGridData.cpp:
3826         * rendering/style/StyleGridData.h:
3827         * rendering/style/StyleGridItemData.cpp:
3828         * rendering/style/StyleGridItemData.h:
3829         * rendering/style/StyleRareNonInheritedData.cpp:
3830         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
3831         (WebCore::StyleRareNonInheritedData::operator==):
3832         * rendering/style/StyleRareNonInheritedData.h:
3833         * testing/InternalSettings.cpp:
3834         (WebCore::InternalSettings::Backup::Backup):
3835         (WebCore::InternalSettings::Backup::restoreTo):
3836         (WebCore::InternalSettings::setCSSGridLayoutEnabled):
3837
3838 2017-02-20  Carlos Garcia Campos  <cgarcia@igalia.com>
3839
3840         REGRESSION(r212345): [GTK] ASSERT(cookieChangeCallbackMap().contains(jar)) failed in WebCore::stopObservingCookieChanges:54
3841         https://bugs.webkit.org/show_bug.cgi?id=168375
3842
3843         Reviewed by Alex Christensen.
3844
3845         Simplify the way cookie storage is handled in NetworkStorageSessionSoup. Now we always keep a reference to the
3846         cookie jar, no matter if we have a session or not, that is always kept in sync with the one actually used by the
3847         session. We always connect to the changed signal of the current cookie jar and notify the observer if it has been
3848         set.
3849
3850         * platform/network/NetworkStorageSession.h:
3851         * platform/network/soup/CookieStorageSoup.cpp:
3852         (WebCore::startObservingCookieChanges): Remove this implementation and add an ASSERT to ensure we don't use this anymore.
3853         (WebCore::stopObservingCookieChanges): Ditto.
3854         (WebCore::cookieChangeCallbackMap): Deleted.
3855         (WebCore::soupCookiesChanged): Deleted.
3856         * platform/network/soup/NetworkStorageSessionSoup.cpp:
3857         (WebCore::NetworkStorageSession::NetworkStorageSession): Initialize the cookie storage.
3858         (WebCore::NetworkStorageSession::~NetworkStorageSession): Disconnect the changed signal.
3859         (WebCore::NetworkStorageSession::getOrCreateSoupNetworkSession): Always pass the current cookie storage.
3860         (WebCore::NetworkStorageSession::cookiesDidChange): Notify the observer.
3861         (WebCore::NetworkStorageSession::cookieStorage): Return the current cookie storage.
3862         (WebCore::NetworkStorageSession::setCookieStorage): Update the current cookie storage and update the session if
3863         needed too. We always have a valid cookie storage so if nullptr is given we create a new one.
3864         (WebCore::NetworkStorageSession::setCookieObserverHandler): Set a cookie observer handler.
3865
3866 2017-02-19  Chris Dumez  <cdumez@apple.com>
3867
3868         onbeforeunload event return value coercion is not per-spec
3869         https://bugs.webkit.org/show_bug.cgi?id=168382
3870
3871         Reviewed by Darin Adler.
3872
3873         Update handling of value returned by onbeforeunload event listeners
3874         to match Firefox and the specification:
3875         - https://html.spec.whatwg.org/#the-event-handler-processing-algorithm (step 4)
3876
3877         Namely, the following changes were made:
3878         - Only set the event's returnValue attribute to the returned value if the attribute
3879           value is the empty string (so as to not override the attribute value if it has
3880           explicitly been set by JS).
3881         - Cancel the event when the return value is not null by calling preventDefault().
3882
3883         Additionally, the following changes were made:
3884         - Ask the user to confirm the navigation if the event was canceled, not just if the
3885           returnValue attribute was set to a non-empty string.
3886         as per:
3887         - https://html.spec.whatwg.org/#prompt-to-unload-a-document (step 8)
3888
3889         Tests: fast/events/before-unload-return-string-conversion.html
3890                imported/w3c/web-platform-tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-canceling.html
3891
3892         * bindings/js/JSEventListener.cpp:
3893         (WebCore::handleBeforeUnloadEventReturnValue):
3894         (WebCore::JSEventListener::handleEvent):
3895         * loader/FrameLoader.cpp:
3896         (WebCore::shouldAskForNavigationConfirmation):
3897         (WebCore::FrameLoader::dispatchBeforeUnloadEvent):
3898
3899 2017-02-19  Carlos Garcia Campos  <cgarcia@igalia.com>
3900
3901         [SOUP] Call SoupNetworkSession::setShouldIgnoreTLSErrors when testRunner.setAllowsAnySSLCertificate() is called
3902         https://bugs.webkit.org/show_bug.cgi?id=168571
3903
3904         Reviewed by Michael Catanzaro.
3905
3906         Fixes: http/tests/ssl/upgrade-origin-usage.html
3907
3908         * testing/InternalSettings.cpp:
3909         (WebCore::InternalSettings::setAllowsAnySSLCertificate):
3910
3911 2017-02-18  Ryosuke Niwa  <rniwa@webkit.org>
3912
3913         REGRESSION(r212218): Assertion failures in and after parserRemoveChild
3914         https://bugs.webkit.org/show_bug.cgi?id=168458
3915
3916         Reviewed by Antti Koivisto.
3917
3918         The bug was caused by parserRemoveChild not preceeding to remove oldChild even when
3919         oldChild had been inserted elsewhere during unload evnets of the disconnected frames.
3920         Fixed the bug by checking this condition and exiting early.
3921
3922         Also fixed various callers of parserRemoveChild to not call parserAppendChild when
3923         the removed node had already been inserted elsewhere by scripts.
3924
3925         Tests: fast/parser/adoption-agency-unload-iframe-3.html
3926                fast/parser/adoption-agency-unload-iframe-4.html
3927                fast/parser/xml-error-unload-iframe.html
3928
3929         * dom/ContainerNode.cpp:
3930         (WebCore::ContainerNode::parserRemoveChild): Exit early when the node had been
3931         inserted elsewhere while firing unload events. Also moved the call to
3932         notifyRemovePendingSheetIfNeeded outside NoEventDispatchAssertion since it can
3933         synchrnously fire a focus event.
3934         (WebCore::ContainerNode::parserAppendChild): Moved adoptNode call to inside
3935         NoEventDispatchAssertion since adoptNode call here should never mutate DOM.
3936         * html/parser/HTMLConstructionSite.cpp:
3937         (WebCore::executeReparentTask): Added an early exit when the node had already been
3938         inserted elsewhere.
3939         (WebCore::executeInsertAlreadyParsedChildTask): Ditto.
3940         * xml/XMLErrors.cpp:
3941         (WebCore::XMLErrors::insertErrorMessageBlock): Ditto.
3942         * xml/parser/XMLDocumentParser.cpp:
3943         (WebCore::XMLDocumentParser::end): Fixed a crash unveiled by one of the test cases.
3944         Exit early when insertErrorMessageBlock detached the parser (by author scripts).
3945         (WebCore::XMLDocumentParser::finish): Keep the parser alive until we exit.
3946
3947 2017-02-19  Chris Dumez  <cdumez@apple.com>
3948
3949         <input type=color readonly> doesn't act per spec
3950         https://bugs.webkit.org/show_bug.cgi?id=168421
3951         <rdar://problem/30593185>
3952
3953         Reviewed by Ryosuke Niwa.
3954
3955         The 'readonly' attribute should not apply to <input type=color> as per the
3956         HTML specification:
3957         - https://html.spec.whatwg.org/#the-input-element:attr-input-readonly-3
3958
3959         Chrome / Firefox and Edge already behave as per the specification.
3960
3961         Tests: fast/forms/color/input-color-disabled.html
3962                fast/forms/color/input-color-readonly.html
3963
3964         * html/ColorInputType.cpp:
3965         (WebCore::ColorInputType::handleDOMActivateEvent):
3966         (WebCore::ColorInputType::didChooseColor):
3967
3968 2017-02-19  Commit Queue  <commit-queue@webkit.org>
3969
3970         Unreviewed, rolling out r212466.
3971         https://bugs.webkit.org/show_bug.cgi?id=168577
3972
3973         causes crashes on AArch64 on linux, maybe it's causing crashes
3974         on iOS too (Requested by pizlo on #webkit).
3975
3976         Reverted changeset:
3977
3978         "The collector thread should only start when the mutator
3979         doesn't have heap access"
3980         https://bugs.webkit.org/show_bug.cgi?id=167737
3981         http://trac.webkit.org/changeset/212466
3982
3983 2017-02-19  Zalan Bujtas  <zalan@apple.com>
3984