Can't use Object.defineProperty() to add an item to a DOMStringMap or Storage
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-06-03  Sam Weinig  <sam@webkit.org>
2
3         Can't use Object.defineProperty() to add an item to a DOMStringMap or Storage
4         https://bugs.webkit.org/show_bug.cgi?id=172687
5
6         Reviewed by Darin Adler.
7
8         - Adds support for generating the defineOwnProperty ClassInfo method table hook
9           to add support for Object.defineProperty(). The implementation follows WebIDL
10           section 3.9.3 [[DefineOwnProperty]].
11           (https://heycam.github.io/webidl/#legacy-platform-object-defineownproperty)
12         - Adds support for generating named setters in addition to the already supported
13           indexed setters as much of the required work was needed to make defineOwnProperty
14           work for those properties. This patch does not aim to follow WebIDL faithfully,
15           but rather to generate as close to the custom code as possible. A follow up 
16           change will attempt to match WebIDL more closely (which will also require changes
17           to [[GetOwnPropertySlot]]).
18         - Removes the need for custom bindings in DOMStringMap, HTMLOptionsCollection and
19           HTMLSelectElement. Gets us one function away from supporting Storage.
20         - Tidies up generated headers a bit by grouping all the ClassInfo method table hooks
21           together.
22         - Removes support for CustomIndexedSetter, which is no longer used.
23
24         Test: js/dom/legacy-platform-object-defineOwnProperty.html
25
26         * CMakeLists.txt:
27         * WebCore.xcodeproj/project.pbxproj:
28         * bindings/js/JSBindingsAllInOne.cpp:
29         Removed now unneeded custom bindings.
30
31         * bindings/js/JSDOMStringMapCustom.cpp: Removed.
32         * bindings/js/JSHTMLOptionsCollectionCustom.cpp: Removed.
33         * bindings/js/JSHTMLSelectElementCustom.cpp: Removed.
34         * bindings/js/JSHTMLSelectElementCustom.h: Removed.
35         * bindings/js/JSStorageCustom.cpp:
36         (WebCore::JSStorage::putDelegate): Deleted.
37         Remove more code that is now generated.
38
39         * bindings/scripts/CodeGeneratorJS.pm:
40         (GenerateIndexedGetter):
41         - Add missing check for indexed setter operation when determining if the property should be ReadOnly.
42         - Add support for custom implementation name, matching GenerateNamedGetter.
43         - Convert to taking an outputArray and indent to allow more flexibility going forward.
44
45         (GenerateNamedGetter):
46         - Add missing check for named setter operation when determining if the property should be ReadOnly.
47         - Convert to taking an outputArray and indent to allow more flexibility going forward.
48
49         (GenerateGetOwnPropertySlotBody):
50         - Convert to taking an outputArray and indent to allow more flexibility going forward.
51         - Take over responsibility for checking and bailing if CustomGetOwnPropertySlot is set.
52
53         (GenerateGetOwnPropertySlotBodyByIndex):
54         - Convert to taking an outputArray and indent to allow more flexibility going forward.
55         - Take over responsibility for checking and bailing if CustomGetOwnPropertySlotByIndex is set.
56
57         (GenerateGetOwnPropertyNames):
58         - Convert to taking an outputArray and indent to allow more flexibility going forward.
59         - Take over responsibility for checking and bailing if CustomEnumerateProperty is set.
60
61         (GenerateInvokeIndexedPropertySetter):
62         Added. Implements the 'invoke an indexed property setter' algorithm (https://heycam.github.io/webidl/#invoke-indexed-setter)
63
64         (GenerateInvokeNamedPropertySetter):
65         Added. Implements the 'invoke a named property setter' algorithm (https://heycam.github.io/webidl/#invoke-named-setter)
66
67         (GeneratePut):
68         (GeneratePutByIndex):
69         - Convert to taking an outputArray and indent to allow more flexibility going forward.
70         - Take over responsibility for checking and bailing if CustomPut is set.
71         - Adds support for CEReactions.
72         - Adopts GenerateInvokeIndexedPropertySetter and GenerateInvokeNamedPropertySetter to
73           simplify code.
74         - Removes support for CustomIndexedSetter, which is no longer used.
75         - Replaces use direct checking of OverrideBuiltins with check if any interface it inherits
76           has it, which is how it is specified to work.
77
78         (GenerateIsUnforgeablePropertyName):
79         Added. Helper subroutine to generate a function that compares a property name
80         agains all the property names defined as Unforgeable on the interface. Used by
81         GenerateDefineOwnProperty.
82
83         (GenerateDefineOwnProperty):
84         Added. Implements section 3.9.3 [[DefineOwnProperty]] (https://heycam.github.io/webidl/#legacy-platform-object-defineownproperty)
85         Adds support for CEReactions.
86
87         (GenerateDeletePropertyCommon):
88         Switch from getting OverrideBuiltins directly off the interface to using InheritsExtendedAttribute.
89
90         (GenerateNamedDeleterDefinition):
91         Switch signature to match peer generators.
92
93         (InstanceOverridesGetOwnPropertySlot):
94         Update for rename of JSCustomGetOwnPropertySlotAndDescriptor to CustomGetOwnPropertySlotAndDescriptor.
95
96         (InstanceOverridesGetOwnPropertySlotByIndex):
97         Added. Like InstanceOverridesGetOwnPropertySlot, but checks for the new CustomGetOwnPropertySlotByIndex 
98         rather than CustomGetOwnPropertySlot.
99
100         (InstanceOverridesGetOwnPropertyNames):
101         Added. Moves complex predicate out of line.
102
103         (InstanceOverridesPut):
104         Removes now unused CustomIndexedSetter, and adds CustomPutFunction, which used to be checked separately.
105
106         (InstanceOverridesDefineOwnProperty):
107         Added.
108
109         (GenerateHeader):
110         - Moves more structure flags together.
111         - Simplifies predicates and moves the ClassInfo method table hooks together.
112
113         (GenerateImplementation):
114         - Moves the ClassInfo method table hooks together
115         - Adds call to GenerateDefineOwnProperty.
116
117         (GenerateLegacyCallerDefinitions):
118         Simplify bail condition to match other generators.
119
120         (GeneratePrototypeDeclaration):
121         Update for new extended attribute names.
122
123         (InstanceOverridesCall): 
124         Renamed from IsCallable for consistency.
125         
126         (HasComplexGetOwnProperty): 
127         Deleted. Unused.
128         
129         (InstanceOverridesPutImplementation): 
130         Deleted. Unused.
131         
132         (InstanceOverridesPutDeclaration): 
133         Deleted. Unused.
134         
135         (IsCallable): 
136         Renamed, for consistency, to InstanceOverridesCall .
137
138         * bindings/scripts/IDLAttributes.json:
139         Renames a few of the extended attributes to remove the JS prefix. This time
140         around I only did the ones in the area I was working, but we should probably
141         remove most of the rest.
142     
143         * css/CSSStyleDeclaration.idl:
144         Update for JSCustomGetOwnPropertySlotAndDescriptor -> CustomGetOwnPropertySlotAndDescriptor rename.
145
146         * dom/DOMStringMap.idl:
147         Remove CustomNamedSetter and add uncomment out the setter.
148
149         * dom/DatasetDOMStringMap.cpp:
150         (WebCore::DatasetDOMStringMap::setNamedItem):
151         (WebCore::DatasetDOMStringMap::setItem): Deleted.
152         * dom/DatasetDOMStringMap.h:
153         Rename setItem to setNamedItem, which is what the generator expects.
154
155         * dom/Node.idl:
156         Update for JSCustomPushEventHandlerScope -> CustomPushEventHandlerScope rename.
157
158         * html/HTMLAppletElement.idl:
159         * html/HTMLEmbedElement.idl:
160         * html/HTMLObjectElement.idl:
161         Update for JSCustomGetOwnPropertySlotAndDescriptor -> CustomGetOwnPropertySlotAndDescriptor rename.
162
163         * html/HTMLCollection.cpp:
164         (WebCore::HTMLCollection::isSupportedPropertyName):
165         * html/HTMLCollection.h:
166         Add isSupportedPropertyName function which is used by the bindings and is now needed.
167
168         * html/HTMLElement.idl:
169         Update for JSCustomPushEventHandlerScope -> CustomPushEventHandlerScope rename.
170
171         * html/HTMLOptionsCollection.h:
172         (WebCore::HTMLOptionsCollection::setItem):
173         Add setItem() implementation which just forwards to the select element. Also, add 
174         a type alias to make the implementations of item and namedItem less verbose.
175
176         * html/HTMLOptionsCollection.idl:
177         Remove CustomIndexedSetter and uncomment the setter.
178
179         * html/HTMLSelectElement.idl:
180         Remove CustomIndexedSetter and uncomment the setter. Also, reformat
181         to match the WHATWG spec.
182
183         * page/DOMWindow.idl:
184         Update for JSCustomDefineOwnProperty -> CustomDefineOwnProperty rename. Add 
185         CustomGetOwnPropertySlotByIndex which is now needed to remove some unsound
186         assumptions the generator was making.
187
188         * page/Location.idl:
189         Update for removal of JS prefix from a bunch of extended attributes.
190
191         * page/UserMessageHandlersNamespace.idl:
192         Update for JSCustomGetOwnPropertySlotAndDescriptor -> CustomGetOwnPropertySlotAndDescriptor rename.
193
194         * storage/Storage.idl:
195         Remove CustomNamedSetter and uncomment the setter.
196
197         * bindings/scripts/test/JS/JSInterfaceName.h:
198         * bindings/scripts/test/JS/JSTestEventTarget.h:
199         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp: Added.
200         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.h: Added.
201         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp: Added.
202         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.h: Added.
203         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp: Added.
204         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.h: Added.
205         * bindings/scripts/test/JS/JSTestInterface.cpp:
206         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp: Added.
207         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.h: Added.
208         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp: Added.
209         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.h: Added.
210         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp: Added.
211         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.h: Added.
212         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.h:
213         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.h:
214         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
215         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.h:
216         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.h:
217         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp: Added.
218         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.h: Added.
219         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp: Added.
220         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.h: Added.
221         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp: Added.
222         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.h: Added.
223         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp: Added.
224         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.h: Added.
225         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp: Added.
226         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.h: Added.
227         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp: Added.
228         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.h: Added.
229         * bindings/scripts/test/JS/JSTestObj.cpp:
230         * bindings/scripts/test/JS/JSTestObj.h:
231         * bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
232         * bindings/scripts/test/TestIndexedSetterNoIdentifier.idl: Added.
233         * bindings/scripts/test/TestIndexedSetterThrowingException.idl: Added.
234         * bindings/scripts/test/TestIndexedSetterWithIdentifier.idl: Added.
235         * bindings/scripts/test/TestNamedAndIndexedSetterNoIdentifier.idl: Added.
236         * bindings/scripts/test/TestNamedAndIndexedSetterThrowingException.idl: Added.
237         * bindings/scripts/test/TestNamedAndIndexedSetterWithIdentifier.idl: Added.
238         * bindings/scripts/test/TestNamedDeleterWithIdentifier.idl:
239         * bindings/scripts/test/TestNamedSetterNoIdentifier.idl: Added.
240         * bindings/scripts/test/TestNamedSetterThrowingException.idl: Added.
241         * bindings/scripts/test/TestNamedSetterWithIdentifier.idl: Added.
242         * bindings/scripts/test/TestNamedSetterWithOverrideBuiltins.idl: Added.
243         * bindings/scripts/test/TestNamedSetterWithUnforgableProperties.idl: Added.
244         * bindings/scripts/test/TestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.idl: Added.
245         Added new tests and updated some results.
246
247 2017-06-04  Simon Fraser  <simon.fraser@apple.com>
248
249         Object bounding box wrong for some paths
250         https://bugs.webkit.org/show_bug.cgi?id=172866
251
252         Reviewed by Tim Horton.
253         
254         RenderSVGShape::calculateObjectBoundingBox() should use boundingRect()
255         rather than fastBoundingRect(), because the latter includes control points.
256
257         Covered by existing tests.
258
259         * rendering/svg/RenderSVGShape.cpp:
260         (WebCore::RenderSVGShape::calculateObjectBoundingBox):
261
262 2017-06-04  Konstantin Tokarev  <annulen@yandex.ru>
263
264         Fix build of Windows-specific code with ICU 59.1
265         https://bugs.webkit.org/show_bug.cgi?id=172729
266
267         Reviewed by Darin Adler.
268
269         Fix conversions from WTF::String to wchar_t* and vice versa.
270         No new tests needed.
271
272         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
273         (WebCore::mimeTypeCache):
274         (WebCore::MediaPlayerPrivateMediaFoundation::startCreateMediaSource):
275
276 2017-06-04  Chris Dumez  <cdumez@apple.com>
277
278         Implement DOMMatrixReadOnly.transformPoint()
279         https://bugs.webkit.org/show_bug.cgi?id=172900
280
281         Reviewed by Simon Fraser.
282
283         Implement DOMMatrixReadOnly.transformPoint():
284         - https://drafts.fxtf.org/geometry/#dommatrixreadonly
285         - https://drafts.fxtf.org/geometry/#dom-dommatrixreadonly-transformpoint
286
287         Test: imported/blink/fast/dom/geometry-interfaces-dom-matrix-transformPoint.html
288
289         * css/DOMMatrixReadOnly.cpp:
290         (WebCore::DOMMatrixReadOnly::transformPoint):
291         * css/DOMMatrixReadOnly.h:
292         * css/DOMMatrixReadOnly.idl:
293
294 2017-06-04  Zan Dobersek  <zdobersek@igalia.com>
295
296         [GCrypt] Improve comments in AES, PBKDF2, RSA-SSA algorithm implementations
297         https://bugs.webkit.org/show_bug.cgi?id=172894
298
299         Reviewed by Michael Catanzaro.
300
301         Add or improve code comments in libgcrypt implementations for the AES_CBC,
302         AES_GCM, AES_KW, PBKDF2 and RSA-SSA algorithms.
303
304         * crypto/gcrypt/CryptoAlgorithmAES_CBCGCrypt.cpp: Add generic comments that
305         describe each operation that's performed.
306         (WebCore::gcryptEncrypt):
307         (WebCore::gcryptDecrypt):
308         * crypto/gcrypt/CryptoAlgorithmAES_GCMGCrypt.cpp: Ditto.
309         (WebCore::gcryptEncrypt):
310         (WebCore::gcryptDecrypt):
311         * crypto/gcrypt/CryptoAlgorithmAES_KWGCrypt.cpp: Ditto.
312         (WebCore::gcryptWrapKey):
313         (WebCore::gcryptUnwrapKey):
314         * crypto/gcrypt/CryptoAlgorithmPBKDF2GCrypt.cpp: Ditto.
315         (WebCore::gcryptDeriveBits):
316         * crypto/gcrypt/CryptoAlgorithmRSASSA_PKCS1_v1_5GCrypt.cpp:
317         (WebCore::gcryptVerify): Align the verification results comment with the
318         one that's used in the ECDSA implementation.
319
320 2017-06-03  Chris Dumez  <cdumez@apple.com>
321
322         Implement DOMMatrix's fromFloat32Array / fromFloat64Array & toFloat32Array / toFloat64Array
323         https://bugs.webkit.org/show_bug.cgi?id=172898
324
325         Reviewed by Sam Weinig.
326
327         Implement DOMMatrix's fromFloat32Array / fromFloat64Array & toFloat32Array / toFloat64Array
328         as per:
329         - https://drafts.fxtf.org/geometry/#dommatrixreadonly
330
331         Test: http/wpt/geometry/DOMMatrix-from-to-typed-arrays.html
332
333         * css/DOMMatrix.cpp:
334         (WebCore::DOMMatrix::fromFloat32Array):
335         (WebCore::DOMMatrix::fromFloat64Array):
336         * css/DOMMatrix.h:
337         * css/DOMMatrix.idl:
338         * css/DOMMatrixReadOnly.cpp:
339         (WebCore::DOMMatrixReadOnly::fromFloat32Array):
340         (WebCore::DOMMatrixReadOnly::fromFloat64Array):
341         (WebCore::DOMMatrixReadOnly::toFloat32Array):
342         (WebCore::DOMMatrixReadOnly::toFloat64Array):
343         * css/DOMMatrixReadOnly.h:
344         * css/DOMMatrixReadOnly.idl:
345
346 2017-06-03  Simon Fraser  <simon.fraser@apple.com>
347
348         Implement DOMPointReadOnly.matrixTransform()
349         https://bugs.webkit.org/show_bug.cgi?id=172896
350
351         Reviewed by Chris Dumez.
352
353         DOMPointReadOnly.matrixTransform() creates the matrix or throws, then uses
354         a new function in TransformationMatrix to map x,y,z,w through the matrix.
355
356         Test: http/wpt/geometry/DOMPoint-003.html
357
358         * CMakeLists.txt:
359         * WebCore.xcodeproj/project.pbxproj:
360         * css/DOMMatrixReadOnly.h:
361         (WebCore::DOMMatrixReadOnly::transformationMatrix):
362         * dom/DOMPointReadOnly.cpp: Copied from Source/WebCore/dom/DOMPointReadOnly.idl.
363         (WebCore::DOMPointReadOnly::matrixTransform):
364         * dom/DOMPointReadOnly.h:
365         * dom/DOMPointReadOnly.idl:
366         * platform/graphics/transforms/TransformationMatrix.cpp:
367         (WebCore::TransformationMatrix::map4ComponentPoint):
368         * platform/graphics/transforms/TransformationMatrix.h:
369
370 2017-06-03  Myles C. Maxfield  <mmaxfield@apple.com>
371
372         Cleanup arguments to preparePlatformFont() and fontWithFamily() in FontCacheCoreText.cpp
373         https://bugs.webkit.org/show_bug.cgi?id=172886
374
375         Reviewed by Simon Fraser.
376
377         The number of arguments is getting out of control.
378
379         No new tests because there is no behavior change.
380
381         * platform/graphics/FontCache.h:
382         * platform/graphics/cocoa/FontCacheCoreText.cpp:
383         (WebCore::preparePlatformFont):
384         (WebCore::fontWithFamily):
385         (WebCore::FontCache::createFontPlatformData):
386         (WebCore::FontCache::systemFallbackForCharacters):
387         * platform/graphics/mac/FontCacheMac.mm:
388         (WebCore::platformFontWithFamilySpecialCase):
389         * platform/graphics/mac/FontCustomPlatformData.cpp:
390         (WebCore::FontCustomPlatformData::fontPlatformData):
391         * platform/spi/cocoa/CoreTextSPI.h:
392
393 2017-06-03  Yusuke Suzuki  <utatane.tea@gmail.com>
394
395         Script modules should be able to import data urls
396         https://bugs.webkit.org/show_bug.cgi?id=171594
397
398         Reviewed by Youenn Fablet.
399
400         Tests: js/dom/classic-script-with-data-url.html
401                js/dom/modules/module-script-with-data-url.html
402
403         Script tag resources should have SameOriginDataURLFlag::Set to load data URLs
404         since script tags should treat data URLs as same origin.
405
406         * bindings/js/CachedScriptFetcher.cpp:
407         (WebCore::CachedScriptFetcher::requestScriptWithCache):
408
409 2017-06-03  Simon Fraser  <simon.fraser@apple.com>
410
411         Sort the project file.
412
413         * WebCore.xcodeproj/project.pbxproj:
414
415 2017-06-03  Zan Dobersek  <zdobersek@igalia.com>
416
417         [GCrypt] Gather SUBTLE_CRYPTO utility functions in a single header
418         https://bugs.webkit.org/show_bug.cgi?id=172870
419
420         Reviewed by Jiewen Tan.
421
422         Gather the helper functions used across different source files
423         for libgcrypt-backed SUBTLE_CRYPTO implementations in a single
424         header file.
425
426         * crypto/gcrypt/CryptoAlgorithmECDSAGCrypt.cpp:
427         (WebCore::hashCryptoDigestAlgorithm): Deleted.
428         (WebCore::hashAlgorithmName): Deleted.
429         (WebCore::mpiData): Deleted.
430         * crypto/gcrypt/CryptoAlgorithmHKDFGCrypt.cpp:
431         (WebCore::gcryptDeriveBits):
432         (WebCore::macAlgorithmForHashFunction): Deleted.
433         * crypto/gcrypt/CryptoAlgorithmPBKDF2GCrypt.cpp:
434         (WebCore::gcryptDeriveBits):
435         * crypto/gcrypt/CryptoAlgorithmRSAES_PKCS1_v1_5GCrypt.cpp:
436         (WebCore::mpiData): Deleted.
437         * crypto/gcrypt/CryptoAlgorithmRSASSA_PKCS1_v1_5GCrypt.cpp:
438         (WebCore::hashCryptoDigestAlgorithm): Deleted.
439         (WebCore::hashAlgorithmName): Deleted.
440         (WebCore::mpiData): Deleted.
441         * crypto/gcrypt/CryptoAlgorithmRSA_OAEPGCrypt.cpp:
442         (WebCore::hashAlgorithmName): Deleted.
443         (WebCore::mpiData): Deleted.
444         * crypto/gcrypt/GCryptUtilities.h: Added.
445         (WebCore::hashAlgorithmName):
446         (WebCore::hmacAlgorithm):
447         (WebCore::digestAlgorithm):
448         (WebCore::hashCryptoDigestAlgorithm):
449         (WebCore::mpiData):
450
451 2017-06-03  Zan Dobersek  <zdobersek@igalia.com>
452
453         [GCrypt] Fix PK verification for ECDSA
454         https://bugs.webkit.org/show_bug.cgi?id=172857
455
456         Reviewed by Michael Catanzaro.
457
458         No new tests -- covered by existing tests.
459
460         * crypto/gcrypt/CryptoAlgorithmECDSAGCrypt.cpp:
461         (WebCore::gcryptVerify): Return `true` if the verification succeeded or `false`
462         in any other case, avoiding spilling information about the exact cause of
463         verification failure.
464
465 2017-06-02  Zalan Bujtas  <zalan@apple.com>
466
467         Cleanup FrameView::autoSizeIfEnabled.
468         https://bugs.webkit.org/show_bug.cgi?id=172889
469         <rdar://problem/32550783>
470
471         Reviewed by Tim Horton.
472
473         This patch ensures that we always have a clean tree (and a valid and current document size) when
474         setting m_autoSizeContentSize. 
475
476         * page/FrameView.cpp:
477         (WebCore::FrameView::autoSizeIfEnabled):
478
479 2017-06-02  Wenson Hsieh  <wenson_hsieh@apple.com>
480
481         REGRESSION(r216212): RenderReplaced::paint() should not save and restore the context unless it has to
482         https://bugs.webkit.org/show_bug.cgi?id=172883
483         <rdar://problem/32548614>
484
485         Reviewed by Tim Horton.
486
487         After implementing dragged content fading, RenderReplace::paint is now always guarded by unnecessary calls to
488         GraphicsContext::save and GraphicsContext::restore, even when there is no dragged content being rendered. To
489         address this, we initialize our GraphicsContextStateSaver with saveAndRestore = false, indicating that we don't
490         want to immediately try and save the context.
491
492         If we are in a dragged content range, we will then call GraphicsContextStateSaver::save, which saves the
493         graphics context and also causes the GraphicsContextStateSaver to eventually try and restore() when it is
494         destroyed. Otherwise, in the common codepath where the renderer is not in a dragged content range, the
495         constructor and destructor of GraphicsContextStateSaver will be no-ops with respect to saving and restoring the
496         graphics context.
497
498         * rendering/RenderReplaced.cpp:
499         (WebCore::RenderReplaced::paint):
500
501 2017-06-02  Myles C. Maxfield  <mmaxfield@apple.com>
502
503         REGRESSION(r213464): [iOS] Fonts get too bold when the "Bold Text" accessibility setting is enabled
504         https://bugs.webkit.org/show_bug.cgi?id=172737
505
506         Reviewed by Simon Fraser.
507
508         Revert the part of r213464 which changed how we calculate the weights of system fonts.
509
510         Add an InternalSetting to trigger our mock of the accessbility "Bold Text" setting. We can't
511         use the real setting, so instead we just ask for bold fonts instead of regular fonts when this
512         setting is true.
513
514         Tests: fast/text/accessibility-bold-system-font.html
515                fast/text/accessibility-bold-system-font-2.html
516
517         * platform/graphics/FontCache.h:
518         (WebCore::FontCache::shouldMockBoldSystemFontForAccessibility):
519         (WebCore::FontCache::setShouldMockBoldSystemFontForAccessibility):
520         * platform/graphics/ios/FontCacheIOS.mm:
521         (WebCore::platformFontWithFamilySpecialCase):
522         * rendering/RenderTheme.h:
523         (WebCore::RenderTheme::shouldMockBoldSystemFontForAccessibility):
524         (WebCore::RenderTheme::setShouldMockBoldSystemFontForAccessibility):
525         * rendering/RenderThemeIOS.h:
526         * rendering/RenderThemeIOS.mm:
527         (WebCore::cssWeightOfSystemFont):
528         (WebCore::RenderThemeIOS::updateCachedSystemFontDescription):
529         * testing/InternalSettings.cpp:
530         (WebCore::InternalSettings::Backup::Backup):
531         (WebCore::InternalSettings::Backup::restoreTo):
532         (WebCore::InternalSettings::setShouldMockBoldSystemFontForAccessibility):
533         * testing/InternalSettings.h:
534         * testing/InternalSettings.idl:
535
536 2017-06-02  Brady Eidson  <beidson@apple.com>
537
538         Prevent scheme handlers from handling all built-in URL schemes.
539         <rdar://problem/32404790> and https://bugs.webkit.org/show_bug.cgi?id=172869
540
541         Reviewed by Andy Estes.
542
543         Covered by API test.
544
545         This patch refactors SchemeRegistry to keep a base, constant set of each of the special
546         URL schemes that WebKit knows about by default.
547         
548         It then exposes that list through a new method to support WK2 API.
549
550         * platform/SchemeRegistry.cpp:
551         (WebCore::allBuiltinSchemes):
552         (WebCore::builtinLocalURLSchemes):
553         (WebCore::localURLSchemes):
554         (WebCore::builtinSecureSchemes):
555         (WebCore::secureSchemes):
556         (WebCore::builtinSchemesWithUniqueOrigins):
557         (WebCore::schemesWithUniqueOrigins):
558         (WebCore::builtinEmptyDocumentSchemes):
559         (WebCore::emptyDocumentSchemes):
560         (WebCore::builtinCanDisplayOnlyIfCanRequestSchemes):
561         (WebCore::canDisplayOnlyIfCanRequestSchemes):
562         (WebCore::SchemeRegistry::removeURLSchemeRegisteredAsLocal):
563         (WebCore::builtinCORSEnabledSchemes):
564         (WebCore::CORSEnabledSchemes):
565         (WebCore::SchemeRegistry::isBuiltinScheme):
566         * platform/SchemeRegistry.h:
567
568 2017-06-02  Simon Fraser  <simon.fraser@apple.com>
569
570         All scroll peformance logging should happen in the UI process
571         https://bugs.webkit.org/show_bug.cgi?id=172874
572         rdar://problem/24474830
573
574         Reviewed by Tim Horton.
575
576         Printing to stdout from the WebProcess doesn't show up anywhere in non-development builds,
577         so we have to log from the UI process.
578
579         Achieve this by adding a PerformanceLoggingClient to Page which forwards messages to
580         WebPageProxy, which prints them with the same format they had before. Some plumbing through
581         PlatformCALayerClient and GraphicsLayerClient is required to get messages from TileControllers
582         through to something that can get to Page.
583
584         * WebCore.xcodeproj/project.pbxproj:
585         * page/Page.cpp:
586         (WebCore::Page::Page):
587         (WebCore::Page::~Page):
588         * page/Page.h:
589         (WebCore::Page::performanceLoggingClient):
590         * page/PageConfiguration.cpp:
591         * page/PageConfiguration.h:
592         * page/PerformanceLoggingClient.cpp: Added.
593         (WebCore::PerformanceLoggingClient::synchronousScrollingReasonsAsString):
594         * page/PerformanceLoggingClient.h: Added.
595         (WebCore::PerformanceLoggingClient::~PerformanceLoggingClient):
596         * page/scrolling/AsyncScrollingCoordinator.cpp:
597         (WebCore::AsyncScrollingCoordinator::reportExposedUnfilledArea):
598         (WebCore::AsyncScrollingCoordinator::reportSynchronousScrollingReasonsChanged):
599         * page/scrolling/AsyncScrollingCoordinator.h:
600         * page/scrolling/ScrollingTree.h:
601         (WebCore::ScrollingTree::reportSynchronousScrollingReasonsChanged):
602         (WebCore::ScrollingTree::reportExposedUnfilledArea):
603         * page/scrolling/ThreadedScrollingTree.cpp:
604         (WebCore::ThreadedScrollingTree::reportSynchronousScrollingReasonsChanged):
605         (WebCore::ThreadedScrollingTree::reportExposedUnfilledArea):
606         * page/scrolling/ThreadedScrollingTree.h:
607         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
608         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
609         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):
610         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPosition):
611         (WebCore::ScrollingTreeFrameScrollingNodeMac::exposedUnfilledArea):
612         (WebCore::ScrollingTreeFrameScrollingNodeMac::logExposedUnfilledArea): Deleted.
613         (WebCore::logThreadedScrollingMode): Deleted.
614         * platform/graphics/GraphicsLayerClient.h:
615         (WebCore::GraphicsLayerClient::logFilledVisibleFreshTile):
616         * platform/graphics/ca/GraphicsLayerCA.cpp:
617         (WebCore::GraphicsLayerCA::platformCALayerLogFilledVisibleFreshTile):
618         * platform/graphics/ca/GraphicsLayerCA.h:
619         * platform/graphics/ca/PlatformCALayerClient.h:
620         (WebCore::PlatformCALayerClient::platformCALayerLogFilledVisibleFreshTile):
621         * platform/graphics/ca/TileController.cpp:
622         (WebCore::TileController::logFilledVisibleFreshTile):
623         * platform/graphics/ca/TileController.h:
624         * platform/graphics/ca/TileGrid.cpp:
625         (WebCore::TileGrid::platformCALayerPaintContents):
626         * platform/graphics/ca/TileGrid.h:
627         * rendering/RenderLayerBacking.cpp:
628         (WebCore::RenderLayerBacking::logFilledVisibleFreshTile):
629         * rendering/RenderLayerBacking.h:
630
631 2017-06-02  Eric Carlson  <eric.carlson@apple.com>
632
633         [MediaStream iOS] Cleanup video muting/unmuting when tab visibility changes
634         https://bugs.webkit.org/show_bug.cgi?id=172858
635
636         Reviewed by Youenn Fablet.
637
638         Test: platform/ios/mediastream/video-muted-in-background-tab.html
639
640         * dom/Document.cpp:
641         (WebCore::Document::visibilityStateChanged): Call notifyMediaCaptureOfVisibilityChanged.
642         (WebCore::Document::notifyMediaCaptureOfVisibilityChanged): Renamed from notifyVisibilityChangedToMediaCapture.
643         Set m_videoCaptureMutedForVisibilityChange when capture is muted because the document is hidden,
644         and clear it when visibility changes when capture is disabled. Don't unmute when the document
645         becomes visible unless this m_videoCaptureMutedForVisibilityChange is still true.
646         (WebCore::Document::notifyVisibilityChangedToMediaCapture): Deleted.
647         * dom/Document.h:
648
649         * platform/mediastream/RealtimeMediaSource.h:
650         * platform/mediastream/RealtimeMediaSourceCenter.cpp:
651         (WebCore::RealtimeMediaSourceCenter::setVideoCaptureMutedForPageVisibility): Renamed from
652         setVisibility.
653         (WebCore::RealtimeMediaSourceCenter::setVisibility): Deleted.
654         * platform/mediastream/RealtimeMediaSourceCenter.h:
655
656         * platform/mediastream/mac/AVVideoCaptureSource.mm:
657         (WebCore::AVVideoCaptureSourceFactory::setVideoCaptureMutedForPageVisibility): Ditto.
658         (WebCore::AVVideoCaptureSourceFactory::setVisibility): Deleted.
659
660         * platform/mock/MockRealtimeVideoSource.cpp:
661         (WebCore::MockRealtimeVideoSourceFactory::setVideoCaptureMutedForPageVisibility): Ditto.
662         (WebCore::MockRealtimeVideoSourceFactory::setVisibility): Deleted.
663
664 2017-06-02  Frederic Wang  <fwang@igalia.com>
665
666         [Mac] Include frames in the scrolling tree when ScrollingTreeIncludesFrames=true
667         https://bugs.webkit.org/show_bug.cgi?id=172825
668
669         Reviewed by Simon Fraser.
670
671         This commit generalizes RenderLayerCompositor/ScrollingCoordinator so that it handles the
672         case of non-main frames. When ScrollingTreeIncludesFrames=true, all the frames will appear
673         in the scrolling tree on Mac WK2.
674
675         Test: fast/scrolling/scrolling-tree-includes-frame.html
676
677         * page/scrolling/ScrollingCoordinator.cpp:
678         (WebCore::ScrollingCoordinator::coordinatesScrollingForFrameView): Do not to restrict to the
679         main frame.
680         * rendering/RenderLayerCompositor.cpp:
681         (WebCore::RenderLayerCompositor::updateBacking): Do not to restrict to the main frame.
682         (WebCore::RenderLayerCompositor::useCoordinatedScrollingForLayer): Make this function a class
683         member so it can call hasCoordinatedScrolling and no longer needs a RenderView parameter.
684         (WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus): Do not to restrict to the
685         main frame.
686         * rendering/RenderLayerCompositor.h: Introduce useCoordinatedScrollingForLayer.
687
688 2017-06-02  Don Olmstead  <don.olmstead@am.sony.com>
689
690         [WebCore] DragImageRef should correspond to USE(CAIRO)
691         https://bugs.webkit.org/show_bug.cgi?id=172863
692
693         Reviewed by Carlos Alberto Lopez Perez.
694
695         No new tests. No change in behavior.
696
697         * platform/DragImage.h:
698
699 2017-06-02  Frederic Wang  <fwang@igalia.com>
700
701         [Mac] Use compositing for frames when ScrollingTreeIncludesFrames=true
702         https://bugs.webkit.org/show_bug.cgi?id=172851
703
704         Reviewed by Simon Fraser.
705
706         When fast frame scrolling is supported on mac (bug 171667), scrollable frames will require
707         special composited layer. This commit enables that on mac but only when
708         ScrollingTreeIncludesFrames=true, so that the default behavior is unchanged.
709
710         Test: compositing/iframes/compositing-for-scrollable-iframe.html
711
712         * rendering/RenderLayerCompositor.cpp:
713         (WebCore::RenderLayerCompositor::requiresCompositingForScrollableFrame): Do not enable frame
714         compositing when ScrollingTreeIncludesFrames=false.
715         Rename ScrollableInnerFrameTrigger to ScrollableNonMainFrameTrigger.
716         * page/ChromeClient.h: Rename ScrollableInnerFrameTrigger.
717
718 2017-06-02  Simon Fraser  <simon.fraser@apple.com>
719
720         Get <chrono> out of StdLibExtras.h
721         https://bugs.webkit.org/show_bug.cgi?id=172744
722
723         Reviewed by Zalan Bujtas.
724
725         Only bring in <chrono> and namespace std::literals::chrono_literals when necessary.
726
727         * fileapi/FileReader.cpp:
728         * inspector/InspectorOverlay.cpp:
729         * loader/CrossOriginPreflightResultCache.cpp:
730         * loader/cache/CachedResource.cpp:
731         (WebCore::CachedResource::freshnessLifetime):
732         * page/ResourceUsageThread.cpp:
733         (WebCore::ResourceUsageThread::threadBody):
734         * page/cocoa/MemoryReleaseCocoa.mm:
735         (WebCore::jettisonExpensiveObjectsOnTopLevelNavigation):
736         * platform/network/CacheValidation.cpp:
737         (WebCore::computeFreshnessLifetimeForHTTPFamily):
738         * platform/network/CacheValidation.h:
739
740 2017-06-02  Andy Estes  <aestes@apple.com>
741
742         [Cocoa] Add a "supportedCountries" property to ApplePayPaymentRequest
743         https://bugs.webkit.org/show_bug.cgi?id=172832
744         <rdar://problem/30735544>
745
746         Reviewed by Alex Christensen.
747
748         Test: http/tests/ssl/applepay/ApplePaySessionV3.html
749
750         * Modules/applepay/ApplePayPaymentRequest.h:
751         * Modules/applepay/ApplePayPaymentRequest.idl:
752         * Modules/applepay/ApplePaySession.cpp:
753         (WebCore::convertAndValidate):
754         * Modules/applepay/PaymentRequest.h:
755         (WebCore::PaymentRequest::supportedCountries):
756         (WebCore::PaymentRequest::setSupportedCountries):
757         * Modules/applepay/PaymentRequestValidator.cpp:
758         (WebCore::PaymentRequestValidator::validate):
759         * platform/spi/cocoa/PassKitSPI.h:
760
761 2017-06-02  Devin Rousso  <drousso@apple.com>
762
763         Web Inspector: Should see active Web Sockets when opening Web Inspector
764         https://bugs.webkit.org/show_bug.cgi?id=172312
765
766         Reviewed by Joseph Pecoraro.
767
768         Test: http/tests/websocket/tests/hybi/inspector/before-load.html
769
770         * Modules/websockets/WebSocket.h:
771         * Modules/websockets/WebSocket.cpp:
772         (WebCore::WebSocket::WebSocket):
773         (WebCore::WebSocket::~WebSocket):
774         (WebCore::WebSocket::allActiveWebSockets):
775         (WebCore::WebSocket::allActiveWebSocketsMutex):
776         (WebCore::WebSocket::channel):
777         (WebCore::WebSocket::eventTargetInterface):
778         Add a static set of all WebSocket objects and provide getters to access web socket metadata.
779
780         * Modules/websockets/ThreadableWebSocketChannel.h:
781         (WebCore::ThreadableWebSocketChannel::isWebSocketChannel):
782         * Modules/websockets/WebSocketChannel.h:
783         * Modules/websockets/WebSocketChannel.cpp:
784         (WebCore::WebSocketChannel::isWebSocketChannel):
785         (WebCore::WebSocketChannel::identifier):
786         (WebCore::WebSocketChannel::clientHandshakeRequest):
787         (WebCore::WebSocketChannel::serverHandshakeResponse):
788         (WebCore::WebSocketChannel::handshakeMode):
789         (WebCore::WebSocketChannel::isType):
790         Provide getters to access web socket metadata.
791
792         * inspector/InspectorNetworkAgent.cpp:
793         (WebCore::InspectorNetworkAgent::enable):
794         Loops over the static set of all WebSocket objects and sends events for each to the frontend.
795
796 2017-06-02  Chris Dumez  <cdumez@apple.com>
797
798         Unreviewed, fix linking errors on iOS after r217712.
799
800         * platform/OrientationNotifer.h:
801         (WebCore::OrientationNotifier::Observer::setNotifier):
802
803 2017-06-02  Chris Dumez  <cdumez@apple.com>
804
805         Crash under OrientationNotifier::Observer::setNotifier()
806         https://bugs.webkit.org/show_bug.cgi?id=172847
807         <rdar://problem/32519127>
808
809         Reviewed by Youenn Fablet.
810
811         Update OrientationNotifier::Observer::setNotifier() to unregister itself from
812         its current notifier if it already has one. This is needed because
813         Internals::setCameraMediaStreamTrackOrientation() may be used to override the
814         notifier of an observer. If we override the notifier without unregistering
815         the observer from its previous notifier, then the previous notifier will not
816         get notified when the observer gets destroyed.
817
818         No new tests, already covered by webrtc/video-rotation.html that is currently
819         failing on some bots.
820
821         * platform/OrientationNotifer.h:
822         (WebCore::OrientationNotifier::Observer::setNotifier):
823
824 2017-06-02  Javier Fernandez  <jfernandez@igalia.com>
825
826         [css-grid] Logical margin incorrectly applied during the tracks sizing algorithm of auto tracks
827         https://bugs.webkit.org/show_bug.cgi?id=172836
828
829         Reviewed by Manuel Rego Casasnovas.
830
831         When computing min-content and max-content of the content-sized tracks
832         we are using the marginIntrinsicLogicalWidthForChild function, which
833         uses the grid's writing-mode to determine wether to use the child's
834         margin width or height. This is not correct when the grid item is
835         orthogonal.
836
837         This patch changes how we compute the tracks width so we use always
838         the item's marginLogicalWidth, which depends only on its own writing
839         mode.
840
841         Test: fast/css-grid-layout/grid-track-sizing-with-margins-and-orthogonal-flows.html
842
843         * rendering/GridTrackSizingAlgorithm.cpp:
844         (WebCore::GridTrackSizingAlgorithmStrategy::minContentForChild):
845         (WebCore::GridTrackSizingAlgorithmStrategy::maxContentForChild):
846
847 2017-06-02  Emilio Cobos Álvarez  <ecobos@igalia.com>
848
849         Invalidate the shadow subtree style when slotted pseudo rules are present.
850         https://bugs.webkit.org/show_bug.cgi?id=172822
851
852         Reviewed by Antti Koivisto.
853
854         No new tests, this is tested by
855         fast/shadow-dom/css-scoping-slot-with-id.html, once we don't force an
856         Inherit style change for slots. I could add some more tests for stuff
857         with descendant combinators and similar I guess, though.
858
859         * style/AttributeChangeInvalidation.cpp:
860         (WebCore::Style::AttributeChangeInvalidation::invalidateStyle):
861         * style/ClassChangeInvalidation.cpp:
862         (WebCore::Style::ClassChangeInvalidation::invalidateStyle):
863         * style/IdChangeInvalidation.cpp:
864         (WebCore::Style::IdChangeInvalidation::invalidateStyle):
865
866 2017-06-02  Miguel Gomez  <magomez@igalia.com>
867
868         [GTK+][WPE] Allow TextureMapperShaderProgram to perform colorspace conversions with the source texture pixels
869         https://bugs.webkit.org/show_bug.cgi?id=172749
870
871         Reviewed by Žan Doberšek.
872
873         Currently TextureMapperGL is only able to paint properly textures that are in RGBA format. There are
874         situations where we will want it to be able to handle other formats (for example BGRA for gstreamer-gl).
875         To make this possible without having to perform the color conversion in the CPU, we add a new color
876         conversion matrix to TextureMapperShaderProgram. This matrix will perform the color space conversion
877         in the GPU, just after sampling the source texture.
878
879         Also, add a new flag to TextureMapperGL to indicate that a color conversion is required to handle a
880         texture. This flag will be set to the TextureMapperPlatformLayerBuffers as required, and TextureMapperGL
881         will set the appropriate color space matrix to the shader. Initially only the flag for BGRA->RGBA conversion
882         is defined, but support for new transformations can be added as needed.
883
884         VideoTextureCopierGStreamer also uses the TextureMapperShaderProgram to perform texture sampling, but for
885         the moment it just sets an identity matrix because when using gstreamer-gl, the format of the video frames
886         is RGBA. This will be changed soon to use BGRA.
887
888         No new tests.
889
890         * platform/graphics/gstreamer/VideoTextureCopierGStreamer.cpp:
891         (WebCore::VideoTextureCopierGStreamer::copyVideoTextureToPlatformTexture):
892         * platform/graphics/texmap/TextureMapperGL.cpp:
893         (WebCore::colorSpaceMatrixForFlags):
894         (WebCore::TextureMapperGL::drawTexturedQuadWithProgram):
895         * platform/graphics/texmap/TextureMapperGL.h:
896         * platform/graphics/texmap/TextureMapperShaderProgram.cpp:
897         * platform/graphics/texmap/TextureMapperShaderProgram.h:
898
899 2017-06-02  Javier Fernandez  <jfernandez@igalia.com>
900
901         [css-grid] Margin wrong applied when stretching an orthogonal item in fixed size track
902         https://bugs.webkit.org/show_bug.cgi?id=172590
903
904         Reviewed by Sergio Villar Senin.
905
906         We need to consider orthogonality when using the item's logical margin to
907         compute the available space for stretching.
908
909         The issue this patch fixes is only reproducible when the grid layout logic
910         is executed several times, since probably the item doesn't need to be
911         laid out again. In such cases, we just get the cached logical margins
912         but we were not taking orthogonality into account.
913
914         Test: fast/css-grid-layout/grid-item-stretching-must-not-depend-on-previous-layouts.html
915
916         * rendering/RenderGrid.cpp:
917         (WebCore::RenderGrid::layoutBlock):
918         (WebCore::RenderGrid::marginLogicalSizeForChild):
919         (WebCore::RenderGrid::availableAlignmentSpaceForChildBeforeStretching):
920         * rendering/RenderGrid.h:
921
922 2017-06-01  Carlos Garcia Campos  <cgarcia@igalia.com>
923
924         [GTK] Cache RenderThemeGadget hierarchies for rendering themed elements with GTK+ 3.20+
925         https://bugs.webkit.org/show_bug.cgi?id=162673
926
927         Reviewed by Michael Catanzaro.
928
929         Because of the way the new theming system works in GTK+ >= 3.20 we are currently creating a gadget hierarchy
930         every time we need to render a styled element or get layout information about it. That's happening on every
931         repaint, and it's specially problematic for overlay scrollbar indicators that fade in/out when shown/hidden. We
932         need to cache the gadgets and simply apply the state before every paint or layout query. When using GtkWidgetPath,
933         calling gtk_style_context_save() breaks the gadget hierarchy, and style classes need to be set when building the
934         GtkWidgetPath. That means we can't cache RenderThemeGadgets, call save, apply style classes and state, and then
935         call restore. We need to cache gadget hierarchies with fixed style classes. Fortunately, setting the state does
936         work, so we don't need to also cache a different hierarchy for every possible state. For example, for the
937         particular case of scrollbars we would cache VerticalScrollbarRight, VerticalScrollbarLeft, HorizontalScrollbar,
938         VerticalScrollIndicatorRight, VerticalScrollIndicatorLeft and HorizontalScrollIndicator. In practice, we will
939         only have 4 of those at the same time in the cache.
940         This patch adds RenderThemeWidget to represent a hierarchy of gadgets with fixed style classes that can be
941         cached and reused to render or query style of those "widgets". It also simplifies the RenderThemeGtk and
942         ScrollbarThemeGtk code by removing a lot of duplicated code to build the gadget hierarchies.
943
944         * PlatformGTK.cmake:
945         * platform/gtk/RenderThemeGadget.cpp:
946         (WebCore::createStyleContext):
947         (WebCore::appendElementToPath):
948         (WebCore::RenderThemeGadget::state):
949         (WebCore::RenderThemeGadget::setState):
950         * platform/gtk/RenderThemeGadget.h:
951         * platform/gtk/RenderThemeWidget.cpp: Added.
952         (WebCore::widgetMap):
953         (WebCore::RenderThemeWidget::getOrCreate):
954         (WebCore::RenderThemeWidget::clearCache):
955         (WebCore::RenderThemeWidget::~RenderThemeWidget):
956         (WebCore::RenderThemeScrollbar::RenderThemeScrollbar):
957         (WebCore::RenderThemeScrollbar::stepper):
958         (WebCore::RenderThemeToggleButton::RenderThemeToggleButton):
959         (WebCore::RenderThemeButton::RenderThemeButton):
960         (WebCore::RenderThemeComboBox::RenderThemeComboBox):
961         (WebCore::RenderThemeEntry::RenderThemeEntry):
962         (WebCore::RenderThemeSearchEntry::RenderThemeSearchEntry):
963         (WebCore::RenderThemeSpinButton::RenderThemeSpinButton):
964         (WebCore::RenderThemeSlider::RenderThemeSlider):
965         (WebCore::RenderThemeProgressBar::RenderThemeProgressBar):
966         (WebCore::RenderThemeListView::RenderThemeListView):
967         (WebCore::RenderThemeIcon::RenderThemeIcon):
968         * platform/gtk/RenderThemeWidget.h: Added.
969         (WebCore::RenderThemeEntry::entry):
970         (WebCore::RenderThemeEntry::selection):
971         * platform/gtk/ScrollbarThemeGtk.cpp:
972         (WebCore::ScrollbarThemeGtk::themeChanged):
973         (WebCore::ScrollbarThemeGtk::updateThemeProperties):
974         (WebCore::widgetTypeForScrollbar):
975         (WebCore::contentsRectangle):
976         (WebCore::ScrollbarThemeGtk::trackRect):
977         (WebCore::ScrollbarThemeGtk::backButtonRect):
978         (WebCore::ScrollbarThemeGtk::forwardButtonRect):
979         (WebCore::ScrollbarThemeGtk::paint):
980         (WebCore::ScrollbarThemeGtk::scrollbarThickness):
981         (WebCore::ScrollbarThemeGtk::minimumThumbLength):
982         * rendering/RenderThemeGtk.cpp:
983         (WebCore::createStyleContext):
984         (WebCore::setToggleSize):
985         (WebCore::paintToggle):
986         (WebCore::RenderThemeGtk::paintButton):
987         (WebCore::menuListColor):
988         (WebCore::RenderThemeGtk::popupInternalPaddingBox):
989         (WebCore::RenderThemeGtk::paintMenuList):
990         (WebCore::RenderThemeGtk::adjustTextFieldStyle):
991         (WebCore::RenderThemeGtk::paintTextField):
992         (WebCore::adjustSearchFieldIconStyle):
993         (WebCore::paintSearchFieldIcon):
994         (WebCore::RenderThemeGtk::paintSliderTrack):
995         (WebCore::RenderThemeGtk::adjustSliderThumbSize):
996         (WebCore::RenderThemeGtk::paintSliderThumb):
997         (WebCore::RenderThemeGtk::progressBarRectForBounds):
998         (WebCore::RenderThemeGtk::paintProgressBar):
999         (WebCore::RenderThemeGtk::adjustInnerSpinButtonStyle):
1000         (WebCore::RenderThemeGtk::paintInnerSpinButton):
1001         (WebCore::styleColor):
1002         (WebCore::RenderThemeGtk::platformActiveSelectionBackgroundColor):
1003         (WebCore::RenderThemeGtk::platformInactiveSelectionBackgroundColor):
1004         (WebCore::RenderThemeGtk::platformActiveSelectionForegroundColor):
1005         (WebCore::RenderThemeGtk::platformInactiveSelectionForegroundColor):
1006         (WebCore::RenderThemeGtk::paintMediaButton):
1007
1008 2017-06-01  Andreas Kling  <akling@apple.com>
1009
1010         [Mac] Remove backing store for layers that are outside the viewport
1011         https://bugs.webkit.org/show_bug.cgi?id=170082
1012         <rdar://problem/31245009>
1013
1014         Reviewed by Simon Fraser.
1015
1016         Implement the backingStoreAttached flag in PlatformCALayerCocoa. This means that
1017         compositing layers outside the tiling coverage rect will no longer have backing
1018         stores, saving large amounts of memory.
1019
1020         Also added a canDetachBackingStore flag that is set to false for scroll control
1021         layers, to avoid complicating coverage rect computations.
1022
1023         Test: compositing/backing-store-attachment-1.html
1024
1025         * page/Frame.h:
1026         * platform/graphics/GraphicsLayer.cpp:
1027         (WebCore::GraphicsLayer::GraphicsLayer):
1028         (WebCore::GraphicsLayer::dumpProperties):
1029         * platform/graphics/GraphicsLayer.h:
1030         (WebCore::GraphicsLayer::backingStoreAttached):
1031         (WebCore::GraphicsLayer::setCanDetachBackingStore):
1032         (WebCore::GraphicsLayer::canDetachBackingStore):
1033         * platform/graphics/GraphicsLayerClient.h:
1034         * platform/graphics/ca/GraphicsLayerCA.cpp:
1035         (WebCore::GraphicsLayerCA::backingStoreAttached):
1036         (WebCore::GraphicsLayerCA::setNeedsDisplay):
1037         (WebCore::GraphicsLayerCA::updateCoverage):
1038         * platform/graphics/ca/GraphicsLayerCA.h:
1039         * platform/graphics/ca/PlatformCALayer.h:
1040         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
1041         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
1042         (PlatformCALayerCocoa::setBackingStoreAttached):
1043         (PlatformCALayerCocoa::backingStoreAttached):
1044         * rendering/RenderLayerBacking.cpp:
1045         (WebCore::RenderLayerBacking::updateOverflowControlsLayers):
1046         * rendering/RenderLayerCompositor.cpp:
1047         (WebCore::RenderLayerCompositor::layerTreeAsText):
1048         (WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
1049         * testing/Internals.cpp:
1050         (WebCore::toLayerTreeFlags):
1051         * testing/Internals.h:
1052         * testing/Internals.idl:
1053
1054 2017-06-01  Ryan Haddad  <ryanhaddad@apple.com>
1055
1056         Unreviewed, rolling out r217691.
1057
1058         This change broke the Windows build.
1059
1060         Reverted changeset:
1061
1062         "Web Inspector: Should see active Web Sockets when opening Web
1063         Inspector"
1064         https://bugs.webkit.org/show_bug.cgi?id=172312
1065         http://trac.webkit.org/changeset/217691
1066
1067 2017-06-01  Joseph Pecoraro  <pecoraro@apple.com>
1068
1069         Unreviewed Windows build fix after r217691.
1070
1071         * Modules/websockets/WebSocketChannel.cpp:
1072         (WebCore::WebSocketChannel::sendFrame):
1073         * Modules/websockets/WebSocketChannel.h:
1074         Disambiguate the Function being used.
1075
1076 2017-06-01  Youenn Fablet  <youenn@apple.com>
1077
1078         LibWebRTC might crash with frames having a null width or height
1079         https://bugs.webkit.org/show_bug.cgi?id=172842
1080         <rdar://problem/32514813>
1081
1082         Reviewed by Jon Lee.
1083
1084         Do not send black frames in case the video width or height is zero.
1085         Also ensure that even if a null buffer is returned by the pool, no crash might actually happen.
1086
1087         * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:
1088         (WebCore::RealtimeOutgoingVideoSource::sendBlackFramesIfNeeded):
1089         (WebCore::RealtimeOutgoingVideoSource::videoSampleAvailable):
1090
1091 2017-06-01  Devin Rousso  <drousso@apple.com>
1092
1093         Web Inspector: Should see active Web Sockets when opening Web Inspector
1094         https://bugs.webkit.org/show_bug.cgi?id=172312
1095
1096         Reviewed by Joseph Pecoraro.
1097
1098         Test: http/tests/websocket/tests/hybi/inspector/before-load.html
1099
1100         * Modules/websockets/WebSocket.h:
1101         * Modules/websockets/WebSocket.cpp:
1102         (WebCore::WebSocket::WebSocket):
1103         (WebCore::WebSocket::~WebSocket):
1104         (WebCore::WebSocket::allActiveWebSockets):
1105         (WebCore::WebSocket::allActiveWebSocketsMutex):
1106         (WebCore::WebSocket::channel):
1107         (WebCore::WebSocket::eventTargetInterface):
1108         Add a static set of all WebSocket objects and provide getters to access web socket metadata.
1109
1110         * Modules/websockets/ThreadableWebSocketChannel.h:
1111         (WebCore::ThreadableWebSocketChannel::isWebSocketChannel):
1112         * Modules/websockets/WebSocketChannel.h:
1113         * Modules/websockets/WebSocketChannel.cpp:
1114         (WebCore::WebSocketChannel::isWebSocketChannel):
1115         (WebCore::WebSocketChannel::identifier):
1116         (WebCore::WebSocketChannel::clientHandshakeRequest):
1117         (WebCore::WebSocketChannel::serverHandshakeResponse):
1118         (WebCore::WebSocketChannel::handshakeMode):
1119         (WebCore::WebSocketChannel::isType):
1120         Provide getters to access web socket metadata.
1121
1122         * inspector/InspectorNetworkAgent.cpp:
1123         (WebCore::InspectorNetworkAgent::enable):
1124         Loops over the static set of all WebSocket objects and sends events for each to the frontend.
1125
1126 2017-06-01  Simon Fraser  <simon.fraser@apple.com>
1127
1128         REGRESSION (r217296): Dragging a video only shows controls during drag event
1129         https://bugs.webkit.org/show_bug.cgi?id=172837
1130         rdar://problem/32434661
1131
1132         Reviewed by Zalan Bujtas.
1133
1134         r217296 changed RenderVideo::paintReplaced() from checking paintBehavior() flags on the FrameView
1135         to paintInfo.paintBehavior flags. However, RenderLayer was stripping the PaintBehaviorFlattenCompositingLayers
1136         flag from the paintInfo.paintBehavior flags, so fix that.
1137
1138         Not easily testable.
1139
1140         * rendering/RenderLayer.cpp:
1141         (WebCore::RenderLayer::paintLayerContents):
1142
1143 2017-06-01  Simon Fraser  <simon.fraser@apple.com>
1144
1145         Remove the redundant selectionOnly argument from RenderLayer::paintForegroundForFragments()
1146         https://bugs.webkit.org/show_bug.cgi?id=172835
1147
1148         Reviewed by Zalan Bujtas.
1149
1150         The 'selectionOnly' state is already encoded in localPaintingInfo.paintBehavior so there's
1151         no need to pass it separately.
1152
1153         * rendering/RenderLayer.cpp:
1154         (WebCore::RenderLayer::paintLayerContents):
1155         (WebCore::RenderLayer::paintForegroundForFragments):
1156         * rendering/RenderLayer.h:
1157
1158 2017-06-01  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>
1159
1160         Fix compilation errors in LocalizedStrings.cpp on platform not USE(CF) nor USE(GLIB)
1161         https://bugs.webkit.org/show_bug.cgi?id=172796
1162
1163         Reviewed by Alex Christensen.
1164
1165         No new tests needed. Fixing compilation errors.
1166
1167         * platform/LocalizedStrings.cpp:
1168         (WebCore::contextMenuItemTagLookUpInDictionary):
1169         (WebCore::imageTitle):
1170         (WebCore::validationMessageRangeUnderflowText):
1171         (WebCore::validationMessageRangeOverflowText):
1172
1173 2017-06-01  Chris Dumez  <cdumez@apple.com>
1174
1175         Unreviewed, rolling out r217647.
1176
1177         No longer needed after r217682
1178
1179         Reverted changeset:
1180
1181         "Avoid iterator invalidation bug in
1182         WebCore::defaultPortForProtocol"
1183         https://bugs.webkit.org/show_bug.cgi?id=172786
1184         http://trac.webkit.org/changeset/217647
1185
1186 2017-06-01  Chris Dumez  <cdumez@apple.com>
1187
1188         Make WebCore::defaultPortForProtocol() thread-safe
1189         https://bugs.webkit.org/show_bug.cgi?id=172797
1190
1191         Reviewed by Brent Fulgham.
1192
1193         Make WebCore::defaultPortForProtocol() thread-safe since it is called from the SecurityOrigin
1194         constructor and SecurityOrigin objects are constructed from various threads.
1195
1196         This should not regress the non-testing code paths since we only pay locking costs if
1197         a default port override has been set by the tests.
1198
1199         * platform/URL.cpp:
1200         (WebCore::defaultPortForProtocolMapLock):
1201         (WebCore::defaultPortForProtocolMapForTesting):
1202         (WebCore::ensureDefaultPortForProtocolMapForTesting):
1203         (WebCore::registerDefaultPortForProtocolForTesting):
1204         (WebCore::clearDefaultPortForProtocolMapForTesting):
1205         (WebCore::defaultPortForProtocol):
1206
1207 2017-06-01  Andy Estes  <aestes@apple.com>
1208
1209         REGRESSION (r217626): ENABLE_APPLE_PAY_SESSION_V3 was disabled by mistake
1210         https://bugs.webkit.org/show_bug.cgi?id=172828
1211
1212         Reviewed by Beth Dakin.
1213
1214         * Configurations/FeatureDefines.xcconfig:
1215
1216 2017-06-01  Frederic Wang  <fwang@igalia.com>
1217
1218         ScrollingCoordinator::updateSynchronousScrollingReasons should consider non-main frames
1219         https://bugs.webkit.org/show_bug.cgi?id=172806
1220
1221         Reviewed by Simon Fraser.
1222
1223         Currently, the scrolling coordinator does not manage scrolling of frames other than the main
1224         one (bugs 171667 and 149264) and so ScrollingCoordinator::updateSynchronousScrollingReasons
1225         is only relevant for the main frame. This commit refactors a bit ScrollingCoordinator so that
1226         updateSynchronousScrollingReasons is considered for all the frames whose scrolling is
1227         coordinated by the ScrollingCoordinator so non-main frames will be considered in the future.
1228
1229         No new tests, behavior is unchanged for now.
1230
1231         * page/scrolling/ScrollingCoordinator.cpp:
1232         (WebCore::ScrollingCoordinator::updateSynchronousScrollingReasons): Add an ASSERT to ensure
1233         that this function is only called for frame whose scrolling is coordinated by this class.
1234         (WebCore::ScrollingCoordinator::updateSynchronousScrollingReasonsForAllFrames): Introduce a
1235         new function to update synchronous scrolling for subframes whose scrolling is coordinated by
1236         this class.
1237         (WebCore::ScrollingCoordinator::setForceSynchronousScrollLayerPositionUpdates): Update
1238         synchronous scrolling reason for non-main frames too.
1239         (WebCore::ScrollingCoordinator::replaySessionStateDidChange): Update synchronous scrolling
1240         reason for non-main frames too.
1241         * page/scrolling/ScrollingCoordinator.h: Define updateSynchronousScrollingReasonsForAllFrames
1242
1243 2017-06-01  Andy Estes  <aestes@apple.com>
1244
1245         [Cocoa] Upstream support for JCB as a supported payment network
1246         https://bugs.webkit.org/show_bug.cgi?id=172819
1247
1248         Reviewed by Tim Horton.
1249
1250         * Modules/applepay/PaymentRequest.cpp:
1251         (WebCore::PaymentRequest::isValidSupportedNetwork):
1252         (WebCore::isAdditionalValidSupportedNetwork): Deleted.
1253
1254 2017-06-01  Chris Dumez  <cdumez@apple.com>
1255
1256         Unreviewed, rolling out r217660.
1257
1258         This should not have landed given that the new assertion is
1259         hit on debug EWS bots
1260
1261         Reverted changeset:
1262
1263         "Make sure we don't access WebCore::defaultPortForProtocol
1264         from non-main thread"
1265         https://bugs.webkit.org/show_bug.cgi?id=172797
1266         http://trac.webkit.org/changeset/217660
1267
1268 2017-06-01  Brent Fulgham  <bfulgham@apple.com>
1269
1270         Make sure we don't access WebCore::defaultPortForProtocol from non-main thread
1271         https://bugs.webkit.org/show_bug.cgi?id=172797
1272
1273         Reviewed by Alex Christensen.
1274
1275         * platform/URL.cpp:
1276         (WebCore::defaultPortForProtocol): Add an assertion to make sure we don't access the
1277         DefaultPortForProtocolMapForTesting from multiple threads.
1278
1279 2017-06-01  Konstantin Tokarev  <annulen@yandex.ru>
1280
1281         Get rid of more HIGH_DPI_CANVAS leftovers
1282         https://bugs.webkit.org/show_bug.cgi?id=172751
1283
1284         Reviewed by Simon Fraser.
1285
1286         Get rid of HTMLCanvasElement::convertLogicalToDevice() and
1287         HTMLCanvasElement::convertDeviceToLogical() that are no longer needed,
1288         as canvas doesn't use device scale factor anymore.
1289
1290         No new tests needed.
1291
1292         * html/HTMLCanvasElement.cpp:
1293         (WebCore::HTMLCanvasElement::createImageBuffer): Use integer width()
1294         and height() instead of floating-point temporary deviceSize variable.
1295         (WebCore::HTMLCanvasElement::baseTransform): Return unmodified
1296         baseTransform of underlying ImageBuffer.
1297         * html/HTMLCanvasElement.h: Removed declarations of unused methods.
1298
1299 2017-05-31  Brent Fulgham  <bfulgham@apple.com>
1300
1301         Avoid iterator invalidation bug in WebCore::defaultPortForProtocol
1302         https://bugs.webkit.org/show_bug.cgi?id=172786
1303         <rdar://problem/32499586>
1304
1305         Reviewed by Chris Dumez.
1306
1307         Create the SecurityOrigin objects on the main thread (rather than the worker queues)
1308         since defaultPortForProtocol is not threadsafe.
1309
1310         * loader/ResourceLoadObserver.cpp:
1311         (WebCore::ResourceLoadObserver::logFrameNavigation):
1312         (WebCore::ResourceLoadObserver::logSubresourceLoading):
1313         (WebCore::ResourceLoadObserver::logWebSocketLoading):
1314
1315 2017-05-31  Mark Lam  <mark.lam@apple.com>
1316
1317         Remove overrides of visitChildren() that do not add any functionality.
1318         https://bugs.webkit.org/show_bug.cgi?id=172789
1319         <rdar://problem/32500865>
1320
1321         Reviewed by Andreas Kling.
1322
1323         No new tests needed.  Just deleting unneeded code.
1324
1325         * bindings/js/JSDOMWindowBase.cpp:
1326         (WebCore::JSDOMWindowBase::visitChildren): Deleted.
1327         * bindings/js/JSDOMWindowBase.h:
1328
1329 2017-05-31  Don Olmstead  <don.olmstead@am.sony.com>
1330
1331         [WebCore] Update AXObjectCache::startOrEndCharacterOffsetForRange signature for !HAVE(ACCESSIBILITY)
1332         https://bugs.webkit.org/show_bug.cgi?id=172769
1333
1334         Reviewed by Yusuke Suzuki.
1335
1336         No new tests. No change in behavior.
1337
1338         * accessibility/AXObjectCache.h:
1339         (WebCore::AXObjectCache::startOrEndCharacterOffsetForRange):
1340         * platform/Curl.cmake: Added.
1341
1342 2017-05-31  Mark Lam  <mark.lam@apple.com>
1343
1344         CodeGeneratorJS's InstanceNeedsVisitChildren should not return true just because a class is / extends EventTarget.
1345         https://bugs.webkit.org/show_bug.cgi?id=172782
1346         <rdar://problem/32498266>
1347
1348         Reviewed by Chris Dumez.
1349
1350         No new tests needed.  This change is covered by existing binding tests.
1351
1352         InstanceNeedsVisitChildren should also not check the IsJSBuiltinConstructor
1353         condition, which is not used to emit any additional code in the visitChildren
1354         override.
1355
1356         The other conditions for generating visitChildren() are adequate if the class
1357         needs to override visitChildren.  Currently, we're generating some visitChildren()
1358         methods that only call its Base::visitChildren().  Removing the "is / extends
1359         EventTarget" conditions removes those unneeded visitChildren overrides.
1360
1361         * bindings/scripts/CodeGeneratorJS.pm:
1362         (InstanceNeedsVisitChildren):
1363         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
1364         (WebCore::JSTestClassWithJSBuiltinConstructor::visitChildren): Deleted.
1365         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.h:
1366         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
1367         (WebCore::JSTestDOMJIT::visitChildren): Deleted.
1368         * bindings/scripts/test/JS/JSTestDOMJIT.h:
1369         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
1370         (WebCore::JSTestEventTarget::visitChildren): Deleted.
1371         * bindings/scripts/test/JS/JSTestEventTarget.h:
1372         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
1373         (WebCore::JSTestJSBuiltinConstructor::visitChildren): Deleted.
1374         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.h:
1375         * bindings/scripts/test/JS/JSTestNode.cpp:
1376         (WebCore::JSTestNode::visitChildren): Deleted.
1377         * bindings/scripts/test/JS/JSTestNode.h:
1378
1379 2017-05-31  Chris Dumez  <cdumez@apple.com>
1380
1381         Make QualifiedName cache per thread
1382         https://bugs.webkit.org/show_bug.cgi?id=172778
1383         <rdar://problem/32490942>
1384
1385         Reviewed by Geoffrey Garen.
1386
1387         Make QualifiedName cache per thread since it is currently used from multiple threads,
1388         in an unsafe fashion. We started using QualifiedName objects in background threads
1389         after r190602 which started using a CSSSelectorParser in the ContentExtensionParser.
1390
1391         * WebCore.xcodeproj/project.pbxproj:
1392         * dom/QualifiedName.cpp:
1393         (WebCore::QualifiedName::QualifiedName):
1394         (WebCore::QualifiedName::QualifiedNameImpl::~QualifiedNameImpl):
1395         * dom/QualifiedNameCache.cpp: Added.
1396         (WebCore::QNameComponentsTranslator::hash):
1397         (WebCore::QNameComponentsTranslator::equal):
1398         (WebCore::QNameComponentsTranslator::translate):
1399         (WebCore::QualifiedNameCache::getOrCreate):
1400         (WebCore::QualifiedNameCache::remove):
1401         * dom/QualifiedNameCache.h: Added.
1402         * platform/ThreadGlobalData.cpp:
1403         (WebCore::ThreadGlobalData::ThreadGlobalData):
1404         (WebCore::ThreadGlobalData::destroy):
1405         * platform/ThreadGlobalData.h:
1406         (WebCore::ThreadGlobalData::qualifiedNameCache):
1407
1408 2017-05-31  Andy Estes  <aestes@apple.com>
1409
1410         Rename ENABLE_APPLE_PAY_DELEGATE to ENABLE_APPLE_PAY_SESSION_V3 and bump the supported version number
1411         https://bugs.webkit.org/show_bug.cgi?id=172366
1412
1413         Reviewed by Daniel Bates.
1414
1415         * Configurations/FeatureDefines.xcconfig:
1416         * Modules/applepay/ApplePayError.idl:
1417         * Modules/applepay/ApplePayPaymentAuthorizationResult.idl:
1418         * Modules/applepay/ApplePayPaymentMethodUpdate.idl:
1419         * Modules/applepay/ApplePaySession.idl:
1420         * Modules/applepay/ApplePayShippingContactUpdate.idl:
1421         * Modules/applepay/ApplePayShippingMethodUpdate.idl:
1422
1423 2017-05-31  Youenn Fablet  <youenn@apple.com>
1424
1425         PeerConnection should respect tracks that are muted at the time they are added
1426         https://bugs.webkit.org/show_bug.cgi?id=172771
1427
1428         Reviewed by Eric Carlson.
1429
1430         Tests: webrtc/peer-connection-audio-unmute.html
1431                webrtc/video-unmute.html
1432
1433         Making sure that muted/enabled state of sources are correctly handled at creation time of the outgoing webrtc sources.
1434         This should trigger silent audio and black frames.
1435
1436         * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
1437         (WebCore::RealtimeOutgoingAudioSource::RealtimeOutgoingAudioSource):
1438         (WebCore::RealtimeOutgoingAudioSource::setSource):
1439         (WebCore::RealtimeOutgoingAudioSource::initializeConverter):
1440         * platform/mediastream/mac/RealtimeOutgoingAudioSource.h:
1441         * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:
1442         (WebCore::RealtimeOutgoingVideoSource::RealtimeOutgoingVideoSource):
1443         (WebCore::RealtimeOutgoingVideoSource::setSource):
1444         (WebCore::RealtimeOutgoingVideoSource::sourceMutedChanged):
1445         (WebCore::RealtimeOutgoingVideoSource::sourceEnabledChanged):
1446         (WebCore::RealtimeOutgoingVideoSource::initializeFromSource):
1447         (WebCore::RealtimeOutgoingVideoSource::AddOrUpdateSink):
1448         (WebCore::RealtimeOutgoingVideoSource::RemoveSink):
1449         (WebCore::RealtimeOutgoingVideoSource::sendBlackFramesIfNeeded):
1450         (WebCore::RealtimeOutgoingVideoSource::setSizeFromSource): Deleted.
1451         (WebCore::RealtimeOutgoingVideoSource::sendBlackFrames): Deleted.
1452         * platform/mediastream/mac/RealtimeOutgoingVideoSource.h:
1453
1454 2017-05-31  Antti Koivisto  <antti@apple.com>
1455
1456         CrashTracer: Regression : com.apple.WebKit.WebContent at STP responsible :: com.apple.WebCore: WebCore::SharedBuffer::data const + 11
1457         https://bugs.webkit.org/show_bug.cgi?id=172747
1458         <rdar://problem/32275314>
1459
1460         Reviewed by Andreas Kling.
1461
1462         Test: http/tests/subresource-integrity/empty-stylesheet-integrity-crash.html
1463
1464         * loader/SubresourceIntegrity.cpp:
1465         (WebCore::matchIntegrityMetadata):
1466
1467             If the resource body is empty CachedResource::resourceBuffer() may be null.
1468
1469 2017-05-31  Frederic Wang  <fwang@igalia.com>
1470
1471         ScrollingStateScrollingNode::ChangedProperty::NumScrollingStateNodeBits is wrongly set
1472         https://bugs.webkit.org/show_bug.cgi?id=172349
1473
1474         Reviewed by Simon Fraser.
1475
1476         ScrollingStateScrollingNode::ChangedProperty::NumScrollingStateNodeBits was introduced in
1477         r133022 so that ScrollingStateFrameScrollingNode and ScrollingStateOverflowScrollingNode
1478         know the number of bits use for properties in their parent class.
1479
1480         In r172649, r210560, r185762 and r183702 new properties were added to
1481         ScrollingStateScrollingNode but NumScrollingStateNodeBits was not increased accordingly. This
1482         means that there are potential conflicts between these new properties and those of derived
1483         classes ScrollingStateFrameScrollingNode and ScrollingStateOverflowScrollingNode. It is not
1484         clear how to write a test case reproducing such conflict, though.
1485
1486         No new tests, this is a coding mistake but its effect is unclear.
1487
1488         * page/scrolling/ScrollingStateNode.cpp:
1489         (WebCore::ScrollingStateNode::setPropertyChanged): Use hasChangedProperty and cast to
1490         64-bits integer before shifting.
1491         * page/scrolling/ScrollingStateNode.h: Add a comment to make clear NumStateNodeBits must
1492         remain at the last position. Ensure we have enough bits available.
1493         (WebCore::ScrollingStateNode::hasChangedProperty): Cast to 64-bits integer before shifting.
1494         * page/scrolling/ScrollingStateScrollingNode.h: Fix position of NumScrollingStateNodeBits and
1495         also add a similar comment.
1496
1497 2017-05-31  Matt Lewis  <jlewis3@apple.com>
1498
1499         Unreviewed, rolling out r217603.
1500
1501         This patch broke the internal builds.
1502
1503         Reverted changeset:
1504
1505         "Get <chrono> out of StdLibExtras.h"
1506         https://bugs.webkit.org/show_bug.cgi?id=172744
1507         http://trac.webkit.org/changeset/217603
1508
1509 2017-05-31  Simon Fraser  <simon.fraser@apple.com>
1510
1511         Get <chrono> out of StdLibExtras.h
1512         https://bugs.webkit.org/show_bug.cgi?id=172744
1513
1514         Reviewed by Saam Barati.
1515
1516         Only bring in <chrono> and namespace std::literals::chrono_literals when necessary.
1517
1518         * fileapi/FileReader.cpp:
1519         * inspector/InspectorOverlay.cpp:
1520         * loader/CrossOriginPreflightResultCache.cpp:
1521         * loader/cache/CachedResource.cpp:
1522         (WebCore::CachedResource::freshnessLifetime):
1523         * page/ResourceUsageThread.cpp:
1524         (WebCore::ResourceUsageThread::threadBody):
1525         * page/cocoa/MemoryReleaseCocoa.mm:
1526         (WebCore::jettisonExpensiveObjectsOnTopLevelNavigation):
1527         * platform/network/CacheValidation.cpp:
1528         (WebCore::computeFreshnessLifetimeForHTTPFamily):
1529         * platform/network/CacheValidation.h:
1530
1531 2017-05-31  Emilio Cobos Álvarez  <ecobos@igalia.com>
1532
1533         Use the rare data's RenderStyle for display: contents.
1534         https://bugs.webkit.org/show_bug.cgi?id=172721
1535
1536         Reviewed by Antti Koivisto.
1537
1538         No new tests, no behavior change.
1539
1540         * dom/Element.cpp:
1541         (WebCore::Element::hasDisplayContents):
1542         (WebCore::Element::storeDisplayContentsStyle):
1543         * dom/Element.h:
1544         * dom/ElementRareData.h:
1545         (WebCore::ElementRareData::ElementRareData):
1546         * style/RenderTreeUpdater.cpp:
1547         (WebCore::RenderTreeUpdater::updateElementRenderer):
1548         * style/StyleTreeResolver.cpp:
1549         (WebCore::Style::TreeResolver::resolveComposedTree):
1550
1551 2017-05-31  Per Arne Vollan  <pvollan@apple.com>
1552
1553         LayoutTest media/video-orientation.html is failing
1554         https://bugs.webkit.org/show_bug.cgi?id=172648
1555         <rdar://problem/31322425>
1556
1557         Reviewed by Eric Carlson.
1558
1559         For videos with rotation tag set, the transform AVAssetTrack.preferredTransform applied to
1560         AVAssetTrack.naturalSize might return a CGSize instance with negative width or height.
1561
1562         Covered by existing tests.
1563
1564         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1565         (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged):
1566
1567 2017-05-30  Frederic Wang  <fwang@igalia.com>
1568
1569         Include ScrollingTreeScrollingNode properties in ScrollingTreeFrameScrollingNode::dumpProperties
1570         https://bugs.webkit.org/show_bug.cgi?id=172287
1571
1572         Reviewed by Simon Fraser.
1573
1574         No new tests, only changes in dumped tree.
1575
1576         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
1577         (WebCore::ScrollingTreeFrameScrollingNode::dumpProperties): Print properties of the parent class.
1578
1579 2017-05-30  Sam Weinig  <sam@webkit.org>
1580
1581         Update test result after r217585.
1582
1583         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
1584         (WebCore::JSTestNamedDeleterWithIndexedGetter::deleteProperty):
1585         (WebCore::JSTestNamedDeleterWithIndexedGetter::deletePropertyByIndex):
1586
1587 2017-05-30  Dan Bernstein  <mitz@apple.com>
1588
1589         Fixed the build after r217588.
1590
1591         * page/FrameView.h: Stopped exporting a function defined inline.
1592
1593 2017-05-30  Zalan Bujtas  <zalan@apple.com>
1594
1595         ASSERTION FAILED: m_layoutPhase == InPostLayerPositionsUpdatedAfterLayout || m_layoutPhase == OutsideLayout
1596         https://bugs.webkit.org/show_bug.cgi?id=171501
1597         <rdar://problem/31977453>
1598
1599         Reviewed by Simon Fraser.
1600
1601         We should be able to paint as long as the tree is clean and we are in paintable state.
1602
1603         * page/FrameView.cpp:
1604         (WebCore::FrameView::paintContents):
1605
1606 2017-05-30  Sam Weinig  <sam@webkit.org>
1607
1608         Revert accidentally checked in change.
1609
1610         * crypto/mac/CryptoAlgorithmRSA_PSSMac.cpp:
1611         * crypto/mac/CryptoDigestAlgorithm.h:
1612
1613 2017-05-30  Sam Weinig  <sam@webkit.org>
1614
1615         [WebIDL] Generate named property deleters
1616         https://bugs.webkit.org/show_bug.cgi?id=172688
1617
1618         Reviewed by Chris Dumez.
1619
1620         Test: js/dom/named-property-deleter.html
1621
1622         * WebCore.xcodeproj/project.pbxproj:
1623         Add new file, JSDOMAbstractOperations.h
1624
1625         * bindings/js/JSDOMAbstractOperations.h: Added.
1626         (WebCore::isVisibleNamedProperty):
1627         Add an implementation of the abstract operation WebIDL calls the 'named property visibility algorithm'.
1628         It is used by many WebIDL algorithms, but currently I am only using this implementation for deleters.
1629         In the future, we should try and move the other property access generators to use it as well.
1630
1631         * bindings/js/JSDOMStringMapCustom.cpp:
1632         (WebCore::JSDOMStringMap::deleteProperty): Deleted.
1633         (WebCore::JSDOMStringMap::deletePropertyByIndex): Deleted.
1634         * bindings/js/JSStorageCustom.cpp:
1635         (WebCore::JSStorage::deleteProperty): Deleted.
1636         (WebCore::JSStorage::deletePropertyByIndex): Deleted.
1637         Remove now generated deleteProperty and deletePropertyByIndex implementations.
1638
1639         * bindings/scripts/CodeGeneratorJS.pm:
1640         (GenerateDeletePropertyCommon):
1641         (GenerateDeletePropertyDefinition):
1642         (GenerateDeletePropertyByIndexDefinition):
1643         (GenerateNamedDeleterDefinition):
1644         Added generation for named deleters. We generate both deleteProperty and deletePropertyByIndex.
1645
1646         (InstanceOverridesDelete):
1647         Add predicate for whether the header should declare deleteProperty and deletePropertyByIndex.
1648
1649         (GenerateHeader):
1650         Move property access hook declarations closer to each other. Use new InstanceOverridesDelete
1651         predicate for deleteProperty and deletePropertyByIndex.
1652  
1653         (GenerateImplementation):
1654         Add call to generate named deleter if one exists.
1655
1656         (GenerateConstructorHelperMethods):
1657         Remove an old FIXME that that was no longer true, there are no more interfaces that inherit from
1658         an interface with [NoInterfaceObject].
1659
1660         * dom/DOMStringMap.idl:
1661         Removes CustomDeleteProperty and sorts extended attributes.
1662
1663         * dom/DatasetDOMStringMap.h:
1664         * dom/DatasetDOMStringMap.cpp:
1665         (WebCore::DatasetDOMStringMap::isSupportedPropertyName):
1666         Added. This is a bindings support function (much like supportedPropertyNames()) that is
1667         used JSDOMAbstractOperations.h's isVisibleNamedProperty.
1668
1669         (WebCore::DatasetDOMStringMap::supportedPropertyNames):
1670         Convert to an early return.
1671
1672         (WebCore::DatasetDOMStringMap::deleteNamedProperty):
1673         (WebCore::DatasetDOMStringMap::deleteItem): Deleted.
1674         Renamed deleteItem to deleteNamedProperty, which is the name the bindings use for deleter
1675         operations without an identifier.
1676
1677         * page/DOMWindow.cpp:
1678         (WebCore::DOMWindow::sessionStorage):
1679         Fix incorrect indentation that bothered me.
1680
1681         * storage/Storage.cpp:
1682         * storage/Storage.h:
1683         - Remove isDisabledByPrivateBrowsing(), which had no definition.
1684         - Add isSupportedPropertyName(), which the deleter code (via the isVisibleNamedProperty algorithm)
1685           needs.
1686         
1687         * storage/Storage.idl:
1688         Removes CustomDeleteProperty, sorts the extended attributes, adds 'deleter' special 
1689         to the removeItem operation and adds a commented out 'setter' special to the 'setItem'
1690         operation.
1691
1692         * bindings/scripts/test/JS/JSTestObj.h:
1693         Update result for declarations moving around.
1694
1695         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp: Added.
1696         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.h: Added.
1697         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp: Added.
1698         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.h: Added.
1699         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp: Added.
1700         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.h: Added.
1701         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp: Added.
1702         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.h: Added.
1703         * bindings/scripts/test/TestNamedDeleterNoIdentifier.idl: Added.
1704         * bindings/scripts/test/TestNamedDeleterThrowingException.idl: Added.
1705         * bindings/scripts/test/TestNamedDeleterWithIdentifier.idl: Added.
1706         * bindings/scripts/test/TestNamedDeleterWithIndexedGetter.idl: Added.
1707         Add new tests for named deleters.
1708
1709 2017-05-30  Joseph Pecoraro  <pecoraro@apple.com>
1710
1711         Web Inspector: images dragged from Inspector to Desktop are named "Unknown.png"
1712         https://bugs.webkit.org/show_bug.cgi?id=141515
1713         <rdar://problem/9251308>
1714
1715         Reviewed by Wenson Hsieh.
1716
1717         * html/HTMLAttributeNames.in:
1718
1719 2017-05-30  Youenn Fablet  <youenn@apple.com>
1720
1721         Add support for Certificate and IceCandidatePair stats
1722         https://bugs.webkit.org/show_bug.cgi?id=172734
1723
1724         Reviewed by Geoff Garen.
1725
1726         Covered by updated test.
1727
1728         Adding support for these two stats in the IDL and in the libwebrtc binding code.
1729
1730         * Modules/mediastream/RTCStatsReport.h:
1731         (WebCore::RTCStatsReport::IceCandidatePairStats::IceCandidatePairStats):
1732         (WebCore::RTCStatsReport::CertificateStats::CertificateStats):
1733         * Modules/mediastream/RTCStatsReport.idl:
1734         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1735         (WebCore::iceCandidatePairState):
1736         (WebCore::fillRTCIceCandidatePairStats):
1737         (WebCore::fillRTCCertificateStats):
1738         (WebCore::LibWebRTCMediaEndpoint::StatsCollector::OnStatsDelivered):
1739
1740 2017-05-30  Jiewen Tan  <jiewen_tan@apple.com>
1741
1742         Unreviewed, add some comments to HKDF/PBKDF2 Mac implementations
1743
1744         * crypto/mac/CryptoAlgorithmHKDFMac.cpp:
1745         (WebCore::CryptoAlgorithmHKDF::platformDeriveBits):
1746         * crypto/mac/CryptoAlgorithmPBKDF2Mac.cpp:
1747         (WebCore::CryptoAlgorithmPBKDF2::platformDeriveBits):
1748
1749 2017-05-30  Jeremy Jones  <jeremyj@apple.com>
1750
1751         m_resourceSelectionTaskQueue tasks should be cleared when player is destroyed to prevent invalid state.
1752         https://bugs.webkit.org/show_bug.cgi?id=172726
1753         rdar://problem/30867764
1754
1755         Reviewed by Eric Carlson.
1756
1757         I haven't found a reproducible way to make a test case for this race condition.
1758
1759         If m_player is cleared while there is an outstanding task in m_resourceSelectionTaskQueue,
1760         that task may assume m_player is not null and crash. It is better to cancel that task than
1761         to perform it part way with null checks.
1762
1763         * html/HTMLMediaElement.cpp:
1764         (WebCore::HTMLMediaElement::~HTMLMediaElement):
1765         (WebCore::HTMLMediaElement::clearMediaPlayer):
1766
1767 2017-05-30  Ryosuke Niwa  <rniwa@webkit.org>
1768
1769         Only include DataDetectorsUI headers in iOS
1770         https://bugs.webkit.org/show_bug.cgi?id=172633
1771
1772         Reviewed by David Kilzer.
1773
1774         Enable data detectors only on iOS and not other variants of iOS.
1775
1776         * editing/cocoa/DataDetection.h:
1777         * editing/cocoa/DataDetection.mm:
1778         * page/DragController.cpp:
1779         (WebCore::isDraggableLink):
1780         * platform/cocoa/DataDetectorsCoreSoftLink.h:
1781         * platform/cocoa/DataDetectorsCoreSoftLink.mm:
1782         * platform/spi/cocoa/DataDetectorsCoreSPI.h:
1783         * platform/spi/ios/DataDetectorsUISPI.h:
1784         * platform/spi/mac/DataDetectorsSPI.h:
1785
1786 2017-05-30  Chris Dumez  <cdumez@apple.com>
1787
1788         REGRESSION(r215946): Can't reference a table cell in Google spreadsheet
1789         https://bugs.webkit.org/show_bug.cgi?id=172703
1790         <rdar://problem/32458086>
1791
1792         Reviewed by Ryosuke Niwa.
1793
1794         We updated getClientRects() to return an array of DOMRect objects instead of
1795         a ClientRectList type, to match the latest specification. As it turns out, this
1796         is not Web-compatible as some content (as Google Spreadsheet) relies on the
1797         return type having an item() operation.
1798
1799         This patch re-introduces a DOMRectList type, with an item() operation. The
1800         DOMRectList name is currently not exposed to the Web as we do not know what's
1801         going to get specified yet (https://github.com/w3c/csswg-drafts/issues/1479).
1802
1803         No new tests, updated existing tests.
1804
1805         * CMakeLists.txt:
1806         * DerivedSources.make:
1807         * WebCore.xcodeproj/project.pbxproj:
1808         * dom/DOMRect.h:
1809         * dom/DOMRectList.cpp: Copied from Source/WebCore/dom/DOMRect.cpp.
1810         (WebCore::DOMRectList::DOMRectList):
1811         (WebCore::DOMRectList::~DOMRectList):
1812         * dom/DOMRectList.h: Copied from Source/WebCore/dom/DOMRect.cpp.
1813         (WebCore::DOMRectList::create):
1814         (WebCore::DOMRectList::length):
1815         (WebCore::DOMRectList::item):
1816         * dom/DOMRectList.idl: Renamed from Source/WebCore/dom/DOMRect.cpp.
1817         * dom/Element.cpp:
1818         (WebCore::Element::getClientRects):
1819         * dom/Element.h:
1820         * dom/Element.idl:
1821         * dom/Range.cpp:
1822         (WebCore::Range::getClientRects):
1823         * dom/Range.h:
1824         * dom/Range.idl:
1825         * page/Page.cpp:
1826         (WebCore::Page::nonFastScrollableRects):
1827         (WebCore::Page::touchEventRectsForEvent):
1828         (WebCore::Page::passiveTouchEventListenerRects):
1829         * page/Page.h:
1830         * testing/Internals.cpp:
1831         (WebCore::Internals::inspectorHighlightRects):
1832         (WebCore::Internals::touchEventRectsForEvent):
1833         (WebCore::Internals::passiveTouchEventListenerRects):
1834         (WebCore::Internals::nonFastScrollableRects):
1835         * testing/Internals.h:
1836         * testing/Internals.idl:
1837
1838 2017-05-30  Ali Juma  <ajuma@chromium.org>
1839
1840         [CredentialManagement] Incorporate IDL updates from latest spec
1841         https://bugs.webkit.org/show_bug.cgi?id=172011
1842
1843         Reviewed by Daniel Bates.
1844
1845         This patch adds IDL definitions for the CredentialsContainer, CredentialsUserData and
1846         FederatedCredentials interfaces, the NavigatorCredentials partial interface, and the
1847         CredentialCreationOptions, CredentialRequestOptions, FederatedCredentialRequestOptions,
1848         and PasswordCredentialData dictionaries. It also deletes IDL definitions for the
1849         SiteBoundCredential interface and the SiteBoundCredentialData dictionary.
1850
1851         Test: credentials/idlharness.html
1852
1853         * CMakeLists.txt:
1854         * DerivedSources.make:
1855         * Modules/credentials/BasicCredential.idl:
1856         * Modules/credentials/CredentialCreationOptions.h: Copied from Source/WebCore/Modules/credentials/PasswordCredential.cpp.
1857         * Modules/credentials/CredentialCreationOptions.idl: Copied from Source/WebCore/Modules/credentials/SiteBoundCredentialData.h.
1858         * Modules/credentials/CredentialRequestOptions.h: Copied from Source/WebCore/Modules/credentials/SiteBoundCredentialData.h.
1859         * Modules/credentials/CredentialRequestOptions.idl: Copied from Source/WebCore/Modules/credentials/SiteBoundCredentialData.h.
1860         * Modules/credentials/CredentialUserData.h: Copied from Source/WebCore/Modules/credentials/SiteBoundCredentialData.h.
1861         (WebCore::CredentialUserData::~CredentialUserData):
1862         * Modules/credentials/CredentialUserData.idl: Copied from Source/WebCore/Modules/credentials/SiteBoundCredential.idl.
1863         * Modules/credentials/CredentialsContainer.cpp: Copied from Source/WebCore/Modules/credentials/PasswordCredential.cpp.
1864         (WebCore::CredentialsContainer::get):
1865         (WebCore::CredentialsContainer::store):
1866         (WebCore::CredentialsContainer::isCreate):
1867         (WebCore::CredentialsContainer::preventSilentAccess):
1868         * Modules/credentials/CredentialsContainer.h: Copied from Source/WebCore/Modules/credentials/SiteBoundCredential.h.
1869         (WebCore::CredentialsContainer::create):
1870         (WebCore::CredentialsContainer::CredentialsContainer):
1871         * Modules/credentials/CredentialsContainer.idl: Copied from Source/WebCore/Modules/credentials/SiteBoundCredential.idl.
1872         * Modules/credentials/FederatedCredential.cpp: Copied from Source/WebCore/Modules/credentials/SiteBoundCredential.cpp.
1873         (WebCore::FederatedCredential::FederatedCredential):
1874         (WebCore::FederatedCredential::~FederatedCredential):
1875         * Modules/credentials/FederatedCredential.h: Renamed from Source/WebCore/Modules/credentials/SiteBoundCredential.h.
1876         (WebCore::FederatedCredential::create):
1877         (WebCore::FederatedCredential::provider):
1878         (WebCore::FederatedCredential::protocol):
1879         * Modules/credentials/FederatedCredential.idl: Copied from Source/WebCore/Modules/credentials/BasicCredential.idl.
1880         * Modules/credentials/FederatedCredentialInit.h: Copied from Source/WebCore/Modules/credentials/SiteBoundCredentialData.h.
1881         * Modules/credentials/FederatedCredentialInit.idl: Copied from Source/WebCore/Modules/credentials/SiteBoundCredentialData.idl.
1882         * Modules/credentials/FederatedCredentialRequestOptions.h: Copied from Source/WebCore/Modules/credentials/SiteBoundCredentialData.h.
1883         * Modules/credentials/FederatedCredentialRequestOptions.idl: Added.
1884         * Modules/credentials/NavigatorCredentials.cpp: Renamed from Source/WebCore/Modules/credentials/SiteBoundCredential.cpp.
1885         (WebCore::NavigatorCredentials::NavigatorCredentials):
1886         (WebCore::NavigatorCredentials::~NavigatorCredentials):
1887         (WebCore::NavigatorCredentials::supplementName):
1888         (WebCore::NavigatorCredentials::credentials):
1889         (WebCore::NavigatorCredentials::from):
1890         * Modules/credentials/NavigatorCredentials.h: Copied from Source/WebCore/Modules/credentials/SiteBoundCredentialData.h.
1891         * Modules/credentials/NavigatorCredentials.idl: Renamed from Source/WebCore/Modules/credentials/SiteBoundCredential.idl.
1892         * Modules/credentials/PasswordCredential.cpp:
1893         (WebCore::PasswordCredential::PasswordCredential):
1894         (WebCore::PasswordCredential::~PasswordCredential):
1895         * Modules/credentials/PasswordCredential.h:
1896         (WebCore::PasswordCredential::create):
1897         (WebCore::PasswordCredential::password):
1898         (WebCore::PasswordCredential::setIdName): Deleted.
1899         (WebCore::PasswordCredential::idName): Deleted.
1900         (WebCore::PasswordCredential::setPasswordName): Deleted.
1901         (WebCore::PasswordCredential::passwordName): Deleted.
1902         (WebCore::PasswordCredential::setAdditionalData): Deleted.
1903         (WebCore::PasswordCredential::additionalData): Deleted.
1904         * Modules/credentials/PasswordCredential.idl:
1905         * Modules/credentials/PasswordCredentialData.h: Renamed from Source/WebCore/Modules/credentials/SiteBoundCredentialData.h.
1906         * Modules/credentials/PasswordCredentialData.idl: Renamed from Source/WebCore/Modules/credentials/SiteBoundCredentialData.idl.
1907         * WebCore.xcodeproj/project.pbxproj:
1908
1909 2017-05-30  Alex Christensen  <achristensen@webkit.org>
1910
1911         Update libwebrtc configuration
1912         https://bugs.webkit.org/show_bug.cgi?id=172727
1913
1914         Reviewed by Geoffrey Garen.
1915
1916         * Configurations/FeatureDefines.xcconfig:
1917
1918 2017-05-30  Mark Lam  <mark.lam@apple.com>
1919
1920         convertEnumerationToJS() should not stash ASCIILiteral strings in NeverDestroyed arrays.
1921         https://bugs.webkit.org/show_bug.cgi?id=172724
1922         <rdar://problem/31193201>
1923
1924         Reviewed by Chris Dumez.
1925
1926         Use MAKE_STATIC_STRING_IMPL instead, which is guaranteed to be thread-safe and
1927         satisfies the promise of immortality promised by NeverDestroyed (while ASCIILiteral
1928         does not always satisfy this promise).
1929
1930         Also converted the ASSERT in convertEnumerationToJS() to a RELEASE_ASSERT as a
1931         debugging aid to check if it is ever passed an invalid enumerationValue.
1932
1933         No new tests because this is a speculative fix for an issue observed in the wild
1934         whose root cause is not known yet.  This patch also adds a release assert to
1935         gather more info about the nature of the issue.
1936
1937         * bindings/scripts/CodeGeneratorJS.pm:
1938         (GenerateEnumerationImplementationContent):
1939
1940         * bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
1941         (WebCore::convertEnumerationToJS):
1942         * bindings/scripts/test/JS/JSTestObj.cpp:
1943         (WebCore::convertEnumerationToJS):
1944         * bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
1945         (WebCore::convertEnumerationToJS):
1946         * bindings/scripts/test/JS/JSTestStandaloneEnumeration.cpp:
1947         (WebCore::convertEnumerationToJS):
1948         - re-baselined these test results.
1949
1950 2017-05-30  Said Abou-Hallawa  <sabouhallawa@apple.com>
1951
1952         REGRESSION(r216882): No image decoding is needed if the BitmapImage is created with a NativeImage
1953         https://bugs.webkit.org/show_bug.cgi?id=172670
1954
1955         Reviewed by Tim Horton.
1956
1957         Test: fast/images/large-image-webkit-canvas.html
1958
1959         Check whether the BitmapImage has created an ImageDecoder before trying 
1960         to decode its image frame.
1961
1962         * platform/graphics/ImageSource.cpp:
1963         (WebCore::ImageSource::shouldUseAsyncDecoding):
1964
1965 2017-05-30  Youenn Fablet  <youenn@apple.com>
1966
1967         RealtimeOutgoingVideoSource should not rotate muted frames
1968         https://bugs.webkit.org/show_bug.cgi?id=172659
1969
1970         Reviewed by Eric Carlson.
1971
1972         Test: webrtc/video-rotation.html
1973
1974         When sending black frames, it is unnecessary to rotate frames.
1975         Instead, it is better to create frame with the expected width and height.
1976         Making sure libwebrtc rotated images are not null, as only YUV rotation is supported.
1977
1978         Adding internals API to test part of that code path.
1979         Full coverage should be added when mock source is producing YUV images.
1980
1981         * Modules/mediastream/PeerConnectionBackend.h:
1982         (WebCore::PeerConnectionBackend::applyRotationForOutgoingVideoSources):
1983         * Modules/mediastream/RTCPeerConnection.h:
1984         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
1985         (WebCore::LibWebRTCPeerConnectionBackend::applyRotationForOutgoingVideoSources):
1986         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
1987         * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:
1988         (WebCore::RealtimeOutgoingVideoSource::sendBlackFrames):
1989         (WebCore::RealtimeOutgoingVideoSource::sendFrame):
1990         * platform/mediastream/mac/RealtimeOutgoingVideoSource.h:
1991         * testing/Internals.cpp:
1992         (WebCore::Internals::Internals):
1993         (WebCore::Internals::applyRotationForOutgoingVideoSources):
1994         (WebCore::Internals::setCameraMediaStreamTrackOrientation):
1995         * testing/Internals.h:
1996         * testing/Internals.idl:
1997
1998 2017-05-30  Brent Fulgham  <bfulgham@apple.com>
1999
2000         Unreviewed typo correction.
2001
2002         * loader/ResourceLoadObserver.cpp:
2003         (WebCore::ResourceLoadObserver::logFrameNavigation): I used an extra colon in my comment.
2004
2005 2017-05-30  Brent Fulgham  <bfulgham@apple.com>
2006
2007         REGRESSION(r217515): Correct iterator invalidation bug (AGAIN)
2008         https://bugs.webkit.org/show_bug.cgi?id=172722
2009         <rdar://problem/32462876>
2010
2011         Reviewed by Zalan Bujtas.
2012
2013         Over-enthusiastic clean-up during r217515 re-introduced a bug caused by holding a reference
2014         to an iterator that gets invalidated while handling the frame navigation. This patch returns
2015         to the copy/set behavior used prior to r217515. 
2016
2017         * loader/ResourceLoadObserver.cpp:
2018         (WebCore::ResourceLoadObserver::logFrameNavigation): Make a copy of the returned value, since
2019         the iterator will be invalidated during the function call. Then set the copy back in the data
2020         store with the updated counts.
2021
2022 2017-05-30  Fujii Hironori  <Hironori.Fujii@sony.com>
2023
2024         [WinCairo] TestWebKitAPI: SHOULD NEVER BE REACHED in WebCore::cairoSurfaceSize
2025         https://bugs.webkit.org/show_bug.cgi?id=172699
2026
2027         Reviewed by Brent Fulgham.
2028
2029         Tests: WebCore.BitmapImageEmptyFrameTest in TestWebKitAPI
2030
2031         * platform/graphics/cairo/CairoUtilities.cpp:
2032         (WebCore::cairoSurfaceSize): Added a case for win32 surface type.
2033
2034 2017-05-30  Miguel Gomez  <magomez@igalia.com>
2035
2036         [GTK][WPE][GSTREAMER_GL] Do not use cairo to copy video textures to an accelerated canvas
2037         https://bugs.webkit.org/show_bug.cgi?id=172542
2038
2039         Reviewed by Žan Doberšek.
2040
2041         When drawing gstreamer-gl video frames into an accelerated canvas, we are currently using cairo to copy
2042         the video textures into a new texture that will be painted into de destination canvas. While this eases
2043         the code, it doesn't allow us to control the copy process. This is a problem because in order to use
2044         gstreamer-gl properly, we will need to perform colorspace transformations during the copy. So, remove
2045         this cairo copy and use VideoTextureCopierGStreamer instead.
2046
2047         The usage of VideoTextureCopierGStreamer is pretty much the same than in the webgl case, except that
2048         no destination texture is provided. For that case, add a custom texture to hold the result that can
2049         be requested after the copy.
2050
2051         Covered by existent tests.
2052
2053         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2054         (WebCore::MediaPlayerPrivateGStreamerBase::copyVideoTextureToPlatformTexture):
2055         (WebCore::MediaPlayerPrivateGStreamerBase::nativeImageForCurrentTime):
2056         (WebCore::MediaPlayerPrivateGStreamerBase::prepareContextForCairoPaint): Deleted.
2057         (WebCore::MediaPlayerPrivateGStreamerBase::paintToCairoSurface): Deleted.
2058         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2059         (WebCore::MediaPlayerPrivateGStreamerBase::gstGLDisplay):
2060         * platform/graphics/gstreamer/VideoTextureCopierGStreamer.cpp:
2061         (WebCore::VideoTextureCopierGStreamer::VideoTextureCopierGStreamer):
2062         (WebCore::VideoTextureCopierGStreamer::~VideoTextureCopierGStreamer):
2063         (WebCore::VideoTextureCopierGStreamer::copyVideoTextureToPlatformTexture):
2064         * platform/graphics/gstreamer/VideoTextureCopierGStreamer.h:
2065         (WebCore::VideoTextureCopierGStreamer::resultTexture):
2066
2067 2017-05-29  Antti Koivisto  <antti@apple.com>
2068
2069         Crash on display-contents-replaced-001.html
2070         https://bugs.webkit.org/show_bug.cgi?id=172596
2071
2072         Reviewed by Andreas Kling.
2073
2074         This is crashing because some code can't handle display:contents on form controls. Turns
2075         out the draft specification tell us to disable it for them in any case.
2076
2077         See https://drafts.csswg.org/css-display-3/#unbox
2078
2079         * css/StyleResolver.cpp:
2080         (WebCore::hasEffectiveDisplayNoneForDisplayContents):
2081
2082             For certain HTML elements (replaced elements, form controls) display:contents should
2083             behave like display:none.
2084             Also disable it for SVG and MathML elements.
2085
2086         (WebCore::StyleResolver::adjustRenderStyle):
2087
2088             Also compute to display:none when there is no associated element (pseudos etc).
2089
2090 2017-05-30  Zan Dobersek  <zdobersek@igalia.com>
2091
2092         [GCrypt] RSA-OAEP support
2093         https://bugs.webkit.org/show_bug.cgi?id=171222
2094
2095         Reviewed by Michael Catanzaro.
2096
2097         Add RSA-OAEP support for configurations that use libgcrypt.
2098
2099         The encryption operation embeds the plain-text data into a data s-expression,
2100         specifying OAEP as the padding method of choice and also adding information
2101         about the hash algorithm and any label data. This is then passed to the
2102         gcry_pk_encrypt() call together with the provided key, returning the enc-val
2103         s-expression containing the resulting cipher text. That's retrieved from the
2104         relevant MPI and returned to the caller.
2105
2106         The decryption operation embeds the cipher-text data into an enc-val
2107         s-expression, again specifying the hash algorithm and also filling in any
2108         label data. This is then passed, along with the key, to the gcry_pk_decrypt()
2109         call. The returned data s-expression contains the decrypted plain-text data
2110         inside the 'value' MPI, from which this data is extracted and returned to the
2111         caller.
2112
2113         No new tests -- the revelant tests are passing and are unskipped, apart from
2114         the ones using PKSC#8 and SPKI formats.
2115
2116         * crypto/gcrypt/CryptoAlgorithmRSA_OAEPGCrypt.cpp:
2117         (WebCore::hashAlgorithmName):
2118         (WebCore::mpiData):
2119         (WebCore::gcryptEncrypt):
2120         (WebCore::gcryptDecrypt):
2121         (WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt):
2122         (WebCore::CryptoAlgorithmRSA_OAEP::platformDecrypt):
2123
2124 2017-05-30  Zan Dobersek  <zdobersek@igalia.com>
2125
2126         Unreviewed follow-up to r217546. Address some review comments that I forgot about.
2127
2128         * crypto/gcrypt/CryptoAlgorithmRSAES_PKCS1_v1_5GCrypt.cpp:
2129         (WebCore::gcryptEncrypt): Use quotations when referencing s-expression names in
2130         comments to avoid confusion.
2131         (WebCore::gcryptDecrypt): Ditto.
2132
2133 2017-05-30  Zan Dobersek  <zdobersek@igalia.com>
2134
2135         [GCrypt] RSAES-PKCS1-v1_5 support
2136         https://bugs.webkit.org/show_bug.cgi?id=171219
2137
2138         Reviewed by Michael Catanzaro.
2139
2140         Add RSAES-PKCS1-v1_5 support for configurations that use libgcrypt.
2141
2142         The encryption operation embeds the plain-text data into a data s-expression,
2143         specifying PKCS#1 as the padding method of choice. That's passed to the
2144         gcry_pk_encrypt() call together with the specified key. The returned enc-val
2145         expression contains the 'a' MPI from which the data is extracted and returned.
2146
2147         The decryption operation goes in reverse -- the cipher-text data is embedded
2148         into an enc-val s-expression that again also specifies PKCS#1 as the padding
2149         method. The s-expression is passed to gcry_pk_decrypt() together with the
2150         specified key. The returned data s-expression contains the decrypted text
2151         inside the 'value' parameter, so the data is extracted from that and returned
2152         to the caller.
2153
2154         No new tests -- the revelant tests are passing and are unskipped, apart from
2155         the ones using PKCS#8 and SPKI formats.
2156
2157         * crypto/gcrypt/CryptoAlgorithmRSAES_PKCS1_v1_5GCrypt.cpp:
2158         (WebCore::mpiData):
2159         (WebCore::gcryptEncrypt):
2160         (WebCore::gcryptDecrypt):
2161         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformEncrypt):
2162         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformDecrypt):
2163
2164 2017-05-30  Zan Dobersek  <zdobersek@igalia.com>
2165
2166         [GCrypt] RSASSA-PKCS1-v1_5 support
2167         https://bugs.webkit.org/show_bug.cgi?id=171220
2168
2169         Reviewed by Michael Catanzaro.
2170
2171         Add RSASSA-PKSC1-V_15 support for configurations that use libgcrypt.
2172
2173         The signing operation first digests data with the specified hash algorithm.
2174         That's then embedded in the data s-expression. That's then passed to the
2175         gcry_pk_sign() call together with the specified key, returning a sig-val
2176         s-expression containing the signature. The signature data is then retrieved
2177         from the relevant MPI and returned to the caller.
2178
2179         The verification operation first digests data with the specified hash
2180         algorithm. That's then embedded in the data s-expression. A sig-val
2181         s-expression is constructed, embedding the signature data. The data and
2182         sig-val s-expressions are passed to the gcry_sexp_verify() call which returns
2183         the resulting error code. The verification succeeds if the returned value is
2184         GPG_ERR_NO_ERROR, fails if it's GPG_ERR_BAD_SIGNATURE, or errors out with an
2185         OperationError otherwise.
2186
2187         No new tests -- the revelant tests are passing and are unskipped, apart from
2188         the ones using PKCS#8 and SPKI formats.
2189
2190         * crypto/gcrypt/CryptoAlgorithmRSASSA_PKCS1_v1_5GCrypt.cpp:
2191         (WebCore::hashCryptoDigestAlgorithm):
2192         (WebCore::hashAlgorithmName):
2193         (WebCore::mpiData):
2194         (WebCore::gcryptSign):
2195         (WebCore::gcryptVerify):
2196         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformSign):
2197         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformVerify):
2198
2199 2017-05-29  Emilio Cobos Álvarez  <ecobos@igalia.com>
2200
2201         Use the parent box style to adjust RenderStyle for alignment.
2202         https://bugs.webkit.org/show_bug.cgi?id=172215
2203
2204         Reviewed by Antti Koivisto.
2205
2206         The css-flexbox spec defined align-self in terms of the parent
2207         element, which is what this code did.
2208
2209         The css-align spec defines these properties in terms of the style of
2210         the containing box instead, which means display: contents styles
2211         should not be used for this adjustment, but the parent box style
2212         instead.
2213
2214         For example, align-items is defined as:
2215
2216         > This property specifies the default align-self for all of the boxes
2217         > (including anonymous boxes) participating in this box’s formatting
2218         > context.
2219
2220         Note that the css-align spec was recently updated to align (no pun
2221         intended) with Gecko, and make the |auto| value compute to itself.
2222         This patch puts us in a more recent spec than before, but not totally
2223         up-to-date.
2224
2225         Tests: imported/w3c/web-platform-tests/css/css-display-3/display-contents-alignment-001.html
2226                imported/w3c/web-platform-tests/css/css-display-3/display-contents-alignment-002.html
2227
2228         * css/StyleResolver.cpp:
2229         (WebCore::StyleResolver::adjustRenderStyle):
2230         (WebCore::StyleResolver::adjustStyleForAlignment):
2231
2232 2017-05-28  Dan Bernstein  <mitz@apple.com>
2233
2234         [Xcode] ALWAYS_SEARCH_USER_PATHS is set to YES
2235         https://bugs.webkit.org/show_bug.cgi?id=172691
2236
2237         Reviewed by Tim Horton.
2238
2239         * Configurations/Base.xcconfig: Set ALWAYS_SEARCH_USER_PATHS to NO.
2240         * WebCore.xcodeproj/project.pbxproj: Added DateTimeChooser.h, DateTimeChooserClient.h,
2241           PerformanceMark.h, PerformanceMeasure.h, SVGUnknownElement.h, and MathMLUnknownElement.h
2242           to the WebCore target.
2243
2244 2017-05-28  Sam Weinig  <sam@webkit.org>
2245
2246         [WebIDL] @@iterator should only be accessed once when disambiguating a union type
2247         https://bugs.webkit.org/show_bug.cgi?id=172684
2248
2249         Reviewed by Yusuke Suzuki.
2250
2251         WebIDL specifies that when determining if the value you are converting to a union
2252         is a sequence, you must get the @@iterator property and, should it exist, use it
2253         to iterate the sequence. While we correctly accessing the property to make the 
2254         determination, we were not passing it into the sequence conversion code, and thus
2255         the sequence conversion code re-accessed it, which is observable and wrong.
2256
2257         This patch pipes the @@iterator method through the sequence conversion code to avoid
2258         this.
2259
2260         Test: js/dom/sequence-in-union-iterator-access.html
2261
2262         * bindings/js/JSDOMConvertSequences.h:
2263         (WebCore::Detail::GenericSequenceConverter::convert):
2264         (WebCore::Detail::NumericSequenceConverter::convertArray):
2265         (WebCore::Detail::NumericSequenceConverter::convert):
2266         (WebCore::Detail::SequenceConverter::convertArray):
2267         (WebCore::Detail::SequenceConverter::convert):
2268         (WebCore::Detail::SequenceConverter<IDLLong>::convert):
2269         (WebCore::Detail::SequenceConverter<IDLFloat>::convert):
2270         (WebCore::Detail::SequenceConverter<IDLUnrestrictedFloat>::convert):
2271         (WebCore::Detail::SequenceConverter<IDLDouble>::convert):
2272         (WebCore::Detail::SequenceConverter<IDLUnrestrictedDouble>::convert):
2273         (WebCore::Converter<IDLSequence<T>>::convert):
2274         (WebCore::Converter<IDLFrozenArray<T>>::convert):
2275         Add variants of convert that take a JSObject* (sequence) / JSValue (iterator method)
2276         rather than just the JSValue (sequence). To avoid too much duplication, split some
2277         parts of SequenceConverter and NumericSequenceConverter up so they could be reused.
2278
2279         * bindings/js/JSDOMConvertUnion.h:
2280         - Fix incorrect step 3 (WebIDL got updated at some point and we didn't notice) to remove
2281           records.
2282         - Update sequence and FrozenArray checking/conversion to get the iterator method and pass
2283           it along, using the new ConditionalSequenceConverter helper which forwards to the new
2284           sequence converters that accept the iterator method.
2285
2286 2017-05-27  Chris Dumez  <cdumez@apple.com>
2287
2288         imported/w3c/web-platform-tests/html/semantics/forms/form-control-infrastructure/form_attribute.html is crashing
2289         https://bugs.webkit.org/show_bug.cgi?id=172472
2290         <rdar://problem/32334831>
2291
2292         Reviewed by Ryosuke Niwa.
2293
2294         Fix assertion hit when running imported/w3c/web-platform-tests/html/semantics/forms/form-control-infrastructure/form_attribute.html.
2295
2296         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 
2297         a form content attribute and there was another form in the document with this ID, then we would erroneously associate the descendant with
2298         that other form, even though that descendant is being disconnected. This is because when the form with the given id is removed, we
2299         notify the IdTargetObservers of the change. In this case, the form control is an IdTargetObserver and gets notified after
2300         removedFrom() has been called on the form but *before* removedFrom() has been called on its descendant form control. As a result, the
2301         form control still thinks it is in the tree (i.e. isConnected() wrongly returns true) and we make the wrong decision and try to
2302         associate it with another form in the document.
2303
2304         To address the problem, we leverage the fact that when a form element is being removed, it already notifies its associated form
2305         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.
2306         The ID observer is no longer needed beyond this point since the control is now disconnected from the document, and the ID observer
2307         callback would erroneously associate it with another form element in the document of the same ID because isConnected() still returns
2308         true at that point.
2309         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
2310         though both are detached.
2311
2312         Test: fast/dom/HTMLFormElement/form-removal-duplicate-id-crash.html
2313
2314         * dom/ContainerNode.h:
2315         (WebCore::Node::rootNode):
2316         Inline rootNode to avoid an extra function call in the fast path case. For the slow path, we now
2317         call traverseToRootNode() to avoid duolicating logic.
2318
2319         * dom/Node.cpp:
2320         (WebCore::Node::traverseToRootNode):
2321         Add a traverseToRootNode() method which gets the root node by traversing the ancestors. This logic was duplicated in 3 places:
2322         - Slow path in Node::rootNode()
2323         - computeRootNode() in FormAssociatedElement.cpp
2324         - findRoot() in HTMLFormElement.cpp
2325         They are now consolidated in a single place to avoid duplication.
2326
2327         * dom/Node.h:
2328         * html/FormAssociatedElement.cpp:
2329         (WebCore::FormAssociatedElement::removedFrom):
2330         Just simplify the logic a bit:
2331         - Clear the id observer (i.e. m_formAttributeTargetObserver) no matter what. Since the element is no longer part of the document,
2332           it is no longer needed. We would previously have checks that would basically avoid resetting m_formAttributeTargetObserver to
2333           null if it is already null. Settign m_formAttributeTargetObserver to null is cheap so there is no reason for those checks. Those
2334           checks were also confusing because they made it look like we would sometimes keep on id observer after being removed from the
2335           document.
2336         - Use new traverseToRootNode() utility function (no behavior change)
2337         - Drop unnecessary |element| local variable
2338
2339         (WebCore::FormAssociatedElement::formOwnerRemovedFromTree):
2340         - Rename to formOwnerRemovedFromTree() to make it clear that it is the element's form owner that is removed, and not just any form.
2341         - As we traverse the tree up to find the root, also check if we find the form owner. If we do, clear the id observer since we are
2342           effectively detached from the document and return early since there is no need to reset our form owner in this case.
2343
2344         * html/FormAssociatedElement.h:
2345         * html/HTMLFormElement.cpp:
2346         (WebCore::HTMLFormElement::removedFrom):
2347         - Use new traverseToRootNode() utility function (no behavior change)
2348
2349 2017-05-27  Yusuke Suzuki  <utatane.tea@gmail.com>
2350
2351         [DOMJIT] Move DOMJIT patchpoint infrastructure out of domjit
2352         https://bugs.webkit.org/show_bug.cgi?id=172260
2353
2354         Reviewed by Filip Pizlo.
2355
2356         * ForwardingHeaders/jit/Snippet.h: Renamed from Source/WebCore/ForwardingHeaders/domjit/DOMJITPatchpoint.h.
2357         * ForwardingHeaders/jit/SnippetParams.h: Renamed from Source/WebCore/ForwardingHeaders/domjit/DOMJITPatchpointParams.h.
2358         * bindings/scripts/CodeGeneratorJS.pm:
2359         (GenerateHeader):
2360         (GenerateImplementation):
2361         * bindings/scripts/test/JS/JSTestDOMJIT.h:
2362         * domjit/DOMJITCheckDOM.h:
2363         (WebCore::DOMJIT::checkDOM):
2364         * domjit/DOMJITHelpers.h:
2365         (WebCore::DOMJIT::toWrapper):
2366         * domjit/JSDocumentDOMJIT.cpp:
2367         (WebCore::checkSubClassSnippetForJSDocument):
2368         (WebCore::DocumentDocumentElementDOMJIT::callDOMGetter):
2369         (WebCore::DocumentBodyDOMJIT::callDOMGetter):
2370         (WebCore::checkSubClassPatchpointForJSDocument): Deleted.
2371         * domjit/JSDocumentFragmentDOMJIT.cpp:
2372         (WebCore::checkSubClassSnippetForJSDocumentFragment):
2373         (WebCore::checkSubClassPatchpointForJSDocumentFragment): Deleted.
2374         * domjit/JSElementDOMJIT.cpp:
2375         (WebCore::checkSubClassSnippetForJSElement):
2376         (WebCore::checkSubClassPatchpointForJSElement): Deleted.
2377         * domjit/JSEventDOMJIT.cpp:
2378         (WebCore::checkSubClassSnippetForJSEvent):
2379         (WebCore::checkSubClassPatchpointForJSEvent): Deleted.
2380         * domjit/JSNodeDOMJIT.cpp:
2381         (WebCore::checkSubClassSnippetForJSNode):
2382         (WebCore::createCallDOMGetterForOffsetAccess):
2383         (WebCore::NodeFirstChildDOMJIT::callDOMGetter):
2384         (WebCore::NodeLastChildDOMJIT::callDOMGetter):
2385         (WebCore::NodeNextSiblingDOMJIT::callDOMGetter):
2386         (WebCore::NodePreviousSiblingDOMJIT::callDOMGetter):
2387         (WebCore::NodeParentNodeDOMJIT::callDOMGetter):
2388         (WebCore::NodeNodeTypeDOMJIT::callDOMGetter):
2389         (WebCore::NodeOwnerDocumentDOMJIT::callDOMGetter):
2390         (WebCore::checkSubClassPatchpointForJSNode): Deleted.
2391
2392 2017-05-26  Simon Fraser  <simon.fraser@apple.com>
2393
2394         getComputedStyle returns percentage values for left / right / top / bottom
2395         https://bugs.webkit.org/show_bug.cgi?id=29084
2396
2397         Reviewed by Zalan Bujtas.
2398         
2399         Fix getComputedStyle() to return pixel values for left / right / top / bottom, per spec.
2400
2401         This is mostly a merge of https://codereview.chromium.org/13871003/.
2402
2403         Behavior now matches Chrome and Firefox.
2404
2405         Test: fast/css/getComputedStyle/getComputedStyle-offsets.html
2406
2407         * css/CSSComputedStyleDeclaration.cpp:
2408         (WebCore::getOffsetComputedLength):
2409         (WebCore::getOffsetUsedStyleRelative):
2410         (WebCore::getOffsetUsedStyleAbsolute):
2411         (WebCore::positionOffsetValue):
2412         (WebCore::positionOffsetValueIsRendererDependent):
2413         (WebCore::isNonReplacedInline):
2414         (WebCore::isLayoutDependent):
2415         (WebCore::ComputedStyleExtractor::propertyValue):
2416
2417 2017-05-27  Zalan Bujtas  <zalan@apple.com>
2418
2419         enclosingIntRect returns a rect with -1 width/height when the input FloatRect overflows integer.
2420         https://bugs.webkit.org/show_bug.cgi?id=172676
2421
2422         Reviewed by Simon Fraser.
2423
2424         Clamp integer values soon after the enclosing rectangle is resolved.
2425
2426         * platform/graphics/FloatRect.cpp:
2427         (WebCore::enclosingIntRect):
2428
2429 2017-05-26  Joseph Pecoraro  <pecoraro@apple.com>
2430
2431         Simply some NSNumber usage
2432         https://bugs.webkit.org/show_bug.cgi?id=172677
2433
2434         Reviewed by Sam Weinig.
2435
2436         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2437         (-[WebAccessibilityObjectWrapper _addAccessibilityObject:toTextMarkerArray:]):
2438         (AXAttributeStringSetFont):
2439         (AXAttributeStringSetStyle):
2440         * accessibility/mac/AXObjectCacheMac.mm:
2441         (WebCore::AXObjectCache::postTextStateChangePlatformNotification):
2442         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2443         (AXAttributeStringSetStyle):
2444         (AXAttributeStringSetSpelling):
2445         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2446         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL):
2447         * platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm:
2448         * rendering/RenderThemeMac.mm:
2449         (WebCore::RenderThemeMac::levelIndicatorFor):
2450
2451 2017-05-26  Youenn Fablet  <youenn@apple.com>
2452
2453         WebRTC stats should be in milliseconds
2454         https://bugs.webkit.org/show_bug.cgi?id=172644
2455
2456         Reviewed by Eric Carlson.
2457
2458         Covered by updated tests.
2459
2460         * Modules/mediastream/RTCStatsReport.h:
2461         * Modules/mediastream/RTCStatsReport.idl:
2462         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
2463         (WebCore::fillRTCStats):
2464
2465 2017-05-26  Sam Weinig  <sam@webkit.org>
2466
2467         [WebIDL] Overloaded functions should throw this object check exception before argument check exception
2468         https://bugs.webkit.org/show_bug.cgi?id=172480
2469
2470         Reviewed by Chris Dumez.
2471
2472         - Codifies naming for both parts of the operation/attribute function implementation:
2473           - The 'trampoline' which is the actual host function and simply calls IDLOperation,
2474             IDLOperationReturningPromise or IDLAttribute.
2475           - The 'body' which is where argument checking and calling into the implementation
2476             takes place.
2477         - Made it so all operations, including static ones, use the trampoline / body model,
2478           simplifying code generation. The one exception is for overloaded operations, which
2479           now have a trampoline and body for the dispatcher, and only bodies for all the 
2480           overloads. This is what fixes the bug, since now that the dispatcher has a trampoline,
2481           it can do the correct this object checking via IDLOperation / IDLOperationReturningPromise.
2482         - Split out code generation for trampoline and body into separate subroutines and 
2483           simplified their implementations.
2484         - Changed GenerateOverloadDispatcher to only generate the body of the function, leaving it
2485           up to the caller to generate the signature, braces and conditionals if needed.
2486         - Made more subroutines take an output array and indent, in support of future endeavors
2487           that will need that support.
2488         - Remove unnecessary #includes of <runtime/Error.h>, which gets included already by virtue
2489           of JSDOMExceptionHandling.h
2490
2491         Test: js/dom/overloaded-operation-exception-order.html
2492
2493         * bindings/js/JSDOMOperation.h:
2494         * bindings/js/JSDOMOperationReturningPromise.h:
2495         Add no-op static versions of the bouncer functions.
2496
2497         * bindings/scripts/CodeGeneratorJS.pm:
2498         (GenerateOverloadDispatcher):
2499         (GenerateOperationTrampolineDefinition):
2500         (GenerateOperationBodyDefinition):
2501         (GenerateOperationDefinition):
2502         (GenerateSerializerDefinition):
2503         (GenerateLegacyCallerDefinitions):
2504         (GenerateLegacyCallerDefinition):
2505         (GenerateArgumentsCountCheck):
2506         (GenerateParametersCheck):
2507         (GenerateImplementationFunctionCall):
2508         (GenerateImplementationCustomFunctionCall):
2509         (GenerateConstructorDefinitions):
2510         (GenerateConstructorDefinition):
2511
2512         * bindings/scripts/test/JS/JSInterfaceName.cpp:
2513         * bindings/scripts/test/JS/JSMapLike.cpp:
2514         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
2515         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
2516         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
2517         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
2518         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
2519         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
2520         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
2521         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
2522         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
2523         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
2524         * bindings/scripts/test/JS/JSTestException.cpp:
2525         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
2526         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
2527         * bindings/scripts/test/JS/JSTestInterface.cpp:
2528         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
2529         * bindings/scripts/test/JS/JSTestIterable.cpp:
2530         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
2531         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
2532         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
2533         * bindings/scripts/test/JS/JSTestNode.cpp:
2534         * bindings/scripts/test/JS/JSTestObj.cpp:
2535         * bindings/scripts/test/JS/JSTestObj.h:
2536         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
2537         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
2538         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
2539         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
2540         * bindings/scripts/test/JS/JSTestSerialization.cpp:
2541         * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
2542         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
2543         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
2544         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2545         Update test results.
2546
2547 2017-05-26  Brent Fulgham  <bfulgham@apple.com>
2548
2549         [WK2] Address thread safety issues with ResourceLoadStatistics
2550         https://bugs.webkit.org/show_bug.cgi?id=172519
2551         <rdar://problem/31707642>
2552
2553         Reviewed by Chris Dumez.
2554
2555         * loader/ResourceLoadObserver.cpp:
2556         (WebCore::ResourceLoadObserver::setStatisticsQueue): Added.
2557         (WebCore::ResourceLoadObserver::clearInMemoryStore): Only interact with the HashTable on the statistics queue.
2558         (WebCore::ResourceLoadObserver::clearInMemoryAndPersistentStore): Ditto.
2559         (WebCore::ResourceLoadObserver::logFrameNavigation): Ditto.
2560         (WebCore::ResourceLoadObserver::logSubresourceLoading): Ditto.
2561         (WebCore::ResourceLoadObserver::logWebSocketLoading): Ditto.
2562         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution): Ditto.
2563         (WebCore::ResourceLoadObserver::logUserInteraction): Ditto.
2564         (WebCore::ResourceLoadObserver::clearUserInteraction): Protect HashTable while reading.
2565         (WebCore::ResourceLoadObserver::hasHadUserInteraction): Ditto.
2566         (WebCore::ResourceLoadObserver::setPrevalentResource): Ditto.
2567         (WebCore::ResourceLoadObserver::isPrevalentResource): Ditto.
2568         (WebCore::ResourceLoadObserver::clearPrevalentResource): Ditto.
2569         (WebCore::ResourceLoadObserver::setGrandfathered): Ditto.
2570         (WebCore::ResourceLoadObserver::isGrandfathered): Ditto.
2571         (WebCore::ResourceLoadObserver::setSubframeUnderTopFrameOrigin): Only interact with the HashTable on the statistics queue.
2572         (WebCore::ResourceLoadObserver::setSubresourceUnderTopFrameOrigin): Ditto.
2573         (WebCore::ResourceLoadObserver::setSubresourceUniqueRedirectTo): Ditto.
2574         (WebCore::ResourceLoadObserver::fireDataModificationHandler): ASSERT this is only called from the main thread, since this is
2575         only meant to be used as part of the testing harness.
2576         (WebCore::ResourceLoadObserver::fireShouldPartitionCookiesHandler): Ditto.
2577         (WebCore::ResourceLoadObserver::fireShouldPartitionCookiesHandler): Ditto.
2578         * loader/ResourceLoadObserver.h:
2579         * loader/ResourceLoadStatisticsStore.cpp:
2580         (WebCore::ResourceLoadStatisticsStore::isPrevalentResource): Protect HashTable while using it.
2581         (WebCore::ResourceLoadStatisticsStore::ensureResourceStatisticsForPrimaryDomain): Ditto.
2582         (WebCore::ResourceLoadStatisticsStore::setResourceStatisticsForPrimaryDomain): Ditto.
2583         (WebCore::ResourceLoadStatisticsStore::createEncoderFromData): ASSERT this isn't being done on the main thread, and
2584         protect HashTable while using it.
2585         (WebCore::ResourceLoadStatisticsStore::readDataFromDecoder): Ditto.
2586         (WebCore::ResourceLoadStatisticsStore::clearInMemory): Ditto.
2587         (WebCore::ResourceLoadStatisticsStore::clearInMemoryAndPersistent): Ditto.
2588         (WebCore::ResourceLoadStatisticsStore::statisticsForOrigin): Protect HashTable while using it.
2589         (WebCore::ResourceLoadStatisticsStore::takeStatistics): Ditto.
2590         (WebCore::ResourceLoadStatisticsStore::mergeStatistics): Ditto.
2591         (WebCore::ResourceLoadStatisticsStore::setNotificationCallback): Use WTF::Function.
2592         (WebCore::ResourceLoadStatisticsStore::setShouldPartitionCookiesCallback): Ditto.
2593         (WebCore::ResourceLoadStatisticsStore::setWritePersistentStoreCallback): Ditto.
2594         (WebCore::ResourceLoadStatisticsStore::setGrandfatherExistingWebsiteDataCallback): Ditto.
2595         (WebCore::ResourceLoadStatisticsStore::fireDataModificationHandler): ASSERT this is not called on the main thread,
2596         but dispatch the registered handler on the main thread.
2597         (WebCore::ResourceLoadStatisticsStore::fireShouldPartitionCookiesHandler): Ditto.
2598         (WebCore::ResourceLoadStatisticsStore::processStatistics): ASSERT this isn't being done on the main thread, and
2599         protect the HashTable while using it. Also switch to WTF::Function.
2600         (WebCore::ResourceLoadStatisticsStore::hasHadRecentUserInteraction): Make const correct.
2601         (WebCore::ResourceLoadStatisticsStore::topPrivatelyControlledDomainsToRemoveWebsiteDataFor): Protect HashTable while using it.
2602         (WebCore::ResourceLoadStatisticsStore::updateStatisticsForRemovedDataRecords): Ditto.
2603         (WebCore::ResourceLoadStatisticsStore::handleFreshStartWithEmptyOrNoStore): Ditto.
2604         (WebCore::ResourceLoadStatisticsStore::shouldRemoveDataRecords): Make const correct. ASSERT this is not being called
2605         on the main thread.
2606         (WebCore::ResourceLoadStatisticsStore::dataRecordsBeingRemoved): ASSERT this is not being called on the main thread.
2607         (WebCore::ResourceLoadStatisticsStore::dataRecordsWereRemoved): Ditto.
2608         (WebCore::ResourceLoadStatisticsStore::statisticsLock): Added.
2609         * loader/ResourceLoadStatisticsStore.h:
2610
2611 2017-05-26  Joseph Pecoraro  <pecoraro@apple.com>
2612
2613         JSContext Inspector: Improve the reliability of automatically pausing in auto-attach
2614         https://bugs.webkit.org/show_bug.cgi?id=172664
2615         <rdar://problem/32362933>
2616
2617         Reviewed by Matt Baker.
2618
2619         * inspector/InspectorController.h:
2620         * page/PageDebuggable.cpp:
2621         (WebCore::PageDebuggable::connect):
2622         * page/PageDebuggable.h:
2623         Pass an immediatelyPause boolean on to the controller.
2624
2625         * inspector/InspectorController.cpp:
2626         (WebCore::InspectorController::connectFrontend):
2627         (WebCore::InspectorController::disconnectFrontend):
2628         (WebCore::InspectorController::disconnectAllFrontends):
2629         Manage should immediately pause state.
2630
2631         (WebCore::InspectorController::frontendInitialized):
2632         When initialized, trigger a pause if requested.
2633
2634 2017-05-26  Don Olmstead  <don.olmstead@am.sony.com>
2635
2636         [CMake] Consolidate CMake code related to FreeType
2637         https://bugs.webkit.org/show_bug.cgi?id=172656
2638
2639         Reviewed by Michael Catanzaro.
2640
2641         No new tests. No change in behavior.
2642
2643         * PlatformGTK.cmake:
2644         * PlatformWPE.cmake:
2645         * platform/FreeType.cmake: Added.
2646
2647 2017-05-26  Sam Weinig  <sam@webkit.org>
2648
2649         [WebIDL] Another bindings cleanup pass, this time focusing on attributes
2650         https://bugs.webkit.org/show_bug.cgi?id=172619
2651
2652         Reviewed by Chris Dumez.
2653
2654         - Moved attribute getter / setter generation into their own subroutines.
2655         - As was done for operations, moved trampoline functions for attributes
2656           below their implementation functions to avoid unseemly forward declaration.
2657         - Changed to place the getter and setter for an attribute next to each other,
2658           rather than having all the getters and then all the setters.
2659         - Moved JSFoo::getConstructor and JSFoo::getNamedConstructor up to be with other
2660           member functions.
2661         - Fix an issue where we were generating a setJSFooConstructor function and not
2662           installing it anywhere. Now we always generate either both the getter and setter
2663           or neither for the constructor property. Also moved their definition to just above
2664           all the attributes, rather than the odd placements of between the getters and
2665           setters which is where they had been.
2666         - Made InstanceNeedsVisitChildren a complete answer, rather than relying on some
2667           loop of the attributes to update needsVisitChildren bit.
2668         - Move use of passing conditionals when adding headers.
2669
2670         * bindings/scripts/CodeGeneratorJS.pm:
2671         (InstanceNeedsVisitChildren):
2672         (GenerateHeader):
2673         (GenerateImplementation):
2674         (GenerateAttributeGetterDefinition):
2675         (GenerateAttributeSetterDefinition):
2676         (NeedsConstructorProperty):
2677
2678         * bindings/scripts/test/JS/JSInterfaceName.cpp:
2679         * bindings/scripts/test/JS/JSMapLike.cpp:
2680         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
2681         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
2682         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
2683         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
2684         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
2685         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
2686         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
2687         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
2688         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
2689         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
2690         * bindings/scripts/test/JS/JSTestException.cpp:
2691         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
2692         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
2693         * bindings/scripts/test/JS/JSTestInterface.cpp:
2694         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
2695         * bindings/scripts/test/JS/JSTestIterable.cpp:
2696         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
2697         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
2698         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
2699         * bindings/scripts/test/JS/JSTestNode.cpp:
2700         * bindings/scripts/test/JS/JSTestObj.cpp:
2701         * bindings/scripts/test/JS/JSTestObj.h:
2702         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
2703         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
2704         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
2705         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
2706         * bindings/scripts/test/JS/JSTestSerialization.cpp:
2707         * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
2708         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
2709         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
2710         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2711         Update test results.
2712
2713 2017-05-26  Don Olmstead  <don.olmstead@am.sony.com>
2714
2715         [CMake] Wrap CODE_GENERATOR_PREPROCESSOR_EXECUTABLE on Windows hosts
2716         https://bugs.webkit.org/show_bug.cgi?id=172553
2717
2718         Reviewed by Brent Fulgham.
2719
2720         No new tests. No change in behavior.
2721
2722         * bindings/scripts/preprocessor.pm:
2723         (applyPreprocessor): Use shellwords() instead of splitting
2724         preprocessor command by space. Combine it back in open3() call on
2725         Windows to work around Cygwin-specific issue.
2726
2727 2017-05-26  Wenson Hsieh  <wenson_hsieh@apple.com>
2728
2729         Unreviewed, fix the build using the latest SDK
2730
2731         Add deprecation guards around newly introduced (and deprecated) SPI.
2732
2733         * platform/ios/WebItemProviderPasteboard.mm:
2734         (-[WebItemProviderPasteboard setItemsUsingRegistrationInfoLists:]):
2735
2736 2017-05-26  Beth Dakin  <bdakin@apple.com>
2737
2738         Media documents inside iframes should not get controls in the TouchBar unless the 
2739         video is playing
2740         https://bugs.webkit.org/show_bug.cgi?id=172620
2741         -and corresponding-
2742         rdar://problem/32165477
2743
2744         Reviewed by Jon Lee.
2745
2746         Media documents get to return early with true, but that should only apply to 
2747         mainframe media documents. 
2748         * html/MediaElementSession.cpp:
2749         (WebCore::MediaElementSession::canShowControlsManager):
2750
2751 2017-05-26  Youenn Fablet  <youenn@apple.com>
2752
2753         Minor clean-up related to DocumentThreadableLoader redirections
2754         https://bugs.webkit.org/show_bug.cgi?id=172647
2755
2756         Reviewed by Chris Dumez.
2757
2758         No change of behavior.
2759
2760         Decrementing m_options redirect count directly instead of using an
2761         additional counter.
2762
2763         To compare whether two URLs are same-origin, use scheme+host+port check
2764         as per the spec.
2765         This is fine as only the initial origin may have specific rules and we
2766         are using the scheme+host+port checks when already being gone to
2767         another origin.
2768
2769         * loader/DocumentThreadableLoader.cpp:
2770         (WebCore::DocumentThreadableLoader::redirectReceived):
2771         * loader/DocumentThreadableLoader.h:
2772         * loader/SubresourceLoader.cpp:
2773         (WebCore::SubresourceLoader::checkRedirectionCrossOriginAccessControl):
2774
2775 2017-05-26  Youenn Fablet  <youenn@apple.com>
2776
2777         Fix memory leaks in MediaSampleAVFObjC::create
2778         https://bugs.webkit.org/show_bug.cgi?id=172600
2779
2780         Reviewed by Eric Carlson.
2781
2782         No change of behavior.
2783
2784         * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
2785         (WebCore::MediaSampleAVFObjC::createImageSample):
2786
2787 2017-05-26  Manuel Rego Casasnovas  <rego@igalia.com>
2788
2789         [css-grid] Add support for orthogonal positioned grid items
2790         https://bugs.webkit.org/show_bug.cgi?id=172591
2791
2792         Reviewed by Sergio Villar Senin.
2793
2794         This patch adds support for positioned grid items with orthogonal flows.
2795         Basically it just needs to check if the item is orthogonal to use
2796         the column or row offset as logical left or top depending on the case.
2797
2798         Tests: imported/w3c/web-platform-tests/css/css-grid-1/abspos/orthogonal-positioned-grid-items-***.html
2799
2800         * rendering/RenderGrid.cpp:
2801         (WebCore::RenderGrid::layoutPositionedObject):
2802
2803 2017-05-25  Emilio Cobos Álvarez  <ecobos@igalia.com>
2804
2805         Don't reset m_hasDisplayContents on ElementRareData::resetComputedStyle.
2806         https://bugs.webkit.org/show_bug.cgi?id=172503
2807
2808         Reviewed by Antti Koivisto.
2809
2810         We use that bit of information to determine whether we need to tear
2811         down the renderers of a display: contents subtree, so better for it to
2812         not change until the render tree is updated.
2813
2814         In practice, we may want to remove that bit and use ElementRareData's
2815         RenderStyle instead (keeping it around as appropriate), to ensure they
2816         don't go out of sync, but that's out of scope of this patch for now.
2817
2818         Tests: imported/w3c/web-platform-tests/css/css-display-3
2819
2820         * dom/ElementRareData.h:
2821         (WebCore::ElementRareData::resetComputedStyle):
2822
2823 2017-05-25  Sam Weinig  <sam@webkit.org>
2824
2825         Fix MediaDeviceInfo's extended attributes so they make sense
2826         https://bugs.webkit.org/show_bug.cgi?id=172629
2827
2828         Reviewed by Daniel Bates.
2829
2830         MediaDeviceInfo.idl had both a Constructor and NoInterfaceObject, which
2831         doesn't really make sense. Either way, the spec says it should have 
2832         neither, so remove both. And, while were there, add missing serializer.
2833
2834         Test: fast/mediastream/media-device-info.html
2835
2836         * Modules/mediastream/MediaDeviceInfo.idl:
2837
2838 2017-05-25  Chris Dumez  <cdumez@apple.com>
2839
2840         imported/w3c/web-platform-tests/html/semantics/forms/form-control-infrastructure/form_owner_and_table_2.html is crashing
2841         https://bugs.webkit.org/show_bug.cgi?id=172628
2842         <rdar://problem/32418707>
2843
2844         Reviewed by Sam Weinig.
2845
2846         In the event where a form is removed synchronously by a script during parsing,
2847         FormAssociatedElement::m_formSetByParser may end up referring to a form that
2848         is no longer in the document. As a result, we should make sure m_formSetByParser
2849         is still connected in FormAssociatedElement::insertedInto() before we call
2850         FormAssociatedElement::setForm(m_formSetByParser).
2851
2852         Test: fast/dom/HTMLFormElement/form-removed-during-parsing-crash.html
2853
2854         * html/FormAssociatedElement.cpp:
2855         (WebCore::FormAssociatedElement::insertedInto):
2856
2857 2017-05-25  Zalan Bujtas  <zalan@apple.com>
2858
2859         Frame's composited content is visible when the frame has visibility: hidden.
2860         https://bugs.webkit.org/show_bug.cgi?id=125565
2861         <rdar://problem/32196849>
2862
2863         Reviewed by Simon Fraser.
2864
2865         Do not construct composited layers for hidden RenderWidgets (frameset, iframe, object).
2866         Note that we still construct layers for the associated renderers as usual. 
2867
2868         Tests: compositing/visibility/frameset-visibility-hidden.html
2869                compositing/visibility/iframe-visibility-hidden.html
2870                compositing/visibility/object-visibility-hidden.html
2871
2872         * rendering/RenderLayerCompositor.cpp:
2873         (WebCore::RenderLayerCompositor::requiresCompositingForPlugin):
2874         (WebCore::RenderLayerCompositor::requiresCompositingForFrame):
2875
2876 2017-05-25  Yusuke Suzuki  <utatane.tea@gmail.com>
2877
2878         Unreviewed, build fix in GTK and WPE ports
2879         https://bugs.webkit.org/show_bug.cgi?id=172580
2880
2881         Missing RenderSVGResourceMode declaration in SVGInlineTextBox.h.
2882
2883         * rendering/svg/SVGInlineTextBox.h:
2884
2885 2017-05-25  Simon Fraser  <simon.fraser@apple.com>
2886
2887         Use a typedef for SVG resource mode flags union
2888         https://bugs.webkit.org/show_bug.cgi?id=172580
2889
2890         Reviewed by Sam Weinig.
2891
2892         Use an OptionSet<> for RenderSVGResourceModes flags, and use it in render
2893         SVG resource classes.
2894
2895         * rendering/svg/RenderSVGResource.cpp:
2896         (WebCore::requestPaintingResource):
2897         (WebCore::RenderSVGResource::fillPaintingResource):
2898         (WebCore::RenderSVGResource::strokePaintingResource):
2899         * rendering/svg/RenderSVGResource.h:
2900         (WebCore::RenderSVGResource::postApplyResource):
2901         * rendering/svg/RenderSVGResourceClipper.cpp:
2902         (WebCore::RenderSVGResourceClipper::applyResource):
2903         * rendering/svg/RenderSVGResourceClipper.h:
2904         * rendering/svg/RenderSVGResourceFilter.cpp:
2905         (WebCore::RenderSVGResourceFilter::applyResource):
2906         (WebCore::RenderSVGResourceFilter::postApplyResource):
2907         * rendering/svg/RenderSVGResourceFilter.h:
2908         * rendering/svg/RenderSVGResourceGradient.cpp:
2909         (WebCore::RenderSVGResourceGradient::applyResource):
2910         * rendering/svg/RenderSVGResourceGradient.h:
2911         * rendering/svg/RenderSVGResourceMarker.h:
2912         * rendering/svg/RenderSVGResourceMasker.cpp:
2913         (WebCore::RenderSVGResourceMasker::applyResource):
2914         * rendering/svg/RenderSVGResourceMasker.h:
2915         * rendering/svg/RenderSVGResourcePattern.cpp:
2916         (WebCore::RenderSVGResourcePattern::buildPattern):
2917         (WebCore::RenderSVGResourcePattern::applyResource):
2918         (WebCore::RenderSVGResourcePattern::postApplyResource):
2919         * rendering/svg/RenderSVGResourcePattern.h:
2920         * rendering/svg/RenderSVGResourceSolidColor.cpp:
2921         (WebCore::RenderSVGResourceSolidColor::applyResource):
2922         (WebCore::RenderSVGResourceSolidColor::postApplyResource):
2923         * rendering/svg/RenderSVGResourceSolidColor.h:
2924         * rendering/svg/RenderSVGShape.cpp:
2925         (WebCore::RenderSVGShape::fillShape):
2926         (WebCore::RenderSVGShape::strokeShape):
2927         * rendering/svg/SVGInlineTextBox.cpp:
2928         (WebCore::SVGInlineTextBox::SVGInlineTextBox):
2929         (WebCore::SVGInlineTextBox::paintSelectionBackground):
2930         (WebCore::SVGInlineTextBox::paint):
2931         (WebCore::SVGInlineTextBox::acquirePaintingResource):
2932         (WebCore::SVGInlineTextBox::releasePaintingResource):
2933         (WebCore::SVGInlineTextBox::paintDecoration):
2934         (WebCore::SVGInlineTextBox::paintDecorationWithStyle):
2935         * rendering/svg/SVGInlineTextBox.h:
2936         * rendering/svg/SVGRenderingContext.cpp:
2937         (WebCore::SVGRenderingContext::~SVGRenderingContext):
2938         (WebCore::SVGRenderingContext::prepareToRenderSVGContent):
2939         (WebCore::SVGRenderingContext::renderSubtreeToImageBuffer): Avoid needless IntPoint -> LayoutPoint
2940         conversion.
2941
2942 2017-05-25  Chris Dumez  <cdumez@apple.com>
2943
2944         Regression(r215686): Videos sometimes do not load in iBooks
2945         https://bugs.webkit.org/show_bug.cgi?id=172604
2946         <rdar://problem/32003717>
2947
2948         Reviewed by Geoffrey Garen.
2949
2950         Before r215686, the loop would have a check at the beginning to check if the
2951         dataRequest's currentOffset was greater than the buffer length and would
2952         cause the function to return early.
2953
2954         This check was dropped in r215686, which caused us in some cases to call
2955         finishLoading / stopLoading() after the loop, even though we did not have
2956         enough data in the buffer to satisfy the data request.
2957
2958         To address the issue, we now return early after the loop if remainingLength
2959         is greater than 0, meaning that we could not satisfy the request. This makes
2960         sure we do not call finishLoading / stopLoading() prematurely.
2961
2962         Note that before r215686, the condition of the while loop was 
2963         "while (remainingLength)" so the only way to get out of the loop was to:
2964         1. Get remainingLength to 0, in which case we would fall through and
2965            potentially call finishLoading / stopLoading() after the loop.
2966         2. Fail the "(data->size() <= [dataRequest currentOffset] - responseOffset)"
2967            check at the beginning of the loop, meaning that we ran out of data in
2968            the buffer. This would cause us to return from the function, not fall
2969            through, so we would not call finishLoading / stopLoading().
2970
2971         No new tests, I do not know how to write a test for this.
2972
2973         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
2974         (WebCore::WebCoreAVFResourceLoader::fulfillRequestWithResource):
2975
2976 2017-05-25  Sam Weinig  <sam@webkit.org>
2977
2978         [WebIDL] Use the term 'operation' more consistently
2979         https://bugs.webkit.org/show_bug.cgi?id=172601
2980
2981         Reviewed by Chris Dumez.
2982
2983         We were using the term 'operation', a WebIDL term for function-like
2984         constructs, inconsistently in the code generator. Now, when we use
2985         'operation' when referring to the IDL concept (usually the object the
2986         parser produces) and 'function' when referring to code being generated.
2987
2988         * bindings/scripts/CodeGenerator.pm:
2989         * bindings/scripts/IDLParser.pm:
2990         * bindings/scripts/generate-bindings.pl:
2991
2992 2017-05-25  Jer Noble  <jer.noble@apple.com>
2993
2994         System sleeps while playing to wireless target, ending stream.
2995         https://bugs.webkit.org/show_bug.cgi?id=172541
2996
2997         Reviewed by Eric Carlson.
2998
2999         API test: Tests/mac/MediaPlaybackSleepAssertion.mm
3000
3001         Keep the system from sleeping (but allow the display to sleep) while playing media to a wireless target.
3002
3003         Give the SleepDisabler a Type, either System or Display, which indicates what kind of sleep to disable.
3004         Update HTMLMediaElement::shouldDisableSleep() to differentiate between a video which is playing locally,
3005         one that is playing but not visible, and one that is playing remotely.
3006
3007         * html/HTMLMediaElement.cpp:
3008         (WebCore::HTMLMediaElement::mediaPlayerCurrentPlaybackTargetIsWirelessChanged):
3009         (WebCore::HTMLMediaElement::updateSleepDisabling):
3010         (WebCore::HTMLMediaElement::shouldDisableSleep):
3011         * html/HTMLMediaElement.h:
3012         * platform/SleepDisabler.cpp:
3013         (WebCore::SleepDisabler::create):
3014         (WebCore::SleepDisabler::SleepDisabler):
3015         * platform/SleepDisabler.h:
3016         (WebCore::SleepDisabler::type):
3017         * platform/cocoa/SleepDisablerCocoa.cpp:
3018         (WebCore::SleepDisabler::create):
3019         (WebCore::SleepDisablerCocoa::SleepDisablerCocoa):
3020         (WebCore::SleepDisablerCocoa::~SleepDisablerCocoa):
3021         * platform/cocoa/SleepDisablerCocoa.h:
3022         * platform/mac/WebVideoFullscreenController.mm:
3023         (-[WebVideoFullscreenController updatePowerAssertions]):
3024         * platform/spi/cocoa/IOPMLibSPI.h:
3025
3026 2017-05-25  Chris Dumez  <cdumez@apple.com>
3027
3028         DocumentThreadableLoader::redirectReceived() should not rely on the resource's loader
3029         https://bugs.webkit.org/show_bug.cgi?id=172578
3030         <rdar://problem/30754582>
3031
3032         Reviewed by Youenn Fablet.
3033
3034         DocumentThreadableLoader::redirectReceived() should not rely on the resource's loader. The rest of the methods do not.
3035         It is unsafe for it to rely on the resource's loader because it gets cleared when the load completes. A CachedRawresource
3036         may be reused from the memory cache once its load has completed.
3037
3038         This would cause crashes in CachedRawResource::didAddClient() when replaying the redirects because it would call
3039         DocumentThreadableLoader::redirectReceived() and potentially not have a loader anymore. To hit this exact code path,
3040         you would need to make repeated XHR to a cacheable simple cross-origin resource that has cacheable redirect.
3041
3042         Test: http/tests/xmlhttprequest/cacheable-cross-origin-redirect-crash.html
3043
3044         * loader/DocumentThreadableLoader.cpp:
3045         (WebCore::DocumentThreadableLoader::redirectReceived):
3046         * loader/DocumentThreadableLoader.h:
3047
3048 2017-05-25  Zalan Bujtas  <zalan@apple.com>
3049
3050         ASSERTION FAILED: !needsStyleRecalc() || !document().childNeedsStyleRecalc()
3051         https://bugs.webkit.org/show_bug.cgi?id=172576
3052         <rdar://problem/32181979>
3053
3054         Reviewed by Brent Fulgham.
3055
3056         Ensure that we clean the subframe's document before start searching for a focusable element.
3057
3058         Covered by existing test.
3059
3060         * page/FocusController.cpp:
3061         (WebCore::FocusController::findFocusableElementDescendingDownIntoFrameDocument):
3062
3063 2017-05-24  Jiewen Tan  <jiewen_tan@apple.com>
3064
3065         Crash on WebCore::FrameSelection::setSelectionWithoutUpdatingAppearance + 1195
3066         https://bugs.webkit.org/show_bug.cgi?id=172555
3067         <rdar://problem/32004724>
3068
3069         Reviewed by Ryosuke Niwa.
3070
3071         setSelectionWithoutUpdatingAppearance could dispatch a synchronous focusin event,
3072         which could invoke an event handler that deteles the frame. Therefore, add a
3073         protector before the call.
3074
3075         Test: editing/selection/select-iframe-focusin-document-crash.html
3076
3077         * editing/FrameSelection.cpp:
3078         (WebCore::FrameSelection::setSelection):
3079
3080 2017-05-25  Said Abou-Hallawa  <sabouhallawa@apple.com>
3081
3082         Ensure ImageFrameCache does not access its BitmapImage after it is deleted
3083         https://bugs.webkit.org/show_bug.cgi?id=172563
3084
3085         Reviewed by Simon Fraser.
3086
3087         A crash may happen if the BitmapImage is deleted while the decoding thread
3088         is still active. Once the current frame finishes decoding, the decoding
3089         thread will make a callOnMainThread() which will access the deleted BitmapImage.
3090
3091         We need to ensure if BitmapImage is deleted, the raw pointer which references
3092         it in ImageFrameCache is cleared. If this is done, nothing else is needed.
3093         All all the accesses to container BitmapImage in ImageFrameCache are guarded
3094         by checking m_image is not null.
3095
3096         * platform/graphics/BitmapImage.cpp:
3097         (WebCore::BitmapImage::~BitmapImage): Make sure the decoding thread will
3098         not have access to the deleted BitmapImage when it finishes decoding and
3099         make its callOnMainThread().
3100         (WebCore::BitmapImage::destroyDecodedData): Use the function new name.
3101         (WebCore::BitmapImage::internalStartAnimation): Ditto.
3102         * platform/graphics/ImageFrameCache.cpp:
3103         (WebCore::ImageFrameCache::startAsyncDecodingQueue): Protect the sourceURL
3104         for the decoding thread. ImageFrameCache::sourceURL() checks for the value
3105         of m_image which now may change from the main thread.
3106         * platform/graphics/ImageFrameCache.h:
3107         (WebCore::ImageFrameCache::clearImage): Add a new function to clear the 
3108         raw pointer m_image when its is deleted.
3109         * platform/graphics/ImageSource.cpp:
3110         (WebCore::ImageSource::resetData): Rename clear() to resetData() for better
3111         code readability. This function deletes the ImageDecoder and creates a new
3112         one if data is not null. The purpose is to delete the decoder raster data.
3113         (WebCore::ImageSource::clear): Deleted.
3114         * platform/graphics/ImageSource.h:
3115         (WebCore::ImageSource::clearImage): Wrapper for the ImageFrameCache function.
3116
3117 2017-05-25  youenn fablet  <youenn@apple.com>
3118
3119         Add some release logging for media elements
3120         https://bugs.webkit.org/show_bug.cgi?id=172581
3121
3122         Reviewed by Eric Carlson.
3123
3124         No change of behavior.
3125
3126          Adding logging for getUserMedia, video autoplay and incoming/outgoing webrtc video tracks.
3127
3128         * Modules/mediastream/UserMediaRequest.cpp:
3129         (WebCore::UserMediaRequest::allow):
3130         (WebCore::UserMediaRequest::deny):
3131         * html/HTMLMediaElement.cpp:
3132         (WebCore::HTMLMediaElement::canTransitionFromAutoplayToPlay):
3133         * html/MediaElementSession.cpp:
3134         (WebCore::MediaElementSession::playbackPermitted):
3135         * platform/Logging.h:
3136         * platform/mediastream/mac/RealtimeIncomingVideoSource.cpp:
3137         (WebCore::RealtimeIncomingVideoSource::OnFrame):
3138         * platform/mediastream/mac/RealtimeIncomingVideoSource.h:
3139         * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:
3140         (WebCore::RealtimeOutgoingVideoSource::sendOneBlackFrame):
3141         (WebCore::RealtimeOutgoingVideoSource::videoSampleAvailable):
3142         * platform/mediastream/mac/RealtimeOutgoingVideoSource.h:
3143
3144 2017-05-25  Sam Weinig  <sam@webkit.org>
3145
3146         [WebIDL] Do a pass of cleanup in the bindings generator
3147         https://bugs.webkit.org/show_bug.cgi?id=172566
3148
3149         Reviewed by Chris Dumez.
3150
3151         - Split JSDOMBindingCaller.h into four new files to allow for less 
3152           header inclusion (one includes a bunch of promise stuff that usually
3153           isn't needed): 
3154             - JSDOMCastedThisErrorBehavior (with shared casting enum)
3155             - JSDOMAttribute (for attribute getting / setting)
3156             - JSDOMOperation (for normal operations)
3157             - JSDOMOperationReturningPromise (for operations returning promises, obviously).
3158
3159           In addition to separating the files, rename to be more consistent with modern
3160           bindings conventions (new classes are IDLAttribute, IDLOperation, and 
3161           IDLOperationReturningPromise) and simplify function names
3162             - 'callOperation' becomes 'call'
3163             - 'attribute' becomes 'get'
3164             - 'setAttribute' becomes 'set'
3165
3166         - Remove extra generated trampoline function for operations returning promises
3167           by making JSDOMOperationReturningPromise handle all the promise related overhead.
3168
3169         - Make [Custom] operations returning promises go through the normal IDLOperationReturningPromise
3170           code path (simplifying JSReadableStreamSource and JSSubtleCrypto). Added [ReturnsOwnPromise]
3171           extended attribute to allow some functions that want to retain specialized behavior to do so
3172
3173         - Swap order of trampoline and implementation of operation, to avoid the need for
3174           a forward declaration and make reading more straightforward.
3175
3176         * WebCore.xcodeproj/project.pbxproj:
3177         Add / remove files.
3178
3179         * bindings/js/JSDOMBindingCaller.h: Removed.
3180
3181         * bindings/js/JSDOMCastedThisErrorBehavior.h: Added.
3182         Shared header for enum needed by JSDOMAttribute, JSDOMOperation and JSDOMOperationReturningPromise.
3183
3184         * bindings/js/JSDOMAttribute.h: Added.
3185         * bindings/js/JSDOMOperation.h: Added.
3186         * bindings/js/JSDOMOperationReturningPromise.h: Added.
3187         Split out JSDOMBindingCaller implementations into own classes / files. Simplify
3188         naming.
3189     
3190         * bindings/js/JSDOMPromiseDeferred.h:
3191         (WebCore::callPromiseFunction):
3192         Add a variant of callPromiseFunction that takes a lambda.
3193
3194         * bindings/js/JSEventTargetCustom.h:
3195         (WebCore::IDLOperation<JSEventTarget>::call):
3196         Update operation specialization to use new class.
3197
3198         * bindings/js/JSReadableStreamSourceCustom.cpp:
3199         * bindings/js/JSSubtleCryptoCustom.cpp:
3200         Simplify now that the callPromiseFunction is called for us.
3201
3202         * crypto/WebKitSubtleCrypto.idl:
3203         * css/FontFace.idl:
3204         * dom/CustomElementRegistry.idl:
3205         Add [ReturnsOwnPromise] to retain custom promise behavior.
3206
3207         * bindings/scripts/CodeGeneratorJS.pm:
3208         (GenerateHeader):
3209         Update header generation to account for custom functions that return promises now
3210         having a Ref<DeferredPromise>&& parameter.
3211
3212         (GenerateImplementation):
3213         - Update for new naming of cast functions.
3214         - Use AddToImplIncludes (and pass in conditional) rather than using $implIncludes
3215           directly, #includes to be grouped correctly.
3216         - Remove dead $inAppleCopyright code (it was moved to GenerateOperationDefinition 
3217           earlier).
3218
3219         (GenerateOperationDefinition):
3220         - Use $codeGenerator->IsPromiseType() rather than directly comparing to "Promise" string.
3221         - Restructure code to allow trampoline (the code that calls IDLOperation) to come after
3222           the main operation implementation (the part that calls into the impl).
3223         - Support custom functions returning promises (and the [ReturnsOwnPromise] variant).
3224
3225         (GenerateImplementationIterableFunctions):
3226         Update for name change to IDLOperation.
3227
3228         * bindings/scripts/IDLAttributes.json:
3229         Add [ReturnsOwnPromise].
3230
3231         * bindings/scripts/test/JS/JSInterfaceName.cpp:
3232         * bindings/scripts/test/JS/JSMapLike.cpp:
3233         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
3234         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
3235         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
3236         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
3237         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
3238         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
3239         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
3240         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
3241         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
3242         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
3243         * bindings/scripts/test/JS/JSTestException.cpp:
3244         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
3245         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
3246         * bindings/scripts/test/JS/JSTestInterface.cpp:
3247         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
3248         * bindings/scripts/test/JS/JSTestIterable.cpp:
3249         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
3250         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
3251         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
3252         * bindings/scripts/test/JS/JSTestNode.cpp:
3253         * bindings/scripts/test/JS/JSTestObj.cpp:
3254         * bindings/scripts/test/JS/JSTestObj.h:
3255         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
3256         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
3257         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
3258         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
3259         * bindings/scripts/test/JS/JSTestSerialization.cpp:
3260         * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
3261         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
3262         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
3263         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
3264         Update test results.
3265
3266         * bindings/scripts/test/TestObj.idl:
3267         Add additional test cases for operations returning promises.
3268
3269 2017-05-25  Simon Fraser  <simon.fraser@apple.com>
3270
3271         Some <chrono> and ProgressTracker cleanup
3272         https://bugs.webkit.org/show_bug.cgi?id=172582
3273
3274         Reviewed by Sam Weinig.
3275
3276         Remove some unnecessary <chrono> includes.
3277         Convert some std::chrono to use MonotonicTime/Seconds.
3278         Clean up ProgressTracker.
3279         Some #pragma once.
3280
3281         * dom/Document.h:
3282         * loader/ProgressTracker.cpp:
3283         (WebCore::ProgressTracker::ProgressTracker):
3284         (WebCore::ProgressTracker::reset):
3285         (WebCore::ProgressTracker::progressStarted):
3286         (WebCore::ProgressTracker::finalProgressComplete):
3287         (WebCore::ProgressTracker::incrementProgress):
3288         * loader/ProgressTracker.h:
3289         * page/Settings.h:
3290         * platform/SearchPopupMenu.h:
3291         * platform/Timer.h:
3292         * platform/graphics/cg/IOSurfacePool.cpp:
3293         (WebCore::IOSurfacePool::markOlderSurfacesPurgeable):
3294         * platform/graphics/cg/IOSurfacePool.h:
3295         (WebCore::IOSurfacePool::CachedSurfaceDetails::resetLastUseTime):
3296         * platform/network/PlatformCookieJar.h:
3297
3298 2017-05-25  Joanmarie Diggs  <jdiggs@igalia.com>
3299
3300         [ATK] Expose doc-footnote ARIA role with ATK_ROLE_FOOTNOTE
3301         https://bugs.webkit.org/show_bug.cgi?id=172355
3302
3303         Reviewed by Chris Fleizach.
3304
3305         Add a new FootnoteRole accessibility role to WebCore and map it to
3306         ATK_ROLE_FOOTNOTE for WebKitGtk and NSAccessibilityGroupRole with
3307         a subrole of AXApplicationGroup for the Mac port.
3308
3309         No new tests because we already have coverage for this role.
3310         The existing test expectations were updated to reflect the
3311         new mapping of doc-footnote to ATK_ROLE_FOOTNOTE.
3312
3313         * accessibility/AccessibilityObject.cpp:
3314         (WebCore::initializeRoleMap):
3315         (WebCore::AccessibilityObject::computedRoleString):
3316         * accessibility/AccessibilityObject.h:
3317         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
3318         (atkRole):
3319         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
3320         (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
3321         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3322         (createAccessibilityRoleMap):
3323         (-[WebAccessibilityObjectWrapper subrole]):
3324
3325 2017-05-25  youenn fablet  <youenn@apple.com>
3326
3327         [macOS WK2 Debug] Layout Test webrtc/video.html is crashing.
3328         https://bugs.webkit.org/show_bug.cgi?id=172560
3329         <rdar://problem/32392611>
3330
3331         Reviewed by Eric Carlson.
3332
3333         webrtc/multiple-video.html is no longer crashing.
3334
3335         Allow autoplay only from going to not capture to capture, and not the reverse.
3336         Renamed HTMLMediaElement::mediaStreamCaptureStateChanged to mediaStreamCaptureStarted.
3337
3338         * dom/Document.cpp:
3339         (WebCore::Document::mediaStreamCaptureStateChanged):
3340         * html/HTMLMediaElement.cpp:
3341         (WebCore::HTMLMediaElement::mediaStreamCaptureStateChanged): Deleted.
3342         * html/HTMLMediaElement.h:
3343         (WebCore::HTMLMediaElement::mediaStreamCaptureStarted):
3344
3345 2017-05-25  Dave Hyatt  <hyatt@apple.com>
3346
3347         Baseline of number inputs not right.
3348         https://bugs.webkit.org/show_bug.cgi?id=172237
3349
3350         Reviewed by Dean Jackson.
3351
3352         Added fast/forms/baseline-of-number-inputs.html
3353
3354         * css/html.css:
3355         (input::-webkit-inner-spin-button):
3356         * rendering/RenderSearchField.cpp:
3357         (WebCore::RenderSearchField::computeLogicalHeightLimit): Deleted.
3358         (WebCore::RenderSearchField::centerContainerIfNeeded): Deleted.
3359         * rendering/RenderSearchField.h:
3360         * rendering/RenderTextControlSingleLine.cpp:
3361         (WebCore::RenderTextControlSingleLine::centerRenderer):
3362         (WebCore::RenderTextControlSingleLine::layout):
3363         (WebCore::RenderTextControlSingleLine::computeLogicalHeightLimit): Deleted.
3364         * rendering/RenderTextControlSingleLine.h:
3365         (WebCore::RenderTextControlSingleLine::centerContainerIfNeeded): Deleted.
3366
3367 2017-05-25  Manuel Rego Casasnovas  <rego@igalia.com>
3368
3369         [css-grid] Fix behavior of positioned items without specific dimensions
3370         https://bugs.webkit.org/show_bug.cgi?id=172117
3371
3372         Reviewed by Sergio Villar Senin.
3373
3374         Currently positioned items that doesn't have specific dimensions
3375         are not properly sized. This patch fixes the issues with them.
3376
3377         The patch removes the extraInline|BlockOffsets from RenderBox,
3378         so now RenderGrid is responsible of setting the location of the positioned item.
3379         This will be useful to add alignment support for positioned items later.
3380         It also removes grid specific logic from RenderBox.
3381
3382         RenderBox::computeInlineStaticDistance() was modified too.
3383         The problem here was that the containing block of the positioned gird items
3384         is the grid area (and not the grid container). The method didn't know
3385         anything about grid, so it was using the grid container causing wrong values
3386         when resolving "auto" in both left and right offset properties.
3387
3388         Note that after this patch we match Chrome and Firefox behavior on these cases.
3389
3390         Test: fast/css-grid-layout/positioned-grid-items-sizing.html
3391
3392         * rendering/RenderBox.cpp:
3393         (WebCore::RenderBox::willBeDestroyed):
3394         (WebCore::computeInlineStaticDistance):
3395         (WebCore::RenderBox::computePositionedLogicalWidth):
3396         (WebCore::RenderBox::computePositionedLogicalHeight):
3397         * rendering/RenderBox.h:
3398         * rendering/RenderGrid.cpp:
3399         (WebCore::RenderGrid::layoutPositionedObject):
3400         (WebCore::RenderGrid::offsetAndBreadthForPositionedChild):
3401
3402 2017-05-25  Claudio Saavedra  <csaavedra@igalia.com>
3403
3404         [WPE] Build fix after r217404
3405
3406         Unreviewed
3407
3408         * PlatformWPE.cmake: Include missing cairo cmake file.
3409
3410 2017-05-24  Chris Dumez  <cdumez@apple.com>
3411
3412         ResourceResponses for data URLs have their Source marked as Unknown