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