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