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