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