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