REGRESSION (r209144): API test IndexedDB.DeleteRecovery failing.
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-11-30  Brady Eidson  <beidson@apple.com>
2
3         REGRESSION (r209144): API test IndexedDB.DeleteRecovery failing.
4         https://bugs.webkit.org/show_bug.cgi?id=165216
5
6         Rubberstamped by Tim Horton.
7
8         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
9         (WebCore::IDBServer::SQLiteIDBBackingStore::closeSQLiteDB): Change invalid ASSERT into a null check.
10
11 2016-11-30  Said Abou-Hallawa  <sabouhallawa@apple.com>
12
13         Add separate settings and preferences to enable/disable async decoding for large images and animated images
14         https://bugs.webkit.org/show_bug.cgi?id=165177
15
16         Reviewed by Simon Fraser.
17
18         Instead of having the async image decoding be controlled by one setting,
19         two separate settings are added:
20             largeImageAsyncDecodingEnabled
21             animatedImageAsyncDecodingEnabled
22             
23         And an existing setting is removed:
24             asyncImageDecodingEnabled
25
26         * loader/cache/CachedImage.cpp:
27         (WebCore::CachedImage::load):
28         * loader/cache/CachedImage.h:
29         * page/Settings.in:
30         * platform/graphics/BitmapImage.cpp:
31         (WebCore::BitmapImage::internalStartAnimation):
32         * platform/graphics/BitmapImage.h:
33         * platform/graphics/ImageObserver.h:
34
35 2016-11-30  Zalan Bujtas  <zalan@apple.com>
36
37         ASSERTION FAILED: layoutState->m_renderer == this in WebCore::RenderBlock::offsetFromLogicalTopOfFirstPage
38         https://bugs.webkit.org/show_bug.cgi?id=155364
39         <rdar://problem/27720461>
40
41         Reviewed by David Hyatt.
42
43         RenderNamedFlowThread is considered to be a root for the current renderer context so
44         we need to bail out from the containing block traversal here (like we do for the RenderView). 
45
46         Test: fast/replaced/replaced-element-with-percentage-width-inside-flow-asserts.html
47
48         * rendering/RenderBox.cpp:
49         (WebCore::RenderBox::computeReplacedLogicalHeightUsing):
50
51 2016-11-30  Brady Eidson  <beidson@apple.com>
52
53         IndexedDB 2.0: Send operations off to the server in batches instead of one at a time.
54         https://bugs.webkit.org/show_bug.cgi?id=165221
55
56         Reviewed by Myles C. Maxfield.
57
58         No new tests (No observable behavior change).
59
60         On a profile of "Lots of writes to an IndexedDB", timer scheduling/firing presented as over 10% of the time.
61
62         This patch negates much of that.
63
64         * Modules/indexeddb/IDBTransaction.cpp:
65         (WebCore::IDBTransaction::pendingOperationTimerFired): Send 100 operations off to the server
66           before spinning the runloop, instead of only 1.
67
68 2016-11-30  Antoine Quint  <graouts@apple.com>
69
70         [Modern Media Controls] Controls are not visible when returning from picture-in-picture playback
71         https://bugs.webkit.org/show_bug.cgi?id=165183
72
73         Reviewed by Dean Jackson.
74
75         We need to call MediaControlsHost::setPreparedToReturnVideoLayerToInline() when we return from
76         picture-in-picture playback such that the video layer is correctly stacked under the media controls.
77         We call that function in a rAF call to ensure it's performed in sync with the next scheduled layout
78         or the media controls would not appear in sync with the video layer.
79
80         We also fix an error from a previous commit in ControlsVisibilitySupport.
81
82         * Modules/modern-media-controls/media/controls-visibility-support.js:
83         (ControlsVisibilitySupport.prototype.syncControl):
84         (ControlsVisibilitySupport):
85         * Modules/modern-media-controls/media/media-controller.js:
86         (MediaController):
87         (MediaController.prototype.handleEvent):
88         (MediaController.prototype._returnMediaLayerToInlineIfNeeded):
89
90 2016-11-30  Jiewen Tan  <jiewen_tan@apple.com>
91
92         Update SubtleCrypto::wrapKey to match the latest spec
93         https://bugs.webkit.org/show_bug.cgi?id=164746
94         <rdar://problem/29258160>
95
96         Reviewed by Brent Fulgham.
97
98         This patch does following few things:
99         1. It updates the SubtleCrypto::wrapKey method to match the latest spec:
100            https://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-wrapKey.
101            It also refers to the latest Editor's Draft to a certain degree:
102            https://w3c.github.io/webcrypto/Overview.html#SubtleCrypto-method-wrapKey.
103         2. It implements wrapKey operations of the following algorithms: AES-KW.
104         3. It also replaces JSSubtleCrypto* with auto in all promise functions.
105
106         Tests: crypto/subtle/aes-cbc-import-key-wrap-jwk-rsa-key-private.html
107                crypto/subtle/aes-cbc-import-key-wrap-jwk-rsa-key-public.html
108                crypto/subtle/aes-kw-import-key-wrap-raw-key.html
109                crypto/subtle/aes-kw-wrap-key-malformed-parameters.html
110                crypto/subtle/rsa-oaep-import-key-wrap-jwk-oct-key.html
111                crypto/subtle/wrapKey-malformed-parameters.html
112                crypto/workers/subtle/aes-cbc-import-key-wrap-key.html
113                crypto/workers/subtle/aes-kw-import-key-wrap-key.html
114                crypto/workers/subtle/rsa-oaep-import-key-wrap-key.html
115
116         * bindings/js/JSSubtleCryptoCustom.cpp:
117         (WebCore::normalizeCryptoAlgorithmParameters):
118         (WebCore::supportExportKeyThrow):
119         (WebCore::jsSubtleCryptoFunctionEncryptPromise):
120         (WebCore::jsSubtleCryptoFunctionDecryptPromise):
121         (WebCore::jsSubtleCryptoFunctionExportKeyPromise):
122         (WebCore::jsSubtleCryptoFunctionWrapKeyPromise):
123         (WebCore::JSSubtleCrypto::wrapKey):
124         * crypto/CryptoAlgorithm.cpp:
125         (WebCore::CryptoAlgorithm::wrapKey):
126         * crypto/CryptoAlgorithm.h:
127         * crypto/SubtleCrypto.idl:
128         * crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
129         (WebCore::CryptoAlgorithmAES_KW::wrapKey):
130         * crypto/algorithms/CryptoAlgorithmAES_KW.h:
131         * crypto/gnutls/CryptoAlgorithmAES_KWGnuTLS.cpp:
132         (WebCore::CryptoAlgorithmAES_KW::platformWrapKey):
133         * crypto/mac/CryptoAlgorithmAES_KWMac.cpp:
134         (WebCore::wrapKeyAES_KW):
135         (WebCore::CryptoAlgorithmAES_KW::platformWrapKey):
136         (WebCore::CryptoAlgorithmAES_KW::platformEncrypt):
137
138 2016-11-29  Sam Weinig  <sam@webkit.org>
139
140         [WebIDL] Add support for more missing / exotic IDLTypes
141         https://bugs.webkit.org/show_bug.cgi?id=165156
142
143         Reviewed by Alex Christensen.
144
145         - Adds JSDOMConvert support for WebIDL's 'callback interface' and 'callback function'.
146         - Adds JSDOMConvert support for WebIDL extensions for SerializedScriptValue, Dictionary, 
147           EventListener and XPathNSResolver (moving much of their special casing out of perl and
148           into JSDOMConvert).
149
150         * DerivedSources.make:
151         Adds $(WebCore)/testing to the list of available IDL directories to keep internals
152         compiling.
153
154         * Modules/webaudio/WaveShaperNode.cpp:
155         * Modules/webaudio/WaveShaperNode.h:
156         Update to take curve by reference.
157
158         * bindings/generic/IDLTypes.h:
159         (WebCore::IDLWrapper):
160         Add helper type, IDLWrapper, which serves as a base type for all IDLTypes that are
161         RefCounted.
162
163         * bindings/js/JSDOMConvert.h:
164         (WebCore::convert):
165         (WebCore::Converter<IDLNullable<T>>::convert):
166         (WebCore::Converter<IDLCallbackFunction<T>>::convert):
167         (WebCore::JSConverter<IDLCallbackFunction<T>>::convert):
168         (WebCore::JSConverter<IDLCallbackFunction<T>>::convertNewlyCreated):
169         (WebCore::Converter<IDLCallbackInterface<T>>::convert):
170         (WebCore::JSConverter<IDLCallbackInterface<T>>::convert):
171         (WebCore::JSConverter<IDLCallbackInterface<T>>::convertNewlyCreated):
172         (WebCore::Converter<IDLSerializedScriptValue<T>>::convert):
173         (WebCore::JSConverter<IDLSerializedScriptValue<T>>::convert):
174         (WebCore::Converter<IDLLegacyDictionary<T>>::convert):
175         (WebCore::Converter<IDLEventListener<T>>::convert):
176         (WebCore::Converter<IDLXPathNSResolver<T>>::convert):
177         (WebCore::JSConverter<IDLXPathNSResolver<T>>::convert):
178         (WebCore::JSConverter<IDLXPathNSResolver<T>>::convertNewlyCreated):
179         Add converters for the new types. IDLSerializedScriptValue, IDLLegacyDictionary, IDLEventListener and IDLXPathNSResolver
180         have been templatized to avoid including their implementation classes everywhere. We can improve this in the future by
181         splitting JSDOMConvert up into to separate files.
182
183         * bindings/scripts/CodeGenerator.pm:
184         (IsBuiltinType):
185         (IsInterfaceType):
186         (IsWrapperType):
187         (ComputeIsCallbackInterface):
188         (ComputeIsCallbackFunction):
189         Add new predicates, IsBuiltinType and IsInterfaceType, and re-work IsWrapperType to determine all types that
190         have a JS wrapper (and consequently a JS{name}.h file).
191
192         * bindings/scripts/CodeGeneratorJS.pm:
193         (AddToIncludesForIDLType):
194         Update to add include for EventListener.
195
196         (GetArgumentExceptionFunction):
197         (GetArgumentExceptionThrower):
198         (GetAttributeExceptionFunction):
199         (GetAttributeExceptionThrower):
200         Add support for exceptions for callbacks.
201
202         (PassArgumentExpression):
203         Factor out logic on how to pass arguments to C++.
204
205         (GenerateHeader):
206         Make toWrapped and JSDOMWrapperConverterTraits work with XPathNSResolver.
207
208         (GenerateImplementation):
209         Update to use PassArgumentExpression and pass a global object reference to JSValueToNative.
210
211         (GenerateParametersCheck):
212         Remove special casing for callbacks.
213
214         (GenerateCallbackHeaderContent):
215         (GenerateCallbackImplementationContent):
216         Simplify toJS functions. State and global object are not necessary.
217
218         (GetBaseIDLType):
219         Add support for new types. Add assertion so that unknown types can't get through.
220
221         (ShouldPassArgumentByReference):
222         Rename from ShouldPassWrapperByReference, and merge in CodeGenerator's ShouldPassWrapperByReference.
223
224         (JSValueToNativeDOMConvertNeedsThisObject):
225         Added. Predicate to determine types that need a this object for conversion.
226
227         (JSValueToNativeDOMConvertNeedsGlobalObject):
228         Added. Predicate to determine types that need a global object for conversion.
229
230         (JSValueToNative):
231         Remove special cases for new types.
232
233         (NativeToJSValueDOMConvertNeedsState):
234         Add SerializedScriptValue and XPathNSResolver.
235
236         (NativeToJSValueDOMConvertNeedsGlobalObject):
237         Add SerializedScriptValue and XPathNSResolver.
238
239         (NativeToJSValueUsingReferences):
240         (NativeToJSValueUsingPointers):
241         (NativeToJSValue):
242         Remove unused $statePointer and replace $globalObject with $globalObjectReference. Remove
243         special cases for new types.
244
245         (GenerateConstructorDefinition):
246         Use PassArgumentExpression.
247
248         * bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
249         * bindings/scripts/test/JS/JSTestCallbackFunction.h:
250         * bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.cpp:
251         * bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.h:
252         * bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
253         * bindings/scripts/test/JS/JSTestCallbackInterface.h:
254         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
255         * bindings/scripts/test/JS/JSTestObj.cpp:
256         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
257         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
258         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
259         * bindings/scripts/test/TestObj.idl:
260         * bindings/scripts/test/TestSerializedScriptValueInterface.idl:
261         Update tests. Remove test for a readonly attribute returning a Promise, which is not supported
262         yet (this was caught by the assertion added to GetBaseIDLType). Add tests for passing and returning 
263         SerializedScriptValues from functions.
264
265 2016-11-30  Jiewen Tan  <jiewen_tan@apple.com>
266
267         Update SubtleCrypto::verify to match the latest spec
268         https://bugs.webkit.org/show_bug.cgi?id=164741
269         <rdar://problem/29257935>
270
271         Reviewed by Brent Fulgham.
272
273         This patch does following few things:
274         1. It updates the SubtleCrypto::verify method to match the latest spec:
275            https://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-verify.
276            It also refers to the latest Editor's Draft to a certain degree:
277            https://w3c.github.io/webcrypto/Overview.html#SubtleCrypto-method-verify.
278         2. It implements verify operations of the following algorithms: HMAC, and
279            RSASSA-PKCS1-V1_5.
280
281         Tests: crypto/subtle/hmac-generate-key-sign-verify.html
282                crypto/subtle/hmac-import-key-verify-sha1.html
283                crypto/subtle/hmac-import-key-verify-sha224.html
284                crypto/subtle/hmac-import-key-verify-sha256.html
285                crypto/subtle/hmac-import-key-verify-sha384.html
286                crypto/subtle/hmac-import-key-verify-sha512.html
287                crypto/subtle/rsassa-pkcs1-v1_5-generate-key-sign-verify.html
288                crypto/subtle/rsassa-pkcs1-v1_5-import-key-verify-sha1.html
289                crypto/subtle/rsassa-pkcs1-v1_5-import-key-verify-sha224.html
290                crypto/subtle/rsassa-pkcs1-v1_5-import-key-verify-sha256.html
291                crypto/subtle/rsassa-pkcs1-v1_5-import-key-verify-sha384.html
292                crypto/subtle/rsassa-pkcs1-v1_5-import-key-verify-sha512.html
293                crypto/subtle/verify-malformed-parameters.html
294                crypto/workers/subtle/hmac-import-key-verify.html
295                crypto/workers/subtle/rsassa-pkcs1-v1_5-import-key-verify.html
296
297         * bindings/js/JSSubtleCryptoCustom.cpp:
298         (WebCore::normalizeCryptoAlgorithmParameters):
299         (WebCore::jsSubtleCryptoFunctionVerifyPromise):
300         (WebCore::JSSubtleCrypto::verify):
301         * crypto/CryptoAlgorithm.cpp:
302         (WebCore::CryptoAlgorithm::verify):
303         * crypto/CryptoAlgorithm.h:
304         * crypto/SubtleCrypto.idl:
305         * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
306         (WebCore::CryptoAlgorithmHMAC::verify):
307         * crypto/algorithms/CryptoAlgorithmHMAC.h:
308         * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
309         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::verify):
310         * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h:
311         * crypto/gcrypt/CryptoAlgorithmHMACGCrypt.cpp:
312         (WebCore::CryptoAlgorithmHMAC::platformVerify):
313         * crypto/gnutls/CryptoAlgorithmHMACGnuTLS.cpp:
314         (WebCore::CryptoAlgorithmHMAC::platformVerify):
315         * crypto/gnutls/CryptoAlgorithmRSASSA_PKCS1_v1_5GnuTLS.cpp:
316         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformVerify):
317         * crypto/mac/CryptoAlgorithmHMACMac.cpp:
318         (WebCore::CryptoAlgorithmHMAC::platformVerify):
319         * crypto/mac/CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp:
320         (WebCore::verifyRSASSA_PKCS1_v1_5):
321         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformVerify):
322
323 2016-11-30  Dave Hyatt  <hyatt@apple.com>
324
325         [CSS Parser] Fix columns shorthand parsing
326         https://bugs.webkit.org/show_bug.cgi?id=165210
327
328         Reviewed by Zalan Bujtas.
329
330         * css/parser/CSSPropertyParser.cpp:
331         (WebCore::CSSPropertyParser::consumeColumns):
332         (WebCore::consumeColumnWidthOrCount): Deleted.
333         Bring over the old parser code, since it was actually better at creating implicit values for auto.
334
335 2016-11-30  Andy Estes  <aestes@apple.com>
336
337         [Cocoa] Pass the embedding app's bundle ID to new instances of NEFilterSource
338         https://bugs.webkit.org/show_bug.cgi?id=165168
339         <rdar://problem/29003618>
340
341         Reviewed by Simon Fraser.
342
343         * platform/RuntimeApplicationChecks.h: Declared applicationBundleIdentifier().
344         * platform/RuntimeApplicationChecks.mm:
345         (WebCore::applicationBundleIdentifier): Made non-static.
346         * platform/cocoa/NetworkExtensionContentFilter.mm:
347         (WebCore::NetworkExtensionContentFilter::initialize): If the new NEFilterSource instance
348         responds to -setSourceAppBundleID:, call it with applicationBundleIdentifier().
349         * platform/spi/cocoa/NEFilterSourceSPI.h: Moved NEFilterSourceOptionsRedirectURL into the
350         !USE(APPLE_INTERNAL_SDK) section and unconditionally declared @property sourceAppBundleID in
351         a new category on NEFilterSource.
352
353 2016-11-30  Brent Fulgham  <bfulgham@apple.com>
354
355         Use 'childOfType' template when retrieving Shadow DOM elements
356         https://bugs.webkit.org/show_bug.cgi?id=165145
357         <rdar://problem/29331830>
358
359         Reviewed by Antti Koivisto.
360
361         Tests: fast/shadow-dom/color-input-element-shadow-manipulation.html
362                fast/shadow-dom/file-input-element-shadow-manipulation.html
363                fast/shadow-dom/keygen-shadow-manipulation.html
364                fast/shadow-dom/media-shadow-manipulation.html
365                fast/shadow-dom/range-input-element-shadow-manipulation.html
366                fast/shadow-dom/textarea-shadow-manipulation.html
367
368         Switch to using 'childOfType' when retrieving Shadow DOM elements, rather
369         than relying on expected element positions, as these can be changed by
370         JavaScript.
371
372         Drive by fix: Make more use of is<> and downcast<> templates rather than blindly casting.
373
374         * dom/Element.h:
375         (WebCore::Element::isUploadButton): Added.
376         (WebCore::Element::isSliderContainerElement): Added.
377         * html/ColorInputType.cpp:
378         (WebCore::ColorInputType::shadowColorSwatch): Use 'childOfType' rather than assuming
379         the first child is the one we want.
380         * html/FileInputType.cpp:
381         (isType): Added.
382         (WebCore::FileInputType::disabledAttributeChanged): Use 'childOfType' rather than assuming
383         the first child is the one we want.
384         (WebCore::FileInputType::multipleAttributeChanged): Ditto.
385         * html/HTMLKeygenElement.cpp:
386         (WebCore::HTMLKeygenElement::shadowSelect): Ditto.
387         * html/HTMLMediaElement.cpp:
388         (WebCore::HTMLMediaElement::mediaControls): Ditto.
389         (WebCore::HTMLMediaElement::hasMediaControls): Ditto.
390         * html/HTMLTextAreaElement.cpp:
391         (WebCore::HTMLTextAreaElement::innerTextElement): Ditto.
392         * html/RangeInputType.cpp:
393         (WebCore::RangeInputType::sliderTrackElement): Ditto.
394         * html/shadow/SliderThumbElement.h:
395         (isType): Added.
396         * svg/SVGUseElement.cpp:
397         (WebCore::SVGUseElement::targetClone): Use 'childOfType' rather than assuming
398         the first child is the one we want.
399
400 2016-11-30  Brady Eidson  <beidson@apple.com>
401
402         IndexedDB 2.0: Cache and reuse SQLiteStatements in the SQLite backend.
403         https://bugs.webkit.org/show_bug.cgi?id=164974
404
405         Reviewed by Alex Christensen.
406
407         No new tests (No behavior change other than being faster).
408
409         Instead of building new SQLiteStatements from scratch each time they're needed and then
410         finalizing them after they're used for a single operation, we cache them.
411
412         For tests that do puts and/or gets in tight loops, this shows up as a 5%-20% speedup on profiles.
413
414         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
415         (WebCore::IDBServer::SQLiteIDBBackingStore::~SQLiteIDBBackingStore):
416         (WebCore::IDBServer::SQLiteIDBBackingStore::createAndPopulateInitialDatabaseInfo):
417         (WebCore::IDBServer::SQLiteIDBBackingStore::getOrEstablishDatabaseInfo):
418         (WebCore::IDBServer::SQLiteIDBBackingStore::createObjectStore):
419         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteObjectStore):
420         (WebCore::IDBServer::SQLiteIDBBackingStore::renameObjectStore):
421         (WebCore::IDBServer::SQLiteIDBBackingStore::clearObjectStore):
422         (WebCore::IDBServer::SQLiteIDBBackingStore::createIndex):
423         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedHasIndexRecord):
424         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedPutIndexRecord):
425         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteIndex):
426         (WebCore::IDBServer::SQLiteIDBBackingStore::renameIndex):
427         (WebCore::IDBServer::SQLiteIDBBackingStore::keyExistsInObjectStore):
428         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteUnusedBlobFileRecords):
429         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteRecord):
430         (WebCore::IDBServer::SQLiteIDBBackingStore::updateAllIndexesForAddRecord):
431         (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord):
432         (WebCore::IDBServer::SQLiteIDBBackingStore::getBlobRecordsForObjectStoreRecord):
433         (WebCore::IDBServer::SQLiteIDBBackingStore::getRecord):
434         (WebCore::IDBServer::SQLiteIDBBackingStore::cachedStatementForGetAllObjectStoreRecords):
435         (WebCore::IDBServer::SQLiteIDBBackingStore::getAllObjectStoreRecords):
436         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedGetKeyGeneratorValue):
437         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedSetKeyGeneratorValue):
438         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteBackingStore):
439         (WebCore::IDBServer::SQLiteIDBBackingStore::cachedStatement):
440         (WebCore::IDBServer::SQLiteIDBBackingStore::closeSQLiteDB):
441         (WebCore::IDBServer::queryForGetAllObjectStoreRecords): Deleted.
442         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
443
444 2016-11-30  Dave Hyatt  <hyatt@apple.com>
445
446         [CSS Parser] Make sure -webkit-background-size coalesces identical values.
447         https://bugs.webkit.org/show_bug.cgi?id=165207
448
449         Reviewed by Dean Jackson.
450
451         * css/parser/CSSPropertyParser.cpp:
452         (WebCore::consumeBackgroundSize):
453
454 2016-11-30  Eric Carlson  <eric.carlson@apple.com>
455
456         [MediaStream] Sync video preview layer and parent layer sizes
457         https://bugs.webkit.org/show_bug.cgi?id=165139
458
459         Reviewed by Jer Noble.
460
461         CALayer auto-resizing doesn't work on iOS, so manually reize the video capture preview layer
462         whenever the background layer's bounds change.
463
464         * platform/mediastream/mac/AVVideoCaptureSource.mm:
465         (WebCore::AVVideoSourcePreview::AVVideoSourcePreview): Create layer observer.
466         (WebCore::AVVideoSourcePreview::backgroundLayerBoundsChanged): Sync preview layer and background
467           layer sizes.
468         (WebCore::AVVideoSourcePreview::invalidate): Invalidate and clear observer.
469         (-[WebCoreAVVideoCaptureSourceObserver initWithParent:]):
470         (-[WebCoreAVVideoCaptureSourceObserver setParent:]): Add KVO bounds observer.
471         (-[WebCoreAVVideoCaptureSourceObserver observeValueForKeyPath:ofObject:change:context:]): Call
472         parent when "bounds" changes.
473         (-[WebCoreAVVideoCaptureSourceObserver actionForKey:]): Return nil to disable all animations.
474
475 2016-11-30  Dave Hyatt  <hyatt@apple.com>
476
477         [CSS Parser] Fix crash in -webkit-shape-outside parsing
478         https://bugs.webkit.org/show_bug.cgi?id=165202
479
480         Reviewed by Dean Jackson.
481
482         * css/CSSBasicShapes.cpp:
483         (WebCore::buildSerializablePositionOffset):
484         The old parser never passed in a singleton value ID for top/right/bottom/left.
485         The new parser does, and it exposed a bug in the serialization code for
486         shapes that didn't properly create the offset primitive value as a percentage
487         in those cases.
488
489 2016-11-30  Carlos Garcia Campos  <cgarcia@igalia.com>
490
491         [GLIB] IndexedDB: Switch to use new encoder for IDBKeyData
492         https://bugs.webkit.org/show_bug.cgi?id=165191
493
494         Reviewed by Sergio Villar Senin.
495
496         Instead of using KeyedEncoder.
497
498         * Modules/indexeddb/server/IDBSerialization.cpp:
499         (WebCore::isLegacySerializedIDBKeyData): Helper function to check whether the given data were encoded with
500         KeyedEncoder or not.
501         (WebCore::serializedTypeForKeyType): Remove #ifdefs for CF and always use the new encoder.
502         (WebCore::encodeKey): Ditto.
503         (WebCore::serializeIDBKeyData): Ditto.
504         (WebCore::decodeKey): Ditto.
505         (WebCore::deserializeIDBKeyData): Ditto.
506
507 2016-11-30  Joseph Pecoraro  <pecoraro@apple.com>
508
509         Web Inspector: Null ResourceResponse Preflight requests cause crash
510         https://bugs.webkit.org/show_bug.cgi?id=165120
511         <rdar://problem/27911350>
512
513         Reviewed by Brian Burg.
514
515         * loader/CrossOriginPreflightChecker.cpp:
516         (WebCore::CrossOriginPreflightChecker::validatePreflightResponse):
517         Only inform Web Inspector about successful responses. Informing with a
518         null response would break the expected Inspector API contract when
519         notifying about did receive response. Also, when informing Web Inspector
520         include a didFinishLoading event so the frontend knows this pre-flight
521         request is complete.
522
523 2016-11-30  Brady Eidson  <beidson@apple.com>
524
525         REGRESSION (209086): IDB tests crash under GuardMalloc.
526         https://bugs.webkit.org/show_bug.cgi?id=165201
527
528         Reviewed by Chris Dumez.
529
530         No new tests (Covered by literally every IDB test when run under GuardMalloc).
531
532         * Modules/indexeddb/IDBTransaction.cpp:
533         (WebCore::IDBTransaction::commitOnServer): "Commit on Server" operations are special, in that they
534           are the last operation a transaction does, and they remove themselves from the protector map right away.
535           So when we remove them from the protector map we also need to remove their raw-pointer from the 
536           "in-progress" queue.
537
538 2016-11-30  Said Abou-Hallawa  <sabouhallawa@apple.com>
539
540         Some animated image do not animate after reseting their animations
541         https://bugs.webkit.org/show_bug.cgi?id=165131
542
543         Reviewed by Simon Fraser.
544
545         Test: fast/images/reset-image-animation.html
546
547         The bug happens because the ImageFrameCache does not reset its cached
548         frames properly when the BitmapImage rests its animation.
549
550         -- We need to ignore caching the new NativeImage of an ImageFrame if the
551         decoding thread is terminated after asynchronously calling  
552         cacheFrameNativeImageAtIndex() on the main thread through callOnMainThread().
553         Although the decoding thread was terminated this call is still scheduled
554         to be executed later on the main thread.
555
556         -- We need to open the m_frameRequestQueue before starting a new decoding
557         thread. Opening m_frameRequestQueue clears the enqueued requests from the 
558         previous decoding thread and allows enqueueing requests for the new thread.
559
560         -- We need to clear the ImageFrames which were being decoded at the time
561         the decoding queue was closing and their new NativeImages were not cached.
562
563         * platform/graphics/ImageFrameCache.cpp:
564         (WebCore::ImageFrameCache::cacheFrameNativeImageAtIndex): Assert the NativeImage
565         is cached for an ImageFrame which is still being decoded.
566
567         (WebCore::ImageFrameCache::startAsyncDecodingQueue): Open the m_frameRequestQueue
568         before starting the decoding thread. Don't cache the NativeImage of an ImageFrame
569         unless the decoding thread is still alive and it the same as the one that makes
570         the asynchronous call to cacheFrameNativeImageAtIndex().
571         
572         (WebCore::ImageFrameCache::requestFrameAsyncDecodingAtIndex): Don't request an
573         image frame to be be asynchronously decoded if it is already being decoded.
574         
575         (WebCore::ImageFrameCache::stopAsyncDecodingQueue): Clear the ImageFrames that
576         were being decoded when the decoding thread terminates.
577         
578         * testing/Internals.cpp:
579         (WebCore::Internals::resetImageAnimation):
580         * testing/Internals.h:
581         * testing/Internals.idl:
582         Expose BitmapImage::resetAnimation() through Internals so tests can force it.
583
584 2016-11-30  Darin Adler  <darin@apple.com>
585
586         Streamline and speed up tokenizer and segmented string classes
587         https://bugs.webkit.org/show_bug.cgi?id=165003
588
589         Reviewed by Sam Weinig.
590
591         Profiling Speedometer on my iMac showed the tokenizer as one of the
592         hottest functions. This patch streamlines the segmented string class,
593         removing various unused features, and also improves some other functions
594         seen on the Speedometer profile. On my iMac I measured a speedup of
595         about 3%. Changes include:
596
597         - Removed m_pushedChar1, m_pushedChar2, and m_empty data members from the
598           SegmentedString class and all the code that used to handle them.
599
600         - Simplified the SegmentedString advance functions so they are small
601           enough to get inlined in the HTML tokenizer.
602
603         - Updated callers to call the simpler SegmentedString advance functions
604           that don't handle newlines in as many cases as possible.
605
606         - Cut down on allocations of SegmentedString and made code move the
607           segmented string and the strings that are moved into it rather than
608           copying them whenever possible.
609
610         - Simplified segmented string functions, removing some branches, mostly
611           from the non-fast paths.
612
613         - Removed small unused functions and small functions used in only one
614           or two places, made more functions private and renamed for clarity.
615
616         * bindings/js/JSHTMLDocumentCustom.cpp:
617         (WebCore::documentWrite): Moved a little more of the common code in here
618         from the two functions belwo. Removed obsolete comment saying this was not
619         following the DOM specification because it is. Removed unneeded special
620         cases for 1 argument and no arguments. Take a reference instead of a pointer.
621         (WebCore::JSHTMLDocument::write): Updated for above.
622         (WebCore::JSHTMLDocument::writeln): Ditto.
623
624         * css/parser/CSSTokenizer.cpp: Added now-needed include.
625         * css/parser/CSSTokenizer.h: Removed unneeded include.
626
627         * css/parser/CSSTokenizerInputStream.h: Added definition of kEndOfFileMarker
628         here; this is now separate from the use in the HTMLParser. In the long run,
629         unclear to me whether it is really needed in either.
630
631         * dom/Document.cpp:
632         (WebCore::Document::prepareToWrite): Added. Helper function used by the three
633         different variants of write. Using this may prevent us from having to construct
634         a SegmentedString just to append one string after future refactoring.
635         (WebCore::Document::write): Updated to take an rvalue reference and move the
636         value through.
637         (WebCore::Document::writeln): Use a single write call instead of two.
638
639         * dom/Document.h: Changed write to take an rvalue reference to SegmentedString
640         rather than a const reference.
641
642         * dom/DocumentParser.h: Changed insert to take an rvalue reference to
643         SegmentedString. In the future, should probably overload to take a single
644         string since that is the normal case.
645
646         * dom/RawDataDocumentParser.h: Updated for change to DocumentParser.
647
648         * html/FTPDirectoryDocument.cpp:
649         (WebCore::FTPDirectoryDocumentParser::append): Refactored a bit, just enough
650         so that we don't need an assignment operator for SegmentedString that can
651         copy a String.
652
653         * html/parser/HTMLDocumentParser.cpp:
654         (WebCore::HTMLDocumentParser::insert): Updated to take an rvalue reference,
655         and move the value through.
656         * html/parser/HTMLDocumentParser.h: Updated for the above.
657
658         * html/parser/HTMLEntityParser.cpp:
659         (WebCore::HTMLEntityParser::consumeNamedEntity): Updated for name changes.
660         Changed the twao calls to advance here to call advancePastNonNewline; no
661         change in behavior, but asserts what the code was assuming before, that the
662         character was not a newline.
663
664         * html/parser/HTMLInputStream.h:
665         (WebCore::HTMLInputStream::appendToEnd): Updated to take an rvalue reference,
666         and move the value through.
667         (WebCore::HTMLInputStream::insertAtCurrentInsertionPoint): Ditto.
668         (WebCore::HTMLInputStream::markEndOfFile): Removed the code to construct a
669         SegmentedString, overkill since we can just append an individual string.
670         (WebCore::HTMLInputStream::splitInto): Rewrote the move idiom here to actually
671         use move, which will reduce reference count churn and other unneeded work.
672
673         * html/parser/HTMLMetaCharsetParser.cpp:
674         (WebCore::HTMLMetaCharsetParser::checkForMetaCharset): Removed unneeded
675         construction of a SegmentedString, just to append a string.
676
677         * html/parser/HTMLSourceTracker.cpp:
678         (WebCore::HTMLSourceTracker::HTMLSourceTracker): Moved to the class definition.
679         (WebCore::HTMLSourceTracker::source): Updated for function name change.
680         * html/parser/HTMLSourceTracker.h: Updated for above.
681
682         * html/parser/HTMLTokenizer.cpp: Added now-needed include.
683         (WebCore::HTMLTokenizer::emitAndResumeInDataState): Use advancePastNonNewline,
684         since this function is never called in response to a newline character.
685         (WebCore::HTMLTokenizer::commitToPartialEndTag): Ditto.
686         (WebCore::HTMLTokenizer::commitToCompleteEndTag): Ditto.
687         (WebCore::HTMLTokenizer::processToken): Use ADVANCE_PAST_NON_NEWLINE_TO macro
688         instead of ADVANCE_TO in cases where the character we are advancing past is
689         known not to be a newline, so we can use the more efficient advance function
690         that doesn't check for the newline character.
691
692         * html/parser/InputStreamPreprocessor.h: Moved kEndOfFileMarker to
693         SegmentedString.h; not sure that's a good place for it either. In the long run,
694         unclear to me whether this is really needed.
695         (WebCore::InputStreamPreprocessor::peek): Added UNLIKELY for the empty check.
696         Added LIKELY for the not-special character check.
697         (WebCore::InputStreamPreprocessor::advance): Updated for the new name of the
698         advanceAndUpdateLineNumber function.
699         (WebCore::InputStreamPreprocessor::advancePastNonNewline): Added. More
700         efficient than advance for cases where the last characer is known not to be
701         a newline character.
702         (WebCore::InputStreamPreprocessor::skipNextNewLine): Deleted. Was unused.
703         (WebCore::InputStreamPreprocessor::reset): Deleted. Was unused except in the
704         constructor; added initial values for the data members to replace.
705         (WebCore::InputStreamPreprocessor::processNextInputCharacter): Removed long
706         FIXME comment that didn't really need to be here. Reorganized a bit.
707         (WebCore::InputStreamPreprocessor::isAtEndOfFile): Renamed and made static.
708
709         * html/track/BufferedLineReader.cpp:
710         (WebCore::BufferedLineReader::nextLine): Updated to not use the poorly named
711         scanCharacter function to advance past a newline. Also renamed from getLine
712         and changed to return Optional<String> instead of using a boolean to indicate
713         failure and an out argument.
714
715         * html/track/BufferedLineReader.h:
716         (WebCore::BufferedLineReader::BufferedLineReader): Use the default, putting
717         initial values on each data member below.
718         (WebCore::BufferedLineReader::append): Updated to take an rvalue reference,
719         and move the value through.
720         (WebCore::BufferedLineReader::scanCharacter): Deleted. Was poorly named,
721         and easy to replace with two lines of code at its two call sites.
722         (WebCore::BufferedLineReader::reset): Rewrote to correctly clear all the
723         data members of the class, not just the segmented string.
724
725         * html/track/InbandGenericTextTrack.cpp:
726         (WebCore::InbandGenericTextTrack::parseWebVTTFileHeader): Updated to take
727         an rvalue reference and move the value through.
728         * html/track/InbandGenericTextTrack.h: Updated for the above.
729
730         * html/track/InbandTextTrack.h: Updated since parseWebVTTFileHeader now
731         takes an rvalue reference.
732
733         * html/track/WebVTTParser.cpp:
734         (WebCore::WebVTTParser::parseFileHeader): Updated to take an rvalue reference
735         and move the value through.
736         (WebCore::WebVTTParser::parseBytes): Updated to pass ownership of the string
737         in to the line reader append function.
738         (WebCore::WebVTTParser::parseCueData): Use auto and WTFMove for WebVTTCueData.
739         (WebCore::WebVTTParser::flush): More of the same.
740         (WebCore::WebVTTParser::parse): Changed to use nextLine instead of getLine.
741         * html/track/WebVTTParser.h: Updated for the above.
742
743         * html/track/WebVTTTokenizer.cpp:
744         (WebCore::advanceAndEmitToken): Use advanceAndUpdateLineNumber by its new
745         name, just advance. No change in behavior.
746         (WebCore::WebVTTTokenizer::WebVTTTokenizer): Pass a String, not a
747         SegmentedString, to add the end of file marker.
748
749         * platform/graphics/InbandTextTrackPrivateClient.h: Updated since
750         parseWebVTTFileHeader takes an rvalue reference.
751
752         * platform/text/SegmentedString.cpp:
753         (WebCore::SegmentedString::Substring::appendTo): Moved here from the header.
754         The only caller is SegmentedString::toString, inside this file.
755         (WebCore::SegmentedString::SegmentedString): Deleted the copy constructor.
756         No longer needed.
757         (WebCore::SegmentedString::operator=): Defined a move assignment operator
758         rather than an ordinary assignment operator, since that's what the call
759         sites really need.
760         (WebCore::SegmentedString::length): Simplified since we no longer need to
761         support pushed characters.
762         (WebCore::SegmentedString::setExcludeLineNumbers): Simplified, since we
763         can just iterate m_otherSubstrings without an extra check. Also changed to
764         write directly to the data member of Substring instead of using a function.
765         (WebCore::SegmentedString::updateAdvanceFunctionPointersForEmptyString):
766         Added. Used when we run out of characters.
767         (WebCore::SegmentedString::clear): Removed code to clear now-deleted members.
768         Updated for changes to other member names.
769         (WebCore::SegmentedString::appendSubstring): Renamed from just append to
770         avoid ambiguity with the public append function. Changed to take an rvalue
771         reference, and move in, and added code to set m_currentCharacter properly,
772         so the caller doesn't have to deal with that.
773         (WebCore::SegmentedString::close): Updated to use m_isClosed by its new name.
774         Also removed unneeded comment about assertion that fires when trying to close
775         an already closed string.
776         (WebCore::SegmentedString::append): Added overloads for rvalue references of
777         both entire SegmentedString objects and of String. Streamlined to just call
778         appendSubstring and append to the deque.
779         (WebCore::SegmentedString::pushBack): Tightened up since we don't allow empty
780         strings and changed to take just a string, not an entire segmented string.
781         (WebCore::SegmentedString::advanceSubstring): Moved logic into the
782         advancePastSingleCharacterSubstringWithoutUpdatingLineNumber function.
783         (WebCore::SegmentedString::toString): Simplified now that we don't need to
784         support pushed characters.
785         (WebCore::SegmentedString::advancePastNonNewlines): Deleted.
786         (WebCore::SegmentedString::advance8): Deleted.
787         (WebCore::SegmentedString::advanceWithoutUpdatingLineNumber16): Renamed from
788         advance16. Simplified now that there are no pushed characters. Also changed to
789         access data members of m_currentSubstring directly instead of calling a function.
790         (WebCore::SegmentedString::advanceAndUpdateLineNumber8): Deleted.
791         (WebCore::SegmentedString::advanceAndUpdateLineNumber16): Ditto.
792         (WebCore::SegmentedString::advancePastSingleCharacterSubstringWithoutUpdatingLineNumber):
793         Renamed from advanceSlowCase. Removed uneeded logic to handle pushed characters.
794         Moved code in here from advanceSubstring.
795         (WebCore::SegmentedString::advancePastSingleCharacterSubstring): Renamed from
796         advanceAndUpdateLineNumberSlowCase. Simplified by calling the function above.
797         (WebCore::SegmentedString::advanceEmpty): Broke assertion up into two.
798         (WebCore::SegmentedString::updateSlowCaseFunctionPointers): Updated for name changes.
799         (WebCore::SegmentedString::advancePastSlowCase): Changed name and meaning of
800         boolean argument. Rewrote to use the String class less; it's now used only when
801         we fail to match after the first character rather than being used for the actual
802         comparison with the literal.
803
804         * platform/text/SegmentedString.h: Moved all non-trivial function bodies out of
805         the class definition to make things easier to read. Moved the SegmentedSubstring
806         class inside the SegmentedString class, making it a private struct named Substring.
807         Removed the m_ prefix from data members of the struct, removed many functions from
808         the struct and made its union be anonymous instead of naming it m_data. Removed
809         unneeded StringBuilder.h include.
810         (WebCore::SegmentedString::isEmpty): Changed to use the length of the substring
811         instead of a separate boolean. We never create an empty substring, nor leave one
812         in place as the current substring unless the entire segmented string is empty.
813         (WebCore::SegmentedString::advancePast): Updated to use the new member function
814         template instead of a non-template member function. The new member function is
815         entirely rewritten and does the matching directly rather than allocating a string
816         just to do prefix matching.
817         (WebCore::SegmentedString::advancePastLettersIgnoringASCIICase): Renamed to make
818         it clear that the literal must be all non-letters or lowercase letters as with
819         the other "letters ignoring ASCII case" functions. The three call sites all fit
820         the bill. Implement by calling the new function template.
821         (WebCore::SegmentedString::currentCharacter): Renamed from currentChar.
822         (WebCore::SegmentedString::Substring::Substring): Use an rvalue reference and
823         move the string in.
824         (WebCore::SegmentedString::Substring::currentCharacter): Simplified since this
825         is never used on an empty substring.
826         (WebCore::SegmentedString::Substring::incrementAndGetCurrentCharacter): Ditto.
827         (WebCore::SegmentedString::SegmentedString): Overload to take an rvalue reference.
828         Simplified since there are now fewer data members.
829         (WebCore::SegmentedString::advanceWithoutUpdatingLineNumber): Renamed from
830         advance, since this is only safe to use if there is some reason it is OK to skip
831         updating the line number.
832         (WebCore::SegmentedString::advance): Renamed from advanceAndUpdateLineNumber,
833         since doing that is the normal desired behavior and not worth mentioning in the
834         public function name.
835         (WebCore::SegmentedString::advancePastNewline): Renamed from
836         advancePastNewlineAndUpdateLineNumber.
837         (WebCore::SegmentedString::numberOfCharactersConsumed): Greatly simplified since
838         pushed characters are no longer supported.
839         (WebCore::SegmentedString::characterMismatch): Added. Used by advancePast.
840
841         * xml/parser/CharacterReferenceParserInlines.h:
842         (WebCore::unconsumeCharacters): Use toString rather than toStringPreserveCapacity
843         because the SegmentedString is going to take ownership of the string.
844         (WebCore::consumeCharacterReference): Updated to use the pushBack that takes just
845         a String, not a SegmentedString. Also use advancePastNonNewline.
846
847         * xml/parser/MarkupTokenizerInlines.h: Added ADVANCE_PAST_NON_NEWLINE_TO.
848
849         * xml/parser/XMLDocumentParser.cpp:
850         (WebCore::XMLDocumentParser::insert): Updated since this takes an rvalue reference.
851         (WebCore::XMLDocumentParser::append): Removed unnecessary code to create a
852         SegmentedString.
853         * xml/parser/XMLDocumentParser.h: Updated for above. Also fixed indentation
854         and initialized most data members.
855         * xml/parser/XMLDocumentParserLibxml2.cpp:
856         (WebCore::XMLDocumentParser::XMLDocumentParser): Moved most data member
857         initialization into the class definition.
858         (WebCore::XMLDocumentParser::resumeParsing): Removed code that copied a
859         segmented string, but converted the whole thing into a string before using it.
860         Now we convert to a string right away.
861
862 2016-11-30  Csaba Osztrogonác  <ossy@webkit.org>
863
864         Unreviewed speculative cmake buildfix after r209070.
865
866         * PlatformMac.cmake: New sources added.
867
868 2016-11-29  Philippe Normand  <pnormand@igalia.com>
869
870         [WebRTC][OpenWebRTC] Temporary device selection support
871         https://bugs.webkit.org/show_bug.cgi?id=165141
872
873         Reviewed by Alejandro G. Castro.
874
875         Make sure the player handles only one audio and video track at
876         most for now. The device choice can be influenced with the
877         WEBKIT_VIDEO_DEVICE and WEBKIT_AUDIO_DEVICE environment variables.
878         Each variable optionally holds the name of the device to use.
879
880         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.cpp:
881         (WebCore::MediaPlayerPrivateGStreamerOwr::play):
882         (WebCore::MediaPlayerPrivateGStreamerOwr::load):
883
884 2016-11-29  Claudio Saavedra  <csaavedra@igalia.com>
885
886         Build fix with !HAVE(ACCESSIBILITY)
887
888         * accessibility/AXObjectCache.h:
889         (WebCore::AccessibilityReplacedText::AccessibilityReplacedText):
890         (WebCore::AccessibilityReplacedText::postTextStateChangeNotification):
891
892         Add dummy implementations.
893
894 2016-11-29  Commit Queue  <commit-queue@webkit.org>
895
896         Unreviewed, rolling out r209058 and r209074.
897         https://bugs.webkit.org/show_bug.cgi?id=165188
898
899         These changes caused API test StringBuilderTest.Equal to crash
900         and/or fail. (Requested by ryanhaddad on #webkit).
901
902         Reverted changesets:
903
904         "Streamline and speed up tokenizer and segmented string
905         classes"
906         https://bugs.webkit.org/show_bug.cgi?id=165003
907         http://trac.webkit.org/changeset/209058
908
909         "REGRESSION (r209058): API test StringBuilderTest.Equal
910         crashing"
911         https://bugs.webkit.org/show_bug.cgi?id=165142
912         http://trac.webkit.org/changeset/209074
913
914 2016-11-29  Nan Wang  <n_wang@apple.com>
915
916         AX: ARIA tree & treeitem roles & aria-expanded state not spoken to VoiceOver iOS 10
917         https://bugs.webkit.org/show_bug.cgi?id=164936
918         <rdar://problem/29334274>
919
920         Reviewed by Chris Fleizach.
921
922         Added a new container type on iOS for trees. Also, since the treeitem role is ignored
923         on iOS, we should expose the expanded status of a treeitem to its accessible children.
924
925         Test: accessibility/ios-simulator/treeitem-expanded.html
926
927         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
928         (-[WebAccessibilityObjectWrapper _accessibilityTreeAncestor]):
929         (-[WebAccessibilityObjectWrapper treeItemParentForObject:]):
930         (-[WebAccessibilityObjectWrapper accessibilitySupportsARIAExpanded]):
931         (-[WebAccessibilityObjectWrapper accessibilityIsExpanded]):
932
933 2016-11-29  Chris Dumez  <cdumez@apple.com>
934
935         Unreviewed, rolling out r209096, r209104, and r209114.
936
937         Caused over 200 layout test failures on the bots
938
939         Reverted changesets:
940
941         "IndexedDB 2.0: Cache and reuse SQLiteStatements in the SQLite
942         backend."
943         https://bugs.webkit.org/show_bug.cgi?id=164974
944         http://trac.webkit.org/changeset/209096
945
946         "Followup to:"
947         https://bugs.webkit.org/show_bug.cgi?id=164974
948         http://trac.webkit.org/changeset/209104
949
950         "REGRESSION (r209104): storage/indexeddb/modern/gc-closes-
951         database(-private).html timeout."
952         https://bugs.webkit.org/show_bug.cgi?id=165186
953         http://trac.webkit.org/changeset/209114
954
955 2016-11-29  Antoine Quint  <graouts@apple.com>
956
957         [Modern Media Controls] Localization
958         https://bugs.webkit.org/show_bug.cgi?id=165176
959
960         Reviewed by Dean Jackson.
961
962         We add a new localization file for the purpose of modern media controls, since we may
963         require different strings than the legacy one.
964
965         * English.lproj/modern-media-controls-localized-strings.js: Added.
966         * Modules/modern-media-controls/controls/airplay-placard.js:
967         (AirplayPlacard):
968         * Modules/modern-media-controls/controls/pip-placard.js:
969         (PiPPlacard):
970         * Modules/modern-media-controls/main.js:
971         (UIString):
972         * Modules/modern-media-controls/media/status-support.js:
973         (StatusSupport.prototype.syncControl):
974         (StatusSupport):
975         * WebCore.xcodeproj/project.pbxproj:
976         * rendering/RenderThemeMac.mm:
977         (WebCore::RenderThemeMac::mediaControlsScript):
978
979 2016-11-29  Antoine Quint  <graouts@apple.com>
980
981         [Modern Media Controls] Show an invalid placard when we fail to load a media file
982         https://bugs.webkit.org/show_bug.cgi?id=165180
983
984         Reviewed by Dean Jackson.
985
986         We now show a placard with an "invalid" icon when we fail to load the media file.
987
988         Tests: media/modern-media-controls/invalid-placard/invalid-placard.html
989                media/modern-media-controls/placard-support/placard-support-error.html
990
991         * Modules/modern-media-controls/controls/icon-service.js:
992         * Modules/modern-media-controls/controls/invalid-placard.js: Added.
993         (InvalidPlacard):
994         * Modules/modern-media-controls/controls/media-controls.js:
995         (MediaControls.prototype.get showsStartButton):
996         (MediaControls.prototype.set showsStartButton):
997         (MediaControls.prototype.get showsPlacard):
998         (MediaControls.prototype.hidePlacard):
999         (MediaControls.prototype._invalidateChildren):
1000         * Modules/modern-media-controls/controls/placard.css:
1001         (.placard .icon):
1002         * Modules/modern-media-controls/images/iOS/invalid-placard@1x.png: Added.
1003         * Modules/modern-media-controls/images/iOS/invalid-placard@2x.png: Added.
1004         * Modules/modern-media-controls/images/iOS/invalid-placard@3x.png: Added.
1005         * Modules/modern-media-controls/images/macOS/invalid-placard@1x.png: Added.
1006         * Modules/modern-media-controls/images/macOS/invalid-placard@2x.png: Added.
1007         * Modules/modern-media-controls/js-files:
1008         * Modules/modern-media-controls/media/placard-support.js:
1009         (PlacardSupport.prototype.get mediaEvents):
1010         (PlacardSupport.prototype._updatePlacard):
1011         (PlacardSupport):
1012         * WebCore.xcodeproj/project.pbxproj:
1013
1014 2016-11-29  Antoine Quint  <graouts@apple.com>
1015
1016         [Modern Media Controls] Only show controls when the controls attribute is set
1017         https://bugs.webkit.org/show_bug.cgi?id=165175
1018
1019         We now respect the value of the media's "controls" attribute so that the start button and the controls
1020         bar are only shown when that attribute is set to "true".
1021
1022         Reviewed by Dean Jackson.
1023
1024         Tests: media/modern-media-controls/controls-visibility-support/controls-visibility-support-controls-off-audio.html
1025                media/modern-media-controls/controls-visibility-support/controls-visibility-support-controls-off.html
1026                media/modern-media-controls/controls-visibility-support/controls-visibility-support-controls-on-audio.html
1027                media/modern-media-controls/controls-visibility-support/controls-visibility-support-controls-on.html
1028                media/modern-media-controls/controls-visibility-support/controls-visibility-support-controls-toggle.html
1029
1030         * Modules/modern-media-controls/controls/controls-bar.js: Added.
1031         (ControlsBar):
1032         * Modules/modern-media-controls/controls/media-controls.js:
1033         (MediaControls.): Deleted.
1034         * Modules/modern-media-controls/js-files:
1035         * Modules/modern-media-controls/media/controls-visibility-support.js: Added.
1036         (ControlsVisibilitySupport):
1037         (ControlsVisibilitySupport.prototype.destroy):
1038         (ControlsVisibilitySupport.prototype.get mediaEvents):
1039         (ControlsVisibilitySupport.prototype.syncControl):
1040         * Modules/modern-media-controls/media/media-controller-support.js:
1041         (MediaControllerSupport):
1042         (MediaControllerSupport.prototype.handleEvent):
1043         * Modules/modern-media-controls/media/media-controller.js:
1044         (MediaController.prototype._updateControlsIfNeeded):
1045         * WebCore.xcodeproj/project.pbxproj:
1046
1047 2016-11-29  Brady Eidson  <beidson@apple.com>
1048
1049         Followup to:
1050         IndexedDB 2.0: Cache and reuse SQLiteStatements in the SQLite backend.
1051         https://bugs.webkit.org/show_bug.cgi?id=164974
1052
1053         Unreviewed.
1054
1055         * Modules/indexeddb/IDBTransaction.h: Until I can explore further why these operations
1056           are not protected in the map, change these raw pointers to RefPtrs.
1057           This fixes issues seen under GuardMalloc.
1058
1059 2016-11-29  Antoine Quint  <graouts@apple.com>
1060
1061         [Modern Media Controls] Inline controls show when entering fullscreen
1062         https://bugs.webkit.org/show_bug.cgi?id=165161
1063
1064         Reviewed by Dean Jackson.
1065
1066         We would error when entering fullscreen due to the TracksSupport having its destroy() method
1067         called when tearing down the inline controls and the `mediaController` reference being incorrect.
1068
1069         * Modules/modern-media-controls/media/tracks-support.js:
1070         (TracksSupport.prototype.destroy):
1071
1072 2016-11-29  Antoine Quint  <graouts@apple.com>
1073
1074         [Modern Media Controls] Status text stuck saying "Loading" after media starts playing
1075         https://bugs.webkit.org/show_bug.cgi?id=165162
1076
1077         Reviewed by Dean Jackson.
1078
1079         We forgot to handle the case where none of the special messages need to be set and the
1080         status text should be just an empty string, meaning there is no status text shown in the
1081         controls bar and the scrubber appears instead.
1082
1083         Test: media/modern-media-controls/status-support/status-support-playing.html
1084
1085         * Modules/modern-media-controls/media/status-support.js:
1086         (StatusSupport.prototype.syncControl):
1087         (StatusSupport):
1088
1089 2016-11-29  Brady Eidson  <beidson@apple.com>
1090
1091         IndexedDB 2.0: Cache and reuse SQLiteStatements in the SQLite backend.
1092         https://bugs.webkit.org/show_bug.cgi?id=164974
1093
1094         Reviewed by Alex Christensen.
1095
1096         No new tests (No behavior change other than being faster).
1097
1098         Instead of building new SQLiteStatements from scratch each time they're needed and then
1099         finalizing them after used for a single operation, cache them.
1100
1101         For tests that do puts and/or gets in tight loops, this shows up as a 5%-20% speedup on profiles.
1102
1103         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
1104         (WebCore::IDBServer::SQLiteIDBBackingStore::createAndPopulateInitialDatabaseInfo):
1105         (WebCore::IDBServer::SQLiteIDBBackingStore::getOrEstablishDatabaseInfo):
1106         (WebCore::IDBServer::SQLiteIDBBackingStore::createObjectStore):
1107         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteObjectStore):
1108         (WebCore::IDBServer::SQLiteIDBBackingStore::renameObjectStore):
1109         (WebCore::IDBServer::SQLiteIDBBackingStore::clearObjectStore):
1110         (WebCore::IDBServer::SQLiteIDBBackingStore::createIndex):
1111         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedHasIndexRecord):
1112         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedPutIndexRecord):
1113         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteIndex):
1114         (WebCore::IDBServer::SQLiteIDBBackingStore::renameIndex):
1115         (WebCore::IDBServer::SQLiteIDBBackingStore::keyExistsInObjectStore):
1116         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteUnusedBlobFileRecords):
1117         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteRecord):
1118         (WebCore::IDBServer::SQLiteIDBBackingStore::updateAllIndexesForAddRecord):
1119         (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord):
1120         (WebCore::IDBServer::SQLiteIDBBackingStore::getBlobRecordsForObjectStoreRecord):
1121         (WebCore::IDBServer::SQLiteIDBBackingStore::getRecord):
1122         (WebCore::IDBServer::SQLiteIDBBackingStore::cachedStatementForGetAllObjectStoreRecords):
1123         (WebCore::IDBServer::SQLiteIDBBackingStore::getAllObjectStoreRecords):
1124         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedGetKeyGeneratorValue):
1125         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedSetKeyGeneratorValue):
1126         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteBackingStore):
1127         (WebCore::IDBServer::SQLiteIDBBackingStore::cachedStatement):
1128         (WebCore::IDBServer::SQLiteIDBBackingStore::closeSQLiteDB):
1129         (WebCore::IDBServer::queryForGetAllObjectStoreRecords): Deleted.
1130         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
1131
1132 2016-11-22  Jiewen Tan  <jiewen_tan@apple.com>
1133
1134         Update SubtleCrypto::sign to match the latest spec
1135         https://bugs.webkit.org/show_bug.cgi?id=164740
1136         <rdar://problem/29257864>
1137
1138         Reviewed by Brent Fulgham.
1139
1140         This patch does following few things:
1141         1. It updates the SubtleCrypto::sign method to match the latest spec:
1142            https://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-sign.
1143            It also refers to the latest Editor's Draft to a certain degree:
1144            https://w3c.github.io/webcrypto/Overview.html#SubtleCrypto-method-sign.
1145         2. It implements sign operations of the following algorithms: HMAC, and
1146            RSASSA-PKCS1-V1_5.
1147         3. It also replaces promise.copyRef() with WTFMove(promise) for all the
1148            capture lists of exception callbacks in promise functions.
1149
1150         Tests: crypto/subtle/hmac-import-key-sign-sha1.html
1151                crypto/subtle/hmac-import-key-sign-sha224.html
1152                crypto/subtle/hmac-import-key-sign-sha256.html
1153                crypto/subtle/hmac-import-key-sign-sha384.html
1154                crypto/subtle/hmac-import-key-sign-sha512.html
1155                crypto/subtle/rsassa-pkcs1-v1_5-import-key-sign-sha1.html
1156                crypto/subtle/rsassa-pkcs1-v1_5-import-key-sign-sha224.html
1157                crypto/subtle/rsassa-pkcs1-v1_5-import-key-sign-sha256.html
1158                crypto/subtle/rsassa-pkcs1-v1_5-import-key-sign-sha384.html
1159                crypto/subtle/rsassa-pkcs1-v1_5-import-key-sign-sha512.html
1160                crypto/subtle/sign-malformed-parameters.html
1161                crypto/workers/subtle/hmac-import-key-sign.html
1162                crypto/workers/subtle/rsassa-pkcs1-v1_5-import-key-sign.html
1163
1164         * bindings/js/JSSubtleCryptoCustom.cpp:
1165         (WebCore::normalizeCryptoAlgorithmParameters):
1166         (WebCore::jsSubtleCryptoFunctionDecryptPromise):
1167         Fix a minor bug.
1168         (WebCore::jsSubtleCryptoFunctionEncryptPromise):
1169         (WebCore::jsSubtleCryptoFunctionDecryptPromise):
1170         (WebCore::jsSubtleCryptoFunctionSignPromise):
1171         (WebCore::jsSubtleCryptoFunctionGenerateKeyPromise):
1172         (WebCore::jsSubtleCryptoFunctionImportKeyPromise):
1173         (WebCore::jsSubtleCryptoFunctionExportKeyPromise):
1174         (WebCore::JSSubtleCrypto::sign):
1175         * crypto/CryptoAlgorithm.cpp:
1176         (WebCore::CryptoAlgorithm::sign):
1177         * crypto/CryptoAlgorithm.h:
1178         * crypto/SubtleCrypto.idl:
1179         * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
1180         (WebCore::CryptoAlgorithmHMAC::sign):
1181         * crypto/algorithms/CryptoAlgorithmHMAC.h:
1182         * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
1183         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::sign):
1184         * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h:
1185         * crypto/gcrypt/CryptoAlgorithmHMACGCrypt.cpp:
1186         (WebCore::CryptoAlgorithmHMAC::platformSign):
1187         * crypto/gnutls/CryptoAlgorithmHMACGnuTLS.cpp:
1188         (WebCore::CryptoAlgorithmHMAC::platformSign):
1189         * crypto/gnutls/CryptoAlgorithmRSASSA_PKCS1_v1_5GnuTLS.cpp:
1190         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformSign):
1191         * crypto/mac/CryptoAlgorithmHMACMac.cpp:
1192         (WebCore::commonCryptoHMACAlgorithm):
1193         (WebCore::calculateSignature):
1194         Remove a null guardance since the depending bug is resolved.
1195         (WebCore::CryptoAlgorithmHMAC::platformSign):
1196         (WebCore::CryptoAlgorithmHMAC::platformVerify):
1197         * crypto/mac/CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp:
1198         (WebCore::signRSASSA_PKCS1_v1_5):
1199         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformSign):
1200
1201 2016-11-29  Chris Dumez  <cdumez@apple.com>
1202
1203         Can't download move.simple.com direct deposit transition PDF: Non user-triggered activations of anchors that have a download attribute are ignored
1204         https://bugs.webkit.org/show_bug.cgi?id=165148
1205         <rdar://problem/29421771>
1206
1207         Reviewed by Daniel Bates.
1208
1209         We were ignoring non user-triggered activations of anchors that have a
1210         download attribute which is stricter than Chrome and Firefox and breaks
1211         downloads on move.simple.com. This patch relaxes our policy to allow
1212         simulated clicks on such links, similarly to other browsers.
1213
1214         Web authors can anyway already trigger downloads using script by setting
1215         window.location to a specific URL and serving to right HTTP headers to
1216         trigger a download.
1217
1218         Note that our previous behavior matches the current version of the
1219         specification so I also filed a bug against the HTML specification to
1220         see if we can get it changed to match the behavior of browsers:
1221         - https://github.com/whatwg/html/issues/2116
1222
1223         No new tests, updated existing test.
1224
1225         * html/HTMLAnchorElement.cpp:
1226         (WebCore::HTMLAnchorElement::handleClick):
1227
1228 2016-11-29  Andy Estes  <aestes@apple.com>
1229
1230         [Cocoa] Enable two clang warnings recommended by Xcode
1231         https://bugs.webkit.org/show_bug.cgi?id=164498
1232
1233         Reviewed by Mark Lam.
1234
1235         * Configurations/Base.xcconfig: Enabled CLANG_WARN_INFINITE_RECURSION and CLANG_WARN_SUSPICIOUS_MOVE.
1236
1237 2016-11-29  Wenson Hsieh  <wenson_hsieh@apple.com>
1238
1239         Address post-review feedback following r209070 (AppKit momentum scrolling adoption for scroll snapping)
1240         https://bugs.webkit.org/show_bug.cgi?id=165147
1241
1242         Reviewed by Simon Fraser.
1243
1244         Addresses some additional review feedback after r209070, which adopts _NSScrollingMomentumCalculator for scroll
1245         snapping. See individual changes below for more details. No new tests, since there is no behavior change.
1246
1247         * page/EventHandler.cpp:
1248         (WebCore::handleWheelEventInAppropriateEnclosingBox):
1249         (WebCore::EventHandler::defaultWheelEventHandler):
1250         * page/Page.cpp:
1251         (WebCore::Page::ensureTestTrigger):
1252         * page/WheelEventDeltaFilter.cpp:
1253         (WebCore::WheelEventDeltaFilter::filteredVelocity):
1254         * page/WheelEventDeltaFilter.h:
1255         * page/mac/WheelEventDeltaFilterMac.mm:
1256         (WebCore::WheelEventDeltaFilterMac::updateFromDelta):
1257         * page/scrolling/AsyncScrollingCoordinator.cpp:
1258         (WebCore::AsyncScrollingCoordinator::updateExpectsWheelEventTestTriggerWithFrameView):
1259         * page/scrolling/AsyncScrollingCoordinator.h:
1260         * page/scrolling/ScrollingCoordinator.h:
1261         (WebCore::ScrollingCoordinator::updateExpectsWheelEventTestTriggerWithFrameView):
1262
1263         Rather than force a complete layout pass when the Page first acquires a WheelEventTestTrigger, we now simply
1264         have the scrolling coordinator update its frame node to expect a wheel event test trigger.
1265
1266         * page/scrolling/ScrollingMomentumCalculator.cpp:
1267         (WebCore::ScrollingMomentumCalculator::ScrollingMomentumCalculator):
1268         (WebCore::ScrollingMomentumCalculator::create):
1269         (WebCore::BasicScrollingMomentumCalculator::BasicScrollingMomentumCalculator):
1270         (WebCore::BasicScrollingMomentumCalculator::scrollOffsetAfterElapsedTime):
1271         (WebCore::BasicScrollingMomentumCalculator::animationDuration):
1272         (WebCore::BasicScrollingMomentumCalculator::initializeSnapProgressCurve):
1273         (WebCore::BasicScrollingMomentumCalculator::animationProgressAfterElapsedTime):
1274         * page/scrolling/ScrollingMomentumCalculator.h:
1275         * page/scrolling/mac/ScrollingMomentumCalculatorMac.h:
1276         * page/scrolling/mac/ScrollingMomentumCalculatorMac.mm:
1277         (WebCore::ScrollingMomentumCalculator::create):
1278         (WebCore::ScrollingMomentumCalculatorMac::ScrollingMomentumCalculatorMac):
1279         (WebCore::ScrollingMomentumCalculatorMac::scrollOffsetAfterElapsedTime):
1280         (WebCore::ScrollingMomentumCalculatorMac::animationDuration):
1281         (WebCore::ScrollingMomentumCalculatorMac::ensurePlatformMomentumCalculator):
1282         * platform/PlatformWheelEvent.h:
1283         (WebCore::PlatformWheelEvent::copyWithDeltasAndVelocity):
1284         (WebCore::PlatformWheelEvent::scrollingVelocity):
1285
1286         Change scrolling velocity in PlatformWheelEvent to be a FloatSize instead of a FloatPoint. This change
1287         propagates to the ScrollController, where state variables and arguments pertaining to scrolling velocity are
1288         also now sizes instead of points.
1289
1290         * platform/cocoa/ScrollController.h:
1291         * platform/cocoa/ScrollController.mm:
1292         (WebCore::ScrollController::scheduleStatelessScrollSnap):
1293         * platform/cocoa/ScrollSnapAnimatorState.h:
1294         * platform/cocoa/ScrollSnapAnimatorState.mm:
1295         (WebCore::ScrollSnapAnimatorState::transitionToGlideAnimationState):
1296         (WebCore::ScrollSnapAnimatorState::setupAnimationForState):
1297         (WebCore::ScrollSnapAnimatorState::teardownAnimationForState):
1298         (WebCore::ScrollSnapAnimatorState::currentAnimatedScrollOffset):
1299
1300         Refactor elapsed time to be Seconds instead of double. Additionally, use MonotonicTime::now() instead of
1301         monotonicallyIncreasingTime(), and MonotonicTime instead of double for keeping track of the start time.
1302
1303         * platform/spi/mac/NSScrollingMomentumCalculatorSPI.h:
1304
1305 2016-11-29  Brady Eidson  <beidson@apple.com>
1306
1307         IndexedDB 2.0: The client's transaction operation queue should flush as much to the server as possible.
1308         https://bugs.webkit.org/show_bug.cgi?id=164932
1309
1310         Reviewed by Alex Christensen.
1311
1312         No new tests (No new test necessary, covered extensively by all existing tests).
1313
1314         Profiles showed that on tests with lots of rapid IDBRequests in a row, both the main thread and database 
1315         threads were largely idle.
1316
1317         The explanation was simple. Currently the client IDBTransaction queues up operations and only vends them out 
1318         to the server 1 at a time, waiting for the previous operation to complete.
1319
1320         While some operations do need to wait for the server to reply, by making the change to send most operations 
1321         (all operations with an associated IDBRequest) to the server without waiting we get rid of most of the idleness.
1322
1323         It is possible we can find a few other types of operations to send without waiting, but we haven't yet seen any
1324         test case where they would show up on profiles.
1325
1326         Sending more than one operation at a time was actually a very small part of this change.
1327         As many "edge case" regression tests revealed, we also needed to start having IDBTransaction track all of their
1328         "in progress" operations such that they could be aborted on the client side in exceptional circumstances.
1329
1330         * Modules/indexeddb/IDBTransaction.cpp:
1331         (WebCore::IDBTransaction::abortInProgressOperations): Abort's all in-progress operations (ones that have already
1332           been sent to the server)
1333         (WebCore::IDBTransaction::abortOnServerAndCancelRequests): Abort in-progress operations before pending ones.
1334         (WebCore::IDBTransaction::operationTimerFired): If we just started an operation with an associated IDBRequest,
1335           schedule the timer to send another one right away.
1336         (WebCore::IDBTransaction::operationDidComplete):
1337         (WebCore::IDBTransaction::connectionClosedFromServer): Abort in-progress operations before pending ones.
1338         * Modules/indexeddb/IDBTransaction.h:
1339
1340         * Modules/indexeddb/client/TransactionOperation.cpp:
1341         (WebCore::IDBClient::TransactionOperation::TransactionOperation):
1342         * Modules/indexeddb/client/TransactionOperation.h:
1343         (WebCore::IDBClient::TransactionOperation::completed):
1344         (WebCore::IDBClient::TransactionOperation::hasIDBRequest):
1345
1346 2016-11-29  Dave Hyatt  <hyatt@apple.com>
1347
1348         [CSS Parser] Fix ::cue parsing
1349         https://bugs.webkit.org/show_bug.cgi?id=165152
1350
1351         Reviewed by Zalan Bujtas.
1352
1353         * css/parser/CSSParserValues.h:
1354         (WebCore::CSSParserSelector::setPseudoElementType):
1355         * css/parser/CSSSelectorParser.cpp:
1356         (WebCore::isOnlyPseudoClassFunction):
1357         (WebCore::isOnlyPseudoElementFunction):
1358         (WebCore::CSSSelectorParser::consumePseudo):
1359         (WebCore::isPseudoClassFunction): Deleted.
1360         (WebCore::isPseudoElementFunction): Deleted.
1361
1362 2016-11-28  Gavin Barraclough  <barraclough@apple.com>
1363
1364         HTMLMediaElement::updateVolume should updateIsPlayingMedia
1365         https://bugs.webkit.org/show_bug.cgi?id=165132
1366
1367         Reviewed by Darin Adler & Jer Noble.
1368
1369         HTMLMediaElement::mediaState takes the volume into account when determining whether media
1370         is playing (audio is not considered to be playing if volume is 0). As such, any change to
1371         the volume may require mediaState to be recomputed.
1372
1373         * html/HTMLMediaElement.cpp:
1374         (WebCore::HTMLMediaElement::updateVolume):
1375
1376 2016-11-29  Daniel Bates  <dabates@apple.com>
1377
1378         Avoid ref-count churn in ShadowParseContext::commitColor()
1379         https://bugs.webkit.org/show_bug.cgi?id=165125
1380
1381         Reviewed by Simon Fraser.
1382
1383         Avoid ref-count churn in ShadowParseContext::commitColor() by moving the passed
1384         color into its instance variable.
1385
1386         Also modified ShadowParseContext::commitColor() to take a Ref<> instead of a
1387         RefPtr<> because it is never passed a nullptr.
1388
1389         * css/parser/CSSParser.cpp:
1390         (WebCore::ShadowParseContext::commitColor):
1391
1392 2016-11-29  Daniel Bates  <dabates@apple.com>
1393
1394         Avoid ref-count churn in CSSParser::ValueWithCalculation::setCalculation()
1395         https://bugs.webkit.org/show_bug.cgi?id=165127
1396
1397         Reviewed by Simon Fraser.
1398
1399         Use WTFMove() to move the passed RefPtr into CSSParser::ValueWithCalculation::m_calculation
1400         instead of copying it.
1401
1402         * css/parser/CSSParser.h:
1403         (WebCore::CSSParser::ValueWithCalculation::setCalculation):
1404
1405 2016-11-29  Daniel Bates  <dabates@apple.com>
1406
1407         CryptoAlgorithm::generateKey() should take lvalue reference to const CryptoAlgorithmParameters
1408         https://bugs.webkit.org/show_bug.cgi?id=165111
1409
1410         Reviewed by Darin Adler.
1411
1412         CryptoAlgorithm::generateKey() and its overrides always expect to receive a non-null pointer
1413         to a CryptoAlgorithmParameter object and never take ownership of it. This kind of relationship
1414         is best expressed by modifying CryptoAlgorithm::generateKey() to take a lvalue reference to
1415         a const CryptoAlgorithmParameter object.
1416
1417         * bindings/js/JSSubtleCryptoCustom.cpp:
1418         (WebCore::jsSubtleCryptoFunctionGenerateKeyPromise):
1419         * crypto/CryptoAlgorithm.cpp:
1420         (WebCore::CryptoAlgorithm::generateKey):
1421         * crypto/CryptoAlgorithm.h:
1422         * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
1423         (WebCore::CryptoAlgorithmAES_CBC::generateKey):
1424         * crypto/algorithms/CryptoAlgorithmAES_CBC.h:
1425         * crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
1426         (WebCore::CryptoAlgorithmAES_KW::generateKey):
1427         * crypto/algorithms/CryptoAlgorithmAES_KW.h:
1428         * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
1429         (WebCore::CryptoAlgorithmHMAC::generateKey):
1430         * crypto/algorithms/CryptoAlgorithmHMAC.h:
1431         * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
1432         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::generateKey):
1433         * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h:
1434         * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
1435         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::generateKey):
1436         * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h:
1437         * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
1438         (WebCore::CryptoAlgorithmRSA_OAEP::generateKey):
1439         * crypto/algorithms/CryptoAlgorithmRSA_OAEP.h:
1440
1441 2016-11-29  Andy Estes  <aestes@apple.com>
1442
1443         window.name leaks information across domains
1444         https://bugs.webkit.org/show_bug.cgi?id=158216
1445         <rdar://problem/14548481>
1446
1447         Reviewed by Brent Fulgham.
1448
1449         When updating the history after a cross-origin navigation, the HTML Standard says:
1450
1451         "If the browsing context is a top-level browsing context, but not an auxiliary browsing
1452         context, then set the browsing context's name to the empty string."
1453
1454         https://html.spec.whatwg.org/multipage/browsers.html#resetBCName
1455
1456         Tests: http/tests/security/window-name-after-cross-origin-aux-frame-navigation.html
1457                http/tests/security/window-name-after-cross-origin-main-frame-navigation.html
1458                http/tests/security/window-name-after-cross-origin-sub-frame-navigation.html
1459                http/tests/security/window-name-after-same-origin-aux-frame-navigation.html
1460                http/tests/security/window-name-after-same-origin-main-frame-navigation.html
1461                http/tests/security/window-name-after-same-origin-sub-frame-navigation.html
1462
1463         * loader/FrameLoader.cpp:
1464         (WebCore::shouldClearWindowName): Returns true if frame is a main frame with no opener and
1465         newDocument does not have the same origin as the frame's current document.
1466         (WebCore::FrameLoader::clear): Changed to set m_frame's name to nullAtom if
1467         clearWindowProperties and shouldClearWindowName() are true.
1468         * page/SecurityOrigin.cpp:
1469         (WebCore::SecurityOrigin::canAccessStorage): Changed to call isSameOriginAs() and check
1470         m_universalAccess.
1471         (WebCore::SecurityOrigin::isSameOriginAs): Renamed from isThirdParty(); removed the check
1472         for m_universalAccess.
1473         (WebCore::SecurityOrigin::isThirdParty): Renamed to isSameOriginAs().
1474         * page/SecurityOrigin.h: Renamed isThirdParty() to isSameOriginAs() and made it public.
1475
1476 2016-11-29  Dave Hyatt  <hyatt@apple.com>
1477
1478         [CSS Parser] Fix parsing of "all" in transitions
1479         https://bugs.webkit.org/show_bug.cgi?id=165144
1480
1481         Reviewed by Dean Jackson.
1482
1483         * css/parser/CSSPropertyParser.cpp:
1484         (WebCore::consumeTransitionProperty):
1485
1486 2016-11-29  Dave Hyatt  <hyatt@apple.com>
1487
1488         [CSS Parser] Fix @page rule parsing
1489         https://bugs.webkit.org/show_bug.cgi?id=165143
1490
1491         Reviewed by Zalan Bujtas.
1492
1493         * css/parser/CSSParserImpl.cpp:
1494         (WebCore::CSSParserImpl::parsePageSelector):
1495
1496 2016-11-29  Wenson Hsieh  <wenson_hsieh@apple.com>
1497
1498         Unreviewed, fix the build after r209070
1499
1500         -[ScrollingMomentumCalculatorMac calculateToReachDestination] is only available on Sierra.
1501
1502         * page/scrolling/mac/ScrollingMomentumCalculatorMac.mm:
1503         (WebCore::ScrollingMomentumCalculatorMac::ensurePlatformMomentumCalculator):
1504         * platform/spi/mac/NSScrollingMomentumCalculatorSPI.h:
1505
1506 2016-11-28  Wenson Hsieh  <wenson_hsieh@apple.com>
1507
1508         Scroll snapping on Mac should use AppKit animations
1509         https://bugs.webkit.org/show_bug.cgi?id=147261
1510         <rdar://problem/29395293>
1511
1512         Reviewed by Brent Fulgham.
1513
1514         Refactors the scroll snapping animation logic to support arbitrary scrolling momentum calculators and
1515         introduces ScrollingMomentumCalculatorMac, which wraps AppKit's _NSScrollingMomentumCalculator. On macOS El
1516         Capitan and later, we use the platform scrolling momentum calculator and for all other cases, we fall back to
1517         the preexissting platform-invariant momentum calculator.
1518
1519         Previously, the scroll snapping animation logic was shared between the ScrollSnapAnimatorState and
1520         ScrollController -- namely, the ScrollController would update various parameters of the ScrollSnapAnimatorState
1521         and then tell it to compute animation-specific constants and coefficients. After this patch, ScrollController
1522         will no longer directly set the ScrollSnapAnimatorState's member variables. Instead, it will tell the animator
1523         state to transition to a new ScrollSnapState with the necessary parameters, and the ScrollSnapAnimatorState is
1524         responsible for modifying itself accordingly. Furthermore, logic pertaining to computing animated scroll offsets
1525         is now split out into a new ScrollingMomentumCalculator, which may have different platform-dependent
1526         implementations. The correct calculator is initialized via ScrollingMomentumCalculator::create, which currently
1527         returns a ScrollingMomentumCalculatorMac on El Capitan and later, and a BasicScrollingMomentumCalculator
1528         otherwise.
1529
1530         The new abstracted ScrollingMomentumCalculator is initialized with various parameters describing the scrolled
1531         content and viewport, as well as the initial and target scrolling offsets. The momentum calculator is then able
1532         to compute the animated scroll offset at any given elapsed time, as well as the total duration of the snapping
1533         animation. The ScrollController's scroll snap timer uses this information (via the ScrollSnapAnimatorState) to
1534         animate its client's scroll offset during a snap or glide.
1535
1536         Also reenables 8 failing and/or flaky scroll snapping tests and adds a new layout test. This patch addresses
1537         two causes for failures and flakiness in these scroll snapping tests:
1538
1539         1.  When starting or stopping the scroll snap animation timer, we call deferTestsForReason and
1540             removeTestDeferralForReason, respectively. These were actually noops for the first simulated scroll gesture
1541             on each of the failing mainframe scrolling tests due to m_expectsWheelEventTestTrigger being false. This
1542             member variable is updated when AsyncScrollingCoordinator::frameViewLayoutUpdated is invoked, wherein we
1543             call ScrollingStateFrameScrollingNode::setExpectsWheelEventTestTrigger(true) when the test has started
1544             monitoring wheel events. However, if this does not happen before scrolling begins in the test (which is the
1545             case here), then the mainframe scrolling node will not expect a wheel event test trigger even though
1546             eventSender.monitorWheelEvents() has been called. To fix this, we simply make the Page trigger a layout of
1547             the main FrameView when first ensuring the wheel event test trigger on the Page.
1548
1549         2.  The second reason for flakiness affects both overflow and mainframe scrolling. Previously, due to the way
1550             we would wait for multiple momentum scroll events before starting to glide, we would end up starting the
1551             scroll snap timer for a snapping animation, stopping it, and then starting it again for the glide animation.
1552             Thus, if the wheel event test trigger's timer fires right after the scroll snap timer stops and before it
1553             starts again due to a glide animation, it will erroneously think that scroll snapping is complete, even
1554             though it's only just about to begin! Now that we know scrolling velocity when we receive the initial
1555             "momentum begin", we now directly transition the scroll snap state from a snapping state to a gliding state
1556             and no longer stop and start the timer during this transition, which means that the test trigger will be
1557             deferred for at least the entire duration of the scroll snapping animation (starting right after the first
1558             "drag end" wheel event).
1559
1560         Test: tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-vertical-then-horizontal.html
1561
1562         * WebCore.xcodeproj/project.pbxproj:
1563         * page/EventHandler.cpp:
1564         (WebCore::handleWheelEventInAppropriateEnclosingBox):
1565         (WebCore::EventHandler::defaultWheelEventHandler):
1566         * page/Page.cpp:
1567         (WebCore::Page::ensureTestTrigger):
1568
1569         Addresses test failures by forcing the mainframe scrolling node to expect wheel event test triggers.
1570
1571         * page/WheelEventDeltaFilter.cpp:
1572         (WebCore::WheelEventDeltaFilter::create):
1573         (WebCore::WheelEventDeltaFilter::filteredVelocity):
1574         * page/WheelEventDeltaFilter.h:
1575         * page/mac/WheelEventDeltaFilterMac.mm:
1576         (WebCore::WheelEventDeltaFilterMac::updateFromDelta):
1577
1578         Add support for plumbing filtered scrolling velocity over to the ScrollController.
1579
1580         * page/scrolling/ScrollingMomentumCalculator.cpp: Copied from Source/WebCore/platform/cocoa/ScrollSnapAnimatorState.mm.
1581         (WebCore::ScrollingMomentumCalculator::ScrollingMomentumCalculator):
1582         (WebCore::ScrollingMomentumCalculator::create):
1583
1584         Creates a platform-independent BasicScrollingMomentumCalculator.
1585
1586         (WebCore::BasicScrollingMomentumCalculator::BasicScrollingMomentumCalculator):
1587         (WebCore::BasicScrollingMomentumCalculator::linearlyInterpolatedOffsetAtProgress):
1588         (WebCore::BasicScrollingMomentumCalculator::cubicallyInterpolatedOffsetAtProgress):
1589         (WebCore::BasicScrollingMomentumCalculator::scrollOffsetAfterElapsedTime):
1590         (WebCore::BasicScrollingMomentumCalculator::animationDuration):
1591         (WebCore::BasicScrollingMomentumCalculator::initializeInterpolationCoefficientsIfNecessary):
1592         (WebCore::BasicScrollingMomentumCalculator::initializeSnapProgressCurve):
1593         (WebCore::BasicScrollingMomentumCalculator::animationProgressAfterElapsedTime):
1594
1595         Interpolation logic ported over from ScrollSnapAnimatorState.
1596
1597         * page/scrolling/ScrollingMomentumCalculator.h: Added.
1598         (WebCore::ScrollingMomentumCalculator::~ScrollingMomentumCalculator):
1599         * page/scrolling/mac/ScrollingMomentumCalculatorMac.h: Copied from Source/WebCore/page/WheelEventDeltaFilter.h.
1600         * page/scrolling/mac/ScrollingMomentumCalculatorMac.mm: Added.
1601         (WebCore::ScrollingMomentumCalculator::create):
1602
1603         Creates a ScrollingMomentumCalculatorMac.
1604
1605         (WebCore::ScrollingMomentumCalculatorMac::ScrollingMomentumCalculatorMac):
1606         (WebCore::ScrollingMomentumCalculatorMac::scrollOffsetAfterElapsedTime):
1607         (WebCore::ScrollingMomentumCalculatorMac::animationDuration):
1608         (WebCore::ScrollingMomentumCalculatorMac::ensurePlatformMomentumCalculator):
1609         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
1610         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
1611         (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollOffset):
1612         (WebCore::ScrollingTreeFrameScrollingNodeMac::viewportSize):
1613         (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollOffsetOnAxis): Deleted.
1614         * platform/PlatformWheelEvent.h:
1615         (WebCore::PlatformWheelEvent::copyWithDeltasAndVelocity):
1616         (WebCore::PlatformWheelEvent::scrollingVelocity):
1617         (WebCore::PlatformWheelEvent::copyWithDeltas): Deleted.
1618         * platform/ScrollAnimator.cpp:
1619         (WebCore::ScrollAnimator::scrollOffset):
1620         (WebCore::ScrollAnimator::viewportSize):
1621         (WebCore::ScrollAnimator::scrollOffsetOnAxis): Deleted.
1622         * platform/ScrollAnimator.h:
1623         * platform/cocoa/ScrollController.h:
1624         * platform/cocoa/ScrollController.mm:
1625         (WebCore::otherScrollEventAxis):
1626         (WebCore::ScrollController::ScrollController):
1627         (WebCore::ScrollController::shouldOverrideInertialScrolling):
1628         (WebCore::ScrollController::scheduleStatelessScrollSnap):
1629         (WebCore::ScrollController::statelessSnapTransitionTimerFired):
1630         (WebCore::ScrollController::startDeferringTestsDueToScrollSnapping):
1631         (WebCore::ScrollController::stopDeferringTestsDueToScrollSnapping):
1632         (WebCore::ScrollController::processWheelEventForScrollSnap):
1633         (WebCore::ScrollController::updateScrollSnapState):
1634         (WebCore::ScrollController::updateScrollSnapPoints):
1635
1636         Update the ScrollController's ScrollSnapAnimationState for both vertical and horizontal axes. If both axes lack
1637         any snap points, the pointer to the animation state will be nulled out; otherwise, the animation state will
1638         exist.
1639
1640         (WebCore::ScrollController::startScrollSnapTimer):
1641         (WebCore::ScrollController::stopScrollSnapTimer):
1642         (WebCore::ScrollController::scrollSnapTimerFired):
1643         (WebCore::ScrollController::activeScrollSnapIndexForAxis):
1644         (WebCore::ScrollController::setActiveScrollSnapIndexForAxis):
1645         (WebCore::ScrollController::setNearestScrollSnapIndexForAxisAndOffset):
1646         (WebCore::ScrollController::setActiveScrollSnapIndicesForOffset):
1647         (WebCore::ScrollController::scrollSnapPointState): Deleted.
1648         (WebCore::ScrollController::processWheelEventForScrollSnapOnAxis): Deleted.
1649         (WebCore::ScrollController::shouldOverrideWheelEvent): Deleted.
1650         (WebCore::projectedInertialScrollDistance): Deleted.
1651         (WebCore::ScrollController::beginScrollSnapAnimation): Deleted.
1652         (WebCore::ScrollController::endScrollSnapAnimation): Deleted.
1653         (WebCore::ScrollController::initializeScrollSnapAnimationParameters): Deleted.
1654         (WebCore::ScrollController::isSnappingOnAxis): Deleted.
1655         * platform/cocoa/ScrollSnapAnimatorState.h:
1656         (WebCore::ScrollSnapAnimatorState::snapOffsetsForAxis):
1657         (WebCore::ScrollSnapAnimatorState::setSnapOffsetsForAxis):
1658         (WebCore::ScrollSnapAnimatorState::currentState):
1659         (WebCore::ScrollSnapAnimatorState::activeSnapIndexForAxis):
1660         (WebCore::ScrollSnapAnimatorState::setActiveSnapIndexForAxis):
1661         * platform/cocoa/ScrollSnapAnimatorState.mm:
1662         (WebCore::projectedInertialScrollDistance):
1663         (WebCore::ScrollSnapAnimatorState::transitionToSnapAnimationState):
1664         (WebCore::ScrollSnapAnimatorState::transitionToGlideAnimationState):
1665         (WebCore::ScrollSnapAnimatorState::transitionToUserInteractionState):
1666         (WebCore::ScrollSnapAnimatorState::transitionToDestinationReachedState):
1667
1668         These methods are used to update the ScrollSnapAnimationState. These state transitions should (and do)
1669         encapsulate all changes that need to be made to the animation state; in other words, the ScrollController should
1670         no longer be reaching directly into the ScrollSnapAnimatorState to change member variables.
1671
1672         (WebCore::ScrollSnapAnimatorState::setupAnimationForState):
1673         (WebCore::ScrollSnapAnimatorState::teardownAnimationForState):
1674         (WebCore::ScrollSnapAnimatorState::currentAnimatedScrollOffset):
1675         (WebCore::ScrollSnapAnimatorState::targetOffsetForStartOffset):
1676         (WebCore::ScrollSnapAnimatorState::ScrollSnapAnimatorState): Deleted.
1677         (WebCore::ScrollSnapAnimatorState::pushInitialWheelDelta): Deleted.
1678         (WebCore::ScrollSnapAnimatorState::averageInitialWheelDelta): Deleted.
1679         (WebCore::ScrollSnapAnimatorState::clearInitialWheelDeltaWindow): Deleted.
1680         (WebCore::ScrollSnapAnimatorState::isSnapping): Deleted.
1681         (WebCore::ScrollSnapAnimatorState::canReachTargetWithCurrentInitialScrollDelta): Deleted.
1682         (WebCore::ScrollSnapAnimatorState::wheelDeltaTrackingIsInProgress): Deleted.
1683         (WebCore::ScrollSnapAnimatorState::hasFinishedTrackingWheelDeltas): Deleted.
1684         (WebCore::ScrollSnapAnimatorState::interpolatedOffsetAtProgress): Deleted.
1685         (WebCore::ScrollSnapAnimationCurveState::initializeSnapProgressCurve): Deleted.
1686         (WebCore::ScrollSnapAnimationCurveState::initializeInterpolationCoefficientsIfNecessary): Deleted.
1687         (WebCore::ScrollSnapAnimationCurveState::interpolatedPositionAtProgress): Deleted.
1688         (WebCore::ScrollSnapAnimationCurveState::shouldCompleteSnapAnimationImmediatelyAtTime): Deleted.
1689         (WebCore::ScrollSnapAnimationCurveState::animationProgressAtTime): Deleted.
1690
1691         The ScrollSnapAnimatorState now tracks state across both axes. This simplifies coordinating scroll snapping in
1692         both horizontal and vertical axes and fixes the issue of the scroll offset not snapping when performing a scroll
1693         in one direction without momentum, then scrolling with momentum in the other direction in a single gesture.
1694
1695         * platform/spi/mac/NSScrollingMomentumCalculatorSPI.h: Added.
1696
1697 2016-11-29  Brady Eidson  <beidson@apple.com>
1698
1699         IndexedDB 2.0: Queue up completed requests in the client, handle them one by one.
1700         https://bugs.webkit.org/show_bug.cgi?id=165000
1701
1702         Reviewed by Alex Christensen.
1703
1704         No new tests (Covered extensively by every existing test).
1705
1706         Currently when a TransactionOperation completes on the server, it immediately completes
1707         itself on the client side, including scheduling an event dispatch if necessary.
1708         
1709         This patch changes it so that "server completed operations" instead queue up in the 
1710         IDBTransaction and are "client-side completed" asynchronously, 1-by-1.
1711         
1712         Currently this is a "no behavior change" because only one operation is ever sent to
1713         the server at a time.
1714         
1715         But that will change with https://webkit.org/b/164932
1716         And this patch is a pre-requisite for that.
1717         
1718         * Modules/indexeddb/IDBRequest.cpp:
1719         (WebCore::IDBRequest::dispatchEvent):
1720         (WebCore::IDBRequest::didOpenOrIterateCursor):
1721         (WebCore::IDBRequest::completeRequestAndDispatchEvent):
1722         (WebCore::IDBRequest::requestCompleted): Deleted.
1723         * Modules/indexeddb/IDBRequest.h:
1724         
1725         * Modules/indexeddb/IDBTransaction.cpp:
1726         (WebCore::IDBTransaction::IDBTransaction):
1727         (WebCore::IDBTransaction::internalAbort):
1728         (WebCore::IDBTransaction::abortOnServerAndCancelRequests):
1729         (WebCore::IDBTransaction::scheduleOperation):
1730         (WebCore::IDBTransaction::schedulePendingOperationTimer):
1731         (WebCore::IDBTransaction::pendingOperationTimerFired):
1732         (WebCore::IDBTransaction::operationCompletedOnServer):
1733         (WebCore::IDBTransaction::scheduleCompletedOperationTimer):
1734         (WebCore::IDBTransaction::completedOperationTimerFired):
1735         (WebCore::IDBTransaction::completeNoncursorRequest):
1736         (WebCore::IDBTransaction::completeCursorRequest):
1737         (WebCore::IDBTransaction::finishedDispatchEventForRequest):
1738         (WebCore::IDBTransaction::didStart):
1739         (WebCore::IDBTransaction::didOpenCursorOnServer):
1740         (WebCore::IDBTransaction::didIterateCursorOnServer):
1741         (WebCore::IDBTransaction::didGetAllRecordsOnServer):
1742         (WebCore::IDBTransaction::didGetRecordOnServer):
1743         (WebCore::IDBTransaction::didGetCountOnServer):
1744         (WebCore::IDBTransaction::didDeleteRecordOnServer):
1745         (WebCore::IDBTransaction::didClearObjectStoreOnServer):
1746         (WebCore::IDBTransaction::putOrAddOnServer):
1747         (WebCore::IDBTransaction::didPutOrAddOnServer):
1748         (WebCore::IDBTransaction::operationCompletedOnClient):
1749         (WebCore::IDBTransaction::deactivate):
1750         (WebCore::IDBTransaction::connectionClosedFromServer):
1751         (WebCore::IDBTransaction::scheduleOperationTimer): Deleted.
1752         (WebCore::IDBTransaction::operationTimerFired): Deleted.
1753         (WebCore::IDBTransaction::operationDidComplete): Deleted.
1754         * Modules/indexeddb/IDBTransaction.h:
1755         
1756         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
1757         (WebCore::IDBClient::IDBConnectionProxy::completeOperation):
1758         
1759         * Modules/indexeddb/client/TransactionOperation.cpp:
1760         (WebCore::IDBClient::TransactionOperation::TransactionOperation):
1761         * Modules/indexeddb/client/TransactionOperation.h:
1762         (WebCore::IDBClient::TransactionOperation::transitionToCompleteOnThisThread):
1763         (WebCore::IDBClient::TransactionOperation::transitionToComplete):
1764         (WebCore::IDBClient::TransactionOperation::doComplete):
1765         (WebCore::IDBClient::TransactionOperation::idbRequest):
1766         (WebCore::IDBClient::TransactionOperation::performCompleteOnOriginThread): Deleted.
1767         (WebCore::IDBClient::TransactionOperation::completed): Deleted.
1768
1769 2016-11-29  Zalan Bujtas  <zalan@apple.com>
1770
1771         Safari (WebKit) doesn't wrap element within flex when width comes below min-width
1772         https://bugs.webkit.org/show_bug.cgi?id=136041
1773         <rdar://problem/25569370>
1774
1775         Reviewed by Darin Adler.
1776
1777         While figuring out whether a particular flex item fits the current line, we need to take
1778         the min-width into account too. This matches both FF and Chrome behaviour.
1779
1780         Tests: fast/flexbox/flex-wrap-when-min-widht-is-set-1.html
1781                fast/flexbox/flex-wrap-when-min-widht-is-set-2.html
1782
1783         * rendering/RenderFlexibleBox.cpp:
1784         (WebCore::RenderFlexibleBox::computeNextFlexLine):
1785
1786 2016-11-29  Antti Koivisto  <antti@apple.com>
1787
1788         Try to fix win/gtk build.
1789
1790         * style/StyleUpdate.h:
1791         (WebCore::Style::ElementUpdate::ElementUpdate):
1792
1793             Add explicit constructor for compilers that don't support C++14 list initialization correctly.
1794
1795 2016-11-28  Antti Koivisto  <antti@apple.com>
1796
1797         Slotted nodes ignore transition
1798         https://bugs.webkit.org/show_bug.cgi?id=160866
1799         <rdar://problem/29231901>
1800
1801         Reviewed by Sam Weinig.
1802
1803         The problem is that slot (display:contents) always triggers full render tree rebuild when something
1804         changes in the slotted subtree. This causes animation to jump to end (may be another bug).
1805
1806         Test: fast/shadow-dom/shadow-host-transition.html
1807
1808         * style/RenderTreeUpdater.cpp:
1809         (WebCore::RenderTreeUpdater::updateElementRenderer):
1810         (WebCore::RenderTreeUpdater::updateBeforeOrAfterPseudoElement):
1811         * style/StyleChange.h:
1812
1813             Rearrange so the strongest ('Detach') is the highest.
1814
1815         * style/StyleTreeResolver.cpp:
1816         (WebCore::Style::TreeResolver::resolveElement):
1817         (WebCore::Style::TreeResolver::createAnimatedElementUpdate):
1818
1819             If style was display:contents and stays that way, use 'Inherit' StyleChange which doesn't force render tree rebuild.
1820             Refactor more of the functionality to createAnimatedElementUpdate.
1821
1822         * style/StyleTreeResolver.h:
1823
1824 2016-11-28  Carlos Garcia Campos  <cgarcia@igalia.com>
1825
1826         [GTK] Crash in WebCore::PlatformDisplayX11::supportsXComposite when running under Wayland
1827         https://bugs.webkit.org/show_bug.cgi?id=164917
1828
1829         Reviewed by Michael Catanzaro.
1830
1831         WebKitGTK+ appplications are expected to call gtk_init(), because WebKitGTK+, like GTK+ itself, requires a
1832         display to work. We currently fallback to create a X11 display when X11 is enabled in cases where GTK+ doesn't
1833         have a default display (gtk_init() wasn't called or failed). That's why we end up creating an X11 display under
1834         Wayland when both Wayland and X11 option are enabled. The code assumes X11 display creation will always work if
1835         X11 is enabled, but that's not true now that we support also Wayland at runtime. So, we should try to get a
1836         native display before creating the PlatformDisplay. Rendering will not work in any case when gtk_init() is not
1837         called, but in most of the cases those applications are not actually going to render anything, so this way at
1838         least we will not crash.
1839
1840         * platform/graphics/PlatformDisplay.cpp:
1841         (WebCore::PlatformDisplay::createPlatformDisplay): Use create() method for X11 and Wayland if we couldn't get a
1842         native display from GTK+. If everything fails create a display with no native.
1843         (WebCore::PlatformDisplay::PlatformDisplay): Add NativeDisplayOwned parameter.
1844         * platform/graphics/PlatformDisplay.h:
1845         * platform/graphics/wayland/PlatformDisplayWayland.cpp:
1846         (WebCore::PlatformDisplayWayland::create): Try to create a native Wayland display or return nullptr.
1847         (WebCore::PlatformDisplayWayland::PlatformDisplayWayland): Initialize NativeDisplayOwned parameter.
1848         (WebCore::PlatformDisplayWayland::~PlatformDisplayWayland): Destroy the display if owned.
1849         (WebCore::PlatformDisplayWayland::initialize): Return early if native display is nullptr.
1850         * platform/graphics/wayland/PlatformDisplayWayland.h:
1851         * platform/graphics/x11/PlatformDisplayX11.cpp:
1852         (WebCore::PlatformDisplayX11::create): Try to create a native X11 display or return nullptr.
1853         (WebCore::PlatformDisplayX11::PlatformDisplayX11): Use NativeDisplayOwned now.
1854         (WebCore::PlatformDisplayX11::~PlatformDisplayX11): Ditto.
1855         * platform/graphics/x11/PlatformDisplayX11.h:
1856
1857 2016-11-28  Matt Baker  <mattbaker@apple.com>
1858
1859         Web Inspector: Debugger should have an option for showing asynchronous call stacks
1860         https://bugs.webkit.org/show_bug.cgi?id=163230
1861         <rdar://problem/28698683>
1862
1863         Reviewed by Joseph Pecoraro.
1864
1865         Test: inspector/debugger/async-stack-trace.html
1866
1867         * inspector/InspectorInstrumentation.cpp:
1868         (WebCore::didScheduleAsyncCall):
1869         Helper function used by by instrumentation hooks. Informs the debugger
1870         agent that an asynchronous call was scheduled for the current script
1871         execution state.
1872
1873         (WebCore::InspectorInstrumentation::didInstallTimerImpl):
1874         (WebCore::InspectorInstrumentation::didRemoveTimerImpl):
1875         (WebCore::InspectorInstrumentation::willFireTimerImpl):
1876         (WebCore::InspectorInstrumentation::didFireTimerImpl):
1877         Asynchronous stack trace plumbing for timers (setTimeout, setInterval).
1878         (WebCore::InspectorInstrumentation::didRequestAnimationFrameImpl):
1879         (WebCore::InspectorInstrumentation::didCancelAnimationFrameImpl):
1880         (WebCore::InspectorInstrumentation::willFireAnimationFrameImpl):
1881         (WebCore::InspectorInstrumentation::didFireAnimationFrameImpl):
1882         Asynchronous stack trace plumbing for requestAnimationFrame.
1883
1884 2016-11-28  Jiewen Tan  <jiewen_tan@apple.com>
1885
1886         Unreviewed, followup patch after r209059.
1887
1888         * crypto/mac/CryptoAlgorithmAES_CBCMac.cpp:
1889         (WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
1890         (WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
1891         * crypto/mac/CryptoAlgorithmRSAES_PKCS1_v1_5Mac.cpp:
1892         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformEncrypt):
1893         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformDecrypt):
1894         * crypto/mac/CryptoAlgorithmRSA_OAEPMac.cpp:
1895         (WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt):
1896         (WebCore::CryptoAlgorithmRSA_OAEP::platformDecrypt):
1897
1898 2016-11-28  Jiewen Tan  <jiewen_tan@apple.com>
1899
1900         ASSERTION FAILED: m_scriptExecutionContext->isContextThread() seen with LayoutTest crypto/subtle/rsa-oaep-generate-key-encrypt-decrypt.html
1901         https://bugs.webkit.org/show_bug.cgi?id=165124
1902         <rdar://problem/29413805>
1903
1904         Reviewed by Daniel Bates.
1905
1906         We should only dereference callbacks after being back to the Document/Worker threads as
1907         it might destroy promises in the work queue which will then trigger the assertion.
1908
1909         Covered by existing tests.
1910
1911         * crypto/mac/CryptoAlgorithmAES_CBCMac.cpp:
1912         (WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
1913         (WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
1914         * crypto/mac/CryptoAlgorithmRSAES_PKCS1_v1_5Mac.cpp:
1915         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformEncrypt):
1916         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformDecrypt):
1917         * crypto/mac/CryptoAlgorithmRSA_OAEPMac.cpp:
1918         (WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt):
1919         (WebCore::CryptoAlgorithmRSA_OAEP::platformDecrypt):
1920
1921 2016-11-28  Darin Adler  <darin@apple.com>
1922
1923         Streamline and speed up tokenizer and segmented string classes
1924         https://bugs.webkit.org/show_bug.cgi?id=165003
1925
1926         Reviewed by Sam Weinig.
1927
1928         Profiling Speedometer on my iMac showed the tokenizer as one of the
1929         hottest functions. This patch streamlines the segmented string class,
1930         removing various unused features, and also improves some other functions
1931         seen on the Speedometer profile. On my iMac I measured a speedup of
1932         about 3%. Changes include:
1933
1934         - Removed m_pushedChar1, m_pushedChar2, and m_empty data members from the
1935           SegmentedString class and all the code that used to handle them.
1936
1937         - Simplified the SegmentedString advance functions so they are small
1938           enough to get inlined in the HTML tokenizer.
1939
1940         - Updated callers to call the simpler SegmentedString advance functions
1941           that don't handle newlines in as many cases as possible.
1942
1943         - Cut down on allocations of SegmentedString and made code move the
1944           segmented string and the strings that are moved into it rather than
1945           copying them whenever possible.
1946
1947         - Simplified segmented string functions, removing some branches, mostly
1948           from the non-fast paths.
1949
1950         - Removed small unused functions and small functions used in only one
1951           or two places, made more functions private and renamed for clarity.
1952
1953         * bindings/js/JSHTMLDocumentCustom.cpp:
1954         (WebCore::documentWrite): Moved a little more of the common code in here
1955         from the two functions belwo. Removed obsolete comment saying this was not
1956         following the DOM specification because it is. Removed unneeded special
1957         cases for 1 argument and no arguments. Take a reference instead of a pointer.
1958         (WebCore::JSHTMLDocument::write): Updated for above.
1959         (WebCore::JSHTMLDocument::writeln): Ditto.
1960
1961         * css/parser/CSSTokenizer.cpp: Added now-needed include.
1962         * css/parser/CSSTokenizer.h: Removed unneeded include.
1963
1964         * css/parser/CSSTokenizerInputStream.h: Added definition of kEndOfFileMarker
1965         here; this is now separate from the use in the HTMLParser. In the long run,
1966         unclear to me whether it is really needed in either.
1967
1968         * dom/Document.cpp:
1969         (WebCore::Document::prepareToWrite): Added. Helper function used by the three
1970         different variants of write. Using this may prevent us from having to construct
1971         a SegmentedString just to append one string after future refactoring.
1972         (WebCore::Document::write): Updated to take an rvalue reference and move the
1973         value through.
1974         (WebCore::Document::writeln): Use a single write call instead of two.
1975
1976         * dom/Document.h: Changed write to take an rvalue reference to SegmentedString
1977         rather than a const reference.
1978
1979         * dom/DocumentParser.h: Changed insert to take an rvalue reference to
1980         SegmentedString. In the future, should probably overload to take a single
1981         string since that is the normal case.
1982
1983         * dom/RawDataDocumentParser.h: Updated for change to DocumentParser.
1984
1985         * html/FTPDirectoryDocument.cpp:
1986         (WebCore::FTPDirectoryDocumentParser::append): Refactored a bit, just enough
1987         so that we don't need an assignment operator for SegmentedString that can
1988         copy a String.
1989
1990         * html/parser/HTMLDocumentParser.cpp:
1991         (WebCore::HTMLDocumentParser::insert): Updated to take an rvalue reference,
1992         and move the value through.
1993         * html/parser/HTMLDocumentParser.h: Updated for the above.
1994
1995         * html/parser/HTMLEntityParser.cpp:
1996         (WebCore::HTMLEntityParser::consumeNamedEntity): Updated for name changes.
1997         Changed the twao calls to advance here to call advancePastNonNewline; no
1998         change in behavior, but asserts what the code was assuming before, that the
1999         character was not a newline.
2000
2001         * html/parser/HTMLInputStream.h:
2002         (WebCore::HTMLInputStream::appendToEnd): Updated to take an rvalue reference,
2003         and move the value through.
2004         (WebCore::HTMLInputStream::insertAtCurrentInsertionPoint): Ditto.
2005         (WebCore::HTMLInputStream::markEndOfFile): Removed the code to construct a
2006         SegmentedString, overkill since we can just append an individual string.
2007         (WebCore::HTMLInputStream::splitInto): Rewrote the move idiom here to actually
2008         use move, which will reduce reference count churn and other unneeded work.
2009
2010         * html/parser/HTMLMetaCharsetParser.cpp:
2011         (WebCore::HTMLMetaCharsetParser::checkForMetaCharset): Removed unneeded
2012         construction of a SegmentedString, just to append a string.
2013
2014         * html/parser/HTMLSourceTracker.cpp:
2015         (WebCore::HTMLSourceTracker::HTMLSourceTracker): Moved to the class definition.
2016         (WebCore::HTMLSourceTracker::source): Updated for function name change.
2017         * html/parser/HTMLSourceTracker.h: Updated for above.
2018
2019         * html/parser/HTMLTokenizer.cpp: Added now-needed include.
2020         (WebCore::HTMLTokenizer::emitAndResumeInDataState): Use advancePastNonNewline,
2021         since this function is never called in response to a newline character.
2022         (WebCore::HTMLTokenizer::commitToPartialEndTag): Ditto.
2023         (WebCore::HTMLTokenizer::commitToCompleteEndTag): Ditto.
2024         (WebCore::HTMLTokenizer::processToken): Use ADVANCE_PAST_NON_NEWLINE_TO macro
2025         instead of ADVANCE_TO in cases where the character we are advancing past is
2026         known not to be a newline, so we can use the more efficient advance function
2027         that doesn't check for the newline character.
2028
2029         * html/parser/InputStreamPreprocessor.h: Moved kEndOfFileMarker to
2030         SegmentedString.h; not sure that's a good place for it either. In the long run,
2031         unclear to me whether this is really needed.
2032         (WebCore::InputStreamPreprocessor::peek): Added UNLIKELY for the empty check.
2033         Added LIKELY for the not-special character check.
2034         (WebCore::InputStreamPreprocessor::advance): Updated for the new name of the
2035         advanceAndUpdateLineNumber function.
2036         (WebCore::InputStreamPreprocessor::advancePastNonNewline): Added. More
2037         efficient than advance for cases where the last characer is known not to be
2038         a newline character.
2039         (WebCore::InputStreamPreprocessor::skipNextNewLine): Deleted. Was unused.
2040         (WebCore::InputStreamPreprocessor::reset): Deleted. Was unused except in the
2041         constructor; added initial values for the data members to replace.
2042         (WebCore::InputStreamPreprocessor::processNextInputCharacter): Removed long
2043         FIXME comment that didn't really need to be here. Reorganized a bit.
2044         (WebCore::InputStreamPreprocessor::isAtEndOfFile): Renamed and made static.
2045
2046         * html/track/BufferedLineReader.cpp:
2047         (WebCore::BufferedLineReader::nextLine): Updated to not use the poorly named
2048         scanCharacter function to advance past a newline. Also renamed from getLine
2049         and changed to return Optional<String> instead of using a boolean to indicate
2050         failure and an out argument.
2051
2052         * html/track/BufferedLineReader.h:
2053         (WebCore::BufferedLineReader::BufferedLineReader): Use the default, putting
2054         initial values on each data member below.
2055         (WebCore::BufferedLineReader::append): Updated to take an rvalue reference,
2056         and move the value through.
2057         (WebCore::BufferedLineReader::scanCharacter): Deleted. Was poorly named,
2058         and easy to replace with two lines of code at its two call sites.
2059         (WebCore::BufferedLineReader::reset): Rewrote to correctly clear all the
2060         data members of the class, not just the segmented string.
2061
2062         * html/track/InbandGenericTextTrack.cpp:
2063         (WebCore::InbandGenericTextTrack::parseWebVTTFileHeader): Updated to take
2064         an rvalue reference and move the value through.
2065         * html/track/InbandGenericTextTrack.h: Updated for the above.
2066
2067         * html/track/InbandTextTrack.h: Updated since parseWebVTTFileHeader now
2068         takes an rvalue reference.
2069
2070         * html/track/WebVTTParser.cpp:
2071         (WebCore::WebVTTParser::parseFileHeader): Updated to take an rvalue reference
2072         and move the value through.
2073         (WebCore::WebVTTParser::parseBytes): Updated to pass ownership of the string
2074         in to the line reader append function.
2075         (WebCore::WebVTTParser::parseCueData): Use auto and WTFMove for WebVTTCueData.
2076         (WebCore::WebVTTParser::flush): More of the same.
2077         (WebCore::WebVTTParser::parse): Changed to use nextLine instead of getLine.
2078         * html/track/WebVTTParser.h: Updated for the above.
2079
2080         * html/track/WebVTTTokenizer.cpp:
2081         (WebCore::advanceAndEmitToken): Use advanceAndUpdateLineNumber by its new
2082         name, just advance. No change in behavior.
2083         (WebCore::WebVTTTokenizer::WebVTTTokenizer): Pass a String, not a
2084         SegmentedString, to add the end of file marker.
2085
2086         * platform/graphics/InbandTextTrackPrivateClient.h: Updated since
2087         parseWebVTTFileHeader takes an rvalue reference.
2088
2089         * platform/text/SegmentedString.cpp:
2090         (WebCore::SegmentedString::Substring::appendTo): Moved here from the header.
2091         The only caller is SegmentedString::toString, inside this file.
2092         (WebCore::SegmentedString::SegmentedString): Deleted the copy constructor.
2093         No longer needed.
2094         (WebCore::SegmentedString::operator=): Defined a move assignment operator
2095         rather than an ordinary assignment operator, since that's what the call
2096         sites really need.
2097         (WebCore::SegmentedString::length): Simplified since we no longer need to
2098         support pushed characters.
2099         (WebCore::SegmentedString::setExcludeLineNumbers): Simplified, since we
2100         can just iterate m_otherSubstrings without an extra check. Also changed to
2101         write directly to the data member of Substring instead of using a function.
2102         (WebCore::SegmentedString::updateAdvanceFunctionPointersForEmptyString):
2103         Added. Used when we run out of characters.
2104         (WebCore::SegmentedString::clear): Removed code to clear now-deleted members.
2105         Updated for changes to other member names.
2106         (WebCore::SegmentedString::appendSubstring): Renamed from just append to
2107         avoid ambiguity with the public append function. Changed to take an rvalue
2108         reference, and move in, and added code to set m_currentCharacter properly,
2109         so the caller doesn't have to deal with that.
2110         (WebCore::SegmentedString::close): Updated to use m_isClosed by its new name.
2111         Also removed unneeded comment about assertion that fires when trying to close
2112         an already closed string.
2113         (WebCore::SegmentedString::append): Added overloads for rvalue references of
2114         both entire SegmentedString objects and of String. Streamlined to just call
2115         appendSubstring and append to the deque.
2116         (WebCore::SegmentedString::pushBack): Tightened up since we don't allow empty
2117         strings and changed to take just a string, not an entire segmented string.
2118         (WebCore::SegmentedString::advanceSubstring): Moved logic into the
2119         advancePastSingleCharacterSubstringWithoutUpdatingLineNumber function.
2120         (WebCore::SegmentedString::toString): Simplified now that we don't need to
2121         support pushed characters.
2122         (WebCore::SegmentedString::advancePastNonNewlines): Deleted.
2123         (WebCore::SegmentedString::advance8): Deleted.
2124         (WebCore::SegmentedString::advanceWithoutUpdatingLineNumber16): Renamed from
2125         advance16. Simplified now that there are no pushed characters. Also changed to
2126         access data members of m_currentSubstring directly instead of calling a function.
2127         (WebCore::SegmentedString::advanceAndUpdateLineNumber8): Deleted.
2128         (WebCore::SegmentedString::advanceAndUpdateLineNumber16): Ditto.
2129         (WebCore::SegmentedString::advancePastSingleCharacterSubstringWithoutUpdatingLineNumber):
2130         Renamed from advanceSlowCase. Removed uneeded logic to handle pushed characters.
2131         Moved code in here from advanceSubstring.
2132         (WebCore::SegmentedString::advancePastSingleCharacterSubstring): Renamed from
2133         advanceAndUpdateLineNumberSlowCase. Simplified by calling the function above.
2134         (WebCore::SegmentedString::advanceEmpty): Broke assertion up into two.
2135         (WebCore::SegmentedString::updateSlowCaseFunctionPointers): Updated for name changes.
2136         (WebCore::SegmentedString::advancePastSlowCase): Changed name and meaning of
2137         boolean argument. Rewrote to use the String class less; it's now used only when
2138         we fail to match after the first character rather than being used for the actual
2139         comparison with the literal.
2140
2141         * platform/text/SegmentedString.h: Moved all non-trivial function bodies out of
2142         the class definition to make things easier to read. Moved the SegmentedSubstring
2143         class inside the SegmentedString class, making it a private struct named Substring.
2144         Removed the m_ prefix from data members of the struct, removed many functions from
2145         the struct and made its union be anonymous instead of naming it m_data. Removed
2146         unneeded StringBuilder.h include.
2147         (WebCore::SegmentedString::isEmpty): Changed to use the length of the substring
2148         instead of a separate boolean. We never create an empty substring, nor leave one
2149         in place as the current substring unless the entire segmented string is empty.
2150         (WebCore::SegmentedString::advancePast): Updated to use the new member function
2151         template instead of a non-template member function. The new member function is
2152         entirely rewritten and does the matching directly rather than allocating a string
2153         just to do prefix matching.
2154         (WebCore::SegmentedString::advancePastLettersIgnoringASCIICase): Renamed to make
2155         it clear that the literal must be all non-letters or lowercase letters as with
2156         the other "letters ignoring ASCII case" functions. The three call sites all fit
2157         the bill. Implement by calling the new function template.
2158         (WebCore::SegmentedString::currentCharacter): Renamed from currentChar.
2159         (WebCore::SegmentedString::Substring::Substring): Use an rvalue reference and
2160         move the string in.
2161         (WebCore::SegmentedString::Substring::currentCharacter): Simplified since this
2162         is never used on an empty substring.
2163         (WebCore::SegmentedString::Substring::incrementAndGetCurrentCharacter): Ditto.
2164         (WebCore::SegmentedString::SegmentedString): Overload to take an rvalue reference.
2165         Simplified since there are now fewer data members.
2166         (WebCore::SegmentedString::advanceWithoutUpdatingLineNumber): Renamed from
2167         advance, since this is only safe to use if there is some reason it is OK to skip
2168         updating the line number.
2169         (WebCore::SegmentedString::advance): Renamed from advanceAndUpdateLineNumber,
2170         since doing that is the normal desired behavior and not worth mentioning in the
2171         public function name.
2172         (WebCore::SegmentedString::advancePastNewline): Renamed from
2173         advancePastNewlineAndUpdateLineNumber.
2174         (WebCore::SegmentedString::numberOfCharactersConsumed): Greatly simplified since
2175         pushed characters are no longer supported.
2176         (WebCore::SegmentedString::characterMismatch): Added. Used by advancePast.
2177
2178         * xml/parser/CharacterReferenceParserInlines.h:
2179         (WebCore::unconsumeCharacters): Use toString rather than toStringPreserveCapacity
2180         because the SegmentedString is going to take ownership of the string.
2181         (WebCore::consumeCharacterReference): Updated to use the pushBack that takes just
2182         a String, not a SegmentedString. Also use advancePastNonNewline.
2183
2184         * xml/parser/MarkupTokenizerInlines.h: Added ADVANCE_PAST_NON_NEWLINE_TO.
2185
2186         * xml/parser/XMLDocumentParser.cpp:
2187         (WebCore::XMLDocumentParser::insert): Updated since this takes an rvalue reference.
2188         (WebCore::XMLDocumentParser::append): Removed unnecessary code to create a
2189         SegmentedString.
2190         * xml/parser/XMLDocumentParser.h: Updated for above. Also fixed indentation
2191         and initialized most data members.
2192         * xml/parser/XMLDocumentParserLibxml2.cpp:
2193         (WebCore::XMLDocumentParser::XMLDocumentParser): Moved most data member
2194         initialization into the class definition.
2195         (WebCore::XMLDocumentParser::resumeParsing): Removed code that copied a
2196         segmented string, but converted the whole thing into a string before using it.
2197         Now we convert to a string right away.
2198
2199 2016-11-28  Chris Dumez  <cdumez@apple.com>
2200
2201         [iOS] Use UIKit SPI to force popover presentation style on iPhone for html validation popovers
2202         https://bugs.webkit.org/show_bug.cgi?id=165107
2203
2204         Reviewed by Simon Fraser.
2205
2206         Use UIKit SPI to force popover presentation style on iPhone for html validation
2207         popovers as this results in simpler code and achieves the same behavior.
2208
2209         * platform/ValidationBubble.h:
2210         * platform/ios/ValidationBubbleIOS.mm:
2211         (WebCore::ValidationBubble::setAnchorRect):
2212         (-[WebValidationBubbleDelegate adaptivePresentationStyleForPresentationController:traitCollection:]): Deleted.
2213         * platform/spi/ios/UIKitSPI.h:
2214
2215 2016-11-28  Chris Dumez  <cdumez@apple.com>
2216
2217         [Mac] Clicking on an HTML validation bubble should dismiss it
2218         https://bugs.webkit.org/show_bug.cgi?id=165117
2219         <rdar://problem/29409837>
2220
2221         Reviewed by Simon Fraser.
2222
2223         Clicking on an HTML validation bubble should dismiss it. It previously
2224         did nothing.
2225
2226         No new tests, this is not easily testable as EventSender.keyDown() sends
2227         the event to the view, not to a particular screen location.
2228
2229         * platform/mac/ValidationBubbleMac.mm:
2230         (-[WebValidationPopover mouseDown:]):
2231         (WebCore::ValidationBubble::ValidationBubble):
2232
2233 2016-11-27  Sam Weinig  <sam@webkit.org>
2234
2235         Make CanvasRenderingContext2D use WebIDL unions / Variants for createPattern and drawImage
2236         https://bugs.webkit.org/show_bug.cgi?id=165086
2237
2238         Reviewed by Darin Adler.
2239
2240         * html/canvas/CanvasRenderingContext2D.cpp:
2241         (WebCore::size):
2242         Add overloads of size for each type of CanvasSource.
2243         (WebCore::CanvasRenderingContext2D::drawImage):
2244         (WebCore::CanvasRenderingContext2D::createPattern):
2245         * html/canvas/CanvasRenderingContext2D.h:
2246         * html/canvas/CanvasRenderingContext2D.idl:
2247         Use variants to reduce code duplication and match spec language in drawImage and createPattern.
2248
2249 2016-11-28  Beth Dakin  <bdakin@apple.com>
2250
2251         Blacklist Netflix for TouchBar support
2252         https://bugs.webkit.org/show_bug.cgi?id=165104
2253         -and corresponding-
2254         rdar://problem/29404778
2255
2256         Reviewed by Tim Horton.
2257
2258         This patch moves the algorithm to 
2259         bestMediaElementForShowingPlaybackControlsManager() so that Now Playing can also 
2260         use it.
2261         * html/HTMLMediaElement.cpp:
2262         (WebCore::needsPlaybackControlsManagerQuirk):
2263         (WebCore::HTMLMediaElement::bestMediaElementForShowingPlaybackControlsManager):
2264         (WebCore::HTMLMediaElement::updatePlaybackControlsManager):
2265
2266 2016-11-28  Mark Lam  <mark.lam@apple.com>
2267
2268         Fix exception scope verification failures in more miscellaneous files.
2269         https://bugs.webkit.org/show_bug.cgi?id=165102
2270
2271         Reviewed by Saam Barati.
2272
2273         No new tests because these are fixes to failures detected by existing tests when
2274         exception check verification is enabled.
2275
2276         * bindings/js/IDBBindingUtilities.cpp:
2277         (WebCore::toJS):
2278         * bindings/js/JSCommandLineAPIHostCustom.cpp:
2279         (WebCore::getJSListenerFunctions):
2280         * bindings/js/JSCryptoKeySerializationJWK.cpp:
2281         (WebCore::buildJSONForRSAComponents):
2282         (WebCore::addUsagesToJSON):
2283         * bindings/js/JSDOMBinding.h:
2284         (WebCore::toJS):
2285         * bridge/runtime_array.cpp:
2286         (JSC::RuntimeArray::put):
2287
2288 2016-11-28  Dave Hyatt  <hyatt@apple.com>
2289
2290         [CSS Parser] Fix bugs in the @supports parser
2291         https://bugs.webkit.org/show_bug.cgi?id=165115
2292
2293         Reviewed by Zalan Bujtas.
2294
2295         * css/parser/CSSParserFastPaths.cpp:
2296         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
2297         Clean up the display property to match the old parser to ensure
2298         that @supports conditions on display are the same.
2299
2300         * css/parser/CSSSupportsParser.cpp:
2301         (WebCore::CSSSupportsParser::consumeCondition):
2302         (WebCore::CSSSupportsParser::consumeNegation):
2303         (WebCore::CSSSupportsParser::consumeConditionInParenthesis):
2304         * css/parser/CSSSupportsParser.h:
2305         What follows are all bugs in Blink that need to be fixed to pass our
2306         tests.
2307
2308         Fix the supports parser to allow the whitespace after not/or/and to
2309         be optional. Allow the whitespace following parenthetical conditions
2310         to be optional.
2311
2312         With whitespace being optional, this means that "not(" will parse
2313         as a FunctionToken type, as will "or(" and "and(". Handle this situation
2314         by checking for FunctionToken along with IdentToken and parameterizing
2315         consumeConditionInParenthesis to do the right thing when it starts with
2316         a FunctionToken instead of an IdentToken.
2317
2318         Fix the general enclosure FunctionToken for forward compatibility to require that
2319         the function still be enclosed within parentheses.
2320
2321 2016-11-28  Mark Lam  <mark.lam@apple.com>
2322
2323         Fix exception scope verification failures in ObjectConstructor.cpp and ObjectPrototype.cpp.
2324         https://bugs.webkit.org/show_bug.cgi?id=165051
2325
2326         Reviewed by Saam Barati.
2327
2328         No new tests because this is covered by the existing test
2329         http/tests/security/cross-frame-access-object-prototype.html with the help of a
2330         new ASSERT in ObjectPrototype.cpp.
2331
2332         Fixed jsDOMWindowGetOwnPropertySlotRestrictedAccess() to return false when it
2333         throws an exception.
2334
2335         * bindings/js/JSDOMWindowCustom.cpp:
2336         (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
2337
2338 2016-11-28  Tim Horton  <timothy_horton@apple.com>
2339
2340         Obvious change in saturation/color when swiping to a previously visited page
2341         https://bugs.webkit.org/show_bug.cgi?id=165112
2342         <rdar://problem/29257229>
2343
2344         Reviewed by Simon Fraser.
2345
2346         * platform/graphics/cocoa/IOSurface.mm:
2347         (WebCore::IOSurface::createFromImage):
2348         IOSurface::createFromImage should take into account the colorspace of the
2349         originating image, instead of just hardcoding sRGB.
2350
2351         Otherwise, on a non-sRGB display, the display-space snapshot that we take
2352         for back-forward swipe is converted to sRGB, then the colorspace information
2353         is lost (without a way to maintain it inside the IOSurface), and displayed
2354         as layer contents interpreted as display space (instead of sRGB).
2355
2356 2016-11-28  Chris Dumez  <cdumez@apple.com>
2357
2358         Unreviewed, fix crashes on Yosemite after r209009
2359
2360         NSTextField's maximumNumberOfLines was introduced in ElCapitan so
2361         disable it at compile-time on previous OSes for now.
2362
2363         * platform/mac/ValidationBubbleMac.mm:
2364         (WebCore::ValidationBubble::ValidationBubble):
2365
2366 2016-11-28  Keith Rollin  <krollin@apple.com>
2367
2368         Unreviewed, rolling out r208607.
2369
2370         The actual changes aren't inline with what was requested.
2371
2372         Reverted changeset:
2373
2374         "Reduce number of platformMemoryUsage calls"
2375         https://bugs.webkit.org/show_bug.cgi?id=164375
2376         http://trac.webkit.org/changeset/208607
2377
2378 2016-11-28  Beth Dakin  <bdakin@apple.com>
2379
2380         Blacklist Netflix for TouchBar support
2381         https://bugs.webkit.org/show_bug.cgi?id=165104
2382         -and corresponding-
2383         rdar://problem/29404778
2384
2385         Reviewed by Darin Adler.
2386
2387         * html/HTMLMediaElement.cpp:
2388         (WebCore::needsPlaybackControlsManagerQuirk):
2389         (WebCore::HTMLMediaElement::updatePlaybackControlsManager):
2390
2391 2016-11-28  Chris Dumez  <cdumez@apple.com>
2392
2393         Limit HTML Form validation popovers to 4 lines
2394         https://bugs.webkit.org/show_bug.cgi?id=165098
2395         <rdar://problem/29403286>
2396
2397         Reviewed by Darin Adler.
2398
2399         Limit HTML Form validation popovers to 4 lines as per recent feedback.
2400
2401         * platform/ios/ValidationBubbleIOS.mm:
2402         (WebCore::ValidationBubble::ValidationBubble):
2403         * platform/mac/ValidationBubbleMac.mm:
2404         (WebCore::ValidationBubble::ValidationBubble):
2405
2406 2016-11-28  Dave Hyatt  <hyatt@apple.com>
2407
2408         [CSS Parser] Filters and Reflections Fixes
2409         https://bugs.webkit.org/show_bug.cgi?id=165103
2410
2411         Reviewed by Zalan Bujtas.
2412
2413         * css/parser/CSSPropertyParser.cpp:
2414         (WebCore::consumeReflect):
2415         Support the "none" keyword for box-reflect.
2416
2417         * css/parser/CSSPropertyParserHelpers.cpp:
2418         (WebCore::CSSPropertyParserHelpers::isValidPrimitiveFilterFunction):
2419         (WebCore::CSSPropertyParserHelpers::consumeFilterFunction):
2420         Don't rely on range checking, since invert isn't grouped with the other
2421         function values. Actually check every keyword.
2422
2423 2016-11-28  Brent Fulgham  <bfulgham@apple.com>
2424
2425         ImageData does not match specification
2426         https://bugs.webkit.org/show_bug.cgi?id=164663
2427
2428         Reviewed by Simon Fraser.
2429
2430         The W3C specification https://www.w3.org/TR/2dcontext/ clearly states that
2431         the width and height attributes of the ImageData type should be unsigned.
2432         Our current implementation has signed integer values.
2433
2434         In practice, we have enforced the unsigned requirement by throwing a TypeError
2435         if you attempt to construct an ImageData with negative width or height.
2436
2437         This change simply updates the IDL and impelemntation to match the spec.
2438
2439         Test coverage is already provided by fast/canvas/canvas-imageData.html
2440
2441         * bindings/js/SerializedScriptValue.cpp:
2442         (WebCore::CloneDeserializer::readTerminal): Serialize as uint32_t values.
2443         * html/ImageData.idl: Revise width and height to be unsigned long.
2444
2445 2016-11-28  Dave Hyatt  <hyatt@apple.com>
2446
2447         [CSS Parser] flex-basis should be pixel units not percentages.
2448         https://bugs.webkit.org/show_bug.cgi?id=165100
2449
2450         Reviewed by Zalan Bujtas.
2451
2452         * css/parser/CSSPropertyParser.cpp:
2453         (WebCore::CSSPropertyParser::consumeFlex):
2454
2455 2016-11-28  Daniel Bates  <dabates@apple.com>
2456
2457         Replace CSSPropertyNames.in with a JSON file
2458         https://bugs.webkit.org/show_bug.cgi?id=164691
2459
2460         Reviewed by Simon Fraser.
2461
2462         Convert CSSPropertyNames.in to a structured JSON file. This is the first step towards
2463         exposing a CSS feature status dashboard and generating more of the boilerplate code
2464         for a CSS property.
2465
2466         A side effect of this change is that makeprop.pl no longer detects duplicate CSS property
2467         definitions. We will look to bring such duplication detection back in a subsequent
2468         commit.
2469
2470         * CMakeLists.txt: Substitute CSSProperties.json for CSSPropertyNames.in and update the
2471         invocation of makeprop.pl as we no longer need to pass the bindings/scripts/preprocessor.pm
2472         Perl module. Makeprop.pl supports conditional CSS properties and values without the need
2473         to preprocess CSSProperties.json using the C preprocessor.
2474         * DerivedSources.make: Ditto. Pass WTF_PLATFORM_IOS to makeprop.pl when building for iOS
2475         as we no longer make use of bindings/scripts/preprocessor.pm.
2476         * css/CSSProperties.json: Added.
2477         * css/CSSPropertyNames.in: Removed.
2478         * css/StyleResolver.cpp: Remove variable lastHighPriorityProperty as we now generate it.
2479         * css/makeprop.pl: Extracted the input file name, now CSSProperties.json, into a global variable
2480         and referenced this variable throughout this script instead of hardcoding the input file name at
2481         each call site. Updated code to handle CSS longhand names being encoded in a JSON array as opposed
2482         to a string of '|'-separated values. I added a FIXME comment to do the same for the codegen property
2483         "custom". Fixed Perl uninitialized variable warnings when die()-ing with error "Unknown CSS property
2484         used in all shorthand ..." or "Unknown CSS property used in longhands ...".
2485         (isPropertyEnabled): Added. Determine whether code should be generated for a property.
2486         (addProperty): Added.
2487         (sortByDescendingPriorityAndName): Added.
2488         (getScopeForFunction): Lowercase option names so that we can use a consistent case throughout
2489         the JSON file.
2490         (getNameForMethods): Ditto.
2491         (generateColorValueSetter):
2492         (generateAnimationPropertyInitialValueSetter): Ditto.
2493         (generateAnimationPropertyInheritValueSetter): Ditto.
2494         (generateFillLayerPropertyInitialValueSetter): Ditto.
2495         (generateFillLayerPropertyInheritValueSetter): Ditto.
2496         (generateSetValueStatement): Ditto.
2497         (generateInitialValueSetter): Ditto.
2498         (generateInheritValueSetter): Ditto.
2499         (generateValueSetter): Ditto.
2500
2501 2016-11-28  Dave Hyatt  <hyatt@apple.com>
2502
2503         [CSS Parser] Support -webkit-animation-trigger
2504         https://bugs.webkit.org/show_bug.cgi?id=165095
2505
2506         Reviewed by Zalan Bujtas.
2507
2508         * css/CSSValueKeywords.in:
2509         * css/parser/CSSPropertyParser.cpp:
2510         (WebCore::consumeWebkitAnimationTrigger):
2511         (WebCore::consumeAnimationValue):
2512         (WebCore::CSSPropertyParser::parseSingleValue):
2513
2514 2016-11-28  Antti Koivisto  <antti@apple.com>
2515
2516         Remove FIRST_LINE_INHERITED fake pseudo style
2517         https://bugs.webkit.org/show_bug.cgi?id=165071
2518
2519         Reviewed by Andreas Kling.
2520
2521         These are create during layout an then cached to the RenderStyle. Cache computed first line style to
2522         RenderObject rare data instead, avoiding style mutation an other confusing messiness.
2523
2524         * rendering/RenderElement.cpp:
2525         (WebCore::RenderElement::RenderElement):
2526         (WebCore::RenderElement::computeFirstLineStyle):
2527         (WebCore::RenderElement::firstLineStyle):
2528
2529             Cache the first line style.
2530
2531         (WebCore::RenderElement::invalidateCachedFirstLineStyle):
2532         (WebCore::RenderElement::styleWillChange):
2533
2534             Invalidate subtree if we have cached first line style.
2535
2536         (WebCore::RenderElement::getUncachedPseudoStyle):
2537         (WebCore::RenderElement::uncachedFirstLineStyle): Deleted.
2538         (WebCore::RenderElement::cachedFirstLineStyle): Deleted.
2539         * rendering/RenderElement.h:
2540         * rendering/RenderObject.cpp:
2541         (WebCore::RenderObject::rareDataMap):
2542         (WebCore::RenderObject::rareData):
2543         (WebCore::RenderObject::ensureRareData):
2544         * rendering/RenderObject.h:
2545
2546             Stop copying rare data objects.
2547
2548         * rendering/style/RenderStyle.cpp:
2549         (WebCore::RenderStyle::changeRequiresLayout):
2550
2551             Use the normal mechanism for invalidating layout for first-line instead of a hack in pseudoStyleCacheIsInvalid.
2552
2553         * rendering/style/RenderStyleConstants.h:
2554         * style/RenderTreeUpdater.cpp:
2555         (WebCore::pseudoStyleCacheIsInvalid):
2556
2557             Simplify.
2558
2559 2016-11-28  Miguel Gomez  <magomez@igalia.com>
2560
2561         [GTK] Dramatic increase on memory usage since 2.14.x
2562         https://bugs.webkit.org/show_bug.cgi?id=164049
2563
2564         Reviewed by Žan Doberšek.
2565
2566         Use OpenGL version 3.2 Core for rendering when available.
2567         Update some operations that have changed when using 3.2 Core:
2568         - Use glGetStringi to get the extensions list.
2569         - Do not use GL_POINT_SPRITE.
2570         - Always use a VAO when rendering.
2571         - Use a GLSL 1.50 compatible shader.
2572
2573         No new tests needed.
2574
2575         * platform/graphics/GLContext.cpp:
2576         (WebCore::GLContext::version):
2577         Add a method to get OpenGL version we are using.
2578         * platform/graphics/GLContext.h:
2579         Ditto.
2580         * platform/graphics/GraphicsContext3D.h:
2581         Add an attribute to store the VAO used for rendering.
2582         * platform/graphics/OpenGLShims.cpp:
2583         (WebCore::initializeOpenGLShims):
2584         Add glGetStringi to the list of functions.
2585         * platform/graphics/OpenGLShims.h:
2586         Ditto.
2587         * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
2588         (WebCore::GraphicsContext3D::GraphicsContext3D):
2589         Set appropriate output to the shader compiler and initalize the VAO if needed.
2590         (WebCore::GraphicsContext3D::~GraphicsContext3D):
2591         Delete the VAO if needed.
2592         (WebCore::GraphicsContext3D::getExtensions):
2593         Use glGetExtensionsi for OpenGL versions >= 3.2.
2594         * platform/graphics/glx/GLContextGLX.cpp:
2595         (WebCore::hasGLXARBCreateContextExtension):
2596         Check whether the GLX_ARB_create_context extension is available.
2597         (WebCore::GLContextGLX::createWindowContext):
2598         Use glXCreateContextAttribsARB() if possible to request an OpenGL 3.2 context.
2599         (WebCore::GLContextGLX::createPbufferContext):
2600         Ditto.
2601         * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
2602         (WebCore::Extensions3DOpenGLCommon::initializeAvailableExtensions):
2603         Enable glGetStringi for GTK.
2604         * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
2605         Do not use default getExtensions() method for GTK.
2606         * platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
2607         Ditto.
2608
2609 2016-11-24  Sergio Villar Senin  <svillar@igalia.com>
2610
2611         [css-grid] Move attributes from RenderGrid to the new Grid class
2612         https://bugs.webkit.org/show_bug.cgi?id=165065
2613
2614         Reviewed by Darin Adler.
2615
2616         A new class called Grid was added in 208973. This is the first of a couple of patches moving
2617         private attributes from RenderGrid to Grid.
2618
2619         Apart from that this is adding a couple of new helper functions that will decouple the
2620         existence of in-flow items from the actual data structures storing that information.
2621
2622         Last but not least, the Grid::insert() method does not only insert the item in the m_grid
2623         data structure, but also stores the GridArea associated to that item, so there is no need to
2624         do it in two different calls.
2625
2626         No new tests required as this is a refactoring.
2627
2628         * rendering/RenderGrid.cpp:
2629         (WebCore::RenderGrid::Grid::insert): Added a new parameter.
2630         (WebCore::RenderGrid::Grid::setSmallestTracksStart):
2631         (WebCore::RenderGrid::Grid::smallestTrackStart):
2632         (WebCore::RenderGrid::Grid::gridItemArea):
2633         (WebCore::RenderGrid::Grid::setGridItemArea):
2634         (WebCore::RenderGrid::Grid::clear): Clear the newly added attributes.
2635         (WebCore::RenderGrid::repeatTracksSizingIfNeeded):
2636         (WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
2637         (WebCore::RenderGrid::rawGridTrackSize):
2638         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctions):
2639         (WebCore::RenderGrid::computeEmptyTracksForAutoRepeat):
2640         (WebCore::RenderGrid::placeItemsOnGrid):
2641         (WebCore::RenderGrid::populateExplicitGridAndOrderIterator):
2642         (WebCore::RenderGrid::placeSpecifiedMajorAxisItemsOnGrid):
2643         (WebCore::RenderGrid::placeAutoMajorAxisItemOnGrid):
2644         (WebCore::RenderGrid::clearGrid):
2645         (WebCore::RenderGrid::offsetAndBreadthForPositionedChild):
2646         (WebCore::RenderGrid::cachedGridSpan):
2647         (WebCore::RenderGrid::cachedGridArea): Deleted.
2648         * rendering/RenderGrid.h:
2649
2650 2016-11-27  Sam Weinig  <sam@webkit.org>
2651
2652         Remove unused DOMRequestState
2653         https://bugs.webkit.org/show_bug.cgi?id=165085
2654
2655         Reviewed by Simon Fraser.
2656
2657         Remove DOMRequestState. It was unused.
2658
2659         * Modules/fetch/FetchBody.cpp:
2660         * WebCore.xcodeproj/project.pbxproj:
2661         * bindings/js/DOMRequestState.h: Removed.
2662
2663 2016-11-27  Csaba Osztrogonác  <ossy@webkit.org>
2664
2665         Fix various --minimal build issues
2666         https://bugs.webkit.org/show_bug.cgi?id=165060
2667
2668         Reviewed by Darin Adler.
2669
2670         * css/parser/CSSPropertyParser.cpp:
2671         * dom/Document.cpp:
2672         * loader/EmptyClients.cpp:
2673
2674 2016-11-26  Yusuke Suzuki  <utatane.tea@gmail.com>
2675
2676         [WTF] Import std::optional reference implementation as WTF::Optional
2677         https://bugs.webkit.org/show_bug.cgi?id=164199
2678
2679         Reviewed by Saam Barati and Sam Weinig.
2680
2681         Rename valueOr to value_or. This is specified in C++17 proposal.
2682
2683         Use Optional::emplace. C++17 Optional::operator=(Optional&&) requires
2684         either copy assignment operator or move assignment operator. But
2685         DFG::JSValueOperand etc. only defines move constructors and drop
2686         implicit copy assignment operators.
2687
2688         It was OK in the previous WTF::Optional since it always uses move
2689         constructors. But it is not valid in C++17 Optional. We use Optional::emplace
2690         instead. This function has the same semantics to the previous WTF::Optional's
2691         operator=.
2692
2693         No behavior change.
2694
2695         * Modules/applepay/ApplePaySession.cpp:
2696         (WebCore::parseAmount):
2697         (WebCore::createContactFields):
2698         (WebCore::toLineItemType):
2699         (WebCore::createLineItem):
2700         (WebCore::createLineItems):
2701         (WebCore::createMerchantCapabilities):
2702         (WebCore::createSupportedNetworks):
2703         (WebCore::toShippingType):
2704         (WebCore::createShippingMethod):
2705         (WebCore::createShippingMethods):
2706         (WebCore::createPaymentRequest):
2707         (WebCore::toPaymentAuthorizationStatus):
2708         * Modules/applepay/PaymentContact.h:
2709         * Modules/applepay/PaymentCoordinator.cpp:
2710         (WebCore::PaymentCoordinator::completeShippingMethodSelection):
2711         (WebCore::PaymentCoordinator::completeShippingContactSelection):
2712         (WebCore::PaymentCoordinator::completePaymentMethodSelection):
2713         * Modules/applepay/PaymentCoordinator.h:
2714         * Modules/applepay/PaymentCoordinatorClient.h:
2715         * Modules/applepay/PaymentMerchantSession.h:
2716         * Modules/applepay/PaymentRequest.h:
2717         * Modules/applepay/cocoa/PaymentContactCocoa.mm:
2718         (WebCore::PaymentContact::fromJS):
2719         * Modules/applepay/cocoa/PaymentMerchantSessionCocoa.mm:
2720         (WebCore::PaymentMerchantSession::fromJS):
2721         * Modules/encryptedmedia/MediaKeyStatusMap.cpp:
2722         (WebCore::MediaKeyStatusMap::Iterator::next):
2723         * Modules/encryptedmedia/MediaKeyStatusMap.h:
2724         * Modules/fetch/FetchBody.cpp:
2725         (WebCore::FetchBody::extract):
2726         * Modules/fetch/FetchBody.h:
2727         * Modules/fetch/FetchBodyOwner.cpp:
2728         (WebCore::FetchBodyOwner::FetchBodyOwner):
2729         (WebCore::FetchBodyOwner::loadBlob):
2730         (WebCore::FetchBodyOwner::finishBlobLoading):
2731         * Modules/fetch/FetchBodyOwner.h:
2732         * Modules/fetch/FetchHeaders.cpp:
2733         (WebCore::FetchHeaders::Iterator::next):
2734         * Modules/fetch/FetchHeaders.h:
2735         * Modules/fetch/FetchRequest.cpp:
2736         (WebCore::setReferrerPolicy):
2737         (WebCore::setMode):
2738         (WebCore::setCredentials):
2739         (WebCore::setCache):
2740         (WebCore::setRedirect):
2741         (WebCore::setMethod):
2742         (WebCore::setReferrer):
2743         (WebCore::buildOptions):
2744         (WebCore::FetchRequest::clone):
2745         * Modules/fetch/FetchRequest.h:
2746         (WebCore::FetchRequest::FetchRequest):
2747         * Modules/fetch/FetchResponse.cpp:
2748         (WebCore::FetchResponse::FetchResponse):
2749         (WebCore::FetchResponse::cloneForJS):
2750         (WebCore::FetchResponse::fetch):
2751         (WebCore::FetchResponse::BodyLoader::didSucceed):
2752         (WebCore::FetchResponse::BodyLoader::didFail):
2753         (WebCore::FetchResponse::BodyLoader::didReceiveResponse):
2754         (WebCore::FetchResponse::BodyLoader::stop):
2755         * Modules/fetch/FetchResponse.h:
2756         * Modules/geolocation/Coordinates.cpp:
2757         (WebCore::Coordinates::altitude):
2758         (WebCore::Coordinates::altitudeAccuracy):
2759         (WebCore::Coordinates::heading):
2760         (WebCore::Coordinates::speed):
2761         * Modules/geolocation/Coordinates.h:
2762         * Modules/indexeddb/IDBCursor.cpp:
2763         (WebCore::IDBCursor::stringToDirection):
2764         * Modules/indexeddb/IDBCursor.h:
2765         * Modules/indexeddb/IDBDatabase.h:
2766         * Modules/indexeddb/IDBDatabaseIdentifier.h:
2767         (WebCore::IDBDatabaseIdentifier::hash):
2768         * Modules/indexeddb/IDBFactory.cpp:
2769         (WebCore::IDBFactory::open):
2770         * Modules/indexeddb/IDBFactory.h:
2771         * Modules/indexeddb/IDBIndex.cpp:
2772         (WebCore::IDBIndex::getAll):
2773         (WebCore::IDBIndex::getAllKeys):
2774         * Modules/indexeddb/IDBIndex.h:
2775         * Modules/indexeddb/IDBKeyPath.h:
2776         (WebCore::isolatedCopy):
2777         * Modules/indexeddb/IDBObjectStore.cpp:
2778         (WebCore::IDBObjectStore::keyPath):
2779         (WebCore::IDBObjectStore::getAll):
2780         (WebCore::IDBObjectStore::getAllKeys):
2781         * Modules/indexeddb/IDBObjectStore.h:
2782         * Modules/indexeddb/IDBTransaction.cpp:
2783         (WebCore::IDBTransaction::requestGetAllObjectStoreRecords):
2784         (WebCore::IDBTransaction::requestGetAllIndexRecords):
2785         * Modules/indexeddb/IDBTransaction.h:
2786         * Modules/indexeddb/IDBVersionChangeEvent.cpp:
2787         (WebCore::IDBVersionChangeEvent::IDBVersionChangeEvent):
2788         * Modules/indexeddb/IDBVersionChangeEvent.h:
2789         * Modules/indexeddb/server/IDBSerialization.cpp:
2790         (WebCore::serializeIDBKeyPath):
2791         (WebCore::deserializeIDBKeyPath):
2792         * Modules/indexeddb/server/IDBSerialization.h:
2793         * Modules/indexeddb/server/MemoryIndex.cpp:
2794         (WebCore::IDBServer::MemoryIndex::getAllRecords):
2795         * Modules/indexeddb/server/MemoryIndex.h:
2796         * Modules/indexeddb/server/MemoryObjectStore.cpp:
2797         (WebCore::IDBServer::MemoryObjectStore::getAllRecords):
2798         * Modules/indexeddb/server/MemoryObjectStore.h:
2799         * Modules/indexeddb/server/MemoryObjectStoreCursor.cpp:
2800         (WebCore::IDBServer::MemoryObjectStoreCursor::objectStoreCleared):
2801         (WebCore::IDBServer::MemoryObjectStoreCursor::keyDeleted):
2802         (WebCore::IDBServer::MemoryObjectStoreCursor::setFirstInRemainingRange):
2803         (WebCore::IDBServer::MemoryObjectStoreCursor::setForwardIteratorFromRemainingRange):
2804         (WebCore::IDBServer::MemoryObjectStoreCursor::setReverseIteratorFromRemainingRange):
2805         (WebCore::IDBServer::MemoryObjectStoreCursor::incrementForwardIterator):
2806         (WebCore::IDBServer::MemoryObjectStoreCursor::incrementReverseIterator):
2807         * Modules/indexeddb/server/MemoryObjectStoreCursor.h:
2808         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
2809         (WebCore::IDBServer::SQLiteIDBBackingStore::extractExistingDatabaseInfo):
2810         * Modules/indexeddb/shared/IDBDatabaseInfo.cpp:
2811         (WebCore::IDBDatabaseInfo::createNewObjectStore):
2812         * Modules/indexeddb/shared/IDBDatabaseInfo.h:
2813         * Modules/indexeddb/shared/IDBGetAllRecordsData.h:
2814         * Modules/indexeddb/shared/IDBObjectStoreInfo.cpp:
2815         (WebCore::IDBObjectStoreInfo::IDBObjectStoreInfo):
2816         * Modules/indexeddb/shared/IDBObjectStoreInfo.h:
2817         (WebCore::IDBObjectStoreInfo::keyPath):
2818         * Modules/mediacontrols/MediaControlsHost.cpp:
2819         (WebCore::MediaControlsHost::displayNameForTrack):
2820         * Modules/mediacontrols/MediaControlsHost.h:
2821         * Modules/mediasource/MediaSource.cpp:
2822         (WebCore::MediaSource::endOfStream):
2823         (WebCore::MediaSource::streamEndedWithError):
2824         * Modules/mediasource/MediaSource.h:
2825         * Modules/mediastream/MediaStreamTrack.h:
2826         * Modules/mediastream/PeerConnectionBackend.cpp:
2827         (WebCore::PeerConnectionBackend::createOfferSucceeded):
2828         (WebCore::PeerConnectionBackend::createOfferFailed):
2829         (WebCore::PeerConnectionBackend::createAnswerSucceeded):
2830         (WebCore::PeerConnectionBackend::createAnswerFailed):
2831         (WebCore::PeerConnectionBackend::setLocalDescriptionSucceeded):
2832         (WebCore::PeerConnectionBackend::setLocalDescriptionFailed):
2833         (WebCore::PeerConnectionBackend::setRemoteDescriptionSucceeded):
2834         (WebCore::PeerConnectionBackend::setRemoteDescriptionFailed):
2835         (WebCore::PeerConnectionBackend::addIceCandidateSucceeded):
2836         (WebCore::PeerConnectionBackend::addIceCandidateFailed):
2837         (WebCore::PeerConnectionBackend::stop):
2838         * Modules/mediastream/PeerConnectionBackend.h:
2839         * Modules/mediastream/RTCDTMFSender.cpp:
2840         (WebCore::RTCDTMFSender::insertDTMF):
2841         * Modules/mediastream/RTCDTMFSender.h:
2842         * Modules/mediastream/RTCIceCandidate.cpp:
2843         (WebCore::RTCIceCandidate::create):
2844         (WebCore::RTCIceCandidate::RTCIceCandidate):
2845         * Modules/mediastream/RTCIceCandidate.h:
2846         (WebCore::RTCIceCandidate::sdpMLineIndex):
2847         * Modules/mediastream/SDPProcessor.cpp:
2848         (WebCore::iceCandidateFromJSON):
2849         * Modules/proximity/DeviceProximityEvent.h:
2850         * Modules/streams/ReadableStreamSource.h:
2851         (WebCore::ReadableStreamSource::startFinished):
2852         (WebCore::ReadableStreamSource::pullFinished):
2853         (WebCore::ReadableStreamSource::clean):
2854         * Modules/webaudio/AudioBufferSourceNode.cpp:
2855         (WebCore::AudioBufferSourceNode::start):
2856         * Modules/webaudio/AudioBufferSourceNode.h:
2857         * Modules/webdatabase/SQLResultSet.h:
2858         * Modules/websockets/WebSocket.cpp:
2859         (WebCore::WebSocket::close):
2860         * Modules/websockets/WebSocket.h:
2861         * Modules/websockets/WebSocketChannel.cpp:
2862         (WebCore::WebSocketChannel::didReceiveSocketStreamData):
2863         * Modules/websockets/WebSocketChannel.h:
2864         * bindings/generic/IDLTypes.h:
2865         (WebCore::IDLType::nullValue):
2866         * bindings/js/CachedModuleScript.h:
2867         (WebCore::CachedModuleScript::error):
2868         * bindings/js/Dictionary.h:
2869         (WebCore::Dictionary::get):
2870         * bindings/js/IDBBindingUtilities.cpp:
2871         (WebCore::toJS):
2872         * bindings/js/IDBBindingUtilities.h:
2873         * bindings/js/JSCryptoKeySerializationJWK.cpp:
2874         (WebCore::JSCryptoKeySerializationJWK::reconcileAlgorithm):
2875         * bindings/js/JSCryptoKeySerializationJWK.h:
2876         * bindings/js/JSDOMConvert.h:
2877         (WebCore::Detail::VariadicConverterBase::convert):
2878         (WebCore::Detail::VariadicConverterBase<IDLInterface<T>>::convert):
2879         (WebCore::convertVariadicArguments):
2880         * bindings/js/JSDOMIterator.h:
2881         (WebCore::IteratorTraits>::next):
2882         * bindings/js/JSDOMPromise.h:
2883         (WebCore::DOMPromise::DOMPromise):
2884         (WebCore::DOMPromise::operator=):
2885         * bindings/js/JSDOMWindowCustom.cpp:
2886         (WebCore::JSDOMWindow::getOwnPropertySlot):
2887         * bindings/js/JSDictionary.h:
2888         (WebCore::JSDictionary::convertValue):
2889         * bindings/js/JSFileCustom.cpp:
2890         (WebCore::constructJSFile):
2891         * bindings/js/JSHTMLAllCollectionCustom.cpp:
2892         (WebCore::callHTMLAllCollection):
2893         (WebCore::JSHTMLAllCollection::item):
2894         * bindings/js/JSHTMLCanvasElementCustom.cpp:
2895         (WebCore::JSHTMLCanvasElement::toDataURL):
2896         * bindings/js/JSImageConstructor.cpp:
2897         (WebCore::JSImageConstructor::construct):
2898         * bindings/js/JSMediaDevicesCustom.cpp:
2899         (WebCore::createStringConstraint):
2900         (WebCore::createBooleanConstraint):
2901         (WebCore::createDoubleConstraint):
2902         (WebCore::createIntConstraint):
2903         * bindings/js/JSWebKitSubtleCryptoCustom.cpp:
2904         (WebCore::importKey):
2905         * bindings/js/ScriptController.cpp:
2906         (WebCore::ScriptController::setupModuleScriptHandlers):
2907         (WebCore::ScriptController::executeScriptInWorld):
2908         (WebCore::ScriptController::executeScript):
2909         * bindings/scripts/CodeGeneratorJS.pm:
2910         (GenerateGetOwnPropertySlotBody):
2911         (GenerateEnumerationImplementationContent):
2912         (GenerateEnumerationHeaderContent):
2913         (GenerateDefaultValue):
2914         (GenerateImplementation):
2915         (GenerateParametersCheck):
2916         * bindings/scripts/test/JS/JSFloat64Array.cpp:
2917         (WebCore::JSFloat64Array::getOwnPropertySlot):
2918         (WebCore::JSFloat64Array::getOwnPropertyDescriptor):
2919         (WebCore::JSFloat64Array::put):
2920         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
2921         (WebCore::JSTestEventTarget::getOwnPropertySlot):
2922         * bindings/scripts/test/JS/JSTestObj.cpp:
2923         (WebCore::parseEnumeration<TestObj::EnumType>):
2924         (WebCore::parseEnumeration<TestObj::Optional>):
2925         (WebCore::parseEnumeration<AlternateEnumName>):
2926         (WebCore::parseEnumeration<TestObj::EnumA>):
2927         (WebCore::parseEnumeration<TestObj::EnumB>):
2928         (WebCore::parseEnumeration<TestObj::EnumC>):
2929         (WebCore::parseEnumeration<TestObj::Kind>):
2930         (WebCore::parseEnumeration<TestObj::Size>):
2931         (WebCore::parseEnumeration<TestObj::Confidence>):
2932         (WebCore::convertDictionary<TestObj::Dictionary>):
2933         (WebCore::JSTestObj::getOwnPropertySlot):
2934         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalEnumArgCaller):
2935         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalArgCaller):
2936         (WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndOptionalArgCaller):
2937         (WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndTwoOptionalArgsCaller):
2938         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalLongLongCaller):
2939         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalUnsignedLongLongCaller):
2940         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalSequenceCaller):
2941         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalBooleanCaller):
2942         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalRecordCaller):
2943         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod2Caller):
2944         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter2Caller):
2945         (WebCore::jsTestObjConstructorFunctionClassMethodWithOptional):
2946         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithOptionalIntArgumentCaller):
2947         * bindings/scripts/test/JS/JSTestObj.h:
2948         * bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
2949         (WebCore::parseEnumeration<TestStandaloneDictionary::EnumInStandaloneDictionaryFile>):
2950         * bindings/scripts/test/JS/JSTestStandaloneDictionary.h:
2951         * bindings/scripts/test/JS/JSTestStandaloneEnumeration.cpp:
2952         (WebCore::parseEnumeration<TestStandaloneEnumeration>):
2953         * bindings/scripts/test/JS/JSTestStandaloneEnumeration.h:
2954         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2955         (WebCore::jsTestTypedefsPrototypeFunctionSetShadowCaller):
2956         (WebCore::jsTestTypedefsPrototypeFunctionFuncWithClampCaller):
2957         * bridge/runtime_array.cpp:
2958         (JSC::RuntimeArray::getOwnPropertySlot):
2959         (JSC::RuntimeArray::put):
2960         * crypto/CryptoAlgorithmRegistry.cpp:
2961         (WebCore::CryptoAlgorithmRegistry::identifier):
2962         * crypto/CryptoAlgorithmRegistry.h:
2963         * crypto/CryptoKeySerialization.h:
2964         * crypto/JsonWebKey.h:
2965         * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
2966         (WebCore::CryptoAlgorithmAES_CBC::importKey):
2967         * crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
2968         (WebCore::CryptoAlgorithmAES_KW::importKey):
2969         * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
2970         (WebCore::CryptoAlgorithmHMAC::generateKey):
2971         (WebCore::CryptoAlgorithmHMAC::importKey):
2972         * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
2973         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::importKey):
2974         * crypto/gcrypt/CryptoAlgorithmHMACGCrypt.cpp:
2975         (WebCore::calculateSignature):
2976         * crypto/keys/CryptoKeyAES.h:
2977         * crypto/keys/CryptoKeyHMAC.h:
2978         * crypto/keys/CryptoKeyRSA.cpp:
2979         (WebCore::CryptoKeyRSA::importJwk):
2980         * crypto/keys/CryptoKeyRSA.h:
2981         * crypto/keys/CryptoKeySerializationRaw.cpp:
2982         (WebCore::CryptoKeySerializationRaw::reconcileAlgorithm):
2983         * crypto/keys/CryptoKeySerializationRaw.h:
2984         * crypto/mac/CryptoAlgorithmHMACMac.cpp:
2985         (WebCore::commonCryptoHMACAlgorithm):
2986         * crypto/mac/CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp:
2987         (WebCore::cryptoDigestAlgorithm):
2988         * crypto/parameters/CryptoAlgorithmHmacKeyParams.h:
2989         * crypto/parameters/CryptoAlgorithmRsaOaepParams.h:
2990         * css/CSSFontFace.cpp:
2991         (WebCore::CSSFontFace::calculateStyleMask):
2992         (WebCore::CSSFontFace::calculateWeightMask):
2993         * css/CSSFontFace.h:
2994         * css/CSSFontFaceSet.cpp:
2995         (WebCore::computeFontTraitsMask):
2996         * css/CSSPrimitiveValue.cpp:
2997         (WebCore::CSSPrimitiveValue::doubleValue):
2998         (WebCore::CSSPrimitiveValue::doubleValueInternal):
2999         * css/CSSPrimitiveValue.h:
3000         * css/CSSPropertyNames.in:
3001         * css/CSSSegmentedFontFace.cpp:
3002         * css/CSSStyleSheet.cpp:
3003         (WebCore::CSSStyleSheet::create):
3004         (WebCore::CSSStyleSheet::CSSStyleSheet):
3005         (WebCore::CSSStyleSheet::addRule):
3006         * css/CSSStyleSheet.h:
3007         * css/FontFace.cpp:
3008         (WebCore::FontFace::fontStateChanged):
3009         * css/FontFace.h:
3010         * css/FontFaceSet.cpp:
3011         (WebCore::FontFaceSet::completedLoading):
3012         * css/FontFaceSet.h:
3013         * css/MediaQueryEvaluator.cpp:
3014         (WebCore::doubleValue):
3015         * css/StyleBuilderConverter.h:
3016         (WebCore::StyleBuilderConverter::convertGridPosition):
3017         (WebCore::StyleBuilderConverter::convertWordSpacing):
3018         (WebCore::StyleBuilderConverter::convertPerspective):
3019         (WebCore::StyleBuilderConverter::convertMarqueeIncrement):
3020         (WebCore::StyleBuilderConverter::convertFilterOperations):
3021         (WebCore::StyleBuilderConverter::convertLineHeight):
3022         * css/StyleBuilderCustom.h:
3023         (WebCore::StyleBuilderCustom::applyValueLineHeight):
3024         * css/StyleRuleImport.cpp:
3025         (WebCore::StyleRuleImport::requestStyleSheet):
3026         * css/parser/CSSParser.cpp:
3027         (WebCore::CSSParser::parseCubicBezierTimingFunctionValue):
3028         (WebCore::CSSParser::parseSpringTimingFunctionValue):
3029         (WebCore::CSSParser::parseColorFunctionParameters):
3030         (WebCore::CSSParser::parseColorFromValue):
3031         * css/parser/CSSParser.h:
3032         * cssjit/SelectorCompiler.cpp:
3033         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateAddStyleRelationIfResolvingStyle):
3034         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateAddStyleRelation):
3035         * dom/CustomElementReactionQueue.cpp:
3036         * dom/Document.cpp:
3037         (WebCore::Document::lastModified):
3038         * dom/Element.cpp:
3039         (WebCore::Element::scrollBy):
3040         (WebCore::Element::getIntegralAttribute):
3041         (WebCore::Element::getUnsignedIntegralAttribute):
3042         (WebCore::Element::resolveCustomStyle):
3043         * dom/Element.h:
3044         * dom/ElementIteratorAssertions.h:
3045         (WebCore::ElementIteratorAssertions::dropEventDispatchAssertion):
3046         (WebCore::ElementIteratorAssertions::clear):
3047         * dom/ExceptionOr.h:
3048         * dom/InlineStyleSheetOwner.cpp:
3049         (WebCore::makeInlineStyleSheetCacheKey):
3050         * dom/KeyboardEvent.h:
3051         * dom/LoadableClassicScript.cpp:
3052         (WebCore::LoadableClassicScript::error):
3053         * dom/LoadableClassicScript.h:
3054         * dom/LoadableModuleScript.cpp:
3055         (WebCore::LoadableModuleScript::error):
3056         * dom/LoadableModuleScript.h:
3057         * dom/LoadableScript.h:
3058         * dom/MessageEvent.cpp:
3059         (WebCore::MessageEvent::MessageEvent):
3060         (WebCore::MessageEvent::create):
3061         (WebCore::MessageEvent::initMessageEvent):
3062         * dom/MessageEvent.h:
3063         * dom/MutationObserver.cpp:
3064         (WebCore::MutationObserver::observe):
3065         * dom/MutationObserver.h:
3066         * dom/ProcessingInstruction.cpp:
3067         (WebCore::ProcessingInstruction::checkStyleSheet):
3068         * dom/PseudoElement.cpp:
3069         (WebCore::PseudoElement::resolveCustomStyle):
3070         * dom/PseudoElement.h:
3071         * dom/RangeBoundaryPoint.h:
3072         (WebCore::RangeBoundaryPoint::setToBeforeChild):
3073         (WebCore::RangeBoundaryPoint::setToAfterChild):
3074         (WebCore::RangeBoundaryPoint::setToEndOfNode):
3075         (WebCore::RangeBoundaryPoint::invalidateOffset):
3076         * dom/ScriptElement.cpp:
3077         (WebCore::ScriptElement::determineScriptType):
3078         (WebCore::ScriptElement::prepareScript):
3079         (WebCore::ScriptElement::executeScriptAndDispatchEvent):
3080         * dom/ScriptElement.h:
3081         * dom/TextDecoder.cpp:
3082         (WebCore::TextDecoder::decode):
3083         * dom/TextDecoder.h:
3084         * dom/UserGestureIndicator.cpp:
3085         (WebCore::UserGestureIndicator::UserGestureIndicator):
3086         * dom/UserGestureIndicator.h:
3087         * editing/CompositeEditCommand.cpp:
3088         (WebCore::CompositeEditCommand::moveParagraphs):
3089         * editing/CompositeEditCommand.h:
3090         * fileapi/File.h:
3091         * history/CachedFrame.h:
3092         (WebCore::CachedFrame::hasInsecureContent):
3093         * html/DOMTokenList.cpp:
3094         (WebCore::DOMTokenList::toggle):
3095         * html/DOMTokenList.h:
3096         * html/HTMLAnchorElement.cpp:
3097         (WebCore::HTMLAnchorElement::handleClick):
3098         * html/HTMLCanvasElement.cpp:
3099         (WebCore::HTMLCanvasElement::toDataURL):
3100         * html/HTMLCanvasElement.h:
3101         * html/HTMLElement.cpp:
3102         (WebCore::HTMLElement::parseBorderWidthAttribute):
3103         (WebCore::HTMLElement::parseAttribute):
3104         * html/HTMLImageElement.cpp:
3105         (WebCore::HTMLImageElement::createForJSConstructor):
3106         (WebCore::HTMLImageElement::width):
3107         (WebCore::HTMLImageElement::height):
3108         * html/HTMLImageElement.h:
3109         * html/HTMLInputElement.cpp:
3110         (WebCore::HTMLInputElement::findClosestTickMarkValue):
3111         (WebCore::HTMLInputElement::maxLengthAttributeChanged):
3112         (WebCore::HTMLInputElement::minLengthAttributeChanged):
3113         * html/HTMLInputElement.h:
3114         * html/HTMLLinkElement.cpp:
3115         (WebCore::HTMLLinkElement::process):
3116         (WebCore::HTMLLinkElement::initializeStyleSheet):
3117         (WebCore::HTMLLinkElement::iconType):
3118         * html/HTMLLinkElement.h:
3119         * html/HTMLOListElement.h:
3120         * html/HTMLOptionsCollection.cpp:
3121         (WebCore::HTMLOptionsCollection::add):
3122         * html/HTMLOptionsCollection.h:
3123         * html/HTMLSelectElement.cpp:
3124         (WebCore::HTMLSelectElement::add):
3125         (WebCore::HTMLSelectElement::setLength):
3126         * html/HTMLSelectElement.h:
3127         * html/HTMLTextAreaElement.cpp:
3128         (WebCore::HTMLTextAreaElement::maxLengthAttributeChanged):
3129         (WebCore::HTMLTextAreaElement::minLengthAttributeChanged):
3130         * html/ImageInputType.cpp:
3131         (WebCore::ImageInputType::height):
3132         (WebCore::ImageInputType::width):
3133         * html/InputType.cpp:
3134         (WebCore::InputType::findClosestTickMarkValue):
3135         * html/InputType.h:
3136         * html/LinkIconCollector.cpp:
3137         * html/LinkRelAttribute.h:
3138         * html/RangeInputType.cpp:
3139         (WebCore::RangeInputType::findClosestTickMarkValue):
3140         * html/RangeInputType.h:
3141         * html/canvas/CanvasRenderingContext2D.cpp:
3142         (WebCore::CanvasRenderingContext2D::restore):
3143         (WebCore::CanvasRenderingContext2D::setStrokeColor):
3144         (WebCore::CanvasRenderingContext2D::setFillColor):
3145         (WebCore::CanvasRenderingContext2D::isPointInPathInternal):
3146         (WebCore::CanvasRenderingContext2D::isPointInStrokeInternal):
3147         (WebCore::CanvasRenderingContext2D::setShadow):
3148         (WebCore::CanvasRenderingContext2D::fillText):
3149         (WebCore::CanvasRenderingContext2D::strokeText):
3150         (WebCore::CanvasRenderingContext2D::drawTextInternal):
3151         * html/canvas/CanvasRenderingContext2D.h:
3152         * html/canvas/WebGL2RenderingContext.cpp:
3153         (WebCore::arrayBufferViewElementSize):
3154         * html/canvas/WebGLRenderingContextBase.cpp:
3155         (WebCore::WebGLRenderingContextBase::bufferData):
3156         (WebCore::WebGLRenderingContextBase::bufferSubData):
3157         (WebCore::WebGLRenderingContextBase::texSubImage2D):
3158         (WebCore::WebGLRenderingContextBase::validateArrayBufferType):
3159         (WebCore::WebGLRenderingContextBase::validateTexFuncData):
3160         (WebCore::WebGLRenderingContextBase::texImage2D):
3161         * html/canvas/WebGLRenderingContextBase.h:
3162         * html/parser/HTMLConstructionSite.cpp:
3163         (WebCore::HTMLConstructionSite::indexOfFirstUnopenFormattingElement):
3164         (WebCore::HTMLConstructionSite::reconstructTheActiveFormattingElements):
3165         * html/parser/HTMLConstructionSite.h:
3166         * html/parser/HTMLParserIdioms.cpp:
3167         (WebCore::parseHTMLIntegerInternal):
3168         (WebCore::parseHTMLInteger):
3169         (WebCore::parseHTMLNonNegativeInteger):
3170         (WebCore::parseValidHTMLNonNegativeIntegerInternal):
3171         (WebCore::parseValidHTMLNonNegativeInteger):
3172         (WebCore::parseValidHTMLFloatingPointNumberInternal):
3173         (WebCore::parseValidHTMLFloatingPointNumber):
3174         (WebCore::parseHTTPRefreshInternal):
3175         * html/parser/HTMLParserIdioms.h:
3176         (WebCore::limitToOnlyHTMLNonNegative):
3177         * html/parser/HTMLSrcsetParser.cpp:
3178         (WebCore::parseDescriptors):
3179         * html/shadow/SliderThumbElement.cpp:
3180         (WebCore::SliderThumbElement::setPositionFromPoint):
3181         (WebCore::SliderThumbElement::resolveCustomStyle):
3182         (WebCore::SliderContainerElement::resolveCustomStyle):
3183         * html/shadow/SliderThumbElement.h:
3184         * html/shadow/TextControlInnerElements.cpp:
3185         (WebCore::TextControlInnerElement::resolveCustomStyle):
3186         (WebCore::TextControlInnerTextElement::resolveCustomStyle):
3187         (WebCore::TextControlPlaceholderElement::resolveCustomStyle):
3188         * html/shadow/TextControlInnerElements.h:
3189         * html/track/TrackEvent.h:
3190         * inspector/InspectorIndexedDBAgent.cpp:
3191         * inspector/InspectorInstrumentation.cpp:
3192         (WebCore::InspectorInstrumentation::didFinishXHRLoadingImpl):
3193         * inspector/InspectorInstrumentation.h:
3194         (WebCore::InspectorInstrumentation::didFinishXHRLoading):
3195         * inspector/InspectorStyleSheet.cpp:
3196         (WebCore::InspectorStyleSheet::addRule):
3197         * inspector/InspectorTimelineAgent.cpp:
3198         (WebCore::InspectorTimelineAgent::setInstruments):
3199         * loader/DocumentLoader.cpp:
3200         (WebCore::DocumentLoader::startIconLoading):
3201         * loader/DocumentThreadableLoader.cpp:
3202         (WebCore::DocumentThreadableLoader::makeCrossOriginAccessRequestWithPreflight):
3203         (WebCore::DocumentThreadableLoader::clearResource):
3204         (WebCore::DocumentThreadableLoader::preflightSuccess):
3205         (WebCore::DocumentThreadableLoader::preflightFailure):
3206         * loader/DocumentThreadableLoader.h:
3207         * loader/EmptyClients.cpp:
3208         * loader/EmptyClients.h:
3209         * loader/FrameLoader.cpp:
3210         (WebCore::FrameLoader::urlSelected):
3211         (WebCore::FrameLoader::receivedFirstData):
3212         (WebCore::FrameLoader::commitProvisionalLoad):
3213         (WebCore::FrameLoader::open):
3214         (WebCore::FrameLoader::dispatchDidCommitLoad):
3215         (WebCore::FrameLoader::clearTestingOverrides):
3216         * loader/FrameLoader.h:
3217         * loader/FrameLoaderClient.h:
3218         * loader/LinkLoader.cpp:
3219         (WebCore::LinkLoader::resourceTypeFromAsAttribute):
3220         (WebCore::LinkLoader::loadLink):
3221         * loader/LinkLoader.h:
3222         * loader/SubresourceLoader.cpp:
3223         (WebCore::SubresourceLoader::SubresourceLoader):
3224         (WebCore::SubresourceLoader::didReceiveResponse):
3225         (WebCore::SubresourceLoader::notifyDone):
3226         * loader/SubresourceLoader.h:
3227         * loader/cache/CachedResource.cpp:
3228         (WebCore::CachedResource::setLoadPriority):
3229         * loader/cache/CachedResource.h:
3230         * loader/cache/CachedResourceRequest.cpp:
3231         (WebCore::CachedResourceRequest::CachedResourceRequest):
3232         * loader/cache/CachedResourceRequest.h:
3233         (WebCore::CachedResourceRequest::priority):
3234         * mathml/MathMLElement.h:
3235         (WebCore::MathMLElement::specifiedDisplayStyle):
3236         (WebCore::MathMLElement::specifiedMathVariant):
3237         * mathml/MathMLFractionElement.cpp:
3238         (WebCore::MathMLFractionElement::cachedFractionAlignment):
3239         (WebCore::MathMLFractionElement::parseAttribute):
3240         * mathml/MathMLFractionElement.h:
3241         * mathml/MathMLMathElement.cpp:
3242         (WebCore::MathMLMathElement::specifiedDisplayStyle):
3243         (WebCore::MathMLMathElement::parseAttribute):
3244         * mathml/MathMLMathElement.h:
3245         * mathml/MathMLMencloseElement.cpp:
3246         (WebCore::MathMLMencloseElement::parseAttribute):
3247         * mathml/MathMLMencloseElement.h:
3248         * mathml/MathMLOperatorDictionary.cpp:
3249         (WebCore::MathMLOperatorDictionary::search):
3250         * mathml/MathMLOperatorDictionary.h:
3251         * mathml/MathMLOperatorElement.cpp:
3252         (WebCore::MathMLOperatorElement::computeOperatorFlag):
3253         (WebCore::MathMLOperatorElement::childrenChanged):
3254         (WebCore::attributeNameToPropertyFlag):
3255         (WebCore::MathMLOperatorElement::parseAttribute):
3256         * mathml/MathMLOperatorElement.h:
3257         * mathml/MathMLPaddedElement.cpp:
3258         (WebCore::MathMLPaddedElement::parseAttribute):
3259         * mathml/MathMLPaddedElement.h:
3260         * mathml/MathMLPresentationElement.cpp:
3261         (WebCore::MathMLPresentationElement::cachedBooleanAttribute):
3262         (WebCore::MathMLPresentationElement::cachedMathMLLength):
3263         (WebCore::MathMLPresentationElement::specifiedDisplayStyle):
3264         (WebCore::MathMLPresentationElement::specifiedMathVariant):
3265         (WebCore::MathMLPresentationElement::parseAttribute):
3266         * mathml/MathMLPresentationElement.h:
3267         (WebCore::MathMLPresentationElement::toOptionalBool):
3268         * mathml/MathMLScriptsElement.cpp:
3269         (WebCore::MathMLScriptsElement::parseAttribute):
3270         * mathml/MathMLScriptsElement.h:
3271         * mathml/MathMLSpaceElement.cpp:
3272         (WebCore::MathMLSpaceElement::parseAttribute):
3273         * mathml/MathMLSpaceElement.h:
3274         * mathml/MathMLTokenElement.cpp:
3275         (WebCore::MathMLTokenElement::convertToSingleCodePoint):
3276         * mathml/MathMLTokenElement.h:
3277         * mathml/MathMLUnderOverElement.cpp:
3278         (WebCore::MathMLUnderOverElement::parseAttribute):
3279         * mathml/MathMLUnderOverElement.h:
3280         * page/ChromeClient.h:
3281         * page/DOMTimer.cpp:
3282         (WebCore::DOMTimer::alignedFireTime):
3283         * page/DOMTimer.h:
3284         * page/DOMWindow.cpp:
3285         (WebCore::DOMWindow::scrollBy):
3286         * page/DOMWindow.h:
3287         * page/EventSource.cpp:
3288         (WebCore::EventSource::parseEventStream):
3289         (WebCore::EventSource::parseEventStreamLine):
3290         * page/EventSource.h:
3291         * page/FrameView.cpp:
3292         (WebCore::FrameView::recalculateScrollbarOverlayStyle):
3293         (WebCore::FrameView::setLayoutViewportOverrideRect):
3294         (WebCore::FrameView::setViewExposedRect):
3295         * page/FrameView.h:
3296         * page/Page.cpp:
3297         (WebCore::Page::takeAnyMediaCanStartListener):
3298         * page/Page.h:
3299         (WebCore::Page::eventThrottlingBehaviorOverride):
3300         (WebCore::Page::setEventThrottlingBehaviorOverride):
3301         * page/ScrollToOptions.h:
3302         * page/SecurityOrigin.cpp:
3303         (WebCore::SecurityOrigin::SecurityOrigin):
3304         (WebCore::SecurityOrigin::create):
3305         * page/SecurityOrigin.h:
3306         (WebCore::SecurityOrigin::port):
3307         * page/SecurityOriginData.cpp:
3308         (WebCore::SecurityOriginData::debugString):
3309         (WebCore::SecurityOriginData::databaseIdentifier):
3310         (WebCore::SecurityOriginData::fromDatabaseIdentifier):
3311         * page/SecurityOriginData.h:
3312         (WebCore::SecurityOriginData::SecurityOriginData):
3313         (WebCore::SecurityOriginData::isEmpty):
3314         (WebCore::SecurityOriginDataHash::hash):
3315         * page/SecurityOriginHash.h:
3316         (WebCore::SecurityOriginHash::hash):
3317         * page/WindowFeatures.cpp:
3318         (WebCore::parseDialogFeatures):
3319         (WebCore::boolFeature):
3320         (WebCore::floatFeature):
3321         * page/WindowFeatures.h:
3322         * page/csp/ContentSecurityPolicySource.cpp:
3323         (WebCore::ContentSecurityPolicySource::ContentSecurityPolicySource):
3324         (WebCore::ContentSecurityPolicySource::portMatches):
3325         * page/csp/ContentSecurityPolicySource.h:
3326         * page/csp/ContentSecurityPolicySourceList.cpp:
3327         (WebCore::ContentSecurityPolicySourceList::parse):
3328         (WebCore::ContentSecurityPolicySourceList::parseSource):
3329         (WebCore::ContentSecurityPolicySourceList::parsePort):
3330         * page/csp/ContentSecurityPolicySourceList.h:
3331         * page/scrolling/AsyncScrollingCoordinator.cpp:
3332         (WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate):
3333         (WebCore::AsyncScrollingCoordinator::scheduleUpdateScrollPositionAfterAsyncScroll):
3334         (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):