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