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