[WebIDL] PutForwards is not implemented to spec as illustrated by the WPT WebIDL...
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-06-07  Sam Weinig  <sam@webkit.org>
2
3         [WebIDL] PutForwards is not implemented to spec as illustrated by the WPT WebIDL/ecmascript-binding/put-forwards.html
4         https://bugs.webkit.org/show_bug.cgi?id=172956
5
6         Reviewed by Chris Dumez.
7
8         Implements step 3.5.9 of https://heycam.github.io/webidl/#dfn-attribute-setter.
9
10         * bindings/scripts/CodeGeneratorJS.pm:
11         (GenerateAttributeSetterDefinition):
12         Implement [PutForwards] to spec, which involves using JSC get/set rather than calling
13         directly into the implementation.
14
15         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
16         * bindings/scripts/test/JS/JSTestObj.cpp:
17         Update test results.
18
19 2017-06-07  Jer Noble  <jer.noble@apple.com>
20
21         Clean-up: RenderElement.h includes headers it doesn't use
22         https://bugs.webkit.org/show_bug.cgi?id=173046
23
24         Reviewed by Andy Estes.
25
26         Remove a couple of unneeded includes from RenderElement.h, and then clean up all the
27         follow-on compile errors that causes. Mostly, these errors are fixed by including the
28         correct headers at the point of use; otherwise, they're solved by forward-declaring types
29         and in one case by moving default constructors implementation to the cpp file from the header.
30
31         * css/parser/SizesAttributeParser.cpp:
32         * editing/cocoa/EditorCocoa.mm:
33         * platform/mac/PasteboardMac.mm:
34         * rendering/InlineIterator.h:
35         (WebCore::embedCharFromDirection):
36         * rendering/RenderBoxModelObject.h:
37         * rendering/RenderElement.cpp:
38         * rendering/RenderElement.h:
39         * rendering/RenderIterator.h:
40         * rendering/RenderLineBreak.cpp:
41         * rendering/RenderQuote.cpp:
42         * rendering/RenderText.h:
43         * rendering/SimpleLineLayoutPagination.cpp:
44         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
45         * rendering/TextAutoSizing.cpp:
46         * rendering/style/RenderStyle.cpp:
47         * rendering/style/RenderStyle.h:
48         * style/RenderTreeUpdater.cpp:
49         * style/StyleResolveForDocument.cpp:
50         * style/StyleTreeResolver.cpp:
51
52 2017-06-07  Youenn Fablet  <youenn@apple.com>
53
54         Add WebRTC stats logging
55         https://bugs.webkit.org/show_bug.cgi?id=173045
56
57         Reviewed by Eric Carlson.
58
59         No change of behavior.
60
61         Do release logging of WebRTC stats once remote description is set.
62         Do logging every second for the first 30 seconds.
63         After 30 seconds, do release logging of these stats every 5 seconds.
64
65         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
66         (WebCore::LibWebRTCMediaEndpoint::LibWebRTCMediaEndpoint):
67         (WebCore::LibWebRTCMediaEndpoint::stop):
68         (WebCore::LibWebRTCMediaEndpoint::gatherStatsForLogging):
69         (WebCore::LibWebRTCMediaEndpoint::OnStatsDelivered):
70         (WebCore::LibWebRTCMediaEndpoint::startLoggingStats):
71         (WebCore::LibWebRTCMediaEndpoint::stopLoggingStats):
72         (WebCore::LibWebRTCPeerConnectionBackend::doSetRemoteDescription):
73
74 2017-06-07  Per Arne Vollan  <pvollan@apple.com>
75
76         Support removal of authentication data through the Website data store API.
77         https://bugs.webkit.org/show_bug.cgi?id=171217
78
79         Reviewed by Brady Eidson.
80
81         Add support to remove and fetch credential data through the Website data store API.
82
83         Test: http/tests/loading/basic-auth-remove-credentials.html
84
85         * platform/network/CredentialStorage.h:
86         (WebCore::CredentialStorage::originsWithCredentials):
87
88 2017-06-07  Per Arne Vollan  <pvollan@apple.com>
89
90         AudioSourceProviderAVFObjC::m_tap member access is not thread safe.
91         https://bugs.webkit.org/show_bug.cgi?id=172263
92
93         Reviewed by Darin Adler.
94
95         It it possible that the main thread will modify the m_tap member by calling
96         AudioSourceProviderAVFObjC::destroyMix(), while m_tap is being read on a secondary
97         thread under AudioSourceProviderAVFObjC::processCallback(). Instead of accessing
98         the m_tap member on the secondary thread, we can use the same MTAudioProcessingTapRef
99         provided by MediaToolbox in the callback. We assume the tap ref is retained by
100         MediaToolbox, so it should be safe to use even if the the m_tap member is set to null.
101
102         Covered by existing tests.
103
104         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.h:
105         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
106         (WebCore::AudioSourceProviderAVFObjC::processCallback):
107         (WebCore::AudioSourceProviderAVFObjC::process):
108
109 2017-06-07  Zan Dobersek  <zdobersek@igalia.com>
110
111         [GCrypt] RSA-PSS support
112         https://bugs.webkit.org/show_bug.cgi?id=172856
113
114         Reviewed by Jiewen Tan.
115
116         Implement RSA-PSS support for Web Crypto API in ports that use libgcrypt.
117
118         For the signing operation, the digest algorithm is determined and used to
119         compute the hash of the passed-in data. The given salt length and hash results
120         are embedded into a data s-expression, specifying PSS as the preferred type of
121         padding. This s-expression and the provided key are then passed to the
122         gcry_pk_sign() call which computes the signature. The MPI data of this signature
123         is retrieved and its size validated before being passed to the success callback.
124
125         For the verification operation, the hash of the passed-in data is computed as
126         before, embedding it into a data s-expression along with the specified salt
127         length. The passed-in signature data is embedded into a sig-val s-expression.
128         The two s-expressions are passed to the gcry_pk_verify() call along with the
129         key. If the returned error code for this operation is GPG_ERR_NO_ERROR the
130         verification is deemed successful, while in case of any other error code (which
131         might indicate a verification failure or an operation error) we simply signal
132         that the verification step failed (and not that it possibly errored out).
133
134         No new tests -- covered by existing tests.
135
136         * PlatformGTK.cmake: Add the new build targets.
137         * PlatformWPE.cmake: Ditto.
138         * crypto/gcrypt/CryptoAlgorithmRSA_PSSGCrypt.cpp: Added.
139         (WebCore::gcryptSign):
140         (WebCore::gcryptVerify):
141         (WebCore::CryptoAlgorithmRSA_PSS::platformSign):
142         (WebCore::CryptoAlgorithmRSA_PSS::platformVerify):
143         * crypto/gcrypt/CryptoAlgorithmRegistryGCrypt.cpp:
144         (WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms): Register the RSA-PSS algorithm.
145
146 2017-06-07  Ryosuke Niwa  <rniwa@webkit.org>
147
148         Merge TreeScopeAdopter into TreeScope
149         https://bugs.webkit.org/show_bug.cgi?id=173040
150
151         Reviewed by Antti Koivisto.
152
153         Merged TreeScopeAdopter into TreeScope since it's used by TreeScope::adoptIfNeeded.
154
155         Most of code changes are for didMoveToNewDocument taking the new document as an argument,
156         which is used by ShadowRoot::didMoveToNewDocument to update its document scope.
157
158         No new tests since there should be no behavioral change.
159
160         * CMakeLists.txt:
161         * WebCore.xcodeproj/project.pbxproj:
162         * dom/Element.cpp:
163         (WebCore::Element::didMoveToNewDocument):
164         * dom/Element.h:
165         * dom/Node.cpp:
166         (WebCore::Node::didMoveToNewDocument): Moved the code to moves the node lists and node iterators here
167         from TreeScopeAdopter::moveNodeToNewDocument.
168         * dom/Node.h:
169         * dom/ShadowRoot.cpp:
170         (WebCore::ShadowRoot::didMoveToNewDocument): Moved the code to update the document scope here
171         from TreeScopeAdopter::moveNodeToNewDocument.
172         * dom/ShadowRoot.h:
173         * dom/TreeScope.cpp:
174         (WebCore::TreeScope::adoptIfNeeded):
175         (WebCore::TreeScope::moveTreeToNewScope): Moved from TreeScopeAdopter. Now takes the old tree scope and
176         the new tree scope as arguments (they used to be members of TreeScopeAdopter). Also merged updateTreeScope
177         into this function.
178         (WebCore::TreeScope::ensureDidMoveToNewDocumentWasCalled): Moved from TreeScopeAdopter.
179         (WebCore::TreeScope::moveNodeToNewDocument): Ditto. The code to adopt node lists and node iterators have
180         been moved to Node::didMoveToNewDocument.
181         (WebCore::TreeScope::moveShadowTreeToNewDocument): Moved from TreeScopeAdopter.
182         * dom/TreeScope.h:
183         (WebCore::TreeScope::ensureDidMoveToNewDocumentWasCalled):
184         * dom/TreeScopeAdopter.cpp: Removed.
185         * dom/TreeScopeAdopter.h: Removed.
186         * html/HTMLFieldSetElement.cpp:
187         (WebCore::HTMLFieldSetElement::didMoveToNewDocument):
188         * html/HTMLFieldSetElement.h:
189         * html/HTMLFormControlElement.cpp:
190         (WebCore::HTMLFormControlElement::didMoveToNewDocument):
191         * html/HTMLFormControlElement.h:
192         * html/HTMLFormElement.cpp:
193         (WebCore::HTMLFormElement::didMoveToNewDocument):
194         * html/HTMLFormElement.h:
195         * html/HTMLImageElement.cpp:
196         (WebCore::HTMLImageElement::didMoveToNewDocument):
197         * html/HTMLImageElement.h:
198         * html/HTMLInputElement.cpp:
199         (WebCore::HTMLInputElement::didMoveToNewDocument): Grouped related function calls on new/old documents.
200         * html/HTMLInputElement.h:
201         * html/HTMLMediaElement.cpp:
202         (WebCore::HTMLMediaElement::didMoveToNewDocument):
203         * html/HTMLMediaElement.h:
204         * html/HTMLObjectElement.cpp:
205         (WebCore::HTMLObjectElement::didMoveToNewDocument):
206         * html/HTMLObjectElement.h:
207         * html/HTMLPictureElement.cpp:
208         (WebCore::HTMLPictureElement::didMoveToNewDocument):
209         * html/HTMLPictureElement.h:
210         * html/HTMLPlugInImageElement.cpp:
211         (WebCore::HTMLPlugInImageElement::didMoveToNewDocument):
212         * html/HTMLPlugInImageElement.h:
213         * html/HTMLTemplateElement.cpp:
214         (WebCore::HTMLTemplateElement::didMoveToNewDocument):
215         * html/HTMLTemplateElement.h:
216         * html/HTMLVideoElement.cpp:
217         (WebCore::HTMLVideoElement::didMoveToNewDocument):
218         * html/HTMLVideoElement.h:
219         * html/ImageDocument.cpp:
220         (WebCore::ImageDocumentElement::didMoveToNewDocument):
221         * svg/SVGImageElement.cpp:
222         (WebCore::SVGImageElement::didMoveToNewDocument):
223         * svg/SVGImageElement.h:
224         * svg/SVGSVGElement.cpp:
225         (WebCore::SVGSVGElement::didMoveToNewDocument):
226         * svg/SVGSVGElement.h:
227
228 2017-06-06  Ryosuke Niwa  <rniwa@webkit.org>
229
230         Use a dedicated node flag to identify a Document node
231         https://bugs.webkit.org/show_bug.cgi?id=173037
232
233         Reviewed by Chris Dumez.
234
235         Use a Node flag to identify a Document node instead of checking this == document() which loads TreeScope.
236
237         * dom/Document.h:
238         (WebCore::Node::isDocumentNode): Deleted.
239         * dom/Node.h:
240         (WebCore::Node::isDocumentNode):
241
242 2017-06-06  Dan Bernstein  <mitz@apple.com>
243
244         Fixed building with the macOS 10.13 Apple Internal SDK when targeting macOS 10.12.
245
246         * platform/spi/cocoa/PassKitSPI.h:
247
248 2017-06-06  Chris Dumez  <cdumez@apple.com>
249
250         Unreviewed, rolling out r214974.
251
252         Causes some tabs to start using a huge amount of CPU after 8
253         minutes in the background
254
255         Reverted changeset:
256
257         "Make inactive web processes behave as though under memory
258         pressure."
259         https://bugs.webkit.org/show_bug.cgi?id=170042
260         http://trac.webkit.org/changeset/214974
261
262 2017-06-06  Tim Horton  <timothy_horton@apple.com>
263
264         Crash trying to drag the entire text of a long book out of Mail compose view
265         https://bugs.webkit.org/show_bug.cgi?id=173042
266         <rdar://problem/32382059>
267
268         Reviewed by Simon Fraser.
269
270         Creating a TextIndicator that is hundreds of thousands of pixels tall
271         is not a good idea. We introduced TextIndicatorOptionDoNotClipToVisibleRect
272         so that (for example) an image that overhangs the edge of the page would
273         contain the entire image, instead of just the visible fragment.
274         Instead, rename this option to ExpandClipBeyondVisibleRect, and make it
275         not unclip *entirely*, but expand the clip significantly (50% in each direction)
276         beyond the bounds of the current visible rect. Also, make use of exposed
277         area information for this clipping; otherwise, clients with very large views
278         inside scrollable areas (like Mail) would still try to create large TextIndicators.
279
280         * page/TextIndicator.cpp:
281         (WebCore::initializeIndicator):
282         * page/TextIndicator.h:
283
284 2017-06-06  Chris Dumez  <cdumez@apple.com>
285
286         RELEASE_ASSERT(static_cast<size_t>(enumerationValue) < WTF_ARRAY_LENGTH(values)) hit in convertEnumerationToJS<WebCore::History::ScrollRestoration>()
287         https://bugs.webkit.org/show_bug.cgi?id=173033
288         <rdar://problem/32591099>
289
290         Reviewed by Simon Fraser.
291
292         History::scrollRestoration() was returning a bad value because HistoryItem::m_shouldRestoreScrollPosition
293         was initialized from FrameState::shouldRestoreScrollPosition member, which was not initialized when
294         restored from the legacy session restore API.
295
296         Tests: WebKit2.RestoreSessionStateContainingScrollRestoration* API tests.
297
298         * bindings/scripts/CodeGeneratorJS.pm:
299         (GenerateEnumerationImplementationContent):
300         Drop the RELEASE_ASSERT that was added to debug this and use the regular debug ASSERT.
301
302         * history/HistoryItem.cpp:
303         (WebCore::HistoryItem::setShouldRestoreScrollPosition):
304         Make sure we notify that the HistoryItem has changed when setShouldRestoreScrollPosition()
305         is called.
306
307 2017-06-06  Darin Adler  <darin@apple.com>
308
309         Update to slightly stricter rules for custom element names from more recent standard draft
310         https://bugs.webkit.org/show_bug.cgi?id=173019
311
312         Reviewed by Ryosuke Niwa.
313
314         * bindings/js/JSCustomElementRegistryCustom.cpp:
315         (WebCore::validateCustomElementNameAndThrowIfNeeded): Add more error strings for various error cases.
316
317         * dom/Document.cpp:
318         (WebCore::isPotentialCustomElementNameCharacter): Added. Implements the PCENChar production
319         from the standard by listing all the ranges exactly as they appear in the standard.
320         (WebCore::Document::validateCustomElementName): Added a check that the first character is
321         a lowercase ASCII letter. Added a check that all characters are potential custom element
322         name characters.
323
324         * dom/Document.h: Update the CustomElementNameValidationStatus with new values for
325         the various new error cases.  Not sure that validateCustomElementName really belongs
326         in the Document class in the first place. Also seems that the error strings could be
327         in validateCustomElementName rather than in a separate bindings function, obviating
328         the need for the enum.
329
330 2017-06-06  Yoav Weiss  <yoav@yoav.ws>
331
332         [preload] Conditional support for media preloading and align media `as` values.
333         https://bugs.webkit.org/show_bug.cgi?id=172501
334
335         Reviewed by Dean Jackson.
336
337         As discussed at https://bugs.webkit.org/show_bug.cgi?id=171720#c11 media preloading may not work
338         since the backend may not reuse such resources properly.
339         This patch makes support for media preloading conditional on a setting, in order to avoid double downloads in these cases.
340         It also aligns the media `as` values to the spec, and splitting them into "video" and "audio".
341
342         No new tests but related tests were modified to remove media preloading tests as the setting is off by default.
343
344         * loader/LinkLoader.cpp:
345         (WebCore::LinkLoader::resourceTypeFromAsAttribute): Make handling of MediaResource conditional on setting. Align `as` values to spec.
346         (WebCore::createLinkPreloadResourceClient): Make handling of MediaResource conditional on setting.
347         (WebCore::LinkLoader::isSupportedType): Make handling of MediaResource conditional on setting.
348         * page/RuntimeEnabledFeatures.h: Added a media preloading preference.
349         (WebCore::RuntimeEnabledFeatures::setMediaPreloadingEnabled):
350         (WebCore::RuntimeEnabledFeatures::mediaPreloadingEnabled):
351         * page/Settings.in: Added a media preloading preference.
352
353 2017-06-06  Don Olmstead  <don.olmstead@am.sony.com>
354
355         [WebCore] Enable REQUEST_ANIMATION_FRAME_TIMER for all ports
356         https://bugs.webkit.org/show_bug.cgi?id=172780
357
358         Reviewed by Alex Christensen.
359
360         No new tests. No change in behavior.
361
362         * dom/ScriptedAnimationController.cpp:
363         (WebCore::ScriptedAnimationController::ScriptedAnimationController):
364         (WebCore::ScriptedAnimationController::addThrottlingReason):
365         (WebCore::ScriptedAnimationController::removeThrottlingReason):
366         (WebCore::ScriptedAnimationController::isThrottled):
367         (WebCore::ScriptedAnimationController::interval):
368         (WebCore::ScriptedAnimationController::scheduleAnimation):
369         (WebCore::ScriptedAnimationController::displayRefreshFired):
370         * dom/ScriptedAnimationController.h:
371         * loader/EmptyClients.h:
372         * page/Chrome.cpp:
373         (WebCore::Chrome::scheduleAnimation): Deleted.
374         * page/Chrome.h:
375         * page/ChromeClient.h:
376         * platform/Curl.cmake: Added.
377         * platform/ScrollAnimationSmooth.cpp:
378         (WebCore::ScrollAnimationSmooth::ScrollAnimationSmooth):
379         (WebCore::ScrollAnimationSmooth::stop):
380         (WebCore::ScrollAnimationSmooth::animationTimerFired):
381         (WebCore::ScrollAnimationSmooth::startNextTimer):
382         (WebCore::ScrollAnimationSmooth::animationTimerActive):
383         (WebCore::ScrollAnimationSmooth::serviceAnimation): Deleted.
384         * platform/ScrollAnimationSmooth.h:
385
386 2017-06-06  Darin Adler  <darin@apple.com>
387
388         Cut down use of WTF_ARRAY_LENGTH
389         https://bugs.webkit.org/show_bug.cgi?id=172997
390
391         Reviewed by Chris Dumez.
392
393         * contentextensions/NFAToDFA.cpp: Remove unused SetTransitions class.
394
395         * dom/Document.cpp:
396         (WebCore::Document::~Document): Use modern for loop instead of WTF_ARRAY_LENGTH.
397         * dom/make_names.pl:
398         (printDefinitions): Ditto.
399         (printFactoryCppFile): Ditto.
400         (printWrapperFactoryCppFile): Ditto.
401
402         * platform/URL.cpp:
403         (WebCore::portAllowed): Use std::is_sorted, std::begin, and std::end
404         in sort assertion to greatly streamline it and eliminate use of WTF_ARRAY_LENGTH.
405         Also allow the sort assertion to run every time; slightly optimizing debug builds
406         was not worth having the code be messy.
407
408         * platform/URLParser.cpp:
409         (WebCore::URLParser::appendNumberToASCIIBuffer): Use std::end instead of
410         WTF_ARRAY_LENGTH.
411
412         * platform/graphics/FontCascade.cpp: Make fontFamiliesWithInvalidCharWidth be
413         a constant array rather than a non-constant array to constant strings.
414         (WebCore::FontCascade::hasValidAverageCharWidth): Streamline the hash table
415         initialization to avoid heap allocation and use a modern for loop instead of
416         WTF_ARRAY_LENGTH.
417
418         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
419         (WebCore::disableComponentsOnce): Use a modern for loop instead of WTF_ARRAY_LENGTH.
420         * platform/network/CacheValidation.cpp:
421         (WebCore::shouldUpdateHeaderAfterRevalidation): Ditto. Also use the
422         startsWithIgnoringASCIICase function rather than the version that folds
423         arbitrary Unicode case.
424
425         * platform/text/TextEncodingRegistry.cpp:
426         (WebCore::pruneBlacklistedCodecs): Use modern for loops to make the code considerably
427         easier to read and avoid WTF_ARRAY_LENGTH.
428
429         * platform/text/mac/LocaleMac.mm:
430         (WebCore::LocaleMac::monthLabels): Use modern for loop instead of WTF_ARRAY_LENGTH.
431         (WebCore::LocaleMac::shortMonthLabels): Ditto.
432         * rendering/RenderCombineText.cpp:
433         (WebCore::RenderCombineText::combineText): Ditto.
434
435 2017-06-06  Isaac Devine  <isaac@devinesystems.co.nz>
436
437         Allow FileReader to open files multiple times
438
439         If multiple file readers open files they are prevented by default due to
440         Windows' file locking.
441
442         Allow FileReader to open multiple files for reading at the same time on wincairo
443         https://bugs.webkit.org/show_bug.cgi?id=172632
444
445         Reviewed by Darin Adler.
446
447         * platform/win/FileSystemWin.cpp:
448         (WebCore::openFile): Use the appropriate sharing options to allow multiple opens
449
450 2017-06-06  Beth Dakin  <bdakin@apple.com>
451
452         Netflix seeking quirk should also apply to Now Playing, and should always use the 
453         livestream UI
454         https://bugs.webkit.org/show_bug.cgi?id=173030
455         -and corresponding-
456         rdar://problem/32228660
457
458         Reviewed by Darin Adler.
459
460         This patch rolls out much of https://trac.webkit.org/changeset/217791/webkit in 
461         favor of an approach that can be used to apply the quirk to Now Playing in 
462         addition to Touch Bar. This patch also changes the UI in both Touch Bar and Now 
463         Playing to match live stream UI, which means there is no playhead. This hopefully 
464         makes it less confusing that taps on the timeline will have no effect. 
465
466         supportsSeeking() should return false for Netflix. That function needs to be 
467         public now.
468         * html/HTMLMediaElement.cpp:
469         (WebCore::needsSeekingSupportQuirk):
470         (WebCore::HTMLMediaElement::supportsSeeking):
471         * html/HTMLMediaElement.h:
472
473         Here is where we get the desired result in Now Playing. Make sure the 
474         currentSession supportsSeeking() before relying on the time and duration info for 
475         the sake of Now Playing. 
476         * platform/audio/mac/MediaSessionManagerMac.mm:
477         (WebCore::MediaSessionManagerMac::updateNowPlayingInfo):
478
479         We can roll out allowsTouchBarScrubbing() and rely on supportsSeeking().
480         * platform/cocoa/WebPlaybackSessionModel.h:
481         (WebCore::WebPlaybackSessionModelClient::mutedChanged):
482         (WebCore::WebPlaybackSessionModelClient::allowsTouchBarScrubbingChanged): Deleted.
483         * platform/cocoa/WebPlaybackSessionModelMediaElement.h:
484         * platform/cocoa/WebPlaybackSessionModelMediaElement.mm:
485         (WebCore::WebPlaybackSessionModelMediaElement::updateForEventName):
486
487         And here is where we get the desired result for Touch Bar. Make sure the the media 
488         element supportsSeeking() before relying on the duration. 
489         (WebCore::WebPlaybackSessionModelMediaElement::duration):
490
491         We can roll out allowsTouchBarScrubbing() and rely on supportsSeeking().
492         (WebCore::WebPlaybackSessionModelMediaElement::allowsTouchBarScrubbing): Deleted.
493         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
494         * platform/mac/WebPlaybackControlsManager.h:
495
496         Currently the Touch Bar live stream UI lets you seek, which results in broken 
497         behavior on real live streams and on Netflix. Prevent that by preventing scrubbing 
498         for NaN and infinite durations.
499         * platform/mac/WebPlaybackControlsManager.mm:
500         (-[WebPlaybackControlsManager canBeginTouchBarScrubbing]):
501
502         We can roll out allowsTouchBarScrubbing() and rely on supportsSeeking().
503         * platform/mac/WebPlaybackSessionInterfaceMac.h:
504         * platform/mac/WebPlaybackSessionInterfaceMac.mm:
505         (WebCore::WebPlaybackSessionInterfaceMac::setPlayBackControlsManager):
506         (WebCore::WebPlaybackSessionInterfaceMac::allowsTouchBarScrubbingChanged): Deleted.
507
508 2017-06-06  Konstantin Tokarev  <annulen@yandex.ru>
509
510         Add missing <functional> includes
511         https://bugs.webkit.org/show_bug.cgi?id=173017
512
513         Patch by Thiago Macieira <thiago.macieira@intel.com>
514         Reviewed by Yusuke Suzuki.
515
516         This patch fixes compilation with GCC 7.
517
518         No new tests needed.
519
520         * css/CSSValue.h:
521         * css/StyleSheetContents.h:
522         * loader/NetscapePlugInStreamLoader.h:
523         * loader/ResourceLoader.h:
524
525 2017-06-06  Konstantin Tokarev  <annulen@yandex.ru>
526
527         Fix compilation with !ENABLE(SVG_FONTS)
528         https://bugs.webkit.org/show_bug.cgi?id=172731
529
530         Reviewed by Darin Adler.
531
532         No new tests needed.
533
534         * css/CSSFontFaceSource.cpp:
535         (WebCore::CSSFontFaceSource::load):
536
537 2017-06-06  Zalan Bujtas  <zalan@apple.com>
538
539         Safari doesn't load newest The Order of the Stick comic.
540         https://bugs.webkit.org/show_bug.cgi?id=172949
541         <rdar://problem/32389730>
542
543         Reviewed by Antti Koivisto.
544
545         As part of the table layout, RenderTableSection::layoutRows calls the RenderTableCell's layout() directly
546         (skipping the RenderTableRow parent). If during this call the RenderTableCell (or any of its descendant) marks the ancestor
547         chain dirty, this dirty flag on the RenderTableRows will never be cleared and we'll end up early returning from RenderTableSection::paint.
548         For certain type of float objects, we need to invalidate the line layout path during layout (and we mark the ancestors dirty).
549         This patch takes a conservative approach and marks the ancestors dirty only when the renderer is not dirty yet, but
550         as part of webkit.org/b/172947 we should revisit and validate whether the setNeedsLayout() is required at all.
551
552         Test: fast/table/floating-table-sibling-is-invisible.html
553
554         * rendering/RenderBlockFlow.cpp:
555         (WebCore::RenderBlockFlow::invalidateLineLayoutPath):
556
557 2017-06-06  Emilio Cobos Álvarez  <ecobos@igalia.com>
558
559         [css-conditional] The one-string version of CSS.supports should be wrapped in implied parentheses.
560         https://bugs.webkit.org/show_bug.cgi?id=172906
561
562         Reviewed by Darin Adler.
563
564         From https://drafts.csswg.org/css-conditional/#the-css-interface:
565
566         > When invoked with a single conditionText argument, it must return
567         > true if conditionText, when either parsed and evaluated as a
568         > supports_condition or parsed as a declaration, wrapped in implied
569         > parentheses, and evaluated as a supports_condition, would return
570         > true.
571
572         Note the "wrapped in implied parentheses" bit.
573
574         Gecko is fixing it in https://bugzil.la/1338486, and Blink in
575         https://crbug.com/729403.
576
577         Tests: css3/supports-dom-api.html
578                imported/w3c/web-platform-tests/cssom/CSS.html
579
580         * css/parser/CSSParser.cpp:
581         (WebCore::CSSParser::parseSupportsCondition):
582         * css/parser/CSSParserImpl.cpp:
583         (WebCore::CSSParserImpl::consumeSupportsRule):
584         * css/parser/CSSSupportsParser.cpp:
585         (WebCore::CSSSupportsParser::supportsCondition):
586         * css/parser/CSSSupportsParser.h:
587
588 2017-06-06  Joseph Pecoraro  <pecoraro@apple.com>
589
590         Move Resource Timing / User Timing from experimental features into main preferences
591         https://bugs.webkit.org/show_bug.cgi?id=172950
592
593         Reviewed by Darin Adler.
594
595         * features.json:
596         Graduate some features from In Development to Supported.
597
598 2017-06-06  Adrian Perez de Castro  <aperez@igalia.com>
599
600         [GTK][Wayland] Do not pass value of $DISPLAY to wl_display_connect()
601         https://bugs.webkit.org/show_bug.cgi?id=172993
602
603         Reviewed by Žan Doberšek.
604
605         No new tests needed.
606
607         * platform/graphics/wayland/PlatformDisplayWayland.cpp:
608         (WebCore::PlatformDisplayWayland::create): Instead of using the "DISPLAY" environment variable (meant for X11),
609         pass a null pointer to "wl_display_connect()". This function checks the value of the "WAYLAND_DISPLAY" environment
610         variable itself and therefore we do not need to pass it ourselves.
611
612 2017-06-06  Antoine Quint  <graouts@apple.com>
613
614         Rebaseline and enable media/modern-media-controls/airplay-support
615         https://bugs.webkit.org/show_bug.cgi?id=172980
616
617         Reviewed by Eric Carlson.
618
619         Fixing a small issue in the modern media controls code which would yield
620         an error when manually creating a MediaController without a MediaControlsHost.
621
622         * Modules/modern-media-controls/media/media-controller.js:
623         (MediaController.prototype.get isAudio):
624
625 2017-06-06  Antoine Quint  <graouts@apple.com>
626
627         Update modern media controls testing utilities
628         https://bugs.webkit.org/show_bug.cgi?id=172976
629         <rdar://problem/32588432>
630
631         Reviewed by Eric Carlson.
632
633         Stop logging an error when we're not able to load UI Strings since UI strings
634         are not defined in the majority of modern-media-controls tests as we load the
635         code directly from the modern-media-controls module and can't reach into the
636         English.lproj directory, nor is it necessary.
637
638         * Modules/modern-media-controls/main.js:
639         (UIString):
640
641 2017-06-06  Carlos Garcia Campos  <cgarcia@igalia.com>
642
643         [GStreamer] Use the same draw timer and mutex when AC disabled or building without OpenGL
644         https://bugs.webkit.org/show_bug.cgi?id=172923
645
646         Reviewed by Michael Catanzaro.
647
648         We have two different paths to do the same. When building without OpenGL, the VideoRenderRequestScheduler has
649         its own timer and we need to add ifdefs to handle that. But when building with OpenGL we still support
650         non-accelerated rendering that does the same than the VideoRenderRequestScheduler timer, but using the media
651         player timer instead. We can simplify the code and remove more ifdefs by using the media player timer and mutex
652         in all cases for non-accelerated rendering.
653
654         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
655         (WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase):
656         (WebCore::MediaPlayerPrivateGStreamerBase::repaint):
657         (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
658         (WebCore::MediaPlayerPrivateGStreamerBase::cancelRepaint):
659         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
660         * platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
661         (VideoRenderRequestScheduler::start):
662         (VideoRenderRequestScheduler::stop):
663         (VideoRenderRequestScheduler::requestRender):
664         (VideoRenderRequestScheduler::VideoRenderRequestScheduler): Deleted.
665         (VideoRenderRequestScheduler::render): Deleted.
666
667 2017-06-05  Antoine Quint  <graouts@apple.com>
668
669         Update media controls to match latest design specs
670         https://bugs.webkit.org/show_bug.cgi?id=172932
671
672         Reviewed by Dean Jackson.
673
674         The media controls specs have changed and we now implement them. The main controls bar now
675         appears to be floating, with a rounded corners and a margin around it. Some of the controls
676         it used to contain now may appear outside of it. Specifically, the fullscreen and
677         picture-in-picture buttons now are displayed in a dedicated controls bar in the top-left
678         corner and the mute button, on iOS (where we don't support changing the volume when inline),
679         is displayed in the top right corner.
680
681         Another small UI improvement is that we display an activity indicator when we are waiting
682         for data to initiate or resume playback instead of showing the elapsed time label. We also
683         make displaying the scrubber more important than displaying other controls, except for the
684         play/pause button, when width becomes scarce. Finally, we no longer use a speci layer type
685         for the controls bar backgrounds, we now use the same "backdrop-filter" and tint overlay
686         on both macOS and iOS.
687
688         Since this work had previously been done through WebKitAdditions, we remove the specific
689         build phase code that we added for this purpose and are now only ever looking for media
690         controls code in the WebCore source tree.
691
692         * Modules/modern-media-controls/controls/activity-indicator.css: Added.
693         (.activity-indicator):
694         (.activity-indicator > div):
695         (.activity-indicator > .ne):
696         (.activity-indicator > .e):
697         (.activity-indicator > .se):
698         (.activity-indicator > .s):
699         (.activity-indicator > .sw):
700         (.activity-indicator > .w):
701         (.activity-indicator > .nw):
702         (@keyframes activity-indicator-pulse):
703         (to):
704         * Modules/modern-media-controls/controls/airplay-button.js:
705         * Modules/modern-media-controls/controls/auto-hide-controller.js: Added.
706         (AutoHideController):
707         (AutoHideController.prototype.get fadesWhileIdle):
708         (AutoHideController.prototype.set fadesWhileIdle):
709         (AutoHideController.prototype.handleEvent):
710         (AutoHideController.prototype.gestureRecognizerStateDidChange):
711         (AutoHideController.prototype.mediaControlsFadedStateDidChange):
712         (AutoHideController.prototype.mediaControlsBecameInvisible):
713         (AutoHideController.prototype._cancelNonEnforcedAutoHideTimer):
714         (AutoHideController.prototype._cancelAutoHideTimer):
715         (AutoHideController.prototype._resetAutoHideTimer):
716         (AutoHideController.prototype._autoHideTimerFired):
717         * Modules/modern-media-controls/controls/background-click-delegate-notifier.js: Added.
718         (BackgroundClickDelegateNotifier):
719         (BackgroundClickDelegateNotifier.prototype.handleEvent):
720         * Modules/modern-media-controls/controls/background-tint.css:
721         (.background-tint,):
722         (.background-tint > .blur):
723         (.background-tint > .tint):
724         * Modules/modern-media-controls/controls/button.css:
725         (button):
726         (button > picture):
727         (button.skip-back > picture,):
728         (button.on > picture):
729         (button:active > picture):
730         (button.corner):
731         (button.center,):
732         (button.center):
733         (button.small-center):
734         (button.center > .background-tint,):
735         (button.center > picture,):
736         (button.center:active > picture,):
737         * Modules/modern-media-controls/controls/button.js:
738         (Button.prototype.get iconName):
739         (Button.prototype.set iconName):
740         (Button.prototype.get on):
741         (Button.prototype.set on):
742         (Button.prototype.get style):
743         (Button.prototype.set style):
744         (Button.prototype.get scaleFactor):
745         (Button.prototype.set scaleFactor):
746         (Button.prototype.handleEvent):
747         (Button.prototype.commit):
748         (Button.prototype._loadImage):
749         (Button.prototype._imageSourceDidLoad):
750         (Button.prototype._updateImage):
751         (Button.prototype._updateImageMetrics):
752         (Button):
753         * Modules/modern-media-controls/controls/buttons-container.css:
754         (.buttons-container):
755         (.ios .buttons-container button):
756         * Modules/modern-media-controls/controls/buttons-container.js:
757         * Modules/modern-media-controls/controls/controls-bar.css:
758         (.controls-bar):
759         (.controls-bar.faded): Deleted.
760         * Modules/modern-media-controls/controls/controls-bar.js:
761         (ControlsBar.prototype.get children):
762         (ControlsBar.prototype.set children):
763         (ControlsBar.prototype.commitProperty):
764         (ControlsBar.prototype.get userInteractionEnabled): Deleted.
765         (ControlsBar.prototype.set userInteractionEnabled): Deleted.
766         (ControlsBar.prototype.get fadesWhileIdle): Deleted.
767         (ControlsBar.prototype.set fadesWhileIdle): Deleted.
768         (ControlsBar.prototype.get visible): Deleted.
769         (ControlsBar.prototype.set visible): Deleted.
770         (ControlsBar.prototype.get faded): Deleted.
771         (ControlsBar.prototype.set faded): Deleted.
772         (ControlsBar.prototype.handleEvent): Deleted.
773         (ControlsBar.prototype.gestureRecognizerStateDidChange): Deleted.
774         (ControlsBar.prototype._cancelNonEnforcedAutoHideTimer): Deleted.
775         (ControlsBar.prototype._cancelAutoHideTimer): Deleted.
776         (ControlsBar.prototype._resetAutoHideTimer): Deleted.
777         (ControlsBar.prototype._autoHideTimerFired): Deleted.
778         * Modules/modern-media-controls/controls/fullscreen-button.js:
779         * Modules/modern-media-controls/controls/icon-button.css: Removed.
780         * Modules/modern-media-controls/controls/icon-button.js: Removed.
781         * Modules/modern-media-controls/controls/icon-service.js:
782         (const.iconService.new.IconService.prototype.imageForIconAndLayoutTraits):
783         (const.iconService.new.IconService.prototype._fileNameAndPlatformForIconAndLayoutTraits):
784         (const.iconService.new.IconService):
785         (const.iconService.new.IconService.prototype.imageForIconNameAndLayoutTraits): Deleted.
786         (const.iconService.new.IconService.prototype._fileNameAndPlatformForIconNameAndLayoutTraits): Deleted.
787         * Modules/modern-media-controls/controls/inline-layout-support.js: Removed.
788         * Modules/modern-media-controls/controls/inline-media-controls.css: Added.
789         (.media-controls.inline > .controls-bar):
790         (.media-controls.inline > .controls-bar.top-left):
791         (.media-controls.inline.audio > .controls-bar):
792         (.media-controls.inline > .controls-bar > *):
793         (.media-controls.inline > button.mute):
794         (.media-controls.inline > button.play-pause.corner):
795         (.media-controls.inline.audio > button.play-pause.corner):
796         (.media-controls.inline > .controls-bar button):
797         (.media-controls.inline button.start.center > picture,):
798         (.media-controls.inline button.start.small-center > picture,):
799         (.media-controls.inline .time-control,):
800         * Modules/modern-media-controls/controls/inline-media-controls.js: Added.
801         (InlineMediaControls):
802         (InlineMediaControls.prototype.set shouldUseAudioLayout):
803         (InlineMediaControls.prototype.set shouldUseSingleBarLayout):
804         (InlineMediaControls.prototype.get showsStartButton):
805         (InlineMediaControls.prototype.set showsStartButton):
806         (InlineMediaControls.prototype.showPlacard):
807         (InlineMediaControls.prototype.hidePlacard):
808         (InlineMediaControls.prototype.layout):
809         (InlineMediaControls.prototype.commitProperty):
810         (InlineMediaControls.prototype.get preferredMuteButtonStyle):
811         (InlineMediaControls.prototype._topLeftContainerButtons):
812         (InlineMediaControls.prototype._leftContainerButtons):
813         (InlineMediaControls.prototype._rightContainerButtons):
814         (InlineMediaControls.prototype._droppableButtons):
815         * Modules/modern-media-controls/controls/ios-inline-media-controls.css: Removed.
816         * Modules/modern-media-controls/controls/ios-inline-media-controls.js:
817         (IOSInlineMediaControls.prototype.get showsStartButton):
818         (IOSInlineMediaControls.prototype.set showsStartButton):
819         (IOSInlineMediaControls.prototype.gestureRecognizerStateDidChange):
820         (IOSInlineMediaControls.prototype._pinchGestureRecognizerStateDidChange):
821         (IOSInlineMediaControls.prototype._tapGestureRecognizerStateDidChange):
822         (IOSInlineMediaControls):
823         (IOSInlineMediaControls.prototype.layout): Deleted.
824         (IOSInlineMediaControls.prototype.layoutTraitsDidChange): Deleted.
825         * Modules/modern-media-controls/controls/layout-item.js:
826         * Modules/modern-media-controls/controls/layout-node.js:
827         (LayoutNode.prototype.commitProperty):
828         * Modules/modern-media-controls/controls/macos-compact-inline-media-controls.css: Removed.
829         * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.css:
830         (.media-controls.mac.fullscreen .buttons-container.left):
831         (.media-controls.mac.fullscreen .buttons-container.center):
832         (.media-controls.mac.fullscreen .time-control):
833         (.media-controls.mac.fullscreen > .controls-bar .status-label):
834         (.media-controls.mac.fullscreen > .controls-bar > .background-tint > div): Deleted.
835         (.media-controls.mac.fullscreen .volume.slider): Deleted.
836         (.media-controls.mac.fullscreen button.volume-down): Deleted.
837         (.media-controls.mac.fullscreen button.volume-up): Deleted.
838         (.media-controls.mac.fullscreen button.rewind): Deleted.
839         (.media-controls.mac.fullscreen button.play-pause): Deleted.
840         (.media-controls.mac.fullscreen button.forward): Deleted.
841         (.media-controls.mac.fullscreen .time-label): Deleted.
842         (.media-controls.mac.fullscreen .scrubber): Deleted.
843         * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
844         (MacOSFullscreenMediaControls.prototype.handleEvent):
845         (MacOSFullscreenMediaControls.prototype.layout):
846         (MacOSFullscreenMediaControls.prototype._handleMousedown):
847         (MacOSFullscreenMediaControls.prototype._handleMousemove):
848         * Modules/modern-media-controls/controls/macos-inline-media-controls.css:
849         (.media-controls.mac.inline .volume-slider-container):
850         (.media-controls.mac.inline.audio .volume-slider-container):
851         (.media-controls.mac.inline .volume-slider-container > .background-tint):
852         (.media-controls.mac.inline .volume-slider-container > .background-tint > div):
853         (.media-controls.mac.inline .volume-slider-container > .slider):
854         (.media-controls.mac.inline > .controls-bar): Deleted.
855         (.media-controls.mac.inline > .controls-bar > *): Deleted.
856         (.media-controls.mac.inline > button.start > div): Deleted.
857         (.media-controls.mac.inline > .controls-bar button): Deleted.
858         (.media-controls.mac.inline button.play-pause): Deleted.
859         (.media-controls.mac.inline button.skip-back): Deleted.
860         (.media-controls.mac.inline .scrubber.slider): Deleted.
861         (.media-controls.mac.inline button.mute): Deleted.
862         (.media-controls.mac.inline button.airplay): Deleted.
863         (.media-controls.mac.inline button.pip): Deleted.
864         (.media-controls.mac.inline button.tracks): Deleted.
865         (.media-controls.mac.inline button.fullscreen): Deleted.
866         (.media-controls.mac.inline .time-label,): Deleted.
867         (.media-controls.mac.inline .volume.slider): Deleted.
868         * Modules/modern-media-controls/controls/macos-inline-media-controls.js:
869         (MacOSInlineMediaControls.prototype.layout):
870         (MacOSInlineMediaControls.prototype.get preferredMuteButtonStyle):
871         (MacOSInlineMediaControls.prototype.handleEvent):
872         (MacOSInlineMediaControls.prototype.layoutTraitsDidChange): Deleted.
873         * Modules/modern-media-controls/controls/macos-media-controls.js: Removed.
874         * Modules/modern-media-controls/controls/media-controls.css:
875         (:host(audio)):
876         (*):
877         (:host(audio), *):
878         (.media-controls-container):
879         (.media-controls):
880         (.media-controls > *):
881         (.media-controls.shows-tracks-panel > .controls-bar,):
882         (.media-controls.faded > *:not(.placard)):
883         (.media-controls .time-label,):
884         * Modules/modern-media-controls/controls/media-controls.js:
885         (MediaControls.prototype.get visible):
886         (MediaControls.prototype.set visible):
887         (MediaControls.prototype.get faded):
888         (MediaControls.prototype.set faded):
889         (MediaControls.prototype.showTracksPanel):
890         (MediaControls.prototype.hideTracksPanel):
891         (MediaControls.prototype.isPointInControls):
892         (MediaControls.prototype.handleEvent):
893         (MediaControls.prototype.commitProperty):
894         (MediaControls.prototype.get layoutTraits): Deleted.
895         (MediaControls.prototype.set layoutTraits): Deleted.
896         (MediaControls.prototype.get showsStartButton): Deleted.
897         (MediaControls.prototype.set showsStartButton): Deleted.
898         (MediaControls.prototype.get placard): Deleted.
899         (MediaControls.prototype.get showsPlacard): Deleted.
900         (MediaControls.prototype.showPlacard): Deleted.
901         (MediaControls.prototype.hidePlacard): Deleted.
902         (MediaControls.prototype.controlsBarVisibilityDidChange): Deleted.
903         (MediaControls.prototype.controlsBarFadedStateDidChange): Deleted.
904         (MediaControls.prototype.layoutTraitsDidChange): Deleted.
905         (MediaControls.prototype.layout): Deleted.
906         (MediaControls.prototype._invalidateChildren): Deleted.
907         * Modules/modern-media-controls/controls/media-document.css:
908         (:host(.media-document)):
909         (:host(.media-document.audio.mac)):
910         * Modules/modern-media-controls/controls/mute-button.js:
911         * Modules/modern-media-controls/controls/pip-button.js:
912         * Modules/modern-media-controls/controls/placard.css:
913         (.placard):
914         (.placard .container):
915         (.placard button):
916         (.placard button > picture):
917         (.placard .icon): Deleted.
918         * Modules/modern-media-controls/controls/placard.js:
919         (Placard.):
920         (Placard.prototype.layout):
921         * Modules/modern-media-controls/controls/play-pause-button.js:
922         (PlayPauseButton):
923         (PlayPauseButton.prototype.commit):
924         * Modules/modern-media-controls/controls/scheduler.js:
925         (const.scheduler.new.prototype.scheduleLayout):
926         (const.scheduler.new.prototype.unscheduleLayout):
927         (const.scheduler.new.prototype._requestFrameIfNeeded):
928         (const.scheduler.new.prototype._frameDidFire):
929         (const.scheduler.new.prototype._layout):
930         * Modules/modern-media-controls/controls/scrubber.js: Removed.
931         * Modules/modern-media-controls/controls/seek-button.js:
932         * Modules/modern-media-controls/controls/skip-back-button.js:
933         * Modules/modern-media-controls/controls/skip-forward-button.js: Added.
934         (SkipForwardButton):
935         * Modules/modern-media-controls/controls/slider.css:
936         (.slider):
937         (.slider > .custom-slider,):
938         (.slider > .custom-slider):
939         (.slider > .custom-slider > *):
940         (.slider > .custom-slider > .fill):
941         (.slider > .custom-slider > .track):
942         (.slider > .custom-slider > .primary):
943         (.slider > .custom-slider > .secondary):
944         (.slider > .custom-slider > .knob):
945         (.slider > input):
946         (.slider > input::-webkit-slider-thumb):
947         (.slider.disabled > input,):
948         (.ios .slider > input):
949         (.ios .slider > input::-webkit-slider-runnable-track):
950         (.ios .slider > input::-webkit-slider-thumb):
951         (.slider > canvas,): Deleted.
952         (.slider > canvas): Deleted.
953         * Modules/modern-media-controls/controls/slider.js:
954         (Slider.prototype.set inputAccessibleLabel):
955         (Slider.prototype.get disabled):
956         (Slider.prototype.set disabled):
957         (Slider.prototype.get secondaryValue):
958         (Slider.prototype.set secondaryValue):
959         (Slider.prototype._formatTime):
960         (Slider.prototype.commitProperty):
961         (Slider.prototype.commit):
962         (Slider.prototype.draw): Deleted.
963         (addRoundedRect): Deleted.
964         * Modules/modern-media-controls/controls/start-button.css: Removed.
965         * Modules/modern-media-controls/controls/start-button.js: Removed.
966         * Modules/modern-media-controls/controls/status-label.css:
967         (.status-label):
968         * Modules/modern-media-controls/controls/status-label.js:
969         (StatusLabel.prototype.get enabled):
970         (StatusLabel.prototype.set enabled): Deleted.
971         * Modules/modern-media-controls/controls/text-tracks.css:
972         (video::-webkit-media-text-track-container):
973         (video::-webkit-media-text-track-container.visible-controls-bar):
974         (video::-webkit-media-text-track-container.visible-controls-bar.compact-controls-bar): Deleted.
975         * Modules/modern-media-controls/controls/time-control.js:
976         (TimeControl.prototype.set duration):
977         (TimeControl.prototype.set currentTime):
978         (TimeControl.prototype.get loading):
979         (TimeControl.prototype.set loading):
980         (TimeControl.prototype.get minimumWidth):
981         (TimeControl.prototype.get idealMinimumWidth):
982         (TimeControl.prototype.layout):
983         (TimeControl.prototype._performIdealLayout):
984         (TimeControl.prototype.get useSixDigitsForTimeLabels): Deleted.
985         (TimeControl.prototype.set useSixDigitsForTimeLabels): Deleted.
986         (TimeControl.prototype.get isSufficientlyWide): Deleted.
987         * Modules/modern-media-controls/controls/time-label.css:
988         (.time-label):
989         * Modules/modern-media-controls/controls/time-label.js:
990         (TimeLabel.prototype.setValueWithNumberOfDigits):
991         (TimeLabel.prototype.commitProperty):
992         (TimeLabel.prototype._formattedTime):
993         (doubleDigits):
994         (TimeLabel.prototype.set value): Deleted.
995         * Modules/modern-media-controls/controls/tracks-button.js:
996         * Modules/modern-media-controls/controls/tracks-panel.css:
997         (.tracks-panel > .scrollable-container):
998         (.tracks-panel section):
999         (.tracks-panel section > h3):
1000         (.tracks-panel > .background-tint > div,): Deleted.
1001         * Modules/modern-media-controls/controls/volume-down-button.js:
1002         * Modules/modern-media-controls/controls/volume-slider.css: Removed.
1003         * Modules/modern-media-controls/controls/volume-slider.js: Removed.
1004         * Modules/modern-media-controls/controls/volume-up-button.js:
1005         * Modules/modern-media-controls/gesture-recognizers/gesture-recognizer.js:
1006         (GestureRecognizer.prototype.gestureBegan):
1007         (GestureRecognizer.prototype._removeTrackingListeners):
1008         * Modules/modern-media-controls/gesture-recognizers/tap.js:
1009         (TapGestureRecognizer.prototype.touchesMoved):
1010         * Modules/modern-media-controls/images/iOS/Airplay.svg: Added.
1011         * Modules/modern-media-controls/images/iOS/EnterFullscreen.svg: Added.
1012         * Modules/modern-media-controls/images/iOS/MediaSelector.svg: Added.
1013         * Modules/modern-media-controls/images/iOS/MiniPipIn.svg: Added.
1014         * Modules/modern-media-controls/images/iOS/Mute.svg: Added.
1015         * Modules/modern-media-controls/images/iOS/Pause.svg: Added.
1016         * Modules/modern-media-controls/images/iOS/PipIn.svg: Added.
1017         * Modules/modern-media-controls/images/iOS/Play.svg: Added.
1018         * Modules/modern-media-controls/images/iOS/SkipBack15.svg: Added.
1019         * Modules/modern-media-controls/images/iOS/SkipForward15.svg: Added.
1020         * Modules/modern-media-controls/images/iOS/VolumeHi.svg: Added.
1021         * Modules/modern-media-controls/images/iOS/airplay@1x.png: Removed.
1022         * Modules/modern-media-controls/images/iOS/airplay@2x.png: Removed.
1023         * Modules/modern-media-controls/images/iOS/enter-fullscreen@1x.png: Removed.
1024         * Modules/modern-media-controls/images/iOS/enter-fullscreen@2x.png: Removed.
1025         * Modules/modern-media-controls/images/iOS/enter-fullscreen@3x.png: Removed.
1026         * Modules/modern-media-controls/images/iOS/interval-skip-back@1x.png: Removed.
1027         * Modules/modern-media-controls/images/iOS/interval-skip-back@2x.png: Removed.
1028         * Modules/modern-media-controls/images/iOS/interval-skip-back@3x.png: Removed.
1029         * Modules/modern-media-controls/images/iOS/pause@1x.png: Removed.
1030         * Modules/modern-media-controls/images/iOS/pause@2x.png: Removed.
1031         * Modules/modern-media-controls/images/iOS/pause@3x.png: Removed.
1032         * Modules/modern-media-controls/images/iOS/pip-in@1x.png: Removed.
1033         * Modules/modern-media-controls/images/iOS/pip-in@2x.png: Removed.
1034         * Modules/modern-media-controls/images/iOS/pip-in@3x.png: Removed.
1035         * Modules/modern-media-controls/images/iOS/play@1x.png: Removed.
1036         * Modules/modern-media-controls/images/iOS/play@2x.png: Removed.
1037         * Modules/modern-media-controls/images/iOS/play@3x.png: Removed.
1038         * Modules/modern-media-controls/images/iOS/slider-thumb@2x.png: Removed.
1039         * Modules/modern-media-controls/images/iOS/start@1x.png: Removed.
1040         * Modules/modern-media-controls/images/iOS/start@2x.png: Removed.
1041         * Modules/modern-media-controls/images/iOS/start@3x.png: Removed.
1042         * Modules/modern-media-controls/images/macOS/Airplay-fullscreen.svg: Added.
1043         * Modules/modern-media-controls/images/macOS/Airplay.svg: Added.
1044         * Modules/modern-media-controls/images/macOS/EnterFullscreen.svg: Added.
1045         * Modules/modern-media-controls/images/macOS/ExitFullscreen.svg: Added.
1046         * Modules/modern-media-controls/images/macOS/Forward.svg: Added.
1047         * Modules/modern-media-controls/images/macOS/MediaSelector-fullscreen.svg: Added.
1048         * Modules/modern-media-controls/images/macOS/MediaSelector.svg: Added.
1049         * Modules/modern-media-controls/images/macOS/Mute.svg: Added.
1050         * Modules/modern-media-controls/images/macOS/Pause.svg: Added.
1051         * Modules/modern-media-controls/images/macOS/PipIn-fullscreen.svg: Added.
1052         * Modules/modern-media-controls/images/macOS/PipIn.svg: Added.
1053         * Modules/modern-media-controls/images/macOS/Play.svg: Added.
1054         * Modules/modern-media-controls/images/macOS/Rewind.svg: Added.
1055         * Modules/modern-media-controls/images/macOS/SkipBack15.svg: Added.
1056         * Modules/modern-media-controls/images/macOS/SkipForward15.svg: Added.
1057         * Modules/modern-media-controls/images/macOS/VolumeHi.svg: Added.
1058         * Modules/modern-media-controls/images/macOS/VolumeLo.svg: Added.
1059         * Modules/modern-media-controls/images/macOS/airplay-compact@1x.png: Removed.
1060         * Modules/modern-media-controls/images/macOS/airplay-compact@2x.png: Removed.
1061         * Modules/modern-media-controls/images/macOS/airplay-fullscreen@1x.png: Removed.
1062         * Modules/modern-media-controls/images/macOS/airplay-fullscreen@2x.png: Removed.
1063         * Modules/modern-media-controls/images/macOS/airplay@1x.png: Removed.
1064         * Modules/modern-media-controls/images/macOS/airplay@2x.png: Removed.
1065         * Modules/modern-media-controls/images/macOS/enter-fullscreen-compact@1x.png: Removed.
1066         * Modules/modern-media-controls/images/macOS/enter-fullscreen-compact@2x.png: Removed.
1067         * Modules/modern-media-controls/images/macOS/enter-fullscreen@1x.png: Removed.
1068         * Modules/modern-media-controls/images/macOS/enter-fullscreen@2x.png: Removed.
1069         * Modules/modern-media-controls/images/macOS/exit-fullscreen@1x.png: Removed.
1070         * Modules/modern-media-controls/images/macOS/exit-fullscreen@2x.png: Removed.
1071         * Modules/modern-media-controls/images/macOS/forward@1x.png: Removed.
1072         * Modules/modern-media-controls/images/macOS/forward@2x.png: Removed.
1073         * Modules/modern-media-controls/images/macOS/interval-skip-back-compact@1x.png: Removed.
1074         * Modules/modern-media-controls/images/macOS/interval-skip-back-compact@2x.png: Removed.
1075         * Modules/modern-media-controls/images/macOS/interval-skip-back@1x.png: Removed.
1076         * Modules/modern-media-controls/images/macOS/interval-skip-back@2x.png: Removed.
1077         * Modules/modern-media-controls/images/macOS/media-selection-compact@1x.png: Removed.
1078         * Modules/modern-media-controls/images/macOS/media-selection-compact@2x.png: Removed.
1079         * Modules/modern-media-controls/images/macOS/media-selection-fullscreen@1x.png: Removed.
1080         * Modules/modern-media-controls/images/macOS/media-selection-fullscreen@2x.png: Removed.
1081         * Modules/modern-media-controls/images/macOS/media-selection@1x.png: Removed.
1082         * Modules/modern-media-controls/images/macOS/media-selection@2x.png: Removed.
1083         * Modules/modern-media-controls/images/macOS/pause-compact@1x.png: Removed.
1084         * Modules/modern-media-controls/images/macOS/pause-compact@2x.png: Removed.
1085         * Modules/modern-media-controls/images/macOS/pause-fullscreen@1x.png: Removed.
1086         * Modules/modern-media-controls/images/macOS/pause-fullscreen@2x.png: Removed.
1087         * Modules/modern-media-controls/images/macOS/pause@1x.png: Removed.
1088         * Modules/modern-media-controls/images/macOS/pause@2x.png: Removed.
1089         * Modules/modern-media-controls/images/macOS/pip-in-compact@1x.png: Removed.
1090         * Modules/modern-media-controls/images/macOS/pip-in-compact@2x.png: Removed.
1091         * Modules/modern-media-controls/images/macOS/pip-in-fullscreen@1x.png: Removed.
1092         * Modules/modern-media-controls/images/macOS/pip-in-fullscreen@2x.png: Removed.
1093         * Modules/modern-media-controls/images/macOS/pip-in@1x.png: Removed.
1094         * Modules/modern-media-controls/images/macOS/pip-in@2x.png: Removed.
1095         * Modules/modern-media-controls/images/macOS/play-compact@1x.png: Removed.
1096         * Modules/modern-media-controls/images/macOS/play-compact@2x.png: Removed.
1097         * Modules/modern-media-controls/images/macOS/play-fullscreen@1x.png: Removed.
1098         * Modules/modern-media-controls/images/macOS/play-fullscreen@2x.png: Removed.
1099         * Modules/modern-media-controls/images/macOS/play@1x.png: Removed.
1100         * Modules/modern-media-controls/images/macOS/play@2x.png: Removed.
1101         * Modules/modern-media-controls/images/macOS/rewind@1x.png: Removed.
1102         * Modules/modern-media-controls/images/macOS/rewind@2x.png: Removed.
1103         * Modules/modern-media-controls/images/macOS/scale-to-fill@1x.png: Removed.
1104         * Modules/modern-media-controls/images/macOS/scale-to-fill@2x.png: Removed.
1105         * Modules/modern-media-controls/images/macOS/scale-to-fit@1x.png: Removed.
1106         * Modules/modern-media-controls/images/macOS/scale-to-fit@2x.png: Removed.
1107         * Modules/modern-media-controls/images/macOS/start@1x.png: Removed.
1108         * Modules/modern-media-controls/images/macOS/start@2x.png: Removed.
1109         * Modules/modern-media-controls/images/macOS/volume-compact@1x.png: Removed.
1110         * Modules/modern-media-controls/images/macOS/volume-compact@2x.png: Removed.
1111         * Modules/modern-media-controls/images/macOS/volume-down-fullscreen@1x.png: Removed.
1112         * Modules/modern-media-controls/images/macOS/volume-down-fullscreen@2x.png: Removed.
1113         * Modules/modern-media-controls/images/macOS/volume-mute-compact@1x.png: Removed.
1114         * Modules/modern-media-controls/images/macOS/volume-mute-compact@2x.png: Removed.
1115         * Modules/modern-media-controls/images/macOS/volume-mute@1x.png: Removed.
1116         * Modules/modern-media-controls/images/macOS/volume-mute@2x.png: Removed.
1117         * Modules/modern-media-controls/images/macOS/volume-up-fullscreen@1x.png: Removed.
1118         * Modules/modern-media-controls/images/macOS/volume-up-fullscreen@2x.png: Removed.
1119         * Modules/modern-media-controls/images/macOS/volume@1x.png: Removed.
1120         * Modules/modern-media-controls/images/macOS/volume@2x.png: Removed.
1121         * Modules/modern-media-controls/js-files:
1122         * Modules/modern-media-controls/main.js:
1123         (UIString):
1124         (formatTimeByUnit):
1125         * Modules/modern-media-controls/media/audio-support.js: Added.
1126         (AudioSupport.prototype.get control):
1127         (AudioSupport.prototype.get mediaEvents):
1128         (AudioSupport.prototype.get tracksToMonitor):
1129         (AudioSupport.prototype.syncControl):
1130         (AudioSupport):
1131         * Modules/modern-media-controls/media/controls-visibility-support.js:
1132         (ControlsVisibilitySupport.prototype._updateControls):
1133         (ControlsVisibilitySupport):
1134         * Modules/modern-media-controls/media/fullscreen-support.js:
1135         (FullscreenSupport.prototype.buttonWasPressed):
1136         (FullscreenSupport.prototype.syncControl):
1137         (FullscreenSupport):
1138         (FullscreenSupport.prototype.iOSInlineMediaControlsRecognizedPinchInGesture): Deleted.
1139         * Modules/modern-media-controls/media/media-controller.js:
1140         (MediaController):
1141         (MediaController.prototype.get isAudio):
1142         (MediaController.prototype.get isYouTubeEmbedWithTitle):
1143         (MediaController.prototype.get isFullscreen):
1144         (MediaController.prototype.get layoutTraits):
1145         (MediaController.prototype.iOSInlineMediaControlsRecognizedTapGesture):
1146         (MediaController.prototype.iOSInlineMediaControlsRecognizedPinchInGesture):
1147         (MediaController.prototype._updateControlsIfNeeded):
1148         (MediaController.prototype._updateTextTracksClassList):
1149         (MediaController.prototype.controlsBarFadedStateDidChange): Deleted.
1150         * Modules/modern-media-controls/media/media-document-controller.js:
1151         (MediaDocumentController.prototype._mediaDocumentHasMetadata):
1152         * Modules/modern-media-controls/media/placard-support.js:
1153         (PlacardSupport.prototype._updatePlacard):
1154         (PlacardSupport):
1155         * Modules/modern-media-controls/media/scrubbing-support.js:
1156         (ScrubbingSupport.prototype.get mediaEvents):
1157         (ScrubbingSupport.prototype.syncControl):
1158         (ScrubbingSupport):
1159         * Modules/modern-media-controls/media/skip-back-support.js:
1160         * Modules/modern-media-controls/media/skip-forward-support.js: Added.
1161         (SkipForwardSupport.prototype.get control):
1162         (SkipForwardSupport.prototype.get mediaEvents):
1163         (SkipForwardSupport.prototype.buttonWasPressed):
1164         (SkipForwardSupport.prototype.syncControl):
1165         (SkipForwardSupport):
1166         * Modules/modern-media-controls/media/start-support.js:
1167         (StartSupport):
1168         (StartSupport.prototype.handleEvent):
1169         (StartSupport.prototype._shouldShowStartButton):
1170         (StartSupport.prototype.get control): Deleted.
1171         (StartSupport.prototype.syncControl): Deleted.
1172         * Modules/modern-media-controls/media/status-support.js:
1173         (StatusSupport.prototype.get mediaEvents):
1174         (StatusSupport.prototype.syncControl):
1175         (StatusSupport):
1176         * Modules/modern-media-controls/media/time-control-support.js: Renamed from Source/WebCore/Modules/modern-media-controls/media/time-labels-support.js.
1177         (TimeControlSupport.prototype.syncControl):
1178         (TimeControlSupport):
1179         * Modules/modern-media-controls/media/tracks-support.js:
1180         (TracksSupport.prototype.syncControl):
1181         * WebCore.xcodeproj/project.pbxproj:
1182
1183 2017-06-05  Wenson Hsieh  <wenson_hsieh@apple.com>
1184
1185         Refactor -[WebItemProviderPasteboard valuesForPasteboardType:inItemSet:] to check readable types
1186         https://bugs.webkit.org/show_bug.cgi?id=172891
1187         <rdar://problem/32204540>
1188
1189         Reviewed by Darin Adler.
1190
1191         Tweaks some logic in PlatformPasteboardIOS and WebItemProviderPasteboard to correctly construct objects in
1192         -valuesForPasteboardType:inItemSet:. Previously, we have a hard-coded map of UTI type to Class in the form of
1193         static helpers titled is{RichText, String, URL, Image, Color}Type in WebItemProviderPasteboard. We would use
1194         these functions to determine whether an NSAttributedString, NSString, NSURL, UIImage or UIColor should be
1195         constructed using the loaded item provider data. This is incorrect for some UTIs, such as public.html, which
1196         cannot actually be used to construct an NSAttributedString -- this caused -valuesForPasteboardType:inItemSet: to
1197         always return nil when attempting to create an object corresponding to public.html.
1198
1199         To fix this, we refactor -valuesForPasteboardType:inItemSet: to instead iterate through UIItemProviderReading-
1200         conformant classes in search for a class that can be created for the given UTI type. If no such class exists, we
1201         then fall back to custom WebKit handling of the dropped UTI type, which so far only includes reading an NSString
1202         with public.plain-text if the UTI is public.html (i.e. reading the HTML source from loaded item provider data).
1203
1204         Covered by 2 new API tests:
1205         DataInteractionTests.ExternalSourceHTMLToContentEditable
1206         DataInteractionTests.ExternalSourceAttributedStringToContentEditable
1207
1208         * platform/ios/PlatformPasteboardIOS.mm:
1209         (WebCore::PlatformPasteboard::stringForType):
1210         (WebCore::PlatformPasteboard::readString):
1211
1212         In some cases, -[WebItemProviderPasteboard valuesForPasteboardType:inItemSet:] may now return an
1213         NSAttributedString when an NSString was previously created. This adjusts for that possibility by returning just
1214         the plain text, -[NSAttributedString string], if the read object was an NSAttributedString.
1215
1216         * platform/ios/WebItemProviderPasteboard.mm:
1217         (allLoadableClasses):
1218         (classForTypeIdentifier):
1219         (-[WebItemProviderPasteboard valuesForPasteboardType:inItemSet:]):
1220
1221         See description above for more details.
1222
1223         (isRichTextType): Deleted.
1224         (isStringType): Deleted.
1225         (isURLType): Deleted.
1226         (isColorType): Deleted.
1227         (isImageType): Deleted.
1228
1229         Removes these heuristics that attempt to "guess" the best UIItemProviderReading class to try and load for a
1230         given UTI type.
1231
1232         * rendering/RenderText.cpp:
1233         (WebCore::RenderText::draggedContentRangesBetweenOffsets):
1234
1235         Adds a nil check to fix a debug assertion hit when running DataInteractionTests.
1236
1237 2017-06-05  Dan Bernstein  <mitz@apple.com>
1238
1239         Build fix for macOS 10.12
1240
1241         * platform/spi/cocoa/AVKitSPI.h:
1242
1243 2017-06-05  Dan Bernstein  <mitz@apple.com>
1244
1245         Tried to fix the build when targrting macOS 10.12 using the macOS 10.13 developer beta SDK.
1246
1247         * platform/mac/WebPlaybackControlsManager.h:
1248         * platform/mac/WebPlaybackControlsManager.mm:
1249         (-[WebPlaybackControlsManager togglePictureInPicture]):
1250
1251 2017-06-05  Dan Bernstein  <mitz@apple.com>
1252
1253         Tried to fix the build when targrting macOS 10.12 using the macOS 10.13 developer beta SDK.
1254
1255         * platform/spi/cocoa/AVKitSPI.h:
1256
1257 2017-06-05  Konstantin Tokarev  <annulen@yandex.ru>
1258
1259         Unreviewed, fix missing semicolon in r217795
1260
1261         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
1262         (WebCore::calculateNaturalSize):
1263
1264 2017-06-05  Jer Noble  <jer.noble@apple.com>
1265
1266         Allow clients to specify a list of codecs which should require hardware decode support.
1267         https://bugs.webkit.org/show_bug.cgi?id=172787
1268
1269         Reviewed by Alex Christensen.
1270
1271         Add a new setting, checked by HTMLMediaElement, which allows MediaPlayerPrivate implementation
1272         to require that the specified codecs have hardware support. This requirement will be supported
1273         in the normal media loading path and the MSE path on Cocoa ports.
1274
1275         * WebCore.xcodeproj/project.pbxproj:
1276         * html/HTMLMediaElement.cpp:
1277         (WebCore::HTMLMediaElement::mediaCodecsRequiringHardwareSupport):
1278         * html/HTMLMediaElement.h:
1279         * page/Settings.cpp:
1280         (WebCore::Settings::setMediaCodecsRequiringHardwareSupport):
1281         * page/Settings.h:
1282         (WebCore::Settings::mediaCodecsRequiringHardwareSupport):
1283         * platform/cocoa/VideoToolboxSoftLink.cpp:
1284         * platform/cocoa/VideoToolboxSoftLink.h:
1285         * platform/graphics/MediaPlayer.h:
1286         (WebCore::MediaPlayerClient::mediaCodecsRequiringHardwareSupport):
1287         * platform/graphics/avfoundation/objc/AVAssetTrackUtilities.h: Added.
1288         * platform/graphics/avfoundation/objc/AVAssetTrackUtilities.mm: Added.
1289         (WebCore::assetTrackMeetsHardwareDecodeRequirements):
1290         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
1291         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1292         (WebCore::MediaPlayerPrivateAVFoundationObjC::checkPlayability):
1293         (WebCore::MediaPlayerPrivateAVFoundationObjC::assetStatus):
1294         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1295         (WebCore::SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset):
1296
1297 2017-06-05  Dan Bernstein  <mitz@apple.com>
1298
1299         Tried to fix the build when targrting macOS 10.12 using the macOS 10.13 developer beta SDK.
1300
1301         * platform/mac/WebPlaybackControlsManager.mm:
1302         (-[WebPlaybackControlsManager togglePictureInPicture]):
1303
1304 2017-06-05  Dan Bernstein  <mitz@apple.com>
1305
1306         Tried to fix the build when targrting macOS 10.12 using the macOS 10.13 developer beta SDK.
1307
1308         * platform/spi/mac/AVFoundationSPI.h:
1309
1310 2017-06-05  Dan Bernstein  <mitz@apple.com>
1311
1312         Tried to fix the build when targrting macOS 10.12 using the macOS 10.13 developer beta SDK.
1313
1314         * platform/spi/cocoa/IOSurfaceSPI.h:
1315
1316 2017-06-05  Konstantin Tokarev  <annulen@yandex.ru>
1317
1318         Fix MediaPlayerPrivateMediaFoundation::naturalSize
1319         https://bugs.webkit.org/show_bug.cgi?id=172908
1320
1321         Reviewed by Alex Christensen.
1322
1323         MediaPlayerPrivateMediaFoundation::naturalSize should return size of
1324         video frame corrected by PAR, not size of video element.
1325
1326         No new tests needed.
1327
1328         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
1329         (WebCore::MediaPlayerPrivateMediaFoundation::load):
1330         (WebCore::MediaPlayerPrivateMediaFoundation::naturalSize):
1331         (WebCore::MediaPlayerPrivateMediaFoundation::setNaturalSize):
1332         (WebCore::calculateNaturalSize):
1333         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::setMediaType):
1334         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
1335
1336 2017-06-05  Zalan Bujtas  <zalan@apple.com>
1337
1338         Destroy the associated renderer subtree when display: contents node is deleted.
1339         https://bugs.webkit.org/show_bug.cgi?id=172920
1340         <rdar://problem/32446045>
1341
1342         Reviewed by Antti Koivisto.
1343
1344         Since display: contents node does not create a renderer, we need to explicitly check
1345         and distinguish it from the display: none case.
1346
1347         Covered by existing tests.
1348
1349         * dom/ContainerNode.cpp:
1350         (WebCore::destroyRenderTreeIfNeeded):
1351         * dom/Node.cpp:
1352         (WebCore::Node::~Node): Promote ASSERT(!renderer()) to ASSERT_WITH_SECURITY_IMPLICATION.
1353         * dom/Text.cpp:
1354         (WebCore::Text::~Text): Redundant assert. Text is a Node.
1355
1356 2017-06-05  Beth Dakin  <bdakin@apple.com>
1357
1358         Modify Netflix controlsManager quirk to prevent only scrubbing
1359         https://bugs.webkit.org/show_bug.cgi?id=172881
1360         -and corresponding-
1361         rdar://problem/32228660
1362
1363         Reviewed by Andy Estes.
1364
1365         Instead of preventing Netflix from getting a controlsManager at all, this patch 
1366         ONLY prevents touch bar scrubbing from working. This means that Netflix will now 
1367         get controls in the TouchBar, it means that the play/pause and PiP buttons will be 
1368         functional, and it means that the timeline will accurately represent the current 
1369         time, BUT users will not be able to use the timeline to scrub the video. This also 
1370         allows Netflix to work with other MediaRemote clients such as AirPods.
1371
1372         Remove the quirk code from here, since this is no longer the right place to test 
1373         if the MediaElement is hosted at Netflix.
1374         * html/HTMLMediaElement.cpp:
1375         (WebCore::HTMLMediaElement::bestMediaElementForShowingPlaybackControlsManager):
1376         (WebCore::needsPlaybackControlsManagerQuirk): Deleted.
1377
1378         Pass around a new bool allowsTouchBarScrubbing.
1379         * platform/cocoa/WebPlaybackSessionModel.h:
1380         (WebCore::WebPlaybackSessionModelClient::allowsTouchBarScrubbingChanged):
1381         * platform/cocoa/WebPlaybackSessionModelMediaElement.h:
1382
1383         Here’s where we check if we need quirky behavior.
1384         * platform/cocoa/WebPlaybackSessionModelMediaElement.mm:
1385         (WebCore::WebPlaybackSessionModelMediaElement::updateForEventName):
1386         (WebCore::WebPlaybackSessionModelMediaElement::allowsTouchBarScrubbing):
1387
1388         Return the bool we have plumbed through tracking whether the current site 
1389         allowsTouchBarScrubbing from the existing delegate method 
1390         canBeginTouchBarScrubbing. We will always return NO for video elements on Netflix, 
1391         and this will prevent users from be able to scrub with the TouchBar on Netflix.
1392         * platform/mac/WebPlaybackControlsManager.h:
1393         * platform/mac/WebPlaybackControlsManager.mm:
1394         (-[WebPlaybackControlsManager canBeginTouchBarScrubbing]):
1395
1396         More plumbing.
1397         * platform/mac/WebPlaybackSessionInterfaceMac.h:
1398         * platform/mac/WebPlaybackSessionInterfaceMac.mm:
1399         (WebCore::WebPlaybackSessionInterfaceMac::allowsTouchBarScrubbingChanged):
1400         (WebCore::WebPlaybackSessionInterfaceMac::setPlayBackControlsManager):
1401
1402 2017-06-05  Carlos Garcia Campos  <cgarcia@igalia.com>
1403
1404         [GStreamer] Deadlock in MediaPlayerPrivateGStreamer::changePipelineState, web process often locks up on seeking in a youtube video that has already fully buffered
1405         https://bugs.webkit.org/show_bug.cgi?id=170003
1406
1407         Reviewed by Michael Catanzaro.
1408
1409         When video sink is requested to render a frame, the GstBaseSink preroll mutex is taken. Then WebKit media player
1410         schedules a repaint in the main thread, taking the draw mutex and waiting on draw condition. It can happen that
1411         before the repaint is done in the main thread, a pause is requested in the main thread, causing a change state
1412         from PLAYING to PAUSE. When the change state reaches the video sink gst_base_sink_change_state() tries to get
1413         the preroll mutex. This causes a deadlock because the main thread is waiting to get the preroll mutex, but the
1414         other thread is waiting for the main thread to do the repaint. GStreamer handles this case by calling unlock()
1415         on the video sink before trying to get the preroll mutex, but the media player doesn't cancel the pending
1416         repaint when using coordinated graphics. This patch adds a new signal to WebKitVideoSink "repaint-cancelled" to
1417         notify the media player to cancel the pending prepaint.
1418
1419         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1420         (WebCore::MediaPlayerPrivateGStreamerBase::cancelRepaint): Release the draw mutex and notify the condition.
1421         (WebCore::MediaPlayerPrivateGStreamerBase::repaintCancelledCallback): Call cancelRepaint().
1422         (WebCore::MediaPlayerPrivateGStreamerBase::createVideoSink): Connect to WebKitVideoSink::repaint-cancelled.
1423         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
1424         * platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
1425         (webkitVideoSinkRepaintCancelled): Emit WebKitVideoSink::repaint-cancelled.
1426         (webkitVideoSinkUnlock): Call webkitVideoSinkRepaintCancelled().
1427         (webkitVideoSinkStop): Ditto.
1428         (webkit_video_sink_class_init): Add WebKitVideoSink::repaint-cancelled signal.
1429
1430 2017-06-05  Carlos Garcia Campos  <cgarcia@igalia.com>
1431
1432         [GStreamer] Cleanup ifdefs in MediaPlayerPrivateGStreamerBase
1433         https://bugs.webkit.org/show_bug.cgi?id=172918
1434
1435         Reviewed by Michael Catanzaro.
1436
1437         The code in MediaPlayerPrivateGStreamerBase is quite difficult to follow with all the ifdefs for the
1438         possibilities when rendering. Some of them are even dead code now that all ports using GStreamer are using also
1439         coordinated graphics.
1440
1441         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1442         (WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase):
1443         (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
1444         (WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor):
1445         (WebCore::MediaPlayerPrivateGStreamerBase::repaint):
1446         (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
1447         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
1448         * platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
1449         (VideoRenderRequestScheduler::VideoRenderRequestScheduler):
1450         (VideoRenderRequestScheduler::stop):
1451         (VideoRenderRequestScheduler::requestRender):
1452         (webkitVideoSinkRequestRender):
1453
1454 2017-06-05  Carlos Garcia Campos  <cgarcia@igalia.com>
1455
1456         Unreviewed. Fix compile warning when building GTK+ port without OpenGL.
1457
1458         * platform/graphics/texmap/BitmapTexturePool.cpp:
1459         (WebCore::BitmapTexturePool::createTexture):
1460
1461 2017-06-05  Miguel Gomez  <magomez@igalia.com>
1462
1463         [GTK][WPE] Do not force video sample's buffer release when the platformLayerProxy is inactive
1464         https://bugs.webkit.org/show_bug.cgi?id=172916
1465
1466         Reviewed by Carlos Garcia Campos.
1467
1468         When MediaPlayerPrivateGStreamerBase's plarformLayerProxy was inactive, a copy of the video sample
1469         was being done (without the buffer) and set, causing the sample's buffer to get freed. This was done
1470         to avoid stalling the gstreamer pipeline in situations where the video was set to display:none, as the
1471         platformLayerProxy would keep all the available buffers. But this can't happen nowadays as setting
1472         the video to display:none invalidates the proxy, causing it to release the references to the
1473         gstreamer buffers it's using. Also, the current code is causing a crash when using gstreamer-gl and
1474         the video is hidden but its contents are being painted through webgl or an accelerated canvas. So,
1475         remove this sample copy as it's not necessary anymore.
1476
1477         Covered by existent tests.
1478
1479         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1480         (WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor):
1481
1482 2017-06-05  Miguel Gomez  <magomez@igalia.com>
1483
1484         [GTK][WPE] Fix the condition to decide whether the MediaPlayer can be rendered accelerated
1485         https://bugs.webkit.org/show_bug.cgi?id=172852
1486
1487         Reviewed by Michael Catanzaro.
1488
1489         Before this change, in order to determine whether the MediaPlayer rendering could be accelerated we
1490         needed the player to have a renderer or it would return false. The renderer was needed in order to
1491         access the RenderLayerCompositor and check whether the chrome would be overwriting the accelerated
1492         compositing setting. But we don't have that option in WebKitGTK+ or WPE, so we can just check the
1493         accelerated compositing setting directly.
1494
1495         Another problems with the approach before this change is that accelerated rendering was being disabled
1496         when the video element was not visible, as there's no video renderer. Due to this, cases where the video
1497         is painted through an accelerated canvas or webgl would not be using hardware accelerated copies.
1498
1499         Covered by existent tests.
1500
1501         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1502         (WebCore::MediaPlayerPrivateGStreamerBase::acceleratedRenderingStateChanged):
1503
1504 2017-06-04  Simon Fraser  <simon.fraser@apple.com>
1505
1506         Percentages are calculated wrong in SVG transform CSS property
1507         https://bugs.webkit.org/show_bug.cgi?id=172901
1508
1509         Reviewed by Zalan Bujtas.
1510         
1511         The code added in r217236 was just fetching viewBox(), but that can be empty.
1512         SVGLengthContext::determineViewport() does the correct thing to get
1513         the appropriate viewport.
1514
1515         Test: svg/transforms/percent-transform-values-viewbox.html
1516
1517         * svg/SVGGraphicsElement.cpp:
1518         (WebCore::SVGGraphicsElement::animatedLocalTransform):
1519
1520 2017-06-04  Eric Carlson  <eric.carlson@apple.com>
1521
1522         [MediaStream] Page capture state not reported correctly
1523         https://bugs.webkit.org/show_bug.cgi?id=172897
1524         <rdar://problem/32493318>
1525
1526         Reviewed by Youenn Fablet.
1527
1528         Test: fast/mediastream/media-stream-track-muted.html
1529
1530         * Modules/mediastream/MediaStream.cpp:
1531         (WebCore::MediaStream::mediaState): Test for audio and video mute on the tracks.
1532         (WebCore::MediaStream::characteristicsChanged): Call statusDidChange when m_mediaState
1533         changes instead of m_muted, so the page is informed when just audio or video mute state
1534         changes.
1535         * Modules/mediastream/MediaStream.h:
1536
1537         * testing/Internals.cpp:
1538         (WebCore::Internals::setMediaStreamTrackMuted): New.
1539         * testing/Internals.h:
1540         * testing/Internals.idl:
1541
1542 2017-06-03  Darin Adler  <darin@apple.com>
1543
1544         Streamline handling of attributes, using references as much as possible
1545         https://bugs.webkit.org/show_bug.cgi?id=172899
1546
1547         Reviewed by Chris Dumez.
1548
1549         * accessibility/AccessibilityNodeObject.cpp:
1550         (WebCore::AccessibilityNodeObject::valueForRange): Use reference to value of
1551         attribute instead of copy to avoid reference count churn.
1552         (WebCore::AccessibilityNodeObject::maxValueForRange): Ditto.
1553         (WebCore::AccessibilityNodeObject::minValueForRange): Ditto.
1554         * accessibility/AccessibilitySVGElement.cpp:
1555         (WebCore::AccessibilitySVGElement::childElementWithMatchingLanguage): Ditto.
1556         (WebCore::AccessibilitySVGElement::accessibilityDescription): Ditto.
1557         * css/PropertySetCSSStyleDeclaration.cpp:
1558         (WebCore::StyleAttributeMutationScope::StyleAttributeMutationScope): Ditto.
1559
1560         * editing/cocoa/DataDetection.mm:
1561         (WebCore::DataDetection::shouldCancelDefaultAction): Use the
1562         equalLettersIgnoringASCIICase function instead of using
1563         both equalIgnoringASCIICase and convertToASCIILowercase.
1564
1565         * html/HTMLAudioElement.cpp:
1566         (WebCore::HTMLAudioElement::HTMLAudioElement): Marked this inline since we
1567         want it inlined the one place it's used.
1568         (WebCore::HTMLAudioElement::create): Use auto and named the local variable
1569         just element.
1570         (WebCore::HTMLAudioElement::createForJSConstructor): Call create rather than
1571         repeating the code from create. Use setAttributeWithoutSynchronization directly
1572         rather than calling helper functions. Removed unneeded null check;
1573         setAttributeWithoutSynchronization handles null by removing the attribute.
1574         * html/HTMLAudioElement.h: Changed src argument of createForJSConstructor to
1575         take AtomicString since that is what we need for an attribute value.
1576         * html/HTMLAudioElement.idl: Use [AtomicString] for src argument.
1577
1578         * html/HTMLElement.cpp:
1579         (WebCore::HTMLElement::directionality): Use reference to value of
1580         attribute instead of copy to avoid reference count churn.
1581         (WebCore::HTMLElement::shouldAutocorrect): Ditto.
1582
1583         * html/HTMLImageElement.cpp:
1584         (WebCore::HTMLImageElement::bestFitSourceFromPictureElement): Call the new
1585         parsedMediaAttribute instead of the old mediaQuerySet function. Other than the
1586         name, the only change is that the result is now a const pointer.
1587
1588         * html/HTMLInputElement.cpp:
1589         (WebCore::HTMLInputElement::updateType): Removed unnecessary local variable,
1590         resulting in code that is slightly cleaner and possibly eliminating reference
1591         count chrun.
1592
1593         * html/HTMLMediaElement.cpp:
1594         (WebCore::HTMLMediaElement::setSrc): Deleted.
1595         (WebCore::HTMLMediaElement::selectNextSourceChild): Use parsedMediaAttribute and
1596         removed rendudant direct check of whether mediaAttr is present. Changed logging to
1597         get the media attribute directly rather than with a helper function. Changed type
1598         to get the type attribute directly rather than with a helper function.
1599         (WebCore::HTMLMediaElement::sourceWasAdded): Take a reference rather than a pointer.
1600         (WebCore::HTMLMediaElement::sourceWasRemoved): Ditto.
1601         (WebCore::HTMLMediaElement::doesHaveAttribute): Use reference to value of
1602         attribute instead of copy to avoid reference count churn.
1603         * html/HTMLMediaElement.h: Updated for the above.
1604
1605         * html/HTMLSourceElement.cpp:
1606         (WebCore::HTMLSourceElement::insertedInto): Pass reference instead of pointer.
1607         (WebCore::HTMLSourceElement::removedFrom): Ditto.
1608         (WebCore::HTMLSourceElement::setSrc): Deleted.
1609         (WebCore::HTMLSourceElement::media): Deleted.
1610         (WebCore::HTMLSourceElement::setMedia): Deleted.
1611         (WebCore::HTMLSourceElement::type): Deleted.
1612         (WebCore::HTMLSourceElement::setType): Deleted.
1613         (WebCore::HTMLSourceElement::parseAttribute): Clear out m_cachedParsedMediaAttribute.
1614         This makes the parsing be lazy. The old code would parse the attribute value to make
1615         a MediaQuerySet here, but we do it in parsedMediaAttribute now.
1616         (WebCore::HTMLSourceElement::parsedMediaAttribute): Added. Creates a MediaQuerySet
1617         if needed, and returns it or null.
1618         * html/HTMLSourceElement.h: Removed include of MediaList.h. Removed unneeded media,
1619         type, setSrc, setMedia, and setType functions. Replaced the mediaQuerySet function
1620         with the parsedMediaAttribute, which returns a const pointer rather than non-const,
1621         and is also non-inline because it lazily creates the MediaQuerySet as needed. Replaced
1622         m_mediaQuerySet with m_cachedParsedMediaAttribute.
1623         * html/HTMLSourceElement.idl: Use [Reflect] for both type and media.
1624
1625         * html/MediaDocument.cpp: Modernize the MediaDocumentParser constructor.
1626         (WebCore::MediaDocumentParser::createDocumentStructure): Instead of setSrc, use
1627         setAttributeWithoutSynchronization for the src attribute just as we do for all the
1628         other attributes of the newly created video element.
1629
1630         * html/MediaElementSession.cpp:
1631         (WebCore::MediaElementSession::wirelessVideoPlaybackDisabled): Use reference to
1632         value of attribute instead of copy to avoid reference count churn.
1633         * loader/FrameLoader.cpp:
1634         (WebCore::FrameLoader::defaultSubstituteDataForURL): Ditto.
1635         * rendering/RenderThemeIOS.mm:
1636         (WebCore::getAttachmentProgress): Ditto.
1637         * rendering/RenderThemeMac.mm:
1638         (WebCore::AttachmentLayout::layOutSubtitle): Ditto.
1639         (WebCore::RenderThemeMac::paintAttachment): Ditto.
1640         * svg/SVGHKernElement.cpp:
1641         (WebCore::SVGHKernElement::buildHorizontalKerningPair): Ditto.
1642         * svg/SVGVKernElement.cpp:
1643         (WebCore::SVGVKernElement::buildVerticalKerningPair): Ditto.
1644         * svg/animation/SVGSMILElement.cpp:
1645         (WebCore::SVGSMILElement::buildPendingResource): Ditto. Also use parentElement
1646         instead of writing out code that does exactly what it does.
1647
1648 2017-06-03  Sam Weinig  <sam@webkit.org>
1649
1650         Can't use Object.defineProperty() to add an item to a DOMStringMap or Storage
1651         https://bugs.webkit.org/show_bug.cgi?id=172687
1652
1653         Reviewed by Darin Adler.
1654
1655         - Adds support for generating the defineOwnProperty ClassInfo method table hook
1656           to add support for Object.defineProperty(). The implementation follows WebIDL
1657           section 3.9.3 [[DefineOwnProperty]].
1658           (https://heycam.github.io/webidl/#legacy-platform-object-defineownproperty)
1659         - Adds support for generating named setters in addition to the already supported
1660           indexed setters as much of the required work was needed to make defineOwnProperty
1661           work for those properties. This patch does not aim to follow WebIDL faithfully,
1662           but rather to generate as close to the custom code as possible. A follow up 
1663           change will attempt to match WebIDL more closely (which will also require changes
1664           to [[GetOwnPropertySlot]]).
1665         - Removes the need for custom bindings in DOMStringMap, HTMLOptionsCollection and
1666           HTMLSelectElement. Gets us one function away from supporting Storage.
1667         - Tidies up generated headers a bit by grouping all the ClassInfo method table hooks
1668           together.
1669         - Removes support for CustomIndexedSetter, which is no longer used.
1670
1671         Test: js/dom/legacy-platform-object-defineOwnProperty.html
1672
1673         * CMakeLists.txt:
1674         * WebCore.xcodeproj/project.pbxproj:
1675         * bindings/js/JSBindingsAllInOne.cpp:
1676         Removed now unneeded custom bindings.
1677
1678         * bindings/js/JSDOMStringMapCustom.cpp: Removed.
1679         * bindings/js/JSHTMLOptionsCollectionCustom.cpp: Removed.
1680         * bindings/js/JSHTMLSelectElementCustom.cpp: Removed.
1681         * bindings/js/JSHTMLSelectElementCustom.h: Removed.
1682         * bindings/js/JSStorageCustom.cpp:
1683         (WebCore::JSStorage::putDelegate): Deleted.
1684         Remove more code that is now generated.
1685
1686         * bindings/scripts/CodeGeneratorJS.pm:
1687         (GenerateIndexedGetter):
1688         - Add missing check for indexed setter operation when determining if the property should be ReadOnly.
1689         - Add support for custom implementation name, matching GenerateNamedGetter.
1690         - Convert to taking an outputArray and indent to allow more flexibility going forward.
1691
1692         (GenerateNamedGetter):
1693         - Add missing check for named setter operation when determining if the property should be ReadOnly.
1694         - Convert to taking an outputArray and indent to allow more flexibility going forward.
1695
1696         (GenerateGetOwnPropertySlotBody):
1697         - Convert to taking an outputArray and indent to allow more flexibility going forward.
1698         - Take over responsibility for checking and bailing if CustomGetOwnPropertySlot is set.
1699
1700         (GenerateGetOwnPropertySlotBodyByIndex):
1701         - Convert to taking an outputArray and indent to allow more flexibility going forward.
1702         - Take over responsibility for checking and bailing if CustomGetOwnPropertySlotByIndex is set.
1703
1704         (GenerateGetOwnPropertyNames):
1705         - Convert to taking an outputArray and indent to allow more flexibility going forward.
1706         - Take over responsibility for checking and bailing if CustomEnumerateProperty is set.
1707
1708         (GenerateInvokeIndexedPropertySetter):
1709         Added. Implements the 'invoke an indexed property setter' algorithm (https://heycam.github.io/webidl/#invoke-indexed-setter)
1710
1711         (GenerateInvokeNamedPropertySetter):
1712         Added. Implements the 'invoke a named property setter' algorithm (https://heycam.github.io/webidl/#invoke-named-setter)
1713
1714         (GeneratePut):
1715         (GeneratePutByIndex):
1716         - Convert to taking an outputArray and indent to allow more flexibility going forward.
1717         - Take over responsibility for checking and bailing if CustomPut is set.
1718         - Adds support for CEReactions.
1719         - Adopts GenerateInvokeIndexedPropertySetter and GenerateInvokeNamedPropertySetter to
1720           simplify code.
1721         - Removes support for CustomIndexedSetter, which is no longer used.
1722         - Replaces use direct checking of OverrideBuiltins with check if any interface it inherits
1723           has it, which is how it is specified to work.
1724
1725         (GenerateIsUnforgeablePropertyName):
1726         Added. Helper subroutine to generate a function that compares a property name
1727         agains all the property names defined as Unforgeable on the interface. Used by
1728         GenerateDefineOwnProperty.
1729
1730         (GenerateDefineOwnProperty):
1731         Added. Implements section 3.9.3 [[DefineOwnProperty]] (https://heycam.github.io/webidl/#legacy-platform-object-defineownproperty)
1732         Adds support for CEReactions.
1733
1734         (GenerateDeletePropertyCommon):
1735         Switch from getting OverrideBuiltins directly off the interface to using InheritsExtendedAttribute.
1736
1737         (GenerateNamedDeleterDefinition):
1738         Switch signature to match peer generators.
1739
1740         (InstanceOverridesGetOwnPropertySlot):
1741         Update for rename of JSCustomGetOwnPropertySlotAndDescriptor to CustomGetOwnPropertySlotAndDescriptor.
1742
1743         (InstanceOverridesGetOwnPropertySlotByIndex):
1744         Added. Like InstanceOverridesGetOwnPropertySlot, but checks for the new CustomGetOwnPropertySlotByIndex 
1745         rather than CustomGetOwnPropertySlot.
1746
1747         (InstanceOverridesGetOwnPropertyNames):
1748         Added. Moves complex predicate out of line.
1749
1750         (InstanceOverridesPut):
1751         Removes now unused CustomIndexedSetter, and adds CustomPutFunction, which used to be checked separately.
1752
1753         (InstanceOverridesDefineOwnProperty):
1754         Added.
1755
1756         (GenerateHeader):
1757         - Moves more structure flags together.
1758         - Simplifies predicates and moves the ClassInfo method table hooks together.
1759
1760         (GenerateImplementation):
1761         - Moves the ClassInfo method table hooks together
1762         - Adds call to GenerateDefineOwnProperty.
1763
1764         (GenerateLegacyCallerDefinitions):
1765         Simplify bail condition to match other generators.
1766
1767         (GeneratePrototypeDeclaration):
1768         Update for new extended attribute names.
1769
1770         (InstanceOverridesCall): 
1771         Renamed from IsCallable for consistency.
1772         
1773         (HasComplexGetOwnProperty): 
1774         Deleted. Unused.
1775         
1776         (InstanceOverridesPutImplementation): 
1777         Deleted. Unused.
1778         
1779         (InstanceOverridesPutDeclaration): 
1780         Deleted. Unused.
1781         
1782         (IsCallable): 
1783         Renamed, for consistency, to InstanceOverridesCall .
1784
1785         * bindings/scripts/IDLAttributes.json:
1786         Renames a few of the extended attributes to remove the JS prefix. This time
1787         around I only did the ones in the area I was working, but we should probably
1788         remove most of the rest.
1789     
1790         * css/CSSStyleDeclaration.idl:
1791         Update for JSCustomGetOwnPropertySlotAndDescriptor -> CustomGetOwnPropertySlotAndDescriptor rename.
1792
1793         * dom/DOMStringMap.idl:
1794         Remove CustomNamedSetter and add uncomment out the setter.
1795
1796         * dom/DatasetDOMStringMap.cpp:
1797         (WebCore::DatasetDOMStringMap::setNamedItem):
1798         (WebCore::DatasetDOMStringMap::setItem): Deleted.
1799         * dom/DatasetDOMStringMap.h:
1800         Rename setItem to setNamedItem, which is what the generator expects.
1801
1802         * dom/Node.idl:
1803         Update for JSCustomPushEventHandlerScope -> CustomPushEventHandlerScope rename.
1804
1805         * html/HTMLAppletElement.idl:
1806         * html/HTMLEmbedElement.idl:
1807         * html/HTMLObjectElement.idl:
1808         Update for JSCustomGetOwnPropertySlotAndDescriptor -> CustomGetOwnPropertySlotAndDescriptor rename.
1809
1810         * html/HTMLCollection.cpp:
1811         (WebCore::HTMLCollection::isSupportedPropertyName):
1812         * html/HTMLCollection.h:
1813         Add isSupportedPropertyName function which is used by the bindings and is now needed.
1814
1815         * html/HTMLElement.idl:
1816         Update for JSCustomPushEventHandlerScope -> CustomPushEventHandlerScope rename.
1817
1818         * html/HTMLOptionsCollection.h:
1819         (WebCore::HTMLOptionsCollection::setItem):
1820         Add setItem() implementation which just forwards to the select element. Also, add 
1821         a type alias to make the implementations of item and namedItem less verbose.
1822
1823         * html/HTMLOptionsCollection.idl:
1824         Remove CustomIndexedSetter and uncomment the setter.
1825
1826         * html/HTMLSelectElement.idl:
1827         Remove CustomIndexedSetter and uncomment the setter. Also, reformat
1828         to match the WHATWG spec.
1829
1830         * page/DOMWindow.idl:
1831         Update for JSCustomDefineOwnProperty -> CustomDefineOwnProperty rename. Add 
1832         CustomGetOwnPropertySlotByIndex which is now needed to remove some unsound
1833         assumptions the generator was making.
1834
1835         * page/Location.idl:
1836         Update for removal of JS prefix from a bunch of extended attributes.
1837
1838         * page/UserMessageHandlersNamespace.idl:
1839         Update for JSCustomGetOwnPropertySlotAndDescriptor -> CustomGetOwnPropertySlotAndDescriptor rename.
1840
1841         * storage/Storage.idl:
1842         Remove CustomNamedSetter and uncomment the setter.
1843
1844         * bindings/scripts/test/JS/JSInterfaceName.h:
1845         * bindings/scripts/test/JS/JSTestEventTarget.h:
1846         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp: Added.
1847         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.h: Added.
1848         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp: Added.
1849         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.h: Added.
1850         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp: Added.
1851         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.h: Added.
1852         * bindings/scripts/test/JS/JSTestInterface.cpp:
1853         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp: Added.
1854         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.h: Added.
1855         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp: Added.
1856         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.h: Added.
1857         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp: Added.
1858         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.h: Added.
1859         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.h:
1860         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.h:
1861         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
1862         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.h:
1863         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.h:
1864         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp: Added.
1865         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.h: Added.
1866         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp: Added.
1867         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.h: Added.
1868         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp: Added.
1869         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.h: Added.
1870         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp: Added.
1871         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.h: Added.
1872         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp: Added.
1873         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.h: Added.
1874         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp: Added.
1875         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.h: Added.
1876         * bindings/scripts/test/JS/JSTestObj.cpp:
1877         * bindings/scripts/test/JS/JSTestObj.h:
1878         * bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
1879         * bindings/scripts/test/TestIndexedSetterNoIdentifier.idl: Added.
1880         * bindings/scripts/test/TestIndexedSetterThrowingException.idl: Added.
1881         * bindings/scripts/test/TestIndexedSetterWithIdentifier.idl: Added.
1882         * bindings/scripts/test/TestNamedAndIndexedSetterNoIdentifier.idl: Added.
1883         * bindings/scripts/test/TestNamedAndIndexedSetterThrowingException.idl: Added.
1884         * bindings/scripts/test/TestNamedAndIndexedSetterWithIdentifier.idl: Added.
1885         * bindings/scripts/test/TestNamedDeleterWithIdentifier.idl:
1886         * bindings/scripts/test/TestNamedSetterNoIdentifier.idl: Added.
1887         * bindings/scripts/test/TestNamedSetterThrowingException.idl: Added.
1888         * bindings/scripts/test/TestNamedSetterWithIdentifier.idl: Added.
1889         * bindings/scripts/test/TestNamedSetterWithOverrideBuiltins.idl: Added.
1890         * bindings/scripts/test/TestNamedSetterWithUnforgableProperties.idl: Added.
1891         * bindings/scripts/test/TestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.idl: Added.
1892         Added new tests and updated some results.
1893
1894 2017-06-04  Simon Fraser  <simon.fraser@apple.com>
1895
1896         Object bounding box wrong for some paths
1897         https://bugs.webkit.org/show_bug.cgi?id=172866
1898
1899         Reviewed by Tim Horton.
1900         
1901         RenderSVGShape::calculateObjectBoundingBox() should use boundingRect()
1902         rather than fastBoundingRect(), because the latter includes control points.
1903
1904         Covered by existing tests.
1905
1906         * rendering/svg/RenderSVGShape.cpp:
1907         (WebCore::RenderSVGShape::calculateObjectBoundingBox):
1908
1909 2017-06-04  Konstantin Tokarev  <annulen@yandex.ru>
1910
1911         Fix build of Windows-specific code with ICU 59.1
1912         https://bugs.webkit.org/show_bug.cgi?id=172729
1913
1914         Reviewed by Darin Adler.
1915
1916         Fix conversions from WTF::String to wchar_t* and vice versa.
1917         No new tests needed.
1918
1919         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
1920         (WebCore::mimeTypeCache):
1921         (WebCore::MediaPlayerPrivateMediaFoundation::startCreateMediaSource):
1922
1923 2017-06-04  Chris Dumez  <cdumez@apple.com>
1924
1925         Implement DOMMatrixReadOnly.transformPoint()
1926         https://bugs.webkit.org/show_bug.cgi?id=172900
1927
1928         Reviewed by Simon Fraser.
1929
1930         Implement DOMMatrixReadOnly.transformPoint():
1931         - https://drafts.fxtf.org/geometry/#dommatrixreadonly
1932         - https://drafts.fxtf.org/geometry/#dom-dommatrixreadonly-transformpoint
1933
1934         Test: imported/blink/fast/dom/geometry-interfaces-dom-matrix-transformPoint.html
1935
1936         * css/DOMMatrixReadOnly.cpp:
1937         (WebCore::DOMMatrixReadOnly::transformPoint):
1938         * css/DOMMatrixReadOnly.h:
1939         * css/DOMMatrixReadOnly.idl:
1940
1941 2017-06-04  Zan Dobersek  <zdobersek@igalia.com>
1942
1943         [GCrypt] Improve comments in AES, PBKDF2, RSA-SSA algorithm implementations
1944         https://bugs.webkit.org/show_bug.cgi?id=172894
1945
1946         Reviewed by Michael Catanzaro.
1947
1948         Add or improve code comments in libgcrypt implementations for the AES_CBC,
1949         AES_GCM, AES_KW, PBKDF2 and RSA-SSA algorithms.
1950
1951         * crypto/gcrypt/CryptoAlgorithmAES_CBCGCrypt.cpp: Add generic comments that
1952         describe each operation that's performed.
1953         (WebCore::gcryptEncrypt):
1954         (WebCore::gcryptDecrypt):
1955         * crypto/gcrypt/CryptoAlgorithmAES_GCMGCrypt.cpp: Ditto.
1956         (WebCore::gcryptEncrypt):
1957         (WebCore::gcryptDecrypt):
1958         * crypto/gcrypt/CryptoAlgorithmAES_KWGCrypt.cpp: Ditto.
1959         (WebCore::gcryptWrapKey):
1960         (WebCore::gcryptUnwrapKey):
1961         * crypto/gcrypt/CryptoAlgorithmPBKDF2GCrypt.cpp: Ditto.
1962         (WebCore::gcryptDeriveBits):
1963         * crypto/gcrypt/CryptoAlgorithmRSASSA_PKCS1_v1_5GCrypt.cpp:
1964         (WebCore::gcryptVerify): Align the verification results comment with the
1965         one that's used in the ECDSA implementation.
1966
1967 2017-06-03  Chris Dumez  <cdumez@apple.com>
1968
1969         Implement DOMMatrix's fromFloat32Array / fromFloat64Array & toFloat32Array / toFloat64Array
1970         https://bugs.webkit.org/show_bug.cgi?id=172898
1971
1972         Reviewed by Sam Weinig.
1973
1974         Implement DOMMatrix's fromFloat32Array / fromFloat64Array & toFloat32Array / toFloat64Array
1975         as per:
1976         - https://drafts.fxtf.org/geometry/#dommatrixreadonly
1977
1978         Test: http/wpt/geometry/DOMMatrix-from-to-typed-arrays.html
1979
1980         * css/DOMMatrix.cpp:
1981         (WebCore::DOMMatrix::fromFloat32Array):
1982         (WebCore::DOMMatrix::fromFloat64Array):
1983         * css/DOMMatrix.h:
1984         * css/DOMMatrix.idl:
1985         * css/DOMMatrixReadOnly.cpp:
1986         (WebCore::DOMMatrixReadOnly::fromFloat32Array):
1987         (WebCore::DOMMatrixReadOnly::fromFloat64Array):
1988         (WebCore::DOMMatrixReadOnly::toFloat32Array):
1989         (WebCore::DOMMatrixReadOnly::toFloat64Array):
1990         * css/DOMMatrixReadOnly.h:
1991         * css/DOMMatrixReadOnly.idl:
1992
1993 2017-06-03  Simon Fraser  <simon.fraser@apple.com>
1994
1995         Implement DOMPointReadOnly.matrixTransform()
1996         https://bugs.webkit.org/show_bug.cgi?id=172896
1997
1998         Reviewed by Chris Dumez.
1999
2000         DOMPointReadOnly.matrixTransform() creates the matrix or throws, then uses
2001         a new function in TransformationMatrix to map x,y,z,w through the matrix.
2002
2003         Test: http/wpt/geometry/DOMPoint-003.html
2004
2005         * CMakeLists.txt:
2006         * WebCore.xcodeproj/project.pbxproj:
2007         * css/DOMMatrixReadOnly.h:
2008         (WebCore::DOMMatrixReadOnly::transformationMatrix):
2009         * dom/DOMPointReadOnly.cpp: Copied from Source/WebCore/dom/DOMPointReadOnly.idl.
2010         (WebCore::DOMPointReadOnly::matrixTransform):
2011         * dom/DOMPointReadOnly.h:
2012         * dom/DOMPointReadOnly.idl:
2013         * platform/graphics/transforms/TransformationMatrix.cpp:
2014         (WebCore::TransformationMatrix::map4ComponentPoint):
2015         * platform/graphics/transforms/TransformationMatrix.h:
2016
2017 2017-06-03  Myles C. Maxfield  <mmaxfield@apple.com>
2018
2019         Cleanup arguments to preparePlatformFont() and fontWithFamily() in FontCacheCoreText.cpp
2020         https://bugs.webkit.org/show_bug.cgi?id=172886
2021
2022         Reviewed by Simon Fraser.
2023
2024         The number of arguments is getting out of control.
2025
2026         No new tests because there is no behavior change.
2027
2028         * platform/graphics/FontCache.h:
2029         * platform/graphics/cocoa/FontCacheCoreText.cpp:
2030         (WebCore::preparePlatformFont):
2031         (WebCore::fontWithFamily):
2032         (WebCore::FontCache::createFontPlatformData):
2033         (WebCore::FontCache::systemFallbackForCharacters):
2034         * platform/graphics/mac/FontCacheMac.mm:
2035         (WebCore::platformFontWithFamilySpecialCase):
2036         * platform/graphics/mac/FontCustomPlatformData.cpp:
2037         (WebCore::FontCustomPlatformData::fontPlatformData):
2038         * platform/spi/cocoa/CoreTextSPI.h:
2039
2040 2017-06-03  Yusuke Suzuki  <utatane.tea@gmail.com>
2041
2042         Script modules should be able to import data urls
2043         https://bugs.webkit.org/show_bug.cgi?id=171594
2044
2045         Reviewed by Youenn Fablet.
2046
2047         Tests: js/dom/classic-script-with-data-url.html
2048                js/dom/modules/module-script-with-data-url.html
2049
2050         Script tag resources should have SameOriginDataURLFlag::Set to load data URLs
2051         since script tags should treat data URLs as same origin.
2052
2053         * bindings/js/CachedScriptFetcher.cpp:
2054         (WebCore::CachedScriptFetcher::requestScriptWithCache):
2055
2056 2017-06-03  Simon Fraser  <simon.fraser@apple.com>
2057
2058         Sort the project file.
2059
2060         * WebCore.xcodeproj/project.pbxproj:
2061
2062 2017-06-03  Zan Dobersek  <zdobersek@igalia.com>
2063
2064         [GCrypt] Gather SUBTLE_CRYPTO utility functions in a single header
2065         https://bugs.webkit.org/show_bug.cgi?id=172870
2066
2067         Reviewed by Jiewen Tan.
2068
2069         Gather the helper functions used across different source files
2070         for libgcrypt-backed SUBTLE_CRYPTO implementations in a single
2071         header file.
2072
2073         * crypto/gcrypt/CryptoAlgorithmECDSAGCrypt.cpp:
2074         (WebCore::hashCryptoDigestAlgorithm): Deleted.
2075         (WebCore::hashAlgorithmName): Deleted.
2076         (WebCore::mpiData): Deleted.
2077         * crypto/gcrypt/CryptoAlgorithmHKDFGCrypt.cpp:
2078         (WebCore::gcryptDeriveBits):
2079         (WebCore::macAlgorithmForHashFunction): Deleted.
2080         * crypto/gcrypt/CryptoAlgorithmPBKDF2GCrypt.cpp:
2081         (WebCore::gcryptDeriveBits):
2082         * crypto/gcrypt/CryptoAlgorithmRSAES_PKCS1_v1_5GCrypt.cpp:
2083         (WebCore::mpiData): Deleted.
2084         * crypto/gcrypt/CryptoAlgorithmRSASSA_PKCS1_v1_5GCrypt.cpp:
2085         (WebCore::hashCryptoDigestAlgorithm): Deleted.
2086         (WebCore::hashAlgorithmName): Deleted.
2087         (WebCore::mpiData): Deleted.
2088         * crypto/gcrypt/CryptoAlgorithmRSA_OAEPGCrypt.cpp:
2089         (WebCore::hashAlgorithmName): Deleted.
2090         (WebCore::mpiData): Deleted.
2091         * crypto/gcrypt/GCryptUtilities.h: Added.
2092         (WebCore::hashAlgorithmName):
2093         (WebCore::hmacAlgorithm):
2094         (WebCore::digestAlgorithm):
2095         (WebCore::hashCryptoDigestAlgorithm):
2096         (WebCore::mpiData):
2097
2098 2017-06-03  Zan Dobersek  <zdobersek@igalia.com>
2099
2100         [GCrypt] Fix PK verification for ECDSA
2101         https://bugs.webkit.org/show_bug.cgi?id=172857
2102
2103         Reviewed by Michael Catanzaro.
2104
2105         No new tests -- covered by existing tests.
2106
2107         * crypto/gcrypt/CryptoAlgorithmECDSAGCrypt.cpp:
2108         (WebCore::gcryptVerify): Return `true` if the verification succeeded or `false`
2109         in any other case, avoiding spilling information about the exact cause of
2110         verification failure.
2111
2112 2017-06-02  Zalan Bujtas  <zalan@apple.com>
2113
2114         Cleanup FrameView::autoSizeIfEnabled.
2115         https://bugs.webkit.org/show_bug.cgi?id=172889
2116         <rdar://problem/32550783>
2117
2118         Reviewed by Tim Horton.
2119
2120         This patch ensures that we always have a clean tree (and a valid and current document size) when
2121         setting m_autoSizeContentSize. 
2122
2123         * page/FrameView.cpp:
2124         (WebCore::FrameView::autoSizeIfEnabled):
2125
2126 2017-06-02  Wenson Hsieh  <wenson_hsieh@apple.com>
2127
2128         REGRESSION(r216212): RenderReplaced::paint() should not save and restore the context unless it has to
2129         https://bugs.webkit.org/show_bug.cgi?id=172883
2130         <rdar://problem/32548614>
2131
2132         Reviewed by Tim Horton.
2133
2134         After implementing dragged content fading, RenderReplace::paint is now always guarded by unnecessary calls to
2135         GraphicsContext::save and GraphicsContext::restore, even when there is no dragged content being rendered. To
2136         address this, we initialize our GraphicsContextStateSaver with saveAndRestore = false, indicating that we don't
2137         want to immediately try and save the context.
2138
2139         If we are in a dragged content range, we will then call GraphicsContextStateSaver::save, which saves the
2140         graphics context and also causes the GraphicsContextStateSaver to eventually try and restore() when it is
2141         destroyed. Otherwise, in the common codepath where the renderer is not in a dragged content range, the
2142         constructor and destructor of GraphicsContextStateSaver will be no-ops with respect to saving and restoring the
2143         graphics context.
2144
2145         * rendering/RenderReplaced.cpp:
2146         (WebCore::RenderReplaced::paint):
2147
2148 2017-06-02  Myles C. Maxfield  <mmaxfield@apple.com>
2149
2150         REGRESSION(r213464): [iOS] Fonts get too bold when the "Bold Text" accessibility setting is enabled
2151         https://bugs.webkit.org/show_bug.cgi?id=172737
2152
2153         Reviewed by Simon Fraser.
2154
2155         Revert the part of r213464 which changed how we calculate the weights of system fonts.
2156
2157         Add an InternalSetting to trigger our mock of the accessbility "Bold Text" setting. We can't
2158         use the real setting, so instead we just ask for bold fonts instead of regular fonts when this
2159         setting is true.
2160
2161         Tests: fast/text/accessibility-bold-system-font.html
2162                fast/text/accessibility-bold-system-font-2.html
2163
2164         * platform/graphics/FontCache.h:
2165         (WebCore::FontCache::shouldMockBoldSystemFontForAccessibility):
2166         (WebCore::FontCache::setShouldMockBoldSystemFontForAccessibility):
2167         * platform/graphics/ios/FontCacheIOS.mm:
2168         (WebCore::platformFontWithFamilySpecialCase):
2169         * rendering/RenderTheme.h:
2170         (WebCore::RenderTheme::shouldMockBoldSystemFontForAccessibility):
2171         (WebCore::RenderTheme::setShouldMockBoldSystemFontForAccessibility):
2172         * rendering/RenderThemeIOS.h:
2173         * rendering/RenderThemeIOS.mm:
2174         (WebCore::cssWeightOfSystemFont):
2175         (WebCore::RenderThemeIOS::updateCachedSystemFontDescription):
2176         * testing/InternalSettings.cpp:
2177         (WebCore::InternalSettings::Backup::Backup):
2178         (WebCore::InternalSettings::Backup::restoreTo):
2179         (WebCore::InternalSettings::setShouldMockBoldSystemFontForAccessibility):
2180         * testing/InternalSettings.h:
2181         * testing/InternalSettings.idl:
2182
2183 2017-06-02  Brady Eidson  <beidson@apple.com>
2184
2185         Prevent scheme handlers from handling all built-in URL schemes.
2186         <rdar://problem/32404790> and https://bugs.webkit.org/show_bug.cgi?id=172869
2187
2188         Reviewed by Andy Estes.
2189
2190         Covered by API test.
2191
2192         This patch refactors SchemeRegistry to keep a base, constant set of each of the special
2193         URL schemes that WebKit knows about by default.
2194         
2195         It then exposes that list through a new method to support WK2 API.
2196
2197         * platform/SchemeRegistry.cpp:
2198         (WebCore::allBuiltinSchemes):
2199         (WebCore::builtinLocalURLSchemes):
2200         (WebCore::localURLSchemes):
2201         (WebCore::builtinSecureSchemes):
2202         (WebCore::secureSchemes):
2203         (WebCore::builtinSchemesWithUniqueOrigins):
2204         (WebCore::schemesWithUniqueOrigins):
2205         (WebCore::builtinEmptyDocumentSchemes):
2206         (WebCore::emptyDocumentSchemes):
2207         (WebCore::builtinCanDisplayOnlyIfCanRequestSchemes):
2208         (WebCore::canDisplayOnlyIfCanRequestSchemes):
2209         (WebCore::SchemeRegistry::removeURLSchemeRegisteredAsLocal):
2210         (WebCore::builtinCORSEnabledSchemes):
2211         (WebCore::CORSEnabledSchemes):
2212         (WebCore::SchemeRegistry::isBuiltinScheme):
2213         * platform/SchemeRegistry.h:
2214
2215 2017-06-02  Simon Fraser  <simon.fraser@apple.com>
2216
2217         All scroll peformance logging should happen in the UI process
2218         https://bugs.webkit.org/show_bug.cgi?id=172874
2219         rdar://problem/24474830
2220
2221         Reviewed by Tim Horton.
2222
2223         Printing to stdout from the WebProcess doesn't show up anywhere in non-development builds,
2224         so we have to log from the UI process.
2225
2226         Achieve this by adding a PerformanceLoggingClient to Page which forwards messages to
2227         WebPageProxy, which prints them with the same format they had before. Some plumbing through
2228         PlatformCALayerClient and GraphicsLayerClient is required to get messages from TileControllers
2229         through to something that can get to Page.
2230
2231         * WebCore.xcodeproj/project.pbxproj:
2232         * page/Page.cpp:
2233         (WebCore::Page::Page):
2234         (WebCore::Page::~Page):
2235         * page/Page.h:
2236         (WebCore::Page::performanceLoggingClient):
2237         * page/PageConfiguration.cpp:
2238         * page/PageConfiguration.h:
2239         * page/PerformanceLoggingClient.cpp: Added.
2240         (WebCore::PerformanceLoggingClient::synchronousScrollingReasonsAsString):
2241         * page/PerformanceLoggingClient.h: Added.
2242         (WebCore::PerformanceLoggingClient::~PerformanceLoggingClient):
2243         * page/scrolling/AsyncScrollingCoordinator.cpp:
2244         (WebCore::AsyncScrollingCoordinator::reportExposedUnfilledArea):
2245         (WebCore::AsyncScrollingCoordinator::reportSynchronousScrollingReasonsChanged):
2246         * page/scrolling/AsyncScrollingCoordinator.h:
2247         * page/scrolling/ScrollingTree.h:
2248         (WebCore::ScrollingTree::reportSynchronousScrollingReasonsChanged):
2249         (WebCore::ScrollingTree::reportExposedUnfilledArea):
2250         * page/scrolling/ThreadedScrollingTree.cpp:
2251         (WebCore::ThreadedScrollingTree::reportSynchronousScrollingReasonsChanged):
2252         (WebCore::ThreadedScrollingTree::reportExposedUnfilledArea):
2253         * page/scrolling/ThreadedScrollingTree.h:
2254         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
2255         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
2256         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):
2257         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPosition):
2258         (WebCore::ScrollingTreeFrameScrollingNodeMac::exposedUnfilledArea):
2259         (WebCore::ScrollingTreeFrameScrollingNodeMac::logExposedUnfilledArea): Deleted.
2260         (WebCore::logThreadedScrollingMode): Deleted.
2261         * platform/graphics/GraphicsLayerClient.h:
2262         (WebCore::GraphicsLayerClient::logFilledVisibleFreshTile):
2263         * platform/graphics/ca/GraphicsLayerCA.cpp:
2264         (WebCore::GraphicsLayerCA::platformCALayerLogFilledVisibleFreshTile):
2265         * platform/graphics/ca/GraphicsLayerCA.h:
2266         * platform/graphics/ca/PlatformCALayerClient.h:
2267         (WebCore::PlatformCALayerClient::platformCALayerLogFilledVisibleFreshTile):
2268         * platform/graphics/ca/TileController.cpp:
2269         (WebCore::TileController::logFilledVisibleFreshTile):
2270         * platform/graphics/ca/TileController.h:
2271         * platform/graphics/ca/TileGrid.cpp:
2272         (WebCore::TileGrid::platformCALayerPaintContents):
2273         * platform/graphics/ca/TileGrid.h:
2274         * rendering/RenderLayerBacking.cpp:
2275         (WebCore::RenderLayerBacking::logFilledVisibleFreshTile):
2276         * rendering/RenderLayerBacking.h:
2277
2278 2017-06-02  Eric Carlson  <eric.carlson@apple.com>
2279
2280         [MediaStream iOS] Cleanup video muting/unmuting when tab visibility changes
2281         https://bugs.webkit.org/show_bug.cgi?id=172858
2282
2283         Reviewed by Youenn Fablet.
2284
2285         Test: platform/ios/mediastream/video-muted-in-background-tab.html
2286
2287         * dom/Document.cpp:
2288         (WebCore::Document::visibilityStateChanged): Call notifyMediaCaptureOfVisibilityChanged.
2289         (WebCore::Document::notifyMediaCaptureOfVisibilityChanged): Renamed from notifyVisibilityChangedToMediaCapture.
2290         Set m_videoCaptureMutedForVisibilityChange when capture is muted because the document is hidden,
2291         and clear it when visibility changes when capture is disabled. Don't unmute when the document
2292         becomes visible unless this m_videoCaptureMutedForVisibilityChange is still true.
2293         (WebCore::Document::notifyVisibilityChangedToMediaCapture): Deleted.
2294         * dom/Document.h:
2295
2296         * platform/mediastream/RealtimeMediaSource.h:
2297         * platform/mediastream/RealtimeMediaSourceCenter.cpp:
2298         (WebCore::RealtimeMediaSourceCenter::setVideoCaptureMutedForPageVisibility): Renamed from
2299         setVisibility.
2300         (WebCore::RealtimeMediaSourceCenter::setVisibility): Deleted.
2301         * platform/mediastream/RealtimeMediaSourceCenter.h:
2302
2303         * platform/mediastream/mac/AVVideoCaptureSource.mm:
2304         (WebCore::AVVideoCaptureSourceFactory::setVideoCaptureMutedForPageVisibility): Ditto.
2305         (WebCore::AVVideoCaptureSourceFactory::setVisibility): Deleted.
2306
2307         * platform/mock/MockRealtimeVideoSource.cpp:
2308         (WebCore::MockRealtimeVideoSourceFactory::setVideoCaptureMutedForPageVisibility): Ditto.
2309         (WebCore::MockRealtimeVideoSourceFactory::setVisibility): Deleted.
2310
2311 2017-06-02  Frederic Wang  <fwang@igalia.com>
2312
2313         [Mac] Include frames in the scrolling tree when ScrollingTreeIncludesFrames=true
2314         https://bugs.webkit.org/show_bug.cgi?id=172825
2315
2316         Reviewed by Simon Fraser.
2317
2318         This commit generalizes RenderLayerCompositor/ScrollingCoordinator so that it handles the
2319         case of non-main frames. When ScrollingTreeIncludesFrames=true, all the frames will appear
2320         in the scrolling tree on Mac WK2.
2321
2322         Test: fast/scrolling/scrolling-tree-includes-frame.html
2323
2324         * page/scrolling/ScrollingCoordinator.cpp:
2325         (WebCore::ScrollingCoordinator::coordinatesScrollingForFrameView): Do not to restrict to the
2326         main frame.
2327         * rendering/RenderLayerCompositor.cpp:
2328         (WebCore::RenderLayerCompositor::updateBacking): Do not to restrict to the main frame.
2329         (WebCore::RenderLayerCompositor::useCoordinatedScrollingForLayer): Make this function a class
2330         member so it can call hasCoordinatedScrolling and no longer needs a RenderView parameter.
2331         (WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus): Do not to restrict to the
2332         main frame.
2333         * rendering/RenderLayerCompositor.h: Introduce useCoordinatedScrollingForLayer.
2334
2335 2017-06-02  Don Olmstead  <don.olmstead@am.sony.com>
2336
2337         [WebCore] DragImageRef should correspond to USE(CAIRO)
2338         https://bugs.webkit.org/show_bug.cgi?id=172863
2339
2340         Reviewed by Carlos Alberto Lopez Perez.
2341
2342         No new tests. No change in behavior.
2343
2344         * platform/DragImage.h:
2345
2346 2017-06-02  Frederic Wang  <fwang@igalia.com>
2347
2348         [Mac] Use compositing for frames when ScrollingTreeIncludesFrames=true
2349         https://bugs.webkit.org/show_bug.cgi?id=172851
2350
2351         Reviewed by Simon Fraser.
2352
2353         When fast frame scrolling is supported on mac (bug 171667), scrollable frames will require
2354         special composited layer. This commit enables that on mac but only when
2355         ScrollingTreeIncludesFrames=true, so that the default behavior is unchanged.
2356
2357         Test: compositing/iframes/compositing-for-scrollable-iframe.html
2358
2359         * rendering/RenderLayerCompositor.cpp:
2360         (WebCore::RenderLayerCompositor::requiresCompositingForScrollableFrame): Do not enable frame
2361         compositing when ScrollingTreeIncludesFrames=false.
2362         Rename ScrollableInnerFrameTrigger to ScrollableNonMainFrameTrigger.
2363         * page/ChromeClient.h: Rename ScrollableInnerFrameTrigger.
2364
2365 2017-06-02  Simon Fraser  <simon.fraser@apple.com>
2366
2367         Get <chrono> out of StdLibExtras.h
2368         https://bugs.webkit.org/show_bug.cgi?id=172744
2369
2370         Reviewed by Zalan Bujtas.
2371
2372         Only bring in <chrono> and namespace std::literals::chrono_literals when necessary.
2373
2374         * fileapi/FileReader.cpp:
2375         * inspector/InspectorOverlay.cpp:
2376         * loader/CrossOriginPreflightResultCache.cpp:
2377         * loader/cache/CachedResource.cpp:
2378         (WebCore::CachedResource::freshnessLifetime):
2379         * page/ResourceUsageThread.cpp:
2380         (WebCore::ResourceUsageThread::threadBody):
2381         * page/cocoa/MemoryReleaseCocoa.mm:
2382         (WebCore::jettisonExpensiveObjectsOnTopLevelNavigation):
2383         * platform/network/CacheValidation.cpp:
2384         (WebCore::computeFreshnessLifetimeForHTTPFamily):
2385         * platform/network/CacheValidation.h:
2386
2387 2017-06-02  Andy Estes  <aestes@apple.com>
2388
2389         [Cocoa] Add a "supportedCountries" property to ApplePayPaymentRequest
2390         https://bugs.webkit.org/show_bug.cgi?id=172832
2391         <rdar://problem/30735544>
2392
2393         Reviewed by Alex Christensen.
2394
2395         Test: http/tests/ssl/applepay/ApplePaySessionV3.html
2396
2397         * Modules/applepay/ApplePayPaymentRequest.h:
2398         * Modules/applepay/ApplePayPaymentRequest.idl:
2399         * Modules/applepay/ApplePaySession.cpp:
2400         (WebCore::convertAndValidate):
2401         * Modules/applepay/PaymentRequest.h:
2402         (WebCore::PaymentRequest::supportedCountries):
2403         (WebCore::PaymentRequest::setSupportedCountries):
2404         * Modules/applepay/PaymentRequestValidator.cpp:
2405         (WebCore::PaymentRequestValidator::validate):
2406         * platform/spi/cocoa/PassKitSPI.h:
2407
2408 2017-06-02  Devin Rousso  <drousso@apple.com>
2409
2410         Web Inspector: Should see active Web Sockets when opening Web Inspector
2411         https://bugs.webkit.org/show_bug.cgi?id=172312
2412
2413         Reviewed by Joseph Pecoraro.
2414
2415         Test: http/tests/websocket/tests/hybi/inspector/before-load.html
2416
2417         * Modules/websockets/WebSocket.h:
2418         * Modules/websockets/WebSocket.cpp:
2419         (WebCore::WebSocket::WebSocket):
2420         (WebCore::WebSocket::~WebSocket):
2421         (WebCore::WebSocket::allActiveWebSockets):
2422         (WebCore::WebSocket::allActiveWebSocketsMutex):
2423         (WebCore::WebSocket::channel):
2424         (WebCore::WebSocket::eventTargetInterface):
2425         Add a static set of all WebSocket objects and provide getters to access web socket metadata.
2426
2427         * Modules/websockets/ThreadableWebSocketChannel.h:
2428         (WebCore::ThreadableWebSocketChannel::isWebSocketChannel):
2429         * Modules/websockets/WebSocketChannel.h:
2430         * Modules/websockets/WebSocketChannel.cpp:
2431         (WebCore::WebSocketChannel::isWebSocketChannel):
2432         (WebCore::WebSocketChannel::identifier):
2433         (WebCore::WebSocketChannel::clientHandshakeRequest):
2434         (WebCore::WebSocketChannel::serverHandshakeResponse):
2435         (WebCore::WebSocketChannel::handshakeMode):
2436         (WebCore::WebSocketChannel::isType):
2437         Provide getters to access web socket metadata.
2438
2439         * inspector/InspectorNetworkAgent.cpp:
2440         (WebCore::InspectorNetworkAgent::enable):
2441         Loops over the static set of all WebSocket objects and sends events for each to the frontend.
2442
2443 2017-06-02  Chris Dumez  <cdumez@apple.com>
2444
2445         Unreviewed, fix linking errors on iOS after r217712.
2446
2447         * platform/OrientationNotifer.h:
2448         (WebCore::OrientationNotifier::Observer::setNotifier):
2449
2450 2017-06-02  Chris Dumez  <cdumez@apple.com>
2451
2452         Crash under OrientationNotifier::Observer::setNotifier()
2453         https://bugs.webkit.org/show_bug.cgi?id=172847
2454         <rdar://problem/32519127>
2455
2456         Reviewed by Youenn Fablet.
2457
2458         Update OrientationNotifier::Observer::setNotifier() to unregister itself from
2459         its current notifier if it already has one. This is needed because
2460         Internals::setCameraMediaStreamTrackOrientation() may be used to override the
2461         notifier of an observer. If we override the notifier without unregistering
2462         the observer from its previous notifier, then the previous notifier will not
2463         get notified when the observer gets destroyed.
2464
2465         No new tests, already covered by webrtc/video-rotation.html that is currently
2466         failing on some bots.
2467
2468         * platform/OrientationNotifer.h:
2469         (WebCore::OrientationNotifier::Observer::setNotifier):
2470
2471 2017-06-02  Javier Fernandez  <jfernandez@igalia.com>
2472
2473         [css-grid] Logical margin incorrectly applied during the tracks sizing algorithm of auto tracks
2474         https://bugs.webkit.org/show_bug.cgi?id=172836
2475
2476         Reviewed by Manuel Rego Casasnovas.
2477
2478         When computing min-content and max-content of the content-sized tracks
2479         we are using the marginIntrinsicLogicalWidthForChild function, which
2480         uses the grid's writing-mode to determine wether to use the child's
2481         margin width or height. This is not correct when the grid item is
2482         orthogonal.
2483
2484         This patch changes how we compute the tracks width so we use always
2485         the item's marginLogicalWidth, which depends only on its own writing
2486         mode.
2487
2488         Test: fast/css-grid-layout/grid-track-sizing-with-margins-and-orthogonal-flows.html
2489
2490         * rendering/GridTrackSizingAlgorithm.cpp:
2491         (WebCore::GridTrackSizingAlgorithmStrategy::minContentForChild):
2492         (WebCore::GridTrackSizingAlgorithmStrategy::maxContentForChild):
2493
2494 2017-06-02  Emilio Cobos Álvarez  <ecobos@igalia.com>
2495
2496         Invalidate the shadow subtree style when slotted pseudo rules are present.
2497         https://bugs.webkit.org/show_bug.cgi?id=172822
2498
2499         Reviewed by Antti Koivisto.
2500
2501         No new tests, this is tested by
2502         fast/shadow-dom/css-scoping-slot-with-id.html, once we don't force an
2503         Inherit style change for slots. I could add some more tests for stuff
2504         with descendant combinators and similar I guess, though.
2505
2506         * style/AttributeChangeInvalidation.cpp:
2507         (WebCore::Style::AttributeChangeInvalidation::invalidateStyle):
2508         * style/ClassChangeInvalidation.cpp:
2509         (WebCore::Style::ClassChangeInvalidation::invalidateStyle):
2510         * style/IdChangeInvalidation.cpp:
2511         (WebCore::Style::IdChangeInvalidation::invalidateStyle):
2512
2513 2017-06-02  Miguel Gomez  <magomez@igalia.com>
2514
2515         [GTK+][WPE] Allow TextureMapperShaderProgram to perform colorspace conversions with the source texture pixels
2516         https://bugs.webkit.org/show_bug.cgi?id=172749
2517
2518         Reviewed by Žan Doberšek.
2519
2520         Currently TextureMapperGL is only able to paint properly textures that are in RGBA format. There are
2521         situations where we will want it to be able to handle other formats (for example BGRA for gstreamer-gl).
2522         To make this possible without having to perform the color conversion in the CPU, we add a new color
2523         conversion matrix to TextureMapperShaderProgram. This matrix will perform the color space conversion
2524         in the GPU, just after sampling the source texture.
2525
2526         Also, add a new flag to TextureMapperGL to indicate that a color conversion is required to handle a
2527         texture. This flag will be set to the TextureMapperPlatformLayerBuffers as required, and TextureMapperGL
2528         will set the appropriate color space matrix to the shader. Initially only the flag for BGRA->RGBA conversion
2529         is defined, but support for new transformations can be added as needed.
2530
2531         VideoTextureCopierGStreamer also uses the TextureMapperShaderProgram to perform texture sampling, but for
2532         the moment it just sets an identity matrix because when using gstreamer-gl, the format of the video frames
2533         is RGBA. This will be changed soon to use BGRA.
2534
2535         No new tests.
2536
2537         * platform/graphics/gstreamer/VideoTextureCopierGStreamer.cpp:
2538         (WebCore::VideoTextureCopierGStreamer::copyVideoTextureToPlatformTexture):
2539         * platform/graphics/texmap/TextureMapperGL.cpp:
2540         (WebCore::colorSpaceMatrixForFlags):
2541         (WebCore::TextureMapperGL::drawTexturedQuadWithProgram):
2542         * platform/graphics/texmap/TextureMapperGL.h:
2543         * platform/graphics/texmap/TextureMapperShaderProgram.cpp:
2544         * platform/graphics/texmap/TextureMapperShaderProgram.h:
2545
2546 2017-06-02  Javier Fernandez  <jfernandez@igalia.com>
2547
2548         [css-grid] Margin wrong applied when stretching an orthogonal item in fixed size track
2549         https://bugs.webkit.org/show_bug.cgi?id=172590
2550
2551         Reviewed by Sergio Villar Senin.
2552
2553         We need to consider orthogonality when using the item's logical margin to
2554         compute the available space for stretching.
2555
2556         The issue this patch fixes is only reproducible when the grid layout logic
2557         is executed several times, since probably the item doesn't need to be
2558         laid out again. In such cases, we just get the cached logical margins
2559         but we were not taking orthogonality into account.
2560
2561         Test: fast/css-grid-layout/grid-item-stretching-must-not-depend-on-previous-layouts.html
2562
2563         * rendering/RenderGrid.cpp:
2564         (WebCore::RenderGrid::layoutBlock):
2565         (WebCore::RenderGrid::marginLogicalSizeForChild):
2566         (WebCore::RenderGrid::availableAlignmentSpaceForChildBeforeStretching):
2567         * rendering/RenderGrid.h:
2568
2569 2017-06-01  Carlos Garcia Campos  <cgarcia@igalia.com>
2570
2571         [GTK] Cache RenderThemeGadget hierarchies for rendering themed elements with GTK+ 3.20+
2572         https://bugs.webkit.org/show_bug.cgi?id=162673
2573
2574         Reviewed by Michael Catanzaro.
2575
2576         Because of the way the new theming system works in GTK+ >= 3.20 we are currently creating a gadget hierarchy
2577         every time we need to render a styled element or get layout information about it. That's happening on every
2578         repaint, and it's specially problematic for overlay scrollbar indicators that fade in/out when shown/hidden. We
2579         need to cache the gadgets and simply apply the state before every paint or layout query. When using GtkWidgetPath,
2580         calling gtk_style_context_save() breaks the gadget hierarchy, and style classes need to be set when building the
2581         GtkWidgetPath. That means we can't cache RenderThemeGadgets, call save, apply style classes and state, and then
2582         call restore. We need to cache gadget hierarchies with fixed style classes. Fortunately, setting the state does
2583         work, so we don't need to also cache a different hierarchy for every possible state. For example, for the
2584         particular case of scrollbars we would cache VerticalScrollbarRight, VerticalScrollbarLeft, HorizontalScrollbar,
2585         VerticalScrollIndicatorRight, VerticalScrollIndicatorLeft and HorizontalScrollIndicator. In practice, we will
2586         only have 4 of those at the same time in the cache.
2587         This patch adds RenderThemeWidget to represent a hierarchy of gadgets with fixed style classes that can be
2588         cached and reused to render or query style of those "widgets". It also simplifies the RenderThemeGtk and
2589         ScrollbarThemeGtk code by removing a lot of duplicated code to build the gadget hierarchies.
2590
2591         * PlatformGTK.cmake:
2592         * platform/gtk/RenderThemeGadget.cpp:
2593         (WebCore::createStyleContext):
2594         (WebCore::appendElementToPath):
2595         (WebCore::RenderThemeGadget::state):
2596         (WebCore::RenderThemeGadget::setState):
2597         * platform/gtk/RenderThemeGadget.h:
2598         * platform/gtk/RenderThemeWidget.cpp: Added.
2599         (WebCore::widgetMap):
2600         (WebCore::RenderThemeWidget::getOrCreate):
2601         (WebCore::RenderThemeWidget::clearCache):
2602         (WebCore::RenderThemeWidget::~RenderThemeWidget):
2603         (WebCore::RenderThemeScrollbar::RenderThemeScrollbar):
2604         (WebCore::RenderThemeScrollbar::stepper):
2605         (WebCore::RenderThemeToggleButton::RenderThemeToggleButton):
2606         (WebCore::RenderThemeButton::RenderThemeButton):
2607         (WebCore::RenderThemeComboBox::RenderThemeComboBox):
2608         (WebCore::RenderThemeEntry::RenderThemeEntry):
2609         (WebCore::RenderThemeSearchEntry::RenderThemeSearchEntry):
2610         (WebCore::RenderThemeSpinButton::RenderThemeSpinButton):
2611         (WebCore::RenderThemeSlider::RenderThemeSlider):
2612         (WebCore::RenderThemeProgressBar::RenderThemeProgressBar):
2613         (WebCore::RenderThemeListView::RenderThemeListView):
2614         (WebCore::RenderThemeIcon::RenderThemeIcon):
2615         * platform/gtk/RenderThemeWidget.h: Added.
2616         (WebCore::RenderThemeEntry::entry):
2617         (WebCore::RenderThemeEntry::selection):
2618         * platform/gtk/ScrollbarThemeGtk.cpp:
2619         (WebCore::ScrollbarThemeGtk::themeChanged):
2620         (WebCore::ScrollbarThemeGtk::updateThemeProperties):
2621         (WebCore::widgetTypeForScrollbar):
2622         (WebCore::contentsRectangle):
2623         (WebCore::ScrollbarThemeGtk::trackRect):
2624         (WebCore::ScrollbarThemeGtk::backButtonRect):
2625         (WebCore::ScrollbarThemeGtk::forwardButtonRect):
2626         (WebCore::ScrollbarThemeGtk::paint):
2627         (WebCore::ScrollbarThemeGtk::scrollbarThickness):
2628         (WebCore::ScrollbarThemeGtk::minimumThumbLength):
2629         * rendering/RenderThemeGtk.cpp:
2630         (WebCore::createStyleContext):
2631         (WebCore::setToggleSize):
2632         (WebCore::paintToggle):
2633         (WebCore::RenderThemeGtk::paintButton):
2634         (WebCore::menuListColor):
2635         (WebCore::RenderThemeGtk::popupInternalPaddingBox):
2636         (WebCore::RenderThemeGtk::paintMenuList):
2637         (WebCore::RenderThemeGtk::adjustTextFieldStyle):
2638         (WebCore::RenderThemeGtk::paintTextField):
2639         (WebCore::adjustSearchFieldIconStyle):
2640         (WebCore::paintSearchFieldIcon):
2641         (WebCore::RenderThemeGtk::paintSliderTrack):
2642         (WebCore::RenderThemeGtk::adjustSliderThumbSize):
2643         (WebCore::RenderThemeGtk::paintSliderThumb):
2644         (WebCore::RenderThemeGtk::progressBarRectForBounds):
2645         (WebCore::RenderThemeGtk::paintProgressBar):
2646         (WebCore::RenderThemeGtk::adjustInnerSpinButtonStyle):
2647         (WebCore::RenderThemeGtk::paintInnerSpinButton):
2648         (WebCore::styleColor):
2649         (WebCore::RenderThemeGtk::platformActiveSelectionBackgroundColor):
2650         (WebCore::RenderThemeGtk::platformInactiveSelectionBackgroundColor):
2651         (WebCore::RenderThemeGtk::platformActiveSelectionForegroundColor):
2652         (WebCore::RenderThemeGtk::platformInactiveSelectionForegroundColor):
2653         (WebCore::RenderThemeGtk::paintMediaButton):
2654
2655 2017-06-01  Andreas Kling  <akling@apple.com>
2656
2657         [Mac] Remove backing store for layers that are outside the viewport
2658         https://bugs.webkit.org/show_bug.cgi?id=170082
2659         <rdar://problem/31245009>
2660
2661         Reviewed by Simon Fraser.
2662
2663         Implement the backingStoreAttached flag in PlatformCALayerCocoa. This means that
2664         compositing layers outside the tiling coverage rect will no longer have backing
2665         stores, saving large amounts of memory.
2666
2667         Also added a canDetachBackingStore flag that is set to false for scroll control
2668         layers, to avoid complicating coverage rect computations.
2669
2670         Test: compositing/backing-store-attachment-1.html
2671
2672         * page/Frame.h:
2673         * platform/graphics/GraphicsLayer.cpp:
2674         (WebCore::GraphicsLayer::GraphicsLayer):
2675         (WebCore::GraphicsLayer::dumpProperties):
2676         * platform/graphics/GraphicsLayer.h:
2677         (WebCore::GraphicsLayer::backingStoreAttached):
2678         (WebCore::GraphicsLayer::setCanDetachBackingStore):
2679         (WebCore::GraphicsLayer::canDetachBackingStore):
2680         * platform/graphics/GraphicsLayerClient.h:
2681         * platform/graphics/ca/GraphicsLayerCA.cpp:
2682         (WebCore::GraphicsLayerCA::backingStoreAttached):
2683         (WebCore::GraphicsLayerCA::setNeedsDisplay):
2684         (WebCore::GraphicsLayerCA::updateCoverage):
2685         * platform/graphics/ca/GraphicsLayerCA.h:
2686         * platform/graphics/ca/PlatformCALayer.h:
2687         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
2688         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
2689         (PlatformCALayerCocoa::setBackingStoreAttached):
2690         (PlatformCALayerCocoa::backingStoreAttached):
2691         * rendering/RenderLayerBacking.cpp:
2692         (WebCore::RenderLayerBacking::updateOverflowControlsLayers):
2693         * rendering/RenderLayerCompositor.cpp:
2694         (WebCore::RenderLayerCompositor::layerTreeAsText):
2695         (WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
2696         * testing/Internals.cpp:
2697         (WebCore::toLayerTreeFlags):
2698         * testing/Internals.h:
2699         * testing/Internals.idl:
2700
2701 2017-06-01  Ryan Haddad  <ryanhaddad@apple.com>
2702
2703         Unreviewed, rolling out r217691.
2704
2705         This change broke the Windows build.
2706
2707         Reverted changeset:
2708
2709         "Web Inspector: Should see active Web Sockets when opening Web
2710         Inspector"
2711         https://bugs.webkit.org/show_bug.cgi?id=172312
2712         http://trac.webkit.org/changeset/217691
2713
2714 2017-06-01  Joseph Pecoraro  <pecoraro@apple.com>
2715
2716         Unreviewed Windows build fix after r217691.
2717
2718         * Modules/websockets/WebSocketChannel.cpp:
2719         (WebCore::WebSocketChannel::sendFrame):
2720         * Modules/websockets/WebSocketChannel.h:
2721         Disambiguate the Function being used.
2722
2723 2017-06-01  Youenn Fablet  <youenn@apple.com>
2724
2725         LibWebRTC might crash with frames having a null width or height
2726         https://bugs.webkit.org/show_bug.cgi?id=172842
2727         <rdar://problem/32514813>
2728
2729         Reviewed by Jon Lee.
2730
2731         Do not send black frames in case the video width or height is zero.
2732         Also ensure that even if a null buffer is returned by the pool, no crash might actually happen.
2733
2734         * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:
2735         (WebCore::RealtimeOutgoingVideoSource::sendBlackFramesIfNeeded):
2736         (WebCore::RealtimeOutgoingVideoSource::videoSampleAvailable):
2737
2738 2017-06-01  Devin Rousso  <drousso@apple.com>
2739
2740         Web Inspector: Should see active Web Sockets when opening Web Inspector
2741         https://bugs.webkit.org/show_bug.cgi?id=172312
2742
2743         Reviewed by Joseph Pecoraro.
2744
2745         Test: http/tests/websocket/tests/hybi/inspector/before-load.html
2746
2747         * Modules/websockets/WebSocket.h:
2748         * Modules/websockets/WebSocket.cpp:
2749         (WebCore::WebSocket::WebSocket):
2750         (WebCore::WebSocket::~WebSocket):
2751         (WebCore::WebSocket::allActiveWebSockets):
2752         (WebCore::WebSocket::allActiveWebSocketsMutex):
2753         (WebCore::WebSocket::channel):
2754         (WebCore::WebSocket::eventTargetInterface):
2755         Add a static set of all WebSocket objects and provide getters to access web socket metadata.
2756
2757         * Modules/websockets/ThreadableWebSocketChannel.h:
2758         (WebCore::ThreadableWebSocketChannel::isWebSocketChannel):
2759         * Modules/websockets/WebSocketChannel.h:
2760         * Modules/websockets/WebSocketChannel.cpp:
2761         (WebCore::WebSocketChannel::isWebSocketChannel):
2762         (WebCore::WebSocketChannel::identifier):
2763         (WebCore::WebSocketChannel::clientHandshakeRequest):
2764         (WebCore::WebSocketChannel::serverHandshakeResponse):
2765         (WebCore::WebSocketChannel::handshakeMode):
2766         (WebCore::WebSocketChannel::isType):
2767         Provide getters to access web socket metadata.
2768
2769         * inspector/InspectorNetworkAgent.cpp:
2770         (WebCore::InspectorNetworkAgent::enable):
2771         Loops over the static set of all WebSocket objects and sends events for each to the frontend.
2772
2773 2017-06-01  Simon Fraser  <simon.fraser@apple.com>
2774
2775         REGRESSION (r217296): Dragging a video only shows controls during drag event
2776         https://bugs.webkit.org/show_bug.cgi?id=172837
2777         rdar://problem/32434661
2778
2779         Reviewed by Zalan Bujtas.
2780
2781         r217296 changed RenderVideo::paintReplaced() from checking paintBehavior() flags on the FrameView
2782         to paintInfo.paintBehavior flags. However, RenderLayer was stripping the PaintBehaviorFlattenCompositingLayers
2783         flag from the paintInfo.paintBehavior flags, so fix that.
2784
2785         Not easily testable.
2786
2787         * rendering/RenderLayer.cpp:
2788         (WebCore::RenderLayer::paintLayerContents):
2789
2790 2017-06-01  Simon Fraser  <simon.fraser@apple.com>
2791
2792         Remove the redundant selectionOnly argument from RenderLayer::paintForegroundForFragments()
2793         https://bugs.webkit.org/show_bug.cgi?id=172835
2794
2795         Reviewed by Zalan Bujtas.
2796
2797         The 'selectionOnly' state is already encoded in localPaintingInfo.paintBehavior so there's
2798         no need to pass it separately.
2799
2800         * rendering/RenderLayer.cpp:
2801         (WebCore::RenderLayer::paintLayerContents):
2802         (WebCore::RenderLayer::paintForegroundForFragments):
2803         * rendering/RenderLayer.h:
2804
2805 2017-06-01  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>
2806
2807         Fix compilation errors in LocalizedStrings.cpp on platform not USE(CF) nor USE(GLIB)
2808         https://bugs.webkit.org/show_bug.cgi?id=172796
2809
2810         Reviewed by Alex Christensen.
2811
2812         No new tests needed. Fixing compilation errors.
2813
2814         * platform/LocalizedStrings.cpp:
2815         (WebCore::contextMenuItemTagLookUpInDictionary):
2816         (WebCore::imageTitle):
2817         (WebCore::validationMessageRangeUnderflowText):
2818         (WebCore::validationMessageRangeOverflowText):
2819
2820 2017-06-01  Chris Dumez  <cdumez@apple.com>
2821
2822         Unreviewed, rolling out r217647.
2823
2824         No longer needed after r217682
2825
2826         Reverted changeset:
2827
2828         "Avoid iterator invalidation bug in
2829         WebCore::defaultPortForProtocol"
2830         https://bugs.webkit.org/show_bug.cgi?id=172786
2831         http://trac.webkit.org/changeset/217647
2832
2833 2017-06-01  Chris Dumez  <cdumez@apple.com>
2834
2835         Make WebCore::defaultPortForProtocol() thread-safe
2836         https://bugs.webkit.org/show_bug.cgi?id=172797
2837
2838         Reviewed by Brent Fulgham.
2839
2840         Make WebCore::defaultPortForProtocol() thread-safe since it is called from the SecurityOrigin
2841         constructor and SecurityOrigin objects are constructed from various threads.
2842
2843         This should not regress the non-testing code paths since we only pay locking costs if
2844         a default port override has been set by the tests.
2845
2846         * platform/URL.cpp:
2847         (WebCore::defaultPortForProtocolMapLock):
2848         (WebCore::defaultPortForProtocolMapForTesting):
2849         (WebCore::ensureDefaultPortForProtocolMapForTesting):
2850         (WebCore::registerDefaultPortForProtocolForTesting):
2851         (WebCore::clearDefaultPortForProtocolMapForTesting):
2852         (WebCore::defaultPortForProtocol):
2853
2854 2017-06-01  Andy Estes  <aestes@apple.com>
2855
2856         REGRESSION (r217626): ENABLE_APPLE_PAY_SESSION_V3 was disabled by mistake
2857         https://bugs.webkit.org/show_bug.cgi?id=172828
2858
2859         Reviewed by Beth Dakin.
2860
2861         * Configurations/FeatureDefines.xcconfig:
2862
2863 2017-06-01  Frederic Wang  <fwang@igalia.com>
2864
2865         ScrollingCoordinator::updateSynchronousScrollingReasons should consider non-main frames
2866         https://bugs.webkit.org/show_bug.cgi?id=172806
2867
2868         Reviewed by Simon Fraser.
2869
2870         Currently, the scrolling coordinator does not manage scrolling of frames other than the main
2871         one (bugs 171667 and 149264) and so ScrollingCoordinator::updateSynchronousScrollingReasons
2872         is only relevant for the main frame. This commit refactors a bit ScrollingCoordinator so that
2873         updateSynchronousScrollingReasons is considered for all the frames whose scrolling is
2874         coordinated by the ScrollingCoordinator so non-main frames will be considered in the future.
2875
2876         No new tests, behavior is unchanged for now.
2877
2878         * page/scrolling/ScrollingCoordinator.cpp:
2879         (WebCore::ScrollingCoordinator::updateSynchronousScrollingReasons): Add an ASSERT to ensure
2880         that this function is only called for frame whose scrolling is coordinated by this class.
2881         (WebCore::ScrollingCoordinator::updateSynchronousScrollingReasonsForAllFrames): Introduce a
2882         new function to update synchronous scrolling for subframes whose scrolling is coordinated by
2883         this class.
2884         (WebCore::ScrollingCoordinator::setForceSynchronousScrollLayerPositionUpdates): Update
2885         synchronous scrolling reason for non-main frames too.
2886         (WebCore::ScrollingCoordinator::replaySessionStateDidChange): Update synchronous scrolling
2887         reason for non-main frames too.
2888         * page/scrolling/ScrollingCoordinator.h: Define updateSynchronousScrollingReasonsForAllFrames
2889
2890 2017-06-01  Andy Estes  <aestes@apple.com>
2891
2892         [Cocoa] Upstream support for JCB as a supported payment network
2893         https://bugs.webkit.org/show_bug.cgi?id=172819
2894
2895         Reviewed by Tim Horton.
2896
2897         * Modules/applepay/PaymentRequest.cpp:
2898         (WebCore::PaymentRequest::isValidSupportedNetwork):
2899         (WebCore::isAdditionalValidSupportedNetwork): Deleted.
2900
2901 2017-06-01  Chris Dumez  <cdumez@apple.com>
2902
2903         Unreviewed, rolling out r217660.
2904
2905         This should not have landed given that the new assertion is
2906         hit on debug EWS bots
2907
2908         Reverted changeset:
2909
2910         "Make sure we don't access WebCore::defaultPortForProtocol
2911         from non-main thread"
2912         https://bugs.webkit.org/show_bug.cgi?id=172797
2913         http://trac.webkit.org/changeset/217660
2914
2915 2017-06-01  Brent Fulgham  <bfulgham@apple.com>
2916
2917         Make sure we don't access WebCore::defaultPortForProtocol from non-main thread
2918         https://bugs.webkit.org/show_bug.cgi?id=172797
2919
2920         Reviewed by Alex Christensen.
2921
2922         * platform/URL.cpp:
2923         (WebCore::defaultPortForProtocol): Add an assertion to make sure we don't access the
2924         DefaultPortForProtocolMapForTesting from multiple threads.
2925
2926 2017-06-01  Konstantin Tokarev  <annulen@yandex.ru>
2927
2928         Get rid of more HIGH_DPI_CANVAS leftovers
2929         https://bugs.webkit.org/show_bug.cgi?id=172751
2930
2931         Reviewed by Simon Fraser.
2932
2933         Get rid of HTMLCanvasElement::convertLogicalToDevice() and
2934         HTMLCanvasElement::convertDeviceToLogical() that are no longer needed,
2935         as canvas doesn't use device scale factor anymore.
2936
2937         No new tests needed.
2938
2939         * html/HTMLCanvasElement.cpp:
2940         (WebCore::HTMLCanvasElement::createImageBuffer): Use integer width()
2941         and height() instead of floating-point temporary deviceSize variable.
2942         (WebCore::HTMLCanvasElement::baseTransform): Return unmodified
2943         baseTransform of underlying ImageBuffer.
2944         * html/HTMLCanvasElement.h: Removed declarations of unused methods.
2945
2946 2017-05-31  Brent Fulgham  <bfulgham@apple.com>
2947
2948         Avoid iterator invalidation bug in WebCore::defaultPortForProtocol
2949         https://bugs.webkit.org/show_bug.cgi?id=172786
2950         <rdar://problem/32499586>
2951
2952         Reviewed by Chris Dumez.
2953
2954         Create the SecurityOrigin objects on the main thread (rather than the worker queues)
2955         since defaultPortForProtocol is not threadsafe.
2956
2957         * loader/ResourceLoadObserver.cpp:
2958         (WebCore::ResourceLoadObserver::logFrameNavigation):
2959         (WebCore::ResourceLoadObserver::logSubresourceLoading):
2960         (WebCore::ResourceLoadObserver::logWebSocketLoading):
2961
2962 2017-05-31  Mark Lam  <mark.lam@apple.com>
2963
2964         Remove overrides of visitChildren() that do not add any functionality.
2965         https://bugs.webkit.org/show_bug.cgi?id=172789
2966         <rdar://problem/32500865>
2967
2968         Reviewed by Andreas Kling.
2969
2970         No new tests needed.  Just deleting unneeded code.
2971
2972         * bindings/js/JSDOMWindowBase.cpp:
2973         (WebCore::JSDOMWindowBase::visitChildren): Deleted.
2974         * bindings/js/JSDOMWindowBase.h:
2975
2976 2017-05-31  Don Olmstead  <don.olmstead@am.sony.com>
2977
2978         [WebCore] Update AXObjectCache::startOrEndCharacterOffsetForRange signature for !HAVE(ACCESSIBILITY)
2979         https://bugs.webkit.org/show_bug.cgi?id=172769
2980
2981         Reviewed by Yusuke Suzuki.
2982
2983         No new tests. No change in behavior.
2984
2985         * accessibility/AXObjectCache.h:
2986         (WebCore::AXObjectCache::startOrEndCharacterOffsetForRange):
2987         * platform/Curl.cmake: Added.
2988
2989 2017-05-31  Mark Lam  <mark.lam@apple.com>
2990
2991         CodeGeneratorJS's InstanceNeedsVisitChildren should not return true just because a class is / extends EventTarget.
2992         https://bugs.webkit.org/show_bug.cgi?id=172782
2993         <rdar://problem/32498266>
2994
2995         Reviewed by Chris Dumez.
2996
2997         No new tests needed.  This change is covered by existing binding tests.
2998
2999         InstanceNeedsVisitChildren should also not check the IsJSBuiltinConstructor
3000         condition, which is not used to emit any additional code in the visitChildren
3001         override.
3002
3003         The other conditions for generating visitChildren() are adequate if the class
3004         needs to override visitChildren.  Currently, we're generating some visitChildren()
3005         methods that only call its Base::visitChildren().  Removing the "is / extends
3006         EventTarget" conditions removes those unneeded visitChildren overrides.
3007
3008         * bindings/scripts/CodeGeneratorJS.pm:
3009         (InstanceNeedsVisitChildren):
3010         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
3011         (WebCore::JSTestClassWithJSBuiltinConstructor::visitChildren): Deleted.
3012         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.h:
3013         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
3014         (WebCore::JSTestDOMJIT::visitChildren): Deleted.
3015         * bindings/scripts/test/JS/JSTestDOMJIT.h:
3016         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
3017         (WebCore::JSTestEventTarget::visitChildren): Deleted.
3018         * bindings/scripts/test/JS/JSTestEventTarget.h:
3019         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
3020         (WebCore::JSTestJSBuiltinConstructor::visitChildren): Deleted.
3021         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.h:
3022         * bindings/scripts/test/JS/JSTestNode.cpp:
3023         (WebCore::JSTestNode::visitChildren): Deleted.
3024         * bindings/scripts/test/JS/JSTestNode.h:
3025
3026 2017-05-31  Chris Dumez  <cdumez@apple.com>
3027
3028         Make QualifiedName cache per thread
3029         https://bugs.webkit.org/show_bug.cgi?id=172778
3030         <rdar://problem/32490942>
3031
3032         Reviewed by Geoffrey Garen.
3033
3034         Make QualifiedName cache per thread since it is currently used from multiple threads,
3035         in an unsafe fashion. We started using QualifiedName objects in background threads
3036         after r190602 which started using a CSSSelectorParser in the ContentExtensionParser.
3037
3038         * WebCore.xcodeproj/project.pbxproj:
3039         * dom/QualifiedName.cpp:
3040         (WebCore::QualifiedName::QualifiedName):
3041         (WebCore::QualifiedName::QualifiedNameImpl::~QualifiedNameImpl):
3042         * dom/QualifiedNameCache.cpp: Added.
3043         (WebCore::QNameComponentsTranslator::hash):
3044         (WebCore::QNameComponentsTranslator::equal):
3045         (WebCore::QNameComponentsTranslator::translate):
3046         (WebCore::QualifiedNameCache::getOrCreate):
3047         (WebCore::QualifiedNameCache::remove):
3048         * dom/QualifiedNameCache.h: Added.
3049         * platform/ThreadGlobalData.cpp:
3050         (WebCore::ThreadGlobalData::ThreadGlobalData):
3051         (WebCore::ThreadGlobalData::destroy):
3052         * platform/ThreadGlobalData.h:
3053         (WebCore::ThreadGlobalData::qualifiedNameCache):
3054
3055 2017-05-31  Andy Estes  <aestes@apple.com>
3056
3057         Rename ENABLE_APPLE_PAY_DELEGATE to ENABLE_APPLE_PAY_SESSION_V3 and bump the supported version number
3058         https://bugs.webkit.org/show_bug.cgi?id=172366
3059
3060         Reviewed by Daniel Bates.
3061
3062         * Configurations/FeatureDefines.xcconfig:
3063         * Modules/applepay/ApplePayError.idl:
3064         * Modules/applepay/ApplePayPaymentAuthorizationResult.idl:
3065         * Modules/applepay/ApplePayPaymentMethodUpdate.idl:
3066         * Modules/applepay/ApplePaySession.idl:
3067         * Modules/applepay/ApplePayShippingContactUpdate.idl:
3068         * Modules/applepay/ApplePayShippingMethodUpdate.idl:
3069
3070 2017-05-31  Youenn Fablet  <youenn@apple.com>
3071
3072         PeerConnection should respect tracks that are muted at the time they are added
3073         https://bugs.webkit.org/show_bug.cgi?id=172771
3074
3075         Reviewed by Eric Carlson.
3076
3077         Tests: webrtc/peer-connection-audio-unmute.html
3078                webrtc/video-unmute.html
3079
3080         Making sure that muted/enabled state of sources are correctly handled at creation time of the outgoing webrtc sources.
3081         This should trigger silent audio and black frames.
3082
3083         * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
3084         (WebCore::RealtimeOutgoingAudioSource::RealtimeOutgoingAudioSource):
3085         (WebCore::RealtimeOutgoingAudioSource::setSource):
3086         (WebCore::RealtimeOutgoingAudioSource::initializeConverter):
3087         * platform/mediastream/mac/RealtimeOutgoingAudioSource.h:
3088         * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:
3089         (WebCore::RealtimeOutgoingVideoSource::RealtimeOutgoingVideoSource):
3090         (WebCore::RealtimeOutgoingVideoSource::setSource):
3091         (WebCore::RealtimeOutgoingVideoSource::sourceMutedChanged):
3092         (WebCore::RealtimeOutgoingVideoSource::sourceEnabledChanged):
3093         (WebCore::RealtimeOutgoingVideoSource::initializeFromSource):
3094         (WebCore::RealtimeOutgoingVideoSource::AddOrUpdateSink):
3095         (WebCore::RealtimeOutgoingVideoSource::RemoveSink):
3096         (WebCore::RealtimeOutgoingVideoSource::sendBlackFramesIfNeeded):
3097         (WebCore::RealtimeOutgoingVideoSource::setSizeFromSource): Deleted.
3098         (WebCore::RealtimeOutgoingVideoSource::sendBlackFrames): Deleted.
3099         * platform/mediastream/mac/RealtimeOutgoingVideoSource.h:
3100
3101 2017-05-31  Antti Koivisto  <antti@apple.com>
3102
3103         CrashTracer: Regression : com.apple.WebKit.WebContent at STP responsible :: com.apple.WebCore: WebCore::SharedBuffer::data const + 11
3104         https://bugs.webkit.org/show_bug.cgi?id=172747
3105         <rdar://problem/32275314>
3106
3107         Reviewed by Andreas Kling.
3108
3109         Test: http/tests/subresource-integrity/empty-stylesheet-integrity-crash.html
3110
3111         * loader/SubresourceIntegrity.cpp:
3112         (WebCore::matchIntegrityMetadata):
3113
3114             If the resource body is empty CachedResource::resourceBuffer() may be null.
3115
3116 2017-05-31  Frederic Wang  <fwang@igalia.com>
3117
3118         ScrollingStateScrollingNode::ChangedProperty::NumScrollingStateNodeBits is wrongly set
3119         https://bugs.webkit.org/show_bug.cgi?id=172349
3120
3121         Reviewed by Simon Fraser.
3122
3123         ScrollingStateScrollingNode::ChangedProperty::NumScrollingStateNodeBits was introduced in
3124         r133022 so that ScrollingStateFrameScrollingNode and ScrollingStateOverflowScrollingNode
3125         know the number of bits use for properties in their parent class.
3126
3127         In r172649, r210560, r185762 and r183702 new properties were added to
3128         ScrollingStateScrollingNode but NumScrollingStateNodeBits was not increased accordingly. This
3129         means that there are potential conflicts between these new properties and those of derived
3130         classes ScrollingStateFrameScrollingNode and ScrollingStateOverflowScrollingNode. It is not
3131         clear how to write a test case reproducing such conflict, though.
3132
3133         No new tests, this is a coding mistake but its effect is unclear.
3134
3135         * page/scrolling/ScrollingStateNode.cpp:
3136         (WebCore::ScrollingStateNode::setPropertyChanged): Use hasChangedProperty and cast to
3137         64-bits integer before shifting.
3138         * page/scrolling/ScrollingStateNode.h: Add a comment to make clear NumStateNodeBits must
3139         remain at the last position. Ensure we have enough bits available.
3140         (WebCore::ScrollingStateNode::hasChangedProperty): Cast to 64-bits integer before shifting.
3141         * page/scrolling/ScrollingStateScrollingNode.h: Fix position of NumScrollingStateNodeBits and
3142         also add a similar comment.
3143
3144 2017-05-31  Matt Lewis  <jlewis3@apple.com>
3145
3146         Unreviewed, rolling out r217603.
3147
3148         This patch broke the internal builds.
3149
3150         Reverted changeset:
3151
3152         "Get <chrono> out of StdLibExtras.h"
3153         https://bugs.webkit.org/show_bug.cgi?id=172744
3154         http://trac.webkit.org/changeset/217603
3155
3156 2017-05-31  Simon Fraser  <simon.fraser@apple.com>
3157
3158         Get <chrono> out of StdLibExtras.h
3159         https://bugs.webkit.org/show_bug.cgi?id=172744
3160
3161         Reviewed by Saam Barati.
3162
3163         Only bring in <chrono> and namespace std::literals::chrono_literals when necessary.
3164
3165         * fileapi/FileReader.cpp:
3166         * inspector/InspectorOverlay.cpp:
3167         * loader/CrossOriginPreflightResultCache.cpp:
3168         * loader/cache/CachedResource.cpp:
3169         (WebCore::CachedResource::freshnessLifetime):
3170         * page/ResourceUsageThread.cpp:
3171         (WebCore::ResourceUsageThread::threadBody):
3172         * page/cocoa/MemoryReleaseCocoa.mm:
3173         (WebCore::jettisonExpensiveObjectsOnTopLevelNavigation):
3174         * platform/network/CacheValidation.cpp:
3175         (WebCore::computeFreshnessLifetimeForHTTPFamily):
3176         * platform/network/CacheValidation.h:
3177
3178 2017-05-31  Emilio Cobos Álvarez  <ecobos@igalia.com>
3179
3180         Use the rare data's RenderStyle for display: contents.
3181         https://bugs.webkit.org/show_bug.cgi?id=172721
3182
3183         Reviewed by Antti Koivisto.
3184
3185         No new tests, no behavior change.
3186
3187         * dom/Element.cpp:
3188         (WebCore::Element::hasDisplayContents):
3189         (WebCore::Element::storeDisplayContentsStyle):
3190         * dom/Element.h:
3191         * dom/ElementRareData.h:
3192         (WebCore::ElementRareData::ElementRareData):
3193         * style/RenderTreeUpdater.cpp:
3194         (WebCore::RenderTreeUpdater::updateElementRenderer):
3195         * style/StyleTreeResolver.cpp:
3196         (WebCore::Style::TreeResolver::resolveComposedTree):
3197
3198 2017-05-31  Per Arne Vollan  <pvollan@apple.com>
3199
3200         LayoutTest media/video-orientation.html is failing
3201         https://bugs.webkit.org/show_bug.cgi?id=172648
3202         <rdar://problem/31322425>
3203
3204         Reviewed by Eric Carlson.
3205
3206         For videos with rotation tag set, the transform AVAssetTrack.preferredTransform applied to
3207         AVAssetTrack.naturalSize might return a CGSize instance with negative width or height.
3208
3209         Covered by existing tests.
3210
3211         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3212         (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged):
3213
3214 2017-05-30  Frederic Wang  <fwang@igalia.com>
3215
3216         Include ScrollingTreeScrollingNode properties in ScrollingTreeFrameScrollingNode::dumpProperties
3217         https://bugs.webkit.org/show_bug.cgi?id=172287
3218
3219         Reviewed by Simon Fraser.
3220
3221         No new tests, only changes in dumped tree.
3222
3223         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
3224         (WebCore::ScrollingTreeFrameScrollingNode::dumpProperties): Print properties of the parent class.
3225
3226 2017-05-30  Sam Weinig  <sam@webkit.org>
3227
3228         Update test result after r217585.
3229
3230         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
3231         (WebCore::JSTestNamedDeleterWithIndexedGetter::deleteProperty):
3232         (WebCore::JSTestNamedDeleterWithIndexedGetter::deletePropertyByIndex):
3233
3234 2017-05-30  Dan Bernstein  <mitz@apple.com>
3235
3236         Fixed the build after r217588.
3237
3238         * page/FrameView.h: Stopped exporting a function defined inline.
3239
3240 2017-05-30  Zalan Bujtas  <zalan@apple.com>
3241
3242         ASSERTION FAILED: m_layoutPhase == InPostLayerPositionsUpdatedAfterLayout || m_layoutPhase == OutsideLayout
3243         https://bugs.webkit.org/show_bug.cgi?id=171501
3244         <rdar://problem/31977453>
3245
3246         Reviewed by Simon Fraser.
3247
3248         We should be able to paint as long as the tree is clean and we are in paintable state.
3249
3250         * page/FrameView.cpp:
3251         (WebCore::FrameView::paintContents):
3252
3253 2017-05-30  Sam Weinig  <sam@webkit.org>
3254
3255         Revert accidentally checked in change.
3256
3257         * crypto/mac/CryptoAlgorithmRSA_PSSMac.cpp:
3258         * crypto/mac/CryptoDigestAlgorithm.h:
3259
3260 2017-05-30  Sam Weinig  <sam@webkit.org>
3261
3262         [WebIDL] Generate named property deleters
3263         https://bugs.webkit.org/show_bug.cgi?id=172688
3264
3265         Reviewed by Chris Dumez.
3266
3267         Test: js/dom/named-property-deleter.html
3268
3269         * WebCore.xcodeproj/project.pbxproj:
3270         Add new file, JSDOMAbstractOperations.h
3271
3272         * bindings/js/JSDOMAbstractOperations.h: Added.
3273         (WebCore::isVisibleNamedProperty):
3274         Add an implementation of the abstract operation WebIDL calls the 'named property visibility algorithm'.
3275         It is used by many WebIDL algorithms, but currently I am only using this implementation for deleters.
3276         In the future, we should try and move the other property access generators to use it as well.
3277
3278         * bindings/js/JSDOMStringMapCustom.cpp:
3279         (WebCore::JSDOMStringMap::deleteProperty): Deleted.
3280         (WebCore::JSDOMStringMap::deletePropertyByIndex): Deleted.
3281         * bindings/js/JSStorageCustom.cpp:
3282         (WebCore::JSStorage::deleteProperty): Deleted.
3283         (WebCore::JSStorage::deletePropertyByIndex): Deleted.
3284         Remove now generated deleteProperty and deletePropertyByIndex implementations.
3285
3286         * bindings/scripts/CodeGeneratorJS.pm:
3287         (GenerateDeletePropertyCommon):
3288         (GenerateDeletePropertyDefinition):
3289         (GenerateDeletePropertyByIndexDefinition):
3290         (GenerateNamedDeleterDefinition):
3291         Added generation for named deleters. We generate both deleteProperty and deletePropertyByIndex.
3292
3293         (InstanceOverridesDelete):
3294         Add predicate for whether the header should declare deleteProperty and deletePropertyByIndex.
3295
3296         (GenerateHeader):
3297         Move property access hook declarations closer to each other. Use new InstanceOverridesDelete
3298         predicate for deleteProperty and deletePropertyByIndex.
3299  
3300         (GenerateImplementation):
3301         Add call to generate named deleter if one exists.
3302
3303         (GenerateConstructorHelperMethods):
3304         Remove an old FIXME that that was no longer true, there are no more interfaces that inherit from
3305         an interface with [NoInterfaceObject].
3306
3307         * dom/DOMStringMap.idl:
3308         Removes CustomDeleteProperty and sorts extended attributes.
3309
3310         * dom/DatasetDOMStringMap.h:
3311         * dom/DatasetDOMStringMap.cpp:
3312         (WebCore::DatasetDOMStringMap::isSupportedPropertyName):
3313         Added. This is a bindings support function (much like supportedPropertyNames()) that is
3314         used JSDOMAbstractOperations.h's isVisibleNamedProperty.
3315
3316         (WebCore::DatasetDOMStringMap::supportedPropertyNames):
3317         Convert to an early return.
3318
3319         (WebCore::DatasetDOMStringMap::deleteNamedProperty):
3320         (WebCore::DatasetDOMStringMap::deleteItem): Deleted.
3321         Renamed deleteItem to deleteNamedProperty, which is the name the bindings use for deleter
3322         operations without an identifier.
3323
3324         * page/DOMWindow.cpp:
3325         (WebCore::DOMWindow::sessionStorage):
3326         Fix incorrect indentation that bothered me.
3327
3328         * storage/Storage.cpp:
3329         * storage/Storage.h:
3330         - Remove isDisabledByPrivateBrowsing(), which had no definition.
3331         - Add isSupportedPropertyName(), which the deleter code (via the isVisibleNamedProperty algorithm)
3332           needs.
3333         
3334         * storage/Storage.idl:
3335         Removes CustomDeleteProperty, sorts the extended attributes, adds 'deleter' special 
3336         to the removeItem operation and adds a commented out 'setter' special to the 'setItem'
3337         operation.
3338
3339         * bindings/scripts/test/JS/JSTestObj.h:
3340         Update result for declarations moving around.
3341
3342         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp: Added.
3343         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.h: Added.
3344         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp: Added.
3345         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.h: Added.
3346         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp: Added.
3347         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.h: Added.
3348         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp: Added.
3349         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.h: Added.
3350         * bindings/scripts/test/TestNamedDeleterNoIdentifier.idl: Added.
3351         * bindings/scripts/test/TestNamedDeleterThrowingException.idl: Added.
3352         * bindings/scripts/test/TestNamedDeleterWithIdentifier.idl: Added.
3353         * bindings/scripts/test/TestNamedDeleterWithIndexedGetter.idl: Added.
3354         Add new tests for named deleters.
3355
3356 2017-05-30  Joseph Pecoraro  <pecoraro@apple.com>
3357
3358         Web Inspector: images dragged from Inspector to Desktop are named "Unknown.png"
3359         https://bugs.webkit.org/show_bug.cgi?id=141515
3360         <rdar://problem/9251308>
3361
3362         Reviewed by Wenson Hsieh.
3363
3364         * html/HTMLAttributeNames.in:
3365
3366 2017-05-30  Youenn Fablet  <youenn@apple.com>
3367
3368         Add support for Certificate and IceCandidatePair stats
3369         https://bugs.webkit.org/show_bug.cgi?id=172734
3370
3371         Reviewed by Geoff Garen.
3372
3373         Covered by updated test.
3374
3375         Adding support for these two stats in the IDL and in the libwebrtc binding code.
3376
3377         * Modules/mediastream/RTCStatsReport.h:
3378         (WebCore::RTCStatsReport::IceCandidatePairStats::IceCandidatePairStats):
3379         (WebCore::RTCStatsReport::CertificateStats::CertificateStats):
3380         * Modules/mediastream/RTCStatsReport.idl:
3381         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
3382         (WebCore::iceCandidatePairState):
3383         (WebCore::fillRTCIceCandidatePairStats):
3384         (WebCore::fillRTCCertificateStats):
3385         (WebCore::LibWebRTCMediaEndpoint::StatsCollector::OnStatsDelivered):
3386