Remove unnecessary unused variable stubs
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-10-24  Joseph Pecoraro  <pecoraro@apple.com>
2
3         Remove unnecessary unused variable stubs
4         https://bugs.webkit.org/show_bug.cgi?id=163688
5
6         Reviewed by Simon Fraser.
7
8         * Modules/applepay/cocoa/PaymentCocoa.mm:
9         (WebCore::toDictionary):
10         * Modules/applepay/cocoa/PaymentContactCocoa.mm:
11         (WebCore::toDictionary):
12
13 2016-10-24  Alex Christensen  <achristensen@webkit.org>
14
15         Try to fix Windows build after r207767
16         https://bugs.webkit.org/show_bug.cgi?id=163891
17
18         * DerivedSources.cpp:
19
20 2016-10-24  Zan Dobersek  <zdobersek@igalia.com>
21
22         [CodeGenerator] Only allow a single interface or standalone dictionary per WebIDL file
23         https://bugs.webkit.org/show_bug.cgi?id=163889
24
25         Reviewed by Chris Dumez.
26
27         Assert that there's only one interface or standalone dictionary
28         per WebIDL input file, and exit from the generator otherwise.
29
30         This avoids potential linking issues where multiple enumeration
31         and dictionary bindings code can be generated if the source
32         WebIDL for them is specified in a file that contains multiple
33         interfaces or standalone dictionaries.
34
35         Additionally, the generator now also exits if it fails to
36         generate code for any interface of standalone dictionary. This
37         should avoid processing WebIDL files that are empty in
38         substance.
39
40         TestException.idl and TestInterface.idl files have their second
41         interfaces removed. In place of those a new testing IDL file is
42         added, TestInterfaceLeadingUnderscore.idl. Like the two removed
43         interfaces, it tests that the leading underscode in the
44         identifier is removed by the generator.
45
46         * bindings/scripts/CodeGenerator.pm:
47         (ProcessDocument):
48         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp: Added.
49         (WebCore::JSTestInterfaceLeadingUnderscorePrototype::create):
50         (WebCore::JSTestInterfaceLeadingUnderscorePrototype::createStructure):
51         (WebCore::JSTestInterfaceLeadingUnderscorePrototype::JSTestInterfaceLeadingUnderscorePrototype):
52         (WebCore::JSTestInterfaceLeadingUnderscoreConstructor::prototypeForStructure):
53         (WebCore::JSTestInterfaceLeadingUnderscoreConstructor::initializeProperties):
54         (WebCore::JSTestInterfaceLeadingUnderscorePrototype::finishCreation):
55         (WebCore::JSTestInterfaceLeadingUnderscore::JSTestInterfaceLeadingUnderscore):
56         (WebCore::JSTestInterfaceLeadingUnderscore::createPrototype):
57         (WebCore::JSTestInterfaceLeadingUnderscore::prototype):
58         (WebCore::JSTestInterfaceLeadingUnderscore::destroy):
59         (WebCore::BindingCaller<JSTestInterfaceLeadingUnderscore>::castForAttribute):
60         (WebCore::jsTestInterfaceLeadingUnderscoreReadonly):
61         (WebCore::jsTestInterfaceLeadingUnderscoreReadonlyGetter):
62         (WebCore::jsTestInterfaceLeadingUnderscoreConstructor):
63         (WebCore::setJSTestInterfaceLeadingUnderscoreConstructor):
64         (WebCore::JSTestInterfaceLeadingUnderscore::getConstructor):
65         (WebCore::JSTestInterfaceLeadingUnderscoreOwner::isReachableFromOpaqueRoots):
66         (WebCore::JSTestInterfaceLeadingUnderscoreOwner::finalize):
67         (WebCore::toJSNewlyCreated):
68         (WebCore::toJS):
69         (WebCore::JSTestInterfaceLeadingUnderscore::toWrapped):
70         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.h: Renamed from Source/WebCore/bindings/scripts/test/JS/JSreadonly.h.
71         (WebCore::JSTestInterfaceLeadingUnderscore::create):
72         (WebCore::JSTestInterfaceLeadingUnderscore::createStructure):
73         (WebCore::JSTestInterfaceLeadingUnderscore::finishCreation):
74         (WebCore::wrapperOwner):
75         (WebCore::wrapperKey):
76         (WebCore::toJS):
77         (WebCore::toJSNewlyCreated):
78         * bindings/scripts/test/JS/JSattribute.cpp: Removed.
79         * bindings/scripts/test/JS/JSattribute.h: Removed.
80         * bindings/scripts/test/JS/JSreadonly.cpp: Removed.
81         * bindings/scripts/test/TestException.idl:
82         * bindings/scripts/test/TestInterface.idl:
83         * bindings/scripts/test/TestInterfaceLeadingUnderscore.idl: Copied from Source/WebCore/bindings/scripts/test/TestException.idl.
84
85 2016-10-21  Alex Christensen  <achristensen@webkit.org>
86
87         URL::port should return Optional<uint16_t>
88         https://bugs.webkit.org/show_bug.cgi?id=163806
89
90         Reviewed by Darin Adler.
91
92         A URL without a port is different than a URL with port 0.
93         This matches the spec, Chrome, and Firefox.
94
95         Covered by newly-passing web platform tests.
96
97         * Modules/indexeddb/IDBDatabaseIdentifier.h:
98         (WebCore::IDBDatabaseIdentifier::IDBDatabaseIdentifier):
99         (WebCore::IDBDatabaseIdentifier::isHashTableDeletedValue):
100         (WebCore::IDBDatabaseIdentifier::hash):
101         (WebCore::IDBDatabaseIdentifier::isValid):
102         (WebCore::IDBDatabaseIdentifier::isEmpty):
103         * Modules/websockets/WebSocket.cpp:
104         (WebCore::WebSocket::connect):
105         * Modules/websockets/WebSocketHandshake.cpp:
106         (WebCore::hostName):
107         * contentextensions/ContentExtensionsBackend.cpp:
108         (WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForLoad):
109         (WebCore::ContentExtensions::applyBlockedStatusToRequest):
110         * html/HTMLPlugInImageElement.cpp:
111         (WebCore::HTMLPlugInImageElement::userDidClickSnapshot):
112         (WebCore::HTMLPlugInImageElement::subframeLoaderWillCreatePlugIn):
113         * html/URLUtils.h:
114         (WebCore::URLUtils<T>::protocol):
115         (WebCore::URLUtils<T>::host):
116         (WebCore::URLUtils<T>::port):
117         * loader/CrossOriginAccessControl.cpp:
118         (WebCore::isValidCrossOriginRedirectionURL):
119         * loader/DocumentLoader.cpp:
120         (WebCore::DocumentLoader::responseReceived):
121         (WebCore::isRemoteWebArchive):
122         (WebCore::DocumentLoader::maybeLoadEmpty):
123         * loader/DocumentThreadableLoader.cpp:
124         (WebCore::DocumentThreadableLoader::makeSimpleCrossOriginAccessRequest):
125         * loader/ResourceLoader.cpp:
126         (WebCore::ResourceLoader::didReceiveResponse):
127         * loader/cache/CachedResource.cpp:
128         (WebCore::shouldCacheSchemeIndefinitely):
129         (WebCore::CachedResource::freshnessLifetime):
130         * page/Location.cpp:
131         (WebCore::Location::protocol):
132         (WebCore::Location::host):
133         (WebCore::Location::port):
134         * page/Page.cpp:
135         (WebCore::Page::userStyleSheetLocationChanged):
136         * page/SecurityOrigin.cpp:
137         (WebCore::shouldTreatAsUniqueOrigin):
138         (WebCore::SecurityOrigin::SecurityOrigin):
139         (WebCore::SecurityOrigin::isSecure):
140         (WebCore::SecurityOrigin::canDisplay):
141         (WebCore::SecurityOrigin::toRawString):
142         (WebCore::SecurityOrigin::create):
143         (WebCore::SecurityOrigin::databaseIdentifier):
144         * page/SecurityOrigin.h:
145         (WebCore::SecurityOrigin::port):
146         * page/SecurityOriginData.cpp:
147         (WebCore::SecurityOriginData::debugString):
148         * page/SecurityOriginData.h:
149         (): Deleted.
150         * page/SecurityOriginHash.h:
151         (WebCore::SecurityOriginHash::hash):
152         * page/csp/ContentSecurityPolicy.cpp:
153         (WebCore::ContentSecurityPolicy::allowObjectFromSource):
154         (WebCore::ContentSecurityPolicy::allowChildFrameFromSource):
155         (WebCore::ContentSecurityPolicy::allowResourceFromSource):
156         (WebCore::ContentSecurityPolicy::allowConnectToSource):
157         (WebCore::ContentSecurityPolicy::allowBaseURI):
158         (WebCore::stripURLForUseInReport):
159         (WebCore::ContentSecurityPolicy::upgradeInsecureRequestIfNeeded):
160         * page/csp/ContentSecurityPolicySource.cpp:
161         (WebCore::ContentSecurityPolicySource::ContentSecurityPolicySource):
162         (WebCore::ContentSecurityPolicySource::portMatches):
163         * page/csp/ContentSecurityPolicySource.h:
164         * page/csp/ContentSecurityPolicySourceList.cpp:
165         (WebCore::ContentSecurityPolicySourceList::parse):
166         (WebCore::ContentSecurityPolicySourceList::parseSource):
167         (WebCore::ContentSecurityPolicySourceList::parsePort):
168         * page/csp/ContentSecurityPolicySourceList.h:
169         * platform/SchemeRegistry.h:
170         * platform/URL.cpp:
171         (WebCore::URL::protocol):
172         (WebCore::URL::port):
173         (WebCore::URL::serialize):
174         (WebCore::portAllowed):
175         (WebCore::defaultPortsMap): Deleted.
176         (WebCore::defaultPortForProtocol): Deleted.
177         (WebCore::isDefaultPortForProtocol): Deleted.
178         * platform/URL.h:
179         (WebCore::URL::hasPort): Deleted.
180         * platform/URLParser.cpp:
181         (WebCore::defaultPortForProtocol):
182         (WebCore::isDefaultPortForProtocol):
183         (WebCore::URLParser::parsePort):
184         (WebCore::isDefaultPort): Deleted.
185         * platform/network/CredentialStorage.cpp:
186         (WebCore::originStringFromURL):
187         * platform/network/ResourceHandle.cpp:
188         (WebCore::ResourceHandle::create):
189         (WebCore::ResourceHandle::loadResourceSynchronously):
190         * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
191         (WebCore::SocketStreamHandleImpl::platformClose):
192         (WebCore::SocketStreamHandleImpl::port):
193         * workers/WorkerLocation.cpp:
194         (WebCore::WorkerLocation::protocol):
195         (WebCore::WorkerLocation::host):
196         (WebCore::WorkerLocation::port):
197
198 2016-10-24  Zan Dobersek  <zdobersek@igalia.com>
199
200         [CodeGeneratorJS] Support enums for standalone dictionaries
201         https://bugs.webkit.org/show_bug.cgi?id=163885
202
203         Reviewed by Youenn Fablet.
204
205         Add support for enumerations in WebIDL files that specify
206         standalone dictionaries. Implementation of this is pretty
207         straight-forward and mirrors interface and callback generators
208         by calling GenerateEnumerations{Header,Implementation}Content()
209         functions in GenerateDictionary{Header,Implementation}().
210
211         In GenerateEnumerationsImplementationContent(), the
212         NeverDestroyed.h header is added to the implementation includes
213         since that class is used to hold an array of possible enum
214         values.
215
216         A test enum is added to the TestStandaloneDictionary.idl file
217         and the baselines are updated to reflect the new capability.
218
219         * bindings/scripts/CodeGenerator.pm:
220         (ProcessDocument):
221         * bindings/scripts/CodeGeneratorJS.pm:
222         (GenerateDictionary):
223         (GenerateEnumerationsImplementationContent):
224         (GenerateDictionaryHeader):
225         (GenerateDictionaryImplementation):
226         * bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
227         (WebCore::convertEnumerationToJS):
228         (WebCore::parseEnumeration<TestStandaloneDictionary::EnumInStandaloneDictionaryFile>):
229         (WebCore::convertEnumeration<TestStandaloneDictionary::EnumInStandaloneDictionaryFile>):
230         (WebCore::expectedEnumerationValues<TestStandaloneDictionary::EnumInStandaloneDictionaryFile>):
231         (WebCore::convertDictionary<DictionaryImplName>):
232         * bindings/scripts/test/JS/JSTestStandaloneDictionary.h:
233         * bindings/scripts/test/TestStandaloneDictionary.idl:
234
235 2016-10-24  Dave Hyatt  <hyatt@apple.com>
236
237         Remove CSSCharsetRule from the CSS OM
238         https://bugs.webkit.org/show_bug.cgi?id=163891
239
240         Reviewed by Darin Adler.
241
242         Remove CSSCharsetRule from the CSS OM. All other browser engines have made this
243         change. This eliminates the weird overloading of isCharsetRule to match both
244         CSSCharsetRule and StyleRuleCharset (only used by the new parser).
245
246         Fix the destroy() method in StyleRuleBase to clean up StyleRuleCharsets created
247         by the new parser properly.
248
249         * CMakeLists.txt:
250         * DerivedSources.make:
251         * WebCore.xcodeproj/project.pbxproj:
252         * bindings/js/JSCSSRuleCustom.cpp:
253         (WebCore::toJSNewlyCreated):
254         * css/CSSCharsetRule.cpp: Removed.
255         * css/CSSCharsetRule.h: Removed.
256         * css/CSSCharsetRule.idl: Removed.
257         * css/CSSPropertySourceData.h:
258         * css/CSSStyleSheet.cpp:
259         (WebCore::CSSStyleSheet::item):
260         (WebCore::CSSStyleSheet::rules):
261         * css/CSSStyleSheet.h:
262         * css/StyleRule.cpp:
263         (WebCore::StyleRuleBase::destroy):
264         * inspector/InspectorStyleSheet.cpp:
265         (WebCore::asCSSRuleList):
266
267 2016-10-24  Zan Dobersek  <zdobersek@igalia.com>
268
269         [CodeGeneratorJS] Standalone dictionaries have misplaced build guards
270         https://bugs.webkit.org/show_bug.cgi?id=163881
271
272         Reviewed by Chris Dumez.
273
274         Build guards that are generated from the Conditional attribute
275         on WebIDL dictionary declarations properly guard the relevant
276         convertDictionary() functions for WebIDL files that also specify
277         interfaces. But for standalone dictionaries these build guards
278         should guard the complete header and implementation files, much
279         like this is done for files that originate from interfaces or
280         callbacks.
281
282         Before this patch, guarding a standalone dictionary resulted in
283         malformed output because GenerateHeaderContentHeader() and
284         GenerateImplementationContentHeader() functions both generated
285         the #if macro that would guard the whole file, but
286         GenerateDictionary{Header,Implementation}() didn't generate the
287         closing #endif.
288
289         CodeGeneratorJS.pm now passes the conditional string, if any,
290         to GenerateDictionary{Header,Implementation}Content() functions
291         in case of a non-standalone dictionary. Otherwise, the
292         conditional string, if any, is used to guard the complete
293         header and implementation files.
294
295         Generator tests are updated to cover various build guard
296         combinations on dictionaries in TestObj.idl, and the standalone
297         dictionary WebIDL file now has a Conditional attribute to check
298         that the build guards cover complete generated header and
299         implementation files.
300
301         * bindings/scripts/CodeGeneratorJS.pm:
302         (GenerateDictionaryHeaderContent):
303         (GenerateDictionariesHeaderContent):
304         (GenerateDictionaryImplementationContent):
305         (GenerateDictionariesImplementationContent):
306         (GenerateDictionaryHeader):
307         (GenerateDictionaryImplementation):
308         * bindings/scripts/test/JS/JSTestObj.cpp:
309         (WebCore::convertDictionary<TestObj::ConditionalDictionaryA>):
310         (WebCore::convertDictionary<TestObj::ConditionalDictionaryB>):
311         (WebCore::convertDictionary<TestObj::ConditionalDictionaryC>):
312         * bindings/scripts/test/JS/JSTestObj.h:
313         * bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
314         * bindings/scripts/test/JS/JSTestStandaloneDictionary.h:
315         * bindings/scripts/test/TestObj.idl:
316         * bindings/scripts/test/TestStandaloneDictionary.idl:
317
318 2016-10-24  Eric Carlson  <eric.carlson@apple.com>
319
320         [MediaStream] Separate media capture and audio playback muting
321         https://bugs.webkit.org/show_bug.cgi?id=163855
322         <rdar://problem/28827186>
323
324         Reviewed by Darin Adler.
325
326         Test: fast/mediastream/MediaStream-page-muted.html
327
328         Change page.muted from a bool to a bitfield so audio and media capture muted are independent.
329         Fix a couple of bugs in the mock media capture device uncovered by new test case.
330         
331         * Modules/mediastream/MediaStream.cpp:
332         (WebCore::MediaStream::pageMutedStateDidChange): page.isMuted -> page.mutedState.
333
334         * Modules/webaudio/AudioContext.cpp:
335         (WebCore::AudioContext::pageMutedStateDidChange): Ditto.
336
337         * html/HTMLMediaElement.cpp:
338         (WebCore::HTMLMediaElement::updateVolume): Ditto.
339         (WebCore::HTMLMediaElement::effectiveMuted): Ditto.
340
341         * page/MediaProducer.h: Add MutedState enum.
342
343         * page/Page.cpp:
344         (WebCore::Page::Page):
345         (WebCore::Page::setMuted): Take MutedStateFlags instead of bool. m_muted -> m_mutedState.
346         * page/Page.h:
347
348         * platform/mock/MockRealtimeMediaSource.cpp:
349         (WebCore::MockRealtimeMediaSource::startProducingData): Call setMuted.
350         (WebCore::MockRealtimeMediaSource::stopProducingData): Ditto.
351         * platform/mock/MockRealtimeMediaSource.h:
352
353         * platform/mock/MockRealtimeVideoSource.cpp:
354         (WebCore::MockRealtimeVideoSource::stopProducingData): Call correct base class method.
355
356         * testing/Internals.cpp:
357         (WebCore::Internals::setPageMuted): Change parameter from a bool to a string.
358         * testing/Internals.h:
359
360         * testing/Internals.idl:
361
362 2016-10-24  Darin Adler  <darin@apple.com>
363
364         Try to fix Windows build.
365
366         * bindings/js/JSWebGL2RenderingContextCustom.cpp: Rearranged includes
367         so they are inside the conditional as they should be.
368
369 2016-10-24  Youenn Fablet  <youenn@apple.com>
370
371         Activate WEB_RTC compilation flags for Mac bots
372         https://bugs.webkit.org/show_bug.cgi?id=163886
373
374         Reviewed by Eric Carlson.
375
376         Covered by existing tests.
377
378         Fixing compilation errors due to missing WEBCORE_EXPORT, missing method and missing override keywords.
379
380         * Configurations/FeatureDefines.xcconfig:
381         * DerivedSources.make:
382         * Modules/mediastream/MediaEndpointPeerConnection.h:
383         * Modules/mediastream/RTCPeerConnection.h:
384         * Modules/mediastream/RTCPeerConnection.idl:
385         * Modules/mediastream/SDPProcessor.cpp:
386         (WebCore::SDPProcessor::generate):
387         (WebCore::SDPProcessor::parse):
388         * WebCore.xcodeproj/project.pbxproj:
389         * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
390         (WebCore::MockRealtimeVideoSource::createMuted):
391
392 2016-10-24  Brady Eidson  <beidson@apple.com>
393
394         IndexedDB 2.0: Support IDBIndex name assignment.
395         <rdar://problem/28806932> and https://bugs.webkit.org/show_bug.cgi?id=163805
396
397         Reviewed by Alex Christensen.
398
399         Tests: storage/indexeddb/modern/index-rename-1-private.html
400                storage/indexeddb/modern/index-rename-1.html
401
402         Touches a *lot* of code sites, but none of them are particularly interesting.
403         They are all just getting the new name spread out to all of the various objects that need it.
404
405         * Modules/indexeddb/IDBDatabase.cpp:
406         (WebCore::IDBDatabase::renameIndex):
407         * Modules/indexeddb/IDBDatabase.h:
408
409         * Modules/indexeddb/IDBIndex.cpp:
410         (WebCore::IDBIndex::IDBIndex):
411         (WebCore::IDBIndex::setName):
412         (WebCore::IDBIndex::rollbackInfoForVersionChangeAbort):
413         * Modules/indexeddb/IDBIndex.h:
414         * Modules/indexeddb/IDBIndex.idl:
415
416         * Modules/indexeddb/IDBObjectStore.cpp:
417         (WebCore::IDBObjectStore::rollbackForVersionChangeAbort):
418         (WebCore::IDBObjectStore::renameReferencedIndex):
419         (WebCore::IDBObjectStore::rollbackInfoForVersionChangeAbort): Deleted.
420         * Modules/indexeddb/IDBObjectStore.h:
421
422         * Modules/indexeddb/IDBTransaction.cpp:
423         (WebCore::IDBTransaction::internalAbort):
424         (WebCore::IDBTransaction::renameIndex):
425         (WebCore::IDBTransaction::renameIndexOnServer):
426         (WebCore::IDBTransaction::didRenameIndexOnServer):
427         * Modules/indexeddb/IDBTransaction.h:
428
429         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
430         (WebCore::IDBClient::IDBConnectionProxy::renameIndex):
431         * Modules/indexeddb/client/IDBConnectionProxy.h:
432
433         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
434         (WebCore::IDBClient::IDBConnectionToServer::renameIndex):
435         (WebCore::IDBClient::IDBConnectionToServer::didRenameIndex):
436         * Modules/indexeddb/client/IDBConnectionToServer.h:
437         * Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
438
439         * Modules/indexeddb/client/TransactionOperation.h:
440         (WebCore::IDBClient::createTransactionOperation):
441
442         * Modules/indexeddb/server/IDBBackingStore.h:
443
444         * Modules/indexeddb/server/IDBConnectionToClient.cpp:
445         (WebCore::IDBServer::IDBConnectionToClient::didRenameIndex):
446         * Modules/indexeddb/server/IDBConnectionToClient.h:
447         * Modules/indexeddb/server/IDBConnectionToClientDelegate.h:
448
449         * Modules/indexeddb/server/IDBServer.cpp:
450         (WebCore::IDBServer::IDBServer::renameIndex):
451         * Modules/indexeddb/server/IDBServer.h:
452
453         * Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
454         (WebCore::IDBServer::MemoryBackingStoreTransaction::indexRenamed):
455         (WebCore::IDBServer::MemoryBackingStoreTransaction::abort):
456         * Modules/indexeddb/server/MemoryBackingStoreTransaction.h:
457
458         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
459         (WebCore::IDBServer::MemoryIDBBackingStore::renameIndex):
460         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
461
462         * Modules/indexeddb/server/MemoryIndex.h:
463         (WebCore::IDBServer::MemoryIndex::rename):
464
465         * Modules/indexeddb/server/MemoryObjectStore.cpp:
466         (WebCore::IDBServer::MemoryObjectStore::renameIndex):
467         * Modules/indexeddb/server/MemoryObjectStore.h:
468
469         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
470         (WebCore::IDBServer::SQLiteIDBBackingStore::renameIndex):
471         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
472
473         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
474         (WebCore::IDBServer::UniqueIDBDatabase::renameIndex):
475         (WebCore::IDBServer::UniqueIDBDatabase::performRenameIndex):
476         (WebCore::IDBServer::UniqueIDBDatabase::didPerformRenameIndex):
477         * Modules/indexeddb/server/UniqueIDBDatabase.h:
478
479         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
480         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didRenameIndex):
481         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.h:
482
483         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
484         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::renameIndex):
485         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
486
487         * Modules/indexeddb/shared/IDBIndexInfo.h:
488         (WebCore::IDBIndexInfo::rename):
489
490         * Modules/indexeddb/shared/IDBObjectStoreInfo.cpp:
491         (WebCore::IDBObjectStoreInfo::infoForExistingIndex):
492         * Modules/indexeddb/shared/IDBObjectStoreInfo.h:
493
494         * Modules/indexeddb/shared/IDBResultData.cpp:
495         (WebCore::IDBResultData::renameIndexSuccess):
496         * Modules/indexeddb/shared/IDBResultData.h:
497
498         * Modules/indexeddb/shared/InProcessIDBServer.cpp:
499         (WebCore::InProcessIDBServer::didRenameIndex):
500         (WebCore::InProcessIDBServer::renameIndex):
501         * Modules/indexeddb/shared/InProcessIDBServer.h:
502
503 2016-10-24  Dave Hyatt  <hyatt@apple.com>
504
505         [CSS Parser] Fix -webkit-box-reflect parsing
506         https://bugs.webkit.org/show_bug.cgi?id=163890
507
508         Reviewed by Zalan Bujtas.
509
510         * css/parser/CSSPropertyParser.cpp:
511         (WebCore::consumeReflect):
512         Do a WTFMove on the mask instead of a .releaseNonNull(), since mask can be a nullptr.
513         Exactly matches the old parser.
514
515         * css/parser/CSSPropertyParserHelpers.cpp:
516         (WebCore::CSSPropertyParserHelpers::CalcParser::consumeValue):
517         (WebCore::CSSPropertyParserHelpers::CalcParser::consumeNumber):
518         (WebCore::CSSPropertyParserHelpers::consumeInteger):
519         (WebCore::CSSPropertyParserHelpers::consumeNumber):
520         (WebCore::CSSPropertyParserHelpers::consumeLength):
521         (WebCore::CSSPropertyParserHelpers::consumePercent):
522         (WebCore::CSSPropertyParserHelpers::consumeAngle):
523         (WebCore::CSSPropertyParserHelpers::consumeTime):
524         (WebCore::CSSPropertyParserHelpers::consumeUrl):
525         (WebCore::CSSPropertyParserHelpers::consumeColor):
526         (WebCore::CSSPropertyParserHelpers::consumeDeprecatedGradientPoint):
527         (WebCore::CSSPropertyParserHelpers::consumeDeprecatedGradientColorStop):
528         (WebCore::CSSPropertyParserHelpers::consumeCrossFade):
529         (WebCore::CSSPropertyParserHelpers::consumeImageSet):
530         Clean up all instances of CSSPrimitiveValue::create to use the CSSValuePool.
531
532 2016-10-21  Antoine Quint  <graouts@apple.com>
533
534         [Modern Media Controls] Concatenate JS and CSS files into a single JS and CSS resources
535         https://bugs.webkit.org/show_bug.cgi?id=163785
536         <rdar://problem/28890058>
537
538         Reviewed by Darin Adler.
539
540         Concatenate CSS and JS resources for modern media controls into single JS and CSS files
541         during build and load these single resources alone at runtime.
542
543         * Modules/modern-media-controls/js-files: Added.
544         * WebCore.xcodeproj/project.pbxproj:
545         * rendering/RenderThemeMac.mm:
546         (WebCore::RenderThemeMac::mediaControlsStyleSheet):
547         (WebCore::RenderThemeMac::mediaControlsScript):
548
549 2016-10-24  Dave Hyatt  <hyatt@apple.com>
550
551         [CSS Parser] Unprefix -webkit-writing-mode
552         https://bugs.webkit.org/show_bug.cgi?id=163870
553
554         Reviewed by Zalan Bujtas.
555
556         * css/CSSComputedStyleDeclaration.cpp:
557         (WebCore::ComputedStyleExtractor::propertyValue):
558         Change -webkit-writing mode to writing-mode.
559
560         * css/CSSPrimitiveValueMappings.h:
561         (WebCore::CSSPrimitiveValue::operator WritingMode):
562         (WebCore::CSSPrimitiveValue::operator SVGWritingMode): Deleted.
563         Eliminate the SVGWritingMode converters. Add support for the unique SVG-specific
564         values to the WritingMode converters.
565
566         * css/CSSPropertyNames.in:
567         Alias -webkit-writing-mode to writing-mode. Move writing-mode up to be
568         high priority like -webkit-writing mode was. Alias -epub-writing-mode to writing-mode
569         instead of to -webkit-writing-mode.
570
571         * css/SVGCSSComputedStyleDeclaration.cpp:
572         (WebCore::ComputedStyleExtractor::svgPropertyValue):
573         Remove writing-mode from SVG computed style, since the base CSSComputedStyleDeclaration handles it.
574
575         * css/StyleBuilderCustom.h:
576         (WebCore::StyleBuilderCustom::applyValueWritingMode):
577         (WebCore::StyleBuilderCustom::applyValueWebkitWritingMode): Deleted.
578         Renamed applyValueWebkitWritingMode to applyValueWritingMode. Removed the SVG code, since
579         the underlying converter for WritingMode now handles those values.
580
581         * css/StyleResolver.cpp:
582         (WebCore::extractDirectionAndWritingMode):
583         Rename -webkit-writing-mode to writing-mode.
584
585         * css/parser/CSSParser.cpp:
586         (WebCore::isValidKeywordPropertyAndValue):
587         Eliminate -webkit-writing-mode and make sure writing-mode handles both the SVG values
588         and the normal values.
589
590         * css/parser/CSSParserFastPaths.cpp:
591         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
592         (WebCore::CSSParserFastPaths::isKeywordPropertyID):
593         Same deal here.
594
595         * html/track/TextTrackCueGeneric.cpp:
596         (WebCore::TextTrackCueGenericBoxElement::applyCSSProperties):
597         * html/track/VTTCue.cpp:
598         (WebCore::VTTCueBox::applyCSSProperties):
599         Cue stuff was setting -webkit-writing-mode, so make it set writing-mode instead now.
600
601         * rendering/RenderLineBreak.cpp:
602         (WebCore::RenderLineBreak::collectSelectionRects):
603         * rendering/RenderText.cpp:
604         (WebCore::RenderText::collectSelectionRects):
605         Switch the SVG-specific code here over to accessing the RenderStyle writing-mode and not
606         the SVG-specific one.
607
608         * rendering/style/RenderStyle.h:
609         (WebCore::RenderStyle::isVerticalWritingMode):
610         Add a helper function for asking if something is vertical writing mode.
611
612         * rendering/style/SVGRenderStyle.cpp:
613         * rendering/style/SVGRenderStyle.h:
614         * rendering/style/SVGRenderStyleDefs.h:
615         (WebCore::SVGRenderStyle::diff):
616         Remove the SVG writing mode code.
617
618         * rendering/svg/RenderSVGInlineText.cpp:
619         (WebCore::RenderSVGInlineText::computeNewScaledFontForStyle):
620         Make sure to force SVG font descriptions to be horizontal, since SVG controls
621         its own glyph orientation.
622
623         * rendering/svg/SVGRenderTreeAsText.cpp:
624         (WebCore::writeSVGInlineTextBox):
625         * rendering/svg/SVGTextChunk.cpp:
626         (WebCore::SVGTextChunk::SVGTextChunk):
627         * rendering/svg/SVGTextLayoutEngine.cpp:
628         (WebCore::SVGTextLayoutEngine::layoutInlineTextBox):
629         * rendering/svg/SVGTextQuery.cpp:
630         (WebCore::SVGTextQuery::executeQuery):
631         Changed to access the RenderStyle writing mode instead of the SVG-specific one.
632
633 2016-10-23  Antti Koivisto  <antti@apple.com>
634
635         Avoid unnecessary full style resolution in getComputedStyle for non-inherited properties
636         https://bugs.webkit.org/show_bug.cgi?id=163875
637
638         Reviewed by Andreas Kling.
639
640         Test: fast/css/getComputedStyle/getComputedStyle-style-resolution.html
641
642         * css/CSSComputedStyleDeclaration.cpp:
643         (WebCore::hasValidStyleForProperty):
644
645             For non-inherited properties we don't need to update style even if some ancestor style is invalid
646             as long as explicit 'inherit' is not being used.
647             We still need to update if we find out that the whole subtree we are in is invalid.
648
649         (WebCore::updateStyleIfNeededForProperty):
650
651             Pass the property.
652
653         (WebCore::ComputedStyleExtractor::customPropertyValue):
654         (WebCore::ComputedStyleExtractor::propertyValue):
655         (WebCore::CSSComputedStyleDeclaration::length):
656         (WebCore::elementOrItsAncestorNeedsStyleRecalc): Deleted.
657         (WebCore::updateStyleIfNeededForElement): Deleted.
658         * css/StyleResolver.cpp:
659         (WebCore::StyleResolver::colorFromPrimitiveValue):
660
661             Mark style as using explicit inheritance if 'currentcolor' value is used.
662
663 2016-10-24  Youenn Fablet  <youenn@apple.com>
664
665         ASSERTION FAILED: canvas()->securityOrigin()->toString() == cachedImage.origin()->toString()
666         https://bugs.webkit.org/show_bug.cgi?id=163242
667
668         Reviewed by Darin Adler.
669
670         Test: http/tests/security/cross-origin-cached-images-canvas.html
671
672         We were previously on Origin HTTP header to check whether requests were made from different origins.
673         This is fine for CORS enabled requests but not for GET no CORS requests since they will not have any Origin header.
674
675         Now that CachedResource and CachedResourceRequest own their origin, it is best to use these directly.
676
677         * loader/cache/CachedResourceLoader.cpp:
678         (WebCore::isRequestMatchingResourceOrigin):
679         (WebCore::CachedResourceLoader::shouldUpdateCachedResourceWithCurrentRequest):
680
681 2016-10-24  Youenn Fablet  <youenn@apple.com>
682
683         Remove CachedResource::passesSameOriginPolicyCheck
684         https://bugs.webkit.org/show_bug.cgi?id=163593
685
686         Reviewed by Andreas Kling.
687
688         No change of behavior.
689
690         Removing no-longer used code.
691
692         * loader/cache/CachedResource.cpp:
693         (WebCore::CachedResource::redirectReceived):
694         (WebCore::CachedResource::passesAccessControlCheck): Deleted.
695         (WebCore::CachedResource::passesSameOriginPolicyCheck): Deleted.
696         (WebCore::CachedResource::responseForSameOriginPolicyChecks): Deleted.
697         * loader/cache/CachedResource.h:
698         (WebCore::CachedResource::response):
699
700 2016-10-24  Youenn Fablet  <youenn@apple.com>
701
702         Redirections should be upgraded if CSP policy says so
703         https://bugs.webkit.org/show_bug.cgi?id=163544
704
705         Reviewed by Darin Adler.
706
707         Test: http/tests/security/contentSecurityPolicy/upgrade-insecure-requests/basic-upgrade-after-redirect.https.html
708
709         Introducing CachedResourceLoader::updateRequestAfterRedirection to do the checks that CachedResourceLoader is doing
710         to the initial request, but for redirection requests.
711
712         Implemented URL upgrade according CSP policy, as specified by fetch algorithm.
713         Minor refactoring in CachedResourceRequest to share some code.
714         Fixing some constness issues.
715
716         * loader/SubresourceLoader.cpp:
717         (WebCore::SubresourceLoader::willSendRequestInternal):
718         * loader/cache/CachedResourceLoader.cpp:
719         (WebCore::CachedResourceLoader::allowedByContentSecurityPolicy):
720         (WebCore::CachedResourceLoader::canRequestAfterRedirection):
721         (WebCore::CachedResourceLoader::updateRequestAfterRedirection):
722         * loader/cache/CachedResourceLoader.h:
723         * loader/cache/CachedResourceRequest.cpp:
724         (WebCore::upgradeInsecureResourceRequestIfNeeded):
725         (WebCore::CachedResourceRequest::upgradeInsecureRequestIfNeeded):
726         * loader/cache/CachedResourceRequest.h:
727
728 2016-10-22  Sam Weinig  <sam@webkit.org>
729
730         [WebIDL] Add IDLType based toJS conversion
731         https://bugs.webkit.org/show_bug.cgi?id=163861
732
733         Reviewed by Darin Adler.
734
735         Adds toJS<IDLType>() functions to be the new way of converting
736         from implementation types to JS types. These are implemented via
737         a similar mechanism to the convert<IDL>() functions, though specializations
738         of a JSConverter struct (rather than the Converter structs). This allows
739         us to support arbitrarily complex aggregate types easily (e.g. sequence<(Node or DOMString?)>).
740
741         * Modules/geolocation/Geoposition.idl:
742         * dom/Event.idl:
743         Add typedef for DOMTimeStamp. Eventually, our IDLParser should do this for us, but
744         for now it allows us to simplify the type system.
745
746         * bindings/js/JSDOMBinding.h:
747         (WebCore::JSValueTraits::arrayJSValue): Deleted.
748         (WebCore::JSValueTraits<String>::arrayJSValue): Deleted.
749         (WebCore::JSValueTraits<double>::arrayJSValue): Deleted.
750         (WebCore::JSValueTraits<float>::arrayJSValue): Deleted.
751         (WebCore::jsArray): Deleted.
752         (WebCore::jsFrozenArray): Deleted.
753         (WebCore::NativeValueTraits<String>::nativeValue): Deleted.
754         (WebCore::NativeValueTraits<unsigned>::nativeValue): Deleted.
755         (WebCore::NativeValueTraits<float>::nativeValue): Deleted.
756         (WebCore::NativeValueTraits<double>::nativeValue): Deleted.
757         (WebCore::toNullableJSNumber): Deleted.
758         (WebCore::toJSArray): Deleted.
759         (WebCore::toJSBoolean): Deleted.
760         (WebCore::toJSNumber): Deleted.
761         (WebCore::toJSString): Deleted.
762         Remove many now-unneeded conversion functions.
763
764         * bindings/js/JSDOMConvert.h:
765         (WebCore::toJS):
766         Add 5 primary toJS functions which take combinations of the following
767         arguments: ExecState, JSDOMGlobalObject, ThrowScope.  All take the value 
768         to be converted as well, except in the case of the throwScope ones, where
769         they take the value in an ExceptionOr<>.
770
771         To simplify the implementations of the JSConverter specializations, avoiding
772         the need for each one to implement their conversion up to 3 times (one for just
773         the value, one for the value and the ExecState, and one for the value, the ExecState
774         and the global object), each JSConverter instead specifies whether it's converter
775         needs an ExecState or global object via a static constexpr. We then use the 
776         JSConverterOverloader template, to call the correct function. This can probably be
777         improved in the future, by inferring the number of arguments needed via SFINAE, but
778         this seemed like a more straightforward first cut.
779
780         (WebCore::JSConverter<IDLNullable<T>>::convert):
781         (WebCore::JSConverter<IDLBoolean>::convert):
782         (WebCore::JSConverter<IDLInterface<T>>::convert):
783         (WebCore::JSConverter<IDLAny>::convert):
784         (WebCore::JSConverter<IDLByte>::convert):
785         (WebCore::JSConverter<IDLOctet>::convert):
786         (WebCore::JSConverter<IDLShort>::convert):
787         (WebCore::JSConverter<IDLUnsignedShort>::convert):
788         (WebCore::JSConverter<IDLLong>::convert):
789         (WebCore::JSConverter<IDLUnsignedLong>::convert):
790         (WebCore::JSConverter<IDLLongLong>::convert):
791         (WebCore::JSConverter<IDLUnsignedLongLong>::convert):
792         (WebCore::JSConverter<IDLFloat>::convert):
793         (WebCore::JSConverter<IDLUnrestrictedFloat>::convert):
794         (WebCore::JSConverter<IDLDouble>::convert):
795         (WebCore::JSConverter<IDLUnrestrictedDouble>::convert):
796         (WebCore::JSConverter<IDLDOMString>::convert):
797         (WebCore::JSConverter<IDLUSVString>::convert):
798         (WebCore::JSConverter<IDLSequence<T>>::convert):
799         (WebCore::JSConverter<IDLFrozenArray<T>>::convert):
800         (WebCore::JSConverter<IDLEnumeration<T>>::convert):
801         (WebCore::JSConverter<IDLUnion<T...>>::convert):
802         There is slightly more duplication than I would have liked, for instance we have a
803         specialization for each numeric type, even though they are all the same, but that is
804         something that can be improved going forward.
805
806         (WebCore::Converter<IDLUnion<T...>>::convert)
807         Fix the normal IDLUnion converter to work with boolean types. This was caught by the
808         test case I added via TypeConversions.idl.
809         
810         * bindings/js/JSDOMStringMapCustom.cpp:
811         (WebCore::JSDOMStringMap::getOwnPropertySlotDelegate):
812         * bindings/js/JSDOMWindowCustom.cpp:
813         (WebCore::JSDOMWindow::setTimeout):
814         (WebCore::JSDOMWindow::setInterval):
815         * bindings/js/JSDataTransferCustom.cpp:
816         (WebCore::JSDataTransfer::types):
817         * bindings/js/JSMediaStreamTrackCustom.cpp:
818         (WebCore::JSMediaStreamTrack::getCapabilities):
819         * bindings/js/JSMutationCallback.cpp:
820         (WebCore::JSMutationCallback::call):
821         * bindings/js/JSSVGLengthCustom.cpp:
822         (WebCore::JSSVGLength::value):
823         Switch to use new toJS<> functions.
824
825         * bindings/scripts/CodeGeneratorJS.pm:
826         (AddStringifierOperationIfNeeded):
827         Fix stringifier function signature to contain an idlType.
828
829         (GenerateEnumerationsHeaderContent):
830         Remove now unnecessary JSValueTraits specializations.
831
832         (JSValueToNativeIsHandledByDOMConvert):
833         Renamed from IsHandledByDOMConvert, since that name is now ambiguous.
834
835         (JSValueToNative):
836         Update for new name of IsHandledByDOMConvert.
837
838         (NativeToJSValueIsHandledByDOMConvert):
839         Predicate guarding what types currently work with the new conversion system.
840
841         (NativeToJSValueDOMConvertNeedsState):
842         Predicate for determining if the ExecState is needed in the conversion function.
843
844         (NativeToJSValueDOMConvertNeedsGlobalObject):
845         Predicate for determining if the global object is needed in the conversion function.
846
847         (NativeToJSValue):
848         Move things around a little bit and start converting use the new toJS<> when possible.
849
850         * bindings/scripts/IDLParser.pm:
851         (parseAttributeOrOperationRest):
852         Fix a missing place where were not setting the idlType.
853  
854         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
855         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
856         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
857         * bindings/scripts/test/JS/JSTestCallback.cpp:
858         * bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
859         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
860         * bindings/scripts/test/JS/JSTestException.cpp:
861         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
862         * bindings/scripts/test/JS/JSTestInterface.cpp:
863         * bindings/scripts/test/JS/JSTestNode.cpp:
864         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
865         * bindings/scripts/test/JS/JSTestObj.cpp:
866         * bindings/scripts/test/JS/JSTestObj.h:
867         * bindings/scripts/test/JS/JSTestSerialization.cpp:
868         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
869         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
870         * bindings/scripts/test/JS/JSattribute.cpp:
871         Update test results.
872
873         * testing/TypeConversions.h:
874         (WebCore::TypeConversions::testUnion):
875         (WebCore::TypeConversions::setTestUnion):
876         (WebCore::TypeConversions::typeConversionsDictionarySequenceValue):
877         (WebCore::TypeConversions::typeConversionsDictionaryUnionValue):
878         * testing/TypeConversions.idl:
879         Add a testUnion attribute, now that we can return unions to JS.
880
881 2016-10-23  Zalan Bujtas  <zalan@apple.com>
882
883         Unreviewed, rolling out r207727.
884
885         broke 15 selection test cases.
886
887         Reverted changeset:
888
889         "Do not update selection rect on dirty lineboxes."
890         https://bugs.webkit.org/show_bug.cgi?id=163862
891         http://trac.webkit.org/changeset/207727
892
893 2016-10-23  Chris Dumez  <cdumez@apple.com>
894
895         addEventListener() / removeEventListener() should use a union for last parameter
896         https://bugs.webkit.org/show_bug.cgi?id=163863
897
898         Reviewed by Darin Adler.
899
900         addEventListener() / removeEventListener() should use a union for last parameter:
901         - https://dom.spec.whatwg.org/#eventtarget
902
903         No new tests, no Web-exposed behavior change.
904
905         * bindings/js/JSDOMConvert.h:
906         * dom/EventTarget.cpp:
907         (WebCore::EventTarget::addEventListenerForBindings):
908         (WebCore::EventTarget::removeEventListenerForBindings):
909         * dom/EventTarget.h:
910         * dom/EventTarget.idl:
911
912 2016-10-23  Zalan Bujtas  <zalan@apple.com>
913
914         Do not update selection rect on dirty lineboxes.
915         https://bugs.webkit.org/show_bug.cgi?id=163862
916         <rdar://problem/28813156>
917
918         Reviewed by Simon Fraser.
919
920         In addition to checking whether the renderer needs layout, we also need to check if its preferred
921         width is clean and stop computing the selection rects, if needed (while adding a renderer to the tree,
922         there's a transition phase where the parent's preferred width dirty bit is already set, but it does
923         not yet need layout).
924
925         Tests: fast/css-generated-content/dynamic-first-letter-selection-clear-crash.html
926
927         * rendering/RenderObject.cpp:
928         (WebCore::RenderObject::canUpdateSelectionOnRootLineBoxes):
929
930 2016-10-22  Myles C. Maxfield  <mmaxfield@apple.com>
931
932         ASSERTION FAILED: m_fonts in &WebCore::FontCascade::primaryFont
933         https://bugs.webkit.org/show_bug.cgi?id=163459
934
935         Reviewed by Darin Adler.
936
937         The CSS Units and Values spec states that font-relative units, when used
938         in the font-size property, are resolved against the parent element. When
939         calc() is specified, we were trying to resolve them against the current
940         element, which is impossible because of the circular dependency. Instead,
941         we should resolve against the parent style the same way as when calc() 
942         isn't specified.
943
944         Test: fast/text/font-size-calc.html
945
946         * css/StyleBuilderCustom.h:
947         (WebCore::StyleBuilderCustom::applyValueFontSize):
948
949 2016-10-22  Chris Dumez  <cdumez@apple.com>
950
951         [Web IDL] Two types are distinguishable for overload resolution if at most one of the two includes a nullable type
952         https://bugs.webkit.org/show_bug.cgi?id=163791
953
954         Reviewed by Sam Weinig.
955
956         Update overload resolution in the bindings generator so that 2 nullable types
957         are no longer considered as distinguishable, as per Web IDL:
958         - https://heycam.github.io/webidl/#dfn-distinguishable
959
960         * bindings/scripts/CodeGeneratorJS.pm:
961         (AreTypesDistinguishableForOverloadResolution):
962         * bindings/scripts/test/JS/JSTestObj.cpp:
963         (WebCore::jsTestObjPrototypeFunctionOverloadWithNullableNonDistinguishingParameter1):
964         (WebCore::jsTestObjPrototypeFunctionOverloadWithNullableNonDistinguishingParameter1Caller):
965         (WebCore::jsTestObjPrototypeFunctionOverloadWithNullableNonDistinguishingParameter2):
966         (WebCore::jsTestObjPrototypeFunctionOverloadWithNullableNonDistinguishingParameter2Caller):
967         (WebCore::jsTestObjPrototypeFunctionOverloadWithNullableNonDistinguishingParameter):
968         * bindings/scripts/test/TestObj.idl:
969
970 2016-10-22  Chris Dumez  <cdumez@apple.com>
971
972         WebGLRenderingContextBase.texSubImage2D() should use a union instead of overloading
973         https://bugs.webkit.org/show_bug.cgi?id=163859
974
975         Reviewed by Darin Adler.
976
977         WebGLRenderingContextBase.texSubImage2D() should use a union instead of overloading:
978         - https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14
979
980         No new tests, no Web-exposed behavior change.
981
982         * html/canvas/WebGL2RenderingContext.cpp:
983         (WebCore::WebGL2RenderingContext::texSubImage2D):
984         * html/canvas/WebGL2RenderingContext.h:
985         * html/canvas/WebGLRenderingContext.cpp:
986         (WebCore::WebGLRenderingContext::texSubImage2D):
987         * html/canvas/WebGLRenderingContext.h:
988         * html/canvas/WebGLRenderingContextBase.h:
989         * html/canvas/WebGLRenderingContextBase.idl:
990
991 2016-10-22  Dan Bernstein  <mitz@apple.com>
992
993         Dynamically-added backdrop filter to clip-path'd element with 3D transform renders incorrectly (without clip)
994         https://bugs.webkit.org/show_bug.cgi?id=163497
995
996         Reviewed by Simon Fraser.
997
998         Test: css3/filters/backdrop/dynamic-with-clip-path.html
999
1000         * platform/graphics/ca/GraphicsLayerCA.cpp:
1001         (WebCore::GraphicsLayerCA::ensureStructuralLayer): Added MaskLayerChanged to
1002           structuralLayerChangeFlags to ensure that the mask layer is updated.
1003
1004 2016-10-22  Simon Fraser  <simon.fraser@apple.com>
1005
1006         Backdrop filter doesn't show if removed then re-added
1007         https://bugs.webkit.org/show_bug.cgi?id=163860
1008
1009         Reviewed by Dan Bernstein.
1010
1011         When a backdrop filter is removed the re-added, updateBackdropFiltersRect() never
1012         runs the second time because m_backdropFiltersRect doesn't change. However, we need
1013         to run that code to size and position the newly re-created backdrop layer, so run
1014         it explicitly if we just created the backdrop layer. This is similar to how
1015         updateContentsImage() calls updateContentsRects().
1016
1017         Test: css3/filters/backdrop/add-remove-add-backdrop-filter.html
1018
1019         * platform/graphics/ca/GraphicsLayerCA.cpp:
1020         (WebCore::GraphicsLayerCA::setBackdropFilters):
1021         (WebCore::GraphicsLayerCA::updateBackdropFilters):
1022
1023 2016-10-22  Simon Fraser  <simon.fraser@apple.com>
1024
1025         Fix repainting of slow repaint objects in WK1 when page scale is applied
1026         https://bugs.webkit.org/show_bug.cgi?id=163854
1027
1028         Reviewed by Zalan Bujtas.
1029         
1030         RenderObject::repaintSlowRepaintObject() always set the repaint container to the RenderView
1031         if it was null. This is before the call to clippedOverflowRectForRepaint(). If that function
1032         is called with a null repaintContainer, it maps the rect up through the RenderView's transform
1033         (which represents page scale), which is what we want here. Passing the RenderView itself
1034         stops the transform from being applied, which led to the bug.
1035         
1036         WebKit2 doesn't suffer from this bug because containerForRepaint() always returns the
1037         composited RenderView.
1038
1039         Test: fast/repaint/zoomed-fixed-background.html
1040
1041         * rendering/RenderObject.cpp:
1042         (WebCore::RenderObject::repaintSlowRepaintObject):
1043
1044 2016-10-22  Darin Adler  <darin@apple.com>
1045
1046         Move HTML canvas and tracks from ExceptionCode to Exception
1047         https://bugs.webkit.org/show_bug.cgi?id=163853
1048
1049         Reviewed by Chris Dumez.
1050
1051         * WebCore.xcodeproj/project.pbxproj: Added CanvasPath.idl.
1052
1053         * bindings/js/JSWebGL2RenderingContextCustom.cpp: Tweaked a bit.
1054
1055         * bindings/js/JSWebGLRenderingContextBaseCustom.cpp:
1056         (WebCore::JSWebGLRenderingContextBase::getExtension): Tweaked a bit.
1057         (WebCore::JSWebGLRenderingContextBase::getFramebufferAttachmentParameter):
1058         Removed unneeded exception handling.
1059         (WebCore::JSWebGLRenderingContextBase::getParameter): Ditto.
1060         (WebCore::JSWebGLRenderingContextBase::getProgramParameter): Ditto.
1061         (WebCore::JSWebGLRenderingContextBase::getShaderParameter): Ditto.
1062         (WebCore::JSWebGLRenderingContextBase::getSupportedExtensions): Use a
1063         modern for loop.
1064         (WebCore::JSWebGLRenderingContextBase::getUniform): Removed unneeded
1065         exception handling.
1066
1067         * html/HTMLCanvasElement.cpp:
1068         (WebCore::HTMLCanvasElement::getContext): Pass a reference.
1069         (WebCore::HTMLCanvasElement::reset): Use is<CanvasRenderingContext2D>.
1070         (WebCore::HTMLCanvasElement::setUsesDisplayListDrawing): Ditto.
1071         (WebCore::HTMLCanvasElement::setTracksDisplayListReplay) Ditto.:
1072         (WebCore::HTMLCanvasElement::displayListAsText): Ditto.
1073         (WebCore::HTMLCanvasElement::replayDisplayListAsText): Ditto.
1074         (WebCore::HTMLCanvasElement::clearImageBuffer): Ditto.
1075
1076         * html/canvas/CanvasGradient.cpp:
1077         (WebCore::CanvasGradient::CanvasGradient): Streamlined.
1078         (WebCore::CanvasGradient::addColorStop): Use ExceptionOr.
1079         * html/canvas/CanvasGradient.h: Updated for above changes.
1080         * html/canvas/CanvasGradient.idl: Use non-legacy exception.
1081
1082         * html/canvas/CanvasPath.cpp:
1083         (WebCore::CanvasPath::arcTo): Use ExceptionOr.
1084         (WebCore::CanvasPath::arc): Ditto.
1085         (WebCore::CanvasPath::ellipse): Ditto.
1086         * html/canvas/CanvasPath.h: Updated for above changes.
1087         * html/canvas/CanvasPath.idl: Use non-legacy exceptions.
1088
1089         * html/canvas/CanvasPattern.cpp:
1090         (WebCore::CanvasPattern::create): Use Ref&&.
1091         (WebCore::CanvasPattern::CanvasPattern): Ditto.
1092         (WebCore::CanvasPattern::parseRepetitionType): Return a boolean
1093         instead of using an ExceptionCode.
1094         * html/canvas/CanvasPattern.h: Updated for above changes.
1095
1096         * html/canvas/CanvasRenderingContext.cpp:
1097         (CanvasRenderingContext::wouldTaintOrigin): Reordered function so
1098         that it's safe to call it on an image element without a cached
1099         image, or a cached image without an underlying image.
1100
1101         * html/canvas/CanvasRenderingContext2D.cpp:
1102         (WebCore::CanvasRenderingContext2D::CanvasRenderingContext2D):
1103         Take a reference.
1104         (WebCore::CanvasRenderingContext2D::drawImage): Use ExceptionOr.
1105         (WebCore::CanvasRenderingContext2D::drawImageFromRect): Ditto.
1106         (WebCore::CanvasRenderingContext2D::createLinearGradient): Ditto.
1107         (WebCore::CanvasRenderingContext2D::createRadialGradient): Ditto.
1108         (WebCore::CanvasRenderingContext2D::createPattern): Ditto.
1109         (WebCore::CanvasRenderingContext2D::createImageData): Ditto.
1110         (WebCore::CanvasRenderingContext2D::getImageData): Ditto.
1111         (WebCore::CanvasRenderingContext2D::webkitGetImageDataHD): Ditto.
1112         (WebCore::CanvasRenderingContext2D::putImageData): Removed unneeded
1113         ExceptionCode because this does not throw exceptions; the only one
1114         was for non-finite numeric values but this is now handled by bindings.
1115         (WebCore::CanvasRenderingContext2D::webkitPutImageDataHD): Ditto.
1116         * html/canvas/CanvasRenderingContext2D.h: Updated for above.
1117         * html/canvas/CanvasRenderingContext2D.idl: Use non-legacy exceptions
1118         and removed exceptions entirely in other cases.
1119
1120         * html/canvas/OESVertexArrayObject.cpp:
1121         (WebCore::OESVertexArrayObject::OESVertexArrayObject): Take a reference.
1122         (WebCore::OESVertexArrayObject::~OESVertexArrayObject): Deleted.
1123         (WebCore::OESVertexArrayObject::isVertexArrayOES): Use && instead of
1124         multiple return statements.
1125         (WebCore::OESVertexArrayObject::bindVertexArrayOES): Removed unneeded
1126         ExceptionCode since this does not throw an exception.
1127         * html/canvas/OESVertexArrayObject.h: Updated for above.
1128         * html/canvas/OESVertexArrayObject.idl: Removed unneeded exception.
1129
1130         * html/canvas/WebGL2RenderingContext.cpp:
1131         (WebCore::WebGL2RenderingContext::getFramebufferAttachmentParameter):
1132         Removed unneeded ExceptionCode since this does not throw an exception.
1133         (WebCore::WebGL2RenderingContext::texSubImage2DBase): Ditto.
1134         (WebCore::WebGL2RenderingContext::texSubImage2DImpl): Ditto.
1135         (WebCore::WebGL2RenderingContext::texSubImage2D): Removed unneeded
1136         ExceptionCode for some overloads, for the others, use ExceptionOr
1137         for the security exception. Moved security exception code here from
1138         the validate functions.
1139         (WebCore::WebGL2RenderingContext::validateTexFuncParameters): Removed
1140         unneeded ExceptionCode.
1141         (WebCore::WebGL2RenderingContext::getParameter): Ditto.
1142         * html/canvas/WebGL2RenderingContext.h: Updated for above.
1143
1144         * html/canvas/WebGLRenderingContext.cpp:
1145         (WebCore::WebGLRenderingContext::getExtension): Pass a reference.
1146         (WebCore::WebGLRenderingContext::getFramebufferAttachmentParameter):
1147         Remvoed unneeded ExceptionCode since this does not throw an exception.
1148         (WebCore::WebGLRenderingContext::texSubImage2DBase): Ditto.
1149         (WebCore::WebGLRenderingContext::texSubImage2DImpl): Ditto.
1150         (WebCore::WebGLRenderingContext::texSubImage2D): Removed unneeded
1151         ExceptionCode for some overloads, for the others, use ExceptionOr
1152         for the security exception. Moved security exception code here from
1153         the validate functions.
1154         (WebCore::WebGLRenderingContext::getParameter): Removed unneeded
1155         ExceptionCode.
1156         * html/canvas/WebGLRenderingContext.h: Updated for above changes.
1157
1158         * html/canvas/WebGLRenderingContextBase.cpp:
1159         (WebCore::WebGLRenderingContextBase::texImage2DBase):
1160         Remvoed unneeded ExceptionCode since this does not throw an exception.
1161         (WebCore::WebGLRenderingContextBase::texImage2DImpl): Ditto.
1162         (WebCore::WebGLRenderingContextBase::texImage2D): Removed unneeded
1163         ExceptionCode for some overloads, for the others, use ExceptionOr
1164         for the security exception. Moved security exception code here from
1165         the validate functions.
1166         (WebCore::WebGLRenderingContextBase::validateHTMLImageElement):
1167         Moved the security exception out of here to the call sites.
1168         (WebCore::WebGLRenderingContextBase::validateHTMLCanvasElement): Ditto.
1169         (WebCore::WebGLRenderingContextBase::validateHTMLVideoElement): Ditto.
1170         * html/canvas/WebGLRenderingContextBase.h: Updated for above changes.
1171         * html/canvas/WebGLRenderingContextBase.idl: Use non-legacy exceptions
1172         in some cases and no exceptions at all in many others.
1173
1174         * html/shadow/MediaControlElements.cpp:
1175         (WebCore::MediaControlTextTrackContainerElement::updateDisplay):
1176         Use a reference instead of a pointer.
1177
1178         * html/track/DataCue.h: Use pragma once.
1179         * html/track/DataCue.idl: Use non-legacy exception for constructor
1180         attribute, even though it is custom and so it has no effect.
1181
1182         * html/track/InbandDataTextTrack.cpp:
1183         (WebCore::InbandDataTextTrack::create): Use RefPtr&&.
1184         (WebCore::InbandDataTextTrack::InbandDataTextTrack): Ditto.
1185         (WebCore::InbandDataTextTrack::addDataCue): Stop using
1186         ASSERT_NO_EXCEPTION.
1187         (WebCore::InbandDataTextTrack::removeDataCue): Stop using
1188         IGNORE_EXCEPTION.
1189         (WebCore::InbandDataTextTrack::removeCue): Use ExceptionOr.
1190         Also use remove instead of find/remove.
1191         * html/track/InbandDataTextTrack.h: Updated for above changes.
1192
1193         * html/track/InbandGenericTextTrack.cpp:
1194         (WebCore::GenericTextTrackCueMap::GenericTextTrackCueMap): Deleted.
1195         (WebCore::GenericTextTrackCueMap::~GenericTextTrackCueMap): Deleted.
1196         (WebCore::GenericTextTrackCueMap::add): Take references intead of
1197         pointers.
1198         (WebCore::GenericTextTrackCueMap::find): Ditto. Also use get
1199         instead of find.
1200         (WebCore::GenericTextTrackCueMap::remove): Ditto. Also use take
1201         instead of double hashing to both find and remove.
1202         (WebCore::InbandGenericTextTrack::updateCueFromCueData): Stop using
1203         IGNORE_EXCEPTION. Also got rid of code that is converting a double
1204         to a long and then back to a double by using lround. Instead just
1205         use std::round, which keeps it a double. But also, why does this need
1206         to round?!
1207         (WebCore::InbandGenericTextTrack::addGenericCue): Updated to use
1208         reference to work with m_cueMap.
1209         (WebCore::InbandGenericTextTrack::updateGenericCue): Ditto.
1210         (WebCore::InbandGenericTextTrack::removeGenericCue): Ditto.
1211         (WebCore::InbandGenericTextTrack::removeCue): Use ExceptionOr.
1212         (WebCore::InbandGenericTextTrack::newCuesParsed): Removed
1213         ASSERT_NO_EXCEPTION.
1214         * html/track/InbandGenericTextTrack.h: Updated for above changes.
1215
1216         * html/track/InbandWebVTTTextTrack.cpp:
1217         (WebCore::InbandWebVTTTextTrack::newCuesParsed): Removed
1218         ASSERT_NO_EXCEPTION.
1219
1220         * html/track/TextTrack.cpp:
1221         (WebCore::TextTrack::addCue): Use ExcepctionOr.
1222         (WebCore::TextTrack::removeCue): Ditto.
1223         (WebCore::TextTrack::addRegion): Ditto.
1224         (WebCore::TextTrack::removeRegion): Ditto.
1225         * html/track/TextTrack.h: Updated for above changes.
1226         * html/track/TextTrack.idl: Ditto.
1227
1228         * html/track/TextTrackCue.cpp:
1229         (WebCore::TextTrackCue::cueShadowPseudoId): Moved this here
1230         since it does not need to be inlined in the header.
1231         (WebCore::TextTrackCue::~TextTrackCue): Deleted.
1232         (WebCore::TextTrackCue::setStartTime): Removed ExceptionCode&
1233         since the exceptions were for non-finite values, but this is
1234         now handled by the bindings.
1235         (WebCore::TextTrackCue::setEndTime): Ditto.
1236         * html/track/TextTrackCue.h: Updated for the above.
1237         * html/track/TextTrackCue.idl: Removed SetterMayThrowLegacyException
1238         and made startTime and endTime be double rather than unrestricted double.
1239
1240         * html/track/TextTrackCueGeneric.cpp:
1241         (WebCore::TextTrackCueGenericBoxElement::applyCSSProperties):
1242         Use a reference instead of a pointer.
1243         (WebCore::TextTrackCueGeneric::TextTrackCueGeneric): Initialize
1244         m_defaultPosition in the class definition instead of here.
1245         (WebCore::TextTrackCueGeneric::createDisplayTree): Return a Ref.
1246         (WebCore::TextTrackCueGeneric::setLine): Use ExceptionOr.
1247         (WebCore::TextTrackCueGeneric::setPosition): Ditto.
1248         (WebCore::TextTrackCueGeneric::setFontSize): Updated since
1249         displayTreeInternal() now returns a reference.
1250         * html/track/TextTrackCueGeneric.h: Updated for above changes.
1251         Also fixed some arguument types and made some more things private.
1252
1253         * html/track/VTTCue.cpp:
1254         (WebCore::VTTCue::createDisplayTree): Return a Ref.
1255         (WebCore::VTTCue::displayTreeInternal): Return a reference.
1256         (WebCore::VTTCue::setVertical): Use ExceptionOr.
1257         (WebCore::VTTCue::setLine): Ditto.
1258         (WebCore::VTTCue::setPosition): Ditto.
1259         (WebCore::VTTCue::setSize): Ditto.
1260         (WebCore::VTTCue::setAlign): Ditto.
1261         (WebCore::VTTCue::getDisplayTree): Return a reference.
1262         (WebCore::VTTCue::removeDisplayTree): Updated since
1263         displayTreeInternal returns a reference.
1264         (WebCore::VTTCue::setFontSize): Ditto.
1265         * html/track/VTTCue.h: Updated for the above.
1266         * html/track/VTTCue.idl: Use non-legacy exceptions and also
1267         restricted doubles.
1268
1269         * html/track/VTTRegion.cpp:
1270         (WebCore::VTTRegion::VTTRegion): Moved default values all into
1271         the class definition.
1272         (WebCore::VTTRegion::setWidth): Removed the check for non-finite
1273         since the bindings now handle that. Use ExcpetionOr.
1274         (WebCore::VTTRegion::setHeight): Ditto.
1275         (WebCore::VTTRegion::setRegionAnchorX): Ditto.
1276         (WebCore::VTTRegion::setRegionAnchorY): Ditto.
1277         (WebCore::VTTRegion::setViewportAnchorX): Ditto.
1278         (WebCore::VTTRegion::setViewportAnchorY): Ditto.
1279         (WebCore::upKeyword): Added. Shared by the code below.
1280         (WebCore::VTTRegion::scroll): Rewrote to be simpler.
1281         (WebCore::VTTRegion::setScroll): Rewrote to be simpler.
1282         (WebCore::VTTRegion::updateParametersFromRegion): Read and
1283         write data members directly to avoid awkward code that is otherwise
1284         required just to copy from one object to the other. Also take a
1285         const& instead of a pointer for the thing to update from.
1286         (WebCore::VTTRegion::parseSettingValue): Use upKeyword.
1287         (WebCore::VTTRegion::appendTextTrackCueBox): Take a Ref&&.
1288         (WebCore::VTTRegion::getDisplayTree): Do the downcast to Document
1289         here instead of using the helper function.
1290         (WebCore::VTTRegion::prepareRegionDisplayTree): Ditto.
1291         * html/track/VTTRegion.h: Updated for the above.
1292         * html/track/VTTRegion.idl: Use non-legacy exceptions and also
1293         use restricted dobules, not unrestricted.
1294
1295 2016-10-22  Chris Dumez  <cdumez@apple.com>
1296
1297         WebGLRenderingContextBase.texImage2D() should use a union instead of overloading
1298         https://bugs.webkit.org/show_bug.cgi?id=163856
1299
1300         Reviewed by Darin Adler.
1301
1302         WebGLRenderingContextBase.texImage2D() should use a union instead of overloading:
1303         - https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14
1304
1305         * html/canvas/WebGLRenderingContextBase.cpp:
1306         (WebCore::WebGLRenderingContextBase::texImage2D):
1307         * html/canvas/WebGLRenderingContextBase.h:
1308         * html/canvas/WebGLRenderingContextBase.idl:
1309
1310 2016-10-22  Antti Koivisto  <antti@apple.com>
1311
1312         REGRESSION(r207669): Dromaeo/jslib-style-jquery.html regressed >20%
1313         https://bugs.webkit.org/show_bug.cgi?id=163851
1314
1315         Reviewed by Darin Adler.
1316
1317         The test calls Scope::flushPendingUpdate a lot and nothing ever happens there.
1318
1319         Add a separate invalidity bit for descendant scopes and inline the fast path.
1320
1321         * style/StyleScope.cpp:
1322         (WebCore::Style::Scope::flushPendingSelfUpdate):
1323         (WebCore::Style::Scope::flushPendingDescendantUpdates):
1324         (WebCore::Style::Scope::scheduleUpdate):
1325         (WebCore::Style::Scope::flushPendingUpdate): Deleted.
1326         * style/StyleScope.h:
1327         (WebCore::Style::Scope::hasPendingUpdate):
1328         (WebCore::Style::Scope::flushPendingUpdate):
1329
1330 2016-10-22  Darin Adler  <darin@apple.com>
1331
1332         Move SVG from ExceptionCode to Exception
1333         https://bugs.webkit.org/show_bug.cgi?id=163837
1334
1335         Reviewed by Chris Dumez.
1336
1337         * WebCore.xcodeproj/project.pbxproj: Added SVGGraphicsElement.idl.
1338
1339         * bindings/js/JSSVGLengthCustom.cpp:
1340         (WebCore::JSSVGLength::value): Use toJSNumber.
1341         (WebCore::JSSVGLength::setValue): Use propagateException.
1342         (WebCore::JSSVGLength::convertToSpecifiedUnits): Ditto.
1343
1344         * bindings/scripts/CodeGeneratorJS.pm:
1345         (GenerateImplementation): Properly handle SetterMayThrowException
1346         in the special case for SVG setters.
1347
1348         * rendering/style/SVGRenderStyle.h:
1349         (WebCore::SVGRenderStyle::initialBaselineShiftValue): Removed
1350         ASSERT_NO_EXCEPTION, no longer needed.
1351         (WebCore::SVGRenderStyle::initialKerning): Ditto.
1352
1353         * svg/SVGAltGlyphElement.cpp:
1354         (WebCore::SVGAltGlyphElement::setGlyphRef): Use ExceptionOr.
1355         (WebCore::SVGAltGlyphElement::setFormat): Ditto.
1356         (WebCore::SVGAltGlyphElement::hasValidGlyphElements): Tweaked a bit.
1357         * svg/SVGAltGlyphElement.h: Updated for above changes.
1358         * svg/SVGAltGlyphElement.idl: Use non-legacy exceptions.
1359
1360         * svg/SVGAngle.cpp:
1361         (WebCore::SVGAngle::valueAsString): Removed unneeded String globals.
1362         (WebCore::parseAngleType): Rewrote to be simpler and more direct.
1363         (WebCore::SVGAngle::setValueAsString): Use ExceptionOr.
1364         (WebCore::SVGAngle::newValueSpecifiedUnits): Ditto.
1365         (WebCore::SVGAngle::convertToSpecifiedUnits): Ditto.
1366         * svg/SVGAngle.h: Updated for above changes. Initialized data members
1367         here in the class definite and removed constructor; default now works.
1368         * svg/SVGAngle.idl: Use non-legacy exceptions.
1369
1370         * svg/SVGAnimateElementBase.cpp:
1371         (WebCore::SVGAnimateElementBase::calculateAnimatedValue): Update since
1372         CalcMode is now an enum class.
1373         * svg/SVGAnimateMotionElement.cpp:
1374         (WebCore::SVGAnimateMotionElement::SVGAnimateMotionElement): Ditto.
1375
1376         * svg/SVGAnimateTransformElement.cpp:
1377         (WebCore::SVGAnimateTransformElement::hasValidAttributeType): Update
1378         since AttributeType is now an enum class.
1379
1380         * svg/SVGAnimatedAngle.cpp:
1381         (WebCore::SVGAnimatedAngleAnimator::calculateDistance): Removed
1382         ASSERT_NO_EXCEPTION, no longer needed.
1383
1384         * svg/SVGAnimatedBoolean.idl: Use non-legacy exception.
1385         * svg/SVGAnimatedEnumeration.idl: Ditto.
1386         * svg/SVGAnimatedInteger.idl: Ditto.
1387
1388         * svg/SVGAnimatedLength.cpp:
1389         (WebCore::sharedSVGLength): Deleted.
1390         (WebCore::SVGAnimatedLengthAnimator::addAnimatedTypes): Removed
1391         ASSERT_NO_EXCEPTION, no longer needed.
1392         (WebCore::parseLengthFromString): Ditto. Also rewrote to not use
1393         a shared SVGLength; no benefit to doing that.
1394         (WebCore::SVGAnimatedLengthAnimator::calculateAnimatedValue): Ditto.
1395         * svg/SVGAnimatedLengthList.cpp:
1396         (WebCore::SVGAnimatedLengthListAnimator::addAnimatedTypes): Ditto.
1397         (WebCore::SVGAnimatedLengthListAnimator::calculateAnimatedValue): Ditto.
1398
1399         * svg/SVGAnimatedNumber.idl: Use non-legacy exception.
1400         * svg/SVGAnimatedString.idl: Ditto.
1401
1402         * svg/SVGAnimatedType.cpp:
1403         (WebCore::SVGAnimatedType::setValueAsString): Updated since
1404         setValueAsString now uses ExceptionOr.
1405
1406         * svg/SVGAnimationElement.cpp:
1407         (WebCore::SVGAnimationElement::SVGAnimationElement): Initialized scalars
1408         in the class definition instead of here.
1409         (WebCore::SVGAnimationElement::getSimpleDuration): Removed uneeded ExceptionCode&.
1410         (WebCore::SVGAnimationElement::setCalcMode): Updated since CalcMode is now an enum class.
1411         (WebCore::SVGAnimationElement::setAttributeType): Updated since AttributeType
1412         is now an enum class.
1413         (WebCore::SVGAnimationElement::shouldApplyAnimation): Ditto.
1414         (WebCore::SVGAnimationElement::calculateKeyTimesForCalcModePaced): Ditto.
1415         (WebCore::SVGAnimationElement::calculatePercentForSpline): Ditto.
1416         (WebCore::SVGAnimationElement::calculatePercentFromKeyPoints): Ditto.
1417         (WebCore::SVGAnimationElement::calculatePercentForFromTo): Ditto.
1418         (WebCore::SVGAnimationElement::currentValuesFromKeyPoints): Ditto.
1419         (WebCore::SVGAnimationElement::currentValuesForValuesAnimation): Ditto.
1420         (WebCore::SVGAnimationElement::startedActiveInterval): Ditto.
1421         (WebCore::SVGAnimationElement::updateAnimation): Ditto.
1422         (WebCore::SVGAnimationElement::checkInvalidCSSAttributeType): Ditto.
1423
1424         * svg/SVGAnimationElement.h: Changed CalcMode into an enum class.
1425         Updated for above changes.
1426
1427         * svg/SVGAnimationElement.idl: Removed MayThrowLegacyException from
1428         getSimpleDuration.
1429
1430         * svg/SVGColor.cpp:
1431         (WebCore::SVGColor::SVGColor): Updated to take scalar in the straightforward
1432         manner instead of constt SVGColorType&.
1433         (WebCore::SVGColor::setRGBColor): Use ExceptionOr.
1434         (WebCore::SVGColor::setRGBColorICCColor): Ditto.
1435         (WebCore::SVGColor::setColor): Ditto.
1436         * svg/SVGColor.h: Updated for above changes. Removed unneeded destructor.
1437         * svg/SVGColor.idl: Use non-legacy exceptions.
1438
1439         * svg/SVGGlyphRefElement.cpp:
1440         (WebCore::SVGGlyphRefElement::SVGGlyphRefElement): Initialize data members
1441         in class definition, not here.
1442         (WebCore::parseFloat): Added helper. Used in parseAttribute.
1443         (WebCore::SVGGlyphRefElement::parseAttribute): Updated to use parseFloat helper.
1444         (WebCore::SVGGlyphRefElement::glyphRef): Deleted.
1445         (WebCore::SVGGlyphRefElement::setGlyphRef): Deleted.
1446         (WebCore::SVGGlyphRefElement::setX): Removed unused Exception& argument.
1447         (WebCore::SVGGlyphRefElement::setY): Ditto.
1448         (WebCore::SVGGlyphRefElement::setDx): Ditto.
1449         (WebCore::SVGGlyphRefElement::setDy): Ditto.
1450         * svg/SVGGlyphRefElement.h: Updated for above changes.
1451         * svg/SVGGlyphRefElement.idl: Use Reflect on glyphRef. Removed incorrect
1452         SetterMayThrowLegacyException attributes for x, y, dx, and dy. Longer term
1453         it might be nice to use [Reflect] on these too.
1454
1455         * svg/SVGGraphicsElement.idl: Use non-legacy exception.
1456
1457         * svg/SVGLength.cpp:
1458         (WebCore::parseLengthType): Changed argument type since caller does not
1459         need to know how many characters are consumed.
1460         (WebCore::SVGLength::SVGLength): Removed IGNORE_EXCEPTION and ASSERT_NO_EXCEPTION.
1461         Also removed the copy constructor, letting the compiler generate the default.
1462         (WebCore::SVGLength::setValueAsString): Use ExceptionOr.
1463         (WebCore::SVGLength::construct): Updated since setValueAsString uses ExceptionOr.
1464         (WebCore::SVGLength::value): Ditto.
1465         (WebCore::SVGLength::valueForBindings): Use ExceptionOr. Also renamed to
1466         disambiguate with the version used outside of bindings.
1467         (WebCore::SVGLength::setValue): Use ExceptionOr.
1468         (WebCore::SVGLength::newValueSpecifiedUnits): Ditto.
1469         (WebCore::SVGLength::convertToSpecifiedUnits): Ditto.
1470         (WebCore::SVGLength::fromCSSPrimitiveValue): Updated since newValueSpecifiedUnits
1471         uses ExceptionOr.
1472         (WebCore::SVGLength::lengthModeForAnimatedLengthAttribute): Rewrote map generation
1473         code to be more efficient and not unrolled. Only do one hash table lookup.
1474         * svg/SVGLength.h: Updated for above changes.
1475         * svg/SVGLength.idl: Use non-legacy exceptions.
1476
1477         * svg/SVGLengthContext.cpp:
1478         (WebCore::SVGLengthContext::valueForLength): Update since function
1479         uses ExceptionOr.
1480         (WebCore::SVGLengthContext::convertValueToUserUnits): Use ExceptionOr.
1481         (WebCore::SVGLengthContext::convertValueFromUserUnits): Ditto.
1482         (WebCore::SVGLengthContext::convertValueFromUserUnitsToPercentage): Ditto.
1483         (WebCore::SVGLengthContext::convertValueFromPercentageToUserUnits): Ditto.
1484         (WebCore::SVGLengthContext::convertValueFromUserUnitsToEMS): Ditto.
1485         (WebCore::SVGLengthContext::convertValueFromEMSToUserUnits): Ditto.
1486         (WebCore::SVGLengthContext::convertValueFromUserUnitsToEXS): Ditto.
1487         (WebCore::SVGLengthContext::convertValueFromEXSToUserUnits): Ditto.
1488         * svg/SVGLengthContext.h: Updatedfor above changes.
1489
1490         * svg/SVGLengthList.cpp:
1491         (WebCore::SVGLengthList::parse): Updated since setValueAsString uses
1492         ExceptionOr now.
1493         * svg/SVGLengthList.h: Removed unneeded constructor.
1494         * svg/SVGLengthList.idl: Use non-legacy exceptions.
1495
1496         * svg/SVGLocatable.cpp:
1497         (WebCore::SVGLocatable::getTransformToElement): Use ExceptionOr.
1498         * svg/SVGLocatable.h: Updated for above change.
1499
1500         * svg/SVGMarkerElement.h:
1501         (WebCore::SVGPropertyTraits<SVGMarkerOrientType>::fromString):
1502         Updated since setValueAsString uses ExceptionOr now.
1503
1504         * svg/SVGMatrix.h: Use ExceptionOr.
1505         * svg/SVGMatrix.idl: Use non-legacy exceptions.
1506
1507         * svg/SVGNumberList.h: Removed unneeded constructor.
1508         * svg/SVGNumberList.idl: Use non-legacy exceptions.
1509
1510         * svg/SVGPaint.cpp:
1511         (WebCore::SVGPaint::setPaint): Use ExceptionOr.
1512         * svg/SVGPaint.h: Updated for above chagne.
1513         * svg/SVGPaint.idl: Use non-legacy exception.
1514
1515         * svg/SVGPathSegList.h: Tweaked a bit.
1516         * svg/SVGPathSegList.idl: Use non-legacy exceptions.
1517
1518         * svg/SVGPointList.h: Removed unneeded constructor.
1519         * svg/SVGPointList.idl: Use non-legacy exceptions.
1520
1521         * svg/SVGPreserveAspectRatio.cpp:
1522         (WebCore::SVGPreserveAspectRatio::setAlign): Use ExceptionOr.
1523         (WebCore::SVGPreserveAspectRatio::setMeetOrSlice): Ditto.
1524         * svg/SVGPreserveAspectRatio.h: Updated for above changes.
1525         * svg/SVGPreserveAspectRatio.idl: Use non-legacy exceptions.
1526
1527         * svg/SVGSVGElement.cpp:
1528         (WebCore::SVGSVGElement::currentView): Pass a reference.
1529
1530         * svg/SVGStringList.h: Tweaked a bit.
1531         * svg/SVGStringList.idl: Use non-legacy exceptions.
1532
1533         * svg/SVGStyleElement.cpp:
1534         (WebCore::SVGStyleElement::setType): Removed unneeded ExceptionCode&.
1535         (WebCore::SVGStyleElement::setMedia): Ditto.
1536         (WebCore::SVGStyleElement::setTitle): Deleted.
1537         * svg/SVGStyleElement.h: Updated for above changes, and made the title
1538         function override be private.
1539         * svg/SVGStyleElement.idl: Use Reflect for title. Removed unneeded
1540         SetterMayThrowLegacyException on all attributes.
1541
1542         * svg/SVGTextContentElement.cpp:
1543         (WebCore::SVGTextContentElement::textLengthAnimated): Removed
1544         ASSERT_NO_EXCEPTION, won't work any more.
1545         (WebCore::SVGTextContentElement::getSubStringLength): Use ExceptionOr.
1546         Also remove redundant call to updateLayoutIgnorePendingStylesheets,
1547         called by getNumberOfChars.
1548         (WebCore::SVGTextContentElement::getStartPositionOfChar): Ditto.
1549         (WebCore::SVGTextContentElement::getEndPositionOfChar): Ditto.
1550         (WebCore::SVGTextContentElement::getExtentOfChar): Ditto.
1551         (WebCore::SVGTextContentElement::getRotationOfChar): Ditto.
1552         (WebCore::SVGTextContentElement::selectSubString): Ditto.
1553         * svg/SVGTextContentElement.h: Updated for above changes.
1554         * svg/SVGTextContentElement.idl: Use non-legacy exceptions.
1555
1556         * svg/SVGTransformList.h: Removed unneeded constructor.
1557         * svg/SVGTransformList.idl: Use non-legacy exceptions.
1558
1559         * svg/SVGViewSpec.cpp:
1560         (WebCore::SVGViewSpec::SVGViewSpec): Updated to take a reference.
1561         (WebCore::SVGViewSpec::setZoomAndPan): Use ExceptionOr.
1562         (WebCore::SVGViewSpec::setTransformString): Deleted.
1563         (WebCore::SVGViewSpec::viewBoxString): Use m_viewBox directly.
1564         (WebCore::SVGViewSpec::preserveAspectRatioString): Use
1565         m_preserveAspectRatio directly.
1566         (WebCore::SVGViewSpec::viewTarget): Use is<SVGElement>.
1567         (WebCore::SVGViewSpec::lookupOrCreateViewBoxWrapper): Use
1568         m_contextElement directly.
1569         (WebCore::SVGViewSpec::lookupOrCreatePreserveAspectRatioWrapper):
1570         Ditto.
1571         (WebCore::SVGViewSpec::lookupOrCreateTransformWrapper): Ditto.
1572         (WebCore::SVGViewSpec::parseViewSpec): Set m_viewTargetString directly.
1573         * svg/SVGViewSpec.h: Updated for above changes. Removed unneeded virtual
1574         destructor, unneeded using for ref/deref, unused functions including
1575         setTransformString, setViewTargetString, non-exception setZoomAndPan,
1576         contextElement, viewBoxBaseValue, and preserveAspectRatioBaseValue.
1577         * svg/SVGViewSpec.idl: Use non-legacy exceptions. Also specify
1578         ImplementationLacksVTable.
1579
1580         * svg/properties/SVGAnimatedEnumerationPropertyTearOff.h:
1581         Use ExceptionOr.
1582         * svg/properties/SVGAnimatedStaticPropertyTearOff.h: Ditto.
1583         * svg/properties/SVGListProperty.h: Ditto.
1584         * svg/properties/SVGListPropertyTearOff.h: Ditto.
1585          * svg/properties/SVGPathSegListPropertyTearOff.cpp:
1586         (WebCore::SVGPathSegListPropertyTearOff::clear): Ditto.
1587         (WebCore::SVGPathSegListPropertyTearOff::getItem): Ditto.
1588         (WebCore::SVGPathSegListPropertyTearOff::replaceItem): Ditto.
1589         (WebCore::SVGPathSegListPropertyTearOff::removeItem): Ditto.
1590         * svg/properties/SVGPathSegListPropertyTearOff.h: Ditto.
1591         * svg/properties/SVGPropertyTearOff.h: Ditto. Also added an overload
1592         of create that knows how to deal with exceptions.
1593         * svg/properties/SVGStaticListPropertyTearOff.h: Ditto.
1594         * svg/properties/SVGTransformListPropertyTearOff.h: Ditto.
1595
1596 2016-10-22  Chris Dumez  <cdumez@apple.com>
1597
1598         WebGLRenderingContextBase.bufferData() should use a union instead of overloading
1599         https://bugs.webkit.org/show_bug.cgi?id=163795
1600
1601         Reviewed by Darin Adler.
1602
1603         WebGLRenderingContextBase.bufferData() / bufferSubData() should use a union
1604         instead of overloading:
1605         - https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14
1606
1607         No new tests, no web-exposed behavior change.
1608
1609         * bindings/js/JSDOMConvert.h:
1610         (WebCore::Converter<IDLInterface<T>>::convert):
1611         * bindings/scripts/CodeGeneratorJS.pm:
1612         (GenerateHeader):
1613         * bindings/scripts/test/JS/JSInterfaceName.h:
1614         * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
1615         * bindings/scripts/test/JS/JSTestCEReactions.h:
1616         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.h:
1617         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.h:
1618         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h:
1619         * bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
1620         * bindings/scripts/test/JS/JSTestEventConstructor.h:
1621         * bindings/scripts/test/JS/JSTestEventTarget.h:
1622         * bindings/scripts/test/JS/JSTestException.h:
1623         * bindings/scripts/test/JS/JSTestGenerateIsReachable.h:
1624         * bindings/scripts/test/JS/JSTestGlobalObject.h:
1625         * bindings/scripts/test/JS/JSTestInterface.h:
1626         * bindings/scripts/test/JS/JSTestIterable.h:
1627         * bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
1628         * bindings/scripts/test/JS/JSTestNamedConstructor.h:
1629         * bindings/scripts/test/JS/JSTestNode.h:
1630         * bindings/scripts/test/JS/JSTestNondeterministic.h:
1631         * bindings/scripts/test/JS/JSTestObj.h:
1632         * bindings/scripts/test/JS/JSTestOverloadedConstructors.h:
1633         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.h:
1634         * bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
1635         * bindings/scripts/test/JS/JSTestSerialization.h:
1636         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
1637         * bindings/scripts/test/JS/JSTestTypedefs.h:
1638         * bindings/scripts/test/JS/JSattribute.h:
1639         * bindings/scripts/test/JS/JSreadonly.h:
1640         * html/canvas/WebGL2RenderingContext.cpp:
1641         (WebCore::WebGL2RenderingContext::bufferData):
1642         (WebCore::WebGL2RenderingContext::bufferSubData):
1643         * html/canvas/WebGLRenderingContextBase.cpp:
1644         (WebCore::WebGLRenderingContextBase::bufferData):
1645         (WebCore::WebGLRenderingContextBase::bufferSubData):
1646         * html/canvas/WebGLRenderingContextBase.h:
1647         * html/canvas/WebGLRenderingContextBase.idl:
1648
1649 2016-10-22  Darin Adler  <darin@apple.com>
1650
1651         [Cocoa] REGRESSION (r204508): Crash in init_WebCreateFragment when pasting (seen in multiple apps using legacy WebKit)
1652         https://bugs.webkit.org/show_bug.cgi?id=163839
1653
1654         Reviewed by Dan Bernstein.
1655
1656         * editing/cocoa/EditorCocoa.mm: Use the appropriate SOFT_LINK macros to find
1657         the WebKitLegacy platform in the correct location for iOS and macOS.
1658
1659 2016-10-22  Nael Ouedraogo  <nael.ouedraogo@crf.canon.fr>
1660
1661         Bindings error message for missing required dictionary member should be more explicit
1662         https://bugs.webkit.org/show_bug.cgi?id=163665
1663
1664         Reviewed by Darin Adler.
1665
1666         Add throwRequiredMemberTypeError function to throw a TypeError exception with an error
1667         message indicating the missing required member.
1668
1669         No new test required, rebase existing tests.
1670
1671         * bindings/js/JSDOMBinding.cpp:
1672         (WebCore::throwRequiredMemberTypeError):
1673         * bindings/js/JSDOMBinding.h:
1674         * bindings/scripts/CodeGeneratorJS.pm:
1675         (GenerateDictionaryImplementationContent):
1676         * bindings/scripts/test/JS/JSTestObj.cpp:
1677         (WebCore::convertDictionary<TestObj::DictionaryThatShouldNotTolerateNull>):
1678
1679 2016-10-22  Ryosuke Niwa  <rniwa@webkit.org>
1680
1681         Upgrading custom element should enqueue attributeChanged and connected callbacks
1682         https://bugs.webkit.org/show_bug.cgi?id=163840
1683
1684         Reviewed by Darin Adler.
1685
1686         When upgrading a custom element, enqueue attributeChanged and connectedCallbacks as needed as specified
1687         in step 3 and 4 of: https://html.spec.whatwg.org/multipage/scripting.html#concept-upgrade-an-element
1688
1689         Test: fast/custom-elements/upgrading-enqueue-reactions.html
1690
1691         * bindings/js/JSCustomElementInterface.cpp:
1692         (WebCore::JSCustomElementInterface::upgradeElement): Enqueue 
1693         * dom/CustomElementReactionQueue.cpp:
1694         (WebCore::CustomElementReactionQueueItem::invoke): Don't invoke callbacks when the custom element had
1695         failed to upgrade.
1696         (WebCore::CustomElementReactionQueue::enqueuePostUpgradeReactions): Added.
1697         (WebCore::CustomElementReactionQueue::invokeAll): Upgrading a custom element may enqueue more reactions.
1698         Keep invoking reactions until the queue becomes empty.
1699         * dom/CustomElementReactionQueue.h:
1700         * dom/Range.idl: Added a forgotten CEReactions here.
1701
1702 2016-10-21  David Kilzer  <ddkilzer@apple.com>
1703
1704         Bug 163762: IntSize::area() should used checked arithmetic
1705         <https://webkit.org/b/163762>
1706
1707         Reviewed by Darin Adler.
1708
1709         No new tests since no change in nominal behavior.
1710
1711         * platform/graphics/IntSize.h:
1712         (WebCore::IntSize::area): Change to return a
1713         Checked<unsigned, T> value. Use WTF:: namespace to avoid
1714         including another header.
1715
1716         * platform/graphics/IntRect.h:
1717         (WebCore::IntRect::area): Ditto.
1718
1719         The remaining changes are to use the Checked<unsigned> return
1720         value of IntSize::area() and IntRect::area() correctly in
1721         context, in addition to items noted below.
1722
1723         * html/HTMLPlugInImageElement.cpp:
1724         (WebCore::HTMLPlugInImageElement::isTopLevelFullPagePlugin):
1725         Declare contentWidth and contentHeight as float values to
1726         prevent overflow when computing the area, and to make the
1727         inequality comparison in the return statement uses the same type
1728         for both sides.
1729         * html/ImageData.cpp:
1730         (WebCore::ImageData::ImageData):
1731         * html/MediaElementSession.cpp:
1732         (WebCore::isElementRectMostlyInMainFrame):
1733         * platform/graphics/ImageBackingStore.h:
1734         (WebCore::ImageBackingStore::setSize): Restructure logic to
1735         compute area only once.
1736         (WebCore::ImageBackingStore::clear):
1737         * platform/graphics/ImageFrame.h:
1738         (WebCore::ImageFrame::frameBytes):
1739         * platform/graphics/ImageSource.cpp:
1740         (WebCore::ImageSource::maximumSubsamplingLevel):
1741         * platform/graphics/ca/LayerPool.cpp:
1742         (WebCore::LayerPool::backingStoreBytesForSize):
1743         * platform/graphics/cg/ImageDecoderCG.cpp:
1744         (WebCore::ImageDecoder::frameBytesAtIndex):
1745         * platform/graphics/filters/FEGaussianBlur.cpp:
1746         (WebCore::FEGaussianBlur::platformApplySoftware):
1747         * platform/graphics/filters/FilterEffect.cpp:
1748         (WebCore::FilterEffect::asUnmultipliedImage):
1749         (WebCore::FilterEffect::asPremultipliedImage):
1750         (WebCore::FilterEffect::copyUnmultipliedImage):
1751         (WebCore::FilterEffect::copyPremultipliedImage):
1752         (WebCore::FilterEffect::createUnmultipliedImageResult):
1753         (WebCore::FilterEffect::createPremultipliedImageResult):
1754         * platform/graphics/win/ImageBufferDataDirect2D.cpp:
1755         (WebCore::ImageBufferData::getData): Update overflow check,
1756         rename local variable to numBytes, and compute numBytes once.
1757         * platform/graphics/win/ImageDecoderDirect2D.cpp:
1758         (WebCore::ImageDecoder::frameBytesAtIndex):
1759         * platform/image-decoders/ImageDecoder.cpp:
1760         (WebCore::ImageDecoder::frameBytesAtIndex):
1761         * platform/ios/LegacyTileLayerPool.mm:
1762         (WebCore::LegacyTileLayerPool::bytesBackingLayerWithPixelSize):
1763         * rendering/RenderLayerCompositor.cpp:
1764         (WebCore::RenderLayerCompositor::requiresCompositingForCanvas):
1765         * rendering/shapes/Shape.cpp:
1766         (WebCore::Shape::createRasterShape):
1767
1768 2016-10-21  Gavin Barraclough  <barraclough@apple.com>
1769
1770         WebPageProxy should not need PageActivityState
1771         https://bugs.webkit.org/show_bug.cgi?id=163821
1772
1773         Reviewed by Geoff Garen.
1774
1775         The PageActivityState is currently plumbed back from WebCore up to the UI process, to
1776         determine whether to enabled process suppression. However the information it contains
1777         (whether a page load is ongoing, whether audio is playing) is already available via
1778         other means. Remove this use of PageActivityState.
1779
1780         * html/HTMLMediaElement.cpp:
1781         (WebCore::HTMLMediaElement::mediaState):
1782             - Fix a bug in how we compute IsPlayingAudio - if the volume of the MediaElement is
1783               set to zero, then audio is not playing (we were already checking muted).
1784         * page/ChromeClient.h:
1785             - removed setPageActivityState
1786         * page/Page.cpp:
1787         (WebCore::Page::setPageActivityState): Deleted.
1788             - setPageActivityState -> pageActivityStateChanged, remove call to ChromeClient
1789         * page/Page.h:
1790         (WebCore::Page::pageActivityStateChanged):
1791             - setPageActivityState -> pageActivityStateChanged
1792         * page/PageThrottler.cpp:
1793         (WebCore::PageThrottler::setActivityFlag):
1794             - setPageActivityState -> pageActivityStateChanged
1795
1796 2016-10-21  Chris Dumez  <cdumez@apple.com>
1797
1798         [Web ID] Overload resolution is wrong if one of the types is a nullable union
1799         https://bugs.webkit.org/show_bug.cgi?id=163816
1800
1801         Reviewed by Alex Christensen.
1802
1803         Overload resolution was wrong if one of the types was a nullable union. This
1804         is because we never considered the union type itself, only its subtypes.
1805         Therefore, we checked if any of the union's subtypes were nullable but we
1806         failed to check if the union itself was nullable.
1807
1808         See:
1809         - https://heycam.github.io/webidl/#es-overloads (Step 11.3.)
1810
1811         No new tests, extended bindings tests.
1812
1813         * bindings/scripts/CodeGeneratorJS.pm:
1814         (GetOverloadThatMatchesIgnoringUnionSubtypes):
1815         (GenerateOverloadedFunctionOrConstructor):
1816         * bindings/scripts/test/JS/JSTestObj.cpp:
1817         (WebCore::jsTestObjPrototypeFunctionOverloadWithNullableUnion1):
1818         (WebCore::jsTestObjPrototypeFunctionOverloadWithNullableUnion1Caller):
1819         (WebCore::jsTestObjPrototypeFunctionOverloadWithNullableUnion2):
1820         (WebCore::jsTestObjPrototypeFunctionOverloadWithNullableUnion2Caller):
1821         (WebCore::jsTestObjPrototypeFunctionOverloadWithNullableUnion):
1822         (WebCore::jsTestObjPrototypeFunctionOverloadWithOptionalUnion1):
1823         (WebCore::jsTestObjPrototypeFunctionOverloadWithOptionalUnion1Caller):
1824         (WebCore::jsTestObjPrototypeFunctionOverloadWithOptionalUnion2):
1825         (WebCore::jsTestObjPrototypeFunctionOverloadWithOptionalUnion2Caller):
1826         (WebCore::jsTestObjPrototypeFunctionOverloadWithOptionalUnion):
1827         * bindings/scripts/test/TestObj.idl:
1828
1829 2016-10-21  Eric Carlson  <eric.carlson@apple.com>
1830
1831         [MediaStream] Dynamically generate media capture sandbox extensions
1832         https://bugs.webkit.org/show_bug.cgi?id=154861
1833         <rdar://problem/24909411>
1834
1835         Reviewed by Tim Horton.
1836
1837         No new tests, some of these changes are covered by existing tests and some can only be tested
1838         with physical capture devices.
1839
1840         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: AVSampleBufferAudioRenderer
1841           and AVSampleBufferRenderSynchronizer are now declared in AVFoundationSPI.h.
1842
1843         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
1844         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
1845         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::MediaPlayerPrivateMediaStreamAVFObjC): Initialize 
1846           AVSampleBufferRenderSynchronizer.
1847         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::isAvailable): Fail if AVSampleBufferRenderSynchronizer
1848           isn't available.
1849         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueAudioSampleBufferFromTrack): Take a MediaSample&
1850           instead of a PlatformSample&.
1851         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSampleBufferFromTrack): Ditto.
1852         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayer): Add the sample buffer display 
1853           later to the synchronizer.
1854         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::destroyLayer): Remove the sample buffer display 
1855           later from the synchronizer.
1856         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::play): Start the synchronizer.
1857         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::pause): Stash the current clock time in 
1858           m_pausedTime, but leave the clock running. Pause the synchronizer.
1859         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentMediaTime): Return the clock time
1860           when playing, m_pausedTime time when paused because we leave the clock running forever.
1861         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::sampleBufferUpdated):
1862
1863         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: AVSampleBufferAudioRenderer
1864           is now declared in AVFoundationSPI.h.
1865
1866         * platform/spi/mac/AVFoundationSPI.h: Add AVSampleBufferAudioRenderer and AVSampleBufferRenderSynchronizer.
1867
1868 2016-10-21  Commit Queue  <commit-queue@webkit.org>
1869
1870         Unreviewed, rolling out r207582.
1871         https://bugs.webkit.org/show_bug.cgi?id=163819
1872
1873         Not quite ready rdar://problem/28897179 (Requested by
1874         alexchristensen on #webkit).
1875
1876         Reverted changeset:
1877
1878         "Re-enable URLParser for non-Safari Cocoa apps after r207321"
1879         https://bugs.webkit.org/show_bug.cgi?id=163690
1880         http://trac.webkit.org/changeset/207582
1881
1882 2016-10-21  Gavin Barraclough  <barraclough@apple.com>
1883
1884         WebPage should take UserActivity directly for user input
1885         https://bugs.webkit.org/show_bug.cgi?id=163813
1886
1887         Reviewed by Anders Carlsson.
1888
1889         When we receive mouse/keyboard events in a page, we want to prevent AppNap. We currently do so
1890         via the PageThrottler. This patch is to just make the WebPage drive the UserActivity directly.
1891
1892         Two reasons to do so: (1) to cleanup & simplify for further refactoring. (2) The current code
1893         isn't really achieving the desired effect. The page setting the flag in the throttler to get
1894         the activity to be set is now a less effective way of achieving this goal, since the
1895         PageActivityState bounces back across to the UI process & then messages back to the WebContent
1896         process to take the UserActivity. These extra hops defeat the purpose of making sure the boost
1897         from the initial message isn't lost.
1898
1899         * page/PageThrottler.cpp:
1900         (WebCore::PageThrottler::PageThrottler):
1901         (WebCore::m_userInputHysteresis): Deleted.
1902         * page/PageThrottler.h:
1903         (WebCore::PageThrottler::didReceiveUserInput): Deleted.
1904             - removed PageActivityState::UserInputActivity, didReceiveUserInput, m_userInputHysteresis.
1905
1906 2016-10-21  Wenson Hsieh  <wenson_hsieh@apple.com>
1907
1908         Support (insertFrom|deleteBy)Composition and (insert|delete)CompositionText inputTypes for InputEvents
1909         https://bugs.webkit.org/show_bug.cgi?id=163460
1910         <rdar://problem/28784142>
1911
1912         Reviewed by Darin Adler.
1913
1914         Adds basic support for the composition inputTypes in the InputEvent spec. See w3.org/TR/input-events,
1915         github.com/w3c/input-events/issues/41 and github.com/w3c/input-events/issues/42 for more details. While input
1916         events are fired in the correct order with respect to each other, additional work will be required to ensure
1917         that input events are fired in the correct order with respect to composition(start|update|end) events and
1918         textInput events. This is held off until the expected ordering of events is officially defined in the spec.
1919
1920         Tests: fast/events/before-input-events-prevent-insert-composition.html
1921                fast/events/before-input-events-prevent-recomposition.html
1922                fast/events/input-events-ime-composition.html
1923                fast/events/input-events-ime-recomposition.html
1924
1925         * editing/CompositeEditCommand.cpp:
1926         (WebCore::CompositeEditCommand::apply):
1927         * editing/CompositeEditCommand.h:
1928         (WebCore::CompositeEditCommand::isBeforeInputEventCancelable):
1929
1930         Adds a new virtual method hook for subclasses to mark their `beforeinput` events as non-cancelable (see
1931         TypingCommand::isBeforeInputEventCancelable). By default, `beforeinput` events are cancelable.
1932
1933         * editing/EditAction.h:
1934
1935         Adds 4 new EditActions corresponding to the 4 composition-related inputTypes. These are:
1936         EditActionTypingDeletePendingComposition    => "deleteCompositionText"
1937         EditActionTypingDeleteFinalComposition      => "deleteByComposition"
1938         EditActionTypingInsertPendingComposition    => "insertCompositionText"
1939         EditActionTypingInsertFinalComposition      => "insertFromComposition"
1940
1941         * editing/EditCommand.cpp:
1942         (WebCore::inputTypeNameForEditingAction):
1943         * editing/Editor.cpp:
1944         (WebCore::dispatchBeforeInputEvent):
1945         (WebCore::dispatchBeforeInputEvents):
1946         (WebCore::Editor::willApplyEditing):
1947         (WebCore::Editor::insertTextWithoutSendingTextEvent):
1948         (WebCore::Editor::setComposition):
1949
1950         In setComposition(text, mode), tweak the logic for committing a composition to always delete the selection
1951         before inserting the final composition text. In setComposition(text, underlines, start, end), catch the case
1952         where we're beginning to recompose an existing range in the DOM and delete the recomposed text first.
1953
1954         * editing/TypingCommand.cpp:
1955         (WebCore::editActionForTypingCommand):
1956         (WebCore::TypingCommand::TypingCommand):
1957         (WebCore::TypingCommand::deleteSelection):
1958
1959         Adds a TextCompositionType parameter so that call sites (see Editor::setComposition) can indicate what state the
1960         edited composition is in. This allows us to differentiate between deletion of finalized composition text in
1961         preparation of recomposing a range in the DOM, and deletion of composition text that has not yet been committed
1962         in preparation for inserting a finalized composition into the DOM.
1963
1964         (WebCore::TypingCommand::deleteKeyPressed):
1965         (WebCore::TypingCommand::forwardDeleteKeyPressed):
1966         (WebCore::TypingCommand::insertText):
1967         (WebCore::TypingCommand::insertLineBreak):
1968         (WebCore::TypingCommand::insertParagraphSeparatorInQuotedContent):
1969         (WebCore::TypingCommand::insertParagraphSeparator):
1970         (WebCore::TypingCommand::isBeforeInputEventCancelable):
1971         (WebCore::TypingCommand::inputEventData):
1972         (WebCore::TypingCommand::willAddTypingToOpenCommand):
1973         * editing/TypingCommand.h:
1974
1975 2016-10-21  Dave Hyatt  <hyatt@apple.com>
1976
1977         [CSS Parser] Make sure shadow user agent sheets parse in UASheetMode
1978         https://bugs.webkit.org/show_bug.cgi?id=163810
1979
1980         Reviewed by Dean Jackson.
1981
1982         * dom/InlineStyleSheetOwner.cpp:
1983         (WebCore::parserContextForElement):
1984         (WebCore::makeInlineStyleSheetCacheKey):
1985         (WebCore::InlineStyleSheetOwner::createSheet):
1986         (WebCore::parserContextForForElement): Deleted.
1987
1988 2016-10-21  Jer Noble  <jer.noble@apple.com>
1989
1990         YouTube stalls when seeking beyond buffered range
1991         https://bugs.webkit.org/show_bug.cgi?id=162813
1992
1993         Reviewed by Eric Carlson.
1994
1995         When seeking a MediaPlayerPrivateMediaSourceAVFObjC, we will first seek the AVSampleBufferRenderSynchronizer,
1996         flush and enqueue non-displaying frames, enqueue regular frames, then begin playback. The above stall will occur
1997         when we enqueue so many non- displaying frames that the display layer is not ready for normal ones before
1998         playback begins. Then, when the synchronizer attempts to synchronize the enqueued audio and video renderers, the
1999         only available samples are back at the original media time, and so it "seeks" by updating the CMTimebase back to
2000         the original media time, causing playback to appear "stalled".  The overall solution is to "flush" the contents
2001         of the renderers before the seek, so that the synchronizer doesn't reset the currentTime, and to only restart
2002         the synchronizer when there are visible (or audible) samples available for display.
2003
2004         Breaking the fix down into sections:
2005
2006         = Don't enqueue too many non-displaying samples at once:
2007         - Rename SourceBufferPrivate::flushAndEnqueueNonDisplayingSamples() to SourceBufferPrivate::flush(), and no longer
2008           pass in an array of non-displaying samples.
2009         - Add a new virtual method to MediaSample, createNonDisplayingCopy(), used by SourceBuffer to enqueue non-displaying
2010           samples.
2011         - in SourceBuffer::reenqueueMediaForTime(), use that new createNonDisplayingCopy() method to enqueue non-displaying
2012           samples in the same queue as regular samples.
2013
2014         * Modules/mediasource/SourceBuffer.cpp:
2015         (WebCore::SourceBuffer::provideMediaData):
2016         (WebCore::SourceBuffer::reenqueueMediaForTime):
2017         * platform/MediaSample.h:
2018         (WebCore::MediaSample::isNonDisplaying):
2019         * platform/graphics/SourceBufferPrivate.h:
2020         (WebCore::SourceBufferPrivate::flush):
2021         (WebCore::SourceBufferPrivate::flushAndEnqueueNonDisplayingSamples): Renamed -> flush().
2022         * platform/graphics/avfoundation/MediaSampleAVFObjC.h:
2023         * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
2024         (WebCore::CMSampleBufferIsNonDisplaying):
2025         (WebCore::MediaSampleAVFObjC::flags):
2026         (WebCore::MediaSampleAVFObjC::createNonDisplayingCopy):
2027         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
2028         (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
2029         (WebCore::SourceBufferPrivateAVFObjC::willSeek):
2030         (WebCore::createNonDisplayingCopy): Moved to MediaSampleAVFObjC.
2031         (WebCore::SourceBufferPrivateAVFObjC::flushAndEnqueueNonDisplayingSamples): Renamed -> flush().
2032         * platform/mock/mediasource/MockBox.h:
2033         * platform/mock/mediasource/MockSourceBufferPrivate.cpp:
2034         (WebCore::MockMediaSample::flags):
2035         (WebCore::MockMediaSample::createNonDisplayingCopy):
2036         * platform/mock/mediasource/MockSourceBufferPrivate.h:
2037
2038         = Don't start playing until all renderers have visible/audible samples:
2039         - SourceBufferPrivateAVFObjC will notify its associated MediaPlayerPrivateMediaSourceAVFObjC when
2040           it flushes and receives visible/audible samples.
2041         - The MediaPlayer will store audio renderers as keys to a HashMap which allows it to track which
2042           have available samples.
2043         - This requires changing all the places where we loop over the available renderers.
2044
2045         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
2046         (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
2047         (WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
2048         (WebCore::SourceBufferPrivateAVFObjC::flush):
2049         (WebCore::SourceBufferPrivateAVFObjC::willSeek):
2050         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
2051         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::allRenderersHaveAvailableSamples):
2052         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setHasAvailableVideoFrame): Deleted.
2053         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2054         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
2055         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVolume):
2056         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setMuted):
2057         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setHasAvailableVideoFrame):
2058         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setHasAvailableAudioSample):
2059         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::updateAllRenderersHaveAvailableSamples):
2060         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::addAudioRenderer):
2061         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::removeAudioRenderer):
2062         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setPreservesPitch):
2063         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seeking):
2064         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::shouldBePlaying):
2065         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekInternal):
2066         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h:
2067         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
2068         (WebCore::MediaSourcePrivateAVFObjC::willSeek):
2069         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
2070
2071         = Don't display new samples mid-seek.
2072         - MediaSource should clear its m_pendingSeekTime ivar, which is used whyn SourceBuffer queries whether or not a
2073           seek is pending, when instructing its SourceBuffers to seekToTime().
2074         - This allows SourceBuffer to decline to enqueue new samples during a MediaSource seek operation.
2075
2076         * Modules/mediasource/MediaSource.cpp:
2077         (WebCore::MediaSource::completeSeek):
2078
2079 2016-10-20  Dean Jackson  <dino@apple.com>
2080
2081         SVG should not paint selection within a mask
2082         https://bugs.webkit.org/show_bug.cgi?id=163772
2083         <rdar://problem/28705129>
2084
2085         Reviewed by Simon Fraser.
2086
2087         When masking content, we shouldn't paint the text
2088         selection as we are rendering into the masking
2089         offscreen buffer.
2090
2091         Test: svg/masking/mask-should-not-paint-selection.html
2092
2093         * rendering/PaintPhase.h: Add a new behavior - PaintBehaviorSkipSelectionHighlight.
2094         * rendering/svg/SVGInlineTextBox.cpp:
2095         (WebCore::SVGInlineTextBox::paint): Don't update the selectionStyle if
2096         PaintBehaviorSkipSelectionHighlight is true.
2097         * rendering/svg/SVGRenderingContext.cpp:
2098         (WebCore::SVGRenderingContext::renderSubtreeToImageBuffer): Add PaintBehaviorSkipSelectionHighlight
2099         to the PaintInfo.
2100
2101 2016-10-21  Chris Dumez  <cdumez@apple.com>
2102
2103         [Web IDL] MediaControlsHost has invalid operation overloads
2104         https://bugs.webkit.org/show_bug.cgi?id=163793
2105
2106         Reviewed by Darin Adler.
2107
2108         MediaControlsHost has invalid operation overloads:
2109         - sortedTrackListForMenu()
2110         - displayNameForTrack()
2111
2112         The parameter is nullable for both overloads which is not valid IDL.
2113
2114         - sortedTrackListForMenu(): The parameter is no longer nullable. This is a minor
2115           behavior change and it should be safe since this is Apple-specific and only
2116           called from mediaControlsApple.js which uses HTMLMediaElement.videoTracks and
2117           HTMLMediaElement.audioTracks as input, both of which are not nullable.
2118           Note that we could have also kept one of the parameters as nullable to not
2119           change behavior but allowing null does not seem useful here.
2120         - displayNameForTrack(): Use a union instead of overloading, no behavior change.
2121
2122         * Modules/mediacontrols/MediaControlsHost.cpp:
2123         (WebCore::MediaControlsHost::sortedTrackListForMenu):
2124         (WebCore::MediaControlsHost::displayNameForTrack):
2125         * Modules/mediacontrols/MediaControlsHost.h:
2126         * Modules/mediacontrols/MediaControlsHost.idl:
2127
2128 2016-10-21  Jeremy Jones  <jeremyj@apple.com>
2129
2130         Implement basic pointer lock behavior for WebKit and WebKit2.
2131         https://bugs.webkit.org/show_bug.cgi?id=162745
2132
2133         Reviewed by Simon Fraser.
2134
2135         When ENABLE_POINTER_LOCK is enabled, these tests now pass with DumpRenderTree.
2136         LayoutTests/pointer-lock/lock-already-locked.html
2137         LayoutTests/pointer-lock/lock-element-not-in-dom.html
2138         LayoutTests/pointer-lock/locked-element-iframe-removed-from-dom.html
2139         LayoutTests/pointer-lock/mouse-event-api.html
2140
2141         Export pointer lock symbols and cancel pointer lock on "escape".
2142
2143         * dom/Document.h: Export symbols.
2144         * dom/Element.h: Export symbols.
2145         * page/EventHandler.cpp:
2146         (WebCore::EventHandler::keyEvent): Cancel pointer lock on "escape".
2147         * page/PointerLockController.cpp: Add missing include.
2148         * page/PointerLockController.h: Export symbols.
2149
2150 2016-10-21  Jer Noble  <jer.noble@apple.com>
2151
2152         WebCore::PlatformMediaSession::stopSession + 13
2153         https://bugs.webkit.org/show_bug.cgi?id=163799
2154
2155         Reviewed by Eric Carlson.
2156
2157         Because m_sessions can be mutated by removeSession() while iterating over m_sessions, and because
2158         PlatformMediaSessions are not refcounted, it is not enough to copy m_sessions into a copied Vector
2159         before iterating. Instead, wrap iteration of m_sessions in a convenience function, which sets an
2160         iteration counter which, when cleared, removes all null entries from m_session. In parallel, modify
2161         removeSession() to check this iteration counter, and replace the session with a null value rather
2162         than mutating the m_sessions vector itself.
2163
2164         * platform/audio/PlatformMediaSessionManager.cpp:
2165         (WebCore::PlatformMediaSessionManager::has):
2166         (WebCore::PlatformMediaSessionManager::activeAudioSessionRequired):
2167         (WebCore::PlatformMediaSessionManager::canProduceAudio):
2168         (WebCore::PlatformMediaSessionManager::removeSession):
2169         (WebCore::PlatformMediaSessionManager::sessionWillBeginPlayback):
2170         (WebCore::PlatformMediaSessionManager::sessionWillEndPlayback):
2171         (WebCore::PlatformMediaSessionManager::currentSessionsMatching):
2172         (WebCore::PlatformMediaSessionManager::applicationWillEnterBackground):
2173         (WebCore::PlatformMediaSessionManager::applicationDidEnterForeground):
2174         (WebCore::PlatformMediaSessionManager::systemWillSleep):
2175         (WebCore::PlatformMediaSessionManager::systemDidWake):
2176         (WebCore::PlatformMediaSessionManager::stopAllMediaPlaybackForDocument):
2177         (WebCore::PlatformMediaSessionManager::stopAllMediaPlaybackForProcess):
2178         (WebCore::PlatformMediaSessionManager::forEachSession):
2179         (WebCore::PlatformMediaSessionManager::anyOfSessions):
2180         * platform/audio/PlatformMediaSessionManager.h:
2181
2182 2016-10-21  Darin Adler  <darin@apple.com>
2183
2184         Move some more assorted classes from ExceptionCode to Exception
2185         https://bugs.webkit.org/show_bug.cgi?id=163775
2186
2187         Reviewed by Chris Dumez.
2188
2189         * Modules/fetch/WorkerGlobalScopeFetch.cpp:
2190         (WebCore::WorkerGlobalScopeFetch::fetch): Remove unnecessary calls to
2191         WorkerGlobalScope::scriptExcutionObject, which just returns the scope itself.
2192
2193         * Modules/notifications/Notification.cpp: Added now-needed include.
2194         * Modules/webdatabase/DOMWindowWebDatabase.cpp: Ditto.
2195
2196         * WebCore.xcodeproj/project.pbxproj: Added WindowOrWorkerGlobalScope.idl.
2197
2198         * bindings/js/JSDedicatedWorkerGlobalScopeCustom.cpp:
2199         (WebCore::JSDedicatedWorkerGlobalScope::postMessage): Pass a reference instead
2200         of a pointer to handlePostMessage.
2201         * bindings/js/JSMessagePortCustom.cpp:
2202         (WebCore::JSMessagePort::postMessage): Ditto.
2203
2204         * bindings/js/JSMessagePortCustom.h: Use pragma once. Change handlePostMessage
2205         to take a reference to the object instead of a pointer, and also to use
2206         propagateException since postMessage now uses ExceptionOr.
2207
2208         * bindings/js/JSWorkerCustom.cpp:
2209         (WebCore::JSWorker::postMessage): Pass a reference instead of a pointer to
2210         handlePostMessage.
2211         (WebCore::constructJSWorker): Use the version of toJSNewlyCreated that handles
2212         propagating an exception from ExceptionOr.
2213
2214         * bindings/js/JSWorkerGlobalScopeCustom.cpp:
2215         (WebCore::JSWorkerGlobalScope::visitAdditionalChildren): Use auto.
2216         Remove unnecessary round trip through the scriptExecutionContext function.
2217         (WebCore::JSWorkerGlobalScope::importScripts): Use reserveInitialCapacity and
2218         uncheckedAppend to build up the vector of strings. Use propagateException
2219         to deal with ExceptionOr result.
2220
2221         * dom/MessagePort.cpp:
2222         (WebCore::MessagePort::MessagePort): Initialize boolean data members in the
2223         class definition instead of here.
2224         (WebCore::MessagePort::postMessage): Use ExceptionOr.
2225         (WebCore::MessagePort::entangle): Use an rvalue reference.
2226         (WebCore::MessagePort::dispatchMessages): Use ExceptionOr.
2227         (WebCore::MessagePort::disentanglePorts): Ditto. Also use a more efficient
2228         idiom that does half as much hashing as the old algorithm, and got rid an
2229         unneeded local variable.
2230         (WebCore::MessagePort::entanglePorts): Use an rvalue reference.
2231         * dom/MessagePort.h: Updated for above changes.
2232
2233         * fileapi/FileReader.cpp:
2234         (WebCore::FileReader::create): Use auto.
2235         (WebCore::FileReader::FileReader): Initialize scalars in the class definition.
2236         (WebCore::FileReader::~FileReader): Call cancel on the loader directly
2237         instead of sharing code with the stop function.
2238         (WebCore::FileReader::stop): Moved the body of the terminate function here.
2239         (WebCore::FileReader::readAsArrayBuffer): Use ExceptionOr.
2240         (WebCore::FileReader::readAsBinaryString): Ditto.
2241         (WebCore::FileReader::readAsText): Ditto.
2242         (WebCore::FileReader::readAsDataURL): Ditto.
2243         (WebCore::FileReader::readInternal): Ditto. Also add a cast now that
2244         we derive privately from FileReaderLoaderClient.
2245         (WebCore::FileReader::abort): Call stop instead of terminate.
2246         (WebCore::FileReader::terminate): Deleted. Moved code into stop.
2247         (WebCore::FileReader::didReceiveData): Moved comment to where the constant is.
2248         * fileapi/FileReader.h: Updated for above changes. Made more functions private
2249         and used final instead of override.
2250         * fileapi/FileReader.idl: Use non-legacy exceptions.
2251
2252         * fileapi/FileReaderSync.cpp:
2253         (WebCore::FileReaderSync::readAsArrayBuffer): Use ExceptionOr.
2254         (WebCore::FileReaderSync::readAsBinaryString): Ditto.
2255         (WebCore::FileReaderSync::readAsText): Ditto.
2256         (WebCore::FileReaderSync::readAsDataURL): Ditto.
2257         (WebCore::FileReaderSync::startLoading): Ditto.
2258         (WebCore::FileReaderSync::startLoadingString): Added. Helper to cut down on
2259         repeated code in functions above.
2260         * fileapi/FileReaderSync.h: Updated for above changes.
2261         * fileapi/FileReaderSync.idl: Use non-legacy exceptions.
2262
2263         * page/Base64Utilities.cpp:
2264         (WebCore::Base64Utilities::btoa): Use ExceptionOr.
2265         (WebCore::Base64Utilities::atob): Ditto.
2266         * page/Base64Utilities.h: Updated for above changes.
2267
2268         * page/DOMWindow.cpp:
2269         (WebCore::DOMWindow::navigator): Pass a reference to the frame.
2270         (WebCore::DOMWindow::postMessage): Use ExceptionOr when calling
2271         MessagePort::disentanglePorts. Also udpated for changes to the
2272         PostMessageTimer.
2273
2274         * page/Navigator.cpp:
2275         (WebCore::Navigator::Navigator): Take a reference.
2276         (WebCore::shouldHideFourDot): Ditto
2277         (WebCore::Navigator::appVersion): Pass a reference.
2278         (WebCore::Navigator::plugins): Return a reference.
2279         (WebCore::Navigator::mimeTypes): Ditto.
2280         * page/Navigator.h: Updated for above changes. Also marked the
2281         class final and moved derivation from RefCounted to NavigatorBase.
2282
2283         * page/NavigatorBase.h: Addded derivation from RefCounted since
2284         both derived classes want that, and the destructor is already virtual.
2285
2286         * page/WindowOrWorkerGlobalScope.idl: Use non-legacy exceptions.
2287
2288         * page/WorkerNavigator.cpp:
2289         (WebCore::WorkerNavigator::~WorkerNavigator): Deleted.
2290
2291         * page/WorkerNavigator.h: Moved derivation from RefCounted to
2292         NavigatorBase. Also marked class final.
2293
2294         * workers/AbstractWorker.cpp:
2295         (WebCore::AbstractWorker::resolveURL): Use ExceptionOr.
2296         * workers/AbstractWorker.h: Updated for above changes.
2297
2298         * workers/DedicatedWorkerGlobalScope.cpp:
2299         (WebCore::DedicatedWorkerGlobalScope::create): Use RefPtr&&
2300         instead of PassRefPtr.
2301         (WebCore::DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope):
2302         Ditto.
2303         (WebCore::DedicatedWorkerGlobalScope::postMessage): Use ExceptionOr.
2304         (WebCore::DedicatedWorkerGlobalScope::importScripts): Ditto.
2305         * workers/DedicatedWorkerGlobalScope.h: Updated for above changes.
2306         * workers/DedicatedWorkerGlobalScope.idl: Use non-legacy exceptions.
2307
2308         * workers/Worker.cpp:
2309         (WebCore::Worker::create): Use ExceptionOr.
2310         (WebCore::Worker::postMessage): Ditto.
2311         * workers/Worker.h: Updated for above changes.
2312         * workers/Worker.idl: Use non-legacy exception.
2313
2314         * workers/WorkerGlobalScope.cpp:
2315         (WebCore::WorkerGlobalScope::WorkerGlobalScope): Moved initialization
2316         of m_closing to class definition.
2317         (WebCore::WorkerGlobalScope::~WorkerGlobalScope): Removed call to
2318         deleted notifyObserversOfStop function.
2319         (WebCore::WorkerGlobalScope::importScripts): Use ExceptionOr. Also use
2320         reserveInitialCapacity and uncheckedAppend to build a vector.
2321         (WebCore::WorkerGlobalScope::addConsoleMessage): Use an rvalue reference.
2322         Also moved the body of one of the addMessageToWorkerConsole overloads into
2323         one of the overloads of this function, and changed the other to call addMessage.
2324         (WebCore::WorkerGlobalScope::addMessage): Moved the body of the other
2325         addMessageToWorkerConsole here.
2326         (WebCore::WorkerGlobalScope::addMessageToWorkerConsole): Deleted.
2327         (WebCore::WorkerGlobalScope::Observer::Observer): Deleted.
2328         (WebCore::WorkerGlobalScope::Observer::~Observer): Deleted.
2329         (WebCore::WorkerGlobalScope::Observer::stopObserving): Deleted.
2330         (WebCore::WorkerGlobalScope::registerObserver): Deleted.
2331         (WebCore::WorkerGlobalScope::unregisterObserver): Deleted.
2332         (WebCore::WorkerGlobalScope::notifyObserversOfStop): Deleted.
2333         * workers/WorkerGlobalScope.h: Removed unneeded includes. Moved many virtual
2334         function overrides into the private section. Marked many functions final instead
2335         of just override. Removed unused Observer class and m_workerObservers set.
2336
2337         * workers/WorkerThread.cpp:
2338         (WebCore::WorkerThread::stop): Removed call to deleted
2339         WorkerGlobalScope::notifyObserversOfStop function.
2340
2341 2016-10-21  Antti Koivisto  <antti@apple.com>
2342
2343         Tighten ComputedStyleExtractor to use Element instead of Node
2344         https://bugs.webkit.org/show_bug.cgi?id=163798
2345
2346         Reviewed by Andreas Kling.
2347
2348         Also make its functions non-const as they may compute style.
2349
2350         * css/CSSComputedStyleDeclaration.cpp:
2351         (WebCore::styleElementForNode):
2352         (WebCore::ComputedStyleExtractor::ComputedStyleExtractor):
2353
2354             If we are called with a Node figure out the style Element in constructor.
2355
2356         (WebCore::ComputedStyleExtractor::getFontSizeCSSValuePreferringKeyword):
2357         (WebCore::ComputedStyleExtractor::useFixedFontDefaultSize):
2358         (WebCore::ComputedStyleExtractor::styledElement):
2359         (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
2360         (WebCore::CSSComputedStyleDeclaration::copyProperties):
2361         (WebCore::elementOrItsAncestorNeedsStyleRecalc):
2362
2363             Use composed tree iterator for increased correctness in shadow trees.
2364
2365         (WebCore::updateStyleIfNeededForElement):
2366         (WebCore::computeRenderStyleForProperty):
2367         (WebCore::ComputedStyleExtractor::customPropertyValue):
2368         (WebCore::ComputedStyleExtractor::customPropertyText):
2369         (WebCore::ComputedStyleExtractor::propertyValue):
2370         (WebCore::CSSComputedStyleDeclaration::length):
2371         (WebCore::CSSComputedStyleDeclaration::item):
2372         (WebCore::ComputedStyleExtractor::propertyMatches):
2373         (WebCore::ComputedStyleExtractor::copyProperties):
2374         (WebCore::ComputedStyleExtractor::getCSSPropertyValuesForShorthandProperties):
2375         (WebCore::ComputedStyleExtractor::getCSSPropertyValuesForSidesShorthand):
2376         (WebCore::ComputedStyleExtractor::getCSSPropertyValuesForGridShorthand):
2377         (WebCore::ComputedStyleExtractor::copyPropertiesInSet):
2378         (WebCore::CSSComputedStyleDeclaration::getPropertyValue):
2379         (WebCore::ComputedStyleExtractor::getBackgroundShorthandValue):
2380         (WebCore::ComputedStyleExtractor::styledNode): Deleted.
2381         (WebCore::nodeOrItsAncestorNeedsStyleRecalc): Deleted.
2382         (WebCore::updateStyleIfNeededForNode): Deleted.
2383         * css/CSSComputedStyleDeclaration.h:
2384         * css/SVGCSSComputedStyleDeclaration.cpp:
2385         (WebCore::ComputedStyleExtractor::svgPropertyValue):
2386         * editing/EditingStyle.cpp:
2387         (WebCore::EditingStyle::removeEquivalentProperties):
2388         * editing/EditingStyle.h:
2389
2390 2016-10-21  Chris Dumez  <cdumez@apple.com>
2391
2392         WebGL2RenderingContext.texSubImage3D() should use a union instead of overloading
2393         https://bugs.webkit.org/show_bug.cgi?id=163792
2394
2395         Reviewed by Darin Adler.
2396
2397         WebGL2RenderingContext.texSubImage3D() should use a union instead of overloading for 
2398         - https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7 (for texSubImage3D)
2399         - https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14 (for TexImageSource)
2400
2401         * html/canvas/WebGL2RenderingContext.cpp:
2402         (WebCore::WebGL2RenderingContext::texSubImage3D):
2403         * html/canvas/WebGL2RenderingContext.h:
2404         * html/canvas/WebGL2RenderingContext.idl:
2405
2406 2016-10-21  Zalan Bujtas  <zalan@apple.com>
2407
2408         Do not mutate the render tree while collecting selection repaint rects.
2409         https://bugs.webkit.org/show_bug.cgi?id=163800
2410         <rdar://problem/28806886>
2411
2412         Reviewed by David Hyatt.
2413
2414         RenderListItem not only mutates the tree while in layout but it also uses
2415         the old descendant context to find the insertion point.
2416         This patch strictly ensures that we only do it while in layout and never
2417         in other cases such as collecting repaint rects.
2418         This gets redundant when webkit.org/b/163789 is fixed.
2419
2420         Test: fast/lists/crash-when-list-marker-is-moved-during-selection.html
2421
2422         * rendering/RenderListItem.cpp:
2423         (WebCore::RenderListItem::insertOrMoveMarkerRendererIfNeeded):
2424
2425 2016-10-21  Dave Hyatt  <hyatt@apple.com>
2426
2427         [CSS Parser] Support horizontal-bt writing mode
2428         https://bugs.webkit.org/show_bug.cgi?id=163797
2429
2430         Reviewed by Zalan Bujtas.
2431
2432         * css/parser/CSSParserFastPaths.cpp:
2433         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
2434
2435 2016-10-20  Brent Fulgham  <bfulgham@apple.com>
2436
2437         [Win][Direct2D] Correct some memory leaks and other minor bugs
2438         https://bugs.webkit.org/show_bug.cgi?id=163769
2439
2440         Reviewed by Alex Christensen.
2441
2442         Several D2D handles were being leaked.
2443  
2444         Direct2D sometimes returns an infinite rect containing { -inf, -inf, FloatMax, FloatMax },
2445         sometimes { -FloatMax, -FloatMax, inf, inf }, and various combinations thereof. This caused
2446         most SVG drawing to decide no screen rect was contained in the "infinite rect" so nothing
2447         would be drawn.
2448         
2449         Tested by existing layout tests. 
2450
2451         * platform/graphics/GraphicsContext.h:
2452         * platform/graphics/win/FloatRectDirect2D.cpp:
2453         (WebCore::isInfiniteRect): Recognize various infinite rects in Windows.
2454         (WebCore::FloatRect::FloatRect): Convert a Windows infinite rect to the style
2455         we use inside WebKit.
2456         * platform/graphics/win/FontCascadeDirect2D.cpp:
2457         (WebCore::FontCascade::drawGlyphs): Use cached brushes if possible.
2458         * platform/graphics/win/GlyphPageTreeNodeDirect2D.cpp:
2459         (WebCore::GlyphPage::fill): Don't terminate on this error case.
2460         * platform/graphics/win/GradientDirect2D.cpp:
2461         (WebCore::Gradient::generateGradient): Don't leak gradients.
2462         * platform/graphics/win/GraphicsContextDirect2D.cpp:
2463         (WebCore::GraphicsContextPlatformPrivate::brushWithColor): Added.
2464         (WebCore::GraphicsContext::brushWithColor): Added.
2465         (WebCore::GraphicsContextPlatformPrivate::concatCTM): Perform transform multiplication
2466         in the right order (hint: it's not distributive).
2467         (WebCore::GraphicsContext::drawWithShadow): Use convenience method.
2468         (WebCore::GraphicsContext::fillRect): Ditto.
2469         (WebCore::GraphicsContext::platformFillRoundedRect): Ditto.
2470         (WebCore::GraphicsContext::clearRect): Ditto.
2471         (WebCore::GraphicsContext::setPlatformStrokeColor): Ditto.
2472         (WebCore::GraphicsContext::setPlatformFillColor): Ditto.
2473         * platform/graphics/win/PathDirect2D.cpp:
2474         (WebCore::Path::polygonPathFromPoints): No need to convert manually.
2475         (WebCore::Path::~Path): Don't leak ID2D1Geometry entities.
2476         (WebCore::Path::appendGeometry): Ditto.
2477         (WebCore::Path::createGeometryWithFillMode): Ditto.
2478         (WebCore::Path::Path): Ditto.
2479         (WebCore::Path::operator=): Ditto.
2480         (WebCore::Path::strokeBoundingRect): Provide an implementation.
2481         (WebCore::Path::addRect): No need for manual casting here.
2482
2483 2016-10-21  Wenson Hsieh  <wenson_hsieh@apple.com>
2484
2485         Fix minor style issue in the signature of StaticRange::create
2486         https://bugs.webkit.org/show_bug.cgi?id=163786
2487         <rdar://problem/28853079>
2488
2489         Reviewed by Alex Christensen.
2490
2491         Change `Ref<WebCore::Node> &&` to `Ref<Node>&&`.
2492
2493         * dom/StaticRange.cpp:
2494         (WebCore::StaticRange::create):
2495
2496 2016-10-21  Dave Hyatt  <hyatt@apple.com>
2497
2498         [CSS Parser] Add support for -webkit-line-box-contain
2499         https://bugs.webkit.org/show_bug.cgi?id=163794
2500
2501         Reviewed by Zalan Bujtas.
2502
2503         * css/parser/CSSPropertyParser.cpp:
2504         (WebCore::consumeLineBoxContain):
2505         (WebCore::CSSPropertyParser::parseSingleValue):
2506
2507 2016-10-21  Dave Hyatt  <hyatt@apple.com>
2508
2509         [CSS Parser] Add support for @-webkit-region rules
2510         https://bugs.webkit.org/show_bug.cgi?id=163787
2511
2512         Reviewed by Zalan Bujtas.
2513
2514         * css/StyleRule.cpp:
2515         (WebCore::StyleRuleRegion::StyleRuleRegion):
2516         * css/StyleRule.h:
2517         * css/parser/CSSAtRuleID.cpp:
2518         (WebCore::cssAtRuleID):
2519         * css/parser/CSSAtRuleID.h:
2520         * css/parser/CSSParserImpl.cpp:
2521         (WebCore::CSSParserImpl::consumeAtRule):
2522         (WebCore::CSSParserImpl::consumePageRule):
2523         (WebCore::CSSParserImpl::consumeRegionRule):
2524         * css/parser/CSSParserImpl.h:
2525
2526 2016-10-21  David Kilzer  <ddkilzer@apple.com>
2527
2528         Bug 163757: Use IntSize::unclampedArea() in PDFDocumentImage::updateCachedImageIfNeeded()
2529         <https://webkit.org/b/163757>
2530
2531         Reviewed by Brent Fulgham.
2532
2533         No new tests since there is no change in nominal behavior.
2534
2535         * platform/graphics/cg/PDFDocumentImage.cpp:
2536         (WebCore::PDFDocumentImage::updateCachedImageIfNeeded): Use
2537         IntSize::unclampedArea() where manual calculations were used
2538         previously.  Also gets rid of more safeCast<size_t>() use.
2539
2540 2016-10-21  Chris Dumez  <cdumez@apple.com>
2541
2542         [Web IDL] Support unions in our overload resolution algorithm
2543         https://bugs.webkit.org/show_bug.cgi?id=163764
2544
2545         Reviewed by Darin Adler.
2546
2547         Support unions in our overload resolution algorithm as per:
2548         - https://heycam.github.io/webidl/#es-overloads
2549         - https://heycam.github.io/webidl/#dfn-distinguishable
2550
2551         * bindings/scripts/CodeGeneratorJS.pm:
2552         (IsIDLTypeDistinguishableWithUnionForOverloadResolution):
2553         (AreTypesDistinguishableForOverloadResolution):
2554         (GetOverloadThatMatches):
2555         (GenerateOverloadedFunctionOrConstructor):
2556         * bindings/scripts/test/JS/JSTestObj.cpp:
2557         * bindings/scripts/test/TestObj.idl:
2558
2559 2016-10-21  Chris Dumez  <cdumez@apple.com>
2560
2561         AudioNode.connect(): First parameter should not be nullable
2562         https://bugs.webkit.org/show_bug.cgi?id=163773
2563
2564         Reviewed by Darin Adler.
2565
2566         AudioNode.connect()'s first parameter should not be nullable:
2567         - https://webaudio.github.io/web-audio-api/#idl-def-AudioNode.
2568
2569         We were throwing a SYNTAX_ERR when passing null, we now throw
2570         a TypeError instead.
2571
2572         No new tests, updated existing test.
2573
2574         * Modules/webaudio/AudioBasicInspectorNode.cpp:
2575         (WebCore::AudioBasicInspectorNode::connect):
2576         * Modules/webaudio/AudioBasicInspectorNode.h:
2577         * Modules/webaudio/AudioNode.cpp:
2578         (WebCore::AudioNode::connect):
2579         * Modules/webaudio/AudioNode.h:
2580         * Modules/webaudio/AudioNode.idl:
2581
2582 2016-10-21  Wenson Hsieh  <wenson_hsieh@apple.com>
2583
2584         Implement InputEvent.getTargetRanges() for the input events spec
2585         https://bugs.webkit.org/show_bug.cgi?id=162947
2586         <rdar://problem/28853079>
2587
2588         Reviewed by Darin Adler.
2589
2590         Implements InputEvent.getTargetRanges(). See individual method changes below for more details. Adds a new hook
2591         for subclasses of CompositeEditCommand to vend a list of target StaticRanges when retrieving target ranges for
2592         an editing command on a contenteditable area.
2593
2594         Tests: fast/events/before-input-delete-empty-list-target-ranges.html
2595                fast/events/before-input-delete-text-target-ranges.html
2596                fast/events/before-input-replace-text-target-ranges.html
2597
2598         * CMakeLists.txt:
2599         * DerivedSources.make:
2600         * WebCore.xcodeproj/project.pbxproj:
2601
2602         Add StaticRange.idl, StaticRange.cpp and StaticRange.h.
2603
2604         * bindings/generic/RuntimeEnabledFeatures.h:
2605         (WebCore::RuntimeEnabledFeatures::setInputEventsEnabled):
2606         (WebCore::RuntimeEnabledFeatures::inputEventsEnabled):
2607
2608         Add a new runtime bindings flag for InputEvents and guard both InputEvent and StaticRange behind it.
2609
2610         * dom/DOMAllInOne.cpp:
2611         * dom/InputEvent.cpp:
2612         (WebCore::InputEvent::InputEvent):
2613         * dom/InputEvent.h:
2614         * dom/InputEvent.idl:
2615         * dom/StaticRange.cpp: Copied from Source/WebCore/dom/InputEvent.cpp.
2616         (WebCore::StaticRange::StaticRange):
2617         (WebCore::StaticRange::create):
2618         (WebCore::StaticRange::createFromRange):
2619
2620         Convenience method for creating a StaticRange from a Range's start/end container and offset.
2621
2622         (WebCore::StaticRange::startContainer):
2623         (WebCore::StaticRange::endContainer):
2624         (WebCore::StaticRange::collapsed):
2625         * dom/StaticRange.h: Copied from Source/WebCore/dom/InputEvent.cpp.
2626         (WebCore::StaticRange::startOffset):
2627         (WebCore::StaticRange::endOffset):
2628         * dom/StaticRange.idl: Copied from Source/WebCore/editing/ReplaceRangeWithTextCommand.h.
2629         * editing/CompositeEditCommand.cpp:
2630         (WebCore::CompositeEditCommand::willApplyCommand):
2631         (WebCore::CompositeEditCommand::targetRanges):
2632
2633         Virtual method that returns a list of target ranges which are associated with this command.
2634
2635         (WebCore::CompositeEditCommand::targetRangesForBindings):
2636
2637         Non-virtual method that calls the above targetRanges(). Takes whether or not the CompositeEditCommand is editing
2638         a textarea or plain text input into account.
2639
2640         (WebCore::CompositeEditCommand::moveParagraphs):
2641         * editing/CompositeEditCommand.h:
2642         * editing/EditCommand.cpp:
2643         (WebCore::EditCommand::frame):
2644         * editing/EditCommand.h:
2645         (WebCore::EditCommand::document):
2646         * editing/Editor.cpp:
2647         (WebCore::dispatchBeforeInputEvent):
2648         (WebCore::dispatchInputEvent):
2649         (WebCore::dispatchBeforeInputEvents):
2650
2651         Changed the `beforeinput` event dispatch to use the regular Node::dispatchEvent instead of dispatchScopedEvent.
2652         This is because if the page prevents the `beforeinput` event, we need to know immediately in order to bail from
2653         the default action.
2654
2655         (WebCore::dispatchInputEvents):
2656         (WebCore::Editor::willApplyEditing):
2657
2658         Added a list of static ranges as a parameter when calling on the Editor to dispatch `beforeinput` events.
2659         By default, this uses the composite edit command's targetRangesForBindings(), though it may be special cased
2660         by subclasses of CompositeEditCommand (see ReplaceRangeWithTextCommand, SpellingCorrectionCommand, and
2661         TypingCommand).
2662
2663         * editing/Editor.h:
2664         * editing/ReplaceRangeWithTextCommand.cpp:
2665         (WebCore::ReplaceRangeWithTextCommand::targetRanges):
2666         * editing/ReplaceRangeWithTextCommand.h:
2667         * editing/SpellingCorrectionCommand.cpp:
2668         (WebCore::SpellingCorrectionCommand::targetRanges):
2669         * editing/SpellingCorrectionCommand.h:
2670         * editing/TypingCommand.cpp:
2671         (WebCore::editActionIsDeleteByTyping):
2672         (WebCore::TypingCommand::shouldDeferWillApplyCommandUntilAddingTypingCommand):
2673         (WebCore::TypingCommand::willApplyCommand):
2674         (WebCore::TypingCommand::willAddTypingToOpenCommand):
2675         (WebCore::TypingCommand::deleteKeyPressed):
2676         (WebCore::TypingCommand::forwardDeleteKeyPressed):
2677
2678         Moves the firing of the `beforeinput` until after the selection range to delete has been computed.
2679
2680         * editing/TypingCommand.h:
2681
2682 2016-10-21  Antti Koivisto  <antti@apple.com>
2683
2684         Style resolver should be updated lazily
2685         https://bugs.webkit.org/show_bug.cgi?id=163721
2686
2687         Reviewed by Andreas Kling.
2688
2689         Currently when stylesheets change in some way we generally update style resolvers and
2690         invalidate style immediately. We should do this lazily to avoid unnecessary work.
2691
2692         Also improve naming of the stylesheet invalidation functions and use more optimal functions in some places.
2693
2694         * css/CSSComputedStyleDeclaration.cpp:
2695         (WebCore::updateStyleIfNeededForNode):
2696         * css/CSSStyleSheet.cpp:
2697         (WebCore::CSSStyleSheet::didMutateRules):
2698         (WebCore::CSSStyleSheet::didMutate):
2699         (WebCore::CSSStyleSheet::setDisabled):
2700         * css/StyleResolver.cpp:
2701         (WebCore::StyleResolver::StyleResolver):
2702
2703             Initialize root style font with null font selector.
2704             This avoids hitting a CSSFontSelector assert in fast/media/mq-relative-constraints-08.html where
2705             media query evaluation requires font information before it is ready.
2706             Exposed by increased laziness in this patch.
2707
2708         * dom/Document.cpp:
2709         (WebCore::Document::setContentLanguage):
2710         (WebCore::Document::updateLayoutIgnorePendingStylesheets):
2711         (WebCore::Document::isPageBoxVisible):
2712         (WebCore::Document::pageSizeAndMarginsInPixels):
2713         (WebCore::Document::processHttpEquiv):
2714         (WebCore::Document::setSelectedStylesheetSet):
2715         (WebCore::Document::didInsertInDocumentShadowRoot):
2716         (WebCore::Document::didRemoveInDocumentShadowRoot):
2717         * dom/Document.h:
2718         (WebCore::Document::inDocumentShadowRoots):
2719
2720             Track all shadow roots in the document. This allows us to find and flush style scopes cheaply.
2721
2722         * dom/Element.cpp:
2723         (WebCore::Element::computedStyle):
2724         * dom/ExtensionStyleSheets.cpp:
2725         (WebCore::ExtensionStyleSheets::ExtensionStyleSheets):
2726         (WebCore::ExtensionStyleSheets::clearPageUserSheet):
2727         (WebCore::ExtensionStyleSheets::updatePageUserSheet):
2728         (WebCore::ExtensionStyleSheets::invalidateInjectedStyleSheetCache):
2729         (WebCore::ExtensionStyleSheets::addUserStyleSheet):
2730         (WebCore::ExtensionStyleSheets::addAuthorStyleSheetForTesting):
2731         (WebCore::ExtensionStyleSheets::addDisplayNoneSelector):
2732         (WebCore::ExtensionStyleSheets::maybeAddContentExtensionSheet):
2733         (WebCore::ExtensionStyleSheets::styleResolverChangedTimerFired): Deleted.
2734
2735             Since updates are now done lazily we don't need a special timer for extension stylesheets.
2736
2737         * dom/ExtensionStyleSheets.h:
2738         * dom/ProcessingInstruction.cpp:
2739         (WebCore::ProcessingInstruction::checkStyleSheet):
2740         (WebCore::ProcessingInstruction::sheetLoaded):
2741         (WebCore::ProcessingInstruction::removedFrom):
2742         * dom/ShadowRoot.cpp:
2743         (WebCore::ShadowRoot::ShadowRoot):
2744         (WebCore::ShadowRoot::insertedInto):
2745         (WebCore::ShadowRoot::removedFrom):
2746         (WebCore::ShadowRoot::styleScope):
2747         * dom/ShadowRoot.h:
2748         * html/HTMLLinkElement.cpp:
2749         (WebCore::HTMLLinkElement::setDisabledState):
2750         (WebCore::HTMLLinkElement::parseAttribute):
2751         (WebCore::HTMLLinkElement::process):
2752         (WebCore::HTMLLinkElement::removePendingSheet):
2753         * html/HTMLStyleElement.cpp:
2754         (WebCore::HTMLStyleElement::parseAttribute):
2755         * inspector/InspectorCSSAgent.cpp:
2756         (WebCore::InspectorCSSAgent::createInspectorStyleSheetForDocument):
2757         (WebCore::InspectorCSSAgent::forcePseudoState):
2758         (WebCore::InspectorCSSAgent::resetPseudoStates):
2759         * inspector/InspectorPageAgent.cpp:
2760         (WebCore::InspectorPageAgent::setEmulatedMedia):
2761         * page/Frame.cpp:
2762         (WebCore::Frame::setPrinting):
2763         * page/FrameView.cpp:
2764         (WebCore::FrameView::layout):
2765         (WebCore::FrameView::setPagination):
2766         (WebCore::FrameView::setViewportSizeForCSSViewportUnits):
2767         * page/Page.cpp:
2768         (WebCore::Page::setViewMode):
2769         (WebCore::Page::setNeedsRecalcStyleInAllFrames):
2770         (WebCore::Page::invalidateInjectedStyleSheetCacheInAllFrames):
2771         * style/StyleScope.cpp:
2772         (WebCore::Style::Scope::setPreferredStylesheetSetName):
2773         (WebCore::Style::Scope::setSelectedStylesheetSetName):
2774         (WebCore::Style::Scope::removePendingSheet):
2775         (WebCore::Style::Scope::removeStyleSheetCandidateNode):
2776         (WebCore::Style::Scope::activeStyleSheetsForInspector):
2777         (WebCore::Style::Scope::flushPendingUpdate):
2778
2779             Also flush descendant shadow roots.
2780
2781         (WebCore::Style::Scope::scheduleUpdate):
2782         (WebCore::Style::Scope::didChangeActiveStyleSheetCandidates):
2783
2784             Make lazy.
2785
2786         (WebCore::Style::Scope::didChangeStyleSheetContents):
2787
2788             Make lazy.
2789
2790         (WebCore::Style::Scope::didChangeStyleSheetEnvironment):
2791
2792             Environment changes also affect author shadow roots.
2793
2794         (WebCore::Style::Scope::styleSheetsForStyleSheetList):
2795         (WebCore::Style::Scope::scheduleActiveSetUpdate): Deleted.
2796         (WebCore::Style::Scope::didChangeCandidatesForActiveSet): Deleted.
2797         (WebCore::Style::Scope::didChangeContentsOrInterpretation): Deleted.
2798
2799             Improved naming of these and split didChangeContentsOrInterpretation into two separate functions.
2800
2801         * style/StyleScope.h:
2802         (WebCore::Style::Scope::styleSheetsForStyleSheetList): Deleted.
2803         (WebCore::Style::Scope::setPreferredStylesheetSetName): Deleted.
2804         (WebCore::Style::Scope::setSelectedStylesheetSetName): Deleted.
2805         * svg/SVGFontFaceElement.cpp:
2806         (WebCore::SVGFontFaceElement::rebuildFontFace):
2807         (WebCore::SVGFontFaceElement::removedFrom):
2808         * testing/Internals.cpp:
2809         (WebCore::Internals::resetToConsistentState):
2810
2811             Ensure that cationsStyleSheetOverride really becomes empty. Some tests rely on not having suprise
2812             inserted stylesheets. Previously this was racy and the patch affected order of things.
2813
2814         (WebCore::Internals::styleChangeType):
2815         * xml/XMLTreeViewer.cpp:
2816         (WebCore::XMLTreeViewer::transformDocumentToTreeView):
2817         * xml/parser/XMLDocumentParser.cpp:
2818         (WebCore::XMLDocumentParser::end):
2819         * xml/parser/XMLDocumentParserLibxml2.cpp:
2820         (WebCore::XMLDocumentParser::doEnd):
2821
2822 2016-10-21  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Adam Bergkvist  <adam.bergkvist@ericsson.com>
2823
2824         WebRTC: [OpenWebRTC] Move SDPProcessorScriptResource(Gtk) to openwebrtc directory
2825         https://bugs.webkit.org/show_bug.cgi?id=163778
2826
2827         Reviewed by Philippe Normand.
2828
2829         Move SDPProcessorScriptResourceGtk from the platform gtk directory to the port generic
2830         openwebrtc directory to make it usable by other ports. Also drop the Gtk-suffix.
2831
2832         No change of behavior.
2833
2834         * PlatformGTK.cmake:
2835         * platform/mediastream/gtk/SDPProcessorScriptResourceGtk.cpp:
2836         (WebCore::SDPProcessorScriptResource::scriptString): Deleted.
2837         * platform/mediastream/openwebrtc/SDPProcessorScriptResource.cpp: Renamed from Source/WebCore/platform/mediastream/gtk/SDPProcessorScriptResourceGtk.cpp.
2838         (WebCore::SDPProcessorScriptResource::scriptString):
2839
2840 2016-10-21  Miguel Gomez  <magomez@igalia.com>
2841
2842         [GTK] Several tests crashing on debug bot in (anonymous namespace)::MediaPlayerPrivateGStreamerBase::repaint
2843         https://bugs.webkit.org/show_bug.cgi?id=163511
2844
2845         Reviewed by Carlos Garcia Campos.
2846
2847         Perform the video repaint in the main thread when accelerated compositing is disabled. Added a new method to
2848         MediaPlayerClient to get whether accelerated compositing is enabled from the MediaPlayer. This is needed
2849         because mediaPlayerAcceleratedCompositingEnabled() will return false while HTMLMediaElement doesn't have a
2850         RenderVideo, even when accelerated compositing is enabled.
2851
2852         Covered by existent tests.
2853
2854         * html/HTMLMediaElement.cpp:
2855         (WebCore::HTMLMediaElement::mediaPlayerAcceleratedCompositingEnabled):
2856         * html/HTMLMediaElement.h:
2857         * platform/graphics/MediaPlayer.h:
2858         (WebCore::MediaPlayerClient::mediaPlayerAcceleratedCompositingEnabled):
2859         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2860         (WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase):
2861         (WebCore::MediaPlayerPrivateGStreamerBase::repaint):
2862         (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
2863         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2864
2865 2016-10-21  Adam Bergkvist  <adam.bergkvist@ericsson.com>
2866
2867         WebRTC: [GTK] Add MediaEndpointOwr - an OpenWebRTC WebRTC backend
2868         https://bugs.webkit.org/show_bug.cgi?id=163327
2869
2870         Reviewed by Philippe Normand.
2871
2872         Add MediaEndpointOwr which is a MediaEndpoint implementation (WebRTC backend) based on
2873         OpenWebRTC [1]. The WebRTC backend can be tested with a manual test. Automatic testing
2874         is still done with MockMediaEndpoint.
2875
2876         [1] http://www.openwebrtc.org/
2877
2878         Testing: Added manual test (webrtc-one-tab-p2p.html)
2879
2880         * CMakeLists.txt:
2881         * platform/GStreamer.cmake:
2882         * platform/mediastream/openwebrtc/MediaEndpointOwr.cpp: Added.
2883         (WebCore::createMediaEndpointOwr):
2884         (WebCore::MediaEndpointOwr::MediaEndpointOwr):
2885         (WebCore::MediaEndpointOwr::~MediaEndpointOwr):
2886         (WebCore::MediaEndpointOwr::setConfiguration):
2887         (WebCore::cryptoDataCallback):
2888         (WebCore::MediaEndpointOwr::generateDtlsInfo):
2889         (WebCore::MediaEndpointOwr::getDefaultAudioPayloads):
2890         (WebCore::MediaEndpointOwr::getDefaultVideoPayloads):
2891         (WebCore::payloadsContainType):
2892         (WebCore::MediaEndpointOwr::filterPayloads):
2893         (WebCore::MediaEndpointOwr::updateReceiveConfiguration):
2894         (WebCore::findRtxPayload):
2895         (WebCore::MediaEndpointOwr::updateSendConfiguration):
2896         (WebCore::MediaEndpointOwr::addRemoteCandidate):
2897         (WebCore::MediaEndpointOwr::replaceMutedRemoteSourceMid):
2898         (WebCore::MediaEndpointOwr::createMutedRemoteSource):
2899         (WebCore::MediaEndpointOwr::replaceSendSource):
2900         (WebCore::MediaEndpointOwr::stop):
2901         (WebCore::MediaEndpointOwr::transceiverIndexForSession):
2902         (WebCore::MediaEndpointOwr::sessionMid):
2903         (WebCore::MediaEndpointOwr::matchTransceiverByMid):
2904         (WebCore::MediaEndpointOwr::dispatchNewIceCandidate):
2905         (WebCore::MediaEndpointOwr::dispatchGatheringDone):
2906         (WebCore::MediaEndpointOwr::processIceTransportStateChange):
2907         (WebCore::MediaEndpointOwr::dispatchDtlsFingerprint):
2908         (WebCore::MediaEndpointOwr::unmuteRemoteSource):
2909         (WebCore::MediaEndpointOwr::prepareSession):
2910         (WebCore::MediaEndpointOwr::prepareMediaSession):
2911         (WebCore::parseHelperServerUrl):
2912         (WebCore::MediaEndpointOwr::ensureTransportAgentAndTransceivers):
2913         (WebCore::MediaEndpointOwr::internalAddRemoteCandidate):
2914         (WebCore::gotCandidate):
2915         (WebCore::candidateGatheringDone):
2916         (WebCore::iceConnectionStateChange):
2917         (WebCore::gotIncomingSource):
2918         * platform/mediastream/openwebrtc/MediaEndpointOwr.h: Added.
2919         (WebCore::OwrTransceiver::create):
2920         (WebCore::OwrTransceiver::~OwrTransceiver):
2921         (WebCore::OwrTransceiver::mid):
2922         (WebCore::OwrTransceiver::session):
2923         (WebCore::OwrTransceiver::owrIceState):
2924         (WebCore::OwrTransceiver::setOwrIceState):
2925         (WebCore::OwrTransceiver::gotEndOfRemoteCandidates):
2926         (WebCore::OwrTransceiver::markGotEndOfRemoteCandidates):
2927         (WebCore::OwrTransceiver::OwrTransceiver):
2928         * platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.h:
2929         (WebCore::RealtimeMediaSourceOwr::RealtimeMediaSourceOwr):
2930         (WebCore::RealtimeMediaSourceOwr::swapOutShallowSource):
2931         Add support for an initially muted source. This is used for early
2932         creation of remote sources.
2933
2934 2016-10-21  Javier Fernandez  <jfernandez@igalia.com>
2935
2936         [css-grid] Content Alignment broken with indefinite sized grid container
2937         https://bugs.webkit.org/show_bug.cgi?id=163724
2938
2939         Reviewed by Manuel Rego Casasnovas.
2940
2941         The Grid Tracks sizing algorithm receives as parameter the
2942         available space to be used as space for tracks. We hold a variable
2943         to store the remaining free space for each dimension.
2944
2945         When the grid container size is indefinite we can't compute the
2946         available free space after computing track sizes until such
2947         indefinite size is resolved.
2948
2949         No new tests, just added some additional test cases.
2950
2951         * rendering/RenderGrid.cpp:
2952         (WebCore::RenderGrid::layoutBlock): Compute freeSpace for Rows
2953         after doing layout and resolving the indefinite height.
2954
2955 2016-10-21  Jer Noble  <jer.noble@apple.com>
2956
2957         CRASH in SourceBuffer::sourceBufferPrivateDidReceiveSample + 2169
2958         https://bugs.webkit.org/show_bug.cgi?id=163735
2959
2960         Reviewed by Eric Carlson.
2961
2962         Test: media/media-source/media-source-sample-wrong-track-id.html
2963
2964         When SourceBuffer receives a sample in sourceBufferPrivateDidReceiveSample() containing
2965         a trackID not previously seen in an initialization segment, it creates a default TrackBuffer
2966         object to contain that track's samples. One of the fields in TrackBuffer, description, is
2967         normally filled out when an initialization segment is received, but with this default
2968         TrackBuffer, it's still null when it's checked later in sourceBufferPrivateDidReceiveSample().
2969
2970         Rather than adding a null-check on trackBuffer.description, drop any sample that has a 
2971         trackID which was not present during a previous initialization segment.
2972
2973         * Modules/mediasource/SourceBuffer.cpp:
2974         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
2975
2976 2016-10-20  Carlos Garcia Campos  <cgarcia@igalia.com>
2977
2978         [GTK] Configures but fails to link with ENABLE_OPENGL=OFF
2979         https://bugs.webkit.org/show_bug.cgi?id=163449
2980
2981         Reviewed by Michael Catanzaro.
2982
2983         Only define sharingGLContext in PlatformDisplay if EGL or GLX are enabled.
2984
2985         * platform/graphics/PlatformDisplay.cpp:
2986         * platform/graphics/PlatformDisplay.h:
2987         * platform/graphics/wayland/PlatformDisplayWayland.cpp:
2988         (WebCore::PlatformDisplayWayland::initialize):
2989         * platform/graphics/x11/PlatformDisplayX11.cpp:
2990         (WebCore::PlatformDisplayX11::~PlatformDisplayX11):
2991
2992 2016-10-20  Filip Pizlo  <fpizlo@apple.com>
2993
2994         The tracking of the coarse-grain Heap state (allocating or not, collector or not, eden vs full) should respect the orthogonality between allocating and collecting
2995         https://bugs.webkit.org/show_bug.cgi?id=163738
2996
2997         Reviewed by Geoffrey Garen.
2998
2999         No new tests because no change in behavior.
3000
3001         * bindings/js/GCController.cpp:
3002         (WebCore::GCController::garbageCollectNow):
3003
3004 2016-10-20  Chris Dumez  <cdumez@apple.com>
3005
3006         [Bindings] Start using signature->idlType instead of signature->type in the overload resolution code
3007         https://bugs.webkit.org/show_bug.cgi?id=163767
3008
3009         Reviewed by Darin Adler.
3010
3011         Start using signature->idlType instead of signature->type in the overload resolution code
3012         to prepare for union type support.
3013
3014         * bindings/scripts/CodeGeneratorJS.pm:
3015         (ComputeEffectiveOverloadSet):
3016         (AreTypesDistinguishableForOverloadResolution):
3017         (GetDistinguishingArgumentIndex):
3018         (GetOverloadThatMatches):
3019         (GenerateOverloadedFunctionOrConstructor):
3020
3021 2016-10-20  Myles C. Maxfield  <mmaxfield@apple.com>
3022
3023         Implement WebGL2 bufferData() and bufferSubData() methods
3024         https://bugs.webkit.org/show_bug.cgi?id=163759
3025
3026         Reviewed by Dean Jackson.
3027
3028         These new overloads simply clip the input array buffer.
3029
3030         Test: fast/canvas/webgl/bufferData-offset-length.html
3031
3032         * html/canvas/WebGL2RenderingContext.cpp:
3033         (WebCore::WebGL2RenderingContext::bufferData):
3034         (WebCore::WebGL2RenderingContext::bufferSubData):
3035         * html/canvas/WebGL2RenderingContext.h:
3036         * html/canvas/WebGL2RenderingContext.idl:
3037
3038 2016-10-20  Chris Dumez  <cdumez@apple.com>
3039
3040         "Download Linked File" context menu action should use 'download' attribute as suggested filename
3041         https://bugs.webkit.org/show_bug.cgi?id=163742
3042         <rdar://problem/28840734>
3043
3044         Reviewed by Darin Adler.
3045
3046         Add convenience method to HitTestResult to return the URL element's
3047         download attribute.
3048
3049         * rendering/HitTestResult.cpp:
3050         (WebCore::HitTestResult::URLElementDownloadAttribute):
3051         * rendering/HitTestResult.h:
3052
3053 2016-10-20  Nan Wang  <n_wang@apple.com>
3054
3055         AX: VoiceOver is not detecting ARIA treeview if it contains role="presentation"
3056         https://bugs.webkit.org/show_bug.cgi?id=163763
3057
3058         Reviewed by Chris Fleizach.
3059
3060         Test: accessibility/mac/aria-tree-with-presentation-role.html
3061
3062         Web authors sometimes use presentation role in the aria tree to hide elements. We should
3063         consider this a valid case if they specify tree items and groups correctly.
3064
3065         * accessibility/AccessibilityNodeObject.cpp:
3066         (WebCore::AccessibilityNodeObject::hierarchicalLevel):
3067         * accessibility/AccessibilityTree.cpp:
3068         (WebCore::AccessibilityTree::nodeHasTreeItemChild):
3069         (WebCore::AccessibilityTree::isTreeValid):
3070         * accessibility/AccessibilityTree.h:
3071
3072 2016-10-20  Myles C. Maxfield  <mmaxfield@apple.com>
3073
3074         Many WebGL functions which don't throw are marked as possibly throwing
3075         https://bugs.webkit.org/show_bug.cgi?id=163747
3076
3077         Reviewed by Dean Jackson.
3078
3079         Mechanically remove the exception code.
3080
3081         No new tests because there is no behavior change.
3082
3083         * bindings/js/JSWebGLRenderingContextBaseCustom.cpp:
3084         (WebCore::getObjectParameter):
3085         (WebCore::JSWebGLRenderingContextBase::getAttachedShaders):
3086         (WebCore::JSWebGLRenderingContextBase::getProgramParameter):
3087         (WebCore::JSWebGLRenderingContextBase::getShaderParameter):
3088         (WebCore::JSWebGLRenderingContextBase::getUniform):
3089         (WebCore::dataFunctionf):
3090         (WebCore::dataFunctioni):
3091         (WebCore::dataFunctionMatrix):
3092         * html/canvas/WebGL2RenderingContext.cpp:
3093         (WebCore::WebGL2RenderingContext::texSubImage2D):
3094         * html/canvas/WebGLRenderingContext.cpp:
3095         (WebCore::WebGLRenderingContext::texSubImage2D):
3096         * html/canvas/WebGLRenderingContextBase.cpp:
3097         (WebCore::WebGLRenderingContextBase::activeTexture):
3098         (WebCore::WebGLRenderingContextBase::attachShader):
3099         (WebCore::WebGLRenderingContextBase::bindAttribLocation):
3100         (WebCore::WebGLRenderingContextBase::bindBuffer):
3101         (WebCore::WebGLRenderingContextBase::bindFramebuffer):
3102         (WebCore::WebGLRenderingContextBase::bindRenderbuffer):
3103         (WebCore::WebGLRenderingContextBase::bindTexture):
3104         (WebCore::WebGLRenderingContextBase::bufferData):
3105         (WebCore::WebGLRenderingContextBase::bufferSubData):
3106         (WebCore::WebGLRenderingContextBase::compileShader):
3107         (WebCore::WebGLRenderingContextBase::createShader):
3108         (WebCore::WebGLRenderingContextBase::detachShader):
3109         (WebCore::WebGLRenderingContextBase::disableVertexAttribArray):
3110         (WebCore::WebGLRenderingContextBase::drawArrays):
3111         (WebCore::WebGLRenderingContextBase::drawElements):
3112         (WebCore::WebGLRenderingContextBase::enableVertexAttribArray):
3113         (WebCore::WebGLRenderingContextBase::framebufferRenderbuffer):
3114         (WebCore::WebGLRenderingContextBase::framebufferTexture2D):
3115         (WebCore::WebGLRenderingContextBase::getActiveAttrib):
3116         (WebCore::WebGLRenderingContextBase::getActiveUniform):
3117         (WebCore::WebGLRenderingContextBase::getAttachedShaders):
3118         (WebCore::WebGLRenderingContextBase::getBufferParameter):
3119         (WebCore::WebGLRenderingContextBase::getProgramParameter):
3120         (WebCore::WebGLRenderingContextBase::getProgramInfoLog):
3121         (WebCore::WebGLRenderingContextBase::getRenderbufferParameter):
3122         (WebCore::WebGLRenderingContextBase::getShaderParameter):
3123         (WebCore::WebGLRenderingContextBase::getShaderInfoLog):
3124         (WebCore::WebGLRenderingContextBase::getShaderPrecisionFormat):
3125         (WebCore::WebGLRenderingContextBase::getShaderSource):
3126         (WebCore::WebGLRenderingContextBase::getTexParameter):
3127         (WebCore::WebGLRenderingContextBase::getUniform):
3128         (WebCore::WebGLRenderingContextBase::getUniformLocation):
3129         (WebCore::WebGLRenderingContextBase::getVertexAttrib):
3130         (WebCore::WebGLRenderingContextBase::linkProgram):
3131         (WebCore::WebGLRenderingContextBase::readPixels):
3132         (WebCore::WebGLRenderingContextBase::shaderSource):
3133         (WebCore::WebGLRenderingContextBase::videoFrameToImage):
3134         (WebCore::WebGLRenderingContextBase::texImage2D):
3135         (WebCore::WebGLRenderingContextBase::uniform1f):
3136         (WebCore::WebGLRenderingContextBase::uniform1fv):
3137         (WebCore::WebGLRenderingContextBase::uniform1i):
3138         (WebCore::WebGLRenderingContextBase::uniform1iv):
3139         (WebCore::WebGLRenderingContextBase::uniform2f):
3140         (WebCore::WebGLRenderingContextBase::uniform2fv):
3141         (WebCore::WebGLRenderingContextBase::uniform2i):
3142         (WebCore::WebGLRenderingContextBase::uniform2iv):
3143         (WebCore::WebGLRenderingContextBase::uniform3f):
3144         (WebCore::WebGLRenderingContextBase::uniform3fv):
3145         (WebCore::WebGLRenderingContextBase::uniform3i):
3146         (WebCore::WebGLRenderingContextBase::uniform3iv):
3147         (WebCore::WebGLRenderingContextBase::uniform4f):
3148         (WebCore::WebGLRenderingContextBase::uniform4fv):
3149         (WebCore::WebGLRenderingContextBase::uniform4i):
3150         (WebCore::WebGLRenderingContextBase::uniform4iv):
3151         (WebCore::WebGLRenderingContextBase::uniformMatrix2fv):
3152         (WebCore::WebGLRenderingContextBase::uniformMatrix3fv):
3153         (WebCore::WebGLRenderingContextBase::uniformMatrix4fv):
3154         (WebCore::WebGLRenderingContextBase::useProgram):
3155         (WebCore::WebGLRenderingContextBase::validateProgram):
3156         (WebCore::WebGLRenderingContextBase::vertexAttribPointer):
3157         (WebCore::WebGLRenderingContextBase::restoreCurrentFramebuffer):
3158         (WebCore::WebGLRenderingContextBase::restoreCurrentTexture2D):
3159         * html/canvas/WebGLRenderingContextBase.h:
3160         * html/canvas/WebGLRenderingContextBase.idl:
3161
3162 2016-10-19  Myles C. Maxfield  <mmaxfield@apple.com>
3163
3164         [macOS] [iOS] Disable variation fonts on macOS El Capitan and iOS 9
3165         https://bugs.webkit.org/show_bug.cgi?id=163374
3166
3167         Reviewed by Darin Adler.
3168
3169         Because of platform lack of support for variations in in-memory fonts,
3170         this feature should be disabled on the affected OSes.
3171
3172         No tests because there is no behavior change (on the relevant platforms).
3173
3174         * Configurations/FeatureDefines.xcconfig:
3175
3176 2016-10-20  Brady Eidson  <beidson@apple.com>
3177
3178         IndexedDB 2.0: Support IDBObjectStore name assignment.
3179         <rdar://problem/28806931> and https://bugs.webkit.org/show_bug.cgi?id=163749
3180
3181         Reviewed by Alex Christensen.
3182
3183         Tests: storage/indexeddb/modern/objectstore-rename-1-private.html
3184                storage/indexeddb/modern/objectstore-rename-1.html
3185
3186         Touches a *lot* of code sites, but none of them are particularly interesting.
3187         They are all just getting the new name spread out to all of the various objects that need it.
3188
3189         * Modules/indexeddb/IDBDatabase.cpp:
3190         (WebCore::IDBDatabase::renameObjectStore):
3191         * Modules/indexeddb/IDBDatabase.h:
3192
3193         * Modules/indexeddb/IDBObjectStore.cpp:
3194         (WebCore::IDBObjectStore::setName):
3195         * Modules/indexeddb/IDBObjectStore.h:
3196         * Modules/indexeddb/IDBObjectStore.idl:
3197
3198         * Modules/indexeddb/IDBTransaction.cpp:
3199         (WebCore::IDBTransaction::renameObjectStore):
3200         (WebCore::IDBTransaction::renameObjectStoreOnServer):
3201         (WebCore::IDBTransaction::didRenameObjectStoreOnServer):
3202         * Modules/indexeddb/IDBTransaction.h:
3203
3204         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
3205         (WebCore::IDBClient::IDBConnectionProxy::renameObjectStore):
3206         * Modules/indexeddb/client/IDBConnectionProxy.h:
3207
3208         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
3209         (WebCore::IDBClient::IDBConnectionToServer::renameObjectStore):
3210         (WebCore::IDBClient::IDBConnectionToServer::didRenameObjectStore):
3211         * Modules/indexeddb/client/IDBConnectionToServer.h:
3212         * Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
3213
3214         * Modules/indexeddb/server/IDBBackingStore.h:
3215
3216         * Modules/indexeddb/server/IDBConnectionToClient.cpp:
3217         (WebCore::IDBServer::IDBConnectionToClient::didDeleteObjectStore):
3218         (WebCore::IDBServer::IDBConnectionToClient::didRenameObjectStore):
3219         * Modules/indexeddb/server/IDBConnectionToClient.h:
3220         * Modules/indexeddb/server/IDBConnectionToClientDelegate.h:
3221
3222         * Modules/indexeddb/server/IDBServer.cpp:
3223         (WebCore::IDBServer::IDBServer::renameObjectStore):
3224         * Modules/indexeddb/server/IDBServer.h:
3225
3226         * Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
3227         (WebCore::IDBServer::MemoryBackingStoreTransaction::objectStoreRenamed):
3228         (WebCore::IDBServer::MemoryBackingStoreTransaction::abort):
3229         * Modules/indexeddb/server/MemoryBackingStoreTransaction.h:
3230
3231         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
3232         (WebCore::IDBServer::MemoryIDBBackingStore::renameObjectStore):
3233         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
3234
3235         * Modules/indexeddb/server/MemoryObjectStore.h:
3236         (WebCore::IDBServer::MemoryObjectStore::rename):
3237
3238         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
3239         (WebCore::IDBServer::SQLiteIDBBackingStore::renameObjectStore):
3240         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
3241
3242         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
3243         (WebCore::IDBServer::UniqueIDBDatabase::renameObjectStore):
3244         (WebCore::IDBServer::UniqueIDBDatabase::performRenameObjectStore):
3245         (WebCore::IDBServer::UniqueIDBDatabase::didPerformRenameObjectStore):
3246         * Modules/indexeddb/server/UniqueIDBDatabase.h:
3247
3248         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
3249         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didRenameObjectStore):
3250         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.h:
3251
3252         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
3253         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::renameObjectStore):
3254         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
3255
3256         * Modules/indexeddb/shared/IDBDatabaseInfo.cpp:
3257         (WebCore::IDBDatabaseInfo::renameObjectStore):
3258         * Modules/indexeddb/shared/IDBDatabaseInfo.h:
3259
3260         * Modules/indexeddb/shared/IDBObjectStoreInfo.h:
3261         (WebCore::IDBObjectStoreInfo::rename):
3262
3263         * Modules/indexeddb/shared/IDBResultData.cpp:
3264         (WebCore::IDBResultData::renameObjectStoreSuccess):
3265         * Modules/indexeddb/shared/IDBResultData.h:
3266
3267         * Modules/indexeddb/shared/InProcessIDBServer.cpp:
3268         (WebCore::InProcessIDBServer::didRenameObjectStore):
3269         (WebCore::InProcessIDBServer::renameObjectStore):
3270         * Modules/indexeddb/shared/InProcessIDBServer.h:
3271
3272 2016-10-20  Chris Dumez  <cdumez@apple.com>
3273
3274         Make table.deleteRow(-1) a no-op when there are no rows
3275         https://bugs.webkit.org/show_bug.cgi?id=163746
3276
3277         Reviewed by Alex Christensen.
3278
3279         Make table.deleteRow(-1) a no-op when there are no rows, instead of throwing:
3280         - https://github.com/whatwg/html/pull/1924
3281
3282         This is more consistent with the behavior of tbody.deleteRow(-1) and
3283         tr.deleteCell(-1). This is also consistent with Gecko. Blink is doing the
3284         same change via:
3285         - https://codereview.chromium.org/2427963004/
3286
3287         No new tests, updated existing tests.
3288
3289         * html/HTMLTableElement.cpp:
3290         (WebCore::HTMLTableElement::deleteRow):
3291
3292 2016-10-20  Dave Hyatt  <hyatt@apple.com>
3293
3294         [CSS Parser] Make sure to handle prefixed transform-style
3295         https://bugs.webkit.org/show_bug.cgi?id=163756
3296
3297         Reviewed by Dean Jackson.
3298
3299         * css/parser/CSSParserFastPaths.cpp:
3300         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
3301
3302 2016-10-20  Dave Hyatt  <hyatt@apple.com>
3303
3304         [CSS Parser] Fix crash when parsing -webkit-margin-collapse
3305         https://bugs.webkit.org/show_bug.cgi?id=163753
3306
3307         Reviewed by Dean Jackson.
3308
3309         * css/parser/CSSPropertyParser.cpp:
3310         (WebCore::CSSPropertyParser::parseShorthand):
3311
3312 2016-10-20  Chris Dumez  <cdumez@apple.com>
3313
3314         Passing a number as the pixel parameter to texImage2D() doesn't thrown an exception
3315         https://bugs.webkit.org/show_bug.cgi?id=163715
3316
3317         Reviewed by Darin Adler.
3318
3319         Enable strict type checking for typed arrays in the bindings, similarly
3320         do what we do for other wrapper types, as per Web IDL.
3321
3322         No new tests, updated existing tests.
3323
3324         * bindings/scripts/CodeGeneratorJS.pm:
3325         (GenerateImplementation):
3326         (GenerateParametersCheck):
3327
3328 2016-10-20  Myles C. Maxfield  <mmaxfield@apple.com>
3329
3330         Improve error message when passing a null ArrayBuffer to bufferData()
3331         https://bugs.webkit.org/show_bug.cgi?id=163745
3332
3333         Reviewed by Dean Jackson.
3334
3335         Test: fast/canvas/webgl/bufferData-nullable-array-buffer-view.html
3336
3337         Update the idl file to accept a nullable ArrayBuffer, and throw
3338         the relevant error with a more helpful error string.
3339
3340         * html/canvas/WebGLRenderingContextBase.cpp:
3341         (WebCore::WebGLRenderingContextBase::bufferData):
3342         * html/canvas/WebGLRenderingContextBase.h:
3343         * html/canvas/WebGLRenderingContextBase.idl:
3344
3345 2016-10-20  Zalan Bujtas  <zalan@apple.com>
3346
3347         Stop searching for first-letter containers at multi-column boundary.
3348         https://bugs.webkit.org/show_bug.cgi?id=163739
3349         <rdar://problem/28810750>
3350
3351         We should not cross the multi-column boundary while searching for the first-letter container.
3352         While moving first-letter renderers to a multi-column parent, it could result in finding the wrong
3353         container and end up adding a new wrapper under the original container (from where we are moving the renderers).    
3354
3355         Reviewed by David Hyatt.
3356
3357         Test: fast/css-generated-content/first-letter-move-to-multicolumn-crash.html
3358
3359         * rendering/RenderBoxModelObject.cpp:
3360         (WebCore::RenderBoxModelObject::moveChildrenTo):
3361         * rendering/RenderTextFragment.cpp:
3362         (WebCore::RenderTextFragment::blockForAccompanyingFirstLetter):
3363
3364 2016-10-19  Dean Jackson  <dino@apple.com>
3365
3366         Support CSS Shapes Level 1 without a prefix
3367         https://bugs.webkit.org/show_bug.cgi?id=163709
3368         <rdar://problem/28859369>
3369
3370         Reviewed by Myles Maxfield.
3371
3372         Support the unprefixed form of CSS Shapes, now that
3373         it is in CR.
3374
3375         We have a few failing tests:
3376
3377         - Some image-based shaping failures, now skipped.
3378           https://bugs.webkit.org/show_bug.cgi?id=163706
3379
3380         - Some false negatives, where my understanding
3381           of the CSS OM seems to suggest that the W3C tests
3382           are incorrect.
3383           https://bugs.webkit.org/show_bug.cgi?id=163708
3384
3385         Tests: imported/w3c/csswg-test/css-shapes-1
3386
3387         * css/CSSComputedStyleDeclaration.cpp:
3388         (WebCore::ComputedStyleExtractor::propertyValue):
3389         * css/CSSPropertyNames.in:
3390         * css/CSSValueKeywords.in:
3391         * css/parser/CSSParser.cpp:
3392         (WebCore::isSimpleLengthPropertyID):
3393         (WebCore::CSSParser::parseValue):
3394         * css/parser/CSSPropertyParser.cpp:
3395         (WebCore::CSSPropertyParser::parseSingleValue):
3396         * page/animation/CSSPropertyAnimation.cpp:
3397         (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
3398
3399 2016-10-20  Dave Hyatt  <hyatt@apple.com>
3400
3401         [CSS Parser] Fix region, column and page break parsing
3402         https://bugs.webkit.org/show_bug.cgi?id=163743
3403
3404         Reviewed by Simon Fraser.
3405
3406         * css/parser/CSSParserFastPaths.cpp:
3407         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
3408         Add the missing values for break support.
3409
3410         * css/parser/CSSPropertyParser.cpp:
3411         (WebCore::isLegacyBreakProperty):