bfb43bd2dd7524256c69714233cadc777bb9d63a
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-02-28  Matt Rajca  <mrajca@apple.com>
2
3         Media: send "did interfere with playback" events when the user pauses an autoplaying element
4         https://bugs.webkit.org/show_bug.cgi?id=169006
5
6         Reviewed by Alex Christensen.
7
8         Added API tests.
9
10         * html/HTMLMediaElement.cpp:
11         (WebCore::HTMLMediaElement::pauseInternal):
12
13 2017-03-02  Chris Dumez  <cdumez@apple.com>
14
15         We should prevent load of subframes inserted during FrameTree deconstruction
16         https://bugs.webkit.org/show_bug.cgi?id=169095
17
18         Reviewed by Brent Fulgham.
19
20         When deconstructing the FrameTree, we fire the unload event in each subframe.
21         Such unload event handler may insert a new frame, we would previously load
22         such new frame which was unsafe as we would end up with an attached subframe
23         on a detached tree. To address the issue, we prevent new subframes from loading
24         while deconstructing the FrameTree and firing the unload events. This new
25         behavior is consistent with Chrome and should therefore be safe from a
26         compatibility standpoint.
27
28         Test: fast/frames/insert-frame-unload-handler.html
29
30         * dom/ContainerNodeAlgorithms.cpp:
31         (WebCore::disconnectSubframes):
32         Update SubframeLoadingDisabler call site now that the constructor takes in
33         a pointer instead of a reference.
34
35         * html/HTMLFrameOwnerElement.h:
36         (WebCore::SubframeLoadingDisabler::SubframeLoadingDisabler):
37         (WebCore::SubframeLoadingDisabler::~SubframeLoadingDisabler):
38         Update SubframeLoadingDisabler constructor to take in a pointer instead
39         of a reference, for convenience.
40
41         * loader/FrameLoader.cpp:
42         (WebCore::FrameLoader::detachChildren):
43         Prevent loads in subframes while detaching the subframes. It would be unsafe
44         as we copy the list of frames before iterating to fire the unload events.
45         Therefore, newly inserted frames would not get unloaded.
46
47 2017-03-02  Dave Hyatt  <hyatt@apple.com>
48
49         flex-basis should be 0% (not 0px) when omitted
50         https://bugs.webkit.org/show_bug.cgi?id=169100
51         rdar://problem/30429154
52
53         Reviewed by Dean Jackson.
54
55         Covered by existing tests.
56
57         * css/parser/CSSPropertyParser.cpp:
58         (WebCore::CSSPropertyParser::consumeFlex):
59
60 2017-02-22  Jiewen Tan  <jiewen_tan@apple.com>
61
62         WebCrypto API support for AES-GCM
63         https://bugs.webkit.org/show_bug.cgi?id=157175
64         <rdar://problem/27311691>
65
66         Reviewed by Brent Fulgham.
67
68         This patch adds support for AES-GCM. Operations of AES-GCM include: encrypt, decrypt, generateKey,
69         importKey, exportKey, wrapKey, and unwrapKey. https://www.w3.org/TR/WebCryptoAPI/#aes-gcm
70
71         Tests: crypto/subtle/aes-gcm-decrypt-malformed-parameters.html
72                crypto/subtle/aes-gcm-encrypt-malformed-parameters.html
73                crypto/subtle/aes-gcm-generate-export-key-jwk-length-128.html
74                crypto/subtle/aes-gcm-generate-export-key-jwk-length-192.html
75                crypto/subtle/aes-gcm-generate-export-key-jwk-length-256.html
76                crypto/subtle/aes-gcm-generate-export-raw-key.html
77                crypto/subtle/aes-gcm-generate-key-encrypt-decrypt.html
78                crypto/subtle/aes-gcm-generate-key.html
79                crypto/subtle/aes-gcm-import-jwk-key-length-128.html
80                crypto/subtle/aes-gcm-import-jwk-key-length-192.html
81                crypto/subtle/aes-gcm-import-jwk-key-length-256.html
82                crypto/subtle/aes-gcm-import-key-decrypt-additional-data-tag-length-32.html
83                crypto/subtle/aes-gcm-import-key-decrypt-additional-data.html
84                crypto/subtle/aes-gcm-import-key-decrypt-tagLengths.html
85                crypto/subtle/aes-gcm-import-key-decrypt.html
86                crypto/subtle/aes-gcm-import-key-encrypt-additional-data-tag-length-32.html
87                crypto/subtle/aes-gcm-import-key-encrypt-additional-data.html
88                crypto/subtle/aes-gcm-import-key-encrypt-tagLengths.html
89                crypto/subtle/aes-gcm-import-key-encrypt.html
90                crypto/subtle/aes-gcm-import-key-unwrap-jwk-key.html
91                crypto/subtle/aes-gcm-import-key-unwrap-raw-key.html
92                crypto/subtle/aes-gcm-import-key-wrap-jwk-key.html
93                crypto/subtle/aes-gcm-import-key-wrap-raw-key.html
94                crypto/subtle/aes-gcm-import-raw-key.html
95                crypto/workers/subtle/aes-gcm-import-key-decrypt.html
96                crypto/workers/subtle/aes-gcm-import-key-encrypt.html
97                crypto/workers/subtle/aes-gcm-import-key-unwrap-key.html
98                crypto/workers/subtle/aes-gcm-import-key-wrap-key.html
99
100         * CMakeLists.txt:
101         * DerivedSources.make:
102         * PlatformGTK.cmake:
103         * PlatformMac.cmake:
104         Add CryptoAlgorithmAES_CFBMac.cpp as well.
105         * WebCore.xcodeproj/project.pbxproj:
106         * bindings/js/JSSubtleCryptoCustom.cpp:
107         (WebCore::normalizeCryptoAlgorithmParameters):
108         Add support for AES-GCM.
109         * crypto/CommonCryptoUtilities.h:
110         Include SPI header for AES-GCM support.
111         * crypto/CryptoAlgorithmParameters.h:
112         * crypto/algorithms/CryptoAlgorithmAES_GCM.cpp: Added.
113         (WebCore::usagesAreInvalidForCryptoAlgorithmAES_GCM):
114         (WebCore::tagLengthIsValid):
115         (WebCore::CryptoAlgorithmAES_GCM::create):
116         (WebCore::CryptoAlgorithmAES_GCM::identifier):
117         (WebCore::CryptoAlgorithmAES_GCM::encrypt):
118         (WebCore::CryptoAlgorithmAES_GCM::decrypt):
119         (WebCore::CryptoAlgorithmAES_GCM::generateKey):
120         (WebCore::CryptoAlgorithmAES_GCM::importKey):
121         (WebCore::CryptoAlgorithmAES_GCM::exportKey):
122         * crypto/algorithms/CryptoAlgorithmAES_GCM.h: Added.
123         * crypto/gnutls/CryptoAlgorithmAES_GCMGnuTLS.cpp: Added.
124         (WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
125         (WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
126         * crypto/mac/CryptoAlgorithmAES_GCMMac.cpp: Added.
127         (WebCore::encryptAES_GCM):
128         (WebCore::decyptAES_GCM):
129         (WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
130         (WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
131         * crypto/mac/CryptoAlgorithmRegistryMac.cpp:
132         (WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms):
133         * crypto/parameters/AesGcmParams.idl: Added.
134         * crypto/parameters/CryptoAlgorithmAesGcmParams.h: Added.
135
136 2017-03-02  Alex Christensen  <achristensen@webkit.org>
137
138         Continue enabling WebRTC
139         https://bugs.webkit.org/show_bug.cgi?id=169056
140
141         Reviewed by Jon Lee.
142
143         * Configurations/FeatureDefines.xcconfig:
144
145 2017-03-02  Ryan Haddad  <ryanhaddad@apple.com>
146
147         Unreviewed, rolling out r213281.
148
149         This change caused API test WebKit2.UserMediaBasic to time
150         out.
151
152         Reverted changeset:
153
154         "[MediaStream] UIClient may not be notified of capture state
155         change when leaving a page"
156         https://bugs.webkit.org/show_bug.cgi?id=169014
157         http://trac.webkit.org/changeset/213281
158
159 2017-03-02  Jon Lee  <jonlee@apple.com>
160
161         Improve consistency of captions rendering on Mac
162         https://bugs.webkit.org/show_bug.cgi?id=169071
163
164         Reviewed by Eric Carlson.
165
166         * page/CaptionUserPreferencesMediaAF.h:
167         (WebCore::CaptionUserPreferencesMediaAF::captionsEdgeColorForTextColor): Deleted.
168         (WebCore::CaptionUserPreferencesMediaAF::cssPropertyWithTextEdgeColor): Deleted.
169
170         * page/CaptionUserPreferencesMediaAF.cpp:
171         (WebCore::appendCSS): Helper function to add a CSS rule with a provided StringBuilder.
172         (WebCore::CaptionUserPreferencesMediaAF::windowRoundedCornerRadiusCSS): Refactor to use
173         appendCSS.
174         (WebCore::CaptionUserPreferencesMediaAF::colorPropertyCSS): Ditto.
175         (WebCore::CaptionUserPreferencesMediaAF::captionsTextEdgeCSS): Update text edge styles.
176         - Add a blur to the shadow
177         - Drop shadow style includes 1px text border
178         - Always use black for the text edge color
179         Also convert the stroke rules to using the CSS property and values instead of straight strings.
180         (WebCore::CaptionUserPreferencesMediaAF::captionsStyleSheetOverride): Fly-by fix of a typo.
181
182 2017-03-02  Chris Dumez  <cdumez@apple.com>
183
184         Download attribute set to "*\" save file with name "example.com"
185         https://bugs.webkit.org/show_bug.cgi?id=169066
186         <rdar://problem/30740875>
187
188         Reviewed by Alex Christensen.
189
190         The issue is that a backslash in recognized as an escaping character in
191         a quoted string as per RFC2616:
192         "
193         The backslash character ("\") MAY be used as a single-character
194         quoting mechanism only within quoted-string and comment constructs.
195         "
196
197         We therefore need to escape the backslashes in the filename before
198         using it in the Content-Disposition header, inside the quoted string.
199
200         Test: fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-backslash.html
201
202         * platform/network/ResourceResponseBase.cpp:
203         (WebCore::ResourceResponseBase::sanitizeSuggestedFilename):
204
205 2017-03-02  Youenn Fablet  <youenn@apple.com>
206
207         [WebRTC] Activate ICE candidate privacy policy
208         https://bugs.webkit.org/show_bug.cgi?id=168975
209
210         Reviewed by Alex Christensen.
211
212         Test: webrtc/datachannel/filter-ice-candidate.html
213
214         * testing/Internals.cpp:
215         (WebCore::Internals::Internals): Disabling ICE candidate filtering by default for rwt.
216         (WebCore::Internals::setICECandidateFiltering):
217         * testing/Internals.h:
218         * testing/Internals.idl:
219
220 2017-03-02  Eric Carlson  <eric.carlson@apple.com>
221
222         [MediaStream] UIClient may not be notified of capture state change when leaving a page
223         https://bugs.webkit.org/show_bug.cgi?id=169014
224         <rdar://problem/30632267>
225
226         Reviewed by Youenn Fablet.
227
228         Enable and update the WebKit API test WebKit2.UserMedia.
229
230         * dom/Document.cpp:
231         (WebCore::Document::prepareForDestruction): Always call page.updateIsPlayingMedia() if there
232         is active media in the document because it won't be possible when the state changes later
233         because the frame will have been cleared.
234
235 2017-03-02  Tomas Popela  <tpopela@redhat.com>
236
237         [WK2] Keyboard menu key should show context menu
238         https://bugs.webkit.org/show_bug.cgi?id=72099
239
240         Reviewed by Carlos Garcia Campos.
241
242         Show the context menu when the GtkWidget::popup-menu signal is
243         emitted. This signal is triggered by pressing a key (usually
244         the Menu key or the Shift + F10 shortcut) or it could be emitted on
245         WebKitWebView.
246
247         Test: fast/events/context-activated-by-key-event.html
248
249         Also could be tested by:
250
251         ManualTests/keyboard-menukey-event.html
252         ManualTests/win/contextmenu-key.html
253         ManualTests/win/contextmenu-key2.html
254
255         * page/EventHandler.cpp:
256         (WebCore::EventHandler::sendContextMenuEventForKey):
257         Correctly send the mouse event that used for showing the context menu.
258         Previously the event was immediately dispatched as it is, but this was
259         only the right way if some element was focused on the page. If there
260         was no focused element or non-empty text range then the event lacked
261         the right node, where it was supposed to be shown. The correct node
262         is determined and added to the event in the sendContextMenuEvent() so
263         we have to use this function to send the event.
264
265         Also use absoluteBoundingBoxRect() instead of
266         pixelSnappedAbsoluteClippedOverflowRect() when determining
267         a coordinate where to show the context menu for the currently focus
268         element. The latter is not returning a right box (it is bigger) which
269         could lead to the situation that no menu will be displayed at all,
270         because the HitTest won't contain the right element as the
271         determined coordinates could be outside of the element.
272         * page/EventHandler.h:
273
274 2017-03-02  Carlos Garcia Campos  <cgarcia@igalia.com>
275
276         [GTK] Crash in WebCore::CoordinatedGraphicsLayer::notifyFlushRequired
277         https://bugs.webkit.org/show_bug.cgi?id=166420
278
279         Reviewed by Žan Doberšek.
280
281         This is happening when closing a page that is being inspected. When CoordinatedGraphicsLayer::removeFromParent()
282         is called, the coordinator has already been invalidated, so all its layers were set a nullptr coordinator. I
283         think it's safe to simply handle m_coordinator being nullptr in notifyFlushRequired().
284
285         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
286         (WebCore::CoordinatedGraphicsLayer::notifyFlushRequired): Return early if the coordinator is nullptr.
287
288 2017-03-02  Andreas Kling  <akling@apple.com>
289
290         Don't keep dead resources in MemoryCache while under memory pressure.
291         <https://webkit.org/b/169070>
292
293         Reviewed by Antti Koivisto.
294
295         Have CachedResource::deleteIfPossible() remove the resource from the MemoryCache
296         if we're under memory pressure and that was the only thing keeping it alive.
297
298         This is consistent with the policy where dead resources are evicted from the cache
299         as we come under pressure.
300
301         * loader/cache/CachedResource.cpp:
302         (WebCore::CachedResource::deleteIfPossible):
303
304 2017-03-01  Carlos Garcia Campos  <cgarcia@igalia.com>
305
306         REGRESSION(r213062): [SOUP] UTF-8 filename in Content-Disposition header incorrectly handled since r213062
307         https://bugs.webkit.org/show_bug.cgi?id=169024
308
309         Reviewed by Youenn Fablet.
310
311         This made test http/tests/download/literal-utf-8.html to start failing. The problem is that I removed the
312         conversion made by String::fromUTF8WithLatin1Fallback that was added in r176930. I removed it because that made
313         fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-unicode.html to timeout. This patch brings back
314         the String::fromUTF8WithLatin1Fallback call but only when the header string is 8 bit one.
315
316         Fixes: http/tests/download/literal-utf-8.html
317
318         * platform/network/soup/ResourceResponseSoup.cpp:
319         (WebCore::ResourceResponse::platformSuggestedFilename):
320
321 2017-03-01  Alex Christensen  <achristensen@webkit.org>
322
323         Actually fix Windows build.
324
325         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
326         Win32Handle is now in WTF namespace.
327
328 2017-03-01  Alex Christensen  <achristensen@webkit.org>
329
330         Fix WinCairo build after r213214
331         https://bugs.webkit.org/show_bug.cgi?id=168908
332
333         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
334
335 2017-03-01  Myles C. Maxfield  <mmaxfield@apple.com>
336
337         Implement font-stretch for installed fonts
338         https://bugs.webkit.org/show_bug.cgi?id=168888
339
340         Reviewed by Darin Adler and Dave Hyatt.
341
342         This patch implements the font-stretch property. Both parsing and the implementation is
343         implemented. Contrary to the name, this property doesn't actually stretch fonts; instead,
344         it provides one more input to the font selection routine.
345
346         The mapping from Core Text's [-1, 1] width values to font-stretch's percentage-based
347         values is not perfect. For now, I've implemented a piecewise linear curve mapping the
348         two. However, I expect to be able to improve this transfer function soon.
349
350         This patch does not implement the font-stretch descriptor in @font-face, and therefore
351         does not work with web fonts. I will add this support in
352         https://bugs.webkit.org/show_bug.cgi?id=168892. The reason it isn't done in this patch is
353         it requires some architectural changes to our CSSFontFace classes which are large enough
354         they should be separated into their own patch.
355
356         This patch lays the groundwork for implementing the 'wdth' variation axis. It does this
357         by adding a floating-point value to RenderStyle instead of just an enum. The font-stretch
358         keywords get converted to these floating-point numbers in accordance with the Fonts spec.
359         This patch doesn't actually implement the variations piece of font-stretch, because that
360         piece also requires some architectural changes. This patch just implements the installed
361         font selection piece.
362
363         This patch also fixes the regression introduced in r213163 with Helvetica Neue. Now that
364         our font selection algorithm has a concept of font stretch, weights 800 and 900 of
365         Helvetica Neue are rendered as expected. (And this patch updates the tests to make sure.)
366
367         Tests: fast/text/font-stretch-parse.html
368                fast/text/font-stretch-shorthand.html
369                FontCacheTest.FontLookupFromFamilyName
370
371         * css/CSSComputedStyleDeclaration.cpp:
372         (WebCore::fontStretchFromStyle): Map style values to CSS keywords.
373         (WebCore::ComputedStyleExtractor::propertyValue): Call the above function.
374         * css/CSSFontValue.cpp:
375         (WebCore::CSSFontValue::customCSSText): Used in getComputedStyle() for the "font"
376         shorthand.
377         (WebCore::CSSFontValue::equals):
378         * css/CSSFontValue.h:
379         * css/CSSProperties.json:
380         * css/StyleBuilderConverter.h:
381         (WebCore::StyleBuilderConverter::convertFontStretch): Map CSS keywords to style values.
382         * css/StyleProperties.cpp:
383         (WebCore::StyleProperties::appendFontLonghandValueIfExplicit): Used for
384         Element.style.font.
385         (WebCore::StyleProperties::fontValue):
386         * css/parser/CSSParserFastPaths.cpp:
387         (WebCore::CSSParserFastPaths::isKeywordPropertyID): Now that variation fonts are being
388         implemented, font-stretch is no longer a keyword property. Instead, it can also take a
389         number or percentage.
390         * css/parser/CSSPropertyParser.cpp:
391         (WebCore::consumeFontStretch): Parse the value.
392         (WebCore::CSSPropertyParser::parseSingleValue): Call the above function.
393         (WebCore::CSSPropertyParser::consumeFont): Ditto.
394         * platform/graphics/FontCache.h:
395         (WebCore::FontDescriptionKey::FontDescriptionKey): Caches should be sensitive to this
396         new value.
397         (WebCore::FontDescriptionKey::operator==):
398         (WebCore::FontDescriptionKey::computeHash):
399         * platform/graphics/FontDescription.h:
400         (WebCore::FontDescription::stretch): The parsed style value.
401         (WebCore::FontDescription::setStretch):
402         (WebCore::FontDescription::operator==):
403         (WebCore::FontCascadeDescription::initialStretch):
404         * platform/graphics/cocoa/FontCacheCoreText.cpp:
405         (WebCore::FontDatabase::InstalledFont::InstalledFont): Update the installed font selection
406         algorithm to understand font-stretch.
407         (WebCore::findClosestStretch):
408         (WebCore::filterStretch):
409         (WebCore::findClosestFont):
410         (WebCore::platformFontLookupWithFamily):
411         (WebCore::fontWithFamily):
412         (WebCore::FontCache::createFontPlatformData):
413
414 2017-03-01  Antti Koivisto  <antti@apple.com>
415
416         Rename recalcStyle to resolveStyle and clean up the signature
417         https://bugs.webkit.org/show_bug.cgi?id=169049
418
419         Reviewed by Sam Weinig.
420
421         Move to modern naming.
422
423         * dom/Document.cpp:
424         (WebCore::Document::resolveStyle):
425
426             Only two of the possible values are used so pass in a two-value enum.
427
428         (WebCore::Document::updateStyleIfNeeded):
429         (WebCore::Document::updateLayoutIgnorePendingStylesheets):
430         (WebCore::Document::createRenderTree):
431         (WebCore::Document::finishedParsing):
432         (WebCore::Document::webkitWillEnterFullScreenForElement):
433         (WebCore::Document::recalcStyle): Deleted.
434         * dom/Document.h:
435         * inspector/InspectorOverlay.cpp:
436         (WebCore::InspectorOverlay::update):
437         * loader/DocumentWriter.cpp:
438         (WebCore::DocumentWriter::reportDataReceived):
439         * page/Frame.cpp:
440         (WebCore::Frame::setPageAndTextZoomFactors):
441         * page/Page.cpp:
442         (WebCore::Page::setPageScaleFactor):
443         * style/StyleTreeResolver.cpp:
444         (WebCore::Style::TreeResolver::Parent::Parent):
445         (WebCore::Style::TreeResolver::resolve):
446
447             Remove the argument, Document invalidates the document element if everything needs to be re-resolved.
448
449         * style/StyleTreeResolver.h:
450
451 2017-03-01  Alex Christensen  <achristensen@webkit.org>
452
453         Unreviewed, rolling out r213259.
454
455         Broke an internal build
456
457         Reverted changeset:
458
459         "Continue enabling WebRTC"
460         https://bugs.webkit.org/show_bug.cgi?id=169056
461         http://trac.webkit.org/changeset/213259
462
463 2017-03-01  Alex Christensen  <achristensen@webkit.org>
464
465         Continue enabling WebRTC
466         https://bugs.webkit.org/show_bug.cgi?id=169056
467
468         Reviewed by Jon Lee.
469
470         * Configurations/FeatureDefines.xcconfig:
471
472 2017-03-01  Chris Dumez  <cdumez@apple.com>
473
474         [WK2][!NETWORK_SESSION] Failure to download when using a download attribute with no value on an anchor
475         https://bugs.webkit.org/show_bug.cgi?id=169060
476         <rdar://problem/30773140>
477
478         Reviewed by Darin Adler.
479
480         Make sure we never set the suggested filename to the empty string when
481         the download attribute is present but has no value.
482
483         Test: http/tests/download/anchor-download-no-value.html
484
485         * loader/PolicyChecker.cpp:
486         (WebCore::PolicyChecker::checkNavigationPolicy):
487
488 2017-03-01  Antoine Quint  <graouts@apple.com>
489
490         [ios-simulator] Unskip media/modern-media-controls/audio/audio-controls-metrics.html
491         https://bugs.webkit.org/show_bug.cgi?id=167258
492         <rdar://problem/30282740>
493
494         We weren't enforcing the min-width to be 200px as well as the default width, and the
495         UA stylesheet would override it. Setting a default min-width that trumps the UA
496         stylesheet makes the test work correctly on iOS and we can safely unskip this test.
497
498         Reviewed by Jon Lee.
499
500         * Modules/modern-media-controls/controls/media-controls.css:
501         (:host(audio)):
502
503 2017-03-01  Javier Fernandez  <jfernandez@igalia.com>
504
505         Missing 'specification' section in the place-content shorthand
506         https://bugs.webkit.org/show_bug.cgi?id=169052
507
508         Reviewed by Darin Adler.
509
510         Added 'specification' section in the place-content shorthand.
511
512         No new tests, no new functionality.
513
514         * css/CSSProperties.json:
515
516 2017-02-28  Matt Rajca  <mrajca@apple.com>
517
518         Media: notify clients when autoplayed media is muted
519         https://bugs.webkit.org/show_bug.cgi?id=168987
520
521         Reviewed by Alex Christensen.
522
523         Added API tests.
524
525         * html/HTMLMediaElement.cpp:
526         (WebCore::HTMLMediaElement::setMuted):
527         (WebCore::HTMLMediaElement::pageMutedStateDidChange):
528         * page/AutoplayEvent.h:
529
530 2017-03-01  Commit Queue  <commit-queue@webkit.org>
531
532         Unreviewed, rolling out r213226.
533         https://bugs.webkit.org/show_bug.cgi?id=169051
534
535         Speculative rollout, might be causing several failures and
536         crashes in WebKitGTK+ (Requested by lajava on #webkit).
537
538         Reverted changeset:
539
540         "REGRESSION(r213062): [SOUP] UTF-8 filename in Content-
541         Disposition header incorrectly handled since r213062"
542         https://bugs.webkit.org/show_bug.cgi?id=169024
543         http://trac.webkit.org/changeset/213226
544
545 2017-03-01  James Craig  <jcraig@apple.com>
546
547         AX: add role aliases for ARIA DPUB module
548         https://bugs.webkit.org/show_bug.cgi?id=168978
549         <rdar://problem/30762724>
550
551         Reviewed by Chris Fleizach.
552
553         Added role aliases for ARIA DPUB module, and updated existing tests.
554
555         Test: accessibility/roles-exposed.html
556         Test: inspector/dom/getAccessibilityPropertiesForNode.html
557
558         * accessibility/AccessibilityObject.cpp:
559         (WebCore::initializeRoleMap): 
560
561 2017-03-01  Alex Christensen  <achristensen@webkit.org>
562
563         Don't call libwebrtc functions if libwebrtc.dylib doesn't exist while testing
564         https://bugs.webkit.org/show_bug.cgi?id=169045
565         <rdar://problem/30735413>
566
567         Reviewed by Youenn Fablet.
568
569         WebRTC tests fail instead of crashing now if libwebrtc.dylib is missing.
570         All other tests pass instead of crashing immediately when creating an Internals object.
571
572         * Modules/mediastream/RTCController.cpp:
573         (WebCore::RTCController::disableICECandidateFiltering):
574         (WebCore::RTCController::enableICECandidateFiltering):
575         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
576         (WebCore::createLibWebRTCPeerConnectionBackend):
577         * testing/Internals.cpp:
578         (WebCore::Internals::enableMockMediaEndpoint):
579         (WebCore::Internals::emulateRTCPeerConnectionPlatformEvent):
580         (WebCore::Internals::useMockRTCPeerConnectionFactory):
581         * testing/Internals.h:
582
583 2017-03-01  Javier Fernandez  <jfernandez@igalia.com>
584
585         [css-align] Implement the place-content shorthand
586         https://bugs.webkit.org/show_bug.cgi?id=168771
587
588         Reviewed by Manuel Rego Casasnovas.
589
590         The CSS Box Alignment specification defines a new shorthand to set the
591         Content Alignment properties (align-content and justify-content) at the
592         same time.
593
594         This patch provides the implementation of the CSS parsing logic and the
595         required regression tests.
596
597         Test: css3/parse-place-content.html
598
599         * css/CSSComputedStyleDeclaration.cpp:
600         (WebCore::ComputedStyleExtractor::propertyValue):
601         * css/CSSProperties.json:
602         * css/StyleProperties.cpp:
603         (WebCore::StyleProperties::getPropertyValue):
604         * css/parser/CSSPropertyParser.cpp:
605         (WebCore::consumeSimplifiedContentPosition):
606         (WebCore::CSSPropertyParser::consumePlaceContentShorthand):
607         (WebCore::CSSPropertyParser::parseShorthand):
608         * css/parser/CSSPropertyParser.h:
609
610 2017-03-01  Simon Fraser  <simon.fraser@apple.com>
611
612         Try to fix Windows build after r213191.
613
614         * platform/spi/win/CoreTextSPIWin.h:
615
616 2017-03-01  Carlos Garcia Campos  <cgarcia@igalia.com>
617
618         REGRESSION(r213062): [SOUP] UTF-8 filename in Content-Disposition header incorrectly handled since r213062
619         https://bugs.webkit.org/show_bug.cgi?id=169024
620
621         Reviewed by Youenn Fablet.
622
623         This made test http/tests/download/literal-utf-8.html to start failing. The problem is that I removed the
624         conversion made by String::fromUTF8WithLatin1Fallback that was added in r176930. I removed it because that made
625         fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-unicode.html to timeout. This patch brings back
626         the String::fromUTF8WithLatin1Fallback call but only when the header string is 8 bit one.
627
628         Fixes: http/tests/download/literal-utf-8.html
629
630         * platform/network/soup/ResourceResponseSoup.cpp:
631         (WebCore::ResourceResponse::platformSuggestedFilename):
632
633 2017-03-01  Carlos Garcia Campos  <cgarcia@igalia.com>
634
635         [GTK] fast/canvas/canvas-createPattern-video-loading.html makes its subsequent test timeout
636         https://bugs.webkit.org/show_bug.cgi?id=169019
637
638         Reviewed by Xabier Rodriguez-Calvar.
639
640         The timeout happens normally when the media player is deleted and the pipeline state is set to NULL. The call to
641         gst_element_set_state() never returns because of different deadlocks with the video sink. Sometimes the deadlock
642         happens with the sample mutex used by VideoRenderRequestScheduler. VideoRenderRequestScheduler::requestRender()
643         calls webkitVideoSinkRepaintRequested() with the lock held, that ends up calling
644         MediaPlayerPrivateGStreamerBase::triggerRepaint(). When rendering can't be accelerated the draw timer is
645         scheduled and triggerRepaint blocks until the timer is fired. If the media player is destroyed before the timer
646         is fired, when setting the pipeline state to NULL, other VideoRenderRequestScheduler methods can be called, like
647         stop() that tries to get the sample mutex that is still held by requestRender(). So, first we need to make
648         sure that requestRender() releases the lock before calling webkitVideoSinkRepaintRequested(). But that's not
649         enough, we also need to ensure that the pipeline is set to NULL state after everyting has been properly
650         stopped. This is currently done in ~MediaPlayerPrivateGStreamer that happens before
651         ~MediaPlayerPrivateGStreamerBase, so gst_element_set_state() is hanging before allowing the
652         MediaPlayerPrivateGStreamerBase to be cleaned up. We should move the call to the end of
653         ~MediaPlayerPrivateGStreamerBase and ensure the draw timer and mutex are properly cleaned up before.
654
655         Fixes: fast/canvas/canvas-createPattern-video-loading.html
656
657         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
658         (WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer): Do not reset pipeline here.
659         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
660         (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase): Stop the draw mutex and notify the
661         lock to ensure we unblock. Do the pipeline reset at the end.
662         * platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
663         (VideoRenderRequestScheduler::requestRender): Release the mutex lock before calling webkitVideoSinkRepaintRequested().
664
665 2017-03-01  Tomas Popela  <tpopela@redhat.com>
666
667         Unreviewed compiler warning fix after r213218
668
669         * platform/gtk/PlatformKeyboardEventGtk.cpp:
670         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
671
672 2017-03-01  Tomas Popela  <tpopela@redhat.com>
673
674         [Cairo] Incorrectly determining height in GraphicsContext::roundToDevicePixels()
675         https://bugs.webkit.org/show_bug.cgi?id=169031
676
677         Reviewed by Carlos Garcia Campos.
678
679         We should compare if height is between -1 and 0 and not mixing height
680         and width together.
681
682         * platform/graphics/cairo/GraphicsContextCairo.cpp:
683         (WebCore::GraphicsContext::roundToDevicePixels):
684
685 2017-03-01  Tomas Popela  <tpopela@redhat.com>
686
687         [GTK] Fix problems found by Coverity scan in platform's keyboard and mouse events
688         https://bugs.webkit.org/show_bug.cgi?id=169028
689
690         Reviewed by Carlos Garcia Campos.
691
692         * platform/gtk/PlatformKeyboardEventGtk.cpp:
693         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent): Initialize
694         the m_handledByInputMethod member.
695         * platform/gtk/PlatformMouseEventGtk.cpp:
696         (WebCore::PlatformMouseEvent::PlatformMouseEvent): Initialize the
697         m_modifierFlags member.
698
699 2017-03-01  Andreas Kling  <akling@apple.com>
700
701         Move MemoryPressureHandler to WTF
702         <https://webkit.org/b/168908>
703
704         Reviewed by Sam Weinig.
705
706         * CMakeLists.txt:
707         * PlatformMac.cmake:
708         * PlatformWin.cmake:
709         * WebCore.xcodeproj/project.pbxproj:
710         * bindings/js/ScriptController.cpp:
711         * history/PageCache.cpp:
712         * html/HTMLMediaElement.cpp:
713         * inspector/InspectorInstrumentation.h:
714         * inspector/InspectorMemoryAgent.h:
715         * page/FrameView.cpp:
716         * page/MemoryRelease.h:
717         * page/linux/ResourceUsageThreadLinux.cpp:
718         * platform/Linux.cmake:
719         * platform/graphics/FontCache.cpp:
720         * platform/graphics/WidthCache.h:
721         * platform/graphics/ca/TileController.cpp:
722         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
723         * platform/ios/LegacyTileCache.mm:
724         * platform/ios/LegacyTileGrid.mm:
725         * platform/ios/LegacyTileLayerPool.mm:
726         * platform/ios/TileControllerMemoryHandlerIOS.cpp:
727         * testing/Internals.cpp:
728
729 2017-03-01  Per Arne Vollan  <pvollan@apple.com>
730
731         [Win] Popup menus are too small in HiDPI mode.
732         https://bugs.webkit.org/show_bug.cgi?id=168965
733
734         Reviewed by Brent Fulgham.
735
736         Scale font with device scale factor.
737
738         * platform/win/PopupMenuWin.cpp:
739         (WebCore::PopupMenuWin::show):
740         (WebCore::PopupMenuWin::calculatePositionAndSize):
741         (WebCore::PopupMenuWin::paint):
742         * platform/win/PopupMenuWin.h:
743
744 2017-03-01  Joseph Pecoraro  <pecoraro@apple.com>
745
746         [WebRTC] Install libwebrtc.dylib inside of WebCore.framework
747         https://bugs.webkit.org/show_bug.cgi?id=168859
748
749         Reviewed by Dan Bernstein.
750
751         * Configurations/WebCore.xcconfig:
752         Set library search path to find the libwebrtc.dylib inside of WebCore's Frameworks
753         or in the WK_OVERRIDE_FRAMEWORKS_DIR.
754
755 2017-02-28  Myles C. Maxfield  <mmaxfield@apple.com>
756
757         Addressing post-review comments on r213163
758         https://bugs.webkit.org/show_bug.cgi?id=168678
759
760         Unreviewed.
761
762         No new tests because there is no behavior change.
763
764         * platform/graphics/cocoa/FontCacheCoreText.cpp:
765         (WebCore::platformFontLookupWithFamily):
766
767 2017-02-28  Simon Fraser  <simon.fraser@apple.com>
768
769         Don't use the LinearGlyphMask format if accelerated drawing is disabled
770         https://bugs.webkit.org/show_bug.cgi?id=168997
771
772         Reviewed by Tim Horton.
773
774         Non-accelerated drawing doesn't work into LinearGlyphMask-format backing store,
775         so don't use that backing store format when accelerated drawing is disabled.
776
777         * platform/graphics/ca/PlatformCALayer.cpp:
778         (WebCore::PlatformCALayer::drawRepaintIndicator):
779         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
780         (layerContentsFormat):
781         (PlatformCALayerCocoa::updateContentsFormat):
782
783 2017-02-28  Simon Fraser  <simon.fraser@apple.com>
784
785         Make the repaint indicators show subpixel antialiased text indication a bit more clearly
786         https://bugs.webkit.org/show_bug.cgi?id=168988
787
788         Reviewed by Tim Horton.
789
790         Put a more obvious stroke around the repaint count when subpixel-antialiased layer text is enabled.
791
792         * platform/graphics/ca/PlatformCALayer.cpp:
793         (WebCore::PlatformCALayer::drawRepaintIndicator):
794         (WebCore::PlatformCALayer::drawTextAtPoint):
795         * platform/graphics/ca/PlatformCALayer.h:
796         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
797         (PlatformCALayerWin::drawTextAtPoint):
798         * platform/graphics/ca/win/PlatformCALayerWin.h:
799
800 2017-02-28  Alex Christensen  <achristensen@webkit.org>
801
802         LibWebRTCProvider should check existence of libwebrtc.dylib
803         https://bugs.webkit.org/show_bug.cgi?id=168986
804         <rdar://problem/30735413>
805
806         Reviewed by Youenn Fablet.
807
808         Some configurations of the webrtc tests overwrite the availability of WebRTC in order to test it
809         with MockLibWebRTCPeerConnection.  If the dylib can not be found, we can't use it, so we want to
810         fail these tests rather than crashing calling rtc::LogMessage::LogToDebug.
811
812         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
813         (WebCore::LibWebRTCMediaEndpoint::doCreateOffer):
814         (WebCore::LibWebRTCMediaEndpoint::doCreateAnswer):
815         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
816         (WebCore::LibWebRTCProvider::factory):
817         (WebCore::LibWebRTCProvider::webRTCAvailable):
818         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
819         * testing/MockLibWebRTCPeerConnection.cpp:
820         (WebCore::useMockRTCPeerConnectionFactory):
821         (WebCore::MockLibWebRTCPeerConnectionFactory::CreatePeerConnection):
822
823 2017-02-28  Tim Horton  <timothy_horton@apple.com>
824
825         Apply a review comment that was missing in r213182
826
827         * loader/ios/QuickLook.mm:
828         (WebCore::isQuickLookPreviewURL):
829
830 2017-02-28  Tim Horton  <timothy_horton@apple.com>
831
832         [iOS] Getting QLPreviewProtocol slows down first navigation in Web process
833         https://bugs.webkit.org/show_bug.cgi?id=168940
834         <rdar://problem/29468999>
835
836         Reviewed by Simon Fraser.
837
838         No new tests, just a performance improvement.
839
840         * loader/DocumentLoader.cpp:
841         (WebCore::isRemoteWebArchive):
842         * loader/PolicyChecker.cpp:
843         (WebCore::PolicyChecker::checkNavigationPolicy):
844         * loader/ResourceLoadNotifier.cpp:
845         (WebCore::ResourceLoadNotifier::dispatchWillSendRequest):
846         Make use of isQuickLookPreviewURL.
847
848         * loader/ios/QuickLook.h:
849         * loader/ios/QuickLook.mm:
850         (WebCore::isQuickLookPreviewURL):
851         Add isQuickLookPreviewURL, which first early-returns if the protocol
852         of the URL is a well-known protocol, and then falls back to loading QuickLook.
853
854         In a microbenchmark this is a 30-40% improvement in total time spent
855         loading an empty HTML document (wall-clock time between loadHTMLString
856         and didFinishNavigation).
857
858 2017-02-28  Simon Fraser  <simon.fraser@apple.com>
859
860         Add Geolocation and DeviceOrientation to features.json 
861
862         * features.json:
863
864 2017-02-28  Wenson Hsieh  <wenson_hsieh@apple.com>
865
866         Data interaction should support attachment elements
867         https://bugs.webkit.org/show_bug.cgi?id=168916
868         <rdar://problem/30664519>
869
870         Reviewed by Ryosuke Niwa.
871
872         Teaches DragController to recognize and initiate dragging on attachment elements, and also adds a new
873         convenience method to the WebItemProviderPasteboard for block enumeration of available UIItemProviders. Covered
874         by a new API test: DataInteractionTests.AttachmentElementItemProviders.
875
876         * page/DragController.cpp:
877         (WebCore::DragController::draggableElement):
878         (WebCore::DragController::startDrag):
879         * platform/ios/WebItemProviderPasteboard.h:
880         * platform/ios/WebItemProviderPasteboard.mm:
881         (-[WebItemProviderPasteboard enumerateItemProvidersWithBlock:]):
882
883 2017-02-28  Mark Lam  <mark.lam@apple.com>
884
885         Remove setExclusiveThread() and peers from the JSLock.
886         https://bugs.webkit.org/show_bug.cgi?id=168977
887
888         Reviewed by Filip Pizlo.
889
890         No new tests because this should already be covered by existing tests.
891
892         * bindings/js/CommonVM.cpp:
893         (WebCore::commonVMSlow):
894
895 2017-02-28  Dave Hyatt  <hyatt@apple.com>
896
897         Centering text inside a button set to display flex and justify-content: center is impossible
898         https://bugs.webkit.org/show_bug.cgi?id=148872
899         <rdar://problem/22590086>
900
901         Reviewed by Simon Fraser.
902
903         Added new test in fast/forms.
904
905         * rendering/RenderButton.cpp:
906         (WebCore::RenderButton::addChild):
907         (WebCore::RenderButton::updateAnonymousChildStyle):
908         (WebCore::RenderButton::styleDidChange):
909         (WebCore::RenderButton::styleWillChange): Deleted.
910         (WebCore::RenderButton::setupInnerStyle): Deleted.
911         * rendering/RenderButton.h:
912         * rendering/RenderElement.cpp:
913         (WebCore::RenderElement::propagateStyleToAnonymousChildren):
914         * rendering/RenderElement.h:
915         (WebCore::RenderElement::updateAnonymousChildStyle):
916
917 2017-02-28  Antoine Quint  <graouts@apple.com>
918
919         [Modern Media Controls] Add missing compact mode assets for macOS
920         https://bugs.webkit.org/show_bug.cgi?id=168980
921         <rdar://problem/30763269>
922
923         Reviewed by Jon Lee.
924
925         Adding missing compact mode assets for the AirPlay, tracks, PiP and volume buttons.
926
927         * Modules/modern-media-controls/controls/icon-service.js:
928         * Modules/modern-media-controls/controls/macos-compact-inline-media-controls.css:
929         (.media-controls.mac.inline.compact button.airplay):
930         (.media-controls.mac.inline.compact button.pip):
931         (.media-controls.mac.inline.compact button.tracks):
932         * Modules/modern-media-controls/images/macOS/airplay-compact@1x.png: Added.
933         * Modules/modern-media-controls/images/macOS/airplay-compact@2x.png: Added.
934         * Modules/modern-media-controls/images/macOS/media-selection-compact@1x.png: Added.
935         * Modules/modern-media-controls/images/macOS/media-selection-compact@2x.png: Added.
936         * Modules/modern-media-controls/images/macOS/pip-in-compact@1x.png: Added.
937         * Modules/modern-media-controls/images/macOS/pip-in-compact@2x.png: Added.
938         * Modules/modern-media-controls/images/macOS/volume-compact@1x.png:
939         * Modules/modern-media-controls/images/macOS/volume-compact@2x.png:
940         * Modules/modern-media-controls/images/macOS/volume-mute-compact@1x.png: Added.
941         * Modules/modern-media-controls/images/macOS/volume-mute-compact@2x.png: Added.
942
943 2017-02-28  Chris Dumez  <cdumez@apple.com>
944
945         [iOS] Throttle requestAnimationFrame to 30fps in low power mode
946         https://bugs.webkit.org/show_bug.cgi?id=168837
947         <rdar://problem/30700929>
948
949         Reviewed by Simon Fraser.
950
951         Throttle requestAnimationFrame to 30fps in low power mode on iOS to save battery.
952
953         ScriptedAnimationController now maintains an OptionSet of throttling reasons.
954         Throttling reasons for now are: OutsideViewport, VisuallyIdle, and LowPowerMode.
955         The requestAnimationFrame interval is then determined based on those throttling
956         reasons:
957         - OutsideViewport or VisuallyIdle: 10 seconds (very aggressive throttling)
958         - LowPowerMode: 30fps
959         - No reasons: 60fps
960
961         The Page now keeps track of low power mode state using a LowPowerModeNotifier.
962         Whenever low power mode changes, it updates the throttling reasons in all the
963         documents' ScriptedAnimationControllers in the frame tree.
964
965         Tests: fast/animation/request-animation-frame-throttling-detached-iframe.html
966                fast/animation/request-animation-frame-throttling-lowPowerMode.html
967
968         * dom/Document.cpp:
969         (WebCore::Document::requestAnimationFrame):
970         * dom/Document.h:
971         * dom/ScriptedAnimationController.cpp:
972         (WebCore::ScriptedAnimationController::ScriptedAnimationController):
973         (WebCore::throttlingReasonToString):
974         (WebCore::throttlingReasonsToString):
975         (WebCore::ScriptedAnimationController::addThrottlingReason):
976         (WebCore::ScriptedAnimationController::removeThrottlingReason):
977         (WebCore::ScriptedAnimationController::isThrottled):
978         (WebCore::ScriptedAnimationController::interval):
979         (WebCore::ScriptedAnimationController::page):
980         (WebCore::ScriptedAnimationController::scheduleAnimation):
981         * dom/ScriptedAnimationController.h:
982         (WebCore::ScriptedAnimationController::create):
983         * page/FrameView.cpp:
984         (WebCore::FrameView::updateScriptedAnimationsAndTimersThrottlingState):
985         * page/Page.cpp:
986         (WebCore::Page::Page):
987         (WebCore::Page::isLowPowerModeEnabled):
988         (WebCore::Page::setLowPowerModeEnabledOverrideForTesting):
989         (WebCore::updateScriptedAnimationsThrottlingReason):
990         (WebCore::Page::setIsVisuallyIdleInternal):
991         (WebCore::Page::handleLowModePowerChange):
992         * page/Page.h:
993         * testing/Internals.cpp:
994         (WebCore::Internals::resetToConsistentState):
995         (WebCore::Internals::requestAnimationFrameInterval):
996         (WebCore::Internals::setLowPowerModeEnabled):
997         * testing/Internals.h:
998         * testing/Internals.idl:
999
1000 2017-02-28  Youenn Fablet  <youenn@apple.com>
1001
1002         [WebRTC] Limit libwebrtc logging in Debug build
1003         https://bugs.webkit.org/show_bug.cgi?id=168974
1004
1005         Reviewed by Alex Christensen.
1006
1007         Covered by manual testing..
1008
1009         * platform/Logging.h:
1010         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
1011         (WebCore::LibWebRTCProvider::callOnWebRTCSignalingThread):
1012
1013 2017-02-28  Myles C. Maxfield  <mmaxfield@apple.com>
1014
1015         [macOS] Migrate off of CTFontCreateForCSS
1016         https://bugs.webkit.org/show_bug.cgi?id=168678
1017
1018         Reviewed by David Hyatt.
1019
1020         This patch implements the Font Matching Algorithm detailed in
1021         https://drafts.csswg.org/css-fonts-4/#font-matching-algorithm
1022         Previously, this was implemented inside Core Text (via
1023         CTFontCreateForCSS()), but that implementation does not understand
1024         variation fonts. Therefore it should move to WebKit (along with
1025         the general fact that CSS algorithms should be implemented in a
1026         CSS engine, not the platform's text engine).
1027
1028         This implementation is not completely divorced from the platform,
1029         however - Core Text exposes font weights on a [-1, 1] range, but
1030         CSS operates on a [1, 999] range. In order to provide the mapping
1031         to CSS weights, Core Text infrastructure is necessary. Therefore,
1032         this new implementation of the matching algorithm is only used
1033         on certain operating systems.
1034
1035         The new implementation of the algorithm is not bug-compatible with
1036         the existing implementation; this patch does represent a behavior
1037         change. However, I have reviewed the differences manually and
1038         believe this algorithm to be a progression over the previous one
1039         (except for one case with Helvetica Neue - see
1040         LayoutTests/ChangeLog for more information about that).
1041
1042         This patch also represents a 27% performance progression on our
1043         standard page load test (just measuring the performance of the font
1044         matching algorithm, and nothing else). (Because font matching is
1045         only a small part of the entire test, the overall progression is
1046         much smaller.)
1047
1048         Tests: FontCacheTest.FontLookupFromFamilyName
1049                FontCacheTest.FontLookupFromPostScriptName
1050
1051         * platform/graphics/FontCache.h:
1052         (WebCore::FontCache::createFontPlatformDataForTesting): Allow for
1053         unit testing.
1054         * platform/graphics/cocoa/FontCacheCoreText.cpp:
1055         (WebCore::isSystemFont): Inlined.
1056         (WebCore::FontDatabase::singleton): Cache results of Core Text
1057         lookups.
1058         (WebCore::FontDatabase::Range::Range): Because of variation fonts,
1059         fonts' weights, widths, and slopes need to be represented as a range
1060         instead of an individual value.
1061         (WebCore::FontDatabase::Range::isValid):
1062         (WebCore::FontDatabase::Range::expand):
1063         (WebCore::FontDatabase::Range::includes):
1064         (WebCore::FontDatabase::InstalledFont::InstalledFont): Represents a
1065         Font Descriptor as well as some lookup information about it.
1066         (WebCore::FontDatabase::InstalledFontCollection::InstalledFontCollection):
1067         A collection of installed fonts.
1068         (WebCore::FontDatabase::InstalledFontCollection::insertInstalledFont):
1069         Cache minima and maxima.
1070         (WebCore::FontDatabase::InstalledFontCollection::isEmpty):
1071         (WebCore::FontDatabase::InstalledFontCollection::size):
1072         (WebCore::FontDatabase::lookupFamilyName): Get all the fonts in
1073         the family.
1074         (WebCore::FontDatabase::lookupPostScriptName): Get the font with
1075         the given PostScript name.
1076         (WebCore::FontDatabase::clear):
1077         (WebCore::FontDatabase::FontDatabase): Cache.
1078         (WebCore::iterateActiveFontsWithReturn): The Font Matching Algorithm
1079         works by starting with every font in the family, and the eliminating
1080         items from the set iteratively. Instead of actually removing items
1081         from a vector or linked list, we instead want to treat the collection
1082         as immutable and keep a parallel side-table of which items have been
1083         eliminated (in order to reduce copies and allocations). This makes
1084         sense because most families only have a handful of fonts in them.
1085         This function consults with the side-table to iterate only over the
1086         fonts which have not been eliminated.
1087         (WebCore::iterateActiveFonts): Ditto.
1088         (WebCore::findClosestStretch):
1089         (WebCore::filterStretch): Eliminate fonts based on their stretch
1090         value.
1091         (WebCore::findClosestStyle):
1092         (WebCore::filterStyle): Eliminate fonts based on their style value.
1093         (WebCore::findClosestWeight):
1094         (WebCore::filterWeight): Eliminate fonts based on their weight value.
1095         (WebCore::computeTargetWeight):
1096         (WebCore::findClosestFont): If we have a set of fonts in a family,
1097         select the font in the set which best matches the criteria.
1098         (WebCore::platformFontLookupWithFamily): While findClosestFont()
1099         function satisfies the spec's notion of the font matching algorithm,
1100         WebKit actually claims to be able to look up fonts by their PostScript
1101         name. Therefore, this function has a higher-level of logic to rectify
1102         the confusion that results when the PostScript name doesn't agree with
1103         the other CSS properties (like if you say "Helvetica-Bold" but also say
1104         font-weight: 100).
1105         * platform/spi/cocoa/CoreTextSPI.h: Add signature for system CSS
1106         font weight support.
1107
1108 2017-02-24  Matt Rajca  <mrajca@apple.com>
1109
1110         Media: notify clients when autoplayed media ends without being paused
1111         https://bugs.webkit.org/show_bug.cgi?id=168852
1112
1113         Reviewed by Alex Christensen.
1114
1115         Added API tests.
1116
1117         * html/HTMLMediaElement.cpp:
1118         (WebCore::HTMLMediaElement::setReadyState):
1119          Set state accordingly if we autoplayed or if playback was prevented.
1120         (WebCore::HTMLMediaElement::play):
1121          Update state if playback was prevented.
1122         (WebCore::HTMLMediaElement::playInternal):
1123          Update state if playback began without user interaction.
1124         (WebCore::HTMLMediaElement::pauseInternal):
1125          Update state.
1126         (WebCore::HTMLMediaElement::mediaPlayerTimeChanged):
1127          If playback ends and it began without user interaction, send a DidPlayMediaWithoutInterference event.
1128         (WebCore::HTMLMediaElement::stopWithoutDestroyingMediaPlayer): Ditto.
1129         * html/HTMLMediaElement.h:
1130         * page/AutoplayEvent.h:
1131
1132 2017-02-27  Dave Hyatt  <hyatt@apple.com>
1133
1134         Update flexbox to Blink's tip of tree
1135         https://bugs.webkit.org/show_bug.cgi?id=168657
1136
1137         Reviewed by Zalan Bujtas.
1138
1139         Added new tests in css3/flexbox.
1140
1141         * CMakeLists.txt:
1142         * WebCore.xcodeproj/project.pbxproj:
1143         * css/CSSComputedStyleDeclaration.cpp:
1144         (WebCore::ComputedStyleExtractor::propertyValue):
1145         * rendering/FlexibleBoxAlgorithm.cpp: Added.
1146         (WebCore::FlexItem::FlexItem):
1147         (WebCore::FlexLayoutAlgorithm::FlexLayoutAlgorithm):
1148         (WebCore::FlexLayoutAlgorithm::computeNextFlexLine):
1149         * rendering/FlexibleBoxAlgorithm.h: Added.
1150         (WebCore::FlexItem::hypotheticalMainAxisMarginBoxSize):
1151         (WebCore::FlexItem::flexBaseMarginBoxSize):
1152         (WebCore::FlexItem::flexedMarginBoxSize):
1153         (WebCore::FlexLayoutAlgorithm::isMultiline):
1154         * rendering/GridTrackSizingAlgorithm.cpp:
1155         (WebCore::GridTrackSizingAlgorithm::computeTrackBasedSize):
1156         (WebCore::GridTrackSizingAlgorithm::increaseSizesToAccommodateSpanningItems):
1157         (WebCore::GridTrackSizingAlgorithm::assumedRowsSizeForOrthogonalChild):
1158         (WebCore::GridTrackSizingAlgorithm::gridAreaBreadthForChild):
1159         (WebCore::IndefiniteSizeStrategy::recomputeUsedFlexFractionIfNeeded):
1160         * rendering/GridTrackSizingAlgorithm.h:
1161         * rendering/OrderIterator.cpp:
1162         (WebCore::OrderIterator::next):
1163         (WebCore::OrderIterator::reset):
1164         (WebCore::OrderIteratorPopulator::~OrderIteratorPopulator):
1165         (WebCore::OrderIteratorPopulator::collectChild):
1166         (WebCore::OrderIteratorPopulator::OrderIteratorPopulator): Deleted.
1167         (WebCore::OrderIteratorPopulator::removeDuplicatedOrderValues): Deleted.
1168         * rendering/OrderIterator.h:
1169         (WebCore::OrderIteratorPopulator::OrderIteratorPopulator):
1170         * rendering/RenderBlock.cpp:
1171         (WebCore::RenderBlock::updateBlockChildDirtyBitsBeforeLayout):
1172         (WebCore::RenderBlock::layoutPositionedObject):
1173         (WebCore::RenderBlock::computeBlockPreferredLogicalWidths):
1174         (WebCore::RenderBlock::computeChildPreferredLogicalWidths):
1175         (WebCore::RenderBlock::hasDefiniteLogicalHeight):
1176         (WebCore::RenderBlock::availableLogicalHeightForPercentageComputation):
1177         * rendering/RenderBlock.h:
1178         (WebCore::RenderBlock::hasPercentHeightDescendants):
1179         * rendering/RenderBlockFlow.cpp:
1180         (WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths):
1181         * rendering/RenderBox.cpp:
1182         (WebCore::RenderBox::columnFlexItemHasStretchAlignment):
1183         (WebCore::RenderBox::isStretchingColumnFlexItem):
1184         (WebCore::RenderBox::hasStretchedLogicalWidth):
1185         (WebCore::RenderBox::sizesLogicalWidthToFitContent):
1186         (WebCore::RenderBox::computeInlineDirectionMargins):
1187         (WebCore::RenderBox::cacheIntrinsicContentLogicalHeightForFlexItem):
1188         (WebCore::RenderBox::updateLogicalHeight):
1189         (WebCore::RenderBox::computeLogicalHeightWithoutLayout):
1190         (WebCore::RenderBox::skipContainingBlockForPercentHeightCalculation):
1191         (WebCore::RenderBox::shouldTreatChildAsReplacedInTableCells):
1192         (WebCore::tableCellShouldHaveZeroInitialSize):
1193         (WebCore::RenderBox::computePercentageLogicalHeight):
1194         (WebCore::RenderBox::computeReplacedLogicalHeightUsing):
1195         (WebCore::RenderBox::availableLogicalHeightUsing):
1196         (WebCore::RenderBox::percentageLogicalHeightIsResolvable):
1197         (WebCore::RenderBox::hasUnsplittableScrollingOverflow):
1198         (WebCore::flexItemHasStretchAlignment): Deleted.
1199         (WebCore::isStretchingColumnFlexItem): Deleted.
1200         (WebCore::logicalWidthIsResolvable): Deleted.
1201         (WebCore::RenderBox::hasDefiniteLogicalWidth): Deleted.
1202         (WebCore::percentageLogicalHeightIsResolvable): Deleted.
1203         (WebCore::RenderBox::percentageLogicalHeightIsResolvableFromBlock): Deleted.
1204         (WebCore::RenderBox::hasDefiniteLogicalHeight): Deleted.
1205         * rendering/RenderBox.h:
1206         (WebCore::RenderBox::isGridItem):
1207         (WebCore::RenderBox::isFlexItem):
1208         (WebCore::RenderBox::selfAlignmentNormalBehavior):
1209         * rendering/RenderBoxModelObject.cpp:
1210         (WebCore::isOutOfFlowPositionedWithImplicitHeight):
1211         (WebCore::RenderBoxModelObject::containingBlockForAutoHeightDetection):
1212         (WebCore::RenderBoxModelObject::hasAutoHeightOrContainingBlockWithAutoHeight):
1213         * rendering/RenderBoxModelObject.h:
1214         * rendering/RenderElement.cpp:
1215         (WebCore::RenderElement::removeChildInternal):
1216         * rendering/RenderFlexibleBox.cpp:
1217         (WebCore::RenderFlexibleBox::LineContext::LineContext):
1218         (WebCore::RenderFlexibleBox::RenderFlexibleBox):
1219         (WebCore::RenderFlexibleBox::computeIntrinsicLogicalWidths):
1220         (WebCore::contentAlignmentNormalBehavior):
1221         (WebCore::RenderFlexibleBox::styleDidChange):
1222         (WebCore::RenderFlexibleBox::layoutBlock):
1223         (WebCore::RenderFlexibleBox::repositionLogicalHeightDependentFlexItems):
1224         (WebCore::RenderFlexibleBox::clientLogicalBottomAfterRepositioning):
1225         (WebCore::RenderFlexibleBox::hasOrthogonalFlow):
1226         (WebCore::RenderFlexibleBox::flexBasisForChild):
1227         (WebCore::RenderFlexibleBox::crossAxisExtentForChild):
1228         (WebCore::RenderFlexibleBox::cachedChildIntrinsicContentLogicalHeight):
1229         (WebCore::RenderFlexibleBox::setCachedChildIntrinsicContentLogicalHeight):
1230         (WebCore::RenderFlexibleBox::clearCachedChildIntrinsicContentLogicalHeight):
1231         (WebCore::RenderFlexibleBox::childIntrinsicLogicalHeight):
1232         (WebCore::RenderFlexibleBox::childIntrinsicLogicalWidth):
1233         (WebCore::RenderFlexibleBox::crossAxisIntrinsicExtentForChild):
1234         (WebCore::RenderFlexibleBox::mainAxisExtentForChild):
1235         (WebCore::RenderFlexibleBox::mainAxisContentExtentForChildIncludingScrollbar):
1236         (WebCore::RenderFlexibleBox::crossAxisExtent):
1237         (WebCore::RenderFlexibleBox::mainAxisExtent):
1238         (WebCore::RenderFlexibleBox::mainAxisContentExtent):
1239         (WebCore::RenderFlexibleBox::computeMainAxisExtentForChild):
1240         (WebCore::RenderFlexibleBox::transformedWritingMode):
1241         (WebCore::RenderFlexibleBox::flowAwareMarginStartForChild):
1242         (WebCore::RenderFlexibleBox::flowAwareMarginEndForChild):
1243         (WebCore::RenderFlexibleBox::flowAwareMarginBeforeForChild):
1244         (WebCore::RenderFlexibleBox::crossAxisMarginExtentForChild):
1245         (WebCore::RenderFlexibleBox::flowAwareLocationForChild):
1246         (WebCore::RenderFlexibleBox::useChildAspectRatio):
1247         (WebCore::RenderFlexibleBox::computeMainSizeFromAspectRatioUsing):
1248         (WebCore::RenderFlexibleBox::setFlowAwareLocationForChild):
1249         (WebCore::RenderFlexibleBox::mainAxisLengthIsDefinite):
1250         (WebCore::RenderFlexibleBox::crossAxisLengthIsDefinite):
1251         (WebCore::RenderFlexibleBox::cacheChildMainSize):
1252         (WebCore::RenderFlexibleBox::clearCachedMainSizeForChild):
1253         (WebCore::RenderFlexibleBox::computeInnerFlexBaseSizeForChild):
1254         (WebCore::RenderFlexibleBox::layoutFlexItems):
1255         (WebCore::RenderFlexibleBox::autoMarginOffsetInMainAxis):
1256         (WebCore::RenderFlexibleBox::updateAutoMarginsInMainAxis):
1257         (WebCore::RenderFlexibleBox::hasAutoMarginsInCrossAxis):
1258         (WebCore::RenderFlexibleBox::availableAlignmentSpaceForChild):
1259         (WebCore::RenderFlexibleBox::updateAutoMarginsInCrossAxis):
1260         (WebCore::RenderFlexibleBox::marginBoxAscentForChild):
1261         (WebCore::RenderFlexibleBox::computeChildMarginValue):
1262         (WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax):
1263         (WebCore::RenderFlexibleBox::crossSizeForPercentageResolution):
1264         (WebCore::RenderFlexibleBox::mainSizeForPercentageResolution):
1265         (WebCore::RenderFlexibleBox::childLogicalHeightForPercentageResolution):
1266         (WebCore::RenderFlexibleBox::adjustChildSizeForAspectRatioCrossAxisMinAndMax):
1267         (WebCore::RenderFlexibleBox::constructFlexItem):
1268         (WebCore::RenderFlexibleBox::freezeViolations):
1269         (WebCore::RenderFlexibleBox::freezeInflexibleItems):
1270         (WebCore::RenderFlexibleBox::resolveFlexibleLengths):
1271         (WebCore::alignmentOffset):
1272         (WebCore::RenderFlexibleBox::setOverrideMainAxisContentSizeForChild):
1273         (WebCore::RenderFlexibleBox::staticMainAxisPositionForPositionedChild):
1274         (WebCore::RenderFlexibleBox::staticCrossAxisPositionForPositionedChild):
1275         (WebCore::RenderFlexibleBox::staticInlinePositionForPositionedChild):
1276         (WebCore::RenderFlexibleBox::staticBlockPositionForPositionedChild):
1277         (WebCore::RenderFlexibleBox::setStaticPositionForPositionedLayout):
1278         (WebCore::RenderFlexibleBox::prepareChildForPositionedLayout):
1279         (WebCore::RenderFlexibleBox::alignmentForChild):
1280         (WebCore::RenderFlexibleBox::resetAutoMarginsAndLogicalTopInCrossAxis):
1281         (WebCore::RenderFlexibleBox::needToStretchChildLogicalHeight):
1282         (WebCore::RenderFlexibleBox::childHasIntrinsicMainAxisSize):
1283         (WebCore::RenderFlexibleBox::crossAxisOverflowForChild):
1284         (WebCore::RenderFlexibleBox::layoutAndPlaceChildren):
1285         (WebCore::RenderFlexibleBox::layoutColumnReverse):
1286         (WebCore::initialAlignContentOffset):
1287         (WebCore::alignContentSpaceBetweenChildren):
1288         (WebCore::RenderFlexibleBox::alignFlexLines):
1289         (WebCore::RenderFlexibleBox::adjustAlignmentForChild):
1290         (WebCore::RenderFlexibleBox::alignChildren):
1291         (WebCore::RenderFlexibleBox::applyStretchAlignmentToChild):
1292         (WebCore::RenderFlexibleBox::flipForRightToLeftColumn):
1293         (WebCore::RenderFlexibleBox::flipForWrapReverse):
1294         (WebCore::RenderFlexibleBox::Violation::Violation): Deleted.
1295         (WebCore::RenderFlexibleBox::setCrossAxisExtent): Deleted.
1296         (WebCore::RenderFlexibleBox::flowAwareMarginAfterForChild): Deleted.
1297         (WebCore::RenderFlexibleBox::mainAxisBorderAndPaddingExtentForChild): Deleted.
1298         (WebCore::RenderFlexibleBox::mainAxisScrollbarExtentForChild): Deleted.
1299         (WebCore::RenderFlexibleBox::preferredMainAxisContentExtentForChild): Deleted.
1300         (WebCore::RenderFlexibleBox::computeNextFlexLine): Deleted.
1301         (WebCore::RenderFlexibleBox::setLogicalOverrideSize): Deleted.
1302         (WebCore::RenderFlexibleBox::numberOfInFlowPositionedChildren): Deleted.
1303         (WebCore::RenderFlexibleBox::needToStretchChild): Deleted.
1304         (WebCore::contentAlignmentNormalBehaviorFlexibleBox): Deleted.
1305         * rendering/RenderFlexibleBox.h:
1306         (WebCore::RenderFlexibleBox::orderIterator):
1307         (WebCore::RenderFlexibleBox::isFlexibleBoxImpl):
1308         * rendering/RenderFullScreen.h:
1309         * rendering/RenderGrid.cpp:
1310         (WebCore::selfAlignmentChangedToStretchInRowAxis):
1311         (WebCore::selfAlignmentChangedFromStretchInRowAxis):
1312         (WebCore::selfAlignmentChangedFromStretchInColumnAxis):
1313         (WebCore::RenderGrid::styleDidChange):
1314         (WebCore::RenderGrid::computeTrackBasedLogicalHeight):
1315         (WebCore::RenderGrid::computeTrackSizesForDefiniteSize):
1316         (WebCore::RenderGrid::gridGapForDirection):
1317         (WebCore::RenderGrid::guttersSize):
1318         (WebCore::RenderGrid::computeTrackSizesForIndefiniteSize):
1319         (WebCore::RenderGrid::computeAutoRepeatTracksCount):
1320         (WebCore::RenderGrid::trackSizesForComputedStyle):
1321         (WebCore::RenderGrid::offsetAndBreadthForPositionedChild):
1322         (WebCore::RenderGrid::populateGridPositionsForDirection):
1323         (WebCore::RenderGrid::alignSelfForChild):
1324         (WebCore::RenderGrid::justifySelfForChild):
1325         (WebCore::RenderGrid::columnAxisPositionForChild):
1326         (WebCore::RenderGrid::rowAxisPositionForChild):
1327         (WebCore::RenderGrid::columnAxisOffsetForChild):
1328         (WebCore::RenderGrid::rowAxisOffsetForChild):
1329         (WebCore::RenderGrid::needToStretchChildLogicalHeight): Deleted.
1330         * rendering/RenderGrid.h:
1331         * rendering/RenderLayer.cpp:
1332         (WebCore::RenderLayer::updateScrollbarsAfterLayout):
1333         * rendering/RenderListBox.cpp:
1334         (WebCore::RenderListBox::computeLogicalHeight):
1335         * rendering/RenderTable.cpp:
1336         (WebCore::RenderTable::layout):
1337         * rendering/RenderTableCell.cpp:
1338         (WebCore::RenderTableCell::layout):
1339         * rendering/RenderTableSection.cpp:
1340         (WebCore::shouldFlexCellChild):
1341         (WebCore::RenderTableSection::relayoutCellIfFlexed):
1342         (WebCore::RenderTableSection::layoutRows):
1343         * rendering/RenderTableSection.h:
1344         * rendering/RenderTextControl.cpp:
1345         (WebCore::RenderTextControl::computeLogicalHeight):
1346         * rendering/style/RenderStyle.cpp:
1347         (WebCore::resolvedSelfAlignment):
1348         (WebCore::RenderStyle::resolvedAlignSelf):
1349         (WebCore::RenderStyle::resolvedJustifySelf):
1350         * rendering/style/RenderStyle.h:
1351         * style/RenderTreeUpdater.cpp:
1352         (WebCore::textRendererIsNeeded):
1353
1354 2017-02-28  Alex Christensen  <achristensen@webkit.org>
1355
1356         Main resource requests need cachePartition
1357         https://bugs.webkit.org/show_bug.cgi?id=168806
1358         <rdar://30639764>
1359
1360         Reviewed by Brady Eidson.
1361
1362         Test: http/tests/security/credentials-main-resource.html
1363
1364         r211751 caused an unintended regression on pages whose main resource is protected
1365         by basic authentication.  We were not setting the cache partition for main resource
1366         requests, and we use the cache partition now for credentials, so the credentials for
1367         the main resource were not being put into a partition in the CredentialStorage that
1368         would not be used for subresources of the page, whose requests had the correct partition
1369         for the domain of the page.  This caused users to have to enter their credentials twice,
1370         once for the main resource and once for any subresources.  This is fixed by using the
1371         domain from the main resource request as the cache partition.  Elsewhere the Document is
1372         used to get the cache partition, but there is no Document yet when requesting the main resource.
1373
1374         * loader/DocumentLoader.cpp:
1375         (WebCore::DocumentLoader::startLoadingMainResource):
1376         Set the cache partition for the main resource loads based on the SecurityOrigin of the
1377         initial request if we are loading the main resource for a new top document.  If the main resource
1378         request is redirected, then we will still use the partition of the initial request because that is
1379         what the user requested and that is where the user entered the credentials.
1380         * loader/cache/CachedResourceLoader.h:
1381         * loader/cache/CachedResourceRequest.cpp:
1382         (WebCore::CachedResourceRequest::setDomainForCachePartition):
1383         * loader/cache/CachedResourceRequest.h:
1384
1385 2017-02-28  Alex Christensen  <achristensen@webkit.org>
1386
1387         REGRESSION: LayoutTest http/tests/security/credentials-iframes.html is failing on ios-simulator
1388         https://bugs.webkit.org/show_bug.cgi?id=167967
1389
1390         Reviewed by Brady Eidson.
1391
1392         XHR credentials have a persistence of CredentialPersistenceNone because we keep
1393         them in the WebCore::CredentialStorage.  We were storing them to CFNetwork's NSURLCredentialStorage
1394         on iOS and then they were being given as the proposedCredential in
1395         NetworkDataTaskCocoa::tryPasswordBasedAuthentication even though we set CredentialPersistenceNone.
1396
1397         This fixes http/tests/security/credentials-iframes.html
1398
1399         * platform/network/CredentialStorage.cpp:
1400         (WebCore::CredentialStorage::set):
1401         * platform/network/CredentialStorage.h:
1402         * platform/network/cf/CredentialStorageCFNet.cpp:
1403         (WebCore::CredentialStorage::saveToPersistentStorage): Deleted.
1404         * platform/network/mac/CredentialStorageMac.mm:
1405         (WebCore::CredentialStorage::saveToPersistentStorage): Deleted.
1406
1407 2017-02-27  Alex Christensen  <achristensen@webkit.org>
1408
1409         Fix WinCairo build.
1410
1411         * PlatformWinCairo.cmake:
1412
1413 2017-02-27  Alex Christensen  <achristensen@webkit.org>
1414
1415         Begin enabling WebRTC on 64-bit
1416         https://bugs.webkit.org/show_bug.cgi?id=168915
1417
1418         Reviewed by Eric Carlson.
1419
1420         * Configurations/FeatureDefines.xcconfig:
1421
1422 2017-02-27  Antoine Quint  <graouts@apple.com>
1423
1424         [Modern Media Controls] Use compact mode by default on macOS
1425         https://bugs.webkit.org/show_bug.cgi?id=168958
1426         <rdar://problem/30748638>
1427
1428         Reviewed by Jon Lee.
1429
1430         We now use the compact layout mode by default on macOS.
1431
1432         * Modules/modern-media-controls/controls/layout-item.js: Remove the ReducedPadding trait.
1433         * Modules/modern-media-controls/controls/macos-compact-inline-media-controls.css: 
1434         (.media-controls.mac.inline.compact .time-label,): Vertically align the time label with
1435         the scrubber in compact mode.
1436         (.media-controls.mac.inline.compact .scrubber.slider): Correctly position the scrubber in
1437         compact mode so that it's vertically aligned.
1438         * Modules/modern-media-controls/controls/macos-inline-media-controls.js:
1439         (MacOSInlineMediaControls.prototype.layoutTraitsDidChange): Remove handling of tight and
1440         reduced padding traits since these do not apply to macOS anymore. We also notify the
1441         scrubber of a layout trait change so that it may adjust its height.
1442         * Modules/modern-media-controls/controls/scrubber.js:
1443         (Scrubber):
1444         (Scrubber.prototype.layoutTraitsDidChange): Adjust the height of the scrubber to match
1445         compact layout traits.
1446         * Modules/modern-media-controls/controls/time-control.js:
1447         (TimeControl.prototype.get isSufficientlyWide): Adjust the minimum scrubber width for
1448         TimeControl visibility to match compact layout traits.
1449         * Modules/modern-media-controls/media/media-controller.js:
1450         (MediaController.prototype.get layoutTraits): Use the compact layout trait by default
1451         on macOS and make the tight padding specific to iOS.
1452
1453 2017-02-27  Antoine Quint  <graouts@apple.com>
1454
1455         [Modern Media Controls] Adhere to tight padding on iOS
1456         https://bugs.webkit.org/show_bug.cgi?id=168949
1457         <rdar://problem/30746164>
1458
1459         Reviewed by Jon Lee.
1460
1461         We used to only support custom margins on macOS, to support this on iOS as
1462         well, we promote the notification when the layoutTraits property is set to
1463         MediaControls and expose a new protected method layoutTraitsDidChange() for
1464         subclasses to implement. IOSInlineMediaControls now implements that method
1465         and will use tighter margins for the TightPadding layout trait.
1466
1467         Test: media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-tight-padding.html
1468
1469         * Modules/modern-media-controls/controls/ios-inline-media-controls.js:
1470         (IOSInlineMediaControls.prototype.layoutTraitsDidChange):
1471         (IOSInlineMediaControls):
1472         * Modules/modern-media-controls/controls/macos-inline-media-controls.js:
1473         (MacOSInlineMediaControls.prototype.get layoutTraits): Deleted.
1474         (MacOSInlineMediaControls.prototype.set layoutTraits): Deleted.
1475         (MacOSInlineMediaControls.prototype._matchLayoutTraits): Deleted.
1476         * Modules/modern-media-controls/controls/media-controls.js:
1477         (MediaControls.prototype.get layoutTraits):
1478         (MediaControls.prototype.set layoutTraits):
1479         (MediaControls.prototype.layoutTraitsDidChange):
1480
1481 2017-02-27  Youenn Fablet  <youenn@apple.com>
1482
1483         [WebRTC] Support modern RTCStatsReport
1484         https://bugs.webkit.org/show_bug.cgi?id=166916
1485         <rdar://problem/30293780>
1486
1487         Reviewed by Alex Christensen.
1488
1489         Updating binding generator and IDL parser to handle maplike.
1490         Covered by binding tests.
1491
1492         Added support for maplike binding from JS wrapper to DOM class.
1493         The principle is to have the JSXX wrapper having a @backingMap slot containing a Map.
1494         All maplike methods are forwarded to the corresponding Map methods.
1495         The XX object is responsible to add key/value pairs using a helper routine.
1496         The creation of the Map is done at creation of the JSXX wrapper.
1497
1498         DOM class is interacting with the map through DOMMapLike.
1499         Extracted DOMGuarded from DOM promise implementation.
1500         This allows reusing this code for DOMMapLike.
1501
1502         Covered by binding tests and manual tests.
1503
1504         * CMakeLists.txt:
1505         * DerivedSources.make:
1506         * Modules/mediastream/RTCStatsReport.h:
1507         (WebCore::RTCStatsReport::InboundRTPStreamStats::InboundRTPStreamStats):
1508         (WebCore::RTCStatsReport::OutboundRTPStreamStats::OutboundRTPStreamStats):
1509         (WebCore::RTCStatsReport::create):
1510         (WebCore::RTCStatsReport::synchronizeBackingMap):
1511         (WebCore::RTCStatsReport::backingMap):
1512         (WebCore::RTCStatsReport::addStats):
1513         * Modules/mediastream/RTCStatsReport.idl:
1514         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1515         (WebCore::fromStdString):
1516         (WebCore::fillRTCStats):
1517         (WebCore::fillRTCRTPStreamStats):
1518         (WebCore::fillInboundRTPStreamStats):
1519         (WebCore::fillOutboundRTPStreamStats):
1520         (WebCore::LibWebRTCMediaEndpoint::StatsCollector::OnStatsDelivered):
1521         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
1522         * WebCore.xcodeproj/project.pbxproj:
1523         * bindings/js/JSDOMBindingInternals.js: Added.
1524         (mapLikeForEach):
1525         * bindings/js/JSDOMGlobalObject.cpp:
1526         (WebCore::JSDOMGlobalObject::visitChildren):
1527         * bindings/js/JSDOMGlobalObject.h:
1528         * bindings/js/JSDOMGuardedObject.cpp: Added.
1529         (WebCore::DOMGuardedObject::DOMGuardedObject):
1530         (WebCore::DOMGuardedObject::~DOMGuardedObject):
1531         (WebCore::DOMGuardedObject::clear):
1532         (WebCore::DOMGuardedObject::contextDestroyed):
1533         * bindings/js/JSDOMGuardedObject.h: Added.
1534         (WebCore::DOMGuardedObject::isSuspended):
1535         (WebCore::DOMGuardedObject::visitAggregate):
1536         (WebCore::DOMGuardedObject::guardedObject):
1537         (WebCore::DOMGuardedObject::globalObject):
1538         (WebCore::DOMGuardedObject::isEmpty):
1539         (WebCore::DOMGuarded::DOMGuarded):
1540         (WebCore::DOMGuarded::guarded):
1541         * bindings/js/JSDOMMapLike.cpp: Added.
1542         (WebCore::getBackingMap):
1543         (WebCore::initializeBackingMap):
1544         (WebCore::createBackingMap):
1545         (WebCore::forwardAttributeGetterToBackingMap):
1546         (WebCore::forwardFunctionCallToBackingMap):
1547         (WebCore::forwardForEachCallToBackingMap):
1548         * bindings/js/JSDOMMapLike.h: Added.
1549         (WebCore::DOMMapLike::set):
1550         (WebCore::synchronizeBackingMap):
1551         (WebCore::forwardSizeToMapLike):
1552         (WebCore::forwardEntriesToMapLike):
1553         (WebCore::forwardKeysToMapLike):
1554         (WebCore::forwardValuesToMapLike):
1555         (WebCore::forwardClearToMapLike):
1556         (WebCore::forwardForEachToMapLike):
1557         (WebCore::forwardHasToMapLike):
1558         (WebCore::forwardAddToMapLike):
1559         (WebCore::forwardDeleteToMapLike):
1560         * bindings/js/JSDOMPromise.cpp:
1561         (WebCore::DeferredPromise::promise):
1562         (WebCore::DeferredPromise::reject):
1563         * bindings/js/JSDOMPromise.h:
1564         (WebCore::DeferredPromise::resolve):
1565         (WebCore::DeferredPromise::resolveWithNewlyCreated):
1566         (WebCore::DeferredPromise::reject):
1567         (WebCore::DeferredPromise::resolveWithCallback):
1568         (WebCore::DeferredPromise::rejectWithCallback):
1569         (WebCore::DeferredPromise::DeferredPromise):
1570         (WebCore::DeferredPromise::deferred):
1571         * bindings/js/WebCoreBuiltinNames.h:
1572         * bindings/scripts/CodeGeneratorJS.pm:
1573         (PrototypeFunctionCount):
1574         (GeneratePropertiesHashTable):
1575         (InterfaceNeedsIterator):
1576         (GenerateImplementation):
1577         (GenerateParametersCheck):
1578         * bindings/scripts/IDLParser.pm:
1579         (assert):
1580         (parseAttributeOrOperationOrIterator):
1581         (parseSerializer):
1582         (parseAttributeOrOperationRest):
1583         (parseAttribute):
1584         (parseAttributeRest):
1585         (parseOperationOrIterator):
1586         (parseOptionalIterableInterface):
1587         (parseMapLikeRest):
1588         (parseMapLikeProperties):
1589         (parseOperationRest):
1590         (applyMemberList):
1591         * bindings/scripts/test/JS/JSMapLike.cpp: Added.
1592         * bindings/scripts/test/JS/JSMapLike.h: Added.
1593         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp: Added.
1594         * bindings/scripts/test/JS/JSReadOnlyMapLike.h: Added.
1595         * bindings/scripts/test/TestMapLike.idl: Added.
1596         * bindings/scripts/test/TestReadOnlyMapLike.idl: Added.
1597
1598 2017-02-27  Mark Lam  <mark.lam@apple.com>
1599
1600         Introduce a VM Traps mechanism and refactor Watchdog to use it.
1601         https://bugs.webkit.org/show_bug.cgi?id=168842
1602
1603         Reviewed by Filip Pizlo.
1604
1605         No new tests needed because this is a re-implementation of existing functionality.
1606
1607         * bindings/js/WorkerScriptController.cpp:
1608         (WebCore::WorkerScriptController::WorkerScriptController):
1609         (WebCore::WorkerScriptController::scheduleExecutionTermination):
1610
1611 2017-02-27  Andy Estes  <aestes@apple.com>
1612
1613         [Cocoa] Rename FileMac.mm to FileCocoa.mm
1614         https://bugs.webkit.org/show_bug.cgi?id=168947
1615
1616         Reviewed by Zalan Bujtas.
1617
1618         * PlatformMac.cmake:
1619         * WebCore.xcodeproj/project.pbxproj:
1620         * fileapi/FileCocoa.mm: Renamed from Source/WebCore/fileapi/FileMac.mm.
1621
1622 2017-02-27  Andy Estes  <aestes@apple.com>
1623
1624         [iOS] Enable file replacement
1625         https://bugs.webkit.org/show_bug.cgi?id=168907
1626         <rdar://problem/22258242>
1627
1628         Reviewed by David Kilzer.
1629
1630         Covered by existing tests.
1631
1632         * fileapi/FileMac.mm:
1633         (WebCore::File::shouldReplaceFile): Stop using Carbon and AppKit API for determining if a
1634         file path is a file package. Use NSURL and CoreServices instead, which exist on Mac and iOS.
1635
1636 2017-02-27  Antoine Quint  <graouts@apple.com>
1637
1638         [Modern Media Controls] Use a solid background for <audio> controls on macOS
1639         https://bugs.webkit.org/show_bug.cgi?id=168941
1640         <rdar://problem/30744316>
1641
1642         Reviewed by Dean Jackson.
1643
1644         Use a solid background for <audio> elements on macOS, the same way we do on iOS.
1645
1646         Test: media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-audio-background.html
1647
1648         * Modules/modern-media-controls/controls/macos-media-controls.css:
1649         (:host(audio) .media-controls.mac.inline > .controls-bar):
1650         (:host(audio) .media-controls.mac.inline > .controls-bar > .background-tint):
1651
1652 2017-02-27  Antoine Quint  <graouts@apple.com>
1653
1654         [Modern Media Controls] StatusLabel should use similar properties to TimeLabel
1655         https://bugs.webkit.org/show_bug.cgi?id=168938
1656         <rdar://problem/30743185>
1657
1658         Reviewed by Dean Jackson.
1659
1660         Ensure we use the same styling properties for StatusLabel and TimeLabel.
1661
1662         Tests: media/modern-media-controls/status-label/status-label-ios.html
1663                media/modern-media-controls/status-label/status-label-macos.html
1664
1665         * Modules/modern-media-controls/controls/ios-inline-media-controls.css:
1666         (.media-controls.ios.inline .time-label,):
1667         (.media-controls.ios.inline .time-label): Deleted.
1668         * Modules/modern-media-controls/controls/macos-media-controls.css:
1669         (.media-controls.mac > .controls-bar .time-label,):
1670         (.media-controls.mac > .controls-bar .time-label): Deleted.
1671         * Modules/modern-media-controls/controls/status-label.css:
1672         (.status-label):
1673
1674 2017-02-27  Myles C. Maxfield  <mmaxfield@apple.com>
1675
1676         Rename ICU cursor iterator to caret iterator
1677         https://bugs.webkit.org/show_bug.cgi?id=168206
1678
1679         Reviewed by Simon Fraser.
1680
1681         Mechanical find/replace.
1682
1683         No new tests because there is no behavior change.
1684
1685         * platform/graphics/ComplexTextController.cpp:
1686         (WebCore::ComplexTextController::offsetForPosition):
1687         * rendering/RenderText.cpp:
1688         (WebCore::RenderText::previousOffset):
1689         (WebCore::RenderText::nextOffset):
1690
1691 2017-02-27  Myles C. Maxfield  <mmaxfield@apple.com>
1692
1693         Unprefix -webkit-line-break
1694         https://bugs.webkit.org/show_bug.cgi?id=168213
1695
1696         Reviewed by Darin Adler.
1697
1698         We support the property as specced.
1699
1700         Test: fast/text/line-break-unprefixed.html
1701
1702         * css/CSSComputedStyleDeclaration.cpp:
1703         (WebCore::ComputedStyleExtractor::propertyValue):
1704         * css/CSSProperties.json:
1705         * css/parser/CSSParserFastPaths.cpp:
1706         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
1707         (WebCore::CSSParserFastPaths::isKeywordPropertyID):
1708         * editing/Editor.cpp:
1709         (WebCore::Editor::applyEditingStyleToElement):
1710         * html/HTMLElement.cpp:
1711         (WebCore::HTMLElement::collectStyleForPresentationAttribute):
1712
1713 2017-02-27  Myles C. Maxfield  <mmaxfield@apple.com>
1714
1715         Use RAII for ICU breaking iterators
1716         https://bugs.webkit.org/show_bug.cgi?id=168203
1717
1718         Reviewed by Simon Fraser.
1719
1720         No new tests because there is no behavior change.
1721
1722         * platform/graphics/ComplexTextController.cpp:
1723         (WebCore::ComplexTextController::offsetForPosition):
1724         * rendering/RenderText.cpp:
1725         (WebCore::RenderText::previousOffset):
1726         (WebCore::RenderText::nextOffset):
1727
1728 2017-02-27  Basuke Suzuki  <Basuke.Suzuki@am.sony.com>
1729
1730         [WinCairo][MiniBrowser] Add ca-bundle to display secure pages
1731         https://bugs.webkit.org/show_bug.cgi?id=168486
1732
1733         Reviewed by Alex Christensen.
1734
1735         change the order of path location search to make it possible to 
1736         configure with environment variable because bundled ca-bundle is
1737         always available now.
1738
1739         * platform/network/curl/ResourceHandleManager.cpp:
1740         (WebCore::certificatePath):
1741
1742 2017-02-27  Antoine Quint  <graouts@apple.com>
1743
1744         [Modern Media Controls] Status text does not appear on iOS
1745         https://bugs.webkit.org/show_bug.cgi?id=168918
1746         <rdar://problem/30737644>
1747
1748         Reviewed by Dean Jackson.
1749
1750         We refactor the layout code out of MacOSInlineMediaControls and into a new
1751         InlineLayoutSupport class which IOSInlineMediaControls uses as well. Now
1752         both the macOS and iOS inline media controls run the same layout logic to
1753         control whether the status label or scrubber should be displayed, and which
1754         controls should be dropped due to space constraints.
1755
1756         Test: media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-status-label.html
1757
1758         * Modules/modern-media-controls/controls/inline-layout-support.js: Added.
1759         (InlineLayoutSupport):
1760         (InlineLayoutSupport.prototype.childrenAfterPerformingLayout):
1761         * Modules/modern-media-controls/controls/ios-inline-media-controls.js:
1762         (IOSInlineMediaControls.prototype.layout):
1763         (IOSInlineMediaControls):
1764         * Modules/modern-media-controls/controls/macos-inline-media-controls.js:
1765         (MacOSInlineMediaControls.prototype.layout):
1766         * Modules/modern-media-controls/js-files:
1767
1768 2017-02-27  Simon Fraser  <simon.fraser@apple.com>
1769
1770         Add specification and status metadata to CSSProperties.json, and validate it
1771         https://bugs.webkit.org/show_bug.cgi?id=168901
1772
1773         Reviewed by Darin Adler.
1774
1775         Annotate CSS properties with data about the WebKit development status, and
1776         where they are specified. A property has a canonical specification reference,
1777         but individual values may have a reference to a more recent spec.
1778
1779         Add a list of specifications to the JSON that properties reference by key.
1780
1781         Enhance check-webkit-style to validate the status and spec data.
1782
1783         * css/CSSProperties.json:
1784
1785 2017-02-27  Jiewen Tan  <jiewen_tan@apple.com>
1786
1787         [CredentialManagement] Add IDL definitions for Credential, SiteBoundCredential, and PasswordCredential
1788         https://bugs.webkit.org/show_bug.cgi?id=168616
1789         <rdar://problem/30167149>
1790
1791         Reviewed by Daniel Bates.
1792
1793         This patch adds IDL definitions for:
1794         1. Credential(https://w3c.github.io/webappsec-credential-management/#interfaces-credential-types-credential),
1795         2. SiteBoundCredential(https://w3c.github.io/webappsec-credential-management/#interfaces-credential-types-siteboundcredential), and
1796         3. PasswordCredential(https://w3c.github.io/webappsec-credential-management/#interfaces-credential-types-passwordcredential).
1797
1798         Test: credentials/idlharness.html
1799
1800         * CMakeLists.txt:
1801         * DerivedSources.make:
1802         * Modules/credentials/BasicCredential.cpp: Added.
1803         (WebCore::BasicCredential::BasicCredential):
1804         (WebCore::BasicCredential::~BasicCredential):
1805         (WebCore::BasicCredential::type):
1806         * Modules/credentials/BasicCredential.h: Added.
1807         (WebCore::BasicCredential::id):
1808         * Modules/credentials/BasicCredential.idl: Added.
1809         * Modules/credentials/CredentialData.h: Added.
1810         * Modules/credentials/CredentialData.idl: Added.
1811         * Modules/credentials/PasswordCredential.cpp: Added.
1812         (WebCore::PasswordCredential::PasswordCredential):
1813         (WebCore::PasswordCredential::PasswordCredential):
1814         Dummy constructors for now.
1815         * Modules/credentials/PasswordCredential.h: Added.
1816         (WebCore::PasswordCredential::create):
1817         (WebCore::PasswordCredential::create):
1818         (WebCore::PasswordCredential::setIdName):
1819         (WebCore::PasswordCredential::idName):
1820         (WebCore::PasswordCredential::setPasswordName):
1821         (WebCore::PasswordCredential::passwordName):
1822         (WebCore::PasswordCredential::setAdditionalData):
1823         (WebCore::PasswordCredential::additionalData):
1824         * Modules/credentials/PasswordCredential.idl: Added.
1825         * Modules/credentials/SiteBoundCredential.cpp: Added.
1826         (WebCore::SiteBoundCredential::SiteBoundCredential):
1827         (WebCore::SiteBoundCredential::~SiteBoundCredential):
1828         * Modules/credentials/SiteBoundCredential.h: Added.
1829         (WebCore::SiteBoundCredential::name):
1830         (WebCore::SiteBoundCredential::iconURL):
1831         (WebCore::SiteBoundCredential::setOrigin):
1832         (WebCore::SiteBoundCredential::origin):
1833         * Modules/credentials/SiteBoundCredential.idl: Added.
1834         * Modules/credentials/SiteBoundCredentialData.h: Added.
1835         * Modules/credentials/SiteBoundCredentialData.idl: Added.
1836         * WebCore.xcodeproj/project.pbxproj:
1837
1838 2017-02-27  Jer Noble  <jer.noble@apple.com>
1839
1840         [WebRTC] Fix remote audio rendering
1841         https://bugs.webkit.org/show_bug.cgi?id=168898
1842
1843         Reviewed by Eric Carlson.
1844
1845         Test: webrtc/audio-peer-connection-webaudio.html
1846
1847         Fix MediaStreamAudioSourceNode by not bailing out early if the input sample rate doesn't match
1848         the AudioContext's sample rate; there's code in setFormat() to do the sample rate conversion
1849         correctly.
1850
1851         * Modules/webaudio/MediaStreamAudioSourceNode.cpp:
1852         (WebCore::MediaStreamAudioSourceNode::setFormat):
1853
1854         Fix AudioSampleBufferList by making the AudioConverter input proc a free function, and passing
1855         its refCon a struct containing only the information it needs to perform its task. Because the
1856         conversion may result in a different number of output samples than input ones, just ask to
1857         generate the entire capacity of the scratch buffer, and signal that the input buffer was fully
1858         converted with a special return value.
1859
1860         * platform/audio/mac/AudioSampleBufferList.cpp:
1861         (WebCore::audioConverterFromABLCallback):
1862         (WebCore::AudioSampleBufferList::copyFrom):
1863         (WebCore::AudioSampleBufferList::convertInput): Deleted.
1864         (WebCore::AudioSampleBufferList::audioConverterCallback): Deleted.
1865         * platform/audio/mac/AudioSampleBufferList.h:
1866
1867         Fix AudioSampleDataSource by updating both the sampleCount and the sampleTime after doing
1868         a sample rate conversion to take into account that both the number of samples may have changed,
1869         as well as the timeScale of the sampleTime. This may result in small off-by-one rounding errors
1870         due to the sample rate conversion of sampleTime, so remember what the next expected sampleTime
1871         should be, and correct sampleTime if it is indeed off-by-one. If the pull operation has gotten
1872         ahead of the push operation, delay the next pull by the empty amount by rolling back the
1873         m_outputSampleOffset. Introduce the same offset behavior during pull operations.
1874
1875         * platform/audio/mac/AudioSampleDataSource.h:
1876         * platform/audio/mac/AudioSampleDataSource.mm:
1877         (WebCore::AudioSampleDataSource::pushSamplesInternal):
1878         (WebCore::AudioSampleDataSource::pullSamplesInternal):
1879         (WebCore::AudioSampleDataSource::pullAvalaibleSamplesAsChunks):
1880
1881         Fix MediaPlayerPrivateMediaStreamAVFObjC by obeying the m_muted property.
1882
1883         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
1884         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setVolume):
1885         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setMuted):
1886
1887         Fix LibWebRTCAudioModule by sleeping for the correct amount after emitting frames. Previously,
1888         LibWebRTCAudioModule would sleep for a fixed amount of time, which meant it would get slowly out
1889         of sync when emitting frames took a non-zero amount of time. Now, the amount of time before the
1890         next cycle starts is correctly calculated, and then LibWebRTCAudioModule sleeps for a dynamic amount
1891         of time in order to wake up correctly at the beginning of the next cycle.
1892
1893         * platform/mediastream/libwebrtc/LibWebRTCAudioModule.cpp:
1894         (WebCore::LibWebRTCAudioModule::StartPlayoutOnAudioThread):
1895
1896         Fix AudioTrackPrivateMediaStreamCocoa by just using the output unit's preferred format
1897         description (with the current system sample rate), rather than whatever is the current
1898         input description.
1899
1900         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
1901         (WebCore::AudioTrackPrivateMediaStreamCocoa::createAudioUnit):
1902         (WebCore::AudioTrackPrivateMediaStreamCocoa::audioSamplesAvailable):
1903         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.h:
1904
1905         Fix RealtimeIncomingAudioSource by actually creating an AudioSourceProvider when asked.
1906
1907         * platform/mediastream/mac/RealtimeIncomingAudioSource.cpp:
1908         (WebCore::RealtimeIncomingAudioSource::OnData):
1909         (WebCore::RealtimeIncomingAudioSource::audioSourceProvider):
1910         * platform/mediastream/mac/RealtimeIncomingAudioSource.h:
1911
1912         Fix RealtimeOutgoingAudioSource by using the outgoing format description rather than the
1913         incoming one to determine the sample rate, channel count, sample byte size, etc., to use
1914         when delivering data upstream to libWebRTC.
1915
1916         * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
1917         (WebCore::RealtimeOutgoingAudioSource::audioSamplesAvailable):
1918         (WebCore::RealtimeOutgoingAudioSource::pullAudioData):
1919         * platform/mediastream/mac/RealtimeOutgoingAudioSource.h:
1920
1921         Fix WebAudioSourceProviderAVFObjC by using a AudioSampleDataSource to do format and sample
1922         rate conversion rather than trying to duplicate all that code and use a CARingBuffer and 
1923         AudioConverter directly.
1924
1925         * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.h:
1926         * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm:
1927         (WebCore::WebAudioSourceProviderAVFObjC::~WebAudioSourceProviderAVFObjC):
1928         (WebCore::WebAudioSourceProviderAVFObjC::provideInput):
1929         (WebCore::WebAudioSourceProviderAVFObjC::prepare):
1930         (WebCore::WebAudioSourceProviderAVFObjC::unprepare):
1931         (WebCore::WebAudioSourceProviderAVFObjC::audioSamplesAvailable):
1932
1933         Fix the MockLibWebRTCAudioTrack by passing along the AddSink() sink to its AudioSourceInterface,
1934         allowing the RealtimeOutgoingAudioSource to push data into the libWebRTC network stack. Also,
1935         make sure m_enabled is initialized to a good value.
1936
1937         * testing/MockLibWebRTCPeerConnection.h:
1938
1939 2017-02-21  Jer Noble  <jer.noble@apple.com>
1940
1941         AudioSampleDataSource should not exclusively lock its read and write threads.
1942         https://bugs.webkit.org/show_bug.cgi?id=168646
1943
1944         Reviewed by Eric Carlson.
1945
1946         Locking the write thread causes the read thread to drop audio samples and generates audible
1947         glitches, and the realtime audio thread backing the read thread should never block. There's
1948         no real reason to lock these threads against one another here; they both rely on the
1949         CARingBuffer to safely and simultaneously read and write data.
1950
1951         * platform/audio/mac/AudioSampleDataSource.cpp:
1952         (WebCore::AudioSampleDataSource::setPaused):
1953         (WebCore::AudioSampleDataSource::pushSamplesInternal):
1954         (WebCore::AudioSampleDataSource::pushSamples):
1955         (WebCore::AudioSampleDataSource::pullSamplesInternal):
1956         (WebCore::AudioSampleDataSource::pullAvalaibleSamplesAsChunks):
1957         (WebCore::AudioSampleDataSource::pullSamples):
1958         * platform/audio/mac/AudioSampleDataSource.h:
1959
1960 2017-02-21  Jer Noble  <jer.noble@apple.com>
1961
1962         AudioTrackPrivateMediaStreamCocoa should not exclusively lock its read and write threads.
1963         https://bugs.webkit.org/show_bug.cgi?id=168643
1964
1965         Reviewed by Eric Carlson.
1966
1967         Locking the write thread causes the read thread to drop audio samples and generates audible
1968         glitches, and the realtime audio thread backing the read thread should never block. There's
1969         no real reason to lock these threads against one another here; they both rely on the
1970         AudioSampleDataSource and it's CARingBuffer to safely and simultaneously read and write
1971         data.
1972
1973         The one piece which locks previously protected against unsafe access was during creation of
1974         the audio unit.  Without a lock, the audio unit could begin playback after the unit was
1975         created and assigned to m_remoteIOUnit but before the ring buffer was created. To protect
1976         against this possibility, create the unit, set the input and output descriptions, but only
1977         assign the new audio unit to m_remoteIOUnit after the ring buffer has been created and
1978         initialized.
1979
1980         * platform/audio/mac/CAAudioStreamDescription.h:
1981         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
1982         (WebCore::AudioTrackPrivateMediaStreamCocoa::~AudioTrackPrivateMediaStreamCocoa):
1983         (WebCore::AudioTrackPrivateMediaStreamCocoa::playInternal):
1984         (WebCore::AudioTrackPrivateMediaStreamCocoa::play):
1985         (WebCore::AudioTrackPrivateMediaStreamCocoa::pause):
1986         (WebCore::AudioTrackPrivateMediaStreamCocoa::setVolume):
1987         (WebCore::AudioTrackPrivateMediaStreamCocoa::createAudioUnit):
1988         (WebCore::AudioTrackPrivateMediaStreamCocoa::setupAudioUnit): Renamed to createAudioUnit()
1989         (WebCore::AudioTrackPrivateMediaStreamCocoa::audioSamplesAvailable):
1990         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.h:
1991
1992 2017-02-27  Youenn Fablet  <youenn@apple.com>
1993
1994         [WebRTC] RealtimOutgoingVideoSource should not need to do image conversion
1995         https://bugs.webkit.org/show_bug.cgi?id=168802
1996
1997         Reviewed by Jon Lee.
1998
1999         Covered by manual testing as mock sources do not hit the same code path.
2000
2001         * platform/mediastream/mac/AVVideoCaptureSource.h:
2002         * platform/mediastream/mac/AVVideoCaptureSource.mm:
2003         (WebCore::AVVideoCaptureSource::currentFrameCGImage):
2004         * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:
2005         (WebCore::RealtimeOutgoingVideoSource::sendFrame):
2006         (WebCore::RealtimeOutgoingVideoSource::videoSampleAvailable):
2007         * platform/mediastream/mac/RealtimeOutgoingVideoSource.h:
2008
2009 2017-02-27  Carlos Garcia Campos  <cgarcia@igalia.com>
2010
2011         [GTK] Downloads attributes tests are failing
2012         https://bugs.webkit.org/show_bug.cgi?id=168871
2013
2014         Reviewed by Michael Catanzaro.
2015
2016         Use libsoup to get the suggested filename from the Content-Disposition header instead of buggy
2017         filenameFromHTTPContentDisposition().
2018
2019         Fixes: fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-doublequote.html
2020                fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-unicode.html
2021
2022         * platform/network/soup/ResourceResponseSoup.cpp:
2023         (WebCore::ResourceResponse::platformSuggestedFilename):
2024
2025 2017-02-27  Antoine Quint  <graouts@apple.com>
2026
2027         [Modern Media Controls] Dragging controls in fullscreen on macOS prevents scrubbing or interacting with controls
2028         https://bugs.webkit.org/show_bug.cgi?id=168820
2029         <rdar://problem/30690281>
2030
2031         Reviewed by Jon Lee.
2032
2033         We broke this in https://bugs.webkit.org/show_bug.cgi?id=168755. We restore the check that the
2034         event target when initiating a drag is the controls bar itself and not some of its content.
2035
2036         Since this wasn't caught by our existing tests, we add a test that attemps to initiate a drag
2037         starting over one of the controls and notice that no dragging occurs.
2038
2039         We also fix an issue where we wouldn't update the layout of the left container as its icon
2040         buttons would load, which would cause the layout width of the left container to be incorrect
2041         and the related tests to time out.
2042
2043         Test: media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-drag-is-prevented-over-button.html
2044
2045         * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
2046         (MacOSFullscreenMediaControls.prototype.layout):
2047         (MacOSFullscreenMediaControls.prototype._handleMousedown):
2048
2049 2017-02-27  Alex Christensen  <achristensen@webkit.org>
2050
2051         [libwebrtc] Enable WebRTC in some Production Builds
2052         https://bugs.webkit.org/show_bug.cgi?id=168858
2053
2054         * Configurations/FeatureDefines.xcconfig:
2055
2056 2017-02-27  Zan Dobersek  <zdobersek@igalia.com>
2057
2058         [TextureMapper] Clean up BitmapTextureGL construction
2059         https://bugs.webkit.org/show_bug.cgi?id=168909
2060
2061         Reviewed by Carlos Garcia Campos.
2062
2063         Have the BitmapTextureGL constructor accept an rvalue reference pointer
2064         to the GraphicsContext3D object. A static create() method is also added
2065         to help with constructing these objects. Construction sites are updated
2066         appropriately.
2067
2068         The BitmapTextureGL constructor is further cleaned up by moving default
2069         member initializations together with the member declarations.
2070
2071         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2072         (WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor):
2073         * platform/graphics/texmap/BitmapTextureGL.cpp:
2074         (WebCore::BitmapTextureGL::BitmapTextureGL):
2075         * platform/graphics/texmap/BitmapTextureGL.h:
2076         * platform/graphics/texmap/BitmapTexturePool.cpp:
2077         (WebCore::BitmapTexturePool::createTexture):
2078         * platform/graphics/texmap/TextureMapperGL.cpp:
2079         (WebCore::TextureMapperGL::createTexture):
2080
2081 2017-02-27  Zan Dobersek  <zdobersek@igalia.com>
2082
2083         [TextureMapper] Remove InterpolationQuality, TextDrawingModeFlags member variables
2084         https://bugs.webkit.org/show_bug.cgi?id=168906
2085
2086         Reviewed by Carlos Garcia Campos.
2087
2088         Remove the InterpolationQuality and TextDrawingModeFlags member variables from the
2089         TextureMapper class. These weren't modified anywhere in the code.
2090
2091         BitmapTexture::updateContents() still sets the image interpolation quality and
2092         drawing mode on the ImageBuffer's GraphicsContext, but now uses the default
2093         InterpolationDefault and TextModeFill values.
2094
2095         * platform/graphics/texmap/BitmapTexture.cpp:
2096         (WebCore::BitmapTexture::updateContents):
2097         * platform/graphics/texmap/TextureMapper.cpp:
2098         (WebCore::TextureMapper::TextureMapper): Deleted.
2099         (WebCore::TextureMapper::~TextureMapper): Deleted.
2100         * platform/graphics/texmap/TextureMapper.h:
2101         (WebCore::TextureMapper::setImageInterpolationQuality): Deleted.
2102         (WebCore::TextureMapper::setTextDrawingMode): Deleted.
2103         (WebCore::TextureMapper::imageInterpolationQuality): Deleted.
2104         (WebCore::TextureMapper::textDrawingMode): Deleted.
2105
2106 2017-02-26  Zan Dobersek  <zdobersek@igalia.com>
2107
2108         [CoordinatedGraphics] Remove CoordinatedGraphicsScene::paintToGraphicsContext()
2109         https://bugs.webkit.org/show_bug.cgi?id=168903
2110
2111         Reviewed by Carlos Garcia Campos.
2112
2113         Remove the GraphicsContext pointer member from the TextureMapper class
2114         since the getter and setter methods are not used anywhere.
2115
2116         * platform/graphics/texmap/TextureMapper.cpp:
2117         (WebCore::TextureMapper::TextureMapper):
2118         * platform/graphics/texmap/TextureMapper.h:
2119         (WebCore::TextureMapper::setGraphicsContext): Deleted.
2120         (WebCore::TextureMapper::graphicsContext): Deleted.
2121
2122 2017-02-26  Myles C. Maxfield  <mmaxfield@apple.com>
2123
2124         Stop compiling our own cursorMovementIterator()
2125         https://bugs.webkit.org/show_bug.cgi?id=168211
2126
2127         Reviewed by David Hyatt.
2128
2129         Covered by existing tests.
2130
2131         Hook up the caret iterator.
2132
2133         * platform/graphics/ComplexTextController.cpp:
2134         (WebCore::ComplexTextController::offsetForPosition):
2135         * rendering/RenderText.cpp:
2136         (WebCore::RenderText::previousOffset):
2137         (WebCore::RenderText::nextOffset):
2138         * rendering/RenderText.h:
2139
2140 2017-02-26  Commit Queue  <commit-queue@webkit.org>
2141
2142         Unreviewed, rolling out r212942.
2143         https://bugs.webkit.org/show_bug.cgi?id=168882
2144
2145         Made EWS very flaky (Requested by ap on #webkit).
2146
2147         Reverted changeset:
2148
2149         "[Modern Media Controls] Dragging controls in fullscreen on
2150         macOS prevents scrubbing or interacting with controls"
2151         https://bugs.webkit.org/show_bug.cgi?id=168820
2152         http://trac.webkit.org/changeset/212942
2153
2154 2017-02-26  Chris Dumez  <cdumez@apple.com>
2155
2156         HitTestResult's linkSuggestedFilename should sanitize download attribute
2157         https://bugs.webkit.org/show_bug.cgi?id=168856
2158         <rdar://problem/30683109>
2159
2160         Reviewed by Antti Koivisto.
2161
2162         HitTestResult's linkSuggestedFilename should sanitize download attribute.
2163         This is used by the context menu's "Download Linked File" & "Download Linked
2164         File As..." actions.
2165
2166         * rendering/HitTestResult.cpp:
2167         (WebCore::HitTestResult::linkSuggestedFilename):
2168         * rendering/HitTestResult.h:
2169
2170 2017-02-25  Zalan Bujtas  <zalan@apple.com>
2171
2172         Simple line layout: Move coverage functions out of SimpleLineLayout.cpp
2173         https://bugs.webkit.org/show_bug.cgi?id=168872
2174         
2175         Reviewed by Simon Fraser.
2176
2177         SimpleLineLayout.cpp is for core functions only.
2178
2179         No change in functionality.
2180
2181         * CMakeLists.txt:
2182         * WebCore.xcodeproj/project.pbxproj:
2183         * rendering/RenderingAllInOne.cpp:
2184         * rendering/SimpleLineLayout.cpp:
2185         (WebCore::SimpleLineLayout::canUseForWithReason):
2186         (WebCore::SimpleLineLayout::printReason): Deleted.
2187         (WebCore::SimpleLineLayout::printReasons): Deleted.
2188         (WebCore::SimpleLineLayout::printTextForSubtree): Deleted.
2189         (WebCore::SimpleLineLayout::textLengthForSubtree): Deleted.
2190         (WebCore::SimpleLineLayout::collectNonEmptyLeafRenderBlockFlows): Deleted.
2191         (WebCore::SimpleLineLayout::collectNonEmptyLeafRenderBlockFlowsForCurrentPage): Deleted.
2192         (WebCore::SimpleLineLayout::toggleSimpleLineLayout): Deleted.
2193         (WebCore::SimpleLineLayout::printSimpleLineLayoutBlockList): Deleted.
2194         (WebCore::SimpleLineLayout::printSimpleLineLayoutCoverage): Deleted.
2195         * rendering/SimpleLineLayout.h:
2196         * rendering/SimpleLineLayoutCoverage.cpp: Added.
2197         (WebCore::SimpleLineLayout::printReason):
2198         (WebCore::SimpleLineLayout::printReasons):
2199         (WebCore::SimpleLineLayout::printTextForSubtree):
2200         (WebCore::SimpleLineLayout::textLengthForSubtree):
2201         (WebCore::SimpleLineLayout::collectNonEmptyLeafRenderBlockFlows):
2202         (WebCore::SimpleLineLayout::collectNonEmptyLeafRenderBlockFlowsForCurrentPage):
2203         (WebCore::SimpleLineLayout::toggleSimpleLineLayout):
2204         (WebCore::SimpleLineLayout::printSimpleLineLayoutBlockList):
2205         (WebCore::SimpleLineLayout::printSimpleLineLayoutCoverage):
2206         * rendering/SimpleLineLayoutCoverage.h: Added.
2207
2208 2017-02-25  Zalan Bujtas  <zalan@apple.com>
2209
2210         Text might wrap when its preferred logical width is used for sizing the containing block.
2211         https://bugs.webkit.org/show_bug.cgi?id=168864
2212         <rdar://problem/30690734>
2213
2214         Reviewed by Antti Koivisto.
2215
2216         In certain cases we end up measuring a text run in 2 different ways.
2217         1. preferred width computation -> slow path FontCascade::width() 
2218         2. line breaking logic -> fast path FontCascade::widthForSimpleText()
2219  
2220         FontCascade::width() and ::widthForSimpleText() might return different results for the same run even when
2221         the individual glyph widths are measured to be the same. It's because they run diffrent set of
2222         arithmetics on the float values and for certain values these arithmetics produce different results due to the floating point
2223         precision.
2224         Since RenderText::computePreferredLogicalWidths() currently forces us to use the slow path
2225         (to retrieve fontfallback and glyph overflow information) the only alternative solution is to turn off the fast path
2226         for all runs that have been already measured using the slow path (which would be just wasteful).
2227
2228         Test: fast/text/fast-run-width-vs-slow-run-width.html
2229
2230         * platform/graphics/FontCascade.cpp:
2231         (WebCore::FontCascade::widthForSimpleText): Mimics WidthIterator::applyFontTransforms. Use the same set of arithmetics here.  
2232
2233 2017-02-24  Simon Fraser  <simon.fraser@apple.com>
2234
2235         Improve how multiple codegen-properties are handled in CSSProperties.json
2236         https://bugs.webkit.org/show_bug.cgi?id=168867
2237
2238         Reviewed by Zalan Bujtas.
2239
2240         To make upcoming metadata storage easier, it's better if property entries in CSSProperties.json
2241         are always hashes. One property (line-height) used an array, in order to represent settings for
2242         two different build flags (ENABLE_TEXT_AUTOSIZING and !ENABLE_TEXT_AUTOSIZING).
2243
2244         Fix by making "codegen-properties" optionally be an array. The relevant item is selected in
2245         removeInactiveCodegenProperties() and used to replace the array.
2246
2247         Sort @internalProprerties when generating code, otherwise the contents of isInternalCSSProperty()
2248         are unstable (the order in @allNames is not stable because it's the keys in a hash).
2249
2250         * css/CSSProperties.json:
2251         * css/makeprop.pl:
2252         (matchEnableFlags):
2253         (removeInactiveCodegenProperties):
2254         (isPropertyEnabled):
2255
2256 2017-02-24  Joseph Pecoraro  <pecoraro@apple.com>
2257
2258         [Resource Timing] Media elements initiated loads should set the initiatorType to their element name (video/audio)
2259         https://bugs.webkit.org/show_bug.cgi?id=168680
2260
2261         Reviewed by Youenn Fablet.
2262
2263         * html/HTMLMediaElement.cpp:
2264         (WebCore::HTMLMediaElement::mediaPlayerCreateResourceLoader):
2265         Pass in the element so it may be used as the initiator.
2266
2267         * html/HTMLVideoElement.h:
2268         Export create() for TestWebKitAPI to use.
2269
2270         * loader/MediaResourceLoader.cpp:
2271         (WebCore::MediaResourceLoader::MediaResourceLoader):
2272         (WebCore::MediaResourceLoader::contextDestroyed):
2273         (WebCore::MediaResourceLoader::requestResource):
2274         * loader/MediaResourceLoader.h:
2275         Include the HTMLMediaElement as the initiator.
2276
2277 2017-02-24  Joseph Pecoraro  <pecoraro@apple.com>
2278
2279         [Resource Timing] Gather timing information with reliable responseEnd time
2280         https://bugs.webkit.org/show_bug.cgi?id=168351
2281
2282         Reviewed by Alex Christensen.
2283
2284         This patch replaces the unused `double finishTime` in ResourceLoader's
2285         didFinishLoad with a complete WebCore::NetworkLoadMetrics object. This
2286         allows the NetworkProcess to give complete timing information, and more
2287         final metrics about the load, to WebCore. Currently this is only used
2288         by ResourceTiming, but it will soon be used by Web Inspector as well.
2289         We may also end up extending this to the didFail path as well, since it
2290         is possible that we have some metrics for load failures.
2291
2292         At the same time we want to start moving away from the legacy path that
2293         populated a subset of this information in ResourceResponse's NetworkLoadMetrics.
2294         It doesn't make sense to store this information on the ResourceResponse
2295         for a few reasons: We don't want to store the metrics in our Network Cache and
2296         not all of the load timing metrics have been populated yet (responseEnd).
2297         In an effort to move off of this data we've renamed the accessor to
2298         "deprecatedNetworkLoadMetrics". There are a few remaining clients
2299         (ResourceHandle, PerformanceTiming, InspectorNetworkAgent) which can be
2300         migrated separately from this patch.
2301
2302         Having both the legacy and new code paths adds a little bit of complexity.
2303         One advantage of the new path is that the complete load timing data
2304         (fetchStart -> dns -> connect -> request -> response -> responseEnd) can
2305         be packaged together. The legacy path could not include a responseEnd, so
2306         WebCore faked that value with its own timestamp. Having the fake responseEnd
2307         caused issues as timestamps / clocks are different between processes. In order
2308         for PerformanceResponseTiming to know whether or not the NetworkLoadMetrics
2309         has the complete network timing metrics it checks isComplete(). If true
2310         it knows it can use the responseEnd time from NetworkLoadMetrics, otherwise
2311         it must fallback to the legacy value from LoadTiming. Once all of the
2312         deprecatedNetworkLoadMetrics clients go away, we should always have the
2313         complete data and this can be eliminated.
2314
2315         Tests: imported/w3c/web-platform-tests/resource-timing/rt-nextHopProtocol.html
2316                imported/w3c/web-platform-tests/resource-timing/rt-nextHopProtocol.worker.html
2317
2318         * PlatformMac.cmake:
2319         * WebCore.xcodeproj/project.pbxproj:
2320         Rename NetworkLoadTiming -> NetworkLoadMetrics.
2321
2322         * page/PerformanceResourceTiming.cpp:
2323         (WebCore::entryStartTime):
2324         (WebCore::entryEndTime):
2325         (WebCore::PerformanceResourceTiming::PerformanceResourceTiming):
2326         (WebCore::PerformanceResourceTiming::nextHopProtocol):
2327         (WebCore::PerformanceResourceTiming::domainLookupStart):
2328         (WebCore::PerformanceResourceTiming::domainLookupEnd):
2329         (WebCore::PerformanceResourceTiming::connectStart):
2330         (WebCore::PerformanceResourceTiming::connectEnd):
2331         (WebCore::PerformanceResourceTiming::secureConnectionStart):
2332         (WebCore::PerformanceResourceTiming::requestStart):
2333         (WebCore::PerformanceResourceTiming::responseStart):
2334         (WebCore::PerformanceResourceTiming::responseEnd):
2335         (WebCore::PerformanceResourceTiming::networkLoadTimeToDOMHighResTimeStamp):
2336         * page/PerformanceResourceTiming.h:
2337         Mostly just updating names and types. This does however need to get the
2338         correct endTime based on whether the NetworkLoadMetrics are complete
2339         (meaning includes responseEnd) or not (legacy, use LoadTiming value).
2340
2341         * page/PerformanceResourceTiming.idl:
2342         Add nextHopProtocol.
2343
2344         * page/PerformanceTiming.cpp:
2345         (WebCore::PerformanceTiming::domainLookupStart):
2346         (WebCore::PerformanceTiming::domainLookupEnd):
2347         (WebCore::PerformanceTiming::connectStart):
2348         (WebCore::PerformanceTiming::connectEnd):
2349         (WebCore::PerformanceTiming::secureConnectionStart):
2350         (WebCore::PerformanceTiming::requestStart):
2351         (WebCore::PerformanceTiming::responseStart):
2352         (WebCore::PerformanceTiming::resourceLoadTimeRelativeToFetchStart):
2353         * page/PerformanceTiming.h:
2354         Navigation Timing values still uses the NetworkLoadTiming values stored on
2355         the DocumentLoader. This should be moved off of the deprecated path separately.
2356
2357         * platform/network/NetworkLoadMetrics.h: Renamed from Source/WebCore/platform/network/NetworkLoadTiming.h.
2358         (WebCore::NetworkLoadMetrics::NetworkLoadMetrics):
2359         (WebCore::NetworkLoadMetrics::isolatedCopy):
2360         (WebCore::NetworkLoadMetrics::reset):
2361         (WebCore::NetworkLoadMetrics::operator==):
2362         (WebCore::NetworkLoadMetrics::operator!=):
2363         (WebCore::NetworkLoadMetrics::isComplete):
2364         (WebCore::NetworkLoadMetrics::markComplete):
2365         (WebCore::NetworkLoadMetrics::encode):
2366         (WebCore::NetworkLoadMetrics::decode):
2367         Re-introduce a reset() method (for NetworkLoadSoup to reset between redirects).
2368         Add protocolName and "complete" boolean.
2369
2370         * platform/network/cocoa/NetworkLoadMetrics.mm: Renamed from Source/WebCore/platform/network/cocoa/NetworkLoadTiming.mm.
2371         (WebCore::timingValue):
2372         (WebCore::copyTimingData):
2373         (WebCore::setCollectsTimingData):
2374         Use this opportunity to convert NetworkLoadTiming timestamps to WTF::Seconds.
2375         Since we already have to modify all the clients this moves us to use the more
2376         strongly typed units that are less ambiguous then "double". The rest of the
2377         Performance API has already moved to these units.
2378
2379         * inspector/InspectorNetworkAgent.cpp:
2380         (WebCore::InspectorNetworkAgent::buildObjectForTiming):
2381         (WebCore::InspectorNetworkAgent::buildObjectForResourceResponse):
2382         (WebCore::InspectorNetworkAgent::didFinishLoading):
2383         * inspector/InspectorNetworkAgent.h:
2384         Inspector was the only client of the finishTime, and since the value was
2385         erratically coming from clients in different ways it was almost certainly
2386         inaccurate. Simplify this in preparation for using NetworkLoadMetrics.
2387
2388         * Modules/fetch/FetchLoader.cpp:
2389         (WebCore::FetchLoader::didFinishLoading):
2390         * Modules/fetch/FetchLoader.h:
2391         * fileapi/FileReaderLoader.cpp:
2392         (WebCore::FileReaderLoader::didFinishLoading):
2393         * fileapi/FileReaderLoader.h:
2394         * html/MediaFragmentURIParser.cpp:
2395         (WebCore::MediaFragmentURIParser::parseNPTTime):
2396         * inspector/InspectorInstrumentation.cpp:
2397         (WebCore::InspectorInstrumentation::didFinishLoadingImpl):
2398         * inspector/InspectorInstrumentation.h:
2399         (WebCore::InspectorInstrumentation::didFinishLoading):
2400         * loader/CrossOriginPreflightChecker.cpp:
2401         (WebCore::CrossOriginPreflightChecker::validatePreflightResponse):
2402         * loader/DocumentLoader.cpp:
2403         (WebCore::DocumentLoader::notifyFinished):
2404         (WebCore::DocumentLoader::finishedLoading):
2405         (WebCore::DocumentLoader::continueAfterContentPolicy):
2406         (WebCore::DocumentLoader::maybeLoadEmpty):
2407         * loader/DocumentLoader.h:
2408         * loader/DocumentThreadableLoader.cpp:
2409         (WebCore::DocumentThreadableLoader::didReceiveResponse):
2410         (WebCore::DocumentThreadableLoader::notifyFinished):
2411         (WebCore::DocumentThreadableLoader::didFinishLoading):
2412         (WebCore::DocumentThreadableLoader::loadRequest):
2413         * loader/DocumentThreadableLoader.h:
2414         * loader/NetscapePlugInStreamLoader.cpp:
2415         (WebCore::NetscapePlugInStreamLoader::didFinishLoading):
2416         * loader/NetscapePlugInStreamLoader.h:
2417         * loader/ResourceLoadNotifier.cpp:
2418         (WebCore::ResourceLoadNotifier::didFinishLoad):
2419         (WebCore::ResourceLoadNotifier::dispatchDidFinishLoading):
2420         (WebCore::ResourceLoadNotifier::sendRemainingDelegateMessages):
2421         * loader/ResourceLoadNotifier.h:
2422         * loader/ResourceLoader.cpp:
2423         (WebCore::ResourceLoader::deliverResponseAndData):
2424         (WebCore::ResourceLoader::loadDataURL):
2425         (WebCore::ResourceLoader::didFinishLoading):
2426         (WebCore::ResourceLoader::didFinishLoadingOnePart):
2427         * loader/ResourceLoader.h:
2428         * loader/ResourceTiming.cpp:
2429         (WebCore::ResourceTiming::fromLoad):
2430         (WebCore::ResourceTiming::fromSynchronousLoad):
2431         (WebCore::ResourceTiming::ResourceTiming):
2432         (WebCore::ResourceTiming::isolatedCopy):
2433         * loader/ResourceTiming.h:
2434         (WebCore::ResourceTiming::networkLoadMetrics):
2435         (WebCore::ResourceTiming::ResourceTiming):
2436         (WebCore::ResourceTiming::networkLoadTiming): Deleted.
2437         * loader/SubresourceLoader.cpp:
2438         (WebCore::SubresourceLoader::SubresourceLoader):
2439         (WebCore::SubresourceLoader::willSendRequestInternal):
2440         (WebCore::SubresourceLoader::didReceiveResponse):
2441         (WebCore::SubresourceLoader::didFinishLoading):
2442         (WebCore::SubresourceLoader::reportResourceTiming):
2443         * loader/SubresourceLoader.h:
2444         * loader/ThreadableLoaderClient.h:
2445         (WebCore::ThreadableLoaderClient::didFinishLoading):
2446         * loader/ThreadableLoaderClientWrapper.h:
2447         (WebCore::ThreadableLoaderClientWrapper::didFinishLoading):
2448         * loader/WorkerThreadableLoader.cpp:
2449         (WebCore::WorkerThreadableLoader::MainThreadBridge::didFinishLoading):
2450         * loader/WorkerThreadableLoader.h:
2451         * loader/appcache/ApplicationCacheGroup.cpp:
2452         (WebCore::ApplicationCacheGroup::didFinishLoading):
2453         * loader/appcache/ApplicationCacheGroup.h:
2454         * loader/cache/CachedResource.h:
2455         (WebCore::CachedResource::setLoadFinishTime):
2456         * loader/ios/QuickLook.mm:
2457         (-[WebPreviewLoader connectionDidFinishLoading:]):
2458         * page/EventSource.cpp:
2459         (WebCore::EventSource::didFinishLoading):
2460         * page/EventSource.h:
2461         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
2462         (ResourceHandleStreamingClient::didFinishLoading):
2463         * platform/network/BlobResourceHandle.cpp:
2464         (WebCore::doNotifyFinish):
2465         * platform/network/PingHandle.h:
2466         * platform/network/ResourceHandle.h:
2467         * platform/network/ResourceHandleClient.h:
2468         (WebCore::ResourceHandleClient::didFinishLoading):
2469         * platform/network/ResourceResponseBase.cpp:
2470         (WebCore::ResourceResponseBase::crossThreadData):
2471         (WebCore::ResourceResponseBase::fromCrossThreadData):
2472         (WebCore::ResourceResponseBase::compare):
2473         * platform/network/ResourceResponseBase.h:
2474         (WebCore::ResourceResponseBase::deprecatedNetworkLoadMetrics):
2475         (WebCore::ResourceResponseBase::encode):
2476         (WebCore::ResourceResponseBase::decode):
2477         (WebCore::ResourceResponseBase::networkLoadTiming): Deleted.
2478         * platform/network/SynchronousLoaderClient.cpp:
2479         (WebCore::SynchronousLoaderClient::didFinishLoading):
2480         * platform/network/SynchronousLoaderClient.h:
2481         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
2482         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
2483         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didFinishLoading):
2484         * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
2485         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveResponse):
2486         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didFinishLoading):
2487         * platform/network/curl/ResourceHandleCurl.cpp:
2488         (WebCore::WebCoreSynchronousLoader::didFinishLoading):
2489         * platform/network/curl/ResourceHandleManager.cpp:
2490         (WebCore::calculateWebTimingInformations):
2491         (WebCore::ResourceHandleManager::downloadTimerCallback):
2492         (WebCore::handleDataURL):
2493         (WebCore::milisecondsSinceRequest): Deleted.
2494         * platform/network/mac/ResourceHandleMac.mm:
2495         (WebCore::ResourceHandle::getConnectionTimingData):
2496         * platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
2497         (-[WebCoreResourceHandleAsDelegate connection:didReceiveResponse:]):
2498         (-[WebCoreResourceHandleAsDelegate connectionDidFinishLoading:]):
2499         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
2500         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]):
2501         (-[WebCoreResourceHandleAsOperationQueueDelegate connectionDidFinishLoading:]):
2502         * platform/network/soup/ResourceHandleSoup.cpp:
2503         (WebCore::restartedCallback):
2504         (WebCore::nextMultipartResponsePartCallback):
2505         (WebCore::sendRequestCallback):
2506         (WebCore::ResourceHandle::didStartRequest):
2507         (WebCore::networkEventCallback):
2508         (WebCore::ResourceHandle::sendPendingRequest):
2509         (WebCore::readCallback):
2510         (WebCore::milisecondsSinceRequest): Deleted.
2511         * workers/WorkerScriptLoader.cpp:
2512         (WebCore::WorkerScriptLoader::didFinishLoading):
2513         * workers/WorkerScriptLoader.h:
2514         * xml/XMLHttpRequest.cpp:
2515         (WebCore::XMLHttpRequest::didFinishLoading):
2516         * xml/XMLHttpRequest.h:
2517         Eliminate the unused finishTime double.
2518
2519 2017-02-24  Chris Dumez  <cdumez@apple.com>
2520
2521         Unreviewed GTK build fix after r212965
2522
2523         * CMakeLists.txt:
2524
2525 2017-02-24  Chris Dumez  <cdumez@apple.com>
2526
2527         Unreviewed, rolling out r212944.
2528
2529         Caused a lot of failures on the debug bots
2530
2531         Reverted changeset:
2532
2533         "[Resource Timing] Gather timing information with reliable
2534         responseEnd time"
2535         https://bugs.webkit.org/show_bug.cgi?id=168351
2536         http://trac.webkit.org/changeset/212944
2537
2538 2017-02-24  Chris Dumez  <cdumez@apple.com>
2539
2540         Unreviewed, follow-up fix after r212972.
2541
2542         Fixes a few assertions on the debug build bots.
2543         URL needs to be exactly the same as the parsed one given
2544         that we are calling the ParsedURLString constructor.
2545
2546         * platform/network/ResourceResponseBase.cpp:
2547         (WebCore::ResourceResponseBase::sanitizeSuggestedFilename):
2548
2549 2017-02-24  Zalan Bujtas  <zalan@apple.com>
2550
2551         Simple line layout: Re-adjust paginated lines when block height changes.
2552         https://bugs.webkit.org/show_bug.cgi?id=168838
2553         <rdar://problem/30701233>
2554
2555         Reviewed by Antti Koivisto.
2556
2557         When the estimated block height is wrong, we issue an additional layout on the inline children
2558         so that we get the pagination right (this layout is setChildNeedsLayout(MarkOnlyThis) only).
2559         Since the height change only affects the struts and page breaks (and again, the relayoutChildren flag is false)
2560         we don't need to re-layout the content, but instead we just need to re-adjust the pagination for the simple lines. 
2561         This patch also moves the pagination logic to SimpleLineLayoutPagination.cpp.
2562
2563         Not enabled yet.
2564
2565         * CMakeLists.txt:
2566         * WebCore.xcodeproj/project.pbxproj:
2567         * rendering/RenderBlockFlow.cpp:
2568         (WebCore::RenderBlockFlow::layoutSimpleLines):
2569         * rendering/RenderingAllInOne.cpp:
2570         * rendering/SimpleLineLayout.cpp:
2571         (WebCore::SimpleLineLayout::canUseForWithReason):
2572         (WebCore::SimpleLineLayout::create):
2573         (WebCore::SimpleLineLayout::Layout::create):
2574         (WebCore::SimpleLineLayout::Layout::Layout):
2575         (WebCore::SimpleLineLayout::computeLineTopAndBottomWithOverflow): Deleted.
2576         (WebCore::SimpleLineLayout::computeLineBreakIndex): Deleted.
2577         (WebCore::SimpleLineLayout::computeOffsetAfterLineBreak): Deleted.
2578         (WebCore::SimpleLineLayout::setPageBreakForLine): Deleted.
2579         (WebCore::SimpleLineLayout::updateMinimumPageHeight): Deleted.
2580         (WebCore::SimpleLineLayout::adjustLinePositionsForPagination): Deleted.
2581         * rendering/SimpleLineLayout.h:
2582         (WebCore::SimpleLineLayout::Layout::setIsPaginated):
2583         (WebCore::SimpleLineLayout::Layout::setLineStruts):
2584         * rendering/SimpleLineLayoutPagination.cpp: Added.
2585         (WebCore::SimpleLineLayout::computeLineTopAndBottomWithOverflow):
2586         (WebCore::SimpleLineLayout::computeLineBreakIndex):
2587         (WebCore::SimpleLineLayout::computeOffsetAfterLineBreak):
2588         (WebCore::SimpleLineLayout::setPageBreakForLine):
2589         (WebCore::SimpleLineLayout::updateMinimumPageHeight):
2590         (WebCore::SimpleLineLayout::adjustLinePositionsForPagination):
2591         * rendering/SimpleLineLayoutPagination.h: Added.
2592
2593 2017-02-24  Jon Lee  <jonlee@apple.com>
2594
2595         Alias "system-ui" for the System font name
2596         https://bugs.webkit.org/show_bug.cgi?id=151493
2597
2598         Reviewed by Tim Horton and Joseph Pecoraro.
2599
2600         Updated existing tests.
2601
2602         * WebCore.xcodeproj/project.pbxproj: Add WebKitFontFamilyNames.in for
2603         convenience.
2604         * css/CSSValueKeywords.in: Add system-ui as a keyword.
2605         * css/WebKitFontFamilyNames.in: Add system-ui.
2606
2607         * platform/graphics/ios/FontCacheIOS.mm:
2608         (WebCore::platformFontWithFamilySpecialCase): Include "system-ui" as an
2609         alias.
2610         * platform/graphics/mac/FontCacheMac.mm:
2611         (WebCore::platformFontWithFamilySpecialCase): Ditto.
2612
2613         * rendering/RenderThemeMac.mm:
2614         (WebCore::RenderThemeMac::updateCachedSystemFontDescription): Update
2615         serialization to "system-ui" from "-apple-system".
2616
2617         * css/CSSComputedStyleDeclaration.cpp:
2618         (WebCore::identifierForFamily):
2619         * css/CSSFontFaceSet.cpp:
2620         (WebCore::CSSFontFaceSet::familyNameFromPrimitive):
2621         * css/StyleBuilderCustom.h:
2622         (WebCore::StyleBuilderCustom::applyValueFontFamily):
2623
2624 2017-02-24  Matt Rajca  <mrajca@apple.com>
2625
2626         Media: notify clients when autoplay is denied
2627         https://bugs.webkit.org/show_bug.cgi?id=168840
2628
2629         Reviewed by Alex Christensen.
2630
2631         Added API tests.
2632
2633         * WebCore.xcodeproj/project.pbxproj:
2634         * html/HTMLMediaElement.cpp:
2635         (WebCore::HTMLMediaElement::setReadyState):
2636         (WebCore::HTMLMediaElement::play):
2637         (WebCore::HTMLMediaElement::playInternal):
2638         * page/AutoplayEvent.h: Added.
2639         * page/ChromeClient.h:
2640
2641 2017-02-24  Basuke Suzuki  <Basuke.Suzuki@am.sony.com>
2642
2643         curl: Improve errors by including the domain
2644         https://bugs.webkit.org/show_bug.cgi?id=134340
2645
2646         Reviewed by Alex Christensen.
2647
2648         Added proper error domain to ResourceError created by
2649         Curl problem.
2650
2651         * platform/network/curl/ResourceHandleManager.cpp:
2652         (WebCore::ResourceHandleManager::downloadTimerCallback):
2653         (WebCore::ResourceHandleManager::dispatchSynchronousJob):
2654
2655 2017-02-24  Antoine Quint  <graouts@apple.com>
2656
2657         [Modern Media Controls] <audio> controls should center in their container when the page is scaled
2658         https://bugs.webkit.org/show_bug.cgi?id=168841
2659         <rdar://problem/28612794>
2660
2661         Reviewed by Eric Carlson.
2662
2663         When dealing with <audio> elements, we vertically center the controls relative to their containing
2664         media element such that if the controls visually overflow, they overflow equally above and below
2665         to minimize the likelihood of overlap with surrounding elements.
2666
2667         Test: media/modern-media-controls/media-controller/media-controller-scale-factor-audio.html
2668
2669         * Modules/modern-media-controls/controls/media-controls.js:
2670         (MediaControls.prototype.get shouldCenterControlsVertically):
2671         (MediaControls.prototype.set shouldCenterControlsVertically):
2672         (MediaControls.prototype.commitProperty):
2673         * Modules/modern-media-controls/media/media-controller.js:
2674         (MediaController.prototype.get isAudio):
2675         (MediaController.prototype.get layoutTraits):
2676         (MediaController.prototype._updateControlsSize):
2677
2678 2017-02-24  Alex Christensen  <achristensen@webkit.org>
2679
2680         Non-special relative URLs should not ignore extra slashes
2681         https://bugs.webkit.org/show_bug.cgi?id=168834
2682
2683         Reviewed by Sam Weinig.
2684
2685         Special authority ignore slashes state should, as its name implies,
2686         only be reached by special URLs.  See https://url.spec.whatwg.org/#relative-slash-state
2687
2688         Covered by newly passing web platform tests.
2689
2690         * platform/URLParser.cpp:
2691         (WebCore::URLParser::parse):
2692
2693 2017-02-24  Alexey Proskuryakov  <ap@apple.com>
2694
2695         Build fix for newer clang
2696         https://bugs.webkit.org/show_bug.cgi?id=168849
2697         rdar://problem/30638741
2698
2699         Reviewed by Ryosuke Niwa.
2700
2701         * dom/Range.cpp: (WebCore::Range::toString): std::max(0, <unsigned>) is not meaningful,
2702         and now triggers a warning.
2703
2704 2017-02-24  Chris Dumez  <cdumez@apple.com>
2705
2706         Download attribute should be sanitized before being used as suggested filename
2707         https://bugs.webkit.org/show_bug.cgi?id=168839
2708         <rdar://problem/30683109>
2709
2710         Reviewed by Darin Adler.
2711
2712         Sanitize Download attribute before using it as a suggested filename for the download.
2713         We rely on ResourceResponse's sanitizing of the suggested filename to do so, which has
2714         the benefit of being consistent with downloads without the download attribute.
2715
2716         Tests: fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-doublequote.html
2717                fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-slashes.html
2718                fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-unicode.html
2719
2720         * html/HTMLAnchorElement.cpp:
2721         (WebCore::HTMLAnchorElement::handleClick):
2722         * platform/network/ResourceResponseBase.cpp:
2723         (WebCore::ResourceResponseBase::sanitizeSuggestedFilename):
2724         * platform/network/ResourceResponseBase.h:
2725
2726 2017-02-24  Miguel Gomez  <magomez@igalia.com>
2727
2728         [GTK] WebkitWebProcess crashes on exit on nvidia if threaded compositing is enabled
2729         https://bugs.webkit.org/show_bug.cgi?id=165522
2730
2731         Reviewed by Carlos Garcia Campos.
2732
2733         Before destrying a GLContextGLX we need to set the default framebufer to avoid a bug
2734         in some nvidia drivers. Ensure that we set the context as current before performing
2735         that operation, and set the appropriate current context after doing so.
2736
2737         No new tests.
2738
2739         * platform/graphics/glx/GLContextGLX.cpp:
2740         (WebCore::GLContextGLX::~GLContextGLX):
2741
2742 2017-02-24  Chris Dumez  <cdumez@apple.com>
2743
2744         [iOS][WK2] Disable network cache speculative revalidation / loading in low power mode
2745         https://bugs.webkit.org/show_bug.cgi?id=168832
2746         <rdar://problem/30697911>
2747
2748         Reviewed by Antti Koivisto.
2749
2750         Add LowPowerModeNotifier class to monitor low power mode state on iOS.
2751
2752         * WebCore.xcodeproj/project.pbxproj:
2753         * platform/LowPowerModeNotifier.cpp: Added.
2754         (WebCore::LowPowerModeNotifier::LowPowerModeNotifier):
2755         (WebCore::LowPowerModeNotifier::isLowPowerModeEnabled):
2756         * platform/LowPowerModeNotifier.h: Added.
2757         * platform/ios/LowPowerModeNotifierIOS.mm: Added.
2758         (-[WebLowPowerModeObserver initWithNotifier:]):
2759         (-[WebLowPowerModeObserver dealloc]):
2760         (-[WebLowPowerModeObserver _didReceiveLowPowerModeChange]):
2761         (WebCore::LowPowerModeNotifier::LowPowerModeNotifier):
2762         (WebCore::LowPowerModeNotifier::isLowPowerModeEnabled):
2763         (WebCore::LowPowerModeNotifier::notifyLowPowerModeChanged):
2764         (WebCore::notifyLowPowerModeChanged):
2765
2766 2017-02-24  Chris Dumez  <cdumez@apple.com>
2767
2768         [Mac] Report domains using abnormally high memory usage via enhanced privacy logging
2769         https://bugs.webkit.org/show_bug.cgi?id=168797
2770         <rdar://problem/29964017>
2771
2772         Reviewed by Andreas Kling.
2773
2774         Report domains using abnormally high memory usage (> 2GB) via enhanced privacy
2775         logging on Mac.
2776
2777         * page/DiagnosticLoggingKeys.cpp:
2778         (WebCore::DiagnosticLoggingKeys::domainCausingJetsamKey):
2779         * page/DiagnosticLoggingKeys.h:
2780         * page/PerformanceMonitor.cpp:
2781         (WebCore::reportPageOverPostLoadResourceThreshold):
2782         (WebCore::PerformanceMonitor::measurePostLoadCPUUsage):
2783         (WebCore::PerformanceMonitor::measurePostLoadMemoryUsage):
2784         (WebCore::reportPageOverPostLoadCPUUsageThreshold): Deleted.
2785
2786 2017-02-24  Alex Christensen  <achristensen@webkit.org>
2787
2788         .. should not remove windows drive letters in paths of file URLs
2789         https://bugs.webkit.org/show_bug.cgi?id=168824
2790
2791         Reviewed by Youenn Fablet.
2792
2793         It's specified in https://url.spec.whatwg.org/#shorten-a-urls-path and helps behavior for browsers on Windows.
2794         It can't hurt to pass a few more web platform tests, though.
2795
2796         * platform/URLParser.cpp:
2797         (WebCore::URLParser::copyURLPartsUntil):
2798         (WebCore::URLParser::shouldPopPath):
2799         (WebCore::URLParser::popPath):
2800         (WebCore::URLParser::parse):
2801         * platform/URLParser.h:
2802
2803 2017-02-24  Csaba Osztrogonác  <ossy@webkit.org>
2804
2805         [Mac][cmake] Unreviewed buildfix after r212736.
2806
2807         * PlatformMac.cmake:
2808
2809 2017-02-24  John Wilander  <wilander@apple.com>
2810
2811         Resource Load Statistics: Add alternate classification method
2812         https://bugs.webkit.org/show_bug.cgi?id=168347
2813         <rdar://problem/30352793>
2814         <rdar://problem/30646710>
2815         <rdar://problem/30660708>
2816
2817         Reviewed by Alex Christensen.
2818
2819         This patch only adds test infrastructure in WebCore.
2820
2821         Tests: http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-mixed-statistics.html
2822                http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-sub-frame-under-top-frame-origins.html
2823                http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-under-top-frame-origins.html
2824                http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-unique-redirects-to.html
2825                http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-mixed-statistics.html
2826                http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-sub-frame-under-top-frame-origins.html
2827                http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-under-top-frame-origins.html
2828                http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-unique-redirects-to.html
2829
2830         * loader/ResourceLoadObserver.cpp:
2831         (WebCore::ResourceLoadObserver::setSubframeUnderTopFrameOrigin):
2832         (WebCore::ResourceLoadObserver::setSubresourceUnderTopFrameOrigin):
2833         (WebCore::ResourceLoadObserver::setSubresourceUniqueRedirectTo):
2834         * loader/ResourceLoadObserver.h:
2835
2836 2017-02-23  Antoine Quint  <graouts@apple.com>
2837
2838         [Modern Media Controls] No controls are shown for <audio preload="none">
2839         https://bugs.webkit.org/show_bug.cgi?id=168800
2840         <rdar://problem/30652142>
2841
2842         Reviewed by Eric Carlson.
2843
2844         A media element's currentSrc property will only be set when data has started
2845         to load. In the case where preload="none" is used, regardless of whether a
2846         source is specified, currentSrc would be the empty string and we wouldn't
2847         show controls at all. Identifying whether a source is specified is a little
2848         tricky because it could be specified in a variety of ways and dynamically
2849         as well.
2850
2851         So instead we optimistically show controls always provided the "controls"
2852         attribute is set.
2853
2854         * Modules/modern-media-controls/media/controls-visibility-support.js:
2855         (ControlsVisibilitySupport.prototype._updateControls):
2856         (ControlsVisibilitySupport):
2857         * Modules/modern-media-controls/media/start-support.js:
2858         (StartSupport.prototype._shouldShowStartButton):
2859         (StartSupport):
2860
2861 2017-02-23  Joseph Pecoraro  <pecoraro@apple.com>
2862
2863         [Resource Timing] Gather timing information with reliable responseEnd time
2864         https://bugs.webkit.org/show_bug.cgi?id=168351
2865
2866         Reviewed by Alex Christensen.
2867
2868         This patch replaces the unused `double finishTime` in ResourceLoader's
2869         didFinishLoad with a complete WebCore::NetworkLoadMetrics object. This
2870         allows the NetworkProcess to give complete timing information, and more
2871         final metrics about the load, to WebCore. Currently this is only used
2872         by ResourceTiming, but it will soon be used by Web Inspector as well.
2873         We may also end up extending this to the didFail path as well, since it
2874         is possible that we have some metrics for load failures.
2875
2876         At the same time we want to start moving away from the legacy path that
2877         populated a subset of this information in ResourceResponse's NetworkLoadMetrics.
2878         It doesn't make sense to store this information on the ResourceResponse
2879         for a few reasons: We don't want to store the metrics in our Network Cache and
2880         not all of the load timing metrics have been populated yet (responseEnd).
2881         In an effort to move off of this data we've renamed the accessor to
2882         "deprecatedNetworkLoadMetrics". There are a few remaining clients
2883         (ResourceHandle, PerformanceTiming, InspectorNetworkAgent) which can be
2884         migrated separately from this patch.
2885
2886         Having both the legacy and new code paths adds a little bit of complexity.
2887         One advantage of the new path is that the complete load timing data
2888         (fetchStart -> dns -> connect -> request -> response -> responseEnd) can
2889         be packaged together. The legacy path could not include a responseEnd, so
2890         WebCore faked that value with its own timestamp. Having the fake responseEnd
2891         caused issues as timestamps / clocks are different between processes. In order
2892         for PerformanceResponseTiming to know whether or not the NetworkLoadMetrics
2893         has the complete network timing metrics it checks isComplete(). If true
2894         it knows it can use the responseEnd time from NetworkLoadMetrics, otherwise
2895         it must fallback to the legacy value from LoadTiming. Once all of the
2896         deprecatedNetworkLoadMetrics clients go away, we should always have the
2897         complete data and this can be eliminated.
2898
2899         Tests: imported/w3c/web-platform-tests/resource-timing/rt-nextHopProtocol.html
2900                imported/w3c/web-platform-tests/resource-timing/rt-nextHopProtocol.worker.html
2901
2902         * PlatformMac.cmake:
2903         * WebCore.xcodeproj/project.pbxproj:
2904         Rename NetworkLoadTiming -> NetworkLoadMetrics.
2905
2906         * page/PerformanceResourceTiming.cpp:
2907         (WebCore::entryStartTime):
2908         (WebCore::entryEndTime):
2909         (WebCore::PerformanceResourceTiming::PerformanceResourceTiming):
2910         (WebCore::PerformanceResourceTiming::nextHopProtocol):
2911         (WebCore::PerformanceResourceTiming::domainLookupStart):
2912         (WebCore::PerformanceResourceTiming::domainLookupEnd):
2913         (WebCore::PerformanceResourceTiming::connectStart):
2914         (WebCore::PerformanceResourceTiming::connectEnd):
2915         (WebCore::PerformanceResourceTiming::secureConnectionStart):
2916         (WebCore::PerformanceResourceTiming::requestStart):
2917         (WebCore::PerformanceResourceTiming::responseStart):
2918         (WebCore::PerformanceResourceTiming::responseEnd):
2919         (WebCore::PerformanceResourceTiming::networkLoadTimeToDOMHighResTimeStamp):
2920         * page/PerformanceResourceTiming.h:
2921         Mostly just updating names and types. This does however need to get the
2922         correct endTime based on whether the NetworkLoadMetrics are complete
2923         (meaning includes responseEnd) or not (legacy, use LoadTiming value).
2924
2925         * page/PerformanceResourceTiming.idl:
2926         Add nextHopProtocol.
2927
2928         * page/PerformanceTiming.cpp:
2929         (WebCore::PerformanceTiming::domainLookupStart):
2930         (WebCore::PerformanceTiming::domainLookupEnd):
2931         (WebCore::PerformanceTiming::connectStart):
2932         (WebCore::PerformanceTiming::connectEnd):
2933         (WebCore::PerformanceTiming::secureConnectionStart):
2934         (WebCore::PerformanceTiming::requestStart):
2935         (WebCore::PerformanceTiming::responseStart):
2936         (WebCore::PerformanceTiming::resourceLoadTimeRelativeToFetchStart):
2937         * page/PerformanceTiming.h:
2938         Navigation Timing values still uses the NetworkLoadTiming values stored on
2939         the DocumentLoader. This should be moved off of the deprecated path separately.
2940
2941         * platform/network/NetworkLoadMetrics.h: Renamed from Source/WebCore/platform/network/NetworkLoadTiming.h.
2942         (WebCore::NetworkLoadMetrics::NetworkLoadMetrics):
2943         (WebCore::NetworkLoadMetrics::isolatedCopy):
2944         (WebCore::NetworkLoadMetrics::reset):
2945         (WebCore::NetworkLoadMetrics::operator==):
2946         (WebCore::NetworkLoadMetrics::operator!=):
2947         (WebCore::NetworkLoadMetrics::isComplete):
2948         (WebCore::NetworkLoadMetrics::markComplete):
2949         (WebCore::NetworkLoadMetrics::encode):
2950         (WebCore::NetworkLoadMetrics::decode):
2951         Re-introduce a reset() method (for NetworkLoadSoup to reset between redirects).
2952         Add protocolName and "complete" boolean.
2953
2954         * platform/network/cocoa/NetworkLoadMetrics.mm: Renamed from Source/WebCore/platform/network/cocoa/NetworkLoadTiming.mm.
2955         (WebCore::timingValue):
2956         (WebCore::copyTimingData):
2957         (WebCore::setCollectsTimingData):
2958         Use this opportunity to convert NetworkLoadTiming timestamps to WTF::Seconds.
2959         Since we already have to modify all the clients this moves us to use the more
2960         strongly typed units that are less ambiguous then "double". The rest of the
2961         Performance API has already moved to these units.
2962
2963         * inspector/InspectorNetworkAgent.cpp:
2964         (WebCore::InspectorNetworkAgent::buildObjectForTiming):
2965         (WebCore::InspectorNetworkAgent::buildObjectForResourceResponse):
2966         (WebCore::InspectorNetworkAgent::didFinishLoading):
2967         * inspector/InspectorNetworkAgent.h:
2968         Inspector was the only client of the finishTime, and since the value was
2969         erratically coming from clients in different ways it was almost certainly
2970         inaccurate. Simplify this in preparation for using NetworkLoadMetrics.
2971
2972         * Modules/fetch/FetchLoader.cpp:
2973         (WebCore::FetchLoader::didFinishLoading):
2974         * Modules/fetch/FetchLoader.h:
2975         * fileapi/FileReaderLoader.cpp:
2976         (WebCore::FileReaderLoader::didFinishLoading):
2977         * fileapi/FileReaderLoader.h:
2978         * html/MediaFragmentURIParser.cpp:
2979         (WebCore::MediaFragmentURIParser::parseNPTTime):
2980         * inspector/InspectorInstrumentation.cpp:
2981         (WebCore::InspectorInstrumentation::didFinishLoadingImpl):
2982         * inspector/InspectorInstrumentation.h:
2983         (WebCore::InspectorInstrumentation::didFinishLoading):
2984         * loader/CrossOriginPreflightChecker.cpp:
2985         (WebCore::CrossOriginPreflightChecker::validatePreflightResponse):
2986         * loader/DocumentLoader.cpp:
2987         (WebCore::DocumentLoader::notifyFinished):
2988         (WebCore::DocumentLoader::finishedLoading):
2989         (WebCore::DocumentLoader::continueAfterContentPolicy):
2990         (WebCore::DocumentLoader::maybeLoadEmpty):
2991         * loader/DocumentLoader.h:
2992         * loader/DocumentThreadableLoader.cpp:
2993         (WebCore::DocumentThreadableLoader::didReceiveResponse):
2994         (WebCore::DocumentThreadableLoader::notifyFinished):
2995         (WebCore::DocumentThreadableLoader::didFinishLoading):
2996         (WebCore::DocumentThreadableLoader::loadRequest):
2997         * loader/DocumentThreadableLoader.h:
2998         * loader/NetscapePlugInStreamLoader.cpp:
2999         (WebCore::NetscapePlugInStreamLoader::didFinishLoading):
3000         * loader/NetscapePlugInStreamLoader.h:
3001         * loader/ResourceLoadNotifier.cpp:
3002         (WebCore::ResourceLoadNotifier::didFinishLoad):
3003         (WebCore::ResourceLoadNotifier::dispatchDidFinishLoading):
3004         (WebCore::ResourceLoadNotifier::sendRemainingDelegateMessages):
3005         * loader/ResourceLoadNotifier.h:
3006         * loader/ResourceLoader.cpp:
3007         (WebCore::ResourceLoader::deliverResponseAndData):
3008         (WebCore::ResourceLoader::loadDataURL):
3009         (WebCore::ResourceLoader::didFinishLoading):
3010         (WebCore::ResourceLoader::didFinishLoadingOnePart):
3011         * loader/ResourceLoader.h:
3012         * loader/ResourceTiming.cpp:
3013         (WebCore::ResourceTiming::fromLoad):
3014         (WebCore::ResourceTiming::fromSynchronousLoad):
3015         (WebCore::ResourceTiming::ResourceTiming):
3016         (WebCore::ResourceTiming::isolatedCopy):
3017         * loader/ResourceTiming.h:
3018         (WebCore::ResourceTiming::networkLoadMetrics):
3019         (WebCore::ResourceTiming::ResourceTiming):
3020         (WebCore::ResourceTiming::networkLoadTiming): Deleted.
3021         * loader/SubresourceLoader.cpp:
3022         (WebCore::SubresourceLoader::SubresourceLoader):
3023         (WebCore::SubresourceLoader::willSendRequestInternal):
3024         (WebCore::SubresourceLoader::didReceiveResponse):
3025         (WebCore::SubresourceLoader::didFinishLoading):
3026         (WebCore::SubresourceLoader::reportResourceTiming):
3027         * loader/SubresourceLoader.h:
3028         * loader/ThreadableLoaderClient.h:
3029         (WebCore::ThreadableLoaderClient::didFinishLoading):
3030         * loader/ThreadableLoaderClientWrapper.h:
3031         (WebCore::ThreadableLoaderClientWrapper::didFinishLoading):
3032         * loader/WorkerThreadableLoader.cpp:
3033         (WebCore::WorkerThreadableLoader::MainThreadBridge::didFinishLoading):
3034         * loader/WorkerThreadableLoader.h:
3035         * loader/appcache/ApplicationCacheGroup.cpp:
3036         (WebCore::ApplicationCacheGroup::didFinishLoading):
3037         * loader/appcache/ApplicationCacheGroup.h:
3038         * loader/cache/CachedResource.h:
3039         (WebCore::CachedResource::setLoadFinishTime):
3040         * loader/ios/QuickLook.mm:
3041         (-[WebPreviewLoader connectionDidFinishLoading:]):
3042         * page/EventSource.cpp:
3043         (WebCore::EventSource::didFinishLoading):
3044         * page/EventSource.h:
3045         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
3046         (ResourceHandleStreamingClient::didFinishLoading):
3047         * platform/network/BlobResourceHandle.cpp:
3048         (WebCore::doNotifyFinish):
3049         * platform/network/PingHandle.h:
3050         * platform/network/ResourceHandle.h:
3051         * platform/network/ResourceHandleClient.h:
3052         (WebCore::ResourceHandleClient::didFinishLoading):
3053         * platform/network/ResourceResponseBase.cpp:
3054         (WebCore::ResourceResponseBase::crossThreadData):
3055         (WebCore::ResourceResponseBase::fromCrossThreadData):
3056         (WebCore::ResourceResponseBase::compare):
3057         * platform/network/ResourceResponseBase.h:
3058         (WebCore::ResourceResponseBase::deprecatedNetworkLoadMetrics):
3059         (WebCore::ResourceResponseBase::encode):
3060         (WebCore::ResourceResponseBase::decode):
3061         (WebCore::ResourceResponseBase::networkLoadTiming): Deleted.
3062         * platform/network/SynchronousLoaderClient.cpp:
3063         (WebCore::SynchronousLoaderClient::didFinishLoading):
3064         * platform/network/SynchronousLoaderClient.h:
3065         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
3066         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
3067         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didFinishLoading):
3068         * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
3069         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveResponse):
3070         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didFinishLoading):
3071         * platform/network/curl/ResourceHandleCurl.cpp:
3072         (WebCore::WebCoreSynchronousLoader::didFinishLoading):
3073         * platform/network/curl/ResourceHandleManager.cpp:
3074         (WebCore::calculateWebTimingInformations):
3075         (WebCore::ResourceHandleManager::downloadTimerCallback):
3076         (WebCore::handleDataURL):
3077         (WebCore::milisecondsSinceRequest): Deleted.
3078         * platform/network/mac/ResourceHandleMac.mm:
3079         (WebCore::ResourceHandle::getConnectionTimingData):
3080         * platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
3081         (-[WebCoreResourceHandleAsDelegate connection:didReceiveResponse:]):
3082         (-[WebCoreResourceHandleAsDelegate connectionDidFinishLoading:]):
3083         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
3084         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]):
3085         (-[WebCoreResourceHandleAsOperationQueueDelegate connectionDidFinishLoading:]):
3086         * platform/network/soup/ResourceHandleSoup.cpp:
3087         (WebCore::restartedCallback):
3088         (WebCore::nextMultipartResponsePartCallback):
3089         (WebCore::sendRequestCallback):
3090         (WebCore::ResourceHandle::didStartRequest):
3091         (WebCore::networkEventCallback):
3092         (WebCore::ResourceHandle::sendPendingRequest):
3093         (WebCore::readCallback):
3094         (WebCore::milisecondsSinceRequest): Deleted.
3095         * workers/WorkerScriptLoader.cpp:
3096         (WebCore::WorkerScriptLoader::didFinishLoading):
3097         * workers/WorkerScriptLoader.h:
3098         * xml/XMLHttpRequest.cpp:
3099         (WebCore::XMLHttpRequest::didFinishLoading):
3100         * xml/XMLHttpRequest.h:
3101         Eliminate the unused finishTime double.
3102
3103 2017-02-23  Antoine Quint  <graouts@apple.com>
3104
3105         [Modern Media Controls] Controls overflow when media element has border or padding
3106         https://bugs.webkit.org/show_bug.cgi?id=168818
3107         <rdar://problem/30689780>
3108
3109         Reviewed by Jon Lee.
3110
3111         We used to query the media element's layout size to compute the size of the media controls,
3112         which would account for border and padding. Instead, we should use the size of the container,
3113         at the root of the ShadowRoot, which will always match the size of the media.
3114
3115         Test: media/modern-media-controls/media-controller/media-controller-controls-sizing-with-border-and-padding.html
3116
3117         * Modules/modern-media-controls/controls/media-controls.css:
3118         (.media-controls-container,):
3119         * Modules/modern-media-controls/media/media-controller.js:
3120         (MediaController.prototype._updateControlsSize):
3121         (MediaController.prototype._controlsWidth):
3122
3123 2017-02-23  Antoine Quint  <graouts@apple.com>
3124
3125         [Modern Media Controls] Dragging controls in fullscreen on macOS prevents scrubbing or interacting with controls
3126         https://bugs.webkit.org/show_bug.cgi?id=168820
3127         <rdar://problem/30690281>
3128
3129         Reviewed by Jon Lee.
3130
3131         We broke this in https://bugs.webkit.org/show_bug.cgi?id=168755. We restore the check that the
3132         event target when initiating a drag is the controls bar itself and not some of its content.
3133
3134         Since this wasn't caught by our existing tests, we add a test that attemps to initiate a drag
3135         starting over one of the controls and notice that no dragging occurs.
3136
3137         Test: media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-drag-is-prevented-over-button.html
3138
3139         * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
3140         (MacOSFullscreenMediaControls.prototype._handleMousedown):
3141
3142 2017-02-23  Simon Fraser  <simon.fraser@apple.com>
3143
3144         REGRESSION (r211305): Masks on composited elements with preserve-3d broken
3145         https://bugs.webkit.org/show_bug.cgi?id=168815
3146         rdar://problem/30676846
3147
3148         Reviewed by Jon Lee.
3149
3150         r211305 moved the mask layer to be on the structural layer if there is one, to fix
3151         masking backdrops. However, with preserve-3d the structural layer can be a CATransformLayer,
3152         which doesn't take a mask, so limit the previous change to backdrops only.
3153
3154         Test: compositing/masks/mask-with-preserve-3d.html
3155
3156         * platform/graphics/ca/GraphicsLayerCA.cpp:
3157         (WebCore::GraphicsLayerCA::updateMaskLayer):
3158
3159 2017-02-23  Antoine Quint  <graouts@apple.com>
3160
3161         [Modern Media Controls] Show "Loading" until playback starts
3162         https://bugs.webkit.org/show_bug.cgi?id=168809
3163         <rdar://problem/30687468>
3164
3165         Reviewed by Jon Lee.
3166
3167         We now display the "Loading" status as soon as we've started loading and
3168         until we've obtained enough data to play. No test provided since we don't
3169         have a way to specifically set networkState and readyState to the satisfactory
3170         values.
3171
3172         * Modules/modern-media-controls/media/status-support.js:
3173         (StatusSupport.prototype.syncControl):
3174         (StatusSupport):
3175
3176 2017-02-23  Antoine Quint  <graouts@apple.com>
3177
3178         [Modern Media Controls] Enforce a minimum layout height of 50pt for <audio>
3179         https://bugs.webkit.org/show_bug.cgi?id=168801
3180         <rdar://problem/30683453>
3181
3182         Reviewed by Eric Carlson.
3183
3184         We enforce a 50pt minimum layout height for <audio> elements. There is no way
3185         for the page author to override this value since the min-height property is set
3186         as !important in a <style> element contained in a ShadowRoot.
3187
3188         * Modules/modern-media-controls/controls/media-controls.css:
3189         (:host(audio)):
3190
3191 2017-02-23  Youenn Fablet  <youenn@apple.com>
3192
3193         [WebRTC] Outgoing video quality is poor
3194         https://bugs.webkit.org/show_bug.cgi?id=168778
3195         <rdar://problem/30674673>
3196
3197         Reviewed by Eric Carlson.
3198
3199         Covered by manually ensuring the voice process thread is not spinning.
3200
3201         * 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.
3202
3203 2017-02-23  Wenson Hsieh  <wenson_hsieh@apple.com>
3204
3205         Data interaction with a URL should navigate the page if the operation is not handled
3206         https://bugs.webkit.org/show_bug.cgi?id=168798
3207         <rdar://problem/30665969>
3208
3209         Reviewed by Tim Horton.
3210
3211         Refactors some drag and drop code on the Mac, and implements PlatformPasteboard::stringForType.
3212
3213         * page/DragController.cpp:
3214         (WebCore::DragController::performDragOperation):
3215         * platform/ios/PlatformPasteboardIOS.mm:
3216         (WebCore::PlatformPasteboard::stringForType):
3217         * platform/mac/DragDataMac.mm:
3218
3219 2017-02-23  Youenn Fablet  <youenn@apple.com>
3220
3221         [WebRTC] RealtimeOutgoingAudioSource does not need to upsample audio buffers
3222         https://bugs.webkit.org/show_bug.cgi?id=168796
3223
3224         Reviewed by Jer Noble.
3225
3226         Covered by manual testing.
3227         Limiting RealtimeOutgoingAudioSource conversion to interleaving and float-to-integer.
3228         Removed the sample rate conversion.
3229
3230         * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
3231         (WebCore::libwebrtcAudioFormat):
3232         (WebCore::RealtimeOutgoingAudioSource::audioSamplesAvailable):
3233         (WebCore::RealtimeOutgoingAudioSource::pullAudioData):
3234
3235 2017-02-23  Alex Christensen  <achristensen@webkit.org>
3236
3237         Re-soft-link CoreVideo after r212906
3238         https://bugs.webkit.org/show_bug.cgi?id=168803
3239
3240         Reviewed by Jer Noble.
3241
3242         CoreVideo should be soft linked to reduce startup time.
3243         Linking against the framework just for a few symbols used in one file was the wrong solution.
3244
3245         * Configurations/WebCore.xcconfig:
3246         * platform/cocoa/CoreVideoSoftLink.cpp:
3247         * platform/cocoa/CoreVideoSoftLink.h:
3248         * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:
3249
3250 2017-02-23  Chris Dumez  <cdumez@apple.com>
3251
3252         Report domains using abnormally high CPU usage via enhanced privacy logging
3253         https://bugs.webkit.org/show_bug.cgi?id=168794
3254         <rdar://problem/29964018>
3255
3256         Reviewed by Ryosuke Niwa.
3257
3258         Report domains using abnormally high CPU usage (> 20%) via enhanced privacy
3259         logging.
3260
3261         * page/DiagnosticLoggingKeys.cpp:
3262         (WebCore::DiagnosticLoggingKeys::domainCausingEnergyDrainKey):
3263         * page/DiagnosticLoggingKeys.h:
3264         * page/PerformanceMonitor.cpp:
3265         (WebCore::reportPageOverPostLoadCPUUsageThreshold):
3266         (WebCore::PerformanceMonitor::measurePostLoadCPUUsage):
3267
3268 2017-02-23  Zalan Bujtas  <zalan@apple.com>
3269
3270         Simple line layout: Adjust RunResolver::lineIndexForHeight with line struts.
3271         https://bugs.webkit.org/show_bug.cgi?id=168783
3272         <rdar://problem/30676449>
3273
3274         Reviewed by Antti Koivisto.
3275
3276         When there's a pagination gap between lines the simple lineIndex = y / lineHeight formula does not work anymore.
3277         This patch takes the line gaps into account by offsetting the y position accordingly.
3278
3279         Not enabled yet.
3280
3281         * rendering/SimpleLineLayoutResolver.cpp:
3282         (WebCore::SimpleLineLayout::RunResolver::lineIndexForHeight):
3283
3284 2017-02-23  Alex Christensen  <achristensen@webkit.org>
3285
3286         Fix iOS WebRTC build after r212812
3287         https://bugs.webkit.org/show_bug.cgi?id=168790
3288
3289         Reviewed by Tim Horton.
3290
3291         * Configurations/WebCore.xcconfig:
3292
3293 2017-02-23  Carlos Garcia Campos  <cgarcia@igalia.com>
3294
3295         [GStreamer] Several layout tests trigger GStreamer-CRITICAL **: gst_bin_get_by_name: assertion 'GST_IS_BIN (bin)' failed
3296         https://bugs.webkit.org/show_bug.cgi?id=167016
3297
3298         Reviewed by Xabier Rodriguez-Calvar.
3299
3300         This is because we create AudioSourceProviderGStreamer objects that are never loaded. In the destructor the
3301         AudioSourceProviderGStreamer calls gst_bin_get_by_name() on its m_audioSinkBin that is nullptr. We could simply
3302         check m_audioSinkBin in the destructor, but I think it's better to simply not create
3303         AudioSourceProviderGStreamer for nothing. MediaPlayerPrivateGStreamer should create the AudioSourceProvider on demand.
3304
3305         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3306         (WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer): Do not create the AudioSourceProvider.
3307         (WebCore::MediaPlayerPrivateGStreamer::createAudioSink): Call ensureAudioSourceProvider() before using m_audioSourceProvider.
3308         (WebCore::MediaPlayerPrivateGStreamer::ensureAudioSourceProvider): Create the AudioSourceProvider if needed.
3309         (WebCore::MediaPlayerPrivateGStreamer::audioSourceProvider): Ensure and return the m_audioSourceProvider.
3310         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
3311
3312 2017-02-23  Tomas Popela  <tpopela@redhat.com>
3313
3314         [GTK] Drag and drop is always moving the content even if copy is requested
3315         https://bugs.webkit.org/show_bug.cgi?id=168424
3316
3317         Reviewed by Carlos Garcia Campos.
3318
3319         Drag and drop is always moving the content around even if the copy is
3320         requested (i.e. by pressing the Control key).
3321
3322         Test: editing/pasteboard/drag-drop-copy-content.html
3323
3324         * page/gtk/DragControllerGtk.cpp:
3325         (WebCore::DragController::isCopyKeyDown):
3326
3327 2017-02-22  Myles C. Maxfield  <mmaxfield@apple.com>
3328
3329         [Cocoa] Remove Yosemite-specific font lookup code
3330         https://bugs.webkit.org/show_bug.cgi?id=168682
3331
3332         Reviewed by Zalan Bujtas.
3333
3334         No new tests because there is no behavior change.
3335
3336         * platform/graphics/cocoa/FontCacheCoreText.cpp:
3337         (WebCore::platformFontLookupWithFamily):
3338         (WebCore::fontWithFamily):
3339         * platform/graphics/mac/FontCacheMac.mm:
3340         (WebCore::platformInvalidateFontCache):
3341         (WebCore::acceptableChoice): Deleted.
3342         (WebCore::betterChoice): Deleted.
3343         (WebCore::desiredFamilyToAvailableFamilyMap): Deleted.
3344         (WebCore::hasDesiredFamilyToAvailableFamilyMapping): Deleted.
3345         (WebCore::rememberDesiredFamilyToAvailableFamilyMapping): Deleted.
3346         (WebCore::toAppKitFontWeight): Deleted.
3347         (WebCore::appkitWeightToFontWeight): Deleted.
3348         (WebCore::toNSFontTraits): Deleted.
3349         (WebCore::platformFontWithFamily): Deleted.
3350
3351 2017-02-22  Antoine Quint  <graouts@apple.com>
3352
3353         [Modern Media Controls] Clicking on the video doesn't toggle playback state in fullscreen on macOS
3354         https://bugs.webkit.org/show_bug.cgi?id=168755
3355         <rdar://problem/30664484>
3356
3357         Reviewed by Dean Jackson.
3358
3359         We now call super in the handleEvent() method of MacOSFullscreenMediaControls if we're not dealing
3360         with an event type and target combination that was specifically registered in this class's scope.
3361         We had mistakenly added the call to super.handleEvent(event) in the wrong method when fixing
3362         https://bugs.webkit.org/show_bug.cgi?id=168515.
3363
3364         Test: media/modern-media-controls/media-controller/media-controller-click-on-video-background-should-pause-fullscreen.html
3365
3366         * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
3367         (MacOSFullscreenMediaControls.prototype.handleEvent):
3368         (MacOSFullscreenMediaControls.prototype._handleMousedown):
3369         * Modules/modern-media-controls/controls/macos-media-controls.js:
3370         (MacOSMediaControls.prototype.handleEvent):
3371         (MacOSMediaControls):
3372
3373 2017-02-22  Antoine Quint  <graouts@apple.com>
3374
3375         [Modern Media Controls] Scrubber stops moving while scrubbing on macOS
3376         https://bugs.webkit.org/show_bug.cgi?id=168518
3377         <rdar://problem/30577637>
3378
3379         Reviewed by Dean Jackson.
3380
3381         As we start to scrub, controlValueWillStartChanging() is called on
3382         ScrubberSupport and pauses the media if it's not already paused. This
3383         causes the play/pause button to change icon and for layout() to be
3384         called on MacOSInlineMediaControls. This in turns sets the .children
3385         property on the .controlsBar and eventually yields a DOM manipulation
3386         which re-inserts the scrubber's DOM hierarchy, causing stutters during
3387         user interaction.
3388
3389         Our solution is to make the .children setter smarter about identifying
3390         that the children list hasn't changed and that no DOM invalidation is
3391         necessary.
3392
3393         * Modules/modern-media-controls/controls/layout-node.js:
3394         (LayoutNode.prototype.set children):
3395
3396 2017-02-22  Antoine Quint  <graouts@apple.com>
3397
3398         [Modern Media Controls] Controls bar may disappear while captions menu is visible
3399         https://bugs.webkit.org/show_bug.cgi?id=168751
3400         <rdar://problem/30663411>
3401
3402         Reviewed by Dean Jackson.
3403
3404         We now prevent the controls bar from fading out due to the auto-hide timer firing
3405         when the tracks panel is up, and wait until the track panel is hidden before fading
3406         the controls bar.
3407
3408         Test: media/modern-media-controls/tracks-panel/tracks-panel-prevent-controls-bar-from-fading.html
3409
3410         * Modules/modern-media-controls/controls/controls-bar.js:
3411         (ControlsBar.prototype.set userInteractionEnabled):
3412         (ControlsBar.prototype._autoHideTimerFired):
3413
3414 2017-02-22  Antoine Quint  <graouts@apple.com>
3415
3416         [Modern Media Controls] Can't set the volume slider with macOS inline controls
3417         https://bugs.webkit.org/show_bug.cgi?id=168747