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