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