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