IndexedDB 2.0: Prefetch cursor records in the server.
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-12-18  Brady Eidson  <beidson@apple.com>
2
3         IndexedDB 2.0: Prefetch cursor records in the server.
4         https://bugs.webkit.org/show_bug.cgi?id=166014
5
6         Reviewed by Andy Estes.
7
8         No new tests (Covered by existing LayoutTests and PerformanceTests).
9
10         This patch implements the followng:
11         1 - After a backing store cursor completes a fetch in the server, it will schedule the next fetch 
12             even before the client requests one. It will do this up to a limited number of prefetches.
13         2 - Once a client request to advance the cursor comes in, we'll work our way through prefetched
14             records instead of reading anything from disk, which might then cause us to continue prefetch.
15         3 - If any changes to the object store occur, it will throw away all previously fetched records
16             (There's room for future improvement here)
17
18         * Modules/indexeddb/server/IDBBackingStore.h:
19         
20         * Modules/indexeddb/server/IDBServer.cpp:
21         (WebCore::IDBServer::IDBServer::postDatabaseTask):
22         
23         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
24         
25         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
26         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteRange):
27         (WebCore::IDBServer::SQLiteIDBBackingStore::prefetchCursor):
28         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
29         
30         * Modules/indexeddb/server/SQLiteIDBCursor.cpp:
31         (WebCore::IDBServer::SQLiteIDBCursor::objectStoreRecordsChanged):
32         (WebCore::IDBServer::SQLiteIDBCursor::prefetch):
33         (WebCore::IDBServer::SQLiteIDBCursor::advance):
34         * Modules/indexeddb/server/SQLiteIDBCursor.h:
35         
36         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
37         (WebCore::IDBServer::UniqueIDBDatabase::performIterateCursor):
38         (WebCore::IDBServer::UniqueIDBDatabase::performPrefetchCursor):
39         (WebCore::IDBServer::UniqueIDBDatabase::postDatabaseTask):
40         * Modules/indexeddb/server/UniqueIDBDatabase.h:
41
42 2016-12-18  Wenson Hsieh  <wenson_hsieh@apple.com>
43
44         Changing text direction fires input events with null inputTypes and no data
45         https://bugs.webkit.org/show_bug.cgi?id=166007
46         <rdar://problem/29557205>
47
48         Reviewed by Sam Weinig.
49
50         Adds support for the "formatSetInlineTextDirection" input type, triggered when using the context menu on Mac in
51         an editable area (for both plain and rich text cases) to change paragraph direction. To do this, we add cases
52         for EditActionSetWritingDirection in inputTypeNameForEditingAction and inputEventDataForEditingStyleAndAction.
53
54         When changing text direction for a plaintext editable element, we have logic in Editor::setBaseWritingDirection
55         that sets the focused element's dir attribute to the requested value (ltr or rtl). We add similar hooks here to
56         dispatch input events and handle preventing default.
57
58         Test: fast/events/before-input-events-prevent-text-direction.html
59
60         * editing/EditCommand.cpp:
61         (WebCore::inputTypeNameForEditingAction):
62
63         Handle the EditActionSetWritingDirection case.
64
65         * editing/Editor.cpp:
66         (WebCore::inputEventDataForEditingStyleAndAction):
67         (WebCore::Editor::applyParagraphStyle):
68
69         Include input event data when dispatching an input event here.
70
71         (WebCore::Editor::setBaseWritingDirection):
72         * testing/Internals.cpp:
73         (WebCore::Internals::setBaseWritingDirection):
74         * testing/Internals.h:
75         * testing/Internals.idl:
76
77         Introduce an internal testing support hook for setting base writing direction (the same codepath taken when
78         using the context menu to change paragraph direction). Currently, using testRunner.execCommand creates and
79         applies style with an additional `unicode-bidi` attribute, and appears to also be intentionally disabled for
80         plaintext editable elements.
81
82 2016-12-17  Simon Fraser  <simon.fraser@apple.com>
83
84         Build fix: linking WebCore was failing: you can't export inline functions.
85
86         * css/DeprecatedCSSOMPrimitiveValue.cpp:
87         (WebCore::DeprecatedCSSOMPrimitiveValue::primitiveType):
88         (WebCore::DeprecatedCSSOMPrimitiveValue::setFloatValue):
89         (WebCore::DeprecatedCSSOMPrimitiveValue::getFloatValue):
90         (WebCore::DeprecatedCSSOMPrimitiveValue::setStringValue):
91         (WebCore::DeprecatedCSSOMPrimitiveValue::getStringValue):
92         * css/DeprecatedCSSOMPrimitiveValue.h:
93         (WebCore::DeprecatedCSSOMPrimitiveValue::primitiveType): Deleted.
94         (WebCore::DeprecatedCSSOMPrimitiveValue::setFloatValue): Deleted.
95         (WebCore::DeprecatedCSSOMPrimitiveValue::getFloatValue): Deleted.
96         (WebCore::DeprecatedCSSOMPrimitiveValue::setStringValue): Deleted.
97         (WebCore::DeprecatedCSSOMPrimitiveValue::getStringValue): Deleted.
98
99 2016-12-16  Dave Hyatt  <hyatt@apple.com>
100
101         [CSS Values] Make separate wrapper classes for the deprecated CSS Values OM
102         https://bugs.webkit.org/show_bug.cgi?id=165968
103
104         Reviewed by Andreas Kling.
105
106         This patch changes the CSS OM for values to use distinct wrapper
107         classes instead of cloning the existing classes. By actually wrapping
108         values instead of cloning, we are freed up to change our CSS value hierarchy
109         however we'd like (such as changing to match the new CSS Values OM that
110         is coming soon).
111
112         All of the CSS Values wrapper classes are prefixed with "DeprecatedCSSOM"
113         to reflect our desire (ultimately) to remove this API from our tree. We're
114         the only ones that support it, and it's not used on the Web, but it is part
115         of the WebKitLegacy API and might be used internally.
116
117         * CMakeLists.txt:
118         * DerivedSources.cpp:
119         * DerivedSources.make:
120         * WebCore.xcodeproj/project.pbxproj:
121         * bindings/js/DOMWrapperWorld.h:
122         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
123         (WebCore::JSCSSStyleDeclaration::getPropertyCSSValue):
124         * bindings/js/JSCSSValueCustom.cpp:
125         (WebCore::JSDeprecatedCSSOMValueOwner::isReachableFromOpaqueRoots):
126         (WebCore::JSDeprecatedCSSOMValueOwner::finalize):
127         (WebCore::toJSNewlyCreated):
128         (WebCore::toJS):
129         (WebCore::JSCSSValueOwner::isReachableFromOpaqueRoots): Deleted.
130         (WebCore::JSCSSValueOwner::finalize): Deleted.
131         * css/CSSComputedStyleDeclaration.cpp:
132         (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
133         * css/CSSComputedStyleDeclaration.h:
134         * css/CSSGridLineNamesValue.cpp:
135         (WebCore::CSSGridLineNamesValue::cloneForCSSOM): Deleted.
136         * css/CSSGridLineNamesValue.h:
137         * css/CSSImageSetValue.cpp:
138         (WebCore::CSSImageSetValue::cloneForCSSOM): Deleted.
139         * css/CSSImageSetValue.h:
140         * css/CSSImageValue.cpp:
141         (WebCore::CSSImageValue::createDeprecatedCSSOMWrapper):
142         (WebCore::CSSImageValue::cloneForCSSOM): Deleted.
143         * css/CSSImageValue.h:
144         * css/CSSPrimitiveValue.cpp:
145         (WebCore::CSSPrimitiveValue::createDeprecatedCSSOMPrimitiveWrapper):
146         (WebCore::CSSPrimitiveValue::cloneForCSSOM): Deleted.
147         * css/CSSPrimitiveValue.h:
148         * css/CSSPrimitiveValue.idl: Removed.
149         * css/CSSStyleDeclaration.h:
150         * css/CSSStyleDeclaration.idl:
151         * css/CSSValue.cpp:
152         (WebCore::CSSValue::traverseSubresources):
153         (WebCore::CSSValue::equals):
154         (WebCore::CSSValue::cssText):
155         (WebCore::CSSValue::destroy):
156         (WebCore::CSSValue::createDeprecatedCSSOMWrapper):
157         (): Deleted.
158         (WebCore::CSSValue::cloneForCSSOM): Deleted.
159         * css/CSSValue.h:
160         (WebCore::CSSValue::CSSValue):
161         (WebCore::CSSValue::setCssText): Deleted.
162         (WebCore::CSSValue::isCSSOMSafe): Deleted.
163         (WebCore::CSSValue::isSubtypeExposedToCSSOM): Deleted.
164         * css/CSSValue.idl: Removed.
165         * css/CSSValueList.cpp:
166         (WebCore::CSSValueList::cloneForCSSOM): Deleted.
167         * css/CSSValueList.h:
168         (WebCore::CSSValueList::separator):
169         * css/CSSValueList.idl: Removed.
170         * css/Counter.h:
171         * css/Counter.idl: Removed.
172         * css/DeprecatedCSSOMCounter.h: Added.
173         * css/DeprecatedCSSOMCounter.idl: Copied from Source/WebCore/css/Counter.idl.
174         * css/DeprecatedCSSOMPrimitiveValue.cpp: Added.
175         (WebCore::DeprecatedCSSOMPrimitiveValue::getCounterValue):
176         (WebCore::DeprecatedCSSOMPrimitiveValue::getRectValue):
177         (WebCore::DeprecatedCSSOMPrimitiveValue::getRGBColorValue):
178         * css/DeprecatedCSSOMPrimitiveValue.h: Added.
179         (WebCore::DeprecatedCSSOMPrimitiveValue::create):
180         (WebCore::DeprecatedCSSOMPrimitiveValue::equals):
181         (WebCore::DeprecatedCSSOMPrimitiveValue::cssValueType):
182         (WebCore::DeprecatedCSSOMPrimitiveValue::cssText):
183         (WebCore::DeprecatedCSSOMPrimitiveValue::primitiveType):
184         (WebCore::DeprecatedCSSOMPrimitiveValue::setFloatValue):
185         (WebCore::DeprecatedCSSOMPrimitiveValue::getFloatValue):
186         (WebCore::DeprecatedCSSOMPrimitiveValue::setStringValue):
187         (WebCore::DeprecatedCSSOMPrimitiveValue::getStringValue):
188         (WebCore::DeprecatedCSSOMPrimitiveValue::stringValue):
189         (WebCore::DeprecatedCSSOMPrimitiveValue::DeprecatedCSSOMPrimitiveValue):
190         * css/DeprecatedCSSOMPrimitiveValue.idl: Copied from Source/WebCore/css/CSSPrimitiveValue.idl.
191         * css/DeprecatedCSSOMRGBColor.h: Added.
192         * css/DeprecatedCSSOMRGBColor.idl: Copied from Source/WebCore/css/RGBColor.idl.
193         * css/DeprecatedCSSOMRect.h: Added.
194         * css/DeprecatedCSSOMRect.idl: Copied from Source/WebCore/css/Rect.idl.
195         * css/DeprecatedCSSOMValue.cpp: Added.
196         (WebCore::compareCSSOMValues):
197         (WebCore::DeprecatedCSSOMValue::equals):
198         (WebCore::DeprecatedCSSOMValue::destroy):
199         (WebCore::DeprecatedCSSOMValue::cssValueType):
200         (WebCore::DeprecatedCSSOMValue::cssText):
201         * css/DeprecatedCSSOMValue.h: Added.
202         (WebCore::DeprecatedCSSOMValue::deref):
203         (WebCore::DeprecatedCSSOMValue::setCssText):
204         (WebCore::DeprecatedCSSOMValue::operator==):
205         (WebCore::DeprecatedCSSOMValue::isComplexValue):
206         (WebCore::DeprecatedCSSOMValue::isPrimitiveValue):
207         (WebCore::DeprecatedCSSOMValue::isValueList):
208         (WebCore::DeprecatedCSSOMValue::classType):
209         (WebCore::DeprecatedCSSOMValue::DeprecatedCSSOMValue):
210         (WebCore::DeprecatedCSSOMValue::~DeprecatedCSSOMValue):
211         (WebCore::DeprecatedCSSOMComplexValue::create):
212         (WebCore::DeprecatedCSSOMComplexValue::equals):
213         (WebCore::DeprecatedCSSOMComplexValue::cssText):
214         (WebCore::DeprecatedCSSOMComplexValue::cssValueType):
215         (WebCore::DeprecatedCSSOMComplexValue::DeprecatedCSSOMComplexValue):
216         * css/DeprecatedCSSOMValue.idl: Copied from Source/WebCore/css/CSSValue.idl.
217         * css/DeprecatedCSSOMValueList.cpp: Added.
218         (WebCore::DeprecatedCSSOMValueList::equals):
219         (WebCore::DeprecatedCSSOMValueList::cssText):
220         * css/DeprecatedCSSOMValueList.h: Added.
221         (WebCore::DeprecatedCSSOMValueList::create):
222         (WebCore::DeprecatedCSSOMValueList::cssValueType):
223         (WebCore::DeprecatedCSSOMValueList::length):
224         (WebCore::DeprecatedCSSOMValueList::item):
225         (WebCore::DeprecatedCSSOMValueList::DeprecatedCSSOMValueList):
226         * css/DeprecatedCSSOMValueList.idl: Copied from Source/WebCore/css/CSSValueList.idl.
227         * css/LengthRepeat.h:
228         * css/PropertySetCSSStyleDeclaration.cpp:
229         (WebCore::PropertySetCSSStyleDeclaration::getPropertyCSSValue):
230         (WebCore::PropertySetCSSStyleDeclaration::wrapForDeprecatedCSSOM):
231         (WebCore::StyleRuleCSSStyleDeclaration::didMutate):
232         (WebCore::InlineCSSStyleDeclaration::didMutate):
233         (WebCore::PropertySetCSSStyleDeclaration::cloneAndCacheForCSSOM): Deleted.
234         * css/PropertySetCSSStyleDeclaration.h:
235         * css/RGBColor.cpp:
236         (WebCore::RGBColor::red): Deleted.
237         (WebCore::RGBColor::green): Deleted.
238         (WebCore::RGBColor::blue): Deleted.
239         (WebCore::RGBColor::alpha): Deleted.
240         * css/RGBColor.h:
241         * css/RGBColor.idl: Removed.
242         * css/Rect.h:
243         (WebCore::RectBase::RectBase):
244         * css/Rect.idl: Removed.
245         * svg/SVGElement.cpp:
246         (WebCore::SVGElement::getPresentationAttribute):
247         * svg/SVGElement.h:
248         * svg/SVGElement.idl:
249
250 2016-12-17  Philippe Normand  <pnormand@igalia.com>
251
252         Unreviewed, rollout r209860 OWR player shouldn't be selected for normal video playback
253
254         * platform/GStreamer.cmake:
255         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.cpp:
256         (WebCore::MediaPlayerPrivateGStreamerOwr::~MediaPlayerPrivateGStreamerOwr):
257         (WebCore::MediaPlayerPrivateGStreamerOwr::play):
258         (WebCore::MediaPlayerPrivateGStreamerOwr::pause):
259         (WebCore::MediaPlayerPrivateGStreamerOwr::load):
260         (WebCore::MediaPlayerPrivateGStreamerOwr::stop):
261         (WebCore::MediaPlayerPrivateGStreamerOwr::trackEnded):
262         (WebCore::MediaPlayerPrivateGStreamerOwr::trackEnabledChanged):
263         (WebCore::MediaPlayerPrivateGStreamerOwr::setSize):
264         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.h:
265         * platform/mediastream/openwebrtc/MediaEndpointOwr.cpp:
266         (WebCore::MediaEndpointOwr::createMutedRemoteSource):
267         * platform/mediastream/openwebrtc/RealtimeAudioSourceOwr.h: Removed.
268         * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp:
269         (WebCore::RealtimeMediaSourceCenterOwr::mediaSourcesAvailable):
270         * platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.cpp: Removed.
271         * platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.h:
272         * platform/mediastream/openwebrtc/RealtimeVideoSourceOwr.h: Removed.
273
274 2016-12-17  Michael Catanzaro  <mcatanzaro@igalia.com>
275
276         warning: the compiler can assume that the address of 'thisObject' will always evaluate to 'true' [-Waddress] in WebCore::JSHTMLDocument::getOwnPropertySlot
277         https://bugs.webkit.org/show_bug.cgi?id=165987
278
279         Reviewed by Mark Lam.
280
281         Work around the warning by passing the JSObject pointer this function receives directly to
282         ASSERT_GC_OBJECT_INHERITS, instead of casting it to a reference and then taking the address
283         of that, to avoid the -Waddress warning.
284
285         * bindings/js/JSHTMLDocumentCustom.cpp:
286         (WebCore::JSHTMLDocument::getOwnPropertySlot):
287
288 2016-12-17  Jer Noble  <jer.noble@apple.com>
289
290         Add implementation for navigator.requestMediaKeySystemAccess()
291         https://bugs.webkit.org/show_bug.cgi?id=165850
292
293         Reviewed by Eric Carlson.
294
295         Test: media/encrypted-media/mock-navigator-requestMediaKeySystemAccess.html
296
297         Add an implementation of NavigatorEME::requestMediaKeySystemAccess() as well as the CDM
298         object on which it depends.
299
300         * Modules/encryptedmedia/CDM.cpp: Added.
301         (WebCore::cdmFactories):
302         (WebCore::createCDMPrivateForKeySystem):
303         (WebCore::CDM::registerCDMFactory):
304         (WebCore::CDM::unregisterCDMFactory):
305         (WebCore::CDM::supportsKeySystem):
306         (WebCore::CDM::create):
307         (WebCore::CDM::CDM):
308         (WebCore::CDM::getSupportedConfiguration):
309         (WebCore::CDM::doSupportedConfigurationStep):
310         (WebCore::CDM::isPersistentType):
311         (WebCore::CDM::getSupportedCapabilitiesForAudioVideoType):
312         (WebCore::CDM::getConsentStatus):
313         * Modules/encryptedmedia/CDM.h: Added.
314         (WebCore::CDMFactory::~CDMFactory):
315         (WebCore::CDM::keySystem):
316         (WebCore::CDM::createWeakPtr):
317         * Modules/encryptedmedia/CDMPrivate.h: Added.
318         (WebCore::CDMPrivate::~CDMPrivate):
319         * Modules/encryptedmedia/NavigatorEME.cpp:
320         (WebCore::NavigatorEME::requestMediaKeySystemAccess):
321         (WebCore::tryNextSupportedConfiguration):
322         * Modules/encryptedmedia/NavigatorEME.h:
323         * Modules/encryptedmedia/NavigatorEME.idl:
324
325         To aid in testing, a new Internals object is added, MockCDMFactory, which can be
326         controlled by LayoutTests to change the behavior of the Mock objects it creates.
327
328         * testing/Internals.cpp:
329         (WebCore::Internals::registerMockCDM):
330         * testing/Internals.h:
331         * testing/Internals.idl:
332         * testing/MockCDMFactory.cpp: Added.
333         (WebCore::MockCDMFactory::MockCDMFactory):
334         (WebCore::MockCDMFactory::~MockCDMFactory):
335         (WebCore::MockCDMFactory::unregister):
336         (WebCore::MockCDMFactory::supportsKeySystem):
337         (WebCore::MockCDMFactory::createCDM):
338         (WebCore::MockCDM::MockCDM):
339         (WebCore::MockCDM::supportsInitDataType):
340         (WebCore::MockCDM::supportsConfiguration):
341         (WebCore::MockCDM::supportsConfigurationWithRestrictions):
342         (WebCore::MockCDM::supportsSessionTypeWithConfiguration):
343         (WebCore::MockCDM::supportsRobustness):
344         (WebCore::MockCDM::distinctiveIdentifiersRequirement):
345         (WebCore::MockCDM::persistentStateRequirement):
346         (WebCore::MockCDM::distinctiveIdentifiersAreUniquePerOriginAndClearable):
347         * testing/MockCDMFactory.h: Added.
348         (WebCore::MockCDMFactory::create):
349         (WebCore::MockCDMFactory::supportedDataTypes):
350         (WebCore::MockCDMFactory::setSupportedDataTypes):
351         (WebCore::MockCDMFactory::supportedRobustness):
352         (WebCore::MockCDMFactory::setSupportedRobustness):
353         (WebCore::MockCDMFactory::distinctiveIdentifiersRequirement):
354         (WebCore::MockCDMFactory::setDistinctiveIdentifiersRequirement):
355         (WebCore::MockCDMFactory::persistentStateRequirement):
356         (WebCore::MockCDMFactory::setPersistentStateRequirement):
357         * testing/MockCDMFactory.idl: Added.
358
359         Move the MediaKeySessionType definition out of the MediaKeys.idl file and into its own.
360         Move the MediaKeysRequiriment definition out of the MediaKeySystemConfiguration.idl file
361         and into its own. Generally fix up the .idl files so that they properly work with their
362         implementation files.
363
364         * Modules/encryptedmedia/MediaKeySessionType.idl: Added.
365         * Modules/encryptedmedia/MediaKeySystemAccess.cpp:
366         (WebCore::MediaKeySystemAccess::create):
367         (WebCore::MediaKeySystemAccess::MediaKeySystemAccess):
368         (WebCore::MediaKeySystemAccess::keySystem): Deleted.
369         (WebCore::MediaKeySystemAccess::getConfiguration): Deleted.
370         * Modules/encryptedmedia/MediaKeySystemAccess.h:
371         (WebCore::MediaKeySystemAccess::keySystem):
372         (WebCore::MediaKeySystemAccess::getConfiguration):
373         (WebCore::MediaKeySystemAccess::create): Deleted.
374         * Modules/encryptedmedia/MediaKeySystemAccess.idl:
375         * Modules/encryptedmedia/MediaKeySystemConfiguration.h:
376         * Modules/encryptedmedia/MediaKeySystemConfiguration.idl:
377         * Modules/encryptedmedia/MediaKeySystemMediaCapability.idl:
378         * Modules/encryptedmedia/MediaKeys.idl:
379         * Modules/encryptedmedia/MediaKeysRequirement.idl: Added.
380         * Modules/encryptedmedia/MediaKeysRestrictions.h: Added.
381         * bindings/js/JSMediaKeySystemAccessCustom.cpp: Removed.
382
383         As some of these enums are referenced in the Internals project, they need to be exported
384         from WebCore correctly. Teach the code generator how to export the symbols generated by
385         enums.
386
387         * bindings/scripts/CodeGeneratorJS.pm:
388         (GenerateEnumerationHeaderContent):
389
390         Add new files to the project.
391
392         * CMakeLists.txt:
393         * DerivedSources.make:
394         * WebCore.xcodeproj/project.pbxproj:
395
396 2016-12-17  Darin Adler  <darin@apple.com>
397
398         Remove WebCore::Dictionary, which is now unused
399         https://bugs.webkit.org/show_bug.cgi?id=165988
400
401         Reviewed by Andreas Kling.
402
403         * CMakeLists.txt: Removed the files.
404         * WebCore.xcodeproj/project.pbxproj: Ditto.
405         * bindings/js/Dictionary.cpp: Removed.
406         * bindings/js/Dictionary.h: Removed.
407         * bindings/js/JSBindingsAllInOne.cpp: Removed include of Dictionary.cpp.
408
409 2016-12-17  Youenn Fablet  <youenn@apple.com>
410
411         Cloned CachedResource should not have an empty response
412         https://bugs.webkit.org/show_bug.cgi?id=165947
413
414         Reviewed by Sam Weinig.
415
416         Test: http/tests/loading/reusing-cached-stylesheet-from-different-domain.html
417
418         * loader/cache/CachedResource.cpp:
419         (WebCore::CachedResource::setBodyDataFrom): Copying the response to the cloned resource.
420         Even though the issue is appearing for stylesheets only, it is safer to do that for all cloned ressources.
421
422 2016-12-16  Brady Eidson  <beidson@apple.com>
423
424         IndexedDB: Refactor SQLiteIDBCursor to prepare for cursor prefetching.
425         https://bugs.webkit.org/show_bug.cgi?id=165978
426
427         Reviewed by Alex Christensen.
428
429         No new tests (Refactor, no behavior change).
430         
431         In preparation for cursor prefetching, we need to shift the cursor off of keeping "the current record"
432         and onto keeping "a deque of fetched records", the first of which is "the current record".
433         
434         This patch does just that, but with no behavior change; The deque only ever holds 0 or 1 records.
435
436         * Modules/indexeddb/server/SQLiteIDBCursor.cpp:
437         (WebCore::IDBServer::SQLiteIDBCursor::currentData):
438         (WebCore::IDBServer::SQLiteIDBCursor::objectStoreRecordsChanged):
439         (WebCore::IDBServer::SQLiteIDBCursor::resetAndRebindStatement):
440         (WebCore::IDBServer::SQLiteIDBCursor::prefetch):
441         (WebCore::IDBServer::SQLiteIDBCursor::advance):
442         (WebCore::IDBServer::SQLiteIDBCursor::fetch):
443         (WebCore::IDBServer::SQLiteIDBCursor::fetchNextRecord):
444         (WebCore::IDBServer::SQLiteIDBCursor::markAsErrored):
445         (WebCore::IDBServer::SQLiteIDBCursor::internalFetchNextRecord):
446         (WebCore::IDBServer::SQLiteIDBCursor::iterate):
447         (WebCore::IDBServer::SQLiteIDBCursor::currentKey):
448         (WebCore::IDBServer::SQLiteIDBCursor::currentPrimaryKey):
449         (WebCore::IDBServer::SQLiteIDBCursor::currentValue):
450         (WebCore::IDBServer::SQLiteIDBCursor::didComplete):
451         (WebCore::IDBServer::SQLiteIDBCursor::didError):
452         (WebCore::IDBServer::SQLiteIDBCursor::currentRecordRowID):
453         (WebCore::IDBServer::SQLiteIDBCursor::advanceUnique): Deleted.
454         (WebCore::IDBServer::SQLiteIDBCursor::advanceOnce): Deleted.
455         (WebCore::IDBServer::SQLiteIDBCursor::internalAdvanceOnce): Deleted.
456         
457         * Modules/indexeddb/server/SQLiteIDBCursor.h:
458         (WebCore::IDBServer::SQLiteIDBCursor::SQLiteCursorRecord::isTerminalRecord):
459         (WebCore::IDBServer::SQLiteIDBCursor::currentRecordRowID): Deleted.
460         (WebCore::IDBServer::SQLiteIDBCursor::currentKey): Deleted.
461         (WebCore::IDBServer::SQLiteIDBCursor::currentPrimaryKey): Deleted.
462         (WebCore::IDBServer::SQLiteIDBCursor::currentValue): Deleted.
463         (WebCore::IDBServer::SQLiteIDBCursor::didComplete): Deleted.
464         (WebCore::IDBServer::SQLiteIDBCursor::didError): Deleted.
465
466 2016-12-16  Darin Adler  <darin@apple.com>
467
468         Remove all custom bindings from media streams, using dictionaries instead
469         https://bugs.webkit.org/show_bug.cgi?id=165943
470
471         Reviewed by Sam Weinig.
472
473         * CMakeLists.txt: Added and removed files.
474         * DerivedSources.make: Ditto.
475
476         * Modules/mediastream/DoubleRange.h: Added. Moved dictionary here so it can be shared
477         by both MediaStreamTrack and MediaTrackSupportedConstraints.
478         * Modules/mediastream/DoubleRange.idl: Ditto.
479         * Modules/mediastream/LongRange.h: Ditto.
480         * Modules/mediastream/LongRange.idl: Ditto.
481
482         * Modules/mediastream/MediaDevices.cpp:
483         (WebCore::MediaDevices::getSupportedConstraints): Changed to return a struct instead
484         of a reference counted object.
485         * Modules/mediastream/MediaDevices.h: Updated for the above.
486         * Modules/mediastream/MediaDevices.idl: Added a conditional on the dictionary in this
487         file; not needed because the conditional on the interface automatically affects the
488         entire fiel, but for now the style seems to be to put these on all the dictionaries.
489
490         * Modules/mediastream/MediaSourceSettings.cpp: Removed.
491         * Modules/mediastream/MediaSourceSettings.h: Removed.
492
493         * Modules/mediastream/MediaStreamTrack.cpp:
494         (WebCore::MediaStreamTrack::getSettings): Changed to return a struct instead of a
495         reference counted object.
496         (WebCore::capabilityDoubleRange): Added. Helper for getCapabilities.
497         (WebCore::capabilityIntRange): Ditto.
498         (WebCore::capabilityStringVector): Ditto.
499         (WebCore::capabilityBooleanVector): Ditto.
500         (WebCore::MediaStreamTrack::getCapabilities): Changed to return a struct instead
501         of a reference counted object.
502         * Modules/mediastream/MediaStreamTrack.h: Updated for the above changes. Also
503         defined the structs here in the class.
504         * Modules/mediastream/MediaStreamTrack.idl: Defined the two dictionaries here and
505         changed the functions to return them and not use [Custom] any more.
506
507         * Modules/mediastream/MediaTrackConstraints.h: Moved DoubleRange and LongRange out
508         of this file and into their own headers. Also removed the currently unimplemented
509         latency and channelCount; there are FIXME comments in the IDL file about eventually
510         adding these to match the specification.
511         * Modules/mediastream/MediaTrackConstraints.idl: Added conditionals, and removed
512         the unimplemented latency and channelCount.
513         style of marking everything consistently.
514
515         * Modules/mediastream/MediaTrackSupportedConstraints.h: Replaced this class with
516         a struct.
517         * Modules/mediastream/MediaTrackSupportedConstraints.idl: Replaced this interface
518         with a dictionary.
519
520         * WebCore.xcodeproj/project.pbxproj: Added and removed files.
521
522         * bindings/js/JSMediaStreamTrackCustom.cpp: Removed.
523         * bindings/js/JSMediaTrackSupportedConstraintsCustom.cpp: Removed.
524
525         * platform/mediastream/MediaStreamTrackPrivate.cpp: Removed include of the
526         MediaSourceSettings.h header.
527         * platform/mediastream/MediaStreamTrackPrivate.h: Removed forward declaration of
528         the MediaSourceSettings class.
529
530 2016-12-16  Zalan Bujtas  <zalan@apple.com>
531
532         Possible nullptr dereference when applying pagination to viewport
533         https://bugs.webkit.org/show_bug.cgi?id=165926
534
535         Reviewed by Simon Fraser.
536
537         Static analysis found a code path where a null dereference could occur.
538         
539         * page/FrameView.cpp:
540         (WebCore::FrameView::applyPaginationToViewport):
541
542 2016-12-16  Ryan Haddad  <ryanhaddad@apple.com>
543
544         Fix the Windows build.
545
546         Unreviewed build fix.
547
548         * platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp:
549
550 2016-12-16  Ryan Haddad  <ryanhaddad@apple.com>
551
552         Yet another attempt to fix the Windows build after r209936.
553
554         Unreviewed build fix.
555
556         * platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.h:
557
558 2016-12-16  Alex Christensen  <achristensen@webkit.org>
559
560         Use initEvent quirk added in r207908 for Flipboard
561         https://bugs.webkit.org/show_bug.cgi?id=165974
562         <rdar://problem/28264190>
563
564         Reviewed by Chris Dumez.
565
566         * dom/Event.cpp:
567         (WebCore::Event::initEventForBindings):
568         * platform/RuntimeApplicationChecks.h:
569         * platform/RuntimeApplicationChecks.mm:
570         (WebCore::IOSApplication::isFlipboard):
571         Flipboard also has JavaScript content that calls initEvent with not enough arguments.
572
573 2016-12-16  Chris Dumez  <cdumez@apple.com>
574
575         [iOS] Align HTML from validation popover style with Copy/Paste callout bar
576         https://bugs.webkit.org/show_bug.cgi?id=165973
577         <rdar://problem/29336638>
578
579         Reviewed by Simon Fraser.
580
581         Tweak font size and padding of the HTML from validation popover to
582         match the style of the Copy/Paste callout bar on iOS.
583
584         * platform/ios/ValidationBubbleIOS.mm:
585         (WebCore::ValidationBubble::ValidationBubble):
586
587 2016-12-16  Ryan Haddad  <ryanhaddad@apple.com>
588
589         Another attempt to fix the Windows build after r209936.
590
591         Unreviewed build fix.
592
593         * CMakeLists.txt:
594
595 2016-12-16  Andy Estes  <aestes@apple.com>
596
597         Add a setting to suppress keyboard input during provisional navigation
598         https://bugs.webkit.org/show_bug.cgi?id=165830
599
600         Reviewed by Brent Fulgham.
601
602         Added a setting that suppresses keyboard input during provisional navigation. When the
603         setting is enabled, DOM propogation of keyboard input events (KeyboardEvents,
604         CompositionEvents, InputEvents, and some TextEvents) is suppressed, and text insertion is
605         disabled in the editor.
606
607         Non-editing default event handling still occurs, for instance keyboard scrolling, access
608         keys, and focus navigation.
609
610         Test: http/tests/navigation/keyboard-events-during-provisional-navigation.html
611
612         * dom/CompositionEvent.h: Added a type trait specialization.
613         * dom/EventDispatcher.cpp:
614         (WebCore::shouldSuppressEventDispatchInDOM): Added. Returns true if the event is trusted,
615         FrameLoader::shouldSuppressKeyboardInput() returns true, and the event is a
616         CompositionEvent, InputEvent, KeyboardEvent, or keyboard/composition TextEvent.
617         (WebCore::EventDispatcher::dispatchEvent): Called stopPropogation() on the event if
618         shouldSuppressEventDispatchInDOM() returns true.
619         * dom/InputEvent.h: Removed the inline no-op destructor so that DataTransfer does not need
620         to be a complete type in every translation unit that includes this header. Added a type
621         trait specialization.
622         * dom/TextEvent.h: Added isKeyboard() to determine if m_inputType is TextEventInputKeyboard.
623         * editing/Editor.cpp:
624         (WebCore::Editor::shouldInsertText): Returned false if
625         FrameLoader::shouldSuppressKeyboardInput() returns true and the action is
626         EditorInsertActionTyped.
627         * loader/FrameLoader.cpp:
628         (WebCore::FrameLoader::shouldSuppressKeyboardInput): Added. Returns true if
629         Settings::shouldSuppressKeyboardInputDuringProvisionalNavigation() returns true and the
630         state is FrameStateProvisional.
631         * loader/FrameLoader.h: Declared shouldSuppressKeyboardInput().
632         * page/EventHandler.h: Exported accessKeyModifiers().
633         * page/Settings.in: Defined shouldSuppressKeyboardInputDuringProvisionalNavigation with an
634         initial value of false.
635         * testing/Internals.cpp:
636         (WebCore::Internals::accessKeyModifiers): Added. Returns a vector of strings representing
637         the access key modifiers.
638         * testing/Internals.h: Declared accessKeyModifiers().
639         * testing/Internals.idl: Exposed accessKeyModifiers() on the internals object.
640
641 2016-12-16  Brady Eidson  <beidson@apple.com>
642
643         More SQLiteIDBCursor refactoring.
644         https://bugs.webkit.org/show_bug.cgi?id=165956
645
646         Reviewed by Tim Horton.
647
648         No new tests (No behavior change).
649         
650         This is a simple patch that encapsulates the current state of the cursor in one structure
651         which will allow for storing multiple-such states in the future (to support prefetching).
652
653         * Modules/indexeddb/server/SQLiteIDBCursor.cpp:
654         (WebCore::IDBServer::SQLiteIDBCursor::currentData):
655         (WebCore::IDBServer::SQLiteIDBCursor::resetAndRebindStatement):
656         (WebCore::IDBServer::SQLiteIDBCursor::advance):
657         (WebCore::IDBServer::SQLiteIDBCursor::advanceUnique):
658         (WebCore::IDBServer::SQLiteIDBCursor::markAsErrored):
659         (WebCore::IDBServer::SQLiteIDBCursor::internalAdvanceOnce):
660         (WebCore::IDBServer::SQLiteIDBCursor::iterate):
661         
662         * Modules/indexeddb/server/SQLiteIDBCursor.h:
663         (WebCore::IDBServer::SQLiteIDBCursor::currentRecordRowID):
664         (WebCore::IDBServer::SQLiteIDBCursor::currentKey):
665         (WebCore::IDBServer::SQLiteIDBCursor::currentPrimaryKey):
666         (WebCore::IDBServer::SQLiteIDBCursor::currentValue):
667         (WebCore::IDBServer::SQLiteIDBCursor::didComplete):
668         (WebCore::IDBServer::SQLiteIDBCursor::didError):
669
670 2016-12-16  Jer Noble  <jer.noble@apple.com>
671
672         Follow-up build fix after r209936; also rename MockCDM -> LegacyMockCDM in
673         CMakeLists.txt.
674
675         * CMakeLists.txt:
676
677 2016-12-16  Sam Weinig  <sam@webkit.org>
678
679         [Bindings] Remove use of Dictionary/ArrayValue in CDMSessionClearKey
680         https://bugs.webkit.org/show_bug.cgi?id=165961
681
682         Reviewed by Darin Adler.
683
684         * CMakeLists.txt:
685         * WebCore.xcodeproj/project.pbxproj:
686         * bindings/js/JSBindingsAllInOne.cpp:
687         Remove ArrayValue.h/cpp
688
689         * bindings/js/ArrayValue.cpp: Removed.
690         * bindings/js/ArrayValue.h: Removed.
691
692         * bindings/js/Dictionary.cpp:
693         * bindings/js/Dictionary.h:
694         Remove support for ArrayValue.
695
696         * Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp:
697         (WebCore::CDMSessionClearKey::update):
698         Replace use of Dictionary/ArrayValue with direct JSObject functions. This
699         should really be replaced with a JSON parser that does not require round
700         tripping through JavaScript objects.
701
702 2016-12-13  Jer Noble  <jer.noble@apple.com>
703
704         Move existing CDM* implementations into modules/encryptedmedia/legacy
705         https://bugs.webkit.org/show_bug.cgi?id=165823
706
707         Rubber-stamped by Sam Weinig.
708
709         * Modules/encryptedmedia/legacy/LegacyCDM.cpp: Renamed from Source/WebCore/Modules/encryptedmedia/CDM.cpp.
710         (WebCore::CDMFactory::CDMFactory):
711         (WebCore::installedCDMFactories):
712         (WebCore::CDM::registerCDMFactory):
713         (WebCore::CDMFactoryForKeySystem):
714         (WebCore::CDM::supportsKeySystem):
715         (WebCore::CDM::keySystemSupportsMimeType):
716         (WebCore::CDM::create):
717         (WebCore::CDM::CDM):
718         (WebCore::CDM::~CDM):
719         (WebCore::CDM::supportsMIMEType):
720         (WebCore::CDM::createSession):
721         (WebCore::CDM::mediaPlayer):
722         * Modules/encryptedmedia/legacy/LegacyCDM.h: Renamed from Source/WebCore/Modules/encryptedmedia/CDM.h.
723         (WebCore::CDMClient::~CDMClient):
724         (WebCore::CDM::keySystem):
725         (WebCore::CDM::client):
726         (WebCore::CDM::setClient):
727         * Modules/encryptedmedia/legacy/LegacyCDMPrivate.h: Renamed from Source/WebCore/Modules/encryptedmedia/CDMPrivate.h.
728         (WebCore::CDMPrivateInterface::CDMPrivateInterface):
729         (WebCore::CDMPrivateInterface::~CDMPrivateInterface):
730         * Modules/encryptedmedia/legacy/LegacyCDMPrivateClearKey.cpp: Renamed from Source/WebCore/Modules/encryptedmedia/CDMPrivateClearKey.cpp.
731         (WebCore::CDMPrivateClearKey::supportsKeySystem):
732         (WebCore::CDMPrivateClearKey::supportsKeySystemAndMimeType):
733         (WebCore::CDMPrivateClearKey::supportsMIMEType):
734         (WebCore::CDMPrivateClearKey::createSession):
735         * Modules/encryptedmedia/legacy/LegacyCDMPrivateClearKey.h: Renamed from Source/WebCore/Modules/encryptedmedia/CDMPrivateClearKey.h.
736         (WebCore::CDMPrivateClearKey::CDMPrivateClearKey):
737         (WebCore::CDMPrivateClearKey::~CDMPrivateClearKey):
738         * Modules/encryptedmedia/legacy/LegacyCDMPrivateMediaPlayer.cpp: Renamed from Source/WebCore/Modules/encryptedmedia/CDMPrivateMediaPlayer.cpp.
739         (WebCore::CDMPrivateMediaPlayer::supportsKeySystem):
740         (WebCore::CDMPrivateMediaPlayer::supportsKeySystemAndMimeType):
741         (WebCore::CDMPrivateMediaPlayer::supportsMIMEType):
742         (WebCore::CDMPrivateMediaPlayer::createSession):
743         * Modules/encryptedmedia/legacy/LegacyCDMPrivateMediaPlayer.h: Renamed from Source/WebCore/Modules/encryptedmedia/CDMPrivateMediaPlayer.h.
744         (WebCore::CDMPrivateMediaPlayer::CDMPrivateMediaPlayer):
745         (WebCore::CDMPrivateMediaPlayer::~CDMPrivateMediaPlayer):
746         (WebCore::CDMPrivateMediaPlayer::cdm):
747         * Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp: Renamed from Source/WebCore/Modules/encryptedmedia/CDMSessionClearKey.cpp.
748         (WebCore::clearKeyVM):
749         (WebCore::CDMSessionClearKey::CDMSessionClearKey):
750         (WebCore::CDMSessionClearKey::~CDMSessionClearKey):
751         (WebCore::CDMSessionClearKey::generateKeyRequest):
752         (WebCore::CDMSessionClearKey::releaseKeys):
753         (WebCore::CDMSessionClearKey::update):
754         (WebCore::CDMSessionClearKey::cachedKeyForKeyID):
755         * Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.h: Renamed from Source/WebCore/Modules/encryptedmedia/CDMSessionClearKey.h.
756         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.h:
757         * Modules/encryptedmedia/legacy/WebKitMediaKeys.h:
758         * WebCore.xcodeproj/project.pbxproj:
759         * platform/graphics/LegacyCDMSession.h: Renamed from Source/WebCore/platform/graphics/CDMSession.h.
760         (WebCore::CDMSessionClient::~CDMSessionClient):
761         (WebCore::CDMSession::CDMSession):
762         (WebCore::CDMSession::~CDMSession):
763         (WebCore::CDMSession::type):
764         (WebCore::CDMSession::cachedKeyForKeyID):
765         * platform/graphics/MediaPlayer.h:
766         * platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.h:
767         * platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm:
768         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
769         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h:
770         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
771         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
772         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
773         * testing/Internals.cpp:
774         * testing/LegacyMockCDM.cpp: Renamed from Source/WebCore/testing/MockCDM.cpp.
775         (WebCore::MockCDMSession::~MockCDMSession):
776         (WebCore::MockCDM::supportsKeySystem):
777         (WebCore::MockCDM::supportsKeySystemAndMimeType):
778         (WebCore::MockCDM::supportsMIMEType):
779         (WebCore::MockCDM::createSession):
780         (WebCore::initDataPrefix):
781         (WebCore::keyPrefix):
782         (WebCore::keyRequest):
783         (WebCore::generateSessionId):
784         (WebCore::MockCDMSession::MockCDMSession):
785         (WebCore::MockCDMSession::generateKeyRequest):
786         (WebCore::MockCDMSession::releaseKeys):
787         (WebCore::MockCDMSession::update):
788         * testing/LegacyMockCDM.h: Renamed from Source/WebCore/testing/MockCDM.h.
789         (WebCore::MockCDM::MockCDM):
790         (WebCore::MockCDM::~MockCDM):
791
792 2016-12-16  Andreas Kling  <akling@apple.com>
793
794         Subframes going into page cache don't need to resetScrollbars().
795         <https://webkit.org/b/163750>
796         <rdar://problem/29273020>
797
798         Reviewed by Antti Koivisto.
799
800         The main frame is the only frame that switches its FrameView when using the page cache,
801         subframes just suspend their DOM and wait around to be either killed or restored.
802
803         Thus there is no reason for subframes to reset their FrameView's scrollbars when going
804         into page cache, since nothing affects them while cached, and their layout should end up
805         identical when restoring.
806
807         This was causing some flakiness with subframe scrollbars jumping between different sizes
808         in when restoring from page cache in macOS/WK1. This change makes the behavior consistent
809         in both WK1 and WK2, and removes the flakiness.
810
811         * dom/Document.cpp:
812         (WebCore::Document::setPageCacheState):
813
814 2016-12-16  Wenson Hsieh  <wenson_hsieh@apple.com>
815
816         Visual viewports: carets and selection UI are incorrectly positioned when editing fixed elements
817         https://bugs.webkit.org/show_bug.cgi?id=165767
818         <rdar://problem/29602382>
819
820         Reviewed by Simon Fraser.
821
822         When changing the layout viewport override, mark viewport-constrained objects as needing layout. If only the
823         width and height of the old and new layout viewports are compared, EditorState info (namely selection and caret
824         rects) that depends on the document location of fixed elements may be stale immediately after the layout
825         viewport override changes and before layout occurs.
826
827         This caused one of the tests (fixed-caret-position-after-scroll.html) to occasionally fail.
828
829         Tests: editing/caret/ios/absolute-caret-position-after-scroll.html
830                editing/caret/ios/fixed-caret-position-after-scroll.html
831                editing/selection/ios/absolute-selection-after-scroll.html
832                editing/selection/ios/fixed-selection-after-scroll.html
833
834         * page/FrameView.cpp:
835         (WebCore::FrameView::setLayoutViewportOverrideRect):
836
837 2016-12-14  Sam Weinig  <sam@webkit.org>
838
839         [ApplePay] Remove remaining custom bindings from the ApplePay code
840         https://bugs.webkit.org/show_bug.cgi?id=165860
841
842         Reviewed by Darin Adler.
843
844         * DerivedSources.make:
845         Add new IDL files.
846
847         * WebCore.xcodeproj/project.pbxproj:
848         Add/remove files.
849
850         * bindings/js/JSApplePayPaymentAuthorizedEventCustom.cpp: Removed.
851         * bindings/js/JSApplePayPaymentMethodSelectedEventCustom.cpp: Removed.
852         * bindings/js/JSApplePayShippingContactSelectedEventCustom.cpp: Removed.
853         * bindings/js/JSApplePayShippingMethodSelectedEventCustom.cpp: Removed.
854         Remove custom bindings.
855
856         * Modules/applepay/ApplePayLineItem.h: Added.
857         * Modules/applepay/ApplePayLineItem.idl: Added.
858         * Modules/applepay/ApplePayPayment.h: Added.
859         * Modules/applepay/ApplePayPayment.idl: Added.
860         * Modules/applepay/ApplePayPaymentContact.h: Added.
861         * Modules/applepay/ApplePayPaymentContact.idl: Added.
862         * Modules/applepay/ApplePayPaymentMethod.h: Added.
863         * Modules/applepay/ApplePayPaymentMethod.idl: Added.
864         * Modules/applepay/ApplePayPaymentPass.h: Added.
865         * Modules/applepay/ApplePayPaymentPass.idl: Added.
866         * Modules/applepay/ApplePayPaymentRequest.h: Added.
867         * Modules/applepay/ApplePayPaymentRequest.idl: Added.
868         * Modules/applepay/ApplePayShippingMethod.h: Added.
869         * Modules/applepay/ApplePayShippingMethod.idl: Added.
870         Split out dictionaries and enums into separate files where needed.
871
872         * Modules/applepay/ApplePayPaymentAuthorizedEvent.cpp:
873         (WebCore::ApplePayPaymentAuthorizedEvent::ApplePayPaymentAuthorizedEvent):
874         * Modules/applepay/ApplePayPaymentAuthorizedEvent.h:
875         * Modules/applepay/ApplePayPaymentAuthorizedEvent.idl:
876         Convert the 'payment' property to return an ApplePayPayment dictionary, removing
877         the need for custom bindings.
878
879         * Modules/applepay/ApplePayPaymentMethodSelectedEvent.cpp:
880         (WebCore::ApplePayPaymentMethodSelectedEvent::ApplePayPaymentMethodSelectedEvent):
881         * Modules/applepay/ApplePayPaymentMethodSelectedEvent.h:
882         * Modules/applepay/ApplePayPaymentMethodSelectedEvent.idl:
883         Convert the 'paymentMethod' property to return an ApplePayPaymentMethod dictionary, removing
884         the need for custom bindings.
885
886         * Modules/applepay/ApplePaySession.cpp:
887         (WebCore::convertAndValidate):
888         (WebCore::ApplePaySession::create):
889         (WebCore::ApplePaySession::ApplePaySession):
890         (WebCore::ApplePaySession::completeShippingMethodSelection):
891         (WebCore::ApplePaySession::completeShippingContactSelection):
892         (WebCore::ApplePaySession::completePaymentMethodSelection):
893         (WebCore::ApplePaySession::didSelectShippingMethod):
894         * Modules/applepay/ApplePaySession.h:
895         Update for new names, remove need for ExecState in the create function, and simplify
896         billingContact and shippingContact now that they are strongly typed.
897
898         * Modules/applepay/ApplePaySession.idl:
899         Move dictionaries and enums to their own files.
900
901         * Modules/applepay/ApplePayShippingContactSelectedEvent.cpp:
902         (WebCore::ApplePayShippingContactSelectedEvent::ApplePayShippingContactSelectedEvent):
903         * Modules/applepay/ApplePayShippingContactSelectedEvent.h:
904         * Modules/applepay/ApplePayShippingContactSelectedEvent.idl:
905         Convert the 'shippingContact' property to return an ApplePayPaymentContact dictionary, removing
906         the need for custom bindings.
907
908         * Modules/applepay/ApplePayShippingMethodSelectedEvent.cpp:
909         * Modules/applepay/ApplePayShippingMethodSelectedEvent.h:
910         * Modules/applepay/ApplePayShippingMethodSelectedEvent.idl:
911         Convert the 'shippingMethod' property to return an ApplePayShippingMethod dictionary, removing
912         the need for custom bindings.
913
914         * Modules/applepay/Payment.h:
915         * Modules/applepay/PaymentContact.h:
916         * Modules/applepay/PaymentMethod.h:
917         * Modules/applepay/cocoa/PaymentCocoa.mm:
918         * Modules/applepay/cocoa/PaymentContactCocoa.mm:
919         * Modules/applepay/cocoa/PaymentMethodCocoa.mm:
920         Replace toJS/fromJS functions with ones that convert to/from the associated dictionary type.
921
922         * bindings/generic/IDLTypes.h:
923         (WebCore::IDLJSON::nullValue):
924         (WebCore::IDLJSON::isNullValue):
925         (WebCore::IDLJSON::extractValueFromNullable):
926         * bindings/js/JSDOMConvert.h:
927         (WebCore::Converter<IDLJSON>::convert):
928         (WebCore::JSConverter<IDLJSON>::convert):
929         Add a new custom type, JSON, which converts from a String to a JS object.
930
931         * bindings/scripts/CodeGenerator.pm:
932         * bindings/scripts/CodeGeneratorJS.pm:
933         Add support for the new JSON type, and improve scoped naming to allow for enums
934         in dictionary only IDL files.
935
936         * bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
937         Update test result for improved scoped naming.
938
939 2016-12-16  Zalan Bujtas  <zalan@apple.com>
940
941         Defer certain accessibility callbacks until after layout is finished.
942         https://bugs.webkit.org/show_bug.cgi?id=165861
943         rdar://problem/29646301
944
945         Reviewed by Chris Fleizach.
946
947         Currently with certain AXObjectCache callbacks, we can end up in a layout while the render tree is being mutated.  
948         This patch ensures that such callbacks are deferred until after tree mutation/layout is finished.
949
950         Test: accessibility/accessibility-crash-with-dynamic-inline-content.html
951
952         * accessibility/AXObjectCache.cpp:
953         (WebCore::AXObjectCache::remove):
954         (WebCore::AXObjectCache::performDeferredIsIgnoredChange):
955         (WebCore::AXObjectCache::insertDeferredIsIgnoredChange):
956         * accessibility/AXObjectCache.h:
957         * page/FrameView.cpp:
958         (WebCore::FrameView::performPostLayoutTasks):
959         * rendering/RenderBlock.cpp:
960         (WebCore::RenderBlock::deleteLines):
961         * rendering/RenderBlockLineLayout.cpp:
962         (WebCore::RenderBlockFlow::createAndAppendRootInlineBox):
963
964 2016-12-16  Ryan Haddad  <ryanhaddad@apple.com>
965
966         Rebaseline bindings tests after r209897.
967
968         Unreviewed test gardening.
969
970         * bindings/scripts/test/JS/JSTestObj.cpp:
971         (WebCore::JSTestObj::visitChildren):
972         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
973         (WebCore::JSTestSerializedScriptValueInterface::visitChildren):
974
975 2016-12-15  Brent Fulgham  <bfulgham@apple.com>
976
977         Arguments called in wrong order
978         https://bugs.webkit.org/show_bug.cgi?id=165923
979
980         Reviewed by Simon Fraser.
981
982         Correct the ordering of several function calls.
983
984         * Modules/mediasource/SourceBuffer.cpp:
985         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample): The 'nearestToPresentationStartTime'
986         argument is being checked for validity, but 'nearestToPresentationEndTime' is being used in the
987         calculation. This seems like a copy/paste error.
988         * page/PrintContext.cpp:
989         (WebCore::PrintContext::outputLinkedDestinations): FloatPoint::expandedTo returns a new object that
990         has been expanded. This code continued using the 'unexpanded' point.
991         * platform/graphics/GraphicsContext3D.cpp:
992         (WebCore::GraphicsContext3D::computeImageSizeInBytes): The 'bytesPerComponent' and 'componentsPerPixel'
993         variables were being passed in the wrong order.
994         * platform/network/CacheValidation.cpp: The 'last-modified' header string was being concatenated with
995         the following string, resulting in an incorrect 'last-modifiedproxy-authenticate' string value.
996         * svg/SVGToOTFFontConversion.cpp:
997         (WebCore::SVGToOTFFontConverter::firstGlyph): The ASSERT was assigning to the (by-value) input
998         parameter 'codePoint', rather than comparing it to the firstGlyph value's codePoint.
999
1000 2016-12-16  Youenn Fablet  <youenn@apple.com>
1001
1002         [Fetch API] Improve resource loading console logging
1003         https://bugs.webkit.org/show_bug.cgi?id=160546
1004
1005         Reviewed by Alex Christensen.
1006
1007         Covered by rebased tests.
1008
1009         Adding support for logging of resource loading failures in ThreadableLoader.
1010         This will allow doing consistent logging for clients such as fetch, XHR, event source...
1011
1012         Doing logging for Fetch API only at the moment in ThreadableLoader.
1013         Future patches should migrate XHR to this logging system.
1014
1015         Logging routine is implemented in ThreadableLoader.
1016         It is used directly by DocumentThreadableLoader before calling didFail client callback.
1017         DocumentThreadableLoader has a new option to not log errors, in the case the client is WorkerThreadableLoader::MainBridge.
1018         In that case, the logging is done in the worker context within WorkerThreadableLoader::MainBridge::didFail
1019
1020         * loader/DocumentThreadableLoader.cpp:
1021         (WebCore::DocumentThreadableLoader::loadResourceSynchronously): Enable logging.
1022         (WebCore::DocumentThreadableLoader::create): Passing logging parameter to constructor.
1023         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader): Adding initialization of logging parameter.
1024         (WebCore::DocumentThreadableLoader::makeSimpleCrossOriginAccessRequest): Making use of the new logErrorAndFail helper routine.
1025         (WebCore::DocumentThreadableLoader::cancel): No need to log error if it is being cancelled.
1026         (WebCore::DocumentThreadableLoader::redirectReceived): Made the reportXX routines methods of DocumentThreadableLoaders and using logErrorAndFail internally.
1027         (WebCore::DocumentThreadableLoader::didFail): Wrapper around logErrorAndFail since cancel is not calling it anymore.
1028         (WebCore::DocumentThreadableLoader::preflightFailure):
1029         (WebCore::DocumentThreadableLoader::loadRequest):
1030         (WebCore::DocumentThreadableLoader::reportRedirectionWithBadScheme):
1031         (WebCore::DocumentThreadableLoader::reportContentSecurityPolicyError):
1032         (WebCore::DocumentThreadableLoader::reportCrossOriginResourceSharingError):
1033         (WebCore::DocumentThreadableLoader::logErrorAndFail):
1034         (WebCore::reportContentSecurityPolicyError): Deleted.
1035         (WebCore::reportCrossOriginResourceSharingError): Deleted.
1036         (WebCore::reportRedirectionWithBadScheme): Deleted.
1037         * loader/DocumentThreadableLoader.h:
1038         * loader/ThreadableLoader.cpp:
1039         (WebCore::ThreadableLoader::logError):
1040         * loader/ThreadableLoader.h:
1041         * loader/ThreadableLoaderClientWrapper.h:
1042         (WebCore::ThreadableLoaderClientWrapper::create):
1043         (WebCore::ThreadableLoaderClientWrapper::initiator):
1044         (WebCore::ThreadableLoaderClientWrapper::ThreadableLoaderClientWrapper):
1045         * loader/WorkerThreadableLoader.cpp:
1046         (WebCore::WorkerThreadableLoader::WorkerThreadableLoader):
1047         (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge):
1048         (WebCore::WorkerThreadableLoader::MainThreadBridge::didFail):
1049
1050 2016-12-16  Enrique Ocaña González  <eocanha@igalia.com>
1051
1052         [GStreamer][MSE] Fix build warning in MediaPlayerPrivateGStreamer.cpp using gcc 6.2
1053         https://bugs.webkit.org/show_bug.cgi?id=165900
1054
1055         Reviewed by Žan Doberšek.
1056
1057         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
1058         (WebCore::MediaPlayerPrivateGStreamerMSE::supportsCodecs):
1059         Move the variable asignation out of the if condition.
1060
1061 2016-12-16  Romain Bellessort  <romain.bellessort@crf.canon.fr>
1062
1063         [Readable Streams API] Implement ReadableByteStreamController cancel internal method
1064         https://bugs.webkit.org/show_bug.cgi?id=165798
1065
1066         Reviewed by Youenn Fablet.
1067
1068         Implemented cancel method of ReadableByteStreamController.
1069         Also fixed small inconsistency in readableByteStreamControllerClose.
1070
1071         Added one test to check cancel behaviour. More tests may be added as the API is implemented.
1072
1073         * Modules/streams/ReadableByteStreamInternals.js:
1074         (privateInitializeReadableByteStreamController): Define cancel internal method.
1075         (readableByteStreamControllerCancel): Added.
1076         (readableByteStreamControllerClose): Fixed behaviour (no value should be dequeued).
1077         * bindings/js/WebCoreBuiltinNames.h: Removed bytesFilled (previous addition was not needed).
1078
1079 2016-12-16  Youenn Fablet  <youennf@gmail.com>
1080
1081         svg/as-image/svg-image-with-data-uri-use-data-uri.svg is flaky after r207754
1082         https://bugs.webkit.org/show_bug.cgi?id=163887
1083         <rdar://problem/29266436>
1084
1085         Reviewed by Alex Christensen.
1086
1087         Test: http/tests/security/cross-origin-cached-images-with-memory-pressure.html
1088
1089         With the introduction of cached resource cloning, an Image may be referenced by several CachedImage.
1090         This did not work well with Image observer system as it mandates a one-to-one relationship.
1091
1092         Introducing CachedImageObserver to restore the one-to-one relationship between Image and its observer.
1093         CachedImageObserver can keep references for more than one CachedImage.
1094
1095         In the future, it might be better to split more clearly CachedImageObserver and its API from CachedImage.
1096         Or remove the concept of CachedResource cloning and find new ways to provide CachedResource origin information to clients.
1097
1098         * loader/cache/CachedImage.cpp:
1099         (WebCore::CachedImage::load): Moved boolean image observer fields to CachedImageObserver.
1100         (WebCore::CachedImage::setBodyDataFrom): Keeping a reference of the image observer when cloning the resource.
1101         (WebCore::CachedImage::createImage): Creating the observer when creating the image.
1102         (WebCore::CachedImage::CachedImageObserver::CachedImageObserver):
1103         (WebCore::CachedImage::CachedImageObserver::decodedSizeChanged):
1104         (WebCore::CachedImage::CachedImageObserver::didDraw):
1105         (WebCore::CachedImage::CachedImageObserver::animationAdvanced):
1106         (WebCore::CachedImage::CachedImageObserver::changedInRect):
1107         (WebCore::CachedImage::clearImage):
1108         * loader/cache/CachedImage.h:
1109         * loader/cache/CachedResource.cpp:
1110         (WebCore::CachedResource::setBodyDataFrom): Now that each cached image receives decodedSizeChanged callback, we need to set its size correctly.
1111
1112 2016-12-15  Joonghun Park  <jh718.park@samsung.com>
1113
1114         [EFL] Fix debug build break since r209873. Unreviewed.
1115         https://bugs.webkit.org/show_bug.cgi?id=165945
1116
1117         No new tests, no new behaviours.
1118
1119         Use Primitive System Data Type uint64_t instead of unsigned long long.
1120
1121         * Modules/indexeddb/IDBFactory.cpp:
1122         (WebCore::IDBFactory::openInternal):
1123         * Modules/indexeddb/IDBFactory.h:
1124
1125 2016-12-15  Zalan Bujtas  <zalan@apple.com>
1126
1127         text-align: justify and word-spacing combine to overflow column
1128         https://bugs.webkit.org/show_bug.cgi?id=165796
1129         rdar://problem/29672168
1130
1131         Reviewed by Myles C. Maxfield.
1132
1133         The value of the word-spacing property is not applied on the inline-tree boxes (normal line layout)
1134         with kerning enabled. It causes hittest failures and selection/rendering glitches.
1135         We normally use the pre-computed 'WordMeasurements' values to figure out the run widths. However
1136         with kerning on, in some cases we need to re-measure a certain part of the text by calling RenderText::width().
1137         This function omits the word-spacing value for leading whitespace, so when this text fragment starts with a whitespace,
1138         (while it's not at the beginning of the run) we have to manually add the word-spacing value back.
1139         r146087 added this logic with the restriction of applying it only to whitespace-only runs.
1140
1141         Test: fast/css/word-spacing-with-normal-layout.html
1142
1143         * rendering/RenderBlockLineLayout.cpp:
1144         (WebCore::setLogicalWidthForTextRun):
1145
1146 2016-12-15  Myles C. Maxfield  <mmaxfield@apple.com>
1147
1148         Stop reinterpret_casting UBreakIterators to the undefined type TextBreakIterator
1149         https://bugs.webkit.org/show_bug.cgi?id=165931
1150
1151         Reviewed by Alex Christensen.
1152
1153         No new tests because there is no behavior change.
1154
1155         * dom/CharacterData.cpp:
1156         (WebCore::CharacterData::parserAppendData):
1157         * editing/TextCheckingHelper.cpp:
1158         (WebCore::findMisspellings):
1159         * editing/VisibleUnits.cpp:
1160         (WebCore::wordBreakIteratorForMinOffsetBoundary):
1161         (WebCore::wordBreakIteratorForMaxOffsetBoundary):
1162         (WebCore::isLogicalStartOfWord):
1163         (WebCore::islogicalEndOfWord):
1164         (WebCore::visualWordPosition):
1165         (WebCore::startSentenceBoundary):
1166         (WebCore::endSentenceBoundary):
1167         (WebCore::previousSentencePositionBoundary):
1168         (WebCore::nextSentencePositionBoundary):
1169         * html/HTMLInputElement.cpp:
1170         * html/HTMLTextAreaElement.cpp:
1171         * html/InputType.cpp:
1172         * html/TextFieldInputType.cpp:
1173         * html/TextInputType.cpp:
1174         * platform/graphics/StringTruncator.cpp:
1175         (WebCore::textBreakAtOrPreceding):
1176         (WebCore::boundedTextBreakFollowing):
1177         (WebCore::rightClipToWordBuffer):
1178         * platform/graphics/mac/ComplexTextController.cpp:
1179         (WebCore::ComplexTextController::offsetForPosition):
1180         * platform/text/TextBoundaries.cpp:
1181         (WebCore::findNextWordFromIndex):
1182         (WebCore::findWordBoundary):
1183         (WebCore::findEndWordBoundary):
1184         * platform/text/mac/TextBoundaries.mm:
1185         (WebCore::findNextWordFromIndex):
1186         * rendering/BreakLines.h:
1187         (WebCore::nextBreakablePositionNonLoosely):
1188         (WebCore::nextBreakablePositionLoosely):
1189         * rendering/RenderBlock.cpp:
1190         * rendering/RenderText.cpp:
1191         (WebCore::makeCapitalized):
1192         (WebCore::RenderText::previousOffset):
1193         (WebCore::RenderText::previousOffsetForBackwardDeletion):
1194         (WebCore::RenderText::nextOffset):
1195         * rendering/SimpleLineLayoutTextFragmentIterator.h:
1196         * rendering/line/LineBreaker.h:
1197
1198 2016-12-15  Darin Adler  <darin@apple.com>
1199
1200         Use asString instead of toWTFString, toString, or getString when we already checked isString
1201         https://bugs.webkit.org/show_bug.cgi?id=165895
1202
1203         Reviewed by Yusuke Suzuki.
1204
1205         * Modules/fetch/FetchBody.cpp:
1206         (WebCore::FetchBody::extract): Use asString/value instead of toWTFString.
1207
1208         * Modules/mediastream/SDPProcessor.cpp:
1209         (WebCore::SDPProcessor::callScript): Use asString/value instead of getString.
1210
1211         * bindings/js/ArrayValue.cpp:
1212         (WebCore::ArrayValue::get): Use asString/value instead of toWTFString.
1213
1214         * bindings/js/IDBBindingUtilities.cpp:
1215         (WebCore::get): Use asString/length instead of toString/length.
1216         (WebCore::createIDBKeyFromValue): Use asString/value instead of toWTFString.
1217         * bindings/js/JSCryptoAlgorithmDictionary.cpp:
1218         (WebCore::JSCryptoAlgorithmDictionary::getAlgorithmIdentifier): Ditto.
1219         * bindings/js/JSDataCueCustom.cpp:
1220         (WebCore::constructJSDataCue): Use asString/value instead of getString.
1221         * bindings/js/JSInspectorFrontendHostCustom.cpp:
1222         (WebCore::populateContextMenuItems): Use asString/value instead of toWTFString.
1223
1224         * bindings/js/ScriptController.cpp:
1225         (WebCore::jsValueToModuleKey): Use asString/toIdentifier instead of
1226         jsCast<JSString*>/value/Identifier::fromString.
1227
1228         * bindings/js/SerializedScriptValue.cpp:
1229         (WebCore::CloneSerializer::dumpIfTerminal): Streamline by getting rid of local variable.
1230
1231         * contentextensions/ContentExtensionParser.cpp:
1232         (WebCore::ContentExtensions::getDomainList): Use asString instead of jsCast<JSString*>.
1233         (WebCore::ContentExtensions::loadTrigger): Use asString/value instead of toWTFString.
1234         (WebCore::ContentExtensions::loadAction): Ditto.
1235
1236         * css/FontFace.cpp:
1237         (WebCore::FontFace::create): Use asString/value instead of getString.
1238
1239 2016-12-15  Zalan Bujtas  <zalan@apple.com>
1240
1241         Change ::computeLogicalHeight's computedValues out argument to the return value.
1242         https://bugs.webkit.org/show_bug.cgi?id=165789
1243
1244         Reviewed by Simon Fraser.
1245
1246         No change in functionality.
1247
1248         * html/shadow/SliderThumbElement.cpp:
1249         (WebCore::RenderSliderContainer::computeLogicalHeight):
1250         * html/shadow/mac/ImageControlsButtonElementMac.cpp:
1251         (WebCore::RenderImageControlsButton::computeLogicalHeight):
1252         * html/shadow/mac/ImageControlsRootElementMac.cpp:
1253         (WebCore::RenderImageControls::computeLogicalHeight):
1254         * rendering/RenderBlock.cpp:
1255         (WebCore::RenderBlock::computeBlockPreferredLogicalWidths):
1256         (WebCore::RenderBlock::estimateRegionRangeForBoxChild):
1257         * rendering/RenderBlockFlow.cpp:
1258         (WebCore::RenderBlockFlow::checkForPaginationLogicalHeightChange):
1259         * rendering/RenderBox.cpp:
1260         (WebCore::RenderBox::updateLogicalHeight):
1261         (WebCore::RenderBox::computeLogicalHeight):
1262         (WebCore::RenderBox::computePercentageLogicalHeight):
1263         (WebCore::RenderBox::computeReplacedLogicalHeightUsing):
1264         (WebCore::RenderBox::availableLogicalHeightUsing):
1265         * rendering/RenderBox.h:
1266         (WebCore::RenderBox::ComputedMarginValues::ComputedMarginValues): Deleted.
1267         (WebCore::RenderBox::LogicalExtentComputedValues::LogicalExtentComputedValues): Deleted.
1268         * rendering/RenderFlexibleBox.cpp:
1269         (WebCore::RenderFlexibleBox::mainAxisContentExtent):
1270         * rendering/RenderFlowThread.cpp:
1271         (WebCore::RenderFlowThread::computeLogicalHeight):
1272         * rendering/RenderFlowThread.h:
1273         * rendering/RenderListBox.cpp:
1274         (WebCore::RenderListBox::computeLogicalHeight):
1275         * rendering/RenderListBox.h:
1276         * rendering/RenderMeter.cpp:
1277         (WebCore::RenderMeter::computeLogicalHeight):
1278         * rendering/RenderMeter.h:
1279         * rendering/RenderMultiColumnFlowThread.cpp:
1280         (WebCore::RenderMultiColumnFlowThread::computeLogicalHeight):
1281         * rendering/RenderMultiColumnFlowThread.h:
1282         * rendering/RenderMultiColumnSet.cpp:
1283         (WebCore::RenderMultiColumnSet::computeLogicalHeight):
1284         * rendering/RenderMultiColumnSet.h:
1285         * rendering/RenderProgress.cpp:
1286         (WebCore::RenderProgress::computeLogicalHeight):
1287         * rendering/RenderProgress.h:
1288         * rendering/RenderTextControl.cpp:
1289         (WebCore::RenderTextControl::computeLogicalHeight):
1290         * rendering/RenderTextControl.h:
1291         * rendering/RenderView.cpp:
1292         (WebCore::RenderView::computeLogicalHeight):
1293         * rendering/RenderView.h:
1294         * rendering/svg/RenderSVGForeignObject.cpp:
1295         (WebCore::RenderSVGForeignObject::computeLogicalHeight):
1296         * rendering/svg/RenderSVGForeignObject.h:
1297
1298 2016-12-15  Chris Dumez  <cdumez@apple.com>
1299
1300         Make sure HTML validation bubble's state is updated after layout
1301         https://bugs.webkit.org/show_bug.cgi?id=165922
1302         <rdar://problem/29694730>
1303
1304         Reviewed by Simon Fraser.
1305
1306         Make sure HTML validation bubble's state is updated after layout.
1307         In particular, if the validation bubble's associated element has
1308         moved or is no longer visible, we now hide the bubble.
1309
1310         Tests: fast/forms/validation-bubble-disappears-when-input-detached.html
1311                fast/forms/validation-bubble-disappears-when-input-moved.html
1312                fast/forms/validation-bubble-disappears-when-input-no-longer-visible.html
1313
1314         * page/FrameView.cpp:
1315         (WebCore::FrameView::viewportContentsChanged):
1316         * page/Page.cpp:
1317         (WebCore::Page::updateValidationBubbleStateIfNeeded):
1318         * page/Page.h:
1319         * page/ValidationMessageClient.h:
1320
1321 2016-12-15  Sam Weinig  <sam@webkit.org>
1322
1323         [WebIDL] Remove use of Dictionary from JSCryptoAlgorithmDictionary
1324         https://bugs.webkit.org/show_bug.cgi?id=165919
1325
1326         Reviewed by Darin Adler.
1327
1328         * bindings/js/JSCryptoAlgorithmDictionary.cpp:
1329         * bindings/js/JSCryptoAlgorithmDictionary.h:
1330         * bindings/js/JSCryptoOperationData.cpp:
1331         * bindings/js/JSCryptoOperationData.h:
1332         * bindings/js/JSWebKitSubtleCryptoCustom.cpp:
1333         Replace simplistic use of Dictionary with simplistic use of direct JSObject
1334         functions. Also, pass the ExecState by reference.
1335
1336 2016-12-15  Filip Pizlo  <fpizlo@apple.com>
1337
1338         Get rid of HeapRootVisitor and make SlotVisitor less painful to use
1339         https://bugs.webkit.org/show_bug.cgi?id=165911
1340
1341         Reviewed by Geoffrey Garen.
1342
1343         No new tests because no new behavior.
1344         
1345         This updates WebCore code to new JSC API.
1346
1347         * bindings/js/JSDOMBinding.cpp:
1348         (WebCore::DOMConstructorJSBuiltinObject::visitChildren):
1349         * bindings/js/JSDOMGlobalObject.cpp:
1350         (WebCore::JSDOMGlobalObject::visitChildren):
1351         * bindings/js/JSDOMPromise.h:
1352         (WebCore::DeferredPromise::visitAggregate):
1353         * bindings/js/JSEventListener.cpp:
1354         (WebCore::JSEventListener::visitJSFunction):
1355         * bindings/js/JSWorkerGlobalScopeBase.cpp:
1356         (WebCore::JSWorkerGlobalScopeBase::visitChildren):
1357         * bindings/scripts/CodeGeneratorJS.pm:
1358         (GenerateImplementation):
1359
1360 2016-12-15  Myles C. Maxfield  <mmaxfield@apple.com>
1361
1362         Sort Xcode project files
1363         https://bugs.webkit.org/show_bug.cgi?id=165937
1364
1365         Reviewed by Simon Fraser.
1366
1367         No new tests because there is no behavior change.
1368
1369         * WebCore.xcodeproj/project.pbxproj:
1370
1371 2016-12-15  Chris Dumez  <cdumez@apple.com>
1372
1373         Move charCode / keyCode / which attributes from UIEvent to KeyboardEvent
1374         https://bugs.webkit.org/show_bug.cgi?id=165904
1375
1376         Reviewed by Sam Weinig.
1377
1378         Move 'charCode' / 'keyCode' attributes from UIEvent to KeyboardEvent and add
1379         'which' to KeyboardEvent to match the specification:
1380         - https://w3c.github.io/uievents/#legacy-interface-KeyboardEvent
1381
1382         We keep a 'which' attribute on UIEvent even though the specification does
1383         not say we should because Firefox and Chrome have 'which' on UIEvent still.
1384
1385         Specification:
1386         - 'charCode' / 'keyCode' / 'which' on KeyboardEvent only
1387
1388         Firefox:
1389         - 'charCode' / 'keyCode' on KeyboardEvent only
1390         - 'which' on UIEvent only
1391
1392         Chrome:
1393         - 'charCode' / 'keyCode' / 'which' on KeyboardEvent
1394         - 'which' on UIEvent as well
1395
1396         Old WebKit behavior:
1397         - 'charCode' / 'keyCode' / 'which' on UIEvent only
1398
1399         New WebKit behavior:
1400         - 'charCode' / 'keyCode' / 'which' on KeyboardEvent
1401         - 'which' on UIEvent as well
1402
1403         Our new behavior is identical to Chrome, much closer to the specification,
1404         and closer to Firefox as well.
1405
1406         No new tests, updated / rebaselined existing tests.
1407
1408         * dom/KeyboardEvent.cpp:
1409         (WebCore::KeyboardEvent::KeyboardEvent):
1410         (WebCore::KeyboardEvent::keyCode):
1411         (WebCore::KeyboardEvent::charCode):
1412         (WebCore::KeyboardEvent::which):
1413         * dom/KeyboardEvent.h:
1414         * dom/KeyboardEvent.idl:
1415         * dom/MouseEvent.cpp:
1416         (WebCore::MouseEvent::which):
1417         * dom/UIEvent.cpp:
1418         * dom/UIEvent.h:
1419         * dom/UIEvent.idl:
1420
1421 2016-12-15  Brady Eidson  <beidson@apple.com>
1422
1423         IndexedDB: Add an "IDBCursorRecord" struct.
1424         https://bugs.webkit.org/show_bug.cgi?id=165929
1425
1426         Reviewed by Alex Christensen.
1427
1428         No new tests (Refactor, no behavior change).
1429
1430         * Modules/indexeddb/server/SQLiteIDBCursor.cpp:
1431         (WebCore::IDBServer::SQLiteIDBCursor::currentData):
1432         (WebCore::IDBServer::SQLiteIDBCursor::resetAndRebindStatement):
1433         (WebCore::IDBServer::SQLiteIDBCursor::advanceUnique):
1434         (WebCore::IDBServer::SQLiteIDBCursor::internalAdvanceOnce):
1435         (WebCore::IDBServer::SQLiteIDBCursor::iterate):
1436         
1437         * Modules/indexeddb/server/SQLiteIDBCursor.h:
1438         (WebCore::IDBServer::SQLiteIDBCursor::currentKey):
1439         (WebCore::IDBServer::SQLiteIDBCursor::currentPrimaryKey):
1440         (WebCore::IDBServer::SQLiteIDBCursor::currentValue):
1441
1442         * Modules/indexeddb/shared/IDBCursorRecord.h: Added.
1443         (WebCore::IDBCursorRecord::encode):
1444         (WebCore::IDBCursorRecord::decode):
1445         
1446         * WebCore.xcodeproj/project.pbxproj:
1447
1448 2016-12-15  Keith Rollin  <krollin@apple.com>
1449
1450         Refactor Document::suspend/resume
1451         https://bugs.webkit.org/show_bug.cgi?id=165921
1452
1453         Reviewed by Chris Dumez.
1454
1455         Update Document::suspend to call Document::suspendScheduledTasks
1456         rather than duplicating the latter's code within itself. Similar
1457         treatment of Document::resume and Document::resumeScheduledTasks.
1458
1459         No new tests -- no new functionality, just refactoring existing code.
1460
1461         * dom/Document.cpp:
1462         (WebCore::Document::suspend):
1463         (WebCore::Document::resume):
1464
1465 2016-12-15  Alex Christensen  <achristensen@webkit.org>
1466
1467         Remove flex and bison build dependencies; commit generated XPath parser
1468         https://bugs.webkit.org/show_bug.cgi?id=165783
1469
1470         Reviewed by Brent Fulgham.
1471
1472         flex and bison are annoying to install and use, especially on Windows.
1473         Since only XPathGrammar uses them and that's not actively developed, let's just check in the one generated file
1474         and make building WebKit easier forever!
1475
1476         * CMakeLists.txt:
1477         * DerivedSources.make:
1478         * WebCore.xcodeproj/project.pbxproj:
1479         * css/makegrammar.pl: Removed.
1480         * xml/XPathGrammar.cpp: Added.
1481         (xpathyylex):
1482         (xpathyyerror):
1483         (yysyntax_error):
1484         * xml/XPathGrammar.h: Added.
1485         * xml/XPathGrammar.y: Rename TEXT to TEXT_ to fix a build error on Windows.  TEXT is already defined.
1486
1487 2016-12-15  Brady Eidson  <beidson@apple.com>
1488
1489         Enhance some of the logging statements just added for IndexedDB Operation scheduling.
1490
1491         Rubberstamped by Tim Horton.
1492
1493         No new tests (No behavior change).
1494
1495         * Modules/indexeddb/IDBTransaction.cpp:
1496         (WebCore::IDBTransaction::iterateCursor):
1497         (WebCore::IDBTransaction::requestGetRecord):
1498         (WebCore::IDBTransaction::requestIndexRecord):
1499         (WebCore::IDBTransaction::requestPutOrAdd):
1500         
1501         * Modules/indexeddb/shared/IDBCursorInfo.cpp:
1502         (WebCore::IDBCursorInfo::loggingString):
1503         
1504         * Modules/indexeddb/shared/IDBIterateCursorData.cpp:
1505         (WebCore::IDBIterateCursorData::loggingString):
1506
1507 2016-12-15  Myles C. Maxfield  <mmaxfield@apple.com>
1508
1509         [Cocoa] Implement font-synthesis: small-caps
1510         https://bugs.webkit.org/show_bug.cgi?id=165892
1511
1512         Reviewed by David Hyatt.
1513
1514         The CSS Fonts level 4 spec adds a new value to the "font-synthesis"
1515         property which controls whether or not small-caps is allowed to be
1516         synthesized. Luckily, we already have an implementation of this
1517         straightforward, so the implementation is quite simple.
1518
1519         Tests: css3/font-synthesis-small-caps.html
1520                fast/text/font-synthesis-parsing.html
1521
1522         * css/CSSComputedStyleDeclaration.cpp:
1523         (WebCore::fontSynthesisFromStyle):
1524         * css/StyleBuilderConverter.h:
1525         (WebCore::StyleBuilderConverter::convertFontSynthesis):
1526         * css/parser/CSSPropertyParser.cpp:
1527         (WebCore::consumeFontSynthesis):
1528         * platform/graphics/FontCache.h:
1529         (WebCore::FontDescriptionKey::makeFlagsKey):
1530         * platform/graphics/FontDescription.cpp:
1531         (WebCore::FontDescription::FontDescription):
1532         * platform/graphics/FontDescription.h:
1533         (WebCore::FontCascadeDescription::initialFontSynthesis):
1534         * platform/graphics/mac/ComplexTextController.cpp:
1535         (WebCore::shouldSynthesize):
1536         (WebCore::ComplexTextController::collectComplexTextRuns):
1537
1538 2016-12-15  Brady Eidson  <beidson@apple.com>
1539
1540         Add a new Logging Channel for IndexedDB Operation scheduling.
1541         https://bugs.webkit.org/show_bug.cgi?id=165912
1542
1543         Reviewed by Alex Christensen.
1544
1545         No new tests (No behavior change).
1546
1547         * Modules/indexeddb/IDBDatabase.cpp:
1548         (WebCore::IDBDatabase::transaction):
1549         
1550         * Modules/indexeddb/IDBFactory.cpp:
1551         (WebCore::IDBFactory::openInternal):
1552         (WebCore::IDBFactory::deleteDatabase):
1553         
1554         * Modules/indexeddb/IDBTransaction.cpp:
1555         (WebCore::IDBTransaction::internalAbort):
1556         (WebCore::IDBTransaction::commit):
1557         (WebCore::IDBTransaction::createObjectStore):
1558         (WebCore::IDBTransaction::renameObjectStore):
1559         (WebCore::IDBTransaction::createIndex):
1560         (WebCore::IDBTransaction::renameIndex):
1561         (WebCore::IDBTransaction::doRequestOpenCursor):
1562         (WebCore::IDBTransaction::iterateCursor):
1563         (WebCore::IDBTransaction::requestGetAllObjectStoreRecords):
1564         (WebCore::IDBTransaction::requestGetAllIndexRecords):
1565         (WebCore::IDBTransaction::requestGetRecord):
1566         (WebCore::IDBTransaction::requestIndexRecord):
1567         (WebCore::IDBTransaction::requestCount):
1568         (WebCore::IDBTransaction::requestDeleteRecord):
1569         (WebCore::IDBTransaction::requestClearObjectStore):
1570         (WebCore::IDBTransaction::requestPutOrAdd):
1571         (WebCore::IDBTransaction::deleteObjectStore):
1572         (WebCore::IDBTransaction::deleteIndex):
1573         
1574         * Modules/indexeddb/shared/IDBCursorInfo.cpp:
1575         (WebCore::IDBCursorInfo::loggingString):
1576         * Modules/indexeddb/shared/IDBCursorInfo.h:
1577         
1578         * Modules/indexeddb/shared/IDBGetAllRecordsData.cpp:
1579         (WebCore::IDBGetAllRecordsData::loggingString):
1580         * Modules/indexeddb/shared/IDBGetAllRecordsData.h:
1581         
1582         * Modules/indexeddb/shared/IDBGetRecordData.cpp:
1583         (WebCore::IDBGetRecordData::loggingString):
1584         * Modules/indexeddb/shared/IDBGetRecordData.h:
1585         
1586         * Modules/indexeddb/shared/IDBIndexInfo.cpp:
1587         (WebCore::IDBIndexInfo::condensedLoggingString):
1588         * Modules/indexeddb/shared/IDBIndexInfo.h:
1589         
1590         * Modules/indexeddb/shared/IDBIterateCursorData.cpp:
1591         (WebCore::IDBIterateCursorData::loggingString):
1592         * Modules/indexeddb/shared/IDBIterateCursorData.h:
1593         
1594         * Modules/indexeddb/shared/IDBObjectStoreInfo.cpp:
1595         (WebCore::IDBObjectStoreInfo::condensedLoggingString):
1596         * Modules/indexeddb/shared/IDBObjectStoreInfo.h:
1597         
1598         * platform/Logging.h:
1599
1600 2016-12-15  Konstantin Tokarev  <annulen@yandex.ru>
1601
1602         Added missing override and final specifiers
1603         https://bugs.webkit.org/show_bug.cgi?id=165903
1604
1605         Reviewed by Darin Adler.
1606
1607         No new tests needed.
1608
1609         * Modules/mediastream/OverconstrainedErrorEvent.h:
1610         * bindings/js/JSCallbackData.h:
1611         * bindings/js/JSCustomXPathNSResolver.h:
1612         * bindings/js/JSErrorHandler.h:
1613         * css/StyleRuleImport.h:
1614         * dom/SecurityPolicyViolationEvent.h:
1615         * editing/CreateLinkCommand.h:
1616         * editing/DeleteSelectionCommand.h:
1617         * editing/DictationCommand.h:
1618         * editing/Editor.cpp:
1619         * editing/FormatBlockCommand.h:
1620         * editing/IndentOutdentCommand.h:
1621         * editing/InsertLineBreakCommand.h:
1622         * editing/InsertParagraphSeparatorCommand.h:
1623         * editing/ModifySelectionListLevel.h:
1624         * editing/MoveSelectionCommand.h:
1625         * editing/RemoveFormatCommand.h:
1626         * editing/RemoveNodePreservingChildrenCommand.h:
1627         * editing/ReplaceSelectionCommand.h:
1628         * editing/SimplifyMarkupCommand.h:
1629         * editing/SplitTextNodeContainingElementCommand.h:
1630         * editing/UnlinkCommand.h:
1631         * fileapi/FileReaderLoader.h:
1632         * html/canvas/ANGLEInstancedArrays.h:
1633         * html/canvas/WebGLVertexArrayObjectBase.h:
1634         * loader/SinkDocument.h:
1635         * loader/archive/mhtml/MHTMLArchive.h:
1636         * page/animation/CSSPropertyAnimation.cpp:
1637         * platform/audio/MultiChannelResampler.cpp:
1638         * platform/audio/SincResampler.cpp:
1639         * platform/audio/gstreamer/AudioDestinationGStreamer.h:
1640         * platform/audio/gstreamer/AudioSourceProviderGStreamer.h:
1641         * platform/graphics/TextTrackRepresentation.cpp:
1642         * platform/graphics/displaylists/DisplayListItems.h:
1643         * platform/graphics/filters/FEBlend.h:
1644         * platform/graphics/filters/FEColorMatrix.h:
1645         * platform/graphics/filters/FEComponentTransfer.h:
1646         * platform/graphics/filters/FEConvolveMatrix.h:
1647         * platform/graphics/filters/FEDiffuseLighting.h:
1648         * platform/graphics/filters/FEDropShadow.h:
1649         * platform/graphics/filters/FEGaussianBlur.h:
1650         * platform/graphics/filters/FELighting.h:
1651         * platform/graphics/filters/FEMerge.h:
1652         * platform/graphics/filters/FEMorphology.h:
1653         * platform/graphics/filters/FEOffset.h:
1654         * platform/graphics/filters/FESpecularLighting.h:
1655         * platform/graphics/filters/FETile.h:
1656         * platform/graphics/filters/FETurbulence.h:
1657         * platform/graphics/filters/SourceAlpha.h:
1658         * platform/graphics/filters/SourceGraphic.h:
1659         * platform/graphics/opengl/Extensions3DOpenGL.h:
1660         * platform/graphics/opengl/Extensions3DOpenGLCommon.h:
1661         * platform/graphics/texmap/TextureMapperBackingStore.h:
1662         * platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.h:
1663         * platform/mock/GeolocationClientMock.h:
1664         * platform/text/TextCodecICU.h:
1665         * platform/text/TextCodecLatin1.h:
1666         * platform/text/TextCodecUTF16.h:
1667         * platform/text/TextCodecUTF8.h:
1668         * platform/text/TextCodecUserDefined.h:
1669         * rendering/RenderFullScreen.cpp:
1670         * storage/StorageEvent.h:
1671         * svg/properties/SVGListProperty.h:
1672         * svg/properties/SVGStaticListPropertyTearOff.h:
1673         * svg/properties/SVGStaticPropertyTearOff.h:
1674         * xml/NativeXPathNSResolver.h:
1675         * xml/XMLHttpRequestProgressEvent.h:
1676         * xml/XMLHttpRequestProgressEventThrottle.h:
1677         * xml/XPathVariableReference.h:
1678         * xml/XSLImportRule.h:
1679
1680 2016-12-15  Chris Dumez  <cdumez@apple.com>
1681
1682         Inline Document::existingAXObjectCache()
1683         https://bugs.webkit.org/show_bug.cgi?id=165906
1684
1685         Reviewed by Darin Adler.
1686
1687         Inline Document::existingAXObjectCache() to avoid paying function call
1688         cost in the common case where AX is disabled.
1689
1690         * dom/Document.cpp:
1691         (WebCore::Document::existingAXObjectCacheSlow):
1692         (WebCore::Document::existingAXObjectCache): Deleted.
1693         * dom/Document.h:
1694         (WebCore::Document::existingAXObjectCache):
1695
1696 2016-12-15  Ryan Haddad  <ryanhaddad@apple.com>
1697
1698         Rebaseline bindings tests after r209864.
1699
1700         Unreviewed test gardening.
1701
1702         * bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
1703         (WebCore::convertDictionary<DictionaryImplName>):
1704
1705 2016-12-15  Andreas Kling  <akling@apple.com>
1706
1707         Always clear RenderLayer backing stores when going into page cache.
1708         <https://webkit.org/b/165901>
1709
1710         Reviewed by Simon Fraser.
1711
1712         We were already doing this for the iOS and GTK+ ports, let's do it everywhere
1713         for consistency, and a bit of memory usage improvement.
1714
1715         This patch just removes the setting and always calls FrameView::clearBackingStores()
1716         when there is composited content going into page cache.
1717
1718         * history/CachedFrame.cpp:
1719         (WebCore::CachedFrame::CachedFrame):
1720         * history/PageCache.h:
1721         (WebCore::PageCache::shouldClearBackingStores): Deleted.
1722         (WebCore::PageCache::setShouldClearBackingStores): Deleted.
1723
1724 2016-12-15  Darin Adler  <darin@apple.com>
1725
1726         Remove custom binding for MediaDevices
1727         https://bugs.webkit.org/show_bug.cgi?id=165894
1728
1729         Reviewed by Eric Carlson.
1730
1731         Removes the explicit code to parse the MediaStreamConstraints and
1732         MediaTrackConstraints. Next step could be to change the internal
1733         code to use the structs from bindings directly so we don't need
1734         code to convert to an internal format.
1735
1736         * CMakeLists.txt: Added MediaTrackConstraints.idl and MediaTrackConstraints.cpp,
1737         removed JSMediaDevicesCustom.cpp.
1738
1739         * DerivedSources.make: Added MediaTrackConstraints.idl.
1740         Also sorted list of IDL files and fixed use of tabs.
1741
1742         * Modules/mediastream/MediaDevices.cpp:
1743         (WebCore::createMediaConstraintsImpl): Added.
1744         (WebCore::MediaDevices::getUserMedia): Changed this function to take arguments that
1745         are generated by the bindings script, and call createMediaConstraintsImpl to convert
1746         into the internal data structure.
1747         * Modules/mediastream/MediaDevices.h: Added StreamConstraints struct and changed
1748         getUserMedia to take that as specified in the IDL.
1749         * Modules/mediastream/MediaDevices.idl: Added definition of the MediaStreamConstraints
1750         dictionary. Removed [Custom] from getUserMedia.
1751
1752         * Modules/mediastream/MediaStream.cpp:
1753         (WebCore::MediaStream::MediaStream): Pass a reference to addObserver.
1754         (WebCore::MediaStream::~MediaStream): Pass a rference to removeObserver.
1755         (WebCore::MediaStream::internalAddTrack): Ditto.
1756         (WebCore::MediaStream::internalRemoveTrack): Ditto.
1757
1758         * Modules/mediastream/MediaStreamTrack.cpp:
1759         (WebCore::createMediaConstraintsImpl): Added.
1760         (WebCore::MediaStreamTrack::applyConstraints): Changed to take an optional
1761         MediaTrackConstraints argument and call createMediaConstraintsImpl to convert
1762         into the internal data structure. Also merged the multiple overloads of this
1763         all into a single function, used auto to make the code easier to read, and
1764         moved the code that stores new constrains into the success handling, since the
1765         specification says that's the only case where we should store it.
1766         (WebCore::MediaStreamTrack::addObserver): Take a reference instead of a pointer.
1767         (WebCore::MediaStreamTrack::removeObserver): Ditto.
1768         * Modules/mediastream/MediaStreamTrack.h: Removed many unneeded includes.
1769         Changed getConstraints to return const MediaTrackConstraints&, applyConstraints
1770         to take an optional MediaTrackConstraints, add/removeObserver to take a reference
1771         rather than a pointer, and changed m_constraints to be a MediaTrackConstraints
1772         instead of a RefPtr<MediaConstraints>.
1773         * Modules/mediastream/MediaStreamTrack.idl: Removed [Custom] from getConstraints
1774         and applyConstraints.
1775
1776         * Modules/mediastream/MediaTrackConstraints.cpp: Added.
1777         (WebCore::set): Overloaded function to set constriaints in a
1778         MediaTrackConstraintSetMap.
1779         (WebCore::convertToInternalForm): Helper function that takes a
1780         MediaTrackConstraintSet and turns it into a MediaTrackConstraintSetMap.
1781         (WebCore::convertAdvancedToInternalForm): More of the same, but for vectors.
1782         (WebCore::createMediaConstraintsImpl): Top level function. Calls the other
1783         functions and then MediaConstraintsImpl::create.
1784         * Modules/mediastream/MediaTrackConstraints.h: Added. Contains all the structures
1785         and type definitions for the dictionaries defined in the IDL file, and also the
1786         createMediaConstraintsImpl function declaration.
1787         * Modules/mediastream/MediaTrackConstraints.idl: Added. Contains the
1788         MediaTrackConstraints and all the other dictionaries and typedefs that are needed
1789         to define that dictionary.
1790         * Modules/mediastream/UserMediaRequest.cpp:
1791         (WebCore::UserMediaRequest::start): Changed to not depend on MediaDevices::Promise.
1792         (WebCore::UserMediaRequest::UserMediaRequest): Ditto.
1793         (WebCore::isSecure): Rearranged to be easier to understand.
1794         (WebCore::UserMediaRequest::start): Removed a local variable for simplicity.
1795         (WebCore::UserMediaRequest::document): Removed a redundant null check.
1796         * Modules/mediastream/UserMediaRequest.h: Reduced includes, changed to not depend
1797         on MediaDevices::Promise, removing the reason to include MediaDevices.h.
1798
1799         * WebCore.xcodeproj/project.pbxproj: Updated to remove old files and add new ones.
1800
1801         * bindings/js/JSBindingsAllInOne.cpp: Removed JSMediaDevicesCustom.cpp.
1802
1803         * bindings/js/JSMediaDevicesCustom.cpp: Removed.
1804         * bindings/js/JSMediaDevicesCustom.h: Removed.
1805
1806         * bindings/js/JSMediaStreamTrackCustom.cpp:
1807         (WebCore::JSMediaStreamTrack::applyConstraints): Deleted.
1808         (WebCore::JSMediaStreamTrack::getConstraints): Deleted.
1809
1810         * bindings/scripts/CodeGenerator.pm:
1811         (ProcessDocument): Updated to allow multiple standalone dictionaries, as long as
1812         the name of one of the dictionaries matches the name of the file.
1813
1814         * bindings/scripts/CodeGeneratorJS.pm:
1815         (GenerateDictionary): Added "other dictionaries" argument so we can support
1816         files with multiple dictionaries in them.
1817         (GenerateDictionariesHeaderContent): Completed support for dictionaries that
1818         are not named after a top level interface by added one more check for a missing
1819         $interface in a place that otherwise would not handle it correctly.
1820         (GenerateImplementation): Removed code that set $currentCachedAttribute and
1821         $cacheIndex, since no was reading the value of either any longer.
1822         (GenerateDictionaryHeader): Added "other dictionaries".
1823         (GenerateDictionaryImplementation): Ditto.
1824         (WriteData): Removed unnnecessarily indirect code that was using FileNamePrefix
1825         and a local variable named $prefix instead of just writing "JS".
1826
1827         * bindings/scripts/generate-bindings.pl: Corrected the use of the fileparse
1828         function from the Path::Basename module; after reading the documentation for
1829         this it is clear that there is no need to first call basename, and fileparse
1830         should also be used instead of basename.
1831
1832         * platform/mediastream/MediaConstraints.h: Removed unneeded includes.
1833         (WebCore::StringConstraint::appendExact): Removed an incorrect use of clear
1834         here that would mess up cases where there is supposed to be more than one
1835         exact value.
1836
1837         * platform/mediastream/MediaStreamTrackPrivate.cpp: Remvoed unneeded includes.
1838         (WebCore::MediaStreamTrackPrivate::clone): Removed code to copy m_constraints.
1839         (WebCore::MediaStreamTrackPrivate::constraints): Deleted.
1840         * platform/mediastream/MediaStreamTrackPrivate.h: Removed the constraints
1841         function member and the m_constraints data member.
1842
1843 2016-12-15  Dave Hyatt  <hyatt@apple.com>
1844
1845         [CSS Parser] Enable CSS Deferred Parsing
1846         https://bugs.webkit.org/show_bug.cgi?id=165869
1847
1848         Reviewed by Sam Weinig.
1849
1850         Enable CSS deferred parsing once again. It's now behind a pref,
1851         so it's easy to flip off and on.
1852
1853         To address the memory regression that caused the previous rollout,
1854         the tokenizer is no longer retained. Instead the sheet text and escaped
1855         strings are retained by CSSDeferredParser, and then DeferredStyleProperties
1856         and DeferredStyleGroupRuleList make copies of the tokens from the original
1857         tokenization process. As the rules get parsed, these tokens get thrown
1858         away.
1859
1860         This means that instead of the entire set of tokens staying in memory
1861         as long as even one unparsed rule remained, now only the tokens that
1862         still need parsing will remain alive.
1863
1864         Unparsed rules will consume slightly more memory than parsed rules, but
1865         the more unparsed rules you have, the bigger the performance win as
1866         well, so this is a tradeoff. Given that the parsing speed is going up
1867         by anywhere from 25-40% on cold loads of pages (where all stylesheets
1868         have to parse), this seems worth it to me.
1869
1870         * css/parser/CSSParserMode.h:
1871         * page/Settings.in:
1872
1873 2016-12-15  Alejandro G. Castro  <alex@igalia.com>
1874
1875         [OWR] Unskip fast/mediastream/MediaStream-video-element-track-stop.html
1876         https://bugs.webkit.org/show_bug.cgi?id=165316
1877
1878         Reviewed by Philippe Normand.
1879
1880         Fixed the ended support of the video element in the OWR player and
1881         fixed the videoTracks support. Now the OW player properly adds and
1882         removes the audio and video tracks. Added the getSettings support
1883         to the mediastream interface. Solved also the size handling in
1884         some of the enable/muted situations.
1885
1886         Unskipping fast/mediastream/MediaStream-video-element-track-stop.html.
1887
1888         * platform/GStreamer.cmake: Added the new
1889         RealtimeMediaSourceOwr.cpp with the new code handling the
1890         settings.
1891         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.cpp:
1892         (WebCore::MediaPlayerPrivateGStreamerOwr::~MediaPlayerPrivateGStreamerOwr):
1893         Release the new video and audio maps that creates a relationship
1894         of the mediastream tracks with the mediatracks of the video element.
1895         (WebCore::MediaPlayerPrivateGStreamerOwr::play): Set ended to
1896         false when we start playing.
1897         (WebCore::MediaPlayerPrivateGStreamerOwr::load): Create the media
1898         tracks to the player so that the videoTracks API returns it, and
1899         add an entry in the map to be able to restore it using the
1900         mediastream track.
1901         (WebCore::MediaPlayerPrivateGStreamerOwr::disableMediaTracks):
1902         Move some part of the stop function to this one in order to use it
1903         in pause method and avoid changing the video selection in that
1904         case.
1905         (WebCore::MediaPlayerPrivateGStreamerOwr::stop): Now we call the
1906         function disableMediaTracks and we also change teh selected
1907         videoTrack.
1908         (WebCore::MediaPlayerPrivateGStreamerOwr::trackEnded): For
1909         videoTrack reset the size and the selected element. In case there
1910         is no media playing we Make sure we set the ended variable to true
1911         and call the timeChange to modify the state of the player.
1912         (WebCore::MediaPlayerPrivateGStreamerOwr::trackEnabledChanged):
1913         Handle properly the situation when the user changed the enabled
1914         value, we disable the media.
1915         (WebCore::MediaPlayerPrivateGStreamerOwr::setSize): Modify the
1916         size of the source.
1917         (WebCore::MediaPlayerPrivateGStreamerOwr::naturalSize): Overrided
1918         to make sure we return a size even when the sample is not ready
1919         for gst.
1920         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.h:
1921         Added the ended attribute and the maps.
1922         * platform/mediastream/openwebrtc/MediaEndpointOwr.cpp:
1923         (WebCore::MediaEndpointOwr::createMutedRemoteSource): Use the new
1924         realtime video and audio sources classes, this new classes
1925         implement the settings of each type of media element.
1926         * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp:
1927         (WebCore::RealtimeMediaSourceCenterOwr::mediaSourcesAvailable):
1928         Use the new audio and video source classes instead of the general
1929         one in order to handle the settings properly.
1930         * platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.cpp: Added
1931         (WebCore::RealtimeMediaSourceOwr::settings): Initialize using the
1932         subclass and return the new currentSettings attribute.
1933         (WebCore::RealtimeMediaSourceOwr::supportedConstraints): Call the
1934         subclass initialization of the supportedSettings.
1935         * platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.h:
1936         (WebCore::RealtimeMediaSourceOwr::initializeSettings): Added to
1937         initialize the settings before returning the value. Implemented in
1938         the subclass.
1939         (WebCore::RealtimeMediaSourceOwr::initializeSupportedConstraints):
1940         Added to initialize the supported settings of the
1941         media. Implemented in the subclass.
1942         (WebCore::RealtimeMediaSourceOwr::settings): Moved to the cpp
1943         file, implemented using the initialize functions of the subclass
1944         * platform/mediastream/openwebrtc/RealtimeVideoSourceOwr.h: Added
1945         this new class to handle the settings of the video elements. The
1946         class initializes the settings and the supportedSettings.
1947         * platform/mediastream/openwebrtc/RealtimeAudioSourceOwr.h: Added
1948         this new class to handle the settings of the audio elements. The
1949         class initializes the settings and the supportedSettings.
1950
1951
1952 2016-12-15  Alex Christensen  <achristensen@webkit.org>
1953
1954         REGRESSION (r208902) Null pointer dereference in wkIsPublicSuffix
1955         https://bugs.webkit.org/show_bug.cgi?id=165885
1956         <rdar://problem/29476917>
1957
1958         Reviewed by Darin Adler.
1959
1960         wkIsPublicSuffix crashes if you give it a nil NSString*.
1961         This was possible before IDN2008 adoption, but it's more common now
1962         because domains like "r4---asdf.example.com" fail in uidna_nameToASCII but not in uidna_IDNToASCII.
1963         decodeHostName can return a nil NSString.  We can't use it unchecked, so instead we use an algorithm that allows
1964         for decoding failures while still finding top privately controlled domains correctly.
1965
1966         Tested by new API tests which crash before this change and verify the behavior matches behavior before r208902.
1967
1968         * platform/mac/PublicSuffixMac.mm:
1969         (WebCore::isPublicSuffix):
1970         (WebCore::topPrivatelyControlledDomain):
1971
1972 2016-12-15  Alex Christensen  <achristensen@webkit.org>
1973
1974         Fix Windows WebGL build after r209832
1975
1976         * CMakeLists.txt:
1977
1978 2016-12-14  Hunseop Jeong  <hs85.jeong@samsung.com>
1979
1980         Unreviewed build fix after r209832
1981
1982         * platform/graphics/PlatformDisplay.cpp: 
1983         (WebCore::PlatformDisplay::sharedDisplay): Added the guard for the clang
1984
1985 2016-12-14  Yusuke Suzuki  <utatane.tea@gmail.com>
1986
1987         [GTK] Support latest SubtleCrypto HMAC APIs
1988         https://bugs.webkit.org/show_bug.cgi?id=165863
1989
1990         Reviewed by Sam Weinig.
1991
1992         SubtleCrypto spec is updated, and new delegate implementations are required to support these interfaces.
1993         This patch implements platformSign and platformVerify with WorkQueues for gcrypt backend.
1994
1995         * crypto/gcrypt/CryptoAlgorithmHMACGCrypt.cpp:
1996         (WebCore::calculateSignature):
1997         (WebCore::CryptoAlgorithmHMAC::platformSign):
1998         (WebCore::CryptoAlgorithmHMAC::platformVerify):
1999
2000 2016-12-14  Chris Dumez  <cdumez@apple.com>
2001
2002         Unreviewed, rolling out r209415.
2003
2004         This workaround is no longer needed now that
2005         <rdar://problem/29518605> has been fixed
2006
2007         Reverted changeset:
2008
2009         "Add HTML interactive form validation blacklist for some
2010         WebKit-specific sites"
2011         https://bugs.webkit.org/show_bug.cgi?id=165470
2012         http://trac.webkit.org/changeset/209415
2013
2014 2016-12-14  Dean Jackson  <dino@apple.com>
2015
2016         Update prefers-reduced-motion syntax
2017         https://bugs.webkit.org/show_bug.cgi?id=165880
2018         <rdar://problems/29671807>
2019
2020         Reviewed by Sam Weinig.
2021
2022         After discussion in:
2023         https://github.com/w3c/csswg-drafts/issues/442
2024         ... the syntax of prefers-reduced-motion was changed
2025         to accept "reduce" or "no-preference".
2026
2027         Updated the tests in fast/media.
2028
2029         * css/CSSValueKeywords.in: Add no-preference keyword.
2030         * css/MediaQueryEvaluator.cpp:
2031         (WebCore::prefersReducedMotionEvaluate):
2032
2033 2016-12-14  Sam Weinig  <sam@webkit.org>
2034
2035         REGRESSION (204679): Google notifications never load (expecting DOMStringList rather than JS array for Location.ancestorOrigins)
2036         <rdar://problem/29573563>
2037         https://bugs.webkit.org/show_bug.cgi?id=165872
2038
2039         Reviewed by Chris Dumez.
2040
2041         Revert the Location.ancestorOrigins part of r204679 because google.com is relying on
2042         it returning a DOMStringList (or at least something with a .item() function), rather
2043         than a frozen javascript array.
2044         
2045         Spec changes are tracked with https://github.com/whatwg/html/issues/2179.
2046
2047         * page/Location.cpp:
2048         (WebCore::Location::ancestorOrigins):
2049         * page/Location.h:
2050         * page/Location.idl:
2051         Change Location.ancestorOrigins back to returning a DOMStringList.
2052
2053 2016-12-14  Dave Hyatt  <hyatt@apple.com>
2054
2055         [CSS Parser] Rename StyleKeyframe to StyleRuleKeyframe
2056         https://bugs.webkit.org/show_bug.cgi?id=165876
2057
2058         Reviewed by Simon Fraser.
2059
2060         * css/CSSKeyframeRule.cpp:
2061         (WebCore::StyleRuleKeyframe::StyleRuleKeyframe):
2062         (WebCore::StyleRuleKeyframe::~StyleRuleKeyframe):
2063         (WebCore::StyleRuleKeyframe::mutableProperties):
2064         (WebCore::StyleRuleKeyframe::keyText):
2065         (WebCore::StyleRuleKeyframe::setKeyText):
2066         (WebCore::StyleRuleKeyframe::cssText):
2067         (WebCore::CSSKeyframeRule::CSSKeyframeRule):
2068         (WebCore::StyleKeyframe::StyleKeyframe): Deleted.
2069         (WebCore::StyleKeyframe::~StyleKeyframe): Deleted.
2070         (WebCore::StyleKeyframe::mutableProperties): Deleted.
2071         (WebCore::StyleKeyframe::keyText): Deleted.
2072         (WebCore::StyleKeyframe::setKeyText): Deleted.
2073         (WebCore::StyleKeyframe::cssText): Deleted.
2074         * css/CSSKeyframeRule.h:
2075         * css/CSSKeyframesRule.cpp:
2076         (WebCore::StyleRuleKeyframes::keyframes):
2077         (WebCore::StyleRuleKeyframes::parserAppendKeyframe):
2078         (WebCore::StyleRuleKeyframes::wrapperAppendKeyframe):
2079         (WebCore::CSSKeyframesRule::appendRule):
2080         (WebCore::CSSKeyframesRule::item):
2081         * css/CSSKeyframesRule.h:
2082         * css/StyleResolver.cpp:
2083         (WebCore::StyleResolver::styleForKeyframe):
2084         (WebCore::StyleResolver::keyframeStylesForAnimation):
2085         * css/StyleResolver.h:
2086         * css/StyleRule.cpp:
2087         (WebCore::StyleRuleBase::destroy):
2088         * css/StyleRule.h:
2089         * css/parser/CSSParser.cpp:
2090         (WebCore::CSSParser::parseKeyframeRule):
2091         * css/parser/CSSParser.h:
2092         * css/parser/CSSParserImpl.cpp:
2093         (WebCore::CSSParserImpl::parseDeferredKeyframeList):
2094         (WebCore::CSSParserImpl::consumeKeyframesRule):
2095         (WebCore::CSSParserImpl::consumeKeyframeStyleRule):
2096         * css/parser/CSSParserImpl.h:
2097
2098 2016-12-14  Dave Hyatt  <hyatt@apple.com>
2099
2100         [CSS Parser] Make deferred parsing retain the sheet text. Fix invalidation to avoid deferred parsing.
2101         https://bugs.webkit.org/show_bug.cgi?id=165868
2102
2103         Reviewed by Simon Fraser.
2104
2105         With this new model of token copying, the sheet text needs to be retained. The tokenizer did this,
2106         but we're no longer keeping it around.
2107
2108         StyleInvalidation is also aggressively crawling media rules, even unsupported ones, so fix it
2109         to avoid deferred parsing.
2110
2111         * css/StyleInvalidationAnalysis.cpp:
2112         (WebCore::shouldDirtyAllStyle):
2113         * css/parser/CSSDeferredParser.cpp:
2114         (WebCore::CSSDeferredParser::CSSDeferredParser):
2115         * css/parser/CSSDeferredParser.h:
2116         (WebCore::CSSDeferredParser::create):
2117         * css/parser/CSSParserImpl.cpp:
2118         (WebCore::CSSParserImpl::CSSParserImpl):
2119
2120 2016-12-14  Ryosuke Niwa  <rniwa@webkit.org>
2121
2122         iOS: An element with tabindex is not focusable unless there is no mouse event handler
2123         https://bugs.webkit.org/show_bug.cgi?id=165843
2124
2125         Reviewed by Antti Koivisto.
2126
2127         The bug was caused by ancestorRespondingToClickEvents not checking the precense of tabindex attribute.
2128         Check that condition along with event listeners.
2129
2130         Test: fast/events/focusing-element-with-tabindex-by-tap-or-click.html
2131
2132         * page/ios/FrameIOS.mm:
2133         (WebCore::ancestorRespondingToClickEvents):
2134
2135 2016-12-14  Alex Christensen  <achristensen@webkit.org>
2136
2137         Progress towards using ANGLE to do WebGL rendering
2138         https://bugs.webkit.org/show_bug.cgi?id=165864
2139
2140         Reviewed by Dean Jackson.
2141
2142         No new tests, no change in behavior.
2143         Just compile fixes for a configuration that will soon be standard
2144         that can be landed now without breaking anything.
2145
2146         * platform/graphics/PlatformDisplay.cpp:
2147         (WebCore::PlatformDisplay::sharedDisplay):
2148         Ignore some clang warnings that will cause problems when this is compiled on Mac.
2149
2150 2016-12-14  Dean Jackson  <dino@apple.com>
2151
2152         [iOS] MediaDocuments have controls on the bottom of the page
2153         https://bugs.webkit.org/show_bug.cgi?id=165865
2154         <rdar://problem/28757268>
2155
2156         Reviewed by Jon Lee.
2157
2158         MediaDocuments on iOS are incorrectly placing the controls at
2159         the bottom of the page. This is due to the <video> element
2160         getting a height of 100%. It should be "auto" instead.
2161
2162         * html/MediaDocument.cpp:
2163         (WebCore::MediaDocumentParser::createDocumentStructure):
2164
2165 2016-12-14  Dave Hyatt  <hyatt@apple.com>
2166
2167         [CSS Parser] Implement deferred parsing of properties, @media, @supports and @keyframes
2168         https://bugs.webkit.org/show_bug.cgi?id=165743
2169
2170         Reviewed by Dean Jackson.
2171
2172         Added new tests in fast/css/deferred-parsing.
2173
2174         This patch implements deferred parsing in CSS. By default, when parsing
2175         author stylesheets, the parser goes into a deferred mode where it leaves
2176         the declaration block of all style rules unparsed initially. Instead of
2177         creating and setting an ImmutableStyleProperties object on the StyleRule,
2178         the parser creates a DeferredStyleProperties object instead that is
2179         capable of calling into CSSDeferredParser to parse the properties and values
2180         only when the properties are finally asked for.
2181
2182         In addition, this patch defers the parsing of the interior of @media,
2183         @supports, and @keyframes rules. @media blocks that are never matched will
2184         never parse any of the rules inside. @supports conditions for unsupported
2185         features will also not be parsed. For @keyframes, if the animation is never
2186         referenced/used, then the @keyframes child rules will never be parsed.
2187
2188         * CMakeLists.txt:
2189         * WebCore.xcodeproj/project.pbxproj:
2190         Add CSSDeferredParser to the build.
2191
2192         * css/CSSFontFaceSet.cpp:
2193         (WebCore::CSSFontFaceSet::matchingFaces):
2194         Patched to drop the StyleSheetContents* argument from parseValue, since it
2195         is no longer needed.
2196
2197         * css/CSSKeyframesRule.cpp:
2198         (WebCore::StyleRuleKeyframes::StyleRuleKeyframes):
2199         (WebCore::StyleRuleKeyframes::parseDeferredRulesIfNeeded):
2200         (WebCore::StyleRuleKeyframes::keyframes):
2201         (WebCore::StyleRuleKeyframes::wrapperAppendKeyframe):
2202         (WebCore::StyleRuleKeyframes::wrapperRemoveKeyframe):
2203         (WebCore::StyleRuleKeyframes::findKeyframeIndex):
2204         * css/CSSKeyframesRule.h:
2205         Keyframes now hold both a keyframes Vector and a DeferredStyleGroupRuleList
2206         object. The keyframes vector won't be populated until it is needed, and the
2207         population is done by DeferredStyleGroupRuleList, which holds both the original
2208         tokens of the keyframes rule interior, and a references to the
2209         CSSDeferredParser that will do the parsing.
2210
2211         * css/DOMCSSNamespace.cpp:
2212         (WebCore::DOMCSSNamespace::supports):
2213         Patched to drop the StyleSheetContents* argument from parseValue, since it
2214         is no longer needed.
2215
2216         * css/ElementRuleCollector.cpp:
2217         (WebCore::ElementRuleCollector::collectMatchingRulesForList):
2218         ElementRuleCollector tests to see if a rule is empty by counting properties(),
2219         but we don't want to initiate deferred parsing just to check this. Instead we
2220         invoke propertiesWithoutDeferredParsing, which will hand back a nullptr if
2221         the properties haven't been parsed yet. In order to ensure this optimization
2222         continues to work, any rules whose interiors consist of only whitespace do
2223         not get deferred.
2224
2225         * css/FontFace.cpp:
2226         (WebCore::FontFace::setVariant):
2227         * css/PropertySetCSSStyleDeclaration.cpp:
2228         (WebCore::PropertySetCSSStyleDeclaration::setProperty):
2229         (WebCore::PropertySetCSSStyleDeclaration::setPropertyInternal):
2230         Patched to drop the StyleSheetContents* argument from parseValue, since it
2231         is no longer needed.
2232
2233         * css/StyleProperties.cpp:
2234         (WebCore::MutableStyleProperties::MutableStyleProperties):
2235         (WebCore::MutableStyleProperties::setProperty):
2236         (WebCore::DeferredStyleProperties::create):
2237         (WebCore::DeferredStyleProperties::DeferredStyleProperties):
2238         (WebCore::DeferredStyleProperties::~DeferredStyleProperties):
2239         (WebCore::DeferredStyleProperties::parseDeferredProperties):
2240         * css/StyleProperties.h:
2241         (WebCore::StylePropertiesBase::type):
2242         (WebCore::StylePropertiesBase::cssParserMode):
2243         (WebCore::StylePropertiesBase::StylePropertiesBase):
2244         (WebCore::StyleProperties::isMutable):
2245         (WebCore::StyleProperties::StyleProperties):
2246         (WebCore::StylePropertiesBase::deref):
2247         (isType):
2248         (WebCore::StyleProperties::cssParserMode): Deleted.
2249         (WebCore::StyleProperties::deref): Deleted.
2250         Right now StyleProperties has two subclasses, ImmutableStyleProperties (which
2251         is created by the parser when not deferring), and MutableStyleProperties (used
2252         when making changes and doing DOM Manipulations).
2253
2254         This patch adds a new base class called StylePropertiesBase, and StyleProperties
2255         now derives from it. DeferredStyleProperties derives from this base. The members
2256         of StyleProperties have been moved up into StylePropertiesBase.
2257
2258         The m_isMutable bit, used to determine the type for downcasting has been enhanced
2259         to m_type (2 bits), since there are now three possible subclasses.
2260
2261         * css/StyleRule.cpp:
2262         (WebCore::StyleRule::StyleRule):
2263         (WebCore::StyleRule::properties):
2264         (WebCore::StyleRule::mutableProperties):
2265         (WebCore::StyleRule::splitIntoMultipleRulesWithMaximumSelectorComponentCount):
2266         Patched to ensure that when properties() are accessed, that if the current
2267         stored StylePropertyBase in the rule is a DeferredStyleProperties, we then
2268         parse and replace DeferredStyleProperties with ImmutableStyleProperties on the
2269         rule. By using a common base class, we avoid increasing memory usage in
2270         StyleRule.
2271
2272         (WebCore::DeferredStyleGroupRuleList::create):
2273         (WebCore::DeferredStyleGroupRuleList::DeferredStyleGroupRuleList):
2274         (WebCore::DeferredStyleGroupRuleList::parseDeferredRules):
2275         (WebCore::DeferredStyleGroupRuleList::parseDeferredKeyframes):
2276         DeferredStyleGroupList is used to handle deferred parsing of objects with
2277         child rules. These include @media, @supports and @keyframes.
2278
2279         (WebCore::StyleRuleGroup::StyleRuleGroup):
2280         (WebCore::StyleRuleGroup::childRules):
2281         (WebCore::StyleRuleGroup::wrapperInsertRule):
2282         (WebCore::StyleRuleGroup::wrapperRemoveRule):
2283         (WebCore::StyleRuleGroup::parseDeferredRulesIfNeeded):
2284         (WebCore::StyleRuleMedia::StyleRuleMedia):
2285         (WebCore::StyleRuleSupports::StyleRuleSupports):
2286         StyleRuleGroup now holds both a child rules Vector and a
2287         DeferredStyleGroupRuleList. If DeferredStyleGroupRuleList is set, then
2288         when the childRules are finally accessed, we will populate the childRules
2289         Vector and then null out the DeferredStyleGroupRuleList.
2290
2291         * css/StyleRule.h:
2292         (WebCore::StyleRule::propertiesWithoutDeferredParsing):
2293         (WebCore::StyleRuleGroup::childRulesWithoutDeferredParsing):
2294         (WebCore::StyleRuleGroup::childRules): Deleted.
2295         Add new accesors for fetching properties and child rules without causing
2296         deferred parsing to happen.
2297
2298         * css/StyleSheetContents.cpp:
2299         (WebCore::StyleSheetContents::parseAuthorStyleSheet):
2300         (WebCore::StyleSheetContents::parseString):
2301         Patched to turn on deferred parsing for author sheets and for all
2302         non-UA stylesheets parsed from a string (e.g., <style>).
2303
2304         (WebCore::traverseSubresourcesInRules):
2305         The broken resource check was aggressively accessing properties(). Patch
2306         it to call propertiesWithoutDeferredParsing() instead so that it doesn't
2307         defeat the new optimization.
2308
2309         * css/WebKitCSSMatrix.cpp:
2310         (WebCore::WebKitCSSMatrix::setMatrixValue):
2311         Patched to drop the StyleSheetContents* argument from parseValue, since it
2312         is no longer needed.
2313
2314         * css/parser/CSSDeferredParser.cpp: Added.
2315         (WebCore::CSSDeferredParser::CSSDeferredParser):
2316         (WebCore::CSSDeferredParser::parseDeclaration):
2317         (WebCore::CSSDeferredParser::parseRuleList):
2318         (WebCore::CSSDeferredParser::parseKeyframeList):
2319         * css/parser/CSSDeferredParser.h: Added.
2320         (WebCore::CSSDeferredParser::create):
2321         (WebCore::CSSDeferredParser::tokenizer):
2322         (WebCore::CSSDeferredParser::mode):
2323         (WebCore::CSSDeferredParser::context):
2324         (WebCore::CSSDeferredParser::styleSheet):
2325         The CSSDeferredParser. It caches the original tokenizer's' escaped strings. Because
2326         the CSSDeferredParser is referenced by all the rules that have yet to parse,
2327         it will stay alive until all rules in the stylesheet has been fully parsed.
2328
2329         The parser receives CSSParserTokenRanges from DeferredStyleProperties or
2330         DeferredStyleGroupRuleList and feeds them to CSSParserImpl, which then
2331         is able to do the parsing as it would have occurred originally had the
2332         range not been deferred.
2333
2334         * css/parser/CSSParser.cpp:
2335         (WebCore::CSSParser::parseSheet):
2336         (WebCore::CSSParser::parseSupportsCondition):
2337         (WebCore::CSSParser::parseSingleValue):
2338         (WebCore::CSSParser::parseValue):
2339         * css/parser/CSSParser.h:
2340         * css/parser/CSSParserFastPaths.cpp:
2341         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
2342         (WebCore::parseKeywordValue):
2343         (WebCore::CSSParserFastPaths::maybeParseValue):
2344         * css/parser/CSSParserFastPaths.h:
2345         Drop the StyleSheetContents* argument from the methods that no longer need
2346         them.
2347
2348         * css/parser/CSSParserImpl.cpp:
2349         (WebCore::CSSParserImpl::CSSParserImpl):
2350         (WebCore::CSSParserImpl::tokenizer):
2351         (WebCore::CSSParserImpl::parseValue):
2352         (WebCore::CSSParserImpl::parseCustomPropertyValue):
2353         (WebCore::CSSParserImpl::parseDeclarationList):
2354         (WebCore::CSSParserImpl::parseInlineStyleDeclaration):
2355         (WebCore::CSSParserImpl::parseRule):
2356         (WebCore::CSSParserImpl::parseStyleSheet):
2357         (WebCore::CSSParserImpl::parseDeclarationListForInspector):
2358         (WebCore::CSSParserImpl::parseStyleSheetForInspector):
2359         (WebCore::CSSParserImpl::consumeQualifiedRule):
2360         (WebCore::CSSParserImpl::consumeMediaRule):
2361         (WebCore::CSSParserImpl::consumeSupportsRule):
2362         (WebCore::CSSParserImpl::consumeKeyframesRule):
2363         (WebCore::CSSParserImpl::consumeStyleRule):
2364         Drop the StyleSheetContents* argument from the methods that no longer need
2365         them.
2366
2367         (WebCore::CSSParserImpl::createDeferredStyleProperties):
2368         (WebCore::CSSParserImpl::parseDeferredDeclaration):
2369         (WebCore::CSSParserImpl::parseDeferredRuleList):
2370         (WebCore::CSSParserImpl::parseDeferredKeyframeList):
2371         The methods that handle deferred parsing. They make sure to initialize
2372         new CSSParserImpls with the original deferred parser, and then call existing
2373         methods to do the parsing.
2374
2375         * css/parser/CSSParserImpl.h:
2376         Patched to remove StyleSheetContents* arguments from some methods and
2377         to add the new deferred parsing methods.
2378
2379         * css/parser/CSSParserTokenRange.cpp:
2380         (WebCore::CSSParserTokenRange::consumeBlockCheckingForEditability):
2381         * css/parser/CSSParserTokenRange.h:
2382         In order to preserve the editability optimization from r180867, when
2383         a style rule's block is consumed, we use a special method that looks
2384         for -webkit-user-modify tokens. If one is seen, then the editability
2385         optimization is turned off. Because we do this at the token level,
2386         the optimization keeps working even if properties don't get parsed.
2387
2388         * css/parser/CSSPropertyParser.cpp:
2389         (WebCore::CSSPropertyParser::parseSingleValue):
2390         (WebCore::CSSPropertyParser::parseFontFaceDescriptor):
2391         (WebCore::CSSPropertyParser::consumeFont):
2392         (WebCore::CSSPropertyParser::parseShorthand):
2393         Patched to remove StyleSheetContents* arguments now that the editability
2394         check is in CSSTokenizer instead.
2395
2396         * css/parser/CSSTokenizer.cpp:
2397         (WebCore::CSSTokenizer::tokenRange):
2398         * css/parser/CSSTokenizer.h:
2399         Make tokenRange() const.
2400
2401         * html/canvas/CanvasRenderingContext2D.cpp:
2402         (WebCore::CanvasRenderingContext2D::setFont):
2403         Patched to drop the StyleSheetContents* argument.
2404
2405         * testing/Internals.cpp:
2406         (WebCore::deferredStyleRulesCountForList):
2407         (WebCore::Internals::deferredStyleRulesCount):
2408         (WebCore::deferredGroupRulesCountForList):
2409         (WebCore::Internals::deferredGroupRulesCount):
2410         (WebCore::deferredKeyframesRulesCountForList):
2411         (WebCore::Internals::deferredKeyframesRulesCount):
2412         * testing/Internals.h:
2413         * testing/Internals.idl:
2414         Add new testing methods that can count the deferred style rules and
2415         group child rule lists. These methods are used by the new layout tests.
2416
2417 2016-12-14  Brady Eidson  <beidson@apple.com>
2418
2419         IndexedDB 2.0: Massively speedup IDBIndex.get().
2420         https://bugs.webkit.org/show_bug.cgi?id=165802
2421
2422         Reviewed by Alex Christensen.
2423
2424         No new tests (No behavior change to Javascript, table upgrade change covered by API test).
2425
2426         This change upgrades the IndexRecords schema to include the ObjectStore record ID for the referenced record.
2427         It also adds a SQLite Index-by-key on IndexRecords.
2428
2429         This speeds up PerformanceTests/IndexedDB/index-get.html by 15-20x.
2430
2431         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
2432         (WebCore::IDBServer::v3IndexRecordsTableSchema):
2433         (WebCore::IDBServer::v3IndexRecordsTableSchemaAlternate):
2434         (WebCore::IDBServer::v1IndexRecordsIndexSchema):
2435         (WebCore::IDBServer::SQLiteIDBBackingStore::ensureValidIndexRecordsTable):
2436         (WebCore::IDBServer::SQLiteIDBBackingStore::ensureValidIndexRecordsIndex):
2437         (WebCore::IDBServer::SQLiteIDBBackingStore::getOrEstablishDatabaseInfo):
2438         (WebCore::IDBServer::SQLiteIDBBackingStore::createIndex):
2439         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedPutIndexKey):
2440         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedPutIndexRecord):
2441         (WebCore::IDBServer::SQLiteIDBBackingStore::updateOneIndexForAddRecord):
2442         (WebCore::IDBServer::SQLiteIDBBackingStore::updateAllIndexesForAddRecord):
2443         (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord):
2444         (WebCore::IDBServer::SQLiteIDBBackingStore::getIndexRecord):
2445         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedGetIndexRecordForOneKey):
2446         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
2447
2448         * Modules/indexeddb/server/SQLiteIDBCursor.cpp:
2449         (WebCore::IDBServer::SQLiteIDBCursor::markAsErrored):
2450         (WebCore::IDBServer::SQLiteIDBCursor::internalAdvanceOnce):
2451         * Modules/indexeddb/server/SQLiteIDBCursor.h:
2452         (WebCore::IDBServer::SQLiteIDBCursor::currentRecordRowID):
2453
2454 2016-12-14  Sam Weinig  <sam@webkit.org>
2455
2456         Actually set the shipping contact when validating the payment request
2457
2458         Reviewed by Anders Carlsson.
2459
2460         * Modules/applepay/ApplePaySession.cpp:
2461         (WebCore::convertAndValidate):
2462         Fix typo.
2463
2464 2016-12-14  John Wilander  <wilander@apple.com>
2465
2466         Handle key generation with empty challenge string
2467         https://bugs.webkit.org/show_bug.cgi?id=165835
2468         <rdar://problem/29128710>
2469
2470         Reviewed by Anders Carlsson.
2471
2472         https://bugs.webkit.org/show_bug.cgi?id=160945 didn't set the challenge length to
2473         1 for empty challenge strings. Thus the null terminator was not included. Empty
2474         challenge strings are allowed:
2475         "If the element has a challenge attribute, then let challenge be that attribute's
2476         value. Otherwise, let challenge be the empty string."
2477         https://www.w3.org/TR/html5/forms.html#the-keygen-element (fetched 2016-12-13)
2478
2479         Email certificate generation at
2480         https://www.comodo.com/home/email-security/free-email-certificate.php broke
2481         because of https://bugs.webkit.org/show_bug.cgi?id=160945.
2482
2483         No new tests. The original patch did not have tests and the breakage was in the
2484         produced key material so a test would have to validate the crypto output.
2485
2486         * platform/mac/SSLKeyGeneratorMac.mm:
2487         (WebCore::signedPublicKeyAndChallengeString):
2488             Now adds 1 to the length of the challenge to account for its null terminator.
2489             This matches the old behavior.
2490
2491 2016-12-14  Daniel Bates  <dabates@apple.com>
2492
2493         CSP: Allow HTTPS URL to match HTTP source expression
2494         https://bugs.webkit.org/show_bug.cgi?id=159520
2495         <rdar://problem/27287177>
2496
2497         Reviewed by Brent Fulgham.
2498
2499         Test: http/tests/security/contentSecurityPolicy/script-src-parsing-implicit-and-explicit-port-number.html
2500
2501         * page/csp/ContentSecurityPolicySource.cpp:
2502         (WebCore::ContentSecurityPolicySource::schemeMatches):
2503         (WebCore::ContentSecurityPolicySource::portMatches):
2504
2505 2016-12-14  Alex Christensen  <achristensen@webkit.org>
2506
2507         REGRESSION (r209776): [ios-simulator] LayoutTest http/tests/xmlhttprequest/on-network-timeout-error-during-preflight.html is timing out
2508         https://bugs.webkit.org/show_bug.cgi?id=165836
2509
2510         Reviewed by Brady Eidson.
2511
2512         * loader/CrossOriginAccessControl.cpp:
2513         (WebCore::createAccessControlPreflightRequest):
2514         Use the platform default timeout for CORS preflight requests.
2515
2516 2016-12-14  Antti Koivisto  <antti@apple.com>
2517
2518         WebContent crash under WebCore::CachedResource::load in WebCore::FrameLoader::outgoingReferrer const
2519         https://bugs.webkit.org/show_bug.cgi?id=165852
2520         <rdar://problem/27297153>
2521
2522         Reviewed by Chris Dumez.
2523
2524         There appears to be some path where we get here with a null frame.
2525         No test, don't know how exactly this happens.
2526
2527         * loader/FrameLoader.cpp:
2528         (WebCore::FrameLoader::outgoingReferrer):
2529
2530             Null check the frame.
2531
2532 2016-12-14  Chris Dumez  <cdumez@apple.com>
2533
2534         Unreviewed, rolling out r209766.
2535
2536         Regressed Dromaeo JSLib by ~50%
2537
2538         Reverted changeset:
2539
2540         "Make opaque root scanning truly constraint-based"
2541         https://bugs.webkit.org/show_bug.cgi?id=165760
2542         http://trac.webkit.org/changeset/209766
2543
2544 2016-12-14  Andy Estes  <aestes@apple.com>
2545
2546         EventDispatcher::dispatchEvent() should take its Node by reference
2547         https://bugs.webkit.org/show_bug.cgi?id=165840
2548
2549         Reviewed by Andreas Kling.
2550
2551         No new tests. No change in behavior.
2552
2553         * dom/Element.cpp:
2554         (WebCore::Element::dispatchWheelEvent): Dereferenced |this| when calling
2555         EventDispatcher::dispatchEvent().
2556         (WebCore::Element::dispatchKeyEvent): Ditto.
2557         (WebCore::Element::dispatchFocusEvent): Ditto.
2558         (WebCore::Element::dispatchBlurEvent): Ditto.
2559         * dom/EventDispatcher.cpp:
2560         (WebCore::EventDispatcher::dispatchEvent): Changed |origin| from a Node* to a Node&, renamed
2561         it to |node|, and protected it with a Ref called |protectedNode| to match our preferred
2562         style.
2563         * dom/EventDispatcher.h: Changed dispatchEvent's first parameter type from Node* to Node&.
2564         * dom/Node.cpp:
2565         (WebCore::Node::dispatchEvent): Dereferenced |this| when calling
2566         EventDispatcher::dispatchEvent().
2567         (WebCore::Node::dispatchTouchEvent): Ditto.
2568         (WebCore::Node::dispatchUIRequestEvent): Ditto.
2569         * dom/ScopedEventQueue.cpp:
2570         (WebCore::ScopedEventQueue::dispatchEvent): Dereferenced |node| when calling
2571         EventDispatcher::dispatchEvent().
2572         * dom/SimulatedClick.cpp:
2573         (WebCore::simulateMouseEvent): Passed |element| as a reference to
2574         EventDispatcher::dispatchEvent().
2575
2576 2016-12-14  Chris Dumez  <cdumez@apple.com>
2577
2578         Remove Unicode case-insensitive matching for usemap=""
2579         https://bugs.webkit.org/show_bug.cgi?id=163894
2580
2581         Reviewed by Antti Koivisto.
2582
2583         Remove Unicode case-insensitive matching for usemap="" as this no longer
2584         matches the specification [1] or Firefox. Also align our parsing logic for
2585         the usemap attribute to match the specification [2].
2586
2587         This simplifies the code a bit, is more efficient and the compatibility
2588         risk should be low based on Firefox's behavior and Chome's usage data.
2589
2590         [1] https://github.com/whatwg/html/commit/6acdb2122298d2bb7bb839c0a61b4e1f9b0f9bc9
2591         [2] https://html.spec.whatwg.org/#rules-for-parsing-a-hash-name-reference
2592
2593         Test: fast/images/image-usemap-parsing.html
2594
2595         * dom/Document.cpp:
2596         (WebCore::Document::addImageElementByUsemap):
2597         (WebCore::Document::removeImageElementByUsemap):
2598         (WebCore::Document::imageElementByUsemap):
2599         * dom/Document.h:
2600         * dom/DocumentOrderedMap.cpp:
2601         (WebCore::DocumentOrderedMap::getElementByUsemap):
2602         * dom/DocumentOrderedMap.h:
2603         * dom/TreeScope.cpp:
2604         (WebCore::TreeScope::getImageMap):
2605         * html/HTMLImageElement.cpp:
2606         (WebCore::HTMLImageElement::parseAttribute):
2607         (WebCore::HTMLImageElement::insertedInto):
2608         (WebCore::HTMLImageElement::removedFrom):
2609         (WebCore::HTMLImageElement::matchesUsemap):
2610         * html/HTMLImageElement.h:
2611         * html/HTMLMapElement.cpp:
2612         (WebCore::HTMLMapElement::imageElement):
2613         (WebCore::HTMLMapElement::parseAttribute):
2614         * html/parser/HTMLParserIdioms.cpp:
2615         (WebCore::parseHTMLHashNameReference):
2616         * html/parser/HTMLParserIdioms.h:
2617
2618 2016-12-14  Ryan Haddad  <ryanhaddad@apple.com>
2619
2620         Attempt to fix the Windows build after r209805.
2621
2622         Unreviewed build fix.
2623
2624         * css/CSSAllInOne.cpp:
2625
2626 2016-12-14  Dave Hyatt  <hyatt@apple.com>
2627
2628         [CSS Parser] Remove WebkitCSSTransformValue
2629         https://bugs.webkit.org/show_bug.cgi?id=165844
2630
2631         Reviewed by Zalan Bujtas.
2632
2633         Remove WebkitCSSTransformValue and just use a CSSFunctionValue instead. No other
2634         browsers support it, and the information it provides is easily obtainable from cssText.
2635
2636         * CMakeLists.txt:
2637         * DerivedSources.cpp:
2638         * DerivedSources.make:
2639         * WebCore.xcodeproj/project.pbxproj:
2640         * bindings/js/JSCSSValueCustom.cpp:
2641         (WebCore::toJSNewlyCreated):
2642         * css/CSSComputedStyleDeclaration.cpp:
2643         (WebCore::matrixTransformValue):
2644         * css/CSSValue.cpp:
2645         (WebCore::CSSValue::equals):
2646         (WebCore::CSSValue::cssText):
2647         (WebCore::CSSValue::destroy):
2648         (WebCore::CSSValue::cloneForCSSOM):
2649         * css/CSSValue.h:
2650         (WebCore::CSSValue::isSpringTimingFunctionValue):
2651         (WebCore::CSSValue::isWebKitCSSTransformValue): Deleted.
2652         * css/StyleResolver.cpp:
2653         * css/TransformFunctions.cpp:
2654         (WebCore::transformOperationType):
2655         (WebCore::transformsForValue):
2656         * css/TransformFunctions.h:
2657         * css/WebKitCSSTransformValue.cpp: Removed.
2658         * css/WebKitCSSTransformValue.h: Removed.
2659         * css/WebKitCSSTransformValue.idl: Removed.
2660         * css/parser/CSSParserFastPaths.cpp:
2661         (WebCore::parseTransformTranslateArguments):
2662         (WebCore::parseTransformNumberArguments):
2663         (WebCore::parseSimpleTransformValue):
2664         (WebCore::parseSimpleTransformList):
2665         * css/parser/CSSPropertyParser.cpp:
2666         (WebCore::consumeTranslate3d):
2667         (WebCore::consumeNumbers):
2668         (WebCore::consumePerspective):
2669         (WebCore::consumeTransformValue):
2670         (WebCore::transformOperationForCSSValueID): Deleted.
2671
2672 2016-12-14  Antti Koivisto  <antti@apple.com>
2673
2674         Make Style::Update const in RenderTreeUpdater
2675         https://bugs.webkit.org/show_bug.cgi?id=165845
2676
2677         Reviewed by Andreas Kling.
2678
2679         Moving style away from unique_ptrs leaves them in weird state.
2680
2681         * style/RenderTreeUpdater.cpp:
2682         (WebCore::findRenderingRoots):
2683         (WebCore::RenderTreeUpdater::commit):
2684         (WebCore::RenderTreeUpdater::updateElementRenderer):
2685
2686             Clone the style instead of moving it. This is not meaningfully more expensive.
2687             Remove null checks, style is never null.
2688
2689         * style/RenderTreeUpdater.h:
2690
2691 2016-12-13  Yusuke Suzuki  <utatane.tea@gmail.com>
2692
2693         Use JSValue::toWTFString instead of calling toString(exec) and value(exec)
2694         https://bugs.webkit.org/show_bug.cgi?id=165795
2695
2696         Reviewed by Saam Barati.
2697
2698         * bindings/js/IDBBindingUtilities.cpp:
2699         (WebCore::createIDBKeyFromValue):
2700         * bindings/js/JSAudioTrackCustom.cpp:
2701         (WebCore::JSAudioTrack::setKind):
2702         (WebCore::JSAudioTrack::setLanguage):
2703         * bindings/js/JSCryptoAlgorithmDictionary.cpp:
2704         (WebCore::JSCryptoAlgorithmDictionary::getAlgorithmIdentifier):
2705         * bindings/js/JSCustomXPathNSResolver.cpp:
2706         (WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
2707         * bindings/js/JSDOMWindowCustom.cpp:
2708         (WebCore::JSDOMWindow::setLocation):
2709         * bindings/js/JSDeviceMotionEventCustom.cpp:
2710         (WebCore::JSDeviceMotionEvent::initDeviceMotionEvent):
2711         * bindings/js/JSDeviceOrientationEventCustom.cpp:
2712         (WebCore::JSDeviceOrientationEvent::initDeviceOrientationEvent):
2713         * bindings/js/JSEventListener.cpp:
2714         (WebCore::JSEventListener::handleEvent):
2715         * bindings/js/JSHTMLAllCollectionCustom.cpp:
2716         (WebCore::callHTMLAllCollection):
2717         (WebCore::JSHTMLAllCollection::namedItem):
2718         * bindings/js/JSHTMLFormControlsCollectionCustom.cpp:
2719         (WebCore::JSHTMLFormControlsCollection::namedItem):
2720         * bindings/js/JSHTMLInputElementCustom.cpp:
2721         (WebCore::JSHTMLInputElement::setSelectionDirection):
2722         * bindings/js/JSInspectorFrontendHostCustom.cpp:
2723         (WebCore::populateContextMenuItems):
2724         * bindings/js/JSMessageEventCustom.cpp:
2725         (WebCore::handleInitMessageEvent):
2726         * bindings/js/JSSQLTransactionCustom.cpp:
2727         (WebCore::JSSQLTransaction::executeSql):
2728         * bindings/js/JSTextTrackCustom.cpp:
2729         (WebCore::JSTextTrack::setLanguage):
2730         * bindings/js/JSVideoTrackCustom.cpp:
2731         (WebCore::JSVideoTrack::setKind):
2732         (WebCore::JSVideoTrack::setLanguage):
2733         * bindings/js/JSWebKitSubtleCryptoCustom.cpp:
2734         (WebCore::cryptoKeyFormatFromJSValue):
2735         (WebCore::cryptoKeyUsagesFromJSValue):
2736         * bindings/js/JSXMLHttpRequestCustom.cpp:
2737         (WebCore::JSXMLHttpRequest::send):
2738         * bindings/js/JSXSLTProcessorCustom.cpp:
2739         (WebCore::JSXSLTProcessor::setParameter):
2740         (WebCore::JSXSLTProcessor::getParameter):
2741         (WebCore::JSXSLTProcessor::removeParameter):
2742         * bindings/js/ScheduledAction.cpp:
2743         (WebCore::ScheduledAction::create):
2744         * bridge/c/c_utility.cpp:
2745         (JSC::Bindings::convertValueToNPVariant):
2746         * bridge/testbindings.cpp:
2747         (main):
2748
2749 2016-12-14  Joonghun Park  <jh718.park@samsung.com>
2750
2751         [EFL] Fix debug build break since r207192. Unreviewed.
2752         https://bugs.webkit.org/show_bug.cgi?id=165847
2753
2754         No new tests, no new behaviours.
2755
2756         In JSDOMBinding.h, JSClass::info() returns each js class's
2757         "static const JSC::ClassInfo s_info"'s address.
2758         It's static variable's address, so always non-null.
2759
2760         * bindings/js/JSDOMBinding.h:
2761         (WebCore::BindingCaller::callPromiseOperation):
2762         (WebCore::BindingCaller::callOperation):
2763         (WebCore::BindingCaller::setAttribute):
2764         (WebCore::BindingCaller::attribute):
2765
2766 2016-12-14  Enrique Ocaña González  <eocanha@igalia.com>
2767
2768         REGRESSION(r207879-207891): [GStreamer] Introduced many layout test failures and crashes, bots exiting early
2769         https://bugs.webkit.org/show_bug.cgi?id=164022
2770
2771         Reviewed by Xabier Rodriguez-Calvar.
2772
2773         Covered by existing tests.
2774
2775         * page/Settings.cpp:
2776         Added new setting to disable GStreamer players, so the selection of
2777         MockMediaPlayerMediaSource can be forced for some tests, just like
2778         it's already being done for the AVFoundation player in Mac.
2779         (WebCore::Settings::setGStreamerEnabled):
2780         * page/Settings.h:
2781         (WebCore::Settings::isGStreamerEnabled):
2782         * platform/graphics/MediaPlayer.cpp:
2783         (WebCore::buildMediaEnginesVector):
2784         Don't register GStreamer players when they're disabled.
2785         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2786         (WebCore::MediaPlayerPrivateGStreamer::durationMediaTime):
2787         Use doubles instead of floats.
2788         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
2789         Use doubles instead of floats for m_durationAtEOS.
2790         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2791         Don't reset m_sample on videoSink drain, it causes too many problems.
2792         (WebCore::MediaPlayerPrivateGStreamerBase::createVideoSink):
2793         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2794         Removed unused methods.
2795         * platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
2796         Keep releasing m_sample on drain, but don't report the event
2797         externally via signal anymore. The base player private isn't
2798         listening to it anymore.
2799         (webkitVideoSinkEvent):
2800         (webkit_video_sink_class_init):
2801         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
2802         (WebCore::AppendPipeline::parseDemuxerSrcPadCaps):
2803         Check if the demuxer caps correspond to a supported codec.
2804         (WebCore::AppendPipeline::didReceiveInitializationSegment):
2805         Empty m_track is now legal and means unsupported codec.
2806         (WebCore::AppendPipeline::connectDemuxerSrcPadToAppsinkFromAnyThread):
2807         Warn about more than one stream, but "support" it by ignoring it using
2808         a black hole probe.
2809         (WebCore::AppendPipeline::connectDemuxerSrcPadToAppsink):
2810         Also report the duration when it's detected for the first time. Invalid
2811         stream types now mean that unsupported codecs have been detected.
2812         Complete init segment processing in that case.
2813         (WebCore::AppendPipeline::disconnectDemuxerSrcPadFromAppsinkFromAnyThread):
2814         Disconnect black hole probe.
2815         (WebCore::appendPipelineDemuxerBlackHolePadProbe): Ignore buffers.
2816         (WebCore::appendPipelineDemuxerPadRemoved): New parameter used.
2817         * platform/graphics/gstreamer/mse/AppendPipeline.h:
2818         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
2819         (WebCore::MediaPlayerPrivateGStreamerMSE::supportsCodecs):
2820         Check supported codecs by matching against wildcard expressions.
2821         (WebCore::MediaPlayerPrivateGStreamerMSE::supportsType):
2822         Check for supported codecs.
2823         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
2824         New supportsCodecs() method.
2825         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
2826         (WebCore::MediaSourceClientGStreamerMSE::resetParserState):
2827         Implemented parser resetting by aborting the AppendPipeline.
2828         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h:
2829         Added resetParserState().
2830         * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp:
2831         (WebCore::SourceBufferPrivateGStreamer::resetParserState):
2832         Implemented it.
2833         * testing/Internals.cpp:
2834         (WebCore::Internals::initializeMockMediaSource):
2835         Disable the GStreamer players when initializing the mock media source,
2836         like it's already done for the AVFoundation player to force the
2837         selection of MockMediaPlayerMediaSource.
2838
2839 2016-12-14  Enrique Ocaña González  <eocanha@igalia.com>
2840
2841         [GStreamer][MSE] Fix player private selection when MSE is enabled
2842         https://bugs.webkit.org/show_bug.cgi?id=164116
2843
2844         Reviewed by Philippe Normand.
2845
2846         Covered by existing tests.
2847
2848         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2849         (WebCore::MediaPlayerPrivateGStreamer::load):
2850         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
2851         (WebCore::MediaPlayerPrivateGStreamerMSE::load):
2852
2853 2016-12-13  Commit Queue  <commit-queue@webkit.org>
2854
2855         Unreviewed, rolling out r209792.
2856         https://bugs.webkit.org/show_bug.cgi?id=165841
2857
2858         Cause build failures (Requested by yusukesuzuki on #webkit).
2859
2860         Reverted changeset:
2861
2862         "Use JSValue::toWTFString instead of calling toString(exec)
2863         and value(exec)"
2864         https://bugs.webkit.org/show_bug.cgi?id=165795
2865         http://trac.webkit.org/changeset/209792
2866
2867 2016-12-13  Yusuke Suzuki  <utatane.tea@gmail.com>
2868
2869         Use JSValue::toWTFString instead of calling toString(exec) and value(exec)
2870         https://bugs.webkit.org/show_bug.cgi?id=165795
2871
2872         Reviewed by Saam Barati.
2873
2874         * bindings/js/IDBBindingUtilities.cpp:
2875         (WebCore::createIDBKeyFromValue):
2876         (WebCore::getNthValueOnKeyPath): Deleted.
2877         (WebCore::internalCreateIDBKeyFromScriptValueAndKeyPath): Deleted.
2878         (WebCore::ensureNthValueOnKeyPath): Deleted.
2879         (WebCore::canInjectNthValueOnKeyPath): Deleted.
2880         (WebCore::injectIDBKeyIntoScriptValue): Deleted.
2881         (WebCore::maybeCreateIDBKeyFromScriptValueAndKeyPath): Deleted.
2882         (WebCore::canInjectIDBKeyIntoScriptValue): Deleted.
2883         (WebCore::deserializeIDBValueToJSValue): Deleted.
2884         (WebCore::scriptValueToIDBKey): Deleted.
2885         (WebCore::idbKeyDataToScriptValue): Deleted.
2886         (WebCore::createKeyPathArray): Deleted.
2887         (WebCore::generateIndexKeyForValue): Deleted.
2888         * bindings/js/JSAudioTrackCustom.cpp:
2889         (WebCore::JSAudioTrack::setKind):
2890         (WebCore::JSAudioTrack::setLanguage):
2891         * bindings/js/JSCryptoAlgorithmDictionary.cpp:
2892         (WebCore::JSCryptoAlgorithmDictionary::getAlgorithmIdentifier):
2893         * bindings/js/JSCustomXPathNSResolver.cpp:
2894         (WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
2895         * bindings/js/JSDOMWindowCustom.cpp:
2896         (WebCore::JSDOMWindow::setLocation):
2897         * bindings/js/JSDeviceMotionEventCustom.cpp:
2898         (WebCore::JSDeviceMotionEvent::initDeviceMotionEvent):
2899         * bindings/js/JSDeviceOrientationEventCustom.cpp:
2900         (WebCore::JSDeviceOrientationEvent::initDeviceOrientationEvent):
2901         * bindings/js/JSEventListener.cpp:
2902         (WebCore::JSEventListener::handleEvent):
2903         (WebCore::JSEventListener::virtualisAttribute): Deleted.
2904         (WebCore::JSEventListener::operator==): Deleted.
2905         (WebCore::eventHandlerAttribute): Deleted.
2906         (WebCore::createEventListenerForEventHandlerAttribute): Deleted.
2907         (WebCore::setEventHandlerAttribute): Deleted.
2908         (WebCore::windowEventHandlerAttribute): Deleted.
2909         (WebCore::setWindowEventHandlerAttribute): Deleted.
2910         (WebCore::documentEventHandlerAttribute): Deleted.
2911         (WebCore::setDocumentEventHandlerAttribute): Deleted.
2912         * bindings/js/JSHTMLAllCollectionCustom.cpp:
2913         (WebCore::callHTMLAllCollection):
2914         (WebCore::JSHTMLAllCollection::namedItem):
2915         * bindings/js/JSHTMLFormControlsCollectionCustom.cpp:
2916         (WebCore::JSHTMLFormControlsCollection::namedItem):
2917         * bindings/js/JSHTMLInputElementCustom.cpp:
2918         (WebCore::JSHTMLInputElement::setSelectionDirection):
2919         (WebCore::JSHTMLInputElement::setSelectionRange): Deleted.
2920         * bindings/js/JSInspectorFrontendHostCustom.cpp:
2921         (WebCore::populateContextMenuItems):
2922         (WebCore::JSInspectorFrontendHost::showContextMenu): Deleted.
2923         * bindings/js/JSMessageEventCustom.cpp:
2924         (WebCore::handleInitMessageEvent):
2925         * bindings/js/JSSQLTransactionCustom.cpp:
2926         (WebCore::JSSQLTransaction::executeSql):
2927         * bindings/js/JSTextTrackCustom.cpp:
2928         (WebCore::JSTextTrack::setLanguage):
2929         * bindings/js/JSVideoTrackCustom.cpp:
2930         (WebCore::JSVideoTrack::setKind):
2931         (WebCore::JSVideoTrack::setLanguage):
2932         * bindings/js/JSWebKitSubtleCryptoCustom.cpp:
2933         (WebCore::cryptoKeyFormatFromJSValue):
2934         (WebCore::cryptoKeyUsagesFromJSValue):
2935         * bindings/js/JSXMLHttpRequestCustom.cpp:
2936         (WebCore::JSXMLHttpRequest::send):
2937         (WebCore::JSXMLHttpRequest::responseText): Deleted.
2938         (WebCore::JSXMLHttpRequest::retrieveResponse): Deleted.
2939         * bindings/js/JSXSLTProcessorCustom.cpp:
2940         (WebCore::JSXSLTProcessor::setParameter):
2941         (WebCore::JSXSLTProcessor::getParameter):
2942         (WebCore::JSXSLTProcessor::removeParameter):
2943         * bindings/js/ScheduledAction.cpp:
2944         (WebCore::ScheduledAction::create):
2945         * bridge/c/c_utility.cpp:
2946         (JSC::Bindings::convertValueToNPVariant):
2947         * bridge/testbindings.cpp:
2948         (main):
2949         * inspector/InspectorDOMAgent.cpp:
2950         (WebCore::InspectorDOMAgent::buildObjectForEventListener):
2951
2952 2016-12-13  Yusuke Suzuki  <utatane.tea@gmail.com>
2953
2954         ASSERTION FAILED: hasParserBlockingScript() seen with js/dom/modules/module-will-fire-beforeload.html
2955         https://bugs.webkit.org/show_bug.cgi?id=164883
2956
2957         Reviewed by Ryosuke Niwa.
2958
2959         This is *attempt to fix* patch since I cannot reproduce the crash reported in this issue.
2960         One possible scenario of this crash is the following.
2961
2962         1. There is pending deferred scripts, that is not fetched yet.
2963         2. Then, we start watching on the script. And stop document parser.
2964         3. The document parser is stopped/detached by calling finishJSTest in beforeload.
2965         4. At this critical timing, (2)'s script is fetched, and notifyFinished is called since it is watched.
2966
2967         In this patch, we ignore the script execution if the document parser is stopped / detached.
2968         Previously, it goes into the wrong path. And it causes assertion failure.
2969
2970         * html/parser/HTMLDocumentParser.cpp:
2971         (WebCore::HTMLDocumentParser::notifyFinished):
2972
2973 2016-12-13  Keith Rollin  <krollin@apple.com>
2974
2975         Memory warning logging appears to capture resident footprint, missing compress/swap.
2976         https://bugs.webkit.org/show_bug.cgi?id=165533
2977         <rdar://problem/29318410>
2978
2979         Reviewed by Daniel Bates.
2980
2981         Fix GTK build by adding an explicit constructor.
2982
2983         * platform/MemoryPressureHandler.h:
2984         (WebCore::MemoryPressureHandler::ReliefLogger::MemoryUsage::MemoryUsage):
2985
2986 2016-12-13  Daniel Bates  <dabates@apple.com>
2987
2988         CSP: ws: and wss: blocked with connect-src *
2989         https://bugs.webkit.org/show_bug.cgi?id=165804
2990         <rdar://problem/28563643>
2991
2992         Reviewed by David Kilzer.
2993
2994         Allow * to match ws: and wss:. This will make our behavior of * more closely conform
2995         the behavior of * in the Content Security Policy Level 3 spec.,
2996         <https://w3c.github.io/webappsec-csp/#match-url-to-source-expression> (Editor's Draft, 2 December 2016).
2997
2998         Tests: http/tests/security/contentSecurityPolicy/connect-src-star-secure-websocket-allowed.html
2999                http/tests/security/contentSecurityPolicy/connect-src-star-websocket-allowed.html
3000                http/tests/security/contentSecurityPolicy/default-src-star-secure-websocket-allowed.html
3001                http/tests/security/contentSecurityPolicy/default-src-star-websocket-allowed.html
3002
3003         * page/csp/ContentSecurityPolicySourceList.cpp:
3004         (WebCore::ContentSecurityPolicySourceList::isProtocolAllowedByStar):
3005
3006 2016-12-13  Dave Hyatt  <hyatt@apple.com>
3007
3008         [CSS Parser] Make CSSFunctionValue derive from CSSValueList
3009         https://bugs.webkit.org/show_bug.cgi?id=165832
3010
3011         Reviewed by Dean Jackson.
3012
3013         With the old parser gone, we can now shrink CSSFunctionValue a bit by
3014         having it derive from CSSValueList instead of having an extra member
3015         that holds a value list of arguments. This is similar to the trick
3016         already employed by WebkitCSSTransformValue.
3017
3018         * css/CSSComputedStyleDeclaration.cpp:
3019         (WebCore::specifiedValueForGridTrackSize):
3020         * css/CSSFunctionValue.cpp:
3021         (WebCore::CSSFunctionValue::customCSSText):
3022         (WebCore::CSSFunctionValue::CSSFunctionValue): Deleted.
3023         (WebCore::CSSFunctionValue::equals): Deleted.
3024         (WebCore::CSSFunctionValue::append): Deleted.
3025         * css/CSSFunctionValue.h:
3026         * css/StyleBuilderConverter.h:
3027         (WebCore::StyleBuilderConverter::convertScrollSnapPoints):
3028         (WebCore::StyleBuilderConverter::createGridTrackSize):
3029         * css/StyleResolver.cpp:
3030         (WebCore::StyleResolver::createFilterOperations):
3031         * css/parser/CSSPropertyParser.cpp:
3032         (WebCore::isGridTrackFixedSized):
3033
3034 2016-12-13  Chris Dumez  <cdumez@apple.com>
3035
3036         Make Document a FrameDestructionObserver
3037         https://bugs.webkit.org/show_bug.cgi?id=165810
3038         <rdar://problem/29157645>
3039
3040         Reviewed by Ryosuke Niwa.
3041
3042         Make Document a FrameDestructionObserver to make sure Document::m_frame
3043         is properly nulled out when a Frame gets destroyed.
3044         Document::disconnectFromFrame() is supposed to be called before the Frame
3045         gets destroyed so this also adds an assertion to try and identify places
3046         where we fail to call it.
3047
3048         No new tests, no known reproduction case.
3049
3050         * dom/Document.cpp:
3051         (WebCore::Document::Document):
3052         (WebCore::Document::disconnectFromFrame):
3053         (WebCore::Document::frameDestroyed):
3054         * dom/Document.h:
3055         (WebCore::Document::frame): Deleted.
3056
3057 2016-12-13  Joseph Pecoraro  <pecoraro@apple.com>
3058
3059         REGRESSION(r204163): Web Inspector: Page crashes when Inspector tries to load insecure SourceMap
3060         https://bugs.webkit.org/show_bug.cgi?id=165806
3061         <rdar://problem/28169025>
3062
3063         Reviewed by Alex Christensen.
3064
3065         Test: http/tests/inspector/network/loadResource-insecure-resource.html
3066
3067         * inspector/InspectorNetworkAgent.cpp:
3068         (WebCore::InspectorNetworkAgent::loadResource):
3069         DocumentThreadableLoader now triggers the ThreadableLoaderClient's didFail
3070         callback, so this didFailLoaderCreation is now redundent and incorrect.
3071
3072 2016-12-13  Dave Hyatt  <hyatt@apple.com>
3073
3074         [CSS Parser] Enhance fast path translate transforms to allow percentages
3075         https://bugs.webkit.org/show_bug.cgi?id=165822
3076
3077         Reviewed by Simon Fraser.
3078
3079         * css/parser/CSSParserFastPaths.cpp:
3080         (WebCore::parseTransformTranslateArguments):
3081
3082 2016-12-13  Ryosuke Niwa  <rniwa@webkit.org>
3083
3084         :hover rule causes a single tap to not activate a slotted anchor element
3085         https://bugs.webkit.org/show_bug.cgi?id=165551
3086
3087         Reviewed by Antti Koivisto.
3088
3089         Fixed a bug in ancestorRespondingToClickEvents that we were traversing the ancestor nodes without taking
3090         shadow roots and slots into account. This prevented tapping on a text node assigned to a slot inside
3091         an anchor element to activate the hyperlink on iOS.
3092
3093         This bug was supposed to be fixed in r206605, and it was still broken on iOS due to the bug in
3094         ancestorRespondingToClickEvents. It is now tested by click-text-inside-linked-slot.html.
3095
3096         Tests: fast/shadow-dom/click-on-slotted-anchor-with-hover.html
3097                fast/shadow-dom/click-text-inside-linked-slot.html
3098
3099         * page/ios/FrameIOS.mm:
3100         (WebCore::ancestorRespondingToClickEvents):
3101         (WebCore::Frame::qualifyingNodeAtViewportLocation):
3102
3103 2016-12-13  Dave Hyatt  <hyatt@apple.com>
3104
3105         [CSS Parser] Eliminate SVGPaint and SVGColor
3106         https://bugs.webkit.org/show_bug.cgi?id=165819
3107
3108         Reviewed by Dean Jackson.
3109
3110         Remove SVGColor and SVGPaint CSS values from the tree. The new parser
3111         already stopped making these values when parsing, so all that's left
3112         is to make sure computed style doesn't use these values either.
3113
3114         We are the only browser engine to support these CSS values, they see no use
3115         on the Web, and they're already gone at the parsing level, so it's time
3116         to remove these interfaces from our tree.
3117
3118         * CMakeLists.txt:
3119         * DerivedSources.make:
3120         * WebCore.xcodeproj/project.pbxproj:
3121         * bindings/js/JSCSSValueCustom.cpp:
3122         (WebCore::toJSNewlyCreated):
3123         * css/CSSComputedStyleDeclaration.h:
3124         * css/CSSValue.cpp:
3125         (WebCore::CSSValue::equals):
3126         (WebCore::CSSValue::cssText):
3127         (WebCore::CSSValue::destroy):
3128         (WebCore::CSSValue::cloneForCSSOM):
3129         * css/CSSValue.h:
3130         (WebCore::CSSValue::isSubtypeExposedToCSSOM):
3131         (WebCore::CSSValue::isSVGColor): Deleted.
3132         (WebCore::CSSValue::isSVGPaint): Deleted.
3133         * css/SVGCSSComputedStyleDeclaration.cpp:
3134         (WebCore::ComputedStyleExtractor::adjustSVGPaintForCurrentColor):
3135         (WebCore::ComputedStyleExtractor::svgPropertyValue):
3136         * css/StyleBuilderConverter.h:
3137         (WebCore::StyleBuilderConverter::convertSVGColor):
3138         * css/StyleBuilderCustom.h:
3139         (WebCore::StyleBuilderCustom::applyValueFill):
3140         (WebCore::StyleBuilderCustom::applyValueStroke):
3141         * page/animation/CSSPropertyAnimation.cpp:
3142         (WebCore::PropertyWrapperSVGPaint::PropertyWrapperSVGPaint):
3143         * rendering/style/RenderStyle.h:
3144         (WebCore::RenderStyle::fillPaintType):
3145         (WebCore::RenderStyle::setFillPaintColor):
3146         (WebCore::RenderStyle::strokePaintType):
3147         (WebCore::RenderStyle::setStrokePaintColor):
3148         * rendering/style/SVGRenderStyle.h:
3149         (WebCore::SVGRenderStyle::initialFillPaintType):
3150         (WebCore::SVGRenderStyle::initialStrokePaintType):
3151         (WebCore::SVGRenderStyle::setFillPaint):
3152         (WebCore::SVGRenderStyle::setStrokePaint):
3153         (WebCore::SVGRenderStyle::fillPaintType):
3154         (WebCore::SVGRenderStyle::strokePaintType):
3155         (WebCore::SVGRenderStyle::visitedLinkFillPaintType):
3156         (WebCore::SVGRenderStyle::visitedLinkStrokePaintType):
3157         (WebCore::SVGRenderStyle::hasStroke):
3158         (WebCore::SVGRenderStyle::hasFill):
3159         * rendering/style/SVGRenderStyleDefs.h:
3160         * rendering/svg/RenderSVGResource.cpp:
3161         (WebCore::requestPaintingResource):
3162         * rendering/svg/SVGResources.cpp:
3163         (WebCore::paintingResourceFromSVGPaint):
3164         * svg/SVGAllInOne.cpp:
3165         * svg/SVGAnimatedColor.cpp:
3166         (WebCore::SVGAnimatedColorAnimator::constructFromString):
3167         (WebCore::parseColorFromString):
3168         (WebCore::SVGAnimatedColorAnimator::calculateDistance):
3169         * svg/SVGAnimatedType.cpp:
3170         (WebCore::SVGAnimatedType::setValueAsString):
3171         * svg/SVGAnimatedType.h:
3172         * svg/SVGColor.cpp: Removed.
3173         * svg/SVGColor.h: Removed.
3174         * svg/SVGColor.idl: Removed.
3175         * svg/SVGFEDiffuseLightingElement.cpp:
3176         * svg/SVGFESpecularLightingElement.cpp:
3177         * svg/SVGPaint.cpp: Removed.
3178         * svg/SVGPaint.h: Removed.
3179         * svg/SVGPaint.idl: Removed.
3180
3181 2016-12-13  Alex Christensen  <achristensen@webkit.org>
3182
3183         Restore NSURLRequest's default time interval to match behavior before NSURLSession adoption
3184         https://bugs.webkit.org/show_bug.cgi?id=165821
3185         <rdar://problem/28492939>
3186
3187         Reviewed by Brady Eidson.
3188
3189         Before adopting NSURLSession, iOS used CFURLConnection, not NSURLConnection.
3190         iOS used to have a default timeout of INT_MAX and it now has a default timeout of 0, which means use the 
3191         default NSURLRequest timeout, which is 60 seconds.  This is not enough for some slow mobile networks,
3192         so we want to match behavior of our CFURLConnection code here.
3193
3194         * platform/network/ResourceRequestBase.cpp:
3195         Use INT_MAX as the default timeout of requests on iOS.
3196
3197 2016-12-13  Filip Pizlo  <fpizlo@apple.com>
3198
3199         Make opaque root scanning truly constraint-based
3200         https://bugs.webkit.org/show_bug.cgi?id=165760
3201
3202         Reviewed by Saam Barati.
3203
3204         No new tests yet. I think that writing tests for this is a big investigation:
3205         https://bugs.webkit.org/show_bug.cgi?id=165808
3206         
3207         Remove the previous advancing wavefront DOM write barrier. I don't think this will scale
3208         very well. It's super confusing.
3209         
3210         This change makes it so that visitChildren can become a GC constraint that executes as
3211         part of the fixpoint. This changes all WebCore visitChildren methods that do opaque
3212         roots into constraints.
3213
3214         * bindings/js/CommonVM.cpp:
3215         (WebCore::commonVMSlow):
3216         (WebCore::writeBarrierOpaqueRootSlow): Deleted.
3217         * bindings/js/CommonVM.h:
3218         (WebCore::writeBarrierOpaqueRoot): Deleted.
3219         * bindings/js/JSAttrCustom.cpp:
3220         (WebCore::JSAttr::visitAdditionalChildren):
3221         * bindings/js/JSDOMWindowCustom.cpp:
3222         (WebCore::JSDOMWindow::visitAdditionalChildren):
3223         * bindings/js/JSIDBCursorCustom.cpp:
3224         (WebCore::JSIDBCursor::visitAdditionalChildren):
3225         * bindings/js/JSMessageChannelCustom.cpp:
3226         (WebCore::JSMessageChannel::visitAdditionalChildren):
3227         * bindings/js/JSMessagePortCustom.cpp:
3228         (WebCore::JSMessagePort::visitAdditionalChildren):
3229         * bindings/js/JSNodeIteratorCustom.cpp:
3230         (WebCore::JSNodeIterator::visitAdditionalChildren):
3231         * bindings/js/JSTextTrackCueCustom.cpp:
3232         (WebCore::JSTextTrackCue::visitAdditionalChildren):
3233         * bindings/js/JSTreeWalkerCustom.cpp:
3234         (WebCore::JSTreeWalker::visitAdditionalChildren):
3235         * bindings/js/JSWorkerGlobalScopeCustom.cpp:
3236         (WebCore::JSWorkerGlobalScope::visitAdditionalChildren):
3237         * bindings/js/JSXMLHttpRequestCustom.cpp:
3238         (WebCore::JSXMLHttpRequest::visitAdditionalChildren):
3239         * bindings/js/JSXPathResultCustom.cpp:
3240         (WebCore::JSXPathResult::visitAdditionalChildren):
3241         * dom/ContainerNodeAlgorithms.cpp:
3242         (WebCore::notifyChildNodeInserted):
3243         (WebCore::notifyChildNodeRemoved):
3244
3245 2016-12-12  Sam Weinig  <sam@webkit.org>
3246
3247         [WebIDL] Remove use of Dictionary in ApplePaySession
3248         https://bugs.webkit.org/show_bug.cgi?id=165787
3249
3250         Reviewed by Anders Carlsson.
3251
3252         First take at generating the bindings for ApplePaySession and removing
3253         all use of Dictionary.
3254         
3255         - Removes all use of Dictionary!
3256         - Removes use of logging errors to the console with improved Exception messages.
3257         - Use ExceptionOr extensively to pass exception state.
3258         
3259         Still to do:
3260             - Reconcile / merge ApplePaySession::PaymentRequest with WebCore::PaymentRequest
3261               and all the sub-objects held within.
3262             - Remove PaymentRequestValidator entirely, merging validation into the validation
3263               we already do in ApplePaySession.cpp
3264             - Make ApplePayEvents use generated dictionary creation code.
3265
3266         Test: http/tests/ssl/applepay/ApplePaySession.html
3267
3268         * Modules/applepay/ApplePaySession.cpp:
3269         (WebCore::convertAndValidate):
3270         (WebCore::canCallApplePaySessionAPIs):
3271         (WebCore::ApplePaySession::create):
3272         (WebCore::ApplePaySession::ApplePaySession):
3273         (WebCore::ApplePaySession::supportsVersion):
3274         (WebCore::ApplePaySession::canMakePayments):
3275         (WebCore::ApplePaySession::canMakePaymentsWithActiveCard):
3276         (WebCore::ApplePaySession::openPaymentSetup):
3277         (WebCore::ApplePaySession::begin):
3278         (WebCore::ApplePaySession::completeMerchantValidation):
3279         (WebCore::ApplePaySession::completeShippingMethodSelection):
3280         (WebCore::ApplePaySession::completeShippingContactSelection):
3281         (WebCore::ApplePaySession::completePaymentMethodSelection):
3282         (WebCore::ApplePaySession::didSelectShippingMethod):
3283         (WebCore::createContactFields): Deleted.
3284         (WebCore::toLineItemType): Deleted.
3285         (WebCore::isValidLineItemPropertyName): Deleted.
3286         (WebCore::createLineItem): Deleted.
3287         (WebCore::createLineItems): Deleted.
3288         (WebCore::createMerchantCapabilities): Deleted.
3289         (WebCore::createSupportedNetworks): Deleted.
3290         (WebCore::toShippingType): Deleted.
3291         (WebCore::isValidShippingMethodPropertyName): Deleted.
3292         (WebCore::createShippingMethod): Deleted.
3293         (WebCore::createShippingMethods): Deleted.
3294         (WebCore::isValidPaymentRequestPropertyName): Deleted.
3295         (WebCore::createPaymentRequest): Deleted.
3296         * Modules/applepay/ApplePaySession.h:
3297         Replace hand written dictionary extraction code with autogenerated code
3298         and hand written additional validation.
3299
3300         * Modules/applepay/ApplePaySession.idl:
3301         Add helper dictionaries and enums.
3302
3303         * Modules/applepay/PaymentRequestValidator.cpp:
3304         (WebCore::PaymentRequestValidator::validate):
3305         (WebCore::PaymentRequestValidator::validateTotal):
3306         (WebCore::validateCountryCode):
3307         (WebCore::validateCurrencyCode):
3308         (WebCore::validateMerchantCapabilities):
3309         (WebCore::validateSupportedNetworks):
3310         (WebCore::validateShippingMethod):
3311         (WebCore::validateShippingMethods):
3312         (WebCore::PaymentRequestValidator::PaymentRequestValidator): Deleted.
3313         (WebCore::PaymentRequestValidator::~PaymentRequestValidator): Deleted.
3314         (WebCore::PaymentRequestValidator::validateCountryCode): Deleted.
3315         (WebCore::PaymentRequestValidator::validateCurrencyCode): Deleted.
3316         (WebCore::PaymentRequestValidator::validateMerchantCapabilities): Deleted.
3317         (WebCore::PaymentRequestValidator::validateShippingMethod): Deleted.
3318         (WebCore::PaymentRequestValidator::validateSupportedNetworks): Deleted.
3319         (WebCore::PaymentRequestValidator::validateShippingMethods): Deleted.
3320         * Modules/applepay/PaymentRequestValidator.h:
3321         Instead of reporting the validation errors to the console, pass them in the exception.
3322         This allows us to remove the window member, and move the helpers to the implementation
3323         file as statics.
3324
3325         * WebCore.xcodeproj/project.pbxproj:
3326         Remove file.
3327
3328         * bindings/generic/IDLTypes.h:
3329         (WebCore::IDLObject::nullValue):
3330         (WebCore::IDLObject::isNullValue):
3331         (WebCore::IDLObject::extractValueFromNullable):
3332         Add nullability traits for IDLObject.
3333         
3334         * bindings/js/JSApplePaySessionCustom.cpp:
3335         Removed.
3336
3337 2016-12-13  Daniel Bates  <dabates@apple.com>
3338
3339         CSP: Teach the preload scanner about the 'nonce' attribute
3340         https://bugs.webkit.org/show_bug.cgi?id=161192
3341         <rdar://problem/28010354>
3342
3343         Reviewed by Darin Adler.
3344
3345         This patch was inspired by a similar Blink change:
3346         <https://chromium.googlesource.com/chromium/src/+/dde5487f380cf774e4c0e96ba7f88ea68e723907>
3347
3348         Preload external scripts and stylesheets whose HTML script and link elements have a nonce
3349         attribute that is listed in the Content Security Policy (CSP) of the page.
3350
3351         Currently the preload scanner ignores the nonce attribute on HTML script and link elements.
3352         So, WebKit does not preload their associated subresources unless the value of the src
3353         attribute or href attribute is whitelisted in the CSP of the page for script and link
3354         elements, respectively. Instead the preload scanner should recognize the nonce attribute on
3355         script and link elements and query the CSP of the page with it. If the nonce attribute is
3356         whitelisted then the request should be preloaded.
3357
3358         Tests: http/tests/loading/do-not-preload-css-blocked-by-csp.html
3359                http/tests/loading/do-not-preload-script-src-blocked-by-csp.html
3360                http/tests/loading/preload-css-with-csp-nonce.html
3361                http/tests/loading/preload-script-src-with-csp-nonce.html
3362
3363         * html/parser/HTMLPreloadScanner.cpp:
3364         (WebCore::TokenPreloadScanner::StartTagScanner::createPreloadRequest): Set the nonce on the
3365         PreloadRequest to the nonce that we found during the scan.
3366         (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute): For script and link tag names,
3367         save the value of the nonce attribute (if it has one).
3368         * html/parser/HTMLResourcePreloader.cpp:
3369         (WebCore::PreloadRequest::resourceRequest): Skip CSP policy check if the nonce is listed in
3370         the CSP of the page.
3371         * html/parser/HTMLResourcePreloader.h:
3372         (WebCore::PreloadRequest::setNonce): Added.
3373
3374 2016-12-13  Dave Hyatt  <hyatt@apple.com>
3375
3376         [CSS Parser] Rename CSSPrimitiveValue::UnitTypes to CSSPrimitiveValue::UnitType
3377         https://bugs.webkit.org/show_bug.cgi?id=165776
3378
3379         Reviewed by Zalan Bujtas.
3380
3381         * css/CSSCalculationValue.cpp:
3382         (WebCore::unitCategory):
3383         (WebCore::hasDoubleValue):
3384         (WebCore::determineCategory):
3385         (WebCore::CSSCalcExpressionNodeParser::parseValue):
3386         * css/CSSCalculationValue.h:
3387         * css/CSSPrimitiveValue.cpp:
3388         (WebCore::isValidCSSUnitTypeForDoubleConversion):
3389         (WebCore::isStringType):
3390         (WebCore::CSSPrimitiveValue::unitCategory):
3391         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
3392         (WebCore::CSSPrimitiveValue::cleanup):
3393         (WebCore::CSSPrimitiveValue::computeLengthDouble):
3394         (WebCore::CSSPrimitiveValue::computeNonCalcLengthDouble):
3395         (WebCore::CSSPrimitiveValue::conversionToCanonicalUnitsScaleFactor):
3396         (WebCore::CSSPrimitiveValue::getFloatValue):
3397         (WebCore::CSSPrimitiveValue::doubleValue):
3398         (WebCore::CSSPrimitiveValue::canonicalUnitTypeForCategory):
3399         (WebCore::CSSPrimitiveValue::doubleValueInternal):
3400         (WebCore::CSSPrimitiveValue::cloneForCSSOM):
3401         * css/CSSPrimitiveValue.h:
3402         (WebCore::CSSPrimitiveValue::isFontRelativeLength):
3403         (WebCore::CSSPrimitiveValue::isLength):
3404         (WebCore::CSSPrimitiveValue::isResolution):
3405         (WebCore::CSSPrimitiveValue::createAllowingMarginQuirk):
3406         * css/CSSValue.h:
3407         * css/CSSValuePool.cpp:
3408         (WebCore::CSSValuePool::createValue):
3409         * css/CSSValuePool.h:
3410         (WebCore::CSSValuePool::createValue):