AX: [Mac] Mark element AXAPI should comform to specs
[WebKit.git] / Source / WebCore / ChangeLog
1 2016-10-19  Nan Wang  <n_wang@apple.com>
2
3         AX: [Mac] Mark element AXAPI should comform to specs
4         https://bugs.webkit.org/show_bug.cgi?id=163707
5
6         Reviewed by Chris Fleizach.
7
8         Created a new role for mark elements on Mac and exposed the role
9         description.
10
11         Changes are covered in modified test expectaions.
12
13         * English.lproj/Localizable.strings:
14         * accessibility/AccessibilityObject.h:
15         * accessibility/AccessibilityRenderObject.cpp:
16         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
17         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
18         (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
19         * accessibility/mac/AccessibilityObjectMac.mm:
20         (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject):
21         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
22         (createAccessibilityRoleMap):
23         (-[WebAccessibilityObjectWrapper roleDescription]):
24         * platform/LocalizedStrings.cpp:
25         (WebCore::AXMarkText):
26         * platform/LocalizedStrings.h:
27
28 2016-10-19  Alex Christensen  <achristensen@webkit.org>
29
30         Re-enable URLParser for non-Safari Cocoa apps after r207321
31         https://bugs.webkit.org/show_bug.cgi?id=163690
32
33         Reviewed by Darin Adler.
34
35         I disabled the URLParser for non-Safari applications in r207305
36         to give me time to make URLParser more compatible, which I did in r207321
37
38         Updated some API tests which will be investigated in 
39         https://bugs.webkit.org/show_bug.cgi?id=163127
40
41         * platform/URLParser.cpp:
42         (WebCore::URLParser::setEnabled):
43         (WebCore::URLParser::enabled):
44         * testing/js/WebCoreTestSupport.cpp:
45         (WebCoreTestSupport::setURLParserEnabled): Deleted.
46         * testing/js/WebCoreTestSupport.h:
47
48 2016-10-19  Myles C. Maxfield  <mmaxfield@apple.com>
49
50         CSS font-variation-settings does not handle uppercase axis names in variable fonts
51         https://bugs.webkit.org/show_bug.cgi?id=163546
52
53         Reviewed by Dean Jackson.
54
55         Remove the extra toASCIILower() call.
56
57         Test: fast/text/variations/case-axis-names.html
58
59         * css/parser/CSSParser.cpp:
60         (WebCore::CSSParser::parseFontVariationTag):
61
62 2016-10-19  Anders Carlsson  <andersca@apple.com>
63
64         Remove m_redirectURLs from HistoryItem
65         https://bugs.webkit.org/show_bug.cgi?id=163704
66
67         Reviewed by Dan Bernstein.
68
69         * history/HistoryItem.cpp:
70         (WebCore::HistoryItem::HistoryItem):
71         (WebCore::HistoryItem::reset):
72         * history/HistoryItem.h:
73
74 2016-10-19  Joone Hur  <joone.hur@intel.com>
75
76         Add a plain space instead of &nbsp; between text nodes
77         https://bugs.webkit.org/show_bug.cgi?id=123163
78
79         Reviewed by Ryosuke Niwa.
80
81         When we rebalance white spaces, &nbsp; can be added as space
82         under some conditions. This patch adds a condition that the next
83         sibling text node should not exist.
84
85         No new tests, updated existing test.
86
87         * editing/CompositeEditCommand.cpp:
88         (WebCore::CompositeEditCommand::rebalanceWhitespaceOnTextSubstring):
89         * editing/htmlediting.cpp:
90         (WebCore::stringWithRebalancedWhitespace):
91         * editing/htmlediting.h:
92
93 2016-10-19  Sam Weinig  <sam@webkit.org>
94
95         Add support for sequences and dictionaries in unions
96         https://bugs.webkit.org/show_bug.cgi?id=163695
97
98         Reviewed by Chris Dumez.
99
100         Tests:
101          - Updated js/dom/webidl-type-mapping.html
102
103         * bindings/generic/IDLTypes.h:
104         Add additional helper predicates and fix formatting.
105
106         * bindings/js/JSDOMBinding.h:
107         Export hasIteratorMethod for use in testing.
108
109         * bindings/js/JSDOMConvert.h:
110         - Change return type of Converter<IDLDictionary<T>> to T, from Optional<T>.
111         - Add support for unions conversion step 12 (parts 1-3).
112
113         * bindings/scripts/CodeGeneratorJS.pm:
114         (GenerateDefaultValue):
115         Support complex default value computations for unions using the convert infrastructure.
116
117         (GenerateParametersCheck):
118         (GenerateConstructorDefinition):
119         Remove incorrect .value() calls now that Converter<IDLDictionary<T>> returns T.
120
121         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
122         * bindings/scripts/test/JS/JSTestObj.cpp:
123         Update bindings test results.
124
125         * testing/TypeConversions.h:
126         (WebCore::TypeConversions::setTypeConversionsDictionary):
127         (WebCore::TypeConversions::typeConversionsDictionaryLongValue):
128         (WebCore::TypeConversions::typeConversionsDictionaryStringValue):
129         (WebCore::TypeConversions::typeConversionsDictionarySequenceValue):
130         (WebCore::TypeConversions::typeConversionsDictionaryUnionType):
131         * testing/TypeConversions.idl:
132         Add some complex types to allow testing IDL conversions from tests.
133
134 2016-10-19  Ryosuke Niwa  <rniwa@webkit.org>
135
136         Annotate more DOM and HTML IDLs with CEReactions
137         https://bugs.webkit.org/show_bug.cgi?id=163653
138
139         Reviewed by Darin Adler.
140
141         Added CEReactions to more IDL files.
142
143         Test: fast/custom-elements/reactions-for-webkit-extensions.html
144
145         * bindings/js/JSDOMStringMapCustom.cpp:
146         (WebCore::JSDOMStringMap::deleteProperty): Instantiate CustomElementReactionStack, which is equivalent to
147         adding CEReactions in IDL.
148         (WebCore::JSDOMStringMap::putDelegate): Ditto.
149         * dom/Document.idl:
150         * dom/Element.idl:
151         * html/HTMLElement.idl:
152         * page/DOMSelection.idl:
153
154 2016-10-19  Ryan Haddad  <ryanhaddad@apple.com>
155
156         Unreviewed, rolling out r207557.
157
158         This change caused animations/font-variations tests to time
159         out on pre-Sierra Macs.
160
161         Reverted changeset:
162
163         "[macOS] [iOS] Disable variation fonts on macOS El Capitan and
164         iOS 9"
165         https://bugs.webkit.org/show_bug.cgi?id=163374
166         http://trac.webkit.org/changeset/207557
167
168 2016-10-19  Dave Hyatt  <hyatt@apple.com>
169
170         [CSS Parser] Support -webkit-border-fit
171         https://bugs.webkit.org/show_bug.cgi?id=163687
172
173         Reviewed by Zalan Bujtas.
174
175         Add support for -webkit-border-fit to isValidKeywordPropertyAndValue.
176
177         * css/parser/CSSParserFastPaths.cpp:
178         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
179
180 2016-10-19  Dave Hyatt  <hyatt@apple.com>
181
182         [CSS Parser] class and id parsing need to be case-insensitive in HTML quirks mode
183         https://bugs.webkit.org/show_bug.cgi?id=163685
184
185         Reviewed by Zalan Bujtas.
186
187         Class and ID parsing should be case-insensitive in quirks mode. Apply the same hack
188         that the old parser did and lowercase the class and ids in place.
189
190         * css/parser/CSSSelectorParser.cpp:
191         (WebCore::CSSSelectorParser::consumeId):
192         (WebCore::CSSSelectorParser::consumeClass):
193
194 2016-10-19  Nan Wang  <n_wang@apple.com>
195
196         AX: crash: com.apple.WebCore: WebCore::AccessibilityObject::findMatchingObjects + 600
197         https://bugs.webkit.org/show_bug.cgi?id=163682
198
199         Reviewed by Chris Fleizach.
200
201         There's a null pointer crash when we ask for startObject->parentObjectUnignored() in
202         AccessibilityObject::findMatchingObject. Added a null check for the startObject to fix that.
203
204         Test: accessibility/mac/search-predicate-crash.html
205
206         * accessibility/AccessibilityObject.cpp:
207         (WebCore::AccessibilityObject::findMatchingObjects):
208
209 2016-10-19  David Kilzer  <ddkilzer@apple.com>
210
211         Bug 163670: Refine assertions in WebCore::ImageData constructors
212         <https://webkit.org/b/163670>
213         <rdar://problem/27497338>
214
215         Reviewed by Brent Fulgham.
216
217         No new tests because there is no change in nominal behavior.
218
219         * html/ImageData.cpp:
220         (WebCore::ImageData::ImageData(const IntSize&)): Change to use
221         ASSERT() since the worst-case scenario here is a nullptr deref.
222         Switch to IntSize::area() to compute the area.
223         (WebCore::ImageData::ImageData(const IntSize&, Ref<Uint8ClampedArray>&&)):
224         Add ASSERT() identical to the previous constructor, and change
225         ASSERT_WITH_SECURITY_IMPLICATION() to only fire when m_data is
226         not nullptr and the length check fails.  Switch to
227         IntSize::area() to compute the area.
228
229 2016-10-19  Myles C. Maxfield  <mmaxfield@apple.com>
230
231         [macOS] [iOS] Disable variation fonts on macOS El Capitan and iOS 9
232         https://bugs.webkit.org/show_bug.cgi?id=163374
233
234         Reviewed by Darin Adler.
235
236         Because of platform lack of support for variations in in-memory fonts,
237         this feature should be disabled on the affected OSes.
238
239         No tests because there is no behavior change (on the relevant platforms).
240
241         * Configurations/FeatureDefines.xcconfig:
242
243 2016-10-19  Dave Hyatt  <hyatt@apple.com>
244
245         [CSS Parser] Fix background-position parsing
246         https://bugs.webkit.org/show_bug.cgi?id=163681
247
248         Reviewed by Dean Jackson.
249
250         The new parser has a more efficient parsed representation of background positions. When
251         background-position is "center" or when no length unit is specified for a dimension,
252         then rather than creating a pair, the new parser makes a singleton primitive value.
253
254         Patch the StyleBuilder code to handle this case, resolving center to (left,50%) or
255         (top,50%) as appropriate and also handling top/left without any associated length.
256
257         * css/CSSToStyleMap.cpp:
258         (WebCore::CSSToStyleMap::mapFillXPosition):
259         (WebCore::CSSToStyleMap::mapFillYPosition):
260
261 2016-10-19  Antoine Quint  <graouts@apple.com>
262
263         [Modern Media Controls] Media Controller: click-to-start support
264         https://bugs.webkit.org/show_bug.cgi?id=163659
265         <rdar://problem/28845656>
266
267         Reviewed by Dean Jackson.
268
269         We introduce the MediaControllerSupport class which will allow a number of media controller
270         features to be implemented by subclasses each devoted to implementing a specific subset of
271         media controller features. With this bug, we add the correct behavior for click-to-start,
272         only showing the start button under the right circumstances.
273
274         A MediaController object indicates which media control to attach click event listeners to
275         through the `control` property, and a list of media events it should register on the media
276         element through the `mediaEvents` property. Then, as the user interacts with the specified
277         control and the media, the Button delegation method `buttonWasClicked()` and the `syncControl()`
278         methods are called to allow for the media state to be correctly set and represented in the
279         media controls. Custom event handling for the specified events can also be achieved by
280         subclassing the `handleEvent()` method.
281
282         Tests: media/modern-media-controls/start-support/start-support-audio.html
283                media/modern-media-controls/start-support/start-support-autoplay.html
284                media/modern-media-controls/start-support/start-support-click-to-start.html
285                media/modern-media-controls/start-support/start-support-error.html
286                media/modern-media-controls/start-support/start-support-fullscreen.html
287                media/modern-media-controls/start-support/start-support-manual-play.html
288                media/modern-media-controls/start-support/start-support-no-source.html
289
290         * Modules/modern-media-controls/media/media-controller-support.js: Added.
291         (MediaControllerSupport):
292         (MediaControllerSupport.prototype.get control):
293         (MediaControllerSupport.prototype.get mediaEvents):
294         (MediaControllerSupport.prototype.buttonWasClicked):
295         (MediaControllerSupport.prototype.handleEvent):
296         (MediaControllerSupport.prototype.syncControl):
297         * Modules/modern-media-controls/media/media-controller.js:
298         (MediaController):
299         (MediaController.prototype.buttonWasClicked): Deleted.
300         * Modules/modern-media-controls/media/start-support.js: Added.
301         (StartSupport.prototype.get control):
302         (StartSupport.prototype.get mediaEvents):
303         (StartSupport.prototype.buttonWasClicked):
304         (StartSupport.prototype.handleEvent):
305         (StartSupport.prototype.syncControl):
306         (StartSupport.prototype._shouldShowStartButton):
307         (StartSupport):
308
309 2016-10-19  Aaron Chu  <aaron_chu@apple.com>
310
311         Web Inspector: AXI: expose computed tree node and heading level
312         https://bugs.webkit.org/show_bug.cgi?id=130825
313         <rdar://problem/16442349>
314
315         Reviewed by Joseph Pecoraro.
316
317         Exposing two new accessibility properties: Heading Level and Hierarchical Level.
318
319         Updated Test: LayoutTest/inspector/dom/getAccessibilityPropertiesForNode.html
320
321         * inspector/InspectorDOMAgent.cpp:
322         (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
323
324 2016-10-19  Adam Bergkvist  <adam.bergkvist@ericsson.com>
325
326         WebRTC: Implement MediaEndpointPeerConnection::stop()
327         https://bugs.webkit.org/show_bug.cgi?id=163660
328
329         Reviewed by Philippe Normand.
330
331         Make MediaEndpointPeerConnection::stop() stop its MediaEndpoint.
332
333         Testing: This fix deals with cleanup and tearing down resources down in the platform layer
334         and is not covered by automated tests. It is however observable in the manual test added
335         in [1] where the remote videos should stop when the connections are closed.
336
337         [1] http://webkit.org/b/163327
338
339         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
340         (WebCore::MediaEndpointPeerConnection::stop):
341
342 2016-10-19  Dave Hyatt  <hyatt@apple.com>
343
344         [CSS Parser] Fix -webkit-mask-box-image parsing
345         https://bugs.webkit.org/show_bug.cgi?id=163676
346
347         Reviewed by Dean Jackson.
348
349         -webkit-mask-box-image is not a shorthand in our current code, so treat it the same as the legacy
350         -webkit-border-image.
351
352         * css/parser/CSSPropertyParser.cpp:
353         (WebCore::CSSPropertyParser::parseSingleValue):
354         (WebCore::CSSPropertyParser::parseShorthand):
355
356 2016-10-19  Carlos Alberto Lopez Perez  <clopez@igalia.com>
357
358         [GTK][EFL] Build fix after r207543.
359         https://bugs.webkit.org/show_bug.cgi?id=163671
360
361         Unreviewed.
362
363         Fix typo on the filename of the included header:
364         Mac filesystem is case insensitive, but Linux filesystems are case sensitive.
365
366         * css/parser/CSSPropertyParser.cpp:
367
368 2016-10-19  Zalan Bujtas  <zalan@apple.com>
369
370         Use anonymous table row for new child at RenderTableRow::addChild() if available.
371         https://bugs.webkit.org/show_bug.cgi?id=163651
372         <rdar://problem/28705022>
373
374         Reviewed by David Hyatt.
375
376         We should try to prevent the continuation siblings from getting separated and inserted into
377         wrapper renderers. It makes finding these continuation siblings difficult.
378         This patch adds a checks for anonymous table rows so that we could find a closer common ancestor of
379         beforeChild/new child. 
380
381         Test: fast/table/crash-when-table-has-continuation-and-content-inserted.html
382
383         * rendering/RenderObject.cpp:
384         (WebCore::RenderObject::showRenderObject): Add continuation information.
385         * rendering/RenderTableRow.cpp:
386         (WebCore::RenderTableRow::addChild):
387
388 2016-10-19  Joseph Pecoraro  <pecoraro@apple.com>
389
390         Cleanup WebCore/workers
391         https://bugs.webkit.org/show_bug.cgi?id=163635
392
393         Reviewed by Chris Dumez.
394
395         * workers/*:
396         Cleanup like pragma once, nullptr, remove stale includes, declarations.
397
398 2016-10-19  Chris Dumez  <cdumez@apple.com>
399
400         MouseEvent's coordinates should be 0 for simulated clicks
401         https://bugs.webkit.org/show_bug.cgi?id=163648
402
403         Reviewed by Darin Adler.
404
405         MouseEvent's coordinates should be 0 / 0 for simulated clicks triggered
406         by JavaScript (i.e. via element.click()). This behavior matches Chrome
407         and Firefox.
408
409         WebKit was computing actual coordinates for the element which was
410         expensive, especially because computing  screenX / screenY required
411         a synchronous IPC with the UI process.
412
413         Test: fast/events/element-click-no-coords.html
414
415         * dom/Element.cpp:
416         (WebCore::Element::dispatchSimulatedClick):
417         * dom/SimulatedClick.cpp:
418         (WebCore::simulateMouseEvent):
419         (WebCore::simulateClick):
420         * dom/SimulatedClick.h:
421         * html/HTMLElement.cpp:
422         (WebCore::HTMLElement::click):
423
424 2016-10-19  Dave Hyatt  <hyatt@apple.com>
425
426         [CSS Parser] Fix transform parsing
427         https://bugs.webkit.org/show_bug.cgi?id=163671
428
429         Reviewed by Dean Jackson.
430
431         The new parser turned function names into CSSValueIDs and made CSSFunctionValue store them. This
432         meant it could be used to handle transform values, with the function name representing the
433         transform operation efficiently as a CSSValueID.
434
435         The old parser, however, creates WebKitCSSTransformValues. This value does not exist in the new
436         parser. Rather than forcing the old and new parser over to CSSFunctionValues, I opted to
437         just make the new parser build WebkitCSSTransformValues too.
438
439         The main reason I did this is that WebkitCSSTransformValue is actually exposed to the Web via
440         IDL. To be safe, I am not eliminating it (even though Blink has).
441
442         * css/parser/CSSPropertyParser.cpp:
443         (WebCore::consumeTranslate3d):
444         (WebCore::consumeNumbers):
445         (WebCore::consumePerspective):
446         (WebCore::transformOperationForCSSValueID):
447         (WebCore::consumeTransformValue):
448
449 2016-10-19  Darin Adler  <darin@apple.com>
450
451         Move XPath from ExceptionCode to Exception
452         https://bugs.webkit.org/show_bug.cgi?id=163656
453
454         Reviewed by Chris Dumez.
455
456         * dom/Document.cpp:
457         (WebCore::Document::createExpression): Use ExceptionOr.
458         (WebCore::Document::createNSResolver): Return Ref.
459         (WebCore::Document::evaluate): Use ExceptionOr.
460         * dom/Document.h: Updated for above changes.
461         * dom/Document.idl: Use non-legacy exceptions for the functions above.
462
463         * inspector/InspectorNodeFinder.cpp:
464         (WebCore::InspectorNodeFinder::searchUsingXPath): Call XPath functions
465         with new interface.
466
467         * xml/DOMParser.cpp:
468         (WebCore::DOMParser::DOMParser): Marked inline.
469         (WebCore::DOMParser::create): Moved here from header.
470         (WebCore::DOMParser::parseFromString): Use ExceptionOr.
471         * xml/DOMParser.h: Updated for above changes.
472         * xml/DOMParser.idl: Use non-legacy exception.
473
474         * xml/XPathEvaluator.cpp:
475         (WebCore::XPathEvaluator::createExpression): Use ExceptionOr.
476         (WebCore::XPathEvaluator::evaluate): Ditto.
477         * xml/XPathEvaluator.h: Updated for above changes.
478         * xml/XPathEvaluator.idl: Use non-legacy exceptions.
479
480         * xml/XPathExpression.cpp:
481         (WebCore::XPathExpression::createExpression): Use ExceptionOr.
482         (WebCore::XPathExpression::evaluate): Ditto.
483         * xml/XPathExpression.h: Updated for above changes.
484         * xml/XPathExpression.idl: Use non-legacy exceptions.
485
486         * xml/XPathGrammar.y: Added include of XPathStep.h.
487
488         * xml/XPathParser.cpp:
489         (WebCore::XPath::Parser::Parser): Initialize three scalar data members
490         in the class definition rather than here.
491         (WebCore::XPath::Parser::parseStatement): Use ExceptionOr.
492         * xml/XPathParser.h: Updated for above changes.
493
494         * xml/XPathResult.cpp:
495         (WebCore::XPathResult::XPathResult): Use a reference rather than a
496         pointer for the document. Alao initialize two scalar data members
497         in the class definition rather than here.
498         (WebCore::XPathResult::convertTo): Use ExceptionOr.
499         (WebCore::XPathResult::numberValue): Ditto.
500         (WebCore::XPathResult::stringValue): Ditto.
501         (WebCore::XPathResult::booleanValue): Ditto.
502         (WebCore::XPathResult::singleNodeValue): Ditto.
503         (WebCore::XPathResult::snapshotLength): Ditto.
504         (WebCore::XPathResult::iterateNext): Ditto.
505         (WebCore::XPathResult::snapshotItem): Ditto.
506         * xml/XPathResult.h: Updated for the changes above.
507         * xml/XPathResult.idl: Use non-legacy exceptions.
508
509 2016-10-19  Nan Wang  <n_wang@apple.com>
510
511         AX: [Mac] Meter element should use AXValueDescription to descrbe the status of the value
512         https://bugs.webkit.org/show_bug.cgi?id=163610
513
514         Reviewed by Chris Fleizach.
515
516         Exposed the goodness of the meter value in AXValueDescription.
517
518         Test: accessibility/mac/meter-gauge-value-description.html
519
520         * English.lproj/Localizable.strings:
521         * accessibility/AccessibilityProgressIndicator.cpp:
522         (WebCore::AccessibilityProgressIndicator::gaugeRegionValueDescription):
523         * accessibility/AccessibilityProgressIndicator.h:
524         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
525         (-[WebAccessibilityObjectWrapper valueDescriptionForMeter]):
526         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
527         * platform/LocalizedStrings.cpp:
528         (WebCore::AXMeterGaugeRegionOptimumText):
529         (WebCore::AXMeterGaugeRegionSuboptimalText):
530         (WebCore::AXMeterGaugeRegionLessGoodText):
531         * platform/LocalizedStrings.h:
532
533 2016-10-19  Dave Hyatt  <hyatt@apple.com>
534
535         [CSS Parser] Fix named color parsing
536         https://bugs.webkit.org/show_bug.cgi?id=163662
537
538         Reviewed by Zalan Bujtas.
539
540         Named color parsing in the old parser for extended colors relied on constructing a Color with the
541         name and doing a lookup that way.
542
543         The new parser allows the back end to hold a primitive identifier value for extended colors.
544
545         StyleColor contains a helper function for looking up the correct color.
546
547         This patch switches both the old and the new parsers over to the new StyleColor function.
548
549         Also remove some asserts from the CSSSelectorList, since the new parser allows it to be empty and
550         detects parsing failure that way.
551
552         * css/CSSSelectorList.cpp:
553         (WebCore::CSSSelectorList::CSSSelectorList):
554         (WebCore::CSSSelectorList::operator=):
555         * css/StyleColor.cpp:
556         (WebCore::StyleColor::isColorKeyword):
557         * css/StyleResolver.cpp:
558         (WebCore::StyleResolver::colorFromPrimitiveValue):
559         (WebCore::colorForCSSValue): Deleted.
560
561 2016-10-19  Youenn Fablet  <youenn@apple.com>
562
563         Remove SecurityOrigin::taintsCanvas
564         https://bugs.webkit.org/show_bug.cgi?id=163594
565
566         Reviewed by Darin Adler.
567
568         No change of behavior.
569
570         * html/canvas/CanvasRenderingContext.cpp:
571         (WebCore::CanvasRenderingContext::wouldTaintOrigin):
572         * page/SecurityOrigin.cpp:
573         (WebCore::SecurityOrigin::canReceiveDragData):
574         (WebCore::SecurityOrigin::taintsCanvas): Deleted.
575         * page/SecurityOrigin.h:
576
577 2016-10-18  Dave Hyatt  <hyatt@apple.com>
578
579         [CSS Parser] Fix compound selector parsing.
580         https://bugs.webkit.org/show_bug.cgi?id=163649
581
582         Reviewed by Darin Adler.
583
584         The new CSS parser is failing to handle compound selectors. The code has an assumption that the
585         first value in the RelationType enum is SubSelector. This patch changes the enum to have the same
586         name used in Blink, RelationType, and to make the ordering be exactly the same.
587
588         * css/CSSSelector.h:
589         (WebCore::CSSSelector::relation):
590         (WebCore::CSSSelector::setRelation):
591         * css/SelectorChecker.cpp:
592         (WebCore::SelectorChecker::matchRecursively):
593         (WebCore::canMatchHoverOrActiveInQuirksMode):
594         (WebCore::SelectorChecker::determineLinkMatchType):
595         * css/SelectorFilter.cpp:
596         (WebCore::SelectorFilter::collectIdentifierHashes):
597         * css/parser/CSSParserValues.cpp:
598         (WebCore::CSSParserSelector::insertTagHistory):
599         (WebCore::CSSParserSelector::appendTagHistory):
600         * css/parser/CSSParserValues.h:
601         (WebCore::CSSParserSelector::setRelation):
602         * css/parser/CSSSelectorParser.cpp:
603         (WebCore::CSSSelectorParser::consumeComplexSelector):
604         (WebCore::CSSSelectorParser::consumeCombinator):
605         * css/parser/CSSSelectorParser.h:
606         * cssjit/SelectorCompiler.cpp:
607         (WebCore::SelectorCompiler::fragmentRelationForSelectorRelation):
608         (WebCore::SelectorCompiler::constructFragmentsInternal):
609
610 2016-10-19  Javier Fernandez  <jfernandez@igalia.com>
611
612         Web Inspector: Debugger buttons positioned incorrectly, align-content default value is unexpected
613         https://bugs.webkit.org/show_bug.cgi?id=163572
614
615         Reviewed by Sergio Villar Senin.
616
617         We only allow the new CSS Box Alignment syntax when the Grid Layout
618         feature is enabled. Due to flexbox backward compatibility we have
619         implemented a different code path for the style initial/default values
620         assignment. However, we have incorrectly resolved both align-content
621         and justify-content to 'flex-start' when grid layout is disabled.
622
623         This patch changes the approach, so we set 'normal' (the value specified
624         by the new syntax) for both properties, but using the values defined in
625         the old syntax (Flexbox specification) at computed style resolution.
626
627         Since 'stretch' is the default value for the align-content property, this
628         issue implies that any flexbox line with an undefined height will be
629         laid out incorrectly, if not explicitly set via CSS, because flex items
630         can't use the available height, even though they use 'stretch' for their
631         'align-self' properties.
632
633         Test: css3/flexbox/flexbox-lines-must-be-stretched-by-default.html
634
635         * css/CSSComputedStyleDeclaration.cpp:
636         (WebCore::valueForContentPositionAndDistributionWithOverflowAlignment):
637         (WebCore::ComputedStyleExtractor::propertyValue):
638         * rendering/style/RenderStyle.h:
639         (WebCore::RenderStyle::initialContentAlignment):
640
641 2016-10-19  Carlos Alberto Lopez Perez  <clopez@igalia.com>
642
643         [GTK] REGRESSION(r207396) Build broken with Clang.
644         https://bugs.webkit.org/show_bug.cgi?id=163599
645
646         Suggested and reviewed by Darin Adler.
647
648         * css/CSSPrimitiveValue.cpp:
649         (WebCore::CSSPrimitiveValue::getStringValue):
650
651 2016-10-19  Darin Adler  <darin@apple.com>
652
653         Try to fix build.
654
655         * page/PerformanceUserTiming.cpp: Add back class name; needed by some compiler versions.
656
657 2016-10-19  Carlos Garcia Campos  <cgarcia@igalia.com>
658
659         Unreviewed. Fix the build after r207522.
660
661         * page/PerformanceUserTiming.cpp: Include PerformanceTiming.h.
662
663 2016-10-19  Carlos Garcia Campos  <cgarcia@igalia.com>
664
665         Unreviewed. Fix the build after r207519.
666
667         The build error is:
668         IDL ATTRIBUTE CHECKER ERROR: Unknown IDL attribute [PassContext] is found at TestRunner.idl.
669
670         Because PassContext was removed from IDLAttributes.txt in rr207519, but it's implemented by
671         CodeGeneratorTestRunner.pm and used by TestRunner.idl.
672
673         * bindings/scripts/IDLAttributes.txt: Bring back PassContext.
674
675 2016-10-19  Carlos Garcia Campos  <cgarcia@igalia.com>
676
677         Unreviewed. Fix the build with GCC 4.9 after r207463.
678
679         Add constructors to MediaConstraintsData.
680
681         * Modules/mediastream/MediaConstraintsImpl.h:
682         (WebCore::MediaConstraintsData::MediaConstraintsData):
683
684 2016-10-19  Jer Noble  <jer.noble@apple.com>
685
686         [Mac][MSE] Movies with a 'mehd' box have a zero-duration
687         https://bugs.webkit.org/show_bug.cgi?id=163641
688
689         Reviewed by Darin Adler.
690
691         Test: media/media-source/media-source-init-segment-duration.html
692
693         The canonical (ISO/IEC 14496-12:2012) way to signal the duration of a fragmented media file is to add a
694         'mehd' box to the 'mvex' container box specifying the duration of the fragment. Support this through the
695         AVAsset -overallDurationHint property.
696
697         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
698         (WebCore::SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset):
699         * platform/spi/mac/AVFoundationSPI.h:
700
701 2016-10-18  Darin Adler  <darin@apple.com>
702
703         Move many miscellaneous classes from ExceptionCode to Exception
704         https://bugs.webkit.org/show_bug.cgi?id=163645
705
706         Reviewed by Ryosuke Niwa.
707
708         * bindings/js/JSCryptoCustom.cpp:
709         (WebCore::JSCrypto::getRandomValues): Use propagateException.
710         * bindings/js/JSDOMWindowCustom.cpp:
711         (WebCore::handlePostMessage): Ditto.
712         (WebCore::JSDOMWindow::setTimeout): Use toJSNumber.
713         (WebCore::JSDOMWindow::setInterval): Ditto.
714         * bindings/js/JSStorageCustom.cpp:
715         (WebCore::JSStorage::nameGetter): Use propagateException.
716         (WebCore::JSStorage::deleteProperty): Ditto.
717         (WebCore::JSStorage::getOwnPropertyNames): Ditto.
718         (WebCore::JSStorage::putDelegate): Ditto.
719
720         * loader/appcache/DOMApplicationCache.cpp:
721         (WebCore::DOMApplicationCache::update): Use ExceptionOr.
722         (WebCore::DOMApplicationCache::swapCache): Ditto.
723         * loader/appcache/DOMApplicationCache.h: Update for above changes.
724         * loader/appcache/DOMApplicationCache.idl: Use non-legacy exceptions.
725
726         * page/Crypto.cpp:
727         (WebCore::Crypto::getRandomValues): Use ExceptionOr.
728         (WebCore::Crypto::webkitSubtle): Ditto.
729         * page/Crypto.h: Updated for above changes.
730         * page/Crypto.idl: Use non-legacy exceptions.
731
732         * page/DOMWindow.cpp:
733         (WebCore::DOMWindow::DOMWindow): Initialize many data members in
734         the class definition instead of here.
735         (WebCore::DOMWindow::page): Use nullptr.
736         (WebCore::DOMWindow::screen): Ditto.
737         (WebCore::DOMWindow::crypto): Ditto.
738         (WebCore::DOMWindow::locationbar): Ditto.
739         (WebCore::DOMWindow::menubar): Ditto.
740         (WebCore::DOMWindow::personalbar): Ditto.
741         (WebCore::DOMWindow::scrollbars): Ditto.
742         (WebCore::DOMWindow::statusbar): Ditto.
743         (WebCore::DOMWindow::toolbar): Ditto.
744         (WebCore::DOMWindow::applicationCache): Ditto.
745         (WebCore::DOMWindow::sessionStorage): Use ExceptionOr.
746         (WebCore::DOMWindow::localStorage): Ditto.
747         (WebCore::DOMWindow::postMessage): Ditto.
748         (WebCore::DOMWindow::frameElement): Use nullptr.
749         (WebCore::DOMWindow::self): Ditto.
750         (WebCore::DOMWindow::opener): Ditto.
751         (WebCore::DOMWindow::parent): Ditto.
752         (WebCore::DOMWindow::top): Ditto.
753         (WebCore::DOMWindow::getComputedStyle): Use Ref.
754         (WebCore::DOMWindow::setTimeout): Use ExceptionOr.
755         (WebCore::DOMWindow::setInterval): Ditto.
756         (WebCore::didAddStorageEventListener): Use a reference instead of a
757         pointer, and ignore return value instead of using IGNORE_EXCEPTION.
758         (WebCore::DOMWindow::addEventListener): Pass reference to function above.
759         (WebCore::DOMWindow::dispatchEvent): Use enum class version of PageStatus.
760         * page/DOMWindow.h: Updated for changes above. Also changed indentatation.
761         * page/DOMWindow.idl: Use non-legacy exceptions.
762
763         * page/EventSource.cpp:
764         (WebCore::EventSource::create): Use ExceptionOr.
765         * page/EventSource.h: Updated for change above.
766         * page/EventSource.idl: Use non-legacy exception.
767
768         * page/Location.cpp:
769         (WebCore::Location::setProtocol): Use ExceptionOr.
770         * page/Location.h: Updated for change above.
771         * page/Location.idl: Use non-legacy exception.
772
773         * page/Performance.cpp:
774         (WebCore::Performance::Performance): Remove unnecessary initialization of
775         smart pointer to null, and moved initialization of m_resourceTimingBufferSize
776         to the header.
777         (WebCore::Performance::navigation): Made non-const and return a reference.
778         (WebCore::Performance::timing): Ditto.
779         (WebCore::Performance::addResourceTiming): Change LoadTiming argument to use
780         a const& instead of passing in a copy.
781         (WebCore::Performance::webkitMark): Use ExceptionOr and make_unique.
782         (WebCore::Performance::webkitClearMarks): Ditto.
783         (WebCore::Performance::webkitMeasure): Ditto.
784         (WebCore::Performance::webkitClearMeasures): Ditto.
785         (WebCore::Performance::reduceTimeResolution): Use std::floor.
786         * page/Performance.h: Updated for above changes. Removed unneeded includes.
787         Made more things private. Removed unneeded reference counting of UserTiming.
788         * page/Performance.idl: Use non-legacy exceptions.
789
790         * page/PerformanceUserTiming.cpp:
791         (WebCore::restrictedMarkFunction): Removed unneeded class name.
792         (WebCore::UserTiming::UserTiming): Take a reference instead of a pointer.
793         (WebCore::UserTiming::mark): Use ExceptionOr.
794         (WebCore::UserTiming::findExistingMarkStartTime): Ditto.
795         (WebCore::UserTiming::measure): Ditto.
796         (WebCore::getEntrySequenceByName): Simplified code using HashMap::get.
797         * page/PerformanceUserTiming.h: Updated for above changes. Removed reference
798         counting since this is a single-owner object.
799
800         * page/UserMessageHandler.cpp:
801         (WebCore::UserMessageHandler::postMessage): Use ExceptionOr.
802         * page/UserMessageHandler.h: Updated for above change.
803         * page/UserMessageHandler.idl: Use non-legacy exception.
804
805         * storage/Storage.cpp:
806         (WebCore::Storage::length): Use ExceptionOr.
807         (WebCore::Storage::key): Ditto.
808         (WebCore::Storage::getItem): Ditto.
809         (WebCore::Storage::setItem): Ditto.
810         (WebCore::Storage::removeItem): Ditto.
811         (WebCore::Storage::clear): Ditto.
812         (WebCore::Storage::contains): Ditto.
813         * storage/Storage.h: Updated for above change.
814         * storage/Storage.idl: Use non-legacy exceptions.
815
816         * storage/StorageEventDispatcher.cpp:
817         (WebCore::StorageEventDispatcher::dispatchSessionStorageEventsToFrames):
818         Updated for ExceptionOr.
819         (WebCore::StorageEventDispatcher::dispatchLocalStorageEventsToFrames): Ditto.
820
821 2016-10-18  Darin Adler  <darin@apple.com>
822
823         Move internal testing classes from ExceptionCode to Exception
824         https://bugs.webkit.org/show_bug.cgi?id=163553
825
826         Reviewed by Ryosuke Niwa.
827
828         * bindings/js/JSDOMBinding.h: Added toJSArray. Also exported a function that
829         is now needed in the testing library.
830         * bindings/scripts/CodeGeneratorJS.pm:
831         (NativeToJSValue): Added code to handle the jsArray case with an exception.
832
833         * css/parser/CSSPropertyParser.cpp: Fix #if to make code compile when
834         CSS_SCROLL_SNAP is not enabled.
835
836         * dom/Element.cpp:
837         (WebCore::Element::createShadowRoot): Changed return type to a raw pointer.
838         There is no reason it needs to be a RefPtr.
839         * dom/Element.h: Updated for above change.
840
841         * svg/SVGPathStringBuilder.h: Exported class and made more public so it can
842         be used in test code.
843
844         * svg/SVGPathUtilities.cpp:
845         (WebCore::pathIteratorForBuildingString): Deleted. Needed only for test code,
846         so moved into there.
847         (WebCore::buildStringFromPath): Deleted. Ditto.
848         * svg/SVGPathUtilities.h: Removed buildStringFromPath.
849
850         * testing/InternalSettings.cpp: Simplified the guard macro and used the all
851         capitals style that our style guide prescribes for non-function-like macros.
852         (WebCore::InternalSettings::create): Moved here, no longer inline Use m_page.
853         (WebCore::InternalSettings::resetToConsistentState): Updated since settings
854         returns a reference.
855         (WebCore::InternalSettings::settings): Changed to return a reference and
856         assert that m_page is not null; functions all check m_page for null first.
857         (WebCore::InternalSettings::setTouchEventEmulationEnabled): Updated to use
858         ExceptionOr, do an m_page check, and use settings that returns a reference.
859         (WebCore::InternalSettings::setStandardFontFamily): Ditto.
860         (WebCore::InternalSettings::setSerifFontFamily): Ditto.
861         (WebCore::InternalSettings::setSansSerifFontFamily): Ditto.
862         (WebCore::InternalSettings::setFixedFontFamily): Ditto.
863         (WebCore::InternalSettings::setCursiveFontFamily): Ditto.
864         (WebCore::InternalSettings::setFantasyFontFamily): Ditto.
865         (WebCore::InternalSettings::setPictographFontFamily): Ditto.
866         (WebCore::InternalSettings::setTextAutosizingEnabled): Ditto.
867         (WebCore::InternalSettings::setTextAutosizingWindowSizeOverride): Ditto.
868         (WebCore::InternalSettings::setMediaTypeOverride): Ditto.
869         (WebCore::InternalSettings::setCanStartMedia): Ditto.
870         (WebCore::InternalSettings::setAllowsAirPlayForMediaPlayback): Ditto.
871         (WebCore::InternalSettings::setEditingBehavior): Ditto.
872         (WebCore::InternalSettings::setShouldDisplayTrackKind): Ditto.
873         (WebCore::InternalSettings::shouldDisplayTrackKind): Ditto.
874         (WebCore::InternalSettings::setStorageBlockingPolicy): Ditto.
875         (WebCore::InternalSettings::setPreferMIMETypeForImages): Ditto.
876         (WebCore::InternalSettings::setImagesEnabled): Ditto.
877         (WebCore::InternalSettings::setPDFImageCachingPolicy): Ditto.
878         (WebCore::InternalSettings::setMinimumTimerInterval): Ditto.
879         (WebCore::InternalSettings::setDefaultVideoPosterURL): Ditto.
880         (WebCore::InternalSettings::setForcePendingWebGLPolicy): Ditto.
881         (WebCore::InternalSettings::setTimeWithoutMouseMovementBeforeHidingControls): Ditto.
882         (WebCore::InternalSettings::setUseLegacyBackgroundSizeShorthandBehavior): Ditto.
883         (WebCore::InternalSettings::setAutoscrollForDragAndDropEnabled): Ditto.
884         (WebCore::InternalSettings::setFontFallbackPrefersPictographs): Ditto.
885         (WebCore::InternalSettings::setWebFontsAlwaysFallBack): Ditto.
886         (WebCore::InternalSettings::setQuickTimePluginReplacementEnabled): Ditto.
887         (WebCore::InternalSettings::setYouTubeFlashPluginReplacementEnabled): Ditto.
888         (WebCore::InternalSettings::setBackgroundShouldExtendBeyondPage): Ditto.
889         (WebCore::InternalSettings::setShouldConvertPositionStyleOnCopy): Ditto.
890         (WebCore::InternalSettings::setScrollingTreeIncludesFrames): Ditto.
891         (WebCore::InternalSettings::setAllowsInlineMediaPlayback): Ditto.
892         (WebCore::InternalSettings::setAllowsInlineMediaPlaybackAfterFullscreen): Ditto.
893         (WebCore::InternalSettings::setInlineMediaPlaybackRequiresPlaysInlineAttribute): Ditto.
894         (WebCore::InternalSettings::setIndexedDBWorkersEnabled): Ditto.
895         (WebCore::InternalSettings::userInterfaceDirectionPolicy): Ditto.
896         (WebCore::InternalSettings::setUserInterfaceDirectionPolicy): Ditto.
897         (WebCore::InternalSettings::systemLayoutDirection): Ditto.
898         (WebCore::InternalSettings::setSystemLayoutDirection): Ditto.
899         (WebCore::InternalSettings::variationFontsEnabled): Ditto.
900         (WebCore::InternalSettings::setVariationFontsEnabled): Ditto.
901         (WebCore::InternalSettings::forcedPrefersReducedMotionValue): Ditto.
902         (WebCore::InternalSettings::setForcedPrefersReducedMotionValue): Ditto.
903         * testing/InternalSettings.h: Updated for above changes. Also moved Backup to make
904         it private instead of public.
905         * testing/InternalSettings.idl: Use non-legacy execption. Also removed unneeded
906         exception for setIndexedDBWorkersEnabled.
907
908         * testing/Internals.cpp: Marked InspectorStubFrontend final and made everything private.
909         (WebCore::Internals::setCanShowModalDialogOverride): Use ExceptionOr.
910         (WebCore::Internals::lastSpatialNavigationCandidateCount): Ditto.
911         (WebCore::Internals::animationsAreSuspended): Ditto.
912         (WebCore::Internals::suspendAnimations): Ditto.
913         (WebCore::Internals::resumeAnimations): Ditto.
914         (WebCore::Internals::pauseAnimationAtTimeOnElement): Ditto.
915         (WebCore::Internals::pauseAnimationAtTimeOnPseudoElement): Ditto.
916         (WebCore::Internals::pauseTransitionAtTimeOnElement): Ditto.
917         (WebCore::Internals::pauseTransitionAtTimeOnPseudoElement): Ditto.
918         (WebCore::Internals::elementRenderTreeAsText): Ditto.
919         (WebCore::Internals::ensureShadowRoot): Ditto.
920         (WebCore::Internals::createShadowRoot): Ditto.
921         (WebCore::Internals::shadowRootType): Ditto.
922         (WebCore::Internals::isTimerThrottled): Ditto.
923         (WebCore::Internals::formControlStateOfPreviousHistoryItem): Ditto.
924         (WebCore::Internals::setFormControlStateOfPreviousHistoryItem): Ditto.
925         (WebCore::Internals::absoluteCaretBounds): Ditto.
926         (WebCore::Internals::inspectorHighlightRects): Ditto.
927         (WebCore::Internals::inspectorHighlightObject): Ditto.
928         (WebCore::Internals::markerCountForNode): Ditto.
929         (WebCore::Internals::markerAt): Ditto.
930         (WebCore::Internals::markerRangeForNode): Ditto.
931         (WebCore::Internals::markerDescriptionForNode): Ditto.
932         (WebCore::Internals::dumpMarkerRects): Ditto.
933         (WebCore::Internals::setMarkedTextMatchesAreHighlighted): Ditto.
934         (WebCore::Internals::setScrollViewPosition): Ditto.
935         (WebCore::Internals::setViewBaseBackgroundColor): Ditto.
936         (WebCore::Internals::setPagination): Ditto.
937         (WebCore::Internals::setPaginationLineGridEnabled): Ditto.
938         (WebCore::Internals::configurationForViewport): Ditto.
939         (WebCore::Internals::wasLastChangeUserEdit): Ditto.
940         (WebCore::Internals::scrollElementToRect): Ditto.
941         (WebCore::Internals::autofillFieldName): Ditto.
942         (WebCore::Internals::paintControlTints): Ditto.
943         (WebCore::Internals::rangeForDictionaryLookupAtLocation): Ditto.
944         (WebCore::Internals::setDelegatesScrolling): Ditto.
945         (WebCore::Internals::lastSpellCheckRequestSequence): Ditto.
946         (WebCore::Internals::lastSpellCheckProcessedSequence): Ditto.
947         (WebCore::Internals::wheelEventHandlerCount): Ditto.
948         (WebCore::Internals::touchEventHandlerCount): Ditto.
949         (WebCore::Internals::nodesFromRect): Ditto.
950         (WebCore::Internals::setBatteryStatus): Ditto.
951         (WebCore::Internals::setDeviceProximity): Ditto.
952         (WebCore::Internals::hasSpellingMarker): Ditto.
953         (WebCore::Internals::hasAutocorrectedMarker): Ditto.
954         (WebCore::Internals::handleAcceptedCandidate): Ditto.
955         (WebCore::Internals::isOverwriteModeEnabled): Ditto.
956         (WebCore::Internals::toggleOverwriteModeEnabled): Ditto.
957         (WebCore::Internals::countMatchesForText): Ditto.
958         (WebCore::Internals::countFindMatches): Ditto.
959         (WebCore::Internals::setInspectorIsUnderTest): Ditto.
960         (WebCore::Internals::hasGrammarMarker): Ditto.
961         (WebCore::Internals::numberOfScrollableAreas): Ditto.
962         (WebCore::Internals::isPageBoxVisible): Ditto.
963         (WebCore::Internals::layerTreeAsText): Ditto.
964         (WebCore::Internals::repaintRectsAsText): Ditto.
965         (WebCore::Internals::scrollingStateTreeAsText): Ditto.
966         (WebCore::Internals::mainThreadScrollingReasons): Ditto.
967         (WebCore::Internals::nonFastScrollableRects): Ditto.
968         (WebCore::Internals::setElementUsesDisplayListDrawing): Ditto.
969         (WebCore::Internals::setElementTracksDisplayListReplay): Ditto.
970         (WebCore::Internals::displayListForElement): Ditto.
971         (WebCore::Internals::replayDisplayListForElement): Ditto.
972         (WebCore::Internals::garbageCollectDocumentResources): Ditto.
973         (WebCore::Internals::insertAuthorCSS): Ditto.
974         (WebCore::Internals::insertUserCSS): Ditto.
975         (WebCore::Internals::pageProperty): Ditto.
976         (WebCore::Internals::pageSizeAndMarginsInPixels): Ditto.
977         (WebCore::Internals::setPageScaleFactor): Ditto.
978         (WebCore::Internals::setPageZoomFactor): Ditto.
979         (WebCore::Internals::setTextZoomFactor): Ditto.
980         (WebCore::Internals::setUseFixedLayout): Ditto.
981         (WebCore::Internals::setFixedLayoutSize): Ditto.
982         (WebCore::Internals::setViewExposedRect): Ditto.
983         (WebCore::Internals::setHeaderHeight): Ditto.
984         (WebCore::Internals::setFooterHeight): Ditto.
985         (WebCore::Internals::setTopContentInset): Ditto.
986         (WebCore::Internals::setApplicationCacheOriginQuota): Ditto.
987         (WebCore::Internals::startTrackingRepaints): Ditto.
988         (WebCore::Internals::stopTrackingRepaints): Ditto.
989         (WebCore::Internals::startTrackingLayerFlushes): Ditto.
990         (WebCore::Internals::layerFlushCount): Ditto.
991         (WebCore::Internals::startTrackingStyleRecalcs): Ditto.
992         (WebCore::Internals::styleRecalcCount): Ditto.
993         (WebCore::Internals::startTrackingCompositingUpdates): Ditto.
994         (WebCore::Internals::compositingUpdateCount): Ditto.
995         (WebCore::Internals::updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks): Ditto.
996         (WebCore::Internals::getCurrentCursorInfo): Ditto.
997         (WebCore::Internals::mediaElementHasCharacteristic): Ditto.
998         (WebCore::Internals::captionsStyleSheetOverride): Ditto.
999         (WebCore::Internals::setCaptionsStyleSheetOverride): Ditto.
1000         (WebCore::Internals::setPrimaryAudioTrackLanguageOverride): Ditto.
1001         (WebCore::Internals::setCaptionDisplayMode): Ditto.
1002         (WebCore::Internals::selectionBounds): Ditto.
1003         (WebCore::Internals::isVibrating): Ditto.
1004         (WebCore::Internals::isPluginUnavailabilityIndicatorObscured): Ditto.
1005         (WebCore::Internals::beginMediaSessionInterruption): Ditto.
1006         (WebCore::Internals::setMediaSessionRestrictions): Ditto.
1007         (WebCore::Internals::postRemoteControlCommand): Ditto.
1008         (WebCore::Internals::setMockMediaPlaybackTargetPickerState): Ditto.
1009         (WebCore::Internals::installMockPageOverlay): Ditto.
1010         (WebCore::Internals::pageOverlayLayerTreeAsText): Ditto.
1011         (WebCore::Internals::scrollSnapOffsets): Ditto.
1012         (WebCore::Internals::pathStringWithShrinkWrappedRects): Moved the code that builds
1013         the path string in here for now since it's only used for this testing.
1014         (WebCore::Internals::resourceLoadStatisticsForOrigin): Take a const String&.
1015
1016         * testing/Internals.h: Updated for above changes.
1017         * testing/Internals.idl: Use non-legacy exceptions.
1018
1019 2016-10-18  Chris Dumez  <cdumez@apple.com>
1020
1021         [Web IDL] Drop webkit-specific extended attributes that are no longer useful
1022         https://bugs.webkit.org/show_bug.cgi?id=163643
1023
1024         Reviewed by Ryosuke Niwa.
1025
1026         Drop webkit-specific IDL extended attributes that are no longer useful:
1027         - [CustomReturn]: I believe this used to be for ObjC bindings. It has
1028           no impact in JS bindings.
1029         - [Deletable]: It only had an impact on static attributes and was only
1030           used on HTMLAllCollection.all, which is not static. I updated the
1031           bindings generator to so that static attributes are now configurable
1032           by default (unless marked as [Unforgeable], as per Web IDL [1]. This
1033           causes Notification.permission (This only static attribute we have)
1034           to become deletable. This behavior is consistent with the specification
1035           and with Chrome. I added test coverage for this.
1036         - [ImplementationNamespace]: Implemented but unused.
1037         - [PassContext]: Not implemented and unused.
1038         - [TypedArray=*]: Not implemented and unused.
1039
1040         [1] https://heycam.github.io/webidl/#es-attributes
1041
1042         Test: fast/notifications/notification-permisssion-deletable.html
1043
1044         * bindings/scripts/CodeGeneratorJS.pm:
1045         (GetNamespaceForInterface):
1046         (GenerateImplementation):
1047         * bindings/scripts/IDLAttributes.txt:
1048         * bindings/scripts/test/JS/JSTestInterface.cpp:
1049         * bindings/scripts/test/JS/JSTestObj.cpp:
1050         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
1051         * dom/Node.idl:
1052         * html/HTMLDocument.idl:
1053
1054 2016-10-18  Sam Weinig  <sam@webkit.org>
1055
1056         Replace std::experimental::variant with WTF::Variant (or similar)
1057         https://bugs.webkit.org/show_bug.cgi?id=163626
1058
1059         Reviewed by Chris Dumez.
1060
1061         Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc.
1062         into the WTF namespace.
1063
1064         * Modules/fetch/FetchBody.h:
1065         (WebCore::FetchBody::isBlob):
1066         (WebCore::FetchBody::isFormData):
1067         (WebCore::FetchBody::isArrayBuffer):
1068         (WebCore::FetchBody::isArrayBufferView):
1069         (WebCore::FetchBody::isURLSearchParams):
1070         (WebCore::FetchBody::isText):
1071         (WebCore::FetchBody::blobBody):
1072         (WebCore::FetchBody::formDataBody):
1073         (WebCore::FetchBody::arrayBufferBody):
1074         (WebCore::FetchBody::arrayBufferViewBody):
1075         (WebCore::FetchBody::textBody):
1076         (WebCore::FetchBody::urlSearchParamsBody):
1077         * bindings/generic/IDLTypes.h:
1078         * dom/ExceptionOr.h:
1079         (WebCore::ExceptionOr<ReturnType>::hasException):
1080         (WebCore::ExceptionOr<ReturnType>::releaseException):
1081         (WebCore::ExceptionOr<ReturnType>::releaseReturnValue):
1082         * dom/MessageEvent.cpp:
1083         (WebCore::MessageEvent::source):
1084         * dom/MessageEvent.h:
1085         * dom/Node.cpp:
1086         (WebCore::nodeSetPreTransformedFromNodeOrStringVector):
1087         (WebCore::Node::convertNodesOrStringsIntoNode):
1088         * dom/Node.h:
1089         * html/HTMLOptionsCollection.h:
1090         * html/HTMLSelectElement.cpp:
1091         (WebCore::HTMLSelectElement::add):
1092         * html/HTMLSelectElement.h:
1093         * html/track/TrackEvent.cpp:
1094         (WebCore::TrackEvent::TrackEvent):
1095         * html/track/TrackEvent.h:
1096
1097 2016-10-18  Chris Dumez  <cdumez@apple.com>
1098
1099         Unreviewed, rebaseline bindings tests after Sam's r207505.
1100
1101         * bindings/scripts/test/JS/JSTestCallback.cpp:
1102         (WebCore::JSTestCallback::callbackWithSerializedScriptValueParam):
1103         * bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
1104         (WebCore::JSTestCallbackFunction::callbackWithSerializedScriptValueParam):
1105         * bindings/scripts/test/JS/JSTestObj.cpp:
1106         (WebCore::jsTestObjPrototypeFunctionSerializedValueCaller):
1107         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
1108         (WebCore::jsTestSerializedScriptValueInterfaceValueGetter):
1109         (WebCore::jsTestSerializedScriptValueInterfaceReadonlyValueGetter):
1110         (WebCore::jsTestSerializedScriptValueInterfaceCachedValueGetter):
1111         (WebCore::jsTestSerializedScriptValueInterfaceCachedReadonlyValueGetter):
1112         (WebCore::setJSTestSerializedScriptValueInterfaceValueFunction):
1113         (WebCore::setJSTestSerializedScriptValueInterfaceCachedValueFunction):
1114         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
1115         (WebCore::jsTestTypedefsImmutableSerializedScriptValueGetter):
1116         (WebCore::setJSTestTypedefsImmutableSerializedScriptValueFunction):
1117
1118 2016-10-18  Chris Dumez  <cdumez@apple.com>
1119
1120         [Web IDL] Kill support for [LegacyConstructorTemplate=Event] / [LegacyInitializedByEventConstructor]
1121         https://bugs.webkit.org/show_bug.cgi?id=163630
1122
1123         Reviewed by Darin Adler.
1124
1125         Kill support for [LegacyConstructorTemplate=Event] / [LegacyInitializedByEventConstructor] in our
1126         IDL now that all our events use proper constructors instead.
1127
1128         * bindings/scripts/CodeGenerator.pm:
1129         * bindings/scripts/CodeGeneratorJS.pm:
1130         (GenerateHeader):
1131         (GenerateConstructorDefinition):
1132         (GenerateConstructorHelperMethods):
1133         (IsConstructable):
1134         * bindings/scripts/IDLAttributes.txt:
1135         * dom/Event.h:
1136         (WebCore::Event::create):
1137         * dom/Event.idl:
1138         * dom/UIEvent.h:
1139         (WebCore::UIEvent::create):
1140         * dom/UIEvent.idl:
1141
1142 2016-10-18  Chris Dumez  <cdumez@apple.com>
1143
1144         Changing details.open should cause a toggle event to be fired asynchronously
1145         https://bugs.webkit.org/show_bug.cgi?id=163568
1146
1147         Reviewed by Darin Adler.
1148
1149         Changing details.open should cause a toggle event to be fired asynchronously:
1150         - https://html.spec.whatwg.org/#details-notification-task-steps
1151
1152         Firefox and Chrome implement this, we don't.
1153
1154         Test: imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-details-element/toggleEvent.html
1155
1156         * dom/EventNames.h:
1157         * dom/GlobalEventHandlers.idl:
1158         * html/HTMLAttributeNames.in:
1159         * html/HTMLDetailsElement.cpp:
1160         (WebCore::detailToggleEventSender):
1161         (WebCore::HTMLDetailsElement::~HTMLDetailsElement):
1162         (WebCore::HTMLDetailsElement::dispatchPendingEvent):
1163         (WebCore::HTMLDetailsElement::parseAttribute):
1164         * html/HTMLDetailsElement.h:
1165         * html/HTMLElement.cpp:
1166         (WebCore::HTMLElement::createEventHandlerNameMap):
1167
1168 2016-10-18  Dave Hyatt  <hyatt@apple.com>
1169
1170         [CSS Parser] Enable basic parser testing.
1171         https://bugs.webkit.org/show_bug.cgi?id=163639
1172
1173         Reviewed by Dean Jackson.
1174
1175         * css/SelectorChecker.cpp:
1176         (WebCore::SelectorChecker::matchRecursively):
1177         Remove the ASSERT_NOT_REACHED on the new shadow selectors. We need to implement this
1178         eventually, but it's better to not assert on that for now.
1179
1180         * css/parser/CSSParserValues.cpp:
1181         (WebCore::CSSParserSelector::isHostPseudoSelector):
1182         Make sure to check that we're a pseudoclass selector first, since otherwise we'll assert.
1183
1184         * css/parser/CSSParserValues.h:
1185         (WebCore::CSSParserSelector::needsImplicitShadowCombinatorForMatching):
1186         Make sure to check that we're a pseudoelement selector first, since otherwise we'll assert.
1187
1188         * css/parser/CSSPropertyParser.cpp:
1189         (WebCore::CSSPropertyParser::addExpandedPropertyForValue):
1190         copyRef is needed here, since a singleton value is being propagated to all the expanded shorthand properties.
1191
1192         (WebCore::parseSingleShadow):
1193         (WebCore::CSSPropertyParser::consumeFont):
1194         Remove the font properties that aren't part of our shorthand. We will need to revisit this eventually as it seems
1195         some of the font properties should be reset as part of this shorthand but aren't.
1196 '
1197         * css/parser/CSSPropertyParserHelpers.cpp:
1198         (WebCore::CSSPropertyParserHelpers::consumeInteger):
1199         Just return a number for now instead of the parser_integer type.
1200
1201         * css/parser/CSSSelectorParser.cpp:
1202         (WebCore::CSSSelectorParser::consumePseudo):
1203         Clean this up so that it doesn't assert by making sure to add qualifying checks for the appropriate match type.
1204
1205 2016-10-18  Ryosuke Niwa  <rniwa@webkit.org>
1206
1207         Update the comment for HTML Imports as there is now a proposal to use ES6 Modules for this.
1208         Also replace the contact by me since I'm most familiar with this feature.
1209
1210         * features.json:
1211
1212 2016-10-18  Ryosuke Niwa  <rniwa@webkit.org>
1213
1214         Update the status of shadow DOM API to "Done" with a comment saying we're still fixing bugs.
1215
1216         Also update my contact information since I'm no longer on Twitter.
1217
1218         * features.json:
1219
1220 2016-10-18  Chris Dumez  <cdumez@apple.com>
1221
1222         Provide better form validation messages
1223         https://bugs.webkit.org/show_bug.cgi?id=163584
1224
1225         Reviewed by Darin Adler.
1226
1227         Provide better form validation messages that match more closely the ones
1228         from Chrome and Firefox.
1229
1230         No new tests, updated existing tests.
1231
1232         * English.lproj/Localizable.strings:
1233         * platform/LocalizedStrings.cpp:
1234         (WebCore::validationMessageValueMissingText):
1235         (WebCore::validationMessageValueMissingForCheckboxText):
1236         (WebCore::validationMessageValueMissingForFileText):
1237         (WebCore::validationMessageValueMissingForMultipleFileText):
1238         (WebCore::validationMessageValueMissingForRadioText):
1239         (WebCore::validationMessageValueMissingForSelectText):
1240         (WebCore::validationMessageTypeMismatchText):
1241         (WebCore::validationMessageTypeMismatchForEmailText):
1242         (WebCore::validationMessageTypeMismatchForMultipleEmailText):
1243         (WebCore::validationMessageTypeMismatchForURLText):
1244         (WebCore::validationMessagePatternMismatchText):
1245         (WebCore::validationMessageTooShortText):
1246         (WebCore::validationMessageTooLongText):
1247         (WebCore::validationMessageRangeUnderflowText):
1248         (WebCore::validationMessageRangeOverflowText):
1249         (WebCore::validationMessageStepMismatchText):
1250         (WebCore::validationMessageBadInputForNumberText):
1251
1252 2016-10-18  Dave Hyatt  <hyatt@apple.com>
1253
1254         Fix GTK build.
1255
1256         * css/parser/CSSPropertyParser.cpp:
1257         (WebCore::CSSPropertyParser::parseSingleValue):
1258
1259 2016-10-18  Sam Weinig  <sam@webkit.org>
1260
1261         Simplify SerializedScriptValue, MessagePortArray and ArrayBufferArray to ease generation
1262         https://bugs.webkit.org/show_bug.cgi?id=163625
1263
1264         Reviewed by Chris Dumez.
1265
1266         - Replace uses of MessagePortArray (a.k.a. Vector<RefPtr<MessagePort>, 1>) with Vector<RefPtr<MessagePort>>.
1267         - Replace uses of ArrayBufferArray (a.k.a. Vector<RefPtr<ArrayBuffer>, 1>) with Vector<RefPtr<ArrayBuffer>>.
1268         - Add convenience functions to SerializedScriptValue to allow calling with fewer parameters.
1269         - Move MessagePorts and ArrayBuffers more where possible.
1270
1271         * Modules/indexeddb/IDBObjectStore.cpp:
1272         (WebCore::IDBObjectStore::putOrAdd):
1273         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1274         (WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd):
1275         * bindings/js/IDBBindingUtilities.cpp:
1276         (WebCore::deserializeIDBValueToJSValue):
1277         * bindings/js/JSCustomEventCustom.cpp:
1278         (WebCore::JSCustomEvent::detail):
1279         * bindings/js/JSHistoryCustom.cpp:
1280         (WebCore::JSHistory::state):
1281         (WebCore::JSHistory::pushState):
1282         (WebCore::JSHistory::replaceState):
1283         * bindings/js/JSPopStateEventCustom.cpp:
1284         (WebCore::JSPopStateEvent::state):
1285         * dom/CustomEvent.cpp:
1286         (WebCore::CustomEvent::trySerializeDetail):
1287         * dom/ErrorEvent.cpp:
1288         (WebCore::ErrorEvent::sanitizedErrorValue):
1289         (WebCore::ErrorEvent::trySerializeError):
1290         * dom/PopStateEvent.cpp:
1291         (WebCore::PopStateEvent::trySerializeState):
1292         * page/DOMWindow.cpp:
1293         (WebCore::DOMWindow::postMessage):
1294         * page/DOMWindow.h:
1295         * workers/DedicatedWorkerGlobalScope.cpp:
1296         (WebCore::DedicatedWorkerGlobalScope::postMessage):
1297         * workers/DedicatedWorkerGlobalScope.h:
1298         * workers/Worker.cpp:
1299         (WebCore::Worker::postMessage):
1300         * workers/Worker.h:
1301         * bindings/js/JSDOMWindowCustom.cpp:
1302         (WebCore::handlePostMessage):
1303         * bindings/js/JSDictionary.cpp:
1304         (WebCore::JSDictionary::convertValue):
1305         * bindings/js/JSDictionary.h:
1306         Updated for new SerializedScriptValue interface/vector naming.
1307
1308         * bindings/js/JSMessageEventCustom.cpp:
1309         (WebCore::handleInitMessageEvent):
1310         Update handleInitMessageEvent to check for exceptions and use convert for the MessagePort sequence.
1311
1312         * bindings/js/JSMessagePortCustom.cpp:
1313         (WebCore::extractTransferables):
1314         (WebCore::fillMessagePortArray): Deleted.
1315         * bindings/js/JSMessagePortCustom.h:
1316         (WebCore::handlePostMessage):
1317         Rename fillMessagePortArray to extractTransferables to better express what it does.
1318
1319         * bindings/js/SerializedScriptValue.cpp:
1320         (WebCore::CloneSerializer::serialize):
1321         (WebCore::CloneSerializer::CloneSerializer):
1322         (WebCore::CloneSerializer::fillTransferMap):
1323         (WebCore::CloneSerializer::dumpIfTerminal):
1324         (WebCore::CloneDeserializer::deserialize):
1325         (WebCore::CloneDeserializer::CloneDeserializer):
1326         (WebCore::CloneDeserializer::readTerminal):
1327         (WebCore::SerializedScriptValue::transferArrayBuffers):
1328         (WebCore::SerializedScriptValue::create):
1329         (WebCore::SerializedScriptValue::deserialize):
1330         * bindings/js/SerializedScriptValue.h:
1331         Simplify interface to allow more callers to avoid passing default arguments. Use ExecState& more.
1332         * bindings/scripts/CodeGeneratorJS.pm:
1333         (GetNativeVectorType):
1334         Remove special case for MessagePort.
1335         (JSValueToNative):
1336         (NativeToJSValue):
1337         Updated for new SerializedScriptValue interface.
1338
1339         * dom/MessageEvent.cpp:
1340         (WebCore::MessageEvent::MessageEvent):
1341         (WebCore::MessageEvent::create):
1342         (WebCore::MessageEvent::initMessageEvent):
1343         (WebCore::MessageEvent::trySerializeData):
1344         * dom/MessageEvent.h:
1345         Store the MessagePort sequence as a Vector<RefPtr<MessagePort>> rather than in a unique_ptr.
1346
1347         * dom/MessageEvent.idl:
1348         Update last type in init functions to be sequence<MessagePort> rather than Array. They are still
1349         custom, as we don't quite generate these correctly yet. 
1350
1351         * dom/MessagePort.cpp:
1352         (WebCore::MessagePort::postMessage):
1353         (WebCore::MessagePort::dispatchMessages):
1354         (WebCore::MessagePort::disentanglePorts):
1355         (WebCore::MessagePort::entanglePorts):
1356         * dom/MessagePort.h:
1357         Update interface to take MessagePort vectors by rvalue reference.
1358
1359 2016-10-18  Chris Dumez  <cdumez@apple.com>
1360
1361         [iOS] Drop JSDictionary::convertValue() overload taking a TouchList
1362         https://bugs.webkit.org/show_bug.cgi?id=163620
1363
1364         Reviewed by Sam Weinig.
1365
1366         Drop JSDictionary::convertValue() overload taking a TouchList now that
1367         TouchEvent is using a proper constructor with a TouchEventInit
1368         dictionary on iOS.
1369
1370         * bindings/js/JSDictionary.cpp:
1371
1372 2016-10-18  Dean Jackson  <dino@apple.com>
1373
1374         Remove CSS_SHAPES feature definition. This should always be on.
1375         https://bugs.webkit.org/show_bug.cgi?id=163628
1376         <rdar://problem/28834613>
1377
1378         Reviewed by Tim Horton.
1379
1380         CSS Shapes is in Candidate Recommendation. It's a core part
1381         of CSS. It should always be enabled.
1382
1383         * Configurations/FeatureDefines.xcconfig:
1384         * css/CSSComputedStyleDeclaration.cpp:
1385         (WebCore::shapePropertyValue):
1386         (WebCore::ComputedStyleExtractor::propertyValue):
1387         * css/CSSPropertyNames.in:
1388         * css/CSSValueKeywords.in:
1389         * css/StyleBuilderConverter.h:
1390         (WebCore::StyleBuilderConverter::convertShapeValue):
1391         * css/parser/CSSParser.cpp:
1392         (WebCore::isSimpleLengthPropertyID):
1393         (WebCore::CSSParser::parseValue):
1394         (WebCore::CSSParser::parseShapeProperty):
1395         * css/parser/CSSParser.h:
1396         * inspector/InspectorOverlay.cpp:
1397         (WebCore::buildObjectForShapeOutside):
1398         (WebCore::buildObjectForElementData):
1399         * page/animation/CSSPropertyAnimation.cpp:
1400         (WebCore::blendFunc):
1401         (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
1402         * rendering/FloatingObjects.cpp:
1403         (WebCore::FindNextFloatLogicalBottomAdapter::collectIfNeeded):
1404         (WebCore::ComputeFloatOffsetForLineLayoutAdapter<FloatingObject::FloatLeft>::updateOffsetIfNeeded):
1405         (WebCore::ComputeFloatOffsetForLineLayoutAdapter<FloatingObject::FloatRight>::updateOffsetIfNeeded):
1406         * rendering/RenderBlock.cpp:
1407         * rendering/RenderBlockFlow.cpp:
1408         (WebCore::RenderBlockFlow::positionNewFloats):
1409         * rendering/RenderBox.cpp:
1410         (WebCore::RenderBox::~RenderBox):
1411         (WebCore::RenderBox::styleDidChange):
1412         (WebCore::RenderBox::updateShapeOutsideInfoAfterStyleChange):
1413         (WebCore::isCandidateForOpaquenessTest):
1414         (WebCore::RenderBox::imageChanged):
1415         * rendering/RenderBox.h:
1416         (WebCore::RenderBox::markShapeOutsideDependentsForLayout):
1417         * rendering/RenderElement.cpp:
1418         (WebCore::RenderElement::~RenderElement):
1419         (WebCore::RenderElement::updateShapeImage):
1420         (WebCore::RenderElement::initializeStyle):
1421         (WebCore::RenderElement::setStyle):
1422         * rendering/RenderElement.h:
1423         (WebCore::RenderElement::hasShapeOutside):
1424         * rendering/SimpleLineLayout.cpp:
1425         (WebCore::SimpleLineLayout::canUseForWithReason):
1426         * rendering/line/LineWidth.cpp:
1427         (WebCore::LineWidth::shrinkAvailableWidthForNewFloatIfNeeded):
1428         (WebCore::LineWidth::wrapNextToShapeOutside):
1429         (WebCore::LineWidth::fitBelowFloats):
1430         * rendering/line/LineWidth.h:
1431         * rendering/shapes/ShapeOutsideInfo.cpp:
1432         * rendering/shapes/ShapeOutsideInfo.h:
1433         * rendering/style/RenderStyle.cpp:
1434         (WebCore::RenderStyle::changeRequiresLayout):
1435         (WebCore::RenderStyle::changeRequiresRepaint):
1436         * rendering/style/RenderStyle.h:
1437         (WebCore::RenderStyle::initialShapeImageThreshold):
1438         * rendering/style/ShapeValue.cpp:
1439         * rendering/style/ShapeValue.h:
1440         * rendering/style/StyleRareNonInheritedData.cpp:
1441         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
1442         (WebCore::StyleRareNonInheritedData::operator==):
1443         * rendering/style/StyleRareNonInheritedData.h:
1444         * style/StylePendingResources.cpp:
1445         (WebCore::Style::loadPendingResources):
1446
1447 2016-10-18  Chris Dumez  <cdumez@apple.com>
1448
1449         convertDictionary<>() no longer needs to return an Optional<> type
1450         https://bugs.webkit.org/show_bug.cgi?id=163624
1451
1452         Reviewed by Sam Weinig.
1453
1454         convertDictionary<>() no longer needs to return an Optional<> type now
1455         that our dictionary structures are all default constructible after
1456         <https://trac.webkit.org/changeset/206974>.
1457
1458         * bindings/js/JSDOMConvert.h:
1459         * bindings/scripts/CodeGeneratorJS.pm:
1460         (GenerateDictionaryHeaderContent):
1461         (GenerateDictionaryImplementationContent):
1462         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
1463         (WebCore::convertDictionary<TestEventConstructor::Init>):
1464         * bindings/scripts/test/JS/JSTestEventConstructor.h:
1465         * bindings/scripts/test/JS/JSTestObj.cpp:
1466         (WebCore::convertDictionary<TestObj::Dictionary>):
1467         (WebCore::convertDictionary<TestObj::DictionaryThatShouldNotTolerateNull>):
1468         (WebCore::convertDictionary<TestObj::DictionaryThatShouldTolerateNull>):
1469         (WebCore::convertDictionary<AlternateDictionaryName>):
1470         (WebCore::convertDictionary<TestObj::ParentDictionary>):
1471         (WebCore::convertDictionary<TestObj::ChildDictionary>):
1472         * bindings/scripts/test/JS/JSTestObj.h:
1473         * bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
1474         (WebCore::convertDictionary<DictionaryImplName>):
1475         * bindings/scripts/test/JS/JSTestStandaloneDictionary.h:
1476
1477 2016-10-18  Chris Dumez  <cdumez@apple.com>
1478
1479         Leverage new union type support for HTMLSelectElement.add() / HTMLOptionsCollection.add()
1480         https://bugs.webkit.org/show_bug.cgi?id=163608
1481
1482         Reviewed by Ryosuke Niwa.
1483
1484         Leverage new union type support for HTMLSelectElement.add() / HTMLOptionsCollection.add():
1485         - https://html.spec.whatwg.org/#htmlselectelement
1486         - https://html.spec.whatwg.org/#htmloptionscollection
1487
1488         No new tests, rebaseline existing test.
1489
1490         * bindings/scripts/CodeGeneratorJS.pm:
1491         (GenerateDefaultValue):
1492         (GenerateParametersCheck):
1493         * bindings/scripts/test/JS/JSTestObj.cpp:
1494         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalSequenceIsEmptyCaller):
1495         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
1496         (WebCore::constructJSTestOverloadedConstructorsWithSequence1):
1497         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
1498         (WebCore::jsTestTypedefsPrototypeFunctionFuncCaller):
1499         * html/HTMLOptGroupElement.idl:
1500         * html/HTMLOptionsCollection.cpp:
1501         (WebCore::HTMLOptionsCollection::add):
1502         * html/HTMLOptionsCollection.h:
1503         * html/HTMLOptionsCollection.idl:
1504         * html/HTMLSelectElement.cpp:
1505         (WebCore::HTMLSelectElement::add):
1506         (WebCore::HTMLSelectElement::setOption):
1507         (WebCore::HTMLSelectElement::setLength):
1508         * html/HTMLSelectElement.h:
1509         * html/HTMLSelectElement.idl:
1510
1511 2016-10-18  Aaron Chu  <aaron_chu@apple.com>
1512
1513         Web Inspector: AXI: focused/focusable state should be based on Accessibility Object instead of Element
1514         https://bugs.webkit.org/show_bug.cgi?id=163088
1515         <rdar://problem/16421985>
1516
1517         Reviewed by Darin Adler.
1518
1519         Changed code in InspectDOMAgent so that it determines the focusability of a Node based
1520         on the AccessibilityNodeObject and not the Element class.
1521
1522         Covered by existing tests: 
1523         LayoutTests/inspector/dom/getAccessibilityPropertiesForNode.html
1524
1525         * inspector/InspectorDOMAgent.cpp:
1526         (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
1527
1528 2016-10-18  Anders Carlsson  <andersca@apple.com>
1529
1530         Get rid of more WebHistoryItem cruft
1531         https://bugs.webkit.org/show_bug.cgi?id=163623
1532
1533         Reviewed by Tim Horton.
1534
1535         * history/HistoryItem.cpp:
1536         (WebCore::HistoryItem::HistoryItem):
1537         * history/HistoryItem.h:
1538         (WebCore::HistoryItem::setViewportArguments):
1539         (WebCore::HistoryItem::bookmarkID): Deleted.
1540         (WebCore::HistoryItem::setBookmarkID): Deleted.
1541         (WebCore::HistoryItem::sharedLinkUniqueIdentifier): Deleted.
1542         (WebCore::HistoryItem::setSharedLinkUniqueIdentifier): Deleted.
1543
1544 2016-10-18  Dave Hyatt  <hyatt@apple.com>
1545
1546         Fix Windows build.
1547  
1548         * css/parser/CSSPropertyParser.cpp:
1549         (WebCore::CSSPropertyParser::parseSingleValue):
1550
1551 2016-10-18  Antoine Quint  <graouts@apple.com>
1552
1553         Modern media controls don't update their rendering correctly
1554         https://bugs.webkit.org/show_bug.cgi?id=163603
1555         <rdar://problem/28826022>
1556
1557         Reviewed by Dean Jackson.
1558
1559         There are rendering issues when we use an absolutely-positioned element
1560         as the top-most element in a media element's shadow root (webkit.org/b/163592).
1561         Since we only need for that element to be positioned, we can use "position: relative"
1562         instead, which removes the rendering issues.
1563
1564         * Modules/modern-media-controls/controls/media-controls.css:
1565         (.media-controls):
1566         (.media-controls,): Deleted.
1567
1568 2016-10-18  Dean Jackson  <dino@apple.com>
1569
1570         Add preliminary support for extended colors to WebCore::Color
1571         https://bugs.webkit.org/show_bug.cgi?id=162878
1572         <rdar://problem/28596413>
1573
1574         Follow-up review comments from Darin Adler.
1575
1576         * html/canvas/CanvasGradient.cpp:
1577         (WebCore::CanvasGradient::addColorStop): Use nullptr.
1578         * platform/graphics/Color.cpp:
1579         (WebCore::Color::Color): Explicitly zero before assigning the pointer.
1580         * platform/graphics/Color.h: Add some comments about the failings of operator== and hash.
1581         (WebCore::Color::Color): Add some static_asserts to the constructors. Move the empty and deleted values
1582         to static constants.
1583         (WebCore::Color::isHashTableDeletedValue):
1584         (WebCore::Color::hash): Replacement for asUint64, which was only being used for a hash.
1585         (WebCore::Color::asUint64): Deleted.
1586         * platform/graphics/ColorHash.h: Use new hash functions. Use "using" instead of typedef.
1587         (WTF::ColorHash::hash):
1588
1589 2016-10-18  Ryosuke Niwa  <rniwa@webkit.org>
1590
1591         REGRESSION (r201471): Keyboard remains visible when swiping back on twitter.com
1592         https://bugs.webkit.org/show_bug.cgi?id=163581
1593         <rdar://problem/27739558>
1594
1595         Reviewed by Simon Fraser.
1596
1597         The bug was caused by Chrome::elementDidBlur not getting called, which resulted in
1598         StopAssistingNode not getting sent to the UI process.
1599
1600         Test: fast/forms/ios/hide-keyboard-on-node-removal.html
1601
1602         * dom/Document.cpp:
1603         (WebCore::Document::setFocusedElement): Restore the behavior prior to r201471 by calling
1604         Chrome::elementDidBlur explicitly.
1605         * html/HTMLTextFormControlElement.cpp:
1606         (WebCore::HTMLTextFormControlElement::dispatchBlurEvent): Added a comment about ordering.
1607
1608 2016-10-17  Anders Carlsson  <andersca@apple.com>
1609
1610         Move some history specific HistoryItem code to WebHistoryItem
1611         https://bugs.webkit.org/show_bug.cgi?id=163567
1612
1613         Reviewed by Tim Horton.
1614
1615         * history/HistoryItem.cpp:
1616         (WebCore::HistoryItem::addRedirectURL): Deleted.
1617         (WebCore::HistoryItem::redirectURLs): Deleted.
1618         (WebCore::HistoryItem::setRedirectURLs): Deleted.
1619         * history/HistoryItem.h:
1620
1621 2016-10-18  Dave Hyatt  <hyatt@apple.com>
1622
1623         [CSS Parser] Get all the properties turned on
1624         https://bugs.webkit.org/show_bug.cgi?id=163605
1625
1626         Reviewed by Dean Jackson.
1627
1628         * WebCore.xcodeproj/project.pbxproj:
1629         * css/CSSFunctionValue.h:
1630         * css/CSSPendingSubstitutionValue.cpp: Added.
1631         (WebCore::CSSPendingSubstitutionValue::customCSSText):
1632         * css/CSSPendingSubstitutionValue.h: Added.
1633         (WebCore::CSSPendingSubstitutionValue::create):
1634         (WebCore::CSSPendingSubstitutionValue::shorthandValue):
1635         (WebCore::CSSPendingSubstitutionValue::shorthandPropertyId):
1636         (WebCore::CSSPendingSubstitutionValue::equals):
1637         (WebCore::CSSPendingSubstitutionValue::CSSPendingSubstitutionValue):
1638         * css/CSSValue.cpp:
1639         (WebCore::CSSValue::cssText):
1640         (WebCore::CSSValue::destroy):
1641         * css/CSSValue.h:
1642         (WebCore::CSSValue::isPendingSubstitutionValue):
1643         * css/CSSValueKeywords.in:
1644         * css/StylePropertyShorthand.cpp:
1645         (WebCore::transitionShorthandForParsing):
1646         * css/StylePropertyShorthand.h:
1647         * css/parser/CSSParser.cpp:
1648         (WebCore::CSSParser::completeURL):
1649         * css/parser/CSSParserImpl.cpp:
1650         (WebCore::CSSParserImpl::parseValue):
1651         (WebCore::CSSParserImpl::consumeDeclaration):
1652         (WebCore::CSSParserImpl::consumeDeclarationValue):
1653         * css/parser/CSSParserMode.h:
1654         (WebCore::CSSParserContext::completeURL):
1655         * css/parser/CSSParserToken.cpp:
1656         (WebCore::CSSParserToken::parseAsCSSPropertyID):
1657         (WebCore::CSSParserToken::parseAsUnresolvedCSSPropertyID): Deleted.
1658         * css/parser/CSSParserToken.h:
1659         * css/parser/CSSPropertyParser.cpp:
1660         (WebCore::cssPropertyID):
1661         (WebCore::CSSPropertyParser::addProperty):
1662         (WebCore::CSSPropertyParser::addExpandedPropertyForValue):
1663         (WebCore::CSSPropertyParser::parseValue):
1664         (WebCore::CSSPropertyParser::parseSingleValue):
1665         (WebCore::CSSPropertyParser::parseValueStart):
1666         (WebCore::CSSPropertyParser::consumeCSSWideKeyword):
1667         (WebCore::consumeTransformOrigin):
1668         (WebCore::consumeWillChange):
1669         (WebCore::consumeFontFeatureTag):
1670         (WebCore::consumeFontFeatureSettings):
1671         (WebCore::consumePage):
1672         (WebCore::consumeQuotes):
1673         (WebCore::FontVariantLigaturesParser::consumeLigature):
1674         (WebCore::FontVariantLigaturesParser::finalizeValue):
1675         (WebCore::consumeFontVariantLigatures):
1676         (WebCore::consumeFontVariantCaps):
1677         (WebCore::FontVariantNumericParser::consumeNumeric):
1678         (WebCore::FontVariantNumericParser::finalizeValue):
1679         (WebCore::consumeFontVariantNumeric):
1680         (WebCore::consumeFontVariantCSS21):
1681         (WebCore::consumeFontVariantList):
1682         (WebCore::consumeFontWeight):
1683         (WebCore::consumeFamilyName):
1684         (WebCore::consumeGenericFamily):
1685         (WebCore::consumeFontFamily):
1686         (WebCore::consumeSpacing):
1687         (WebCore::consumeTabSize):
1688         (WebCore::consumeTextSizeAdjust):
1689         (WebCore::consumeFontSize):
1690         (WebCore::consumeLineHeight):
1691         (WebCore::createPrimitiveValuePair):
1692         (WebCore::consumeCounter):
1693         (WebCore::consumePageSize):
1694         (WebCore::consumeSize):
1695         (WebCore::consumeTextIndent):
1696         (WebCore::validWidthOrHeightKeyword):
1697         (WebCore::consumeMaxWidthOrHeight):
1698         (WebCore::consumeWidthOrHeight):
1699         (WebCore::consumeMarginOrOffset):
1700         (WebCore::consumeClipComponent):
1701         (WebCore::consumeClip):
1702         (WebCore::consumeTouchAction):
1703         (WebCore::consumeLineClamp):
1704         (WebCore::consumeLocale):
1705         (WebCore::consumeColumnWidth):
1706         (WebCore::consumeColumnCount):
1707         (WebCore::consumeColumnGap):
1708         (WebCore::consumeColumnSpan):
1709         (WebCore::consumeZoom):
1710         (WebCore::consumeAnimationIterationCount):
1711         (WebCore::consumeAnimationName):
1712         (WebCore::consumeTransitionProperty):
1713         (WebCore::consumeCubicBezier):
1714         (WebCore::consumeAnimationTimingFunction):
1715         (WebCore::consumeAnimationValue):
1716         (WebCore::isValidAnimationPropertyList):
1717         (WebCore::consumeAnimationPropertyList):
1718         (WebCore::CSSPropertyParser::consumeAnimationShorthand):
1719         (WebCore::consumeZIndex):
1720         (WebCore::parseSingleShadow):
1721         (WebCore::consumeShadow):
1722         (WebCore::consumeFilterFunction):
1723         (WebCore::consumeFilter):
1724         (WebCore::consumeTextDecorationLine):
1725         (WebCore::consumeTextEmphasisStyle):
1726         (WebCore::consumeOutlineColor):
1727         (WebCore::consumeLineWidth):
1728         (WebCore::consumeBorderWidth):
1729         (WebCore::consumeTextStrokeWidth):
1730         (WebCore::consumeColumnRuleWidth):
1731         (WebCore::consumeTranslate3d):
1732         (WebCore::consumeNumbers):
1733         (WebCore::consumePerspective):
1734         (WebCore::consumeTransformValue):
1735         (WebCore::consumeTransform):
1736         (WebCore::consumePositionLonghand):
1737         (WebCore::consumePositionX):
1738         (WebCore::consumePositionY):
1739         (WebCore::consumePaintStroke):
1740         (WebCore::consumePaintOrder):
1741         (WebCore::consumeNoneOrURI):
1742         (WebCore::consumeFlexBasis):
1743         (WebCore::consumeStrokeDasharray):
1744         (WebCore::consumeBaselineShift):
1745         (WebCore::consumeRxOrRy):
1746         (WebCore::consumeCursor):
1747         (WebCore::consumeAttr):
1748         (WebCore::consumeCounterContent):
1749         (WebCore::consumeContent):
1750         (WebCore::consumePositionList):
1751         (WebCore::consumeScrollSnapCoordinate):
1752         (WebCore::consumeScrollSnapPoints):
1753         (WebCore::consumeBorderRadiusCorner):
1754         (WebCore::consumeVerticalAlign):
1755         (WebCore::consumeShapeRadius):
1756         (WebCore::consumeBasicShapeCircle):
1757         (WebCore::consumeBasicShapeEllipse):
1758         (WebCore::consumeBasicShapePolygon):
1759         (WebCore::complete4Sides):
1760         (WebCore::consumeRadii):
1761         (WebCore::consumeBasicShapeInset):
1762         (WebCore::consumeBasicShape):
1763         (WebCore::consumeWebkitClipPath):
1764         (WebCore::consumeShapeOutside):
1765         (WebCore::consumeContentDistributionOverflowPosition):
1766         (WebCore::consumeBorderImageRepeatKeyword):
1767         (WebCore::consumeBorderImageRepeat):
1768         (WebCore::consumeBorderImageSlice):
1769         (WebCore::consumeBorderImageOutset):
1770         (WebCore::consumeBorderImageWidth):
1771         (WebCore::consumeBorderImageComponents):
1772         (WebCore::consumeWebkitBorderImage):
1773         (WebCore::consumeReflect):
1774         (WebCore::consumeImageOrientation):
1775         (WebCore::consumeBackgroundBlendMode):
1776         (WebCore::consumeBackgroundAttachment):
1777         (WebCore::consumeBackgroundBox):
1778         (WebCore::consumeBackgroundComposite):
1779         (WebCore::consumePrefixedBackgroundBox):
1780         (WebCore::consumeBackgroundSize):
1781         (WebCore::consumeGridAutoFlow):
1782         (WebCore::consumeBackgroundComponent):
1783         (WebCore::addBackgroundValue):
1784         (WebCore::consumeCommaSeparatedBackgroundComponent):
1785         (WebCore::consumeSelfPositionKeyword):
1786         (WebCore::consumeSelfPositionOverflowPosition):
1787         (WebCore::consumeAlignItems):
1788         (WebCore::consumeJustifyItems):
1789         (WebCore::consumeFitContent):
1790         (WebCore::consumeCustomIdentForGridLine):
1791         (WebCore::consumeGridLine):
1792         (WebCore::isGridTrackFixedSized):
1793         (WebCore::consumeGridBreadth):
1794         (WebCore::consumeGridTrackSize):
1795         (WebCore::consumeGridLineNames):
1796         (WebCore::consumeGridTrackRepeatFunction):
1797         (WebCore::consumeGridTrackList):
1798         (WebCore::consumeGridTemplatesRowsOrColumns):
1799         (WebCore::consumeGridTemplateAreas):
1800         (WebCore::consumeFontFaceUnicodeRange):
1801         (WebCore::consumeFontFaceSrcURI):
1802         (WebCore::consumeFontFaceSrcLocal):
1803         (WebCore::consumeFontFaceSrc):
1804         (WebCore::CSSPropertyParser::parseFontFaceDescriptor):
1805         (WebCore::CSSPropertyParser::consumeSystemFont):
1806         (WebCore::CSSPropertyParser::consumeFont):
1807         (WebCore::CSSPropertyParser::consumeFontVariantShorthand):
1808         (WebCore::CSSPropertyParser::consumeBorderSpacing):
1809         (WebCore::consumeSingleViewportDescriptor):
1810         (WebCore::CSSPropertyParser::parseViewportDescriptor):
1811         (WebCore::consumeColumnWidthOrCount):
1812         (WebCore::CSSPropertyParser::consumeColumns):
1813         (WebCore::CSSPropertyParser::consumeShorthandGreedily):
1814         (WebCore::CSSPropertyParser::consumeFlex):
1815         (WebCore::CSSPropertyParser::consumeBorder):
1816         (WebCore::CSSPropertyParser::consume4Values):
1817         (WebCore::CSSPropertyParser::consumeBorderImage):
1818         (WebCore::CSSPropertyParser::consumeLegacyBreakProperty):
1819         (WebCore::consumeBackgroundPosition):
1820         (WebCore::consumeRepeatStyleComponent):
1821         (WebCore::consumeRepeatStyle):
1822         (WebCore::CSSPropertyParser::consumeBackgroundShorthand):
1823         (WebCore::CSSPropertyParser::consumeGridItemPositionShorthand):
1824         (WebCore::CSSPropertyParser::consumeGridAreaShorthand):
1825         (WebCore::CSSPropertyParser::consumeGridTemplateRowsAndAreasAndColumns):
1826         (WebCore::CSSPropertyParser::consumeGridTemplateShorthand):
1827         (WebCore::CSSPropertyParser::consumeGridShorthand):
1828         (WebCore::CSSPropertyParser::parseShorthand):
1829         (WebCore::unresolvedCSSPropertyID): Deleted.
1830         * css/parser/CSSPropertyParser.h:
1831         * css/parser/CSSPropertyParserHelpers.cpp:
1832         (WebCore::CSSPropertyParserHelpers::consumeIdent):
1833         (WebCore::CSSPropertyParserHelpers::consumeCustomIdent):
1834         (WebCore::CSSPropertyParserHelpers::consumeString):
1835         (WebCore::CSSPropertyParserHelpers::consumeImageSet):
1836         * css/parser/CSSPropertyParserHelpers.h:
1837
1838 2016-10-18  Brent Fulgham  <bfulgham@apple.com>
1839
1840         Correct Document::removeAllEventListeners
1841         https://bugs.webkit.org/show_bug.cgi?id=163558
1842         <rdar://problem/28716840>
1843
1844         Reviewed by Chris Dumez.
1845
1846         Tested by fast/dom/node-move-to-new-document-crash-main.html.
1847
1848         * dom/Document.cpp:
1849         (WebCore::Document::removeAllEventListeners): Clear out the wheel and
1850         touch event targets when clearing all data.
1851
1852 2016-10-18  Dean Jackson  <dino@apple.com>
1853
1854         Remove dependency cycle with UIKit
1855         https://bugs.webkit.org/show_bug.cgi?id=163577
1856         <rdar://problem/28786160>
1857
1858         Reviewed by Tim Horton.
1859
1860         Soft link against UIKit. Followup patch because
1861         I screwed up and forgot to edit the simulator
1862         configuration.
1863
1864         * Configurations/WebCoreTestSupport.xcconfig:
1865
1866 2016-10-18  Said Abou-Hallawa  <sabouhallawa@apple.com>
1867
1868         SVGCSSParser: m_implicitShorthand value is not reset after adding the shorthand property
1869         https://bugs.webkit.org/show_bug.cgi?id=116470
1870
1871         Reviewed by Simon Fraser.
1872
1873         When we encounter a shorthand css property, we set m_implicitShorthand
1874         to true to tell addProperty() later that the individual properties are
1875         all set through a short hand one. We need to make sure that setting 
1876         m_implicitShorthand to true will not be leaked after finishing parsing
1877         the short hand property.
1878
1879         Test: fast/css/implicit-property-restore.html
1880
1881         * css/parser/CSSParser.cpp:
1882         (WebCore::CSSParser::parseValue):
1883         (WebCore::CSSParser::parseFillShorthand):
1884         (WebCore::CSSParser::parseShorthand):
1885         (WebCore::CSSParser::parse4Values):
1886         (WebCore::CSSParser::parseBorderRadius):
1887         (WTF::ImplicitScope::ImplicitScope): Deleted.
1888         (WTF::ImplicitScope::~ImplicitScope): Deleted.
1889         Get rid of ImplicitScope and replace its calls by TemporaryChange<bool>.
1890         
1891         * css/parser/SVGCSSParser.cpp:
1892         (WebCore::CSSParser::parseSVGValue):
1893         Restore m_implicitShorthand value after setting it temporarily to true.
1894
1895 2016-10-18  Chris Dumez  <cdumez@apple.com>
1896
1897         Update TrackEvent to stop using legacy [ConstructorTemplate=Event]
1898         https://bugs.webkit.org/show_bug.cgi?id=163580
1899
1900         Reviewed by Sam Weinig.
1901
1902         Update TrackEvent to stop using legacy [ConstructorTemplate=Event]
1903         and use a regular constructor as in the specification:
1904         - https://html.spec.whatwg.org/#the-trackevent-interface
1905
1906         No new tests, updated existing tests.
1907
1908         * html/track/TrackEvent.cpp:
1909         (WebCore::TrackEvent::TrackEvent):
1910         * html/track/TrackEvent.h:
1911         * html/track/TrackEvent.idl:
1912
1913 2016-10-18  Commit Queue  <commit-queue@webkit.org>
1914
1915         Unreviewed, rolling out r207409.
1916         https://bugs.webkit.org/show_bug.cgi?id=163602
1917
1918         Introduced many test failures and timeouts, causing release
1919         bot to exit early (Requested by mcatanzaro on #webkit).
1920
1921         Reverted changeset:
1922
1923         "[GTK] Several tests crashing on debug bot in (anonymous
1924         namespace)::MediaPlayerPrivateGStreamerBase::repaint"
1925         https://bugs.webkit.org/show_bug.cgi?id=163511
1926         http://trac.webkit.org/changeset/207409
1927
1928 2016-10-18  Eric Carlson  <eric.carlson@apple.com>
1929
1930         [MediaStream] Resolve constraints and enumerate devices in the UI process
1931         https://bugs.webkit.org/show_bug.cgi?id=162147
1932         <rdar://problem/28803569>
1933
1934         Reviewed by Darin Adler.
1935
1936         Restructure gUM constraint validation and MediaDevices.enumerateDevices so all media device
1937         access happens in the UI process.
1938
1939         No new tests, updated results of existing tests.
1940
1941         * CMakeLists.txt: Add MediaDevicesEnumerationRequest.cpp, delete UserMediaPermissionCheck.cpp.
1942
1943         * Modules/mediastream/MediaConstraintsImpl.cpp:
1944         (WebCore::MediaConstraintsImpl::create): Only create from MediaConstraintsData.
1945         (WebCore::MediaConstraintsImpl::initialize): Deleted.
1946         * Modules/mediastream/MediaConstraintsImpl.h:
1947
1948         * Modules/mediastream/MediaDevicesEnumerationRequest.cpp: Added.
1949         (WebCore::MediaDevicesEnumerationRequest::create):
1950         (WebCore::MediaDevicesEnumerationRequest::MediaDevicesEnumerationRequest):
1951         (WebCore::MediaDevicesEnumerationRequest::~MediaDevicesEnumerationRequest):
1952         (WebCore::MediaDevicesEnumerationRequest::userMediaDocumentOrigin):
1953         (WebCore::MediaDevicesEnumerationRequest::topLevelDocumentOrigin):
1954         (WebCore::MediaDevicesEnumerationRequest::contextDestroyed):
1955         (WebCore::MediaDevicesEnumerationRequest::start):
1956         (WebCore::MediaDevicesEnumerationRequest::cancel):
1957         (WebCore::MediaDevicesEnumerationRequest::setDeviceInfo):
1958         (WebCore::MediaDevicesEnumerationRequest::finish):
1959         * Modules/mediastream/MediaDevicesEnumerationRequest.h: Added.
1960
1961         * Modules/mediastream/MediaDevicesRequest.cpp:
1962         (WebCore::MediaDevicesRequest::~MediaDevicesRequest): Clear the enumeration request.
1963         (WebCore::MediaDevicesRequest::contextDestroyed): Ditto.
1964         (WebCore::MediaDevicesRequest::start): Create and use a MediaDevicesEnumerationRequest.
1965         (WebCore::MediaDevicesRequest::didCompletePermissionCheck): Deleted.
1966         * Modules/mediastream/MediaDevicesRequest.h:
1967
1968         * Modules/mediastream/UserMediaClient.h:
1969         * Modules/mediastream/UserMediaController.h:
1970         (WebCore::UserMediaController::enumerateMediaDevices): New.
1971         (WebCore::UserMediaController::cancelMediaDevicesEnumerationRequest): New.
1972         (WebCore::UserMediaController::checkUserMediaPermission): Deleted.
1973         (WebCore::UserMediaController::cancelUserMediaPermissionCheck): Deleted.
1974
1975         * Modules/mediastream/UserMediaPermissionCheck.h: Deleted.
1976         * Modules/mediastream/UserMediaPermissionCheck.cpp: Deleted.
1977
1978         * Modules/mediastream/UserMediaRequest.cpp:
1979         (WebCore::UserMediaRequest::UserMediaRequest):
1980         (WebCore::UserMediaRequest::start):
1981         (WebCore::UserMediaRequest::allow):
1982         (WebCore::UserMediaRequest::deny):
1983         (WebCore::UserMediaRequest::constraintsValidated): Deleted.
1984         (WebCore::UserMediaRequest::userMediaAccessGranted): Deleted.
1985         (WebCore::UserMediaRequest::userMediaAccessDenied): Deleted.
1986         (WebCore::UserMediaRequest::constraintsInvalid): Deleted.
1987         (WebCore::UserMediaRequest::didCreateStream): Deleted.
1988         (WebCore::UserMediaRequest::failedToCreateStreamWithConstraintsError): Deleted.
1989         (WebCore::UserMediaRequest::failedToCreateStreamWithPermissionError): Deleted.
1990         * Modules/mediastream/UserMediaRequest.h:
1991
1992         * WebCore.xcodeproj/project.pbxproj: Add MediaDevicesEnumerationRequest.*.
1993
1994         * platform/mediastream/CaptureDevice.h:
1995         (WebCore::CaptureDevice::CaptureDevice):
1996         (WebCore::CaptureDevice::setPersistentId): Add setter for argument decoder.
1997         (WebCore::CaptureDevice::setLabel): Ditto.
1998         (WebCore::CaptureDevice::setGroupId): Ditto.
1999         (WebCore::CaptureDevice::setKind): Ditto.
2000
2001         * platform/mediastream/CaptureDeviceManager.h: Remove unnecessary include.
2002
2003         * platform/mediastream/MediaConstraints.h:
2004         (WebCore::MediaConstraint::encode): New.
2005         (WebCore::MediaConstraint::decode): Ditto.
2006         (WebCore::NumericConstraint::encode): Ditto.
2007         (WebCore::NumericConstraint::decode): Ditto.
2008
2009         * platform/mediastream/MediaStreamCreationClient.h: Deleted.
2010
2011         * platform/mediastream/RealtimeMediaSourceCenter.h: Use completion handlers instead of client interface.
2012
2013         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
2014         (WebCore::AVCaptureDeviceManager::refreshCaptureDeviceList): Drive-by fix: don't initialize
2015         group id, we don't support it.
2016
2017         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
2018         (WebCore::RealtimeMediaSourceCenterMac::validateRequestConstraints): Update for interface change.
2019         (WebCore::RealtimeMediaSourceCenterMac::createMediaStream): Ditto.
2020         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.h:
2021
2022         * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp:
2023         (WebCore::RealtimeMediaSourceCenterOwr::validateRequestConstraints): Ditto.
2024         (WebCore::RealtimeMediaSourceCenterOwr::createMediaStream): Ditto.
2025         (WebCore::RealtimeMediaSourceCenterOwr::mediaSourcesAvailable): Ditto.
2026         * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.h:
2027
2028         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
2029         (WebCore::MockRealtimeMediaSourceCenter::validateRequestConstraints): Ditto.
2030         (WebCore::MockRealtimeMediaSourceCenter::createMediaStream): Ditto.
2031         * platform/mock/MockRealtimeMediaSourceCenter.h:
2032
2033 2016-10-18  Zan Dobersek  <zdobersek@igalia.com>
2034
2035         [WebIDL] Support BufferSource
2036         https://bugs.webkit.org/show_bug.cgi?id=163541
2037
2038         Reviewed by Youenn Fablet.
2039
2040         Add support for the BufferSource typedef in WebIDL. The implementation
2041         adds the necessary handling for this type in the generator scripts and
2042         the specialization of the Converter<> template for the IDLBufferSource
2043         struct that enables exposing ArrayBuffer or ArrayBufferView objects by
2044         having WebCore::BufferSource objects pointing to their data.
2045
2046         The SourceBuffer interface in the MSE module has the appendBuffer()
2047         operation modified to accept a BufferSource parameter, instead of
2048         overloading it for ArrayBuffer and ArrayBufferView parameters.
2049
2050         The bindings generator tests cover BufferSource as both an operation
2051         parameter and as a dictionary member.
2052
2053         * Modules/mediasource/SourceBuffer.cpp:
2054         (WebCore::SourceBuffer::appendBuffer):
2055         (WebCore::SourceBuffer::appendBufferInternal):
2056         * Modules/mediasource/SourceBuffer.h:
2057         * Modules/mediasource/SourceBuffer.idl:
2058         * WebCore.xcodeproj/project.pbxproj:
2059         * bindings/generic/IDLTypes.h:
2060         * bindings/js/BufferSource.h: Added.
2061         * bindings/js/JSDOMConvert.h:
2062         (WebCore::Converter<IDLBufferSource>::convert):
2063         * bindings/scripts/CodeGenerator.pm:
2064         (SkipIncludeHeader):
2065         (IsWrapperType):
2066         * bindings/scripts/CodeGeneratorJS.pm:
2067         (AddClassForwardIfNeeded):
2068         (GetBaseIDLType):
2069         (IsHandledByDOMConvert):
2070         * bindings/scripts/test/JS/JSTestObj.cpp:
2071         (WebCore::convertDictionary<TestObj::Dictionary>):
2072         (WebCore::jsTestObjPrototypeFunctionBufferSourceParameter):
2073         (WebCore::jsTestObjPrototypeFunctionBufferSourceParameterCaller):
2074         * bindings/scripts/test/TestObj.idl:
2075
2076 2016-10-18  Javier Fernandez  <jfernandez@igalia.com>
2077
2078         [css-grid] Different width of grid container between initial load and refresh
2079         https://bugs.webkit.org/show_bug.cgi?id=163535
2080
2081         Reviewed by Manuel Rego Casasnovas.
2082
2083         Grid's layout logic manages two different override sizes; one it's
2084         designed to implement the grid item's stretching behavior, identified
2085         with the concept of 'overrideContentLogicalSize'; there is another
2086         override size, known as overrideContainingBlockContentLogicalSize,
2087         used to implement the Grid Area abstraction, which will behave as
2088         the actual containing block of any grid item.
2089
2090         During grid's layout logic these override sizes are set according
2091         to the CSS style rules. This affects how the grid container and its
2092         children are going to be sized during layout. Grid Tracks sizing
2093         algorithm depends on these override sizes.
2094
2095         In order to ensure that the tracks sizing algorithm produces the
2096         same results when it's run consecutively several times, we need to
2097         clear these override sizes and perform a layout of the affected grid
2098         items. Otherwise, the affected items will return sizing values which
2099         depend on the override values set in the previous layout, which in
2100         some cases, like orthogonal flows, may change through different runs
2101         of the sizing algorithm.
2102
2103         Test: fast/css-grid-layout/repeating-layout-must-produce-the-same-results.html
2104
2105         * rendering/RenderGrid.cpp:
2106         (WebCore::RenderGrid::layoutBlock):
2107
2108 2016-10-18  Youenn Fablet  <youenn@apple.com>
2109
2110         CachedResourceLoader should not need to remove fragment identifier
2111         https://bugs.webkit.org/show_bug.cgi?id=163015
2112
2113         Reviewed by Darin Adler.
2114
2115         No expected change for non-window port.
2116         For window port, CachedResourceLoader will strip the fragment identifier of the URL passed to subresourceForURL
2117         before querying the memory cache.
2118
2119         Removing the fragment identifier from the request stored in CachedResourceRequest.
2120         The fragment identifier is stored in a separate field.
2121
2122         This allows CachedResourceLoader to not care about fragment identifier.
2123         CachedResource can then get access to it.
2124
2125         * loader/cache/CachedResource.cpp:
2126         (WebCore::CachedResource::CachedResource):
2127         (WebCore::CachedResource::finishRequestInitialization): Deleted.
2128         * loader/cache/CachedResource.h:
2129         * loader/cache/CachedResourceLoader.cpp:
2130         (WebCore::CachedResourceLoader::cachedResource):
2131         Updated the method taking a const String& to strip the fragment identifier if needed.
2132         Updated the method taking a const URL& to assert if the fragment identifier is present.
2133         (WebCore::CachedResourceLoader::requestUserCSSStyleSheet):
2134         (WebCore::CachedResourceLoader::requestResource):
2135         * loader/cache/CachedResourceRequest.cpp:
2136         (WebCore::CachedResourceRequest::CachedResourceRequest):
2137         (WebCore::CachedResourceRequest::splitFragmentIdentifierFromRequestURL):
2138         * loader/cache/CachedResourceRequest.h:
2139         (WebCore::CachedResourceRequest::releaseFragmentIdentifier):
2140         (WebCore::CachedResourceRequest::clearFragmentIdentifier):
2141         * loader/cache/MemoryCache.cpp:
2142         (WebCore::MemoryCache::shouldRemoveFragmentIdentifier):
2143         (WebCore::MemoryCache::removeFragmentIdentifierIfNeeded):
2144         (WebCore::MemoryCache::revalidationSucceeded):
2145         (WebCore::MemoryCache::resourceForRequest):
2146         * loader/cache/MemoryCache.h:
2147
2148 2016-10-18  Antti Koivisto  <antti@apple.com>
2149
2150         Rename setNeedsStyleRecalc to invalidateStyle
2151         https://bugs.webkit.org/show_bug.cgi?id=163542
2152
2153         Reviewed by Darin Adler.
2154
2155         Also rename StyleChangeType enum and some related functions for clarity. For example
2156
2157             element.setNeedsStyleRecalc(SyntheticStyleChange);
2158
2159         becomes
2160
2161             element.invalidateStyleAndLayerComposition();
2162
2163         * WebCore.xcodeproj/project.pbxproj:
2164         * css/StyleInvalidationAnalysis.cpp:
2165         (WebCore::StyleInvalidationAnalysis::invalidateIfNeeded):
2166         * dom/Document.cpp:
2167         (WebCore::Document::recalcStyle):
2168         (WebCore::Document::updateViewportUnitsOnResize):
2169         (WebCore::Document::setCSSTarget):
2170         (WebCore::unwrapFullScreenRenderer):
2171         (WebCore::Document::setAnimatingFullScreen):
2172         * dom/Element.cpp:
2173         (WebCore::Element::setActive):
2174         (WebCore::Element::setFocus):
2175         (WebCore::Element::setHovered):
2176         (WebCore::Element::attributeChanged):
2177         (WebCore::Element::invalidateStyle):
2178         (WebCore::Element::invalidateStyleAndLayerComposition):
2179         (WebCore::Element::invalidateStyleForSubtree):
2180         (WebCore::Element::invalidateStyleAndRenderersForSubtree):
2181
2182             Move public invalidation functions to Element tightening typing.
2183             Use separate functions instead of enum values.
2184             This way the call sites look nicer and only useful combinations are exposed.
2185
2186         (WebCore::Element::addShadowRoot):
2187         (WebCore::checkForEmptyStyleChange):
2188         (WebCore::checkForSiblingStyleChanges):
2189         (WebCore::Element::needsStyleInvalidation):
2190         (WebCore::Element::setContainsFullScreenElement):
2191         * dom/Element.h:
2192         (WebCore::Element::setHasFocusWithin):
2193         * dom/Node.cpp:
2194         (WebCore::computeEditabilityFromComputedStyle):
2195         (WebCore::Node::adjustStyleValidity):
2196
2197             Update validity and mode separately. There was a potential bug here where
2198             SyntheticStyleChange could overwrite FullStyleChange (no known repro).
2199
2200         (WebCore::Node::updateAncestorsForStyleRecalc):
2201         (WebCore::Node::invalidateStyle):
2202         (WebCore::Node::insertedInto):
2203         (WebCore::Node::setNeedsStyleRecalc): Deleted.
2204         * dom/Node.h:
2205         (WebCore::Node::needsStyleRecalc):
2206         (WebCore::Node::styleValidity):
2207         (WebCore::Node::styleResolutionShouldRecompositeLayer):
2208         (WebCore::Node::setHasValidStyle):
2209         (WebCore::Node::styleChangeType): Deleted.
2210         (WebCore::Node::clearNeedsStyleRecalc): Deleted.
2211         (WebCore::Node::setStyleChange): Deleted.
2212         * dom/RadioButtonGroups.cpp:
2213         (WebCore::RadioButtonGroup::remove):
2214         (WebCore::RadioButtonGroup::setNeedsStyleRecalcForAllButtons):
2215         * dom/ShadowRoot.cpp:
2216         (WebCore::ShadowRoot::setResetStyleInheritance):
2217         * dom/SlotAssignment.cpp:
2218         (WebCore::SlotAssignment::addSlotElementByName):
2219         (WebCore::SlotAssignment::removeSlotElementByName):
2220         (WebCore::SlotAssignment::didChangeSlot):
2221         * dom/StyledElement.cpp:
2222         (WebCore::StyledElement::attributeChanged):
2223         (WebCore::StyledElement::styleAttributeChanged):
2224         (WebCore::StyledElement::invalidateStyleAttribute):
2225         * dom/Text.cpp:
2226         (WebCore::Text::updateRendererAfterContentChange):
2227         * dom/VisitedLinkState.cpp:
2228         (WebCore::VisitedLinkState::invalidateStyleForAllLinks):
2229         (WebCore::VisitedLinkState::invalidateStyleForLink):
2230         * editing/FrameSelection.cpp:
2231         (WebCore::FrameSelection::focusedOrActiveStateChanged):
2232         * html/BaseDateAndTimeInputType.cpp:
2233         (WebCore::BaseDateAndTimeInputType::minOrMaxAttributeChanged):
2234         * html/FileInputType.cpp:
2235         (WebCore::FileInputType::setValue):
2236         * html/HTMLAnchorElement.cpp:
2237         (WebCore::HTMLAnchorElement::parseAttribute):
2238         * html/HTMLBodyElement.cpp:
2239         (WebCore::HTMLBodyElement::parseAttribute):
2240         * html/HTMLCanvasElement.cpp:
2241         (WebCore::HTMLCanvasElement::getContext):
2242         (WebCore::HTMLCanvasElement::createImageBuffer):
2243         * html/HTMLElement.cpp:
2244         (WebCore::HTMLElement::adjustDirectionalityIfNeededAfterChildAttributeChanged):
2245         (WebCore::HTMLElement::calculateAndAdjustDirectionality):
2246         * html/HTMLFieldSetElement.cpp:
2247         (WebCore::HTMLFieldSetElement::addInvalidDescendant):
2248         (WebCore::HTMLFieldSetElement::removeInvalidDescendant):
2249         * html/HTMLFormControlElement.cpp:
2250         (WebCore::HTMLFormControlElement::disabledStateChanged):
2251         (WebCore::HTMLFormControlElement::readOnlyAttributeChanged):
2252         (WebCore::HTMLFormControlElement::requiredAttributeChanged):
2253         (WebCore::HTMLFormControlElement::setNeedsWillValidateCheck):
2254         (WebCore::HTMLFormControlElement::updateValidity):
2255         * html/HTMLFormElement.cpp:
2256         (WebCore::HTMLFormElement::registerFormElement):
2257         (WebCore::HTMLFormElement::registerInvalidAssociatedFormControl):
2258         (WebCore::HTMLFormElement::removeInvalidAssociatedFormControlIfNeeded):
2259         (WebCore::HTMLFormElement::resetDefaultButton):
2260         * html/HTMLFrameElementBase.cpp:
2261         (WebCore::HTMLFrameElementBase::finishedInsertingSubtree):
2262         * html/HTMLFrameOwnerElement.cpp:
2263         (WebCore::HTMLFrameOwnerElement::scheduleinvalidateStyleAndLayerComposition):
2264         (WebCore::HTMLFrameOwnerElement::scheduleSetNeedsStyleRecalc): Deleted.
2265         * html/HTMLFrameOwnerElement.h:
2266         * html/HTMLFrameSetElement.cpp:
2267         (WebCore::HTMLFrameSetElement::parseAttribute):
2268         (WebCore::HTMLFrameSetElement::willRecalcStyle):
2269         * html/HTMLInputElement.cpp:
2270         (WebCore::HTMLInputElement::runPostTypeUpdateTasks):
2271         (WebCore::HTMLInputElement::parseAttribute):
2272         (WebCore::HTMLInputElement::setChecked):
2273         (WebCore::HTMLInputElement::setIndeterminate):
2274         (WebCore::HTMLInputElement::setAutoFilled):
2275         (WebCore::HTMLInputElement::maxLengthAttributeChanged):
2276         (WebCore::HTMLInputElement::minLengthAttributeChanged):
2277         * html/HTMLLinkElement.cpp:
2278         (WebCore::HTMLLinkElement::parseAttribute):
2279         * html/HTMLMediaElement.cpp:
2280         (WebCore::HTMLMediaElement::mediaPlayerRenderingModeChanged):
2281         (WebCore::HTMLMediaElement::setVideoFullscreenLayer):
2282         * html/HTMLObjectElement.cpp:
2283         (WebCore::HTMLObjectElement::parseAttribute):
2284         (WebCore::HTMLObjectElement::childrenChanged):
2285         (WebCore::HTMLObjectElement::renderFallbackContent):
2286         * html/HTMLOptGroupElement.cpp:
2287         (WebCore::HTMLOptGroupElement::parseAttribute):
2288         * html/HTMLOptionElement.cpp:
2289         (WebCore::HTMLOptionElement::parseAttribute):
2290         (WebCore::HTMLOptionElement::setSelectedState):
2291         * html/HTMLPlugInElement.cpp:
2292         (WebCore::HTMLPlugInElement::didAddUserAgentShadowRoot):
2293         * html/HTMLPlugInImageElement.cpp:
2294         (WebCore::HTMLPlugInImageElement::setDisplayState):
2295         (WebCore::HTMLPlugInImageElement::willRecalcStyle):
2296         (WebCore::HTMLPlugInImageElement::finishParsingChildren):
2297         (WebCore::HTMLPlugInImageElement::resumeFromDocumentSuspension):
2298         (WebCore::HTMLPlugInImageElement::removeSnapshotTimerFired):
2299         (WebCore::HTMLPlugInImageElement::restartSnapshottedPlugIn):
2300         * html/HTMLProgressElement.cpp:
2301         (WebCore::HTMLProgressElement::didElementStateChange):
2302         * html/HTMLSelectElement.cpp:
2303         (WebCore::HTMLSelectElement::parseAttribute):
2304         (WebCore::HTMLSelectElement::setRecalcListItems):
2305         (WebCore::HTMLSelectElement::parseMultipleAttribute):
2306         (WebCore::HTMLSelectElement::reset):
2307         * html/HTMLTableElement.cpp:
2308         (WebCore::isTableCellAncestor):
2309         (WebCore::setTableCellsChanged):
2310         (WebCore::HTMLTableElement::parseAttribute):
2311         * html/HTMLTextAreaElement.cpp:
2312         (WebCore::HTMLTextAreaElement::setValueCommon):
2313         * html/HTMLTextFormControlElement.cpp:
2314         (WebCore::HTMLTextFormControlElement::updatePlaceholderVisibility):
2315         * html/InputType.cpp:
2316         (WebCore::InputType::setValue):
2317         * html/NumberInputType.cpp:
2318         (WebCore::NumberInputType::minOrMaxAttributeChanged):
2319         * html/TextFieldInputType.cpp:
2320         (WebCore::TextFieldInputType::subtreeHasChanged):
2321         * mathml/MathMLElement.cpp:
2322         (WebCore::MathMLElement::parseAttribute):
2323         * mathml/MathMLSelectElement.cpp:
2324         (WebCore::MathMLSelectElement::updateSelectedChild):
2325         * page/animation/AnimationBase.cpp:
2326         (WebCore::AnimationBase::setNeedsStyleRecalc):
2327         * page/animation/AnimationController.cpp:
2328         (WebCore::AnimationControllerPrivate::clear):
2329         (WebCore::AnimationControllerPrivate::updateAnimations):
2330         (WebCore::AnimationControllerPrivate::fireEventsAndUpdateStyle):
2331         (WebCore::AnimationControllerPrivate::pauseAnimationAtTime):
2332         (WebCore::AnimationControllerPrivate::pauseTransitionAtTime):
2333         (WebCore::AnimationController::cancelAnimations):
2334         * rendering/RenderImage.cpp:
2335         (WebCore::RenderImage::imageChanged):
2336         * rendering/RenderLayer.cpp:
2337         (WebCore::RenderLayer::calculateClipRects):
2338         * rendering/RenderLayerCompositor.cpp:
2339         (WebCore::RenderLayerCompositor::attachRootLayer):
2340         (WebCore::RenderLayerCompositor::detachRootLayer):
2341         (WebCore::RenderLayerCompositor::notifyIFramesOfCompositingChange):
2342         * rendering/RenderObject.cpp:
2343         (WebCore::RenderObject::updateDragState):
2344         * rendering/svg/SVGResourcesCache.cpp:
2345         (WebCore::SVGResourcesCache::clientStyleChanged):
2346         * style/AttributeChangeInvalidation.cpp:
2347         (WebCore::Style::AttributeChangeInvalidation::invalidateStyle):
2348         * style/ClassChangeInvalidation.cpp:
2349         (WebCore::Style::ClassChangeInvalidation::invalidateStyle):
2350         * style/IdChangeInvalidation.cpp:
2351         (WebCore::Style::IdChangeInvalidation::invalidateStyle):
2352         * style/RenderTreeUpdater.cpp:
2353         (WebCore::RenderTreeUpdater::updateElementRenderer):
2354         * style/StyleScope.cpp:
2355         (WebCore::Style::Scope::updateActiveStyleSheets):
2356         * style/StyleTreeResolver.cpp:
2357         (WebCore::Style::resetStyleForNonRenderedDescendants):
2358         (WebCore::Style::TreeResolver::resolveElement):
2359         (WebCore::Style::TreeResolver::createAnimatedElementUpdate):
2360         (WebCore::Style::TreeResolver::popParent):
2361         (WebCore::Style::clearNeedsStyleResolution):
2362         (WebCore::Style::TreeResolver::resolveComposedTree):
2363         * style/StyleUpdate.h:
2364         * style/StyleValidity.h: Added.
2365
2366             StyleChangeType enum splits into Style::Validity and Style::InvalidationMode.
2367             Move to a file of its own.
2368
2369         * svg/SVGAElement.cpp:
2370         (WebCore::SVGAElement::svgAttributeChanged):
2371         * svg/SVGAnimateElementBase.cpp:
2372         (WebCore::applyCSSPropertyToTarget):
2373         (WebCore::removeCSSPropertyFromTarget):
2374         * svg/SVGElement.cpp:
2375         (WebCore::SVGElement::willRecalcStyle):
2376         * svg/SVGElement.h:
2377         (WebCore::SVGElement::invalidateSVGPresentationAttributeStyle):
2378         * svg/SVGTests.cpp:
2379         (WebCore::SVGTests::handleAttributeChange):
2380         * svg/SVGUseElement.cpp:
2381         (WebCore::SVGUseElement::invalidateShadowTree):
2382         * testing/Internals.cpp:
2383         (WebCore::styleValidityToToString):
2384         (WebCore::Internals::styleChangeType):
2385         (WebCore::styleChangeTypeToString): Deleted.
2386
2387 2016-10-17  Sergio Villar Senin  <svillar@igalia.com>
2388
2389         [css-grid] Constrain by min|max-height on auto repeat computation
2390         https://bugs.webkit.org/show_bug.cgi?id=163540
2391
2392         Reviewed by Darin Adler.
2393
2394         The max-height (if definite) is used to compute the number of auto repeat rows whenever the
2395         height is indefinite. We were using the min-height only in case both values were indefinite.
2396
2397         Although not explicitly mentioned by grid specs, it's reasonable to assume that
2398         the min-height trumps the used value of height/max-height like it always does, per CSS
2399         2.2. Note that the number of rows still needs to fit within that size even if using
2400         min-height, because we're just using min-height to compute the used value of the height
2401         property. If both height and max-height are indefinite we keep doing the same, i.e., compute
2402         the minimum number of rows that fulfill min-height (if definite).
2403
2404         * rendering/RenderGrid.cpp:
2405         (WebCore::RenderGrid::computeAutoRepeatTracksCount):
2406
2407 2016-10-17  Yusuke Suzuki  <utatane.tea@gmail.com>
2408
2409         [DOMJIT] Use NativeCallFrameTracer for operations used for DOMJIT slow calls
2410         https://bugs.webkit.org/show_bug.cgi?id=163586
2411
2412         Reviewed by Saam Barati.
2413
2414         * domjit/JSNodeDOMJIT.cpp:
2415         (WebCore::toWrapperSlow):
2416
2417 2016-10-18  Ryuan Choi  <ryuan.choi@navercorp.com>
2418
2419         [EFL] Build break since r207442
2420         https://bugs.webkit.org/show_bug.cgi?id=163587
2421
2422         Unreviewed.
2423
2424         Since r207442, setRGB is moved to private.
2425
2426         * rendering/RenderThemeEfl.cpp:
2427         (WebCore::fillColorsFromEdjeClass):
2428
2429 2016-10-17  Dean Jackson  <dino@apple.com>
2430
2431         Remove dependency cycle with UIKit
2432         https://bugs.webkit.org/show_bug.cgi?id=163577
2433         <rdar://problem/28786160>
2434
2435         Reviewed by Tim Horton.
2436
2437         Soft link against UIKit.
2438
2439         * Configurations/WebCoreTestSupport.xcconfig:
2440         * testing/Internals.mm:
2441
2442 2016-10-17  Dean Jackson  <dino@apple.com>
2443
2444         Allow creation of ExtendedColors and make Color immutable
2445         https://bugs.webkit.org/show_bug.cgi?id=163557
2446         <rdar://problem/28805360>
2447
2448         Reviewed by Darin Adler and Dave Hyatt.
2449
2450         1. Support the creation of ExtendedColor objects via the
2451         Color class.
2452
2453         2. Fix the remaining few places where a Color object is
2454         modified after creation, instead creating a new Color.
2455         Move all the mutation methods into the private section,
2456         making Color now immutable.
2457
2458         Changes to Color are covered by existing tests. Changes
2459         to ExtendedColor are covered by the ExtendedColor API test.
2460
2461         * css/parser/CSSParser.cpp:
2462         (WebCore::CSSParser::fastParseColor): Return a new named Color.
2463
2464         * dom/Document.cpp:
2465         (WebCore::Document::resetActiveLinkColor): Set to be the named "red" color.
2466
2467         * html/HTMLElement.cpp:
2468         (WebCore::HTMLElement::addHTMLColorToStyle): Use the string-based constructor
2469         where possible.
2470
2471         * page/CaptionUserPreferencesMediaAF.cpp:
2472         (WebCore::CaptionUserPreferencesMediaAF::captionsTextEdgeCSS): No need to
2473         use the string "black" here - we have a constant value.
2474
2475         * platform/graphics/cairo/GraphicsContextCairo.cpp: Don't use setRGB.
2476
2477         * platform/graphics/Color.cpp:
2478         (WebCore::findNamedColor): Move this up in the file.
2479         (WebCore::Color::Color): Copy in the code from setNamedColor. Also
2480         add a constructor for ExtendedColor.
2481         (WebCore::Color::serialized): Call ExtendedColor's serializer if necessary.
2482         (WebCore::Color::cssText): Ditto.
2483         (WebCore::Color::setNamedColor): Deleted.
2484         (WebCore::Color::tagAsExtended): Deleted.
2485
2486         * platform/graphics/Color.h: Add a new constructor.
2487         (WebCore::Color::setRGB): Move to private.
2488
2489         * platform/graphics/ExtendedColor.cpp:
2490         (WebCore::ExtendedColor::cssText): Implement serializer.
2491         * platform/graphics/ExtendedColor.h:
2492
2493         * rendering/style/RenderStyle.cpp:
2494         (WebCore::RenderStyle::colorIncludingFallback): Construct a new Color rather than changing an existing object.
2495
2496 2016-10-17  Simon Fraser  <simon.fraser@apple.com>
2497
2498         Implement DOMRect/DOMRectReadOnly
2499         https://bugs.webkit.org/show_bug.cgi?id=163464
2500
2501         Reviewed by Darin Adler.
2502         
2503         Implement the DOMRectInit/DOMRectReadOnly/DOMRect interfaces specified in
2504         https://dev.w3.org/fxtf/geometry/
2505         
2506         DOMRects allow negative height/width and require double storage, so we can't just
2507         use FloatRect for storage. They also require handling of NaN and Infinity.
2508         
2509         To have the left/right/top/bottom accessors follow IEEE NaN rules, we need to use
2510         custom min/max functions that return NaN if either argument is NaN, so add 
2511         nanPropagatingMin/nanPropagatingMax helpers to MathExtras.h.
2512
2513         Test: fast/dom/domrect.html
2514
2515         * CMakeLists.txt:
2516         * DerivedSources.make:
2517         * WebCore.xcodeproj/project.pbxproj:
2518         * dom/DOMRect.h: Added.
2519         (WebCore::DOMRect::create):
2520         (WebCore::DOMRect::fromRect):
2521         (WebCore::DOMRect::setX):
2522         (WebCore::DOMRect::setY):
2523         (WebCore::DOMRect::setWidth):
2524         (WebCore::DOMRect::setHeight):
2525         (WebCore::DOMRect::DOMRect):
2526         * dom/DOMRect.idl: Added.
2527         * dom/DOMRectInit.h: Added.
2528         * dom/DOMRectInit.idl: Added.
2529         * dom/DOMRectReadOnly.h: Added.
2530         (WebCore::DOMRectReadOnly::create):
2531         (WebCore::DOMRectReadOnly::fromRect):
2532         (WebCore::DOMRectReadOnly::x):
2533         (WebCore::DOMRectReadOnly::y):
2534         (WebCore::DOMRectReadOnly::width):
2535         (WebCore::DOMRectReadOnly::height):
2536         (WebCore::DOMRectReadOnly::top):
2537         (WebCore::DOMRectReadOnly::right):
2538         (WebCore::DOMRectReadOnly::bottom):
2539         (WebCore::DOMRectReadOnly::left):
2540         (WebCore::DOMRectReadOnly::DOMRectReadOnly):
2541         * dom/DOMRectReadOnly.idl: Added.
2542
2543 2016-10-17  Antoine Quint  <graouts@apple.com>
2544
2545         [Modern Media Controls] Basic MediaController
2546         https://bugs.webkit.org/show_bug.cgi?id=163539
2547         <rdar://problem/28797542>
2548
2549         Reviewed by Darin Adler.
2550
2551         We add a new main.js file which acts as the entry point by implementing the createControls()
2552         function that HTMLMediaElement::ensureMediaControlsInjectedScript() once the shadow root has
2553         been created. That functions creates an instance of the new MediaController class, which is
2554         the controller object that will handle communication between the media controls and the media
2555         element. At first, this MediaController class is very limited and assumes macOS inline
2556         layout traits and forces a start button to be shown over the media, which can be played
2557         to start the media and show the full controls. More functionality will be added by future patches.
2558
2559         Tests: media/modern-media-controls/media-controller/media-controller-click-to-start.html
2560                media/modern-media-controls/media-controller/media-controller-constructor.html
2561                media/modern-media-controls/media-controller/media-controller-resize.html
2562
2563         * Modules/modern-media-controls/main.js: Added.
2564         (createControls):
2565         * Modules/modern-media-controls/media/media-controller.js: Added.
2566         (MediaController):
2567         (MediaController.prototype.set pageScaleFactor):
2568         (MediaController.prototype.set usesLTRUserInterfaceLayoutDirection):
2569         (MediaController.prototype.handleEvent):
2570         (MediaController.prototype.buttonWasClicked):
2571         (MediaController.prototype._updateControlsSize):
2572         * WebCore.xcodeproj/project.pbxproj:
2573         * rendering/RenderThemeMac.mm:
2574         (WebCore::RenderThemeMac::mediaControlsStyleSheet):
2575         (WebCore::RenderThemeMac::mediaControlsScript):
2576
2577 2016-10-17  Anders Carlsson  <andersca@apple.com>
2578
2579         Remove an unused HistoryItem function
2580         https://bugs.webkit.org/show_bug.cgi?id=163565
2581
2582         Reviewed by Tim Horton.
2583
2584         * history/HistoryItem.cpp:
2585         (WebCore::HistoryItem::isAncestorOf): Deleted.
2586         * history/HistoryItem.h:
2587
2588 2016-10-17  Nan Wang  <n_wang@apple.com>
2589
2590         AX: [Mac] mapping for output elements
2591         https://bugs.webkit.org/show_bug.cgi?id=163471
2592
2593         Reviewed by Chris Fleizach.
2594
2595         Mapped the output element to status role and exposed its text content
2596         as AXTitle. 
2597
2598         Test: accessibility/mac/output-element.html
2599
2600         * English.lproj/Localizable.strings:
2601         * accessibility/AccessibilityNodeObject.cpp:
2602         (WebCore::AccessibilityNodeObject::visibleText):
2603         * accessibility/AccessibilityObject.cpp:
2604         (WebCore::AccessibilityObject::isOutput):
2605         * accessibility/AccessibilityObject.h:
2606         * accessibility/AccessibilityRenderObject.cpp:
2607         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
2608         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2609         (-[WebAccessibilityObjectWrapper roleDescription]):
2610         * platform/LocalizedStrings.cpp:
2611         (WebCore::AXOutputText):
2612         * platform/LocalizedStrings.h:
2613         * platform/efl/LocalizedStringsEfl.cpp:
2614         (WebCore::AXOutputText):
2615         * platform/gtk/LocalizedStringsGtk.cpp:
2616         (WebCore::AXOutputText):
2617
2618 2016-10-17  Yusuke Suzuki  <utatane.tea@gmail.com>
2619
2620         [DOMJIT] Use DOMJIT::Patchpoint in IC
2621         https://bugs.webkit.org/show_bug.cgi?id=163223
2622
2623         Reviewed by Saam Barati.
2624
2625         Make DOMJITPatchpointParams non-const.
2626
2627         * domjit/DOMJITHelpers.h:
2628         (WebCore::DOMJITHelpers::toWrapper):
2629         * domjit/JSNodeDOMJIT.cpp:
2630         (WebCore::createCallDOMForOffsetAccess):
2631         (WebCore::checkNode):
2632         (WebCore::NodeNodeTypeDOMJIT::callDOM):
2633
2634 2016-10-17  Chris Dumez  <cdumez@apple.com>
2635
2636         Move form.reportValidity() behind InteractiveFormValidation setting
2637         https://bugs.webkit.org/show_bug.cgi?id=163550
2638
2639         Reviewed by Darin Adler.
2640
2641         Move form.reportValidity() behind InteractiveFormValidation setting for consistency
2642         given that the two features are strongly related.
2643
2644         Also enable the setting by default so we can get feedback on the implementation.
2645
2646         Demos:
2647         - Interactive form validation: http://jsfiddle.net/tj_vantoll/HdSqt/
2648         - Report validity: https://googlechrome.github.io/samples/report-validity/
2649
2650         * bindings/generic/RuntimeEnabledFeatures.h:
2651         (WebCore::RuntimeEnabledFeatures::setInteractiveFormValidationEnabled):
2652         (WebCore::RuntimeEnabledFeatures::interactiveFormValidationEnabled):
2653         * html/HTMLButtonElement.idl:
2654         * html/HTMLFieldSetElement.idl:
2655         * html/HTMLFormElement.idl:
2656         * html/HTMLInputElement.idl:
2657         * html/HTMLKeygenElement.idl:
2658         * html/HTMLObjectElement.idl:
2659         * html/HTMLOutputElement.idl:
2660         * html/HTMLSelectElement.idl:
2661         * html/HTMLTextAreaElement.idl:
2662
2663 2016-10-17  Antoine Quint  <graouts@apple.com>
2664
2665         [Modern Media Controls] Add a MediaControlsHost API to retrieve images as base64
2666         https://bugs.webkit.org/show_bug.cgi?id=163502
2667         <rdar://problem/28792017>
2668
2669         Reviewed by Darin Adler.
2670
2671         Add a new `base64StringForIconAndPlatform()` method to MediaControlsHost such that we
2672         may load images from the modern-media-controls directory in the WebCore.framework bundle.
2673         We use this new method in the iconService singleton when a `mediaControlsHost` is set,
2674         which will be set in a later patch.
2675
2676         * Modules/mediacontrols/MediaControlsHost.cpp:
2677         (WebCore::MediaControlsHost::base64StringForIconAndPlatform):
2678         * Modules/mediacontrols/MediaControlsHost.h:
2679         * Modules/mediacontrols/MediaControlsHost.idl:
2680         * Modules/modern-media-controls/controls/icon-service.js:
2681         (const.iconService.new.IconService.prototype.urlForIconNameAndLayoutTraits):
2682         (const.iconService.new.IconService):
2683         * rendering/RenderTheme.h:
2684         (WebCore::RenderTheme::mediaControlsBase64StringForIconAndPlatform):
2685         (WebCore::RenderTheme::mediaControlsScript): Deleted.
2686         * rendering/RenderThemeMac.h:
2687         * rendering/RenderThemeMac.mm:
2688         (WebCore::RenderThemeMac::mediaControlsBase64StringForIconAndPlatform):
2689
2690 2016-10-17  Antoine Quint  <graouts@apple.com>
2691
2692         [Modern Media Controls] Add a MediaControlsHost API to retrieve the shadow root CSS
2693         https://bugs.webkit.org/show_bug.cgi?id=163501
2694         <rdar://problem/28792014>
2695
2696         Reviewed by Darin Adler.
2697
2698         Add a new `shadowRootCSSText` property to MediaControlsHost so that we may obtain the
2699         concatenated CSS sources for the media controls shadow root via JS. Actually using this
2700         API will be done in a later patch. We also no longer inject those styles as a user-agent
2701         stylesheet when the runtime flag is on since it will no longer be necessary.
2702
2703         * Modules/mediacontrols/MediaControlsHost.cpp:
2704         (WebCore::MediaControlsHost::shadowRootCSSText):
2705         * Modules/mediacontrols/MediaControlsHost.h:
2706         * Modules/mediacontrols/MediaControlsHost.idl:
2707         * css/CSSDefaultStyleSheets.cpp:
2708         (WebCore::CSSDefaultStyleSheets::ensureDefaultStyleSheetsForElement):
2709
2710 2016-10-17  Simon Fraser  <simon.fraser@apple.com>
2711
2712         Implement DOMPoint/DOMPointReadOnly
2713         https://bugs.webkit.org/show_bug.cgi?id=133916
2714
2715         Reviewed by Darin Adler.
2716
2717         Patch mostly by Dirk Schultz <krit@webkit.org>.
2718
2719         Implement DOMPoint/DOMPointReadOnly following https://drafts.fxtf.org/geometry/
2720         (although we may need to match https://www.w3.org/TR/geometry-1/ to be compatible
2721         with Chrome).
2722         
2723         Test: geometry/DOMPoint-001.html
2724
2725         * CMakeLists.txt:
2726         * DerivedSources.make:
2727         * WebCore.xcodeproj/project.pbxproj:
2728         * dom/DOMPoint.h: Added.
2729         * dom/DOMPoint.idl: Added.
2730         * dom/DOMPointInit.h: Added.
2731         * dom/DOMPointInit.idl: Added.
2732         * dom/DOMPointReadOnly.h: Added.
2733         (WebCore::DOMPointReadOnly::create):
2734         (WebCore::DOMPointReadOnly::fromPoint):
2735         (WebCore::DOMPointReadOnly::x):
2736         (WebCore::DOMPointReadOnly::y):
2737         (WebCore::DOMPointReadOnly::z):
2738         (WebCore::DOMPointReadOnly::w):
2739         (WebCore::DOMPointReadOnly::DOMPointReadOnly):
2740         * dom/DOMPointReadOnly.idl: Added.
2741
2742 2016-10-17  Antoine Quint  <graouts@apple.com>
2743
2744         [Modern Media Controls] Use modern-media-controls module sources for media controls stylesheet and script injection
2745         https://bugs.webkit.org/show_bug.cgi?id=163500
2746         <rdar://problem/28792010>
2747
2748         Reviewed by Darin Adler.
2749
2750         Add files from the Modules/modern-media-controls directory to the Xcode project and add a copy phase
2751         to copy those files with their directory stucture as a subdirectory of the WebCore.framework Resources
2752         directory.
2753
2754         Additionally, use the modern-media-controls Module CSS and JS files when concatenating the media controls
2755         scripts and styles in RenderTheme when the runtime flag is on.
2756
2757         * WebCore.xcodeproj/project.pbxproj:
2758         * rendering/RenderThemeMac.mm:
2759         (WebCore::RenderThemeMac::mediaControlsStyleSheet):
2760         (WebCore::RenderThemeMac::mediaControlsScript):
2761
2762 2016-10-17  Simon Fraser  <simon.fraser@apple.com>
2763
2764         Fix typo in error message.
2765
2766         * bindings/scripts/CodeGeneratorJS.pm:
2767         (GenerateSerializerFunction):
2768
2769 2016-10-17  Fujii Hironori  <Hironori.Fujii@sony.com>
2770
2771         preprocessor.pm: cl.exe outputs processing filenames if Windows Perl is used
2772         https://bugs.webkit.org/show_bug.cgi?id=163435
2773
2774         Reviewed by Alex Christensen.
2775
2776         cl.exe outputs processing filenames to stderr. Suppress this
2777         annoying messages by using open3 instead of open2.
2778
2779         * bindings/scripts/preprocessor.pm:
2780         (applyPreprocessor): Use open3 in case of Windows Perl.
2781
2782 2016-10-17  Mark Lam  <mark.lam@apple.com>
2783
2784         Use the reject() helper function for conditionally throwing TypeErrors.
2785         https://bugs.webkit.org/show_bug.cgi?id=163491
2786
2787         Reviewed by Filip Pizlo.
2788
2789         No new tests because this patch does not introduce new behavior.
2790
2791         * bindings/js/JSCryptoAlgorithmDictionary.cpp:
2792         (WebCore::createRsaKeyGenParams):
2793         * bindings/js/JSIDBDatabaseCustom.cpp:
2794         (WebCore::JSIDBDatabase::createObjectStore):
2795         * bridge/c/c_instance.cpp:
2796         (JSC::Bindings::CInstance::invokeMethod):
2797
2798 2016-10-17  Miguel Gomez  <magomez@igalia.com>
2799
2800         [GTK] Several tests crashing on debug bot in (anonymous namespace)::MediaPlayerPrivateGStreamerBase::repaint
2801         https://bugs.webkit.org/show_bug.cgi?id=163511
2802
2803         Reviewed by Carlos Garcia Campos.
2804
2805         Perform the video repaint in the main thread when accelerated compositing is disabled.
2806
2807         Covered by existent tests.
2808
2809         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2810         (WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase):
2811         (WebCore::MediaPlayerPrivateGStreamerBase::repaint):
2812         (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
2813         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2814
2815 2016-10-17  Konstantin Tokarev  <annulen@yandex.ru>
2816
2817         Eleminate code duplication between ResourceRequest encoding/decoding implementations
2818         https://bugs.webkit.org/show_bug.cgi?id=163507
2819
2820         Reviewed by Carlos Garcia Campos.
2821
2822         ResourceRequestBase::encodeWithoutPlatformData() and Soup implementation of
2823         ArgumentCoder<ResourceRequest>::encodePlatformData() share most of the code,
2824         ditto for decoding implementations.
2825
2826         No new tests needed.
2827
2828         * platform/network/ResourceRequestBase.h:
2829         (WebCore::ResourceRequestBase::encodeBase):
2830         (WebCore::ResourceRequestBase::decodeBase):
2831         (WebCore::ResourceRequestBase::encodeWithoutPlatformData):
2832         (WebCore::ResourceRequestBase::decodeWithoutPlatformData):
2833         * platform/network/soup/ResourceRequest.h:
2834         (WebCore::ResourceRequest::encodeWithPlatformData):
2835         (WebCore::ResourceRequest::decodeWithPlatformData):
2836
2837 2016-10-17  Michael Catanzaro  <mcatanzaro@igalia.com>
2838
2839         Move user agent quirks to cross-platform location
2840         https://bugs.webkit.org/show_bug.cgi?id=163508
2841
2842         Reviewed by Carlos Garcia Campos.
2843
2844         Tested by Tools/TestWebKitAPI/Tests/WebCore/UserAgentQuirks.cpp.
2845
2846         * PlatformGTK.cmake:
2847         * platform/UserAgent.h: Renamed from Source/WebCore/platform/gtk/UserAgentGtk.h.
2848         * platform/UserAgentQuirks.cpp: Added. Moved from UserAgentGtk.cpp.
2849         (WebCore::urlRequiresChromeBrowser): Sneakily tighten up Google domain detection, it should
2850         only apply to sites if the base domain matches google.*, not any base domain that starts
2851         with google.
2852         (WebCore::urlRequiresMacintoshPlatform):
2853         (WebCore::UserAgentQuirks::quirksForURL):
2854         (WebCore::UserAgentQuirks::stringForQuirk):
2855         * platform/UserAgentQuirks.h: Moved from UserAgentGtk.cpp. prepare-ChangeLog thinks it was
2856         renamed from Source/WebCore/platform/efl/UserAgentEfl.h, but prepare-ChangeLog is dumb.
2857         (WebCore::UserAgentQuirks::UserAgentQuirks):
2858         (WebCore::UserAgentQuirks::add):
2859         (WebCore::UserAgentQuirks::contains):
2860         (WebCore::UserAgentQuirks::isEmpty):
2861         * platform/efl/UserAgentEfl.cpp:
2862         (WebCore::standardUserAgentForURL):
2863         * platform/gtk/UserAgentGtk.cpp:
2864         (WebCore::buildUserAgentString):
2865         (WebCore::standardUserAgentForURL):
2866         (): Deleted.
2867         (WebCore::UserAgentQuirks::UserAgentQuirks): Deleted.
2868         (WebCore::UserAgentQuirks::add): Deleted.
2869         (WebCore::UserAgentQuirks::contains): Deleted.
2870         (WebCore::UserAgentQuirks::isEmpty): Deleted.
2871         (WebCore::urlRequiresChromeBrowser): Deleted.
2872         (WebCore::urlRequiresMacintoshPlatform): Deleted.
2873
2874 2016-10-17  Alberto Garcia  <berto@igalia.com>
2875
2876         [GTK] gobject-introspection on package build with webkit2gtk fails without active X session
2877         https://bugs.webkit.org/show_bug.cgi?id=163105
2878
2879         Reviewed by Carlos Garcia Campos.
2880
2881         Don't call XCompositeQueryExtension() or XDamageQueryExtension()
2882         if m_display is NULL.
2883
2884         * platform/graphics/x11/PlatformDisplayX11.cpp:
2885         (WebCore::PlatformDisplayX11::supportsXComposite):
2886         (WebCore::PlatformDisplayX11::supportsXDamage):
2887
2888 2016-10-16  Nan Wang  <n_wang@apple.com>
2889
2890         AX: [Mac] roleDescription for AXTextField input types
2891         https://bugs.webkit.org/show_bug.cgi?id=163419
2892         <rdar://problem/28766192>
2893
2894         Reviewed by Darin Adler.
2895
2896         Provided more detailed role description for input types that
2897         exposed as standard text fields on the mac.
2898
2899         Changes are covered in modified test expectation.
2900
2901         * English.lproj/Localizable.strings:
2902         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2903         (-[WebAccessibilityObjectWrapper roleDescription]):
2904         * platform/LocalizedStrings.cpp:
2905         (WebCore::AXEmailFieldText):
2906         (WebCore::AXTelephoneFieldText):
2907         (WebCore::AXURLFieldText):
2908         (WebCore::AXDateFieldText):
2909         (WebCore::AXTimeFieldText):
2910         * platform/LocalizedStrings.h:
2911         * platform/efl/LocalizedStringsEfl.cpp:
2912         (WebCore::AXEmailFieldText):
2913         (WebCore::AXTelephoneFieldText):
2914         (WebCore::AXURLFieldText):
2915         (WebCore::AXDateFieldText):
2916         (WebCore::AXTimeFieldText):
2917         * platform/gtk/LocalizedStringsGtk.cpp:
2918         (WebCore::AXEmailFieldText):
2919         (WebCore::AXTelephoneFieldText):
2920         (WebCore::AXURLFieldText):
2921         (WebCore::AXDateFieldText):
2922         (WebCore::AXTimeFieldText):
2923
2924 2016-10-16  Chris Dumez  <cdumez@apple.com>
2925
2926         Update WebKit localizable strings
2927         https://bugs.webkit.org/show_bug.cgi?id=163513
2928
2929         Reviewed by Dan Bernstein.
2930
2931         Update WebKit localizable strings as it was missing the "too short" one needed
2932         by form validation. This was causing a "Localized string not found" message to
2933         be shown when testing the following sample on WebKit ToT:
2934         - https://googlechrome.github.io/samples/report-validity/
2935
2936         * English.lproj/Localizable.strings:
2937
2938 2016-10-16  Chris Dumez  <cdumez@apple.com>
2939
2940         REGRESSION (r206750): Crash when pressing Caps Lock if “Use the Caps Lock key to switch to and from U.S.” is selected in Input Sources preferences
2941         https://bugs.webkit.org/show_bug.cgi?id=163506
2942         <rdar://problem/28792483>
2943
2944         Reviewed by Darin Adler.
2945
2946         As per the NSEvent documentation [1], calling [NSEvent characters] is only
2947         valid on key up / key down events and will raise an NSInternalInconsistencyException
2948         if accessed on any other kind of event object. The crash happens when keyForKeyEvent()
2949         is called with the third kind of key event (NSFlagsChanged) which is used for
2950         detecting modifier keys. We normally detect the modifier key and return early before
2951         calling [NSEvent characters]. However, in some rare cases, we fail to detect the
2952         modifier key and we fall through.
2953
2954         To address the issue, we now return "Unidentified" for NSFlagsChanged events, if we
2955         fail to detect the modifier key and before calling [NSEvent characters].
2956
2957         [1] https://developer.apple.com/reference/appkit/nsevent/1534183-characters
2958
2959         No new test, not easily testable.
2960
2961         * platform/mac/PlatformEventFactoryMac.mm:
2962         (WebCore::keyForKeyEvent):
2963
2964 2016-10-16  Darin Adler  <darin@apple.com>
2965
2966         Move CSS classes from ExceptionCode to Exception
2967         https://bugs.webkit.org/show_bug.cgi?id=163494
2968
2969         Reviewed by Sam Weinig.
2970
2971         Removed the "get" prefix from the names of many CSSPrimitiveValue
2972         functions to match WebKit coding style and to disambiguate them
2973         from the public CSS DOM functions that raise exceptions.
2974
2975         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
2976         (WebCore::propertyNamePrefix): Use enum class.
2977         (WebCore::parseJavaScriptCSSPropertyName): Tweak style a bit.
2978         (WebCore::stylePropertyGetter): Refactor to simplify structure.
2979         (WebCore::stylePropertyGetterPixelOrPosPrefix): Ditto. Also use floatValue.
2980         (WebCore::JSCSSStyleDeclaration::putDelegate): Use findIgnoringASCIICase,
2981         and use propagateException to handle ExcpetionOr.
2982         (WebCore::JSCSSStyleDeclaration::getPropertyCSSValue): Tweak style a bit.
2983         (WebCore::JSCSSStyleDeclaration::getOwnPropertyNames): Use a lambda to
2984         initialize a global here.
2985
2986         * bindings/js/JSDOMBinding.h: Added toJSString to support bindings for
2987         functions returning ExceptionOr<String>.
2988
2989         * bindings/scripts/gobject-generate-headers.pl: Deleted.
2990
2991         * css/BasicShapeFunctions.cpp:
2992         (WebCore::convertToLengthSize): Use pairValue.
2993         (WebCore::convertToCenterCoordinate): Use valueID and pairValue.
2994         (WebCore::cssValueToBasicShapeRadius): Ditto.
2995         * css/CSSBasicShapes.cpp:
2996         (WebCore::serializePositionOffset): Ditto.
2997         (WebCore::buildSerializablePositionOffset): Ditto.
2998         (WebCore::CSSBasicShapeCircle::cssText): Ditto.
2999         (WebCore::CSSBasicShapeEllipse::cssText): Ditto.
3000         (WebCore::updateCornerRadiusWidthAndHeight): Ditto.
3001         * css/CSSBorderImageSliceValue.h: Use quadValue.
3002         * css/CSSCalculationValue.cpp:
3003         (WebCore::determineCategory): Use floatValue and doubleValue.
3004
3005         * css/CSSCharsetRule.h: Use ExceptionOr. Also made more things private.
3006         * css/CSSCharsetRule.idl: Use non-legacy exceptions.
3007
3008         * css/CSSComputedStyleDeclaration.cpp:
3009         (WebCore::CSSComputedStyleDeclaration::setCssText): Use ExceptionOr.
3010         (WebCore::ComputedStyleExtractor::propertyMatches): Use valueID.
3011         (WebCore::CSSComputedStyleDeclaration::setProperty): Use ExceptionOr.
3012         (WebCore::CSSComputedStyleDeclaration::removeProperty): Ditto.
3013         (WebCore::CSSComputedStyleDeclaration::setPropertyInternal): Ditto.
3014         (WebCore::ComputedStyleExtractor::getBackgroundShorthandValue): Return
3015         a Ref instead of a RefPtr.
3016         * css/CSSComputedStyleDeclaration.h: Updated for above changes.
3017
3018         * css/CSSCrossfadeValue.cpp:
3019         (WebCore::CSSCrossfadeValue::fixedSize): Use floatValue.
3020         (WebCore::CSSCrossfadeValue::image): Ditto.
3021         (WebCore::CSSCrossfadeValue::blend): Use doubleValue.
3022
3023         * css/CSSFontFace.cpp:
3024         (WebCore::CSSFontFace::calculateStyleMask): Use valueID.
3025         (WebCore::CSSFontFace::calculateWeightMask): Ditto.
3026         * css/CSSFontFaceSet.cpp:
3027         (WebCore::CSSFontFaceSet::familyNameFromPrimitive): Ditto.
3028         (WebCore::CSSFontFaceSet::matchingFaces): Use ExceptoinOr.
3029         (WebCore::CSSFontFaceSet::check): Ditto.
3030         * css/CSSFontFaceSet.h: Updated for above changes.
3031
3032         * css/CSSGradientValue.cpp:
3033         (WebCore::compareStops): Use doubleValue.
3034         (WebCore::CSSGradientValue::addStops): Use floatValue.
3035         (WebCore::positionFromValue): Use floatValue and valudID.
3036         (WebCore::CSSLinearGradientValue::customCSSText): Use doubleValue and valueID.
3037         (WebCore::CSSLinearGradientValue::createGradient): Use floatValue and valueID.
3038         (WebCore::CSSRadialGradientValue::customCSSText): Use doubleValue and valueID.
3039         (WebCore::CSSRadialGradientValue::resolveRadius): Use floatValue.
3040         (WebCore::CSSRadialGradientValue::createGradient): Use valueID.
3041
3042         * css/CSSGroupingRule.cpp:
3043         (WebCore::CSSGroupingRule::insertRule): Use ExceptionOr.
3044         (WebCore::CSSGroupingRule::deleteRule): Ditto.
3045         * css/CSSGroupingRule.h: Updated for above changes.
3046
3047         * css/CSSImageGeneratorValue.cpp:
3048         (WebCore::CSSImageGeneratorValue::subimageIsPending): Use valueID.
3049         (WebCore::CSSImageGeneratorValue::cachedImageForCSSValue): Ditto.
3050
3051         * css/CSSImageSetValue.cpp:
3052         (WebCore::CSSImageSetValue::fillImageSet): Use floatValue.
3053
3054         * css/CSSMediaRule.idl: Use non-legacy exceptions.
3055
3056         * css/CSSPrimitiveValue.cpp:
3057         (WebCore::CSSPrimitiveValue::computeDegrees): Use doubleValue.
3058         (WebCore::CSSPrimitiveValue::setFloatValue): Use ExceptionOr.
3059         (WebCore::CSSPrimitiveValue::getFloatValue): Replaced getDoubleValue with this,
3060         since getDoubleValue is unused, moving the call to clampTo into this function.
3061         Also changed this to use ExceptionOr.
3062         (WebCore::CSSPrimitiveValue::doubleValue): Renamed from getDoubleValue.
3063         (WebCore::CSSPrimitiveValue::doubleValueInternal): Use Optional instead of a bool
3064         and an out argument to return the value and check for type failure.
3065         (WebCore::CSSPrimitiveValue::setStringValue): Use ExceptionOr.
3066         (WebCore::CSSPrimitiveValue::getStringValue): Ditto.
3067         (WebCore::CSSPrimitiveValue::stringValue): Renamed from getStringValue.
3068         (WebCore::CSSPrimitiveValue::getCounterValue): Use ExceptionOr.
3069         (WebCore::CSSPrimitiveValue::getRectValue): Use ExceptionOr.
3070         (WebCore::CSSPrimitiveValue::getQuadValue): Deleted.
3071         (WebCore::CSSPrimitiveValue::getLengthRepeatValue): Deleted.
3072         (WebCore::CSSPrimitiveValue::getRGBColorValue): Use ExceptionOr.
3073         (WebCore::CSSPrimitiveValue::getPairValue): Deleted.
3074         (WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText): Use new names for functions.
3075         * css/CSSPrimitiveValue.h: Reorganized the class, moved large inline function bodies
3076         out of the class definition. Updated for the above changes.
3077         * css/CSSPrimitiveValue.idl: Use non-legacy exceptions.
3078
3079         * css/CSSPrimitiveValueMappings.h: Use value instead of getValue, etc.
3080
3081         * css/CSSRule.cpp:
3082         (WebCore::CSSRule::setCssText): Use ExceptionOr.
3083         * css/CSSRule.h: Updated for above change.
3084         * css/CSSRule.idl: Use non-legacy exceptions.
3085
3086         * css/CSSStyleDeclaration.h: Use ExceptionOr.
3087         * css/CSSStyleDeclaration.idl: Use non-legacy exceptions.
3088
3089         * css/CSSStyleSheet.cpp:
3090         (WebCore::CSSStyleSheet::deprecatedInsertRule): Use ExceptionOr.
3091         (WebCore::CSSStyleSheet::insertRule): Ditto.
3092         (WebCore::CSSStyleSheet::deleteRule): Ditto.
3093         (WebCore::CSSStyleSheet::addRule): Ditto.
3094         * css/CSSStyleSheet.h: Updated for the above changes.
3095         * css/CSSStyleSheet.idl: Use non-legacy exceptions.
3096
3097         * css/CSSSupportsRule.idl: Use non-legacy exceptions.
3098
3099         * css/CSSToStyleMap.cpp:
3100         (WebCore::CSSToStyleMap::mapFillAttachment): Use valueID instead of getValueID, etc.
3101         (WebCore::convertToLengthSize): Ditto.
3102         (WebCore::CSSToStyleMap::mapFillSize): Ditto.
3103         (WebCore::CSSToStyleMap::mapFillXPosition): Ditto.
3104         (WebCore::CSSToStyleMap::mapFillYPosition): Ditto.
3105         (WebCore::CSSToStyleMap::mapFillMaskSourceType): Ditto.
3106         (WebCore::CSSToStyleMap::mapAnimationDirection): Ditto.
3107         (WebCore::CSSToStyleMap::mapAnimationFillMode): Ditto.
3108         (WebCore::CSSToStyleMap::mapAnimationIterationCount): Ditto.
3109         (WebCore::CSSToStyleMap::mapAnimationName): Ditto.
3110         (WebCore::CSSToStyleMap::mapAnimationPlayState): Ditto.
3111         (WebCore::CSSToStyleMap::mapAnimationProperty): Ditto.
3112         (WebCore::CSSToStyleMap::mapAnimationTimingFunction): Ditto.
3113         (WebCore::CSSToStyleMap::mapAnimationTrigger): Ditto.
3114         (WebCore::CSSToStyleMap::mapNinePieceImageSlice): Ditto.
3115         (WebCore::CSSToStyleMap::mapNinePieceImageQuad): Ditto.
3116         (WebCore::CSSToStyleMap::mapNinePieceImageRepeat): Ditto.
3117
3118         * css/CSSValue.h: Use ExceptionOr.
3119         * css/CSSValue.idl: Use non-legacy exceptions.
3120
3121         * css/Counter.h: Use stringValue instead of getStringValue, etc.
3122
3123         * css/FontFace.cpp:
3124         (WebCore::FontFace::create): Use ExceptionOr.
3125         (WebCore::FontFace::setFamily): Ditto.
3126         (WebCore::FontFace::setStyle): Ditto.
3127         (WebCore::FontFace::setWeight): Ditto.
3128         (WebCore::FontFace::setStretch): Ditto.
3129         (WebCore::FontFace::setUnicodeRange): Ditto.
3130         (WebCore::FontFace::setVariant): Ditto.
3131         (WebCore::FontFace::setFeatureSettings): Ditto.
3132         * css/FontFace.h: Updated for above changes.
3133         * css/FontFace.idl: Use non-legacy exceptions.
3134
3135         * css/FontFaceSet.cpp:
3136         (WebCore::FontFaceSet::load): Use ExceptionOr.
3137         (WebCore::FontFaceSet::check): Ditto.
3138         * css/FontFaceSet.h: Updated for above changes.
3139         * css/FontFaceSet.idl: Use non-legacy exceptions.
3140
3141         * css/FontVariantBuilder.cpp:
3142         (WebCore::extractFontVariantLigatures): Use valueID instead of getValueID, etc.
3143         (WebCore::extractFontVariantNumeric): Ditto.
3144         (WebCore::extractFontVariantEastAsian): Ditto.
3145
3146         * css/MediaList.cpp:
3147         (WebCore::MediaList::setMediaText): Use ExceptionOr.
3148         (WebCore::MediaList::deleteMedium): Ditto.
3149         (WebCore::MediaList::appendMedium): Ditto.
3150         * css/MediaList.h: Updated for above changes.
3151         * css/MediaList.idl: Use non-legacy exceptions.
3152
3153         * css/MediaQueryEvaluator.cpp:
3154         (WebCore::doubleValue): Use valueID instead of getValueID, etc.
3155         (WebCore::colorGamutEvaluate): Ditto.
3156         (WebCore::invertedColorsEvaluate): Ditto.
3157         (WebCore::orientationEvaluate): Ditto.
3158         (WebCore::evaluateResolution): Ditto.
3159         (WebCore::computeLength): Ditto.
3160         (WebCore::viewModeEvaluate): Ditto.
3161         (WebCore::hoverEvaluate): Ditto.
3162         (WebCore::pointerEvaluate): Ditto.
3163         (WebCore::prefersReducedMotionEvaluate): Ditto.
3164
3165         * css/PropertySetCSSStyleDeclaration.cpp:
3166         (WebCore::PropertySetCSSStyleDeclaration::setCssText): Use ExceptionOr.
3167         (WebCore::PropertySetCSSStyleDeclaration::setProperty): Ditto.
3168         (WebCore::PropertySetCSSStyleDeclaration::removeProperty): Ditto.
3169         (WebCore::PropertySetCSSStyleDeclaration::getPropertyCSSValueInternal): Ditto.
3170         (WebCore::PropertySetCSSStyleDeclaration::setPropertyInternal): Ditto.
3171         * css/PropertySetCSSStyleDeclaration.h: Updated for above changes.
3172         Also marked a couple additional functions private.
3173
3174         * css/StyleBuilderConverter.h: Use doubleValue instead of getDoubleValue, etc.
3175         * css/StyleBuilderCustom.h: Ditto.
3176         * css/StyleProperties.cpp:
3177         (WebCore::StyleProperties::getLayeredShorthandValue): Ditto.
3178         * css/StyleResolver.cpp:
3179         (WebCore::StyleResolver::MatchResult::addMatchedProperties): Ditto.
3180         (WebCore::StyleResolver::colorFromPrimitiveValueIsDerivedFromElement): Ditto.
3181         (WebCore::StyleResolver::colorFromPrimitiveValue): Ditto.
3182         (WebCore::StyleResolver::createFilterOperations): Ditto.
3183         * css/TransformFunctions.cpp:
3184         (WebCore::transformsForValue): Ditto.
3185         * css/ViewportStyleResolver.cpp:
3186         (WebCore::ViewportStyleResolver::getViewportArgumentValue): Ditto.
3187
3188         * css/WebKitCSSMatrix.cpp:
3189         (WebCore::WebKitCSSMatrix::WebKitCSSMatrix): Tweaked constructors a bit,
3190         getting rid of the one that uses an ExceptionCode.
3191         (WebCore::WebKitCSSMatrix::create): Moved in here, and use ExceptionOr.
3192         (WebCore::WebKitCSSMatrix::setMatrixValue): Use ExceptionOr.
3193         (WebCore::WebKitCSSMatrix::multiply): Tweak coding style a bit.
3194         (WebCore::WebKitCSSMatrix::inverse): Use ExceptionOr.
3195         (WebCore::WebKitCSSMatrix::translate): Return a Ref instead of RefPtr.
3196         (WebCore::WebKitCSSMatrix::scale): Ditto.
3197         (WebCore::WebKitCSSMatrix::rotate): Ditto.
3198         (WebCore::WebKitCSSMatrix::rotateAxisAngle): Ditto.
3199         (WebCore::WebKitCSSMatrix::skewX): Ditto.
3200         (WebCore::WebKitCSSMatrix::skewY): Ditto.
3201         (WebCore::WebKitCSSMatrix::toString): Tweaked formatting a bit.
3202         * css/WebKitCSSMatrix.h: Updated for above changes.
3203         * css/WebKitCSSMatrix.idl: Use non-legacy extensions.
3204
3205         * css/makeprop.pl:
3206         (handleCurrentColorValue): Use valueID instead of getValueID.
3207         (generateValueSetter): Ditto.
3208
3209         * css/parser/CSSParser.cpp:
3210         (WebCore::CSSParser::parse4ValuesFillPosition): Use valueID instead of getValueID, etc.
3211         (WebCore::CSSParser::parse3ValuesFillPosition): Ditto.
3212         (WebCore::CSSParser::parseFillPosition): Ditto.
3213         (WebCore::CSSParser::parseFillRepeat): Ditto.
3214         (WebCore::CSSParser::parseGridPosition): Ditto.
3215         (WebCore::CSSParser::parseGridTemplateRowsAndAreasAndColumns): Ditto.
3216         (WebCore::isGridTrackFixedSized): Ditto.
3217         (WebCore::CSSParser::parseRadialGradient): Ditto.
3218         (WebCore::CSSParser::parseBuiltinFilterArguments): Ditto.
3219
3220         * css/parser/CSSParserValues.cpp:
3221         (WebCore::CSSParserValue::createCSSValue): Removed the unneeded call to
3222         setPrimitiveType here. The createParserOperator returns an object that
3223         already has the correct primitive type.
3224
3225         * css/parser/CSSPropertyParser.cpp: Updated most cases of calling the old
3226         getXXXValue functions, but not sure if it's right since it is commented out
3227         code that I did not compile.
3228
3229         * css/parser/CSSPropertyParserHelpers.cpp:
3230         (WebCore::CSSPropertyParserHelpers::clampRGBComponent): Use intValue instead of getIntValue, etc.
3231         (WebCore::CSSPropertyParserHelpers::parseHSLParameters): Ditto.
3232         (WebCore::CSSPropertyParserHelpers::isHorizontalPositionKeywordOnly): Ditto.
3233         (WebCore::CSSPropertyParserHelpers::isVerticalPositionKeywordOnly): Ditto.
3234         (WebCore::CSSPropertyParserHelpers::positionFromThreeOrFourValues): Ditto.
3235         (WebCore::CSSPropertyParserHelpers::consumeRadialGradient): Ditto.
3236
3237         * dom/Range.cpp: Added now-needed include of ExceptionCode.h.
3238         * dom/SelectorQuery.cpp: Ditto.
3239
3240         * editing/ApplyStyleCommand.cpp:
3241         (WebCore::toIdentifier): Use valueID instead of getValueID, etc.
3242         (WebCore::ApplyStyleCommand::computedFontSize): Ditto.
3243         * editing/EditingStyle.cpp:
3244         (WebCore::identifierForStyleProperty): Ditto.
3245         (WebCore::HTMLElementEquivalent::valueIsPresentInStyle): Ditto.
3246         (WebCore::EditingStyle::extractFontSizeDelta): Ditto.
3247         (WebCore::EditingStyle::textDirection): Ditto.
3248         (WebCore::EditingStyle::prepareToApplyAt): Ditto.
3249         (WebCore::EditingStyle::textDirectionForSelection): Ditto.
3250         (WebCore::fontWeightIsBold): Ditto.
3251         (WebCore::legacyFontSizeFromCSSValue): Ditto.
3252         (WebCore::isTransparentColorValue): Ditto.
3253         (WebCore::hasTransparentBackgroundColor): Ditto.
3254         (WebCore::backgroundColorInEffect): Ditto.
3255
3256         * editing/Editor.cpp:
3257         (WebCore::Editor::applyEditingStyleToElement): Removed IGNORE_EXCEPTION; that is
3258         what we do by default for things returning ExceptionOr.
3259         * editing/RemoveCSSPropertyCommand.cpp:
3260         (WebCore::RemoveCSSPropertyCommand::doApply): Ditto.
3261         (WebCore::RemoveCSSPropertyCommand::doUnapply): Ditto.
3262         * editing/ReplaceSelectionCommand.cpp:
3263         (WebCore::ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline): Ditto.
3264
3265         * editing/cocoa/HTMLConverter.mm:
3266         (floatValueFromPrimitiveValue): Use floatValue instead of getFloatValue, etc.
3267         * editing/markup.cpp:
3268         (WebCore::propertyMissingOrEqualToNone): Ditto.
3269
3270         * inspector/InspectorStyleSheet.cpp:
3271         (WebCore::InspectorStyleSheet::addRule): Updated to call ExceptionOr-returning functions.
3272         (WebCore::InspectorStyleSheet::deleteRule): Ditto.
3273         (WebCore::InspectorStyleSheet::setStyleText): Ditto.
3274
3275         * svg/SVGLength.cpp:
3276         (WebCore::SVGLength::fromCSSPrimitiveValue): Use floatValue instead of getFloatValue.
3277
3278 2016-10-16  Antoine Quint  <graouts@apple.com>
3279
3280         [Modern Media Controls] Styles for StartButton are missing
3281         https://bugs.webkit.org/show_bug.cgi?id=163499
3282         <rdar://problem/28792009>
3283
3284         Reviewed by Darin Adler.
3285
3286         Add styling for StartButton so that instances are always displayed in the center of their container.
3287
3288         Test: media/modern-media-controls/start-button/start-button-styles.html
3289
3290         * Modules/modern-media-controls/controls/start-button.css: Added.
3291         (button.start):
3292         (button.start > *):
3293         (button.start > div):
3294         (button.start > img):
3295         (button.start:active > img):
3296
3297 2016-10-16  Simon Fraser  <simon.fraser@apple.com>
3298
3299         Implement serializer = { attribute }
3300         https://bugs.webkit.org/show_bug.cgi?id=163466
3301         
3302         Follow-up fix to die if "serializer {...}" lists an attribute not present
3303         on the interface. I don't think this is testable with the current bindings tests.
3304
3305         * bindings/scripts/CodeGeneratorJS.pm:
3306         (GenerateSerializerFunction):
3307
3308 2016-10-16  Simon Fraser  <simon.fraser@apple.com>
3309
3310         Add the "Geometry Interfaces" to features.json.
3311
3312         * features.json:
3313
3314 2016-10-16  Carlos Garcia Campos  <cgarcia@igalia.com>
3315
3316         Document request not updated after willSendRequest is called for a redirect
3317         https://bugs.webkit.org/show_bug.cgi?id=163436
3318
3319         Reviewed by Michael Catanzaro.
3320
3321         The first willSendRequest happens before DocumentLoader::startLoadingMainResource(), that calls setRequest, but
3322         the second one happens after DocumentLoader::redirectReceived() and then the request is never updated again.
3323
3324         Covered by GTK+ unit tests.
3325
3326         * loader/DocumentLoader.cpp:
3327         (WebCore::DocumentLoader::willContinueMainResourceLoadAfterRedirect): Set the new request.
3328         * loader/DocumentLoader.h:
3329         * loader/SubresourceLoader.cpp:
3330         (WebCore::SubresourceLoader::willSendRequestInternal): Notify the document loader when loading the main resource
3331         and called for a redirection.
3332
3333 2016-10-15  Said Abou-Hallawa  <sabouhallawa@apple.com>
3334
3335         Delete the animated image catchup code
3336         https://bugs.webkit.org/show_bug.cgi?id=163410
3337
3338         Reviewed by Simon Fraser.
3339
3340         This patch fixes two issues in the animated image workflow:
3341
3342         1) Setting the animation timer should follow the following rules:
3343         
3344             -- Initial case: Which happens before drawing the first frame. We
3345             should set the timer to fire after the current_frame_duration.
3346
3347             -- Late case (Slow animation): This happens if the current_time is
3348             past the next_frame_desired_time. In this case we should fire the
3349             timer immediately.
3350
3351             -- Early case (Fast animation): This happens when there is still time
3352             before the next_frame_desired_time. In this case we should set the
3353             timer to fire after the difference between the next_frame_desired_time
3354             and the current_time.
3355
3356         2) Deleting the code for catching up the current_frame:
3357         
3358             This code used to run in the slow animation case. It was never used
3359             on iOS. It was trying to adjust the current_frame according to the
3360             current_time as if there were no delay. It turned out that this might
3361             cause a bigger delay because most likely the decoder decodes the image
3362             frames incrementally; i.e. to decode frame k, it has to have frame
3363             (k - 1) decoded.
3364
3365         Test: fast/images/ordered-animated-image-frames.html
3366
3367         * platform/graphics/BitmapImage.cpp:
3368         (WebCore::BitmapImage::draw): Remove the iOS specific code.
3369         (WebCore::BitmapImage::startAnimation): Move the animation finishing code from 
3370         BitmapImage::internalAdvanceAnimation() to this function. Simplify the timer
3371         duration code as it is described above.
3372
3373         (WebCore::BitmapImage::advanceAnimation): Merge BitmapImage::internalAdvanceAnimation()
3374         into this function.
3375
3376         (WebCore::BitmapImage::resetAnimation):
3377         
3378         (WebCore::BitmapImage::internalAdvanceAnimation): Deleted.
3379         * platform/graphics/BitmapImage.h:
3380
3381         * platform/graphics/Image.cpp:
3382         (WebCore::Image::drawTiled):
3383         * platform/graphics/Image.h:
3384         (WebCore::Image::startAnimation):
3385         * svg/graphics/SVGImage.cpp:
3386         (WebCore::SVGImage::startAnimation):
3387         * svg/graphics/SVGImage.h:
3388         Remove the catchup code form the Image and SVGImage classes.
3389
3390 2016-10-15  Darin Adler  <darin@apple.com>
3391
3392         Move Web SQL database and WebSockets off legacy exceptions
3393         https://bugs.webkit.org/show_bug.cgi?id=163284
3394
3395         Reviewed by Chris Dumez.
3396
3397         * Modules/webdatabase/DOMWindowWebDatabase.cpp:
3398         (WebCore::DOMWindowWebDatabase::openDatabase): Use ExceptionOr.
3399         * Modules/webdatabase/DOMWindowWebDatabase.h: Update for above.
3400         * Modules/webdatabase/DOMWindowWebDatabase.idl: Ditto.
3401
3402         * Modules/webdatabase/SQLResultSet.cpp:
3403         (WebCore::SQLResultSet::SQLResultSet): Move initialization of
3404         many data members into the class definition.
3405         (WebCore::SQLResultSet::insertId): Use ExceptionOr.
3406         (WebCore::SQLResultSet::rowsAffected): Moved into class definition.
3407         (WebCore::SQLResultSet::rows): Ditto.
3408         (WebCore::SQLResultSet::setInsertId): Ditto.
3409         (WebCore::SQLResultSet::setRowsAffected): Ditto.
3410
3411         * Modules/webdatabase/SQLResultSet.h: Updated for above.
3412
3413         * Modules/webdatabase/SQLResultSet.idl: Use non-legacy exceptions.
3414         Added a FIXME about the mismatch between long and int64_t.
3415
3416         * Modules/webdatabase/SQLStatement.cpp:
3417         (WebCore::SQLStatement::execute): Use reference instead of pointer.
3418
3419         * Modules/websockets/WebSocket.cpp:
3420         (WebCore::isValidProtocolString): Use StringView.
3421         (WebCore::WebSocket::subprotocolSeparator): Fixed capitalization and
3422         spelling error in the name of this function.
3423         (WebCore::WebSocket::WebSocket): Move initialization of many data
3424         members into the class definition.
3425         (WebCore::WebSocket::create): Use ExceptionOr.
3426         (WebCore::WebSocket::connect): Ditto.
3427         (WebCore::WebSocket::send): Ditto.
3428         (WebCore::WebSocket::close): Ditto.
3429         (WebCore::WebSocket::binaryType): Update to use enum class.
3430         (WebCore::WebSocket::setBinaryType): Use ExecptionOr and update to
3431         use enum class.
3432         (WebCore::WebSocket::didReceiveBinaryData): Ditto.
3433
3434         * Modules/websockets/WebSocket.h: Updated for above. Changed the
3435         BinaryType enum into an enum class.
3436
3437         * Modules/websockets/WebSocket.idl: Use non-legacy exceptions.
3438
3439         * Modules/websockets/WebSocketHandshake.cpp:
3440         (WebCore::WebSocketHandshake::checkResponseHeaders):
3441         Updated for name change to subprotocolSeparator.
3442
3443         * dom/ExceptionOr.h: Added a constructor for scalar types that does not
3444         require an rvalue reference. We can refine this more later, but for now
3445         this is sufficient to obviate the need for WTFMove where it otherwise would
3446         have been needed in the code above.
3447
3448         * inspector/InspectorDatabaseAgent.cpp: Use reference instead of pointer.
3449
3450         * page/DOMWindow.idl: Touched this file to work around bugs in the dependency
3451         analysis of the current CMake build system, since otherwise it doesn't process the
3452         change to the partial interface WebSocket. Edited lots of comments, removed many
3453         others, and tweaked formatting.
3454
3455 2016-10-14  Sam Weinig  <sam@webkit.org>
3456
3457         MessageEvent's source property should be a (DOMWindow or MessagePort)? rather than a EventTarget?
3458         https://bugs.webkit.org/show_bug.cgi?id=163475
3459
3460         Reviewed by Simon Fraser.
3461
3462         Start fleshing out union support, starting with MessageEvent.
3463         - Simplify things a bit for now by requiring interface types to use RefPtr<T> as their type when
3464           used in sequences and unions. We should revisit this later, and see if we can use Ref<T> where
3465           possible, but it causes complications for dictionaries, since they want a Ref<T> uninitialized.
3466
3467         * bindings/generic/IDLTypes.h:
3468         Switch IDLInterface to use RefPtr<T> as its implementation type.
3469
3470         * bindings/js/JSDOMConvert.h:
3471         (WebCore::Detail::VariadicConverterBase::convert):
3472         - Remove isJSDOMWrapperType() optimization. It was not correct, due to not being able to detect window
3473           and window shell, and not always an optimization, e.g. in the case of a single interface.
3474         - Switch from JSC::jsDynamicCast<WrapperType*>() to WrapperType::toWrapped() which can be faster and
3475           handles window and window shell correctly.
3476         - Also fix an issue where we would wrongly assert that one interface had to match.
3477
3478         * bindings/js/JSDOMWrapper.h:
3479         (WebCore::isJSDOMWrapperType): Deleted.
3480         Remove unused predicate.
3481
3482         * bindings/scripts/IDLParser.pm:
3483         (parseType):
3484         Add missing support for nullable unions.
3485
3486         * bindings/scripts/test/JS/JSTestObj.cpp:
3487         * bindings/scripts/test/TestObj.idl:
3488         Add new tests for unions (both non-null and nullable) in dictionaries.
3489  
3490         * dom/ContainerNode.cpp:
3491         (WebCore::ContainerNode::append):
3492         (WebCore::ContainerNode::prepend):
3493         * dom/ContainerNode.h:
3494         * dom/Node.cpp:
3495         (WebCore::nodeSetPreTransformedFromNodeOrStringVector):
3496         (WebCore::Node::convertNodesOrStringsIntoNode):
3497         (WebCore::Node::before):
3498         (WebCore::Node::after):
3499         (WebCore::Node::replaceWith):
3500         * dom/Node.h:
3501         Add using declaration for NodeOrString and change it to use RefPtr<Node>.
3502
3503         * bindings/js/JSMessageEventCustom.cpp:
3504         (WebCore::handleInitMessageEvent):
3505         * dom/MessageEvent.cpp:
3506         (WebCore::MessageEvent::MessageEvent):
3507         (WebCore::MessageEvent::create):
3508         (WebCore::MessageEvent::initMessageEvent):
3509         (WebCore::MessageEvent::source):
3510         (WebCore::isValidSource): Deleted.
3511         * dom/MessageEvent.h:
3512         * dom/MessageEvent.idl:
3513         * page/DOMWindow.cpp:
3514         (WebCore::PostMessageTimer::event):
3515         Change MessageEvent's source to be a std::experimental::variant<RefPtr<DOMWindow>, RefPtr<MessagePort>>.
3516         For now, we only enforce this on setting, and leave the getter a EventTarget?, but that should not be
3517         observable, and will rectified in subsequent patches.
3518
3519 2016-10-15  Chris Dumez  <cdumez@apple.com>
3520
3521         Add support for reportValidity() on form and form control elements
3522         https://bugs.webkit.org/show_bug.cgi?id=163479
3523
3524         Reviewed by Darin Adler.
3525
3526         Add support for reportValidity() on form and form control elements:
3527         - https://html.spec.whatwg.org/#dom-form-reportvalidity
3528         - https://html.spec.whatwg.org/#dom-cva-reportvalidity
3529
3530         Firefox and Chrome already support this.
3531
3532         Demo: https://googlechrome.github.io/samples/report-validity/
3533
3534         No new tests, rebaselined existing tests.
3535
3536         * html/HTMLButtonElement.idl:
3537         * html/HTMLFieldSetElement.idl:
3538         * html/HTMLFormElement.idl:
3539         * html/HTMLInputElement.idl:
3540         * html/HTMLKeygenElement.idl:
3541         * html/HTMLObjectElement.idl:
3542         * html/HTMLOutputElement.idl:
3543         * html/HTMLSelectElement.idl:
3544         * html/HTMLTextAreaElement.idl:
3545         Add reportValidity() operation.
3546
3547         * html/HTMLFormControlElement.cpp:
3548         (WebCore::HTMLFormControlElement::checkValidity):
3549
3550         (WebCore::HTMLFormControlElement::reportValidity):
3551         Add implementation for reportValidity() for form control elements.
3552         First, it calls checkValidity() and returns early if there is no
3553         constraint violation. if the JS canceled the 'invalid' event
3554         fired by checkValidity(), then return early as well, as per the
3555         specification. If the element is focusable, we scroll to it,
3556         focus it and show the validation message. Otherwise, we log a
3557         error message to the console. The last part of the behavior
3558         matches what we already did in HTMLFormElement::validateInteractively()
3559         and complies with the behavior in the specification.
3560
3561         (WebCore::HTMLFormControlElement::focusAndShowValidationMessage):
3562         Add utility function to scroll to the form control element, focus
3563         it and show its validation message. This code was moved from
3564         HTMLFormElement::validateInteractively() so that it could be reused
3565         in HTMLFormControlElement::reportValidity().
3566
3567         * html/HTMLFormControlElement.h:
3568         * html/HTMLFormElement.cpp:
3569         (WebCore::HTMLFormElement::validateInteractively):
3570         Move the early abort checks to the existing call site (prepareForSubmission)
3571         so that we can reuse this method for reportValidity().
3572
3573         (WebCore::HTMLFormElement::prepareForSubmission):
3574         Only call validateInteractively() if we really should validate. Those checks
3575         used to be in validateInteractively() but I moved them here so we could more
3576         easily reuse validateInteractively().
3577
3578         (WebCore::HTMLFormElement::checkValidity):
3579         (WebCore::HTMLFormElement::checkInvalidControlsAndCollectUnhandled):
3580         Update Vector type to be a Vector of HTMLFormControlElement given that we
3581         only add HTMLFormControlElement objects to it and that it results it simpler
3582         code.
3583
3584         (WebCore::HTMLFormElement::reportValidity):
3585         Add implementation for reportValidity() for form elements. The
3586         implementation calls our already existing validateInteractively()
3587         method, as per the specification.
3588
3589         * html/HTMLFormElement.h:
3590
3591         * html/HTMLObjectElement.h:
3592         reportValidity() returns true unconditionally for object elements,
3593         similarly to checkValidity().
3594
3595 2016-10-15  Simon Fraser  <simon.fraser@apple.com>
3596
3597         Sort the project file.
3598
3599         * WebCore.xcodeproj/project.pbxproj:
3600
3601 2016-10-15  Simon Fraser  <simon.fraser@apple.com>
3602
3603         Implement serializer = { attribute }
3604         https://bugs.webkit.org/show_bug.cgi?id=163466
3605
3606         Reviewed by Darin Adler.
3607
3608         Fix the code generator to generate code for serializer = { attribute }.
3609         In IDLParser, extend domSerializable with flags for the 'inherit', 'getter' and
3610         'attribute' values (the first two are still unsupported). Fix parseSerializationPattern()
3611         to detect these; it needs to create the domSerializable() now. Basic support
3612         for isSerializableAttribute() is added (primitive types only).
3613         
3614         GenerateSerializerFunction is fixed to output code for the serializable attributes
3615         in the order specified in "serializer = {}", as specified in WebIDL.
3616         
3617         Removed custom serialization for ClientRect and PerformanceTiming.
3618         
3619         Other minor cleanup to always get $interfaceName from $interface->name, and to fix
3620         ObjectConstructor.h to be included as <runtime/ObjectConstructor.h>.
3621
3622         * CMakeLists.txt:
3623         * WebCore.xcodeproj/project.pbxproj:
3624         * bindings/js/JSBindingsAllInOne.cpp:
3625         * bindings/js/JSClientRectCustom.cpp: Removed.
3626         * bindings/js/JSPerformanceTimingCustom.cpp: Removed.
3627         * bindings/scripts/CodeGeneratorJS.pm:
3628         (GenerateImplementation):
3629         (GenerateSerializerFunction):
3630         * bindings/scripts/IDLParser.pm:
3631         (parseSerializerRest):
3632         (parseSerializationPattern):
3633         (parseSerializationAttributes):
3634         (isSerializableAttribute):
3635         (applyMemberList):
3636         * bindings/scripts/test/JS/JSTestNode.cpp:
3637         * bindings/scripts/test/JS/JSTestObj.cpp:
3638         (WebCore::jsTestObjPrototypeFunctionToJSONCaller):
3639         * bindings/scripts/test/JS/JSTestSerialization.cpp: Added.
3640         * bindings/scripts/test/JS/JSTestSerialization.h: Added.
3641         * bindings/scripts/test/TestObj.idl:
3642         * bindings/scripts/test/TestSerialization.idl: Copied from Source/WebCore/dom/ClientRect.idl.
3643         * dom/ClientRect.idl:
3644         * page/PerformanceTiming.idl:
3645
3646 2016-10-15  Michael Catanzaro  <mcatanzaro@igalia.com>
3647
3648         [GTK] Restore user agent quirk for Yahoo
3649         https://bugs.webkit.org/show_bug.cgi?id=163481
3650
3651         Reviewed by Carlos Garcia Campos.
3652
3653         finance.yahoo.com is sending a mobile version in response to our standard user agent.
3654
3655         * platform/gtk/UserAgentGtk.cpp:
3656         (WebCore::urlRequiresMacintoshPlatform):
3657
3658 2016-10-15  Chris Dumez  <cdumez@apple.com>
3659
3660         Setting HTMLMediaElement.volume to NaN or Inf should throw a TypeError
3661         https://bugs.webkit.org/show_bug.cgi?id=163472
3662
3663         Reviewed by Sam Weinig.
3664
3665         Setting HTMLMediaElement.volume to NaN or Inf should throw a TypeError:
3666         - https://html.spec.whatwg.org/#dom-media-volume
3667
3668         This is because the attribute is of type double (not unrestricted double in the IDL).
3669
3670         Chrome and Firefox agree with the specification. WebKit throws an IndexSizeErr instead.
3671
3672         No new tests, rebaselined existing test.
3673
3674         * html/HTMLMediaElement.idl:
3675
3676 2016-10-15  Zalan Bujtas  <zalan@apple.com>
3677
3678         CounterNode::resetRenderers is so inefficient.
3679         https://bugs.webkit.org/show_bug.cgi?id=163480
3680
3681         Reviewed by Simon Fraser.
3682
3683         CounterNode::resetRenderers() removes all the associated renderers from this CounterNode
3684         and sets the dirty bit on them.
3685         This patch does all that in a loop, instead of traversing the linked tree on each removal.
3686
3687         No change in functionality.
3688
3689         * rendering/CounterNode.cpp:
3690         (WebCore::CounterNode::CounterNode):
3691         (WebCore::CounterNode::~CounterNode):
3692         (WebCore::CounterNode::nextInPreOrderAfterChildren):
3693         (WebCore::CounterNode::lastDescendant):
3694         (WebCore::CounterNode::addRenderer): These assertions do not seem super useful.
3695         (WebCore::CounterNode::removeRenderer):
3696         (WebCore::CounterNode::resetRenderers):
3697         (WebCore::CounterNode::insertAfter):
3698         (WebCore::CounterNode::removeChild):
3699         * rendering/CounterNode.h:
3700         * rendering/RenderCounter.cpp:
3701         (WebCore::makeCounterNode):
3702         (WebCore::RenderCounter::RenderCounter):
3703         (WebCore::RenderCounter::~RenderCounter):
3704         (WebCore::RenderCounter::originalText):
3705         (WebCore::updateCounters):
3706         (WebCore::RenderCounter::invalidate): Deleted.
3707         * rendering/RenderCounter.h:
3708
3709 2016-10-15  Antoine Quint  <graouts@apple.com>
3710
3711         [Modern Media Controls] macOS inline controls
3712         https://bugs.webkit.org/show_bug.cgi?id=163444
3713         <rdar://problem/27989473>
3714
3715         Reviewed by Dean Jackson.
3716
3717         Introducing the new MacOSMediaControls and MacOSInlineMediaControls classes. MacOSMediaControls is a MediaControls subclass
3718         that adds specific buttons to the macOS platform and sets the layout traits to be macOS. This class has a new subclass,
3719         MacOSInlineMediaControls, which sets the layout traits to also include inline and implements custom layout to drop
3720         controls as necessary as the width of the controls varies. It also shows the volume slider when the mute button is hovered.
3721         
3722         Tests: media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-buttons-styles.html
3723                media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-constructor.html
3724                media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-controls-bar-styles.html
3725                media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-layout.html
3726                media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-time-control-styles.html
3727                media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-volume-slider-visibility.html
3728                media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-volume-styles.html
3729                media/modern-media-controls/macos-inline-media-controls/macos-inline-media-dropping-controls.html
3730                media/modern-media-controls/macos-media-controls/macos-media-controls.html
3731
3732         * Modules/modern-media-controls/controls/macos-inline-media-controls.css: Added.
3733         (.media-controls.mac.inline > .controls-bar):
3734         (.media-controls.mac.inline > .controls-bar > *):
3735         (.media-controls.mac.inline button):
3736         (.media-controls.mac.inline button:active):
3737         (.media-controls.mac.inline > .controls-bar button):
3738         (.media-controls.mac.inline > .controls-bar,):
3739         (.media-controls.mac.inline button.play-pause):
3740         (.media-controls.mac.inline button.skip-back):
3741         (.media-controls.mac.inline .scrubber.slider):
3742         (.media-controls.mac.inline button.mute):
3743         (.media-controls.mac.inline button.airplay):
3744         (.media-controls.mac.inline button.pip):
3745         (.media-controls.mac.inline button.tracks):
3746         (.media-controls.mac.inline button.fullscreen):
3747         (.media-controls.mac.inline .time-label):
3748         (.media-controls.mac.inline .volume-slider-container):
3749         (.media-controls.mac.inline .volume-slider-container:before):
3750         (.media-controls.mac.inline .volume.slider):
3751         * Modules/modern-media-controls/controls/macos-inline-media-controls.js: Added.
3752         (MacOSInlineMediaControls.prototype.layout):
3753         (MacOSInlineMediaControls.prototype.handleEvent):
3754         * Modules/modern-media-controls/controls/macos-media-controls.js: Added.
3755         (MacOSMediaControls):
3756
3757 2016-10-14  Antti Koivisto  <antti@apple.com>
3758
3759         100% CPU on homedepot.com page
3760         https://bugs.webkit.org/show_bug.cgi?id=163452
3761         <rdar://problem/28730708>
3762
3763         Reviewed by Simon Fraser.
3764
3765         The site has a keyframe animation on body. Currently this causes the animation to invalidate the
3766         style of the entire document.
3767
3768         Animations use SyntheticStyleChange to invalidate elements when animation progresses and currently
3769         that causes full subtree invalidation. However animation only ever affect individual elements and
3770         the normal style resolution mechanism should be able to deal with things like inheritance as needed.
3771
3772         Test: fast/animation/animation-style-update-size.html
3773
3774         * dom/Document.cpp:
3775         (WebCore::Document::recalcStyle):
3776         * dom/Document.h:
3777         (WebCore::Document::lastStyleUpdateSizeForTesting):
3778
3779             Testing support.
3780
3781         * style/StyleTreeResolver.cpp:
3782         (WebCore::Style::TreeResolver::resolveElement):
3783
3784             Don't force subtree style resolution for SyntheticStyleChange.
3785
3786         * style/StyleUpdate.h:
3787         (WebCore::Style::Update::size):
3788         * testing/Internals.cpp:
3789         (WebCore::Internals::lastStyleUpdateSize):
3790         * testing/Internals.h:
3791         * testing/Internals.idl:
3792
3793 2016-10-14  Chris Dumez  <cdumez@apple.com>
3794
3795         Setting HTMLMediaElement.muted to the same value should not fire a volume change event
3796         https://bugs.webkit.org/show_bug.cgi?id=163474
3797
3798         Reviewed by Eric Carlson.
3799
3800         Setting HTMLMediaElement.muted to the same value should not fire a volume
3801         change event:
3802         - https://html.spec.whatwg.org/#dom-media-muted
3803
3804         Chrome and Firefox agree with the specification.
3805
3806         No new tests, rebaselined existing test.
3807
3808         * html/HTMLMediaElement.cpp:
3809         (WebCore::HTMLMediaElement::setMuted):
3810
3811 2016-10-14  Dean Jackson  <dino@apple.com>
3812
3813         Add Display P3 ColorSpace
3814         https://bugs.webkit.org/show_bug.cgi?id=162880
3815         <rdar://problem/28598564>
3816
3817         Reviewed by Sam Weinig.
3818
3819         Re-landing with a version that hopefully compiles on El Capitan.
3820
3821         Add a new ColorSpace for Display P3.
3822
3823         This will be tested once the Color class can create
3824         objects that reference other color spaces.
3825
3826         * platform/graphics/ColorSpace.h:
3827         * platform/graphics/cg/GraphicsContextCG.cpp:
3828         (WebCore::displayP3ColorSpaceRef):
3829         * platform/graphics/cg/GraphicsContextCG.h:
3830         (WebCore::cachedCGColorSpace):
3831
3832 2016-10-14  Brent Fulgham  <bfulgham@apple.com>
3833
3834         [Win][Direct2D] Minor cleanups
3835         https://bugs.webkit.org/show_bug.cgi?id=162953
3836
3837         Reviewed by Dean Jackson.
3838
3839         Code cleanup. No change in behavior.
3840
3841         * platform/graphics/win/ImageDecoderDirect2D.cpp:
3842         (WebCore::ImageDecoder::frameIsCompleteAtIndex):
3843         (WebCore::ImageDecoder::frameBytesAtIndex):
3844
3845 2016-10-14  Alex Christensen  <achristensen@webkit.org>
3846
3847         Fix CMake build.
3848
3849         * PlatformMac.cmake:
3850
3851 2016-10-14  Anders Carlsson  <andersca@apple.com>
3852
3853         Pass on networking settings to the PKPaymentRequest
3854         https://bugs.webkit.org/show_bug.cgi?id=163462
3855         rdar://problem/28567629
3856
3857         Reviewed by Dan Bernstein.
3858
3859         Add new SPI.
3860
3861         * platform/spi/cocoa/PassKitSPI.h:
3862
3863 2016-10-14  Dean Jackson  <dino@apple.com>
3864
3865         CSS parsing should use Color not RGBA32
3866         https://bugs.webkit.org/show_bug.cgi?id=163423
3867         <rdar://problem/28766903>
3868
3869         Reviewed by Simon Fraser.
3870
3871         Re-landing this after it was rolled out in https://trac.webkit.org/r207342.
3872
3873         In order to allow CSS to use the ExtendedColor variant of
3874         Color, we need to stop using RGBA32. This is a fairly big
3875         change that goes through all the places in the parser
3876         related to colors, and moves them from RGBA32 to Color.
3877
3878         No change in functionality, so covered by existing tests.
3879
3880         * WebCore.xcodeproj/project.pbxproj: Add the new ColorHash.h file.
3881
3882         * css/CSSPrimitiveValue.cpp: CSSPrimitiveValue now can hold a Color*
3883         rather than an unsigned int for colors.
3884         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
3885         (WebCore::CSSPrimitiveValue::cleanup):
3886         (WebCore::CSSPrimitiveValue::getRGBColorValue):
3887         (WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText):
3888         (WebCore::CSSPrimitiveValue::cloneForCSSOM):
3889         (WebCore::CSSPrimitiveValue::equals):
3890         * css/CSSPrimitiveValue.h: Move to Color* and also use some
3891         nullptrs.
3892         * css/CSSPrimitiveValueMappings.h:
3893         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Add a new inline
3894         constructor.
3895
3896         * css/CSSValuePool.cpp: Move to Color.
3897         (WebCore::CSSValuePool::CSSValuePool):
3898         (WebCore::CSSValuePool::createColorValue):
3899         * css/CSSValuePool.h: Change the ColorValueCache to a new type.
3900
3901         * css/StyleResolver.cpp: Move to Color.
3902         (WebCore::StyleResolver::colorFromPrimitiveValue):
3903         * css/parser/CSSParser.cpp:
3904         (WebCore::parseColorValue):
3905         (WebCore::CSSParser::parseColor):
3906         (WebCore::CSSParser::parseColorFromString):
3907         (WebCore::CSSParser::parseSystemColor):
3908         (WebCore::fastParseColorInternal):
3909         (WebCore::CSSParser::fastParseColor):
3910         (WebCore::CSSParser::parseColorFromValue):
3911         * css/parser/CSSParser.h:
3912         * css/parser/CSSParserFastPaths.cpp:
3913         (WebCore::fastParseColorInternal):
3914         (WebCore::CSSParserFastPaths::parseColor):
3915         * css/parser/CSSPropertyParserHelpers.cpp:
3916         (WebCore::CSSPropertyParserHelpers::consumeColor):
3917         * css/parser/SVGCSSParser.cpp:
3918         (WebCore::CSSParser::parseSVGValue):
3919         (WebCore::CSSParser::parseSVGPaint):
3920         (WebCore::CSSParser::parseSVGColor):
3921         * editing/EditingStyle.cpp:
3922         (WebCore::cssValueToColor):
3923         (WebCore::textColorFromStyle):
3924         (WebCore::backgroundColorFromStyle):
3925         (WebCore::rgbaBackgroundColorInEffect):
3926         (WebCore::EditingStyle::prepareToApplyAt):
3927         (WebCore::isTransparentColorValue):
3928         (WebCore::cssValueToRGBA): Deleted.
3929         * editing/cocoa/HTMLConverter.mm:
3930         (HTMLConverterCaches::colorPropertyValueForNode):
3931         * html/HTMLBodyElement.cpp:
3932         (WebCore::HTMLBodyElement::parseAttribute):
3933         * html/canvas/CanvasGradient.cpp:
3934         (WebCore::CanvasGradient::addColorStop):
3935         * html/canvas/CanvasRenderingContext2D.cpp: Ditto, but leave a FIXME to
3936         remind myself to come back when colorWithOverrideAlpha has been updated.
3937         (WebCore::CanvasRenderingContext2D::setStrokeStyle):
3938         (WebCore::CanvasRenderingContext2D::setFillStyle):
3939         (WebCore::CanvasRenderingContext2D::setShadowColor):
3940         (WebCore::CanvasRenderingContext2D::setShadow):
3941         * html/canvas/CanvasStyle.cpp:
3942         (WebCore::isCurrentColorString):
3943         (WebCore::parseColor):
3944         (WebCore::currentColor):
3945         (WebCore::parseColorOrCurrentColor):
3946         (WebCore::CanvasStyle::createFromString):
3947         (WebCore::CanvasStyle::createFromStringWithOverrideAlpha):
3948         * html/canvas/CanvasStyle.h:
3949         * svg/SVGColor.cpp:
3950         (WebCore::SVGColor::colorFromRGBColorString):
3951
3952         * platform/graphics/Color.h: Add new constructors for the special
3953         empty and deleted Color values used in HashTables.
3954         (WebCore::Color::Color):
3955         (WebCore::Color::isHashTableDeletedValue):
3956         (WebCore::Color::asUint64): New accessor to get the raw uint64_t value.
3957
3958         * platform/graphics/ColorHash.h: Added. Implement the traits for a Color HashTable.
3959         (WTF::ColorHash::hash):
3960         (WTF::ColorHash::equal):
3961         (WTF::HashTraits<WebCore::Color>::emptyValue):
3962         (WTF::HashTraits<WebCore::Color>::constructDeletedValue):
3963         (WTF::HashTraits<WebCore::Color>::isDeletedValue):
3964
3965 2016-10-14  Brent Fulgham  <bfulgham@apple.com>
3966
3967         [Win][Direct2D] Implement basic SVG support
3968         https://bugs.webkit.org/show_bug.cgi?id=163349
3969
3970         Reviewed by Brent Fulgham.
3971
3972         Direct2D needs access to the target graphics context when generating bitmap
3973         images so that it can properly match pixel format and other settings.
3974
3975         Add implementations for a number of drawing primitives used in the SVG
3976         test cases. Correct some differences between CG and Direct2D for drawing
3977         different primitives.
3978
3979         No new tests. Tested by existing 'svg' tests.
3980
3981         * platform/graphics/BitmapImage.cpp:
3982        (WebCore::BitmapImage::frameImageAtIndex): Take optional target graphics
3983        context. Also pass the graphics context to the image decoder.
3984        (WebCore::BitmapImage::nativeImage): Accept an optional target context.
3985        (WebCore::BitmapImage::nativeImageForCurrentFrame): Ditto.
3986        (WebCore::BitmapImage::draw): Pass target graphics context to the
3987        'frameImageAtIndex' method.
3988         * platform/graphics/BitmapImage.h:
3989         * platform/graphics/Image.h:
3990         * platform/graphics/ImageBuffer.cpp:
3991         (WebCore::ImageBuffer::create): Moved from header. Add create function that
3992         takes an optional GraphicsContext argument.
3993         * platform/graphics/ImageBuffer.h:
3994         * platform/graphics/ImageFrameCache.cpp: Add missing include needed to build
3995         under Direct2D.
3996         * platform/graphics/ImageSource.cpp:
3997         (WebCore::ImageSource::setDecoderTargetContext): Added.
3998         (WebCore::ImageSource::setRenderTarget): Deleted.
3999         * platform/graphics/ImageSource.h:
4000         * platform/graphics/Pattern.h:
4001         * platform/graphics/win/GraphicsContextDirect2D.cpp:
4002         (WebCore::GraphicsContextPlatformPrivate::endDraw): Log error state instead of crashing
4003         each time.
4004         (WebCore::GraphicsContext::drawEllipse): Ellipses are defined in D2D as a center, an
4005         X-radius, and a Y-radius.
4006         (WebCore::GraphicsContext::applyStrokePattern):
4007         (WebCore::GraphicsContext::applyFillPattern):
4008         (WebCore::GraphicsContext::clearRect): Use 'Clear' function if possible. Don't clear
4009         anything if the clear rect is outside the drawing area.
4010         (WebCore::GraphicsContext::strokeRect): Provide implementation (needed by SVG).
4011         (WebCore::GraphicsContext::platformFillEllipse): Ellipses are defined in D2D as
4012         a center, an X-radius, and a Y-radius.
4013         (WebCore::GraphicsContext::platformStrokeEllipse): Ditto.
4014         * platform/graphics/win/ImageBufferDirect2D.cpp:
4015         (WebCore::ImageBuffer::createCompatibleBuffer): Accept optional GraphicsContext argument.
4016         (WebCore::ImageBuffer::ImageBuffer): Ditto.
4017         * platform/graphics/win/ImageDecoderDirect2D.cpp:
4018         (WebCore::ImageDecoder::setTargetContext): Renamed from 'setRenderTarget'.
4019         (WebCore::ImageDecoder::createFrameImageAtIndex): Take optional GraphicsContext argument.
4020         (WebCore::ImageDecoder::setRenderTarget): Deleted.
4021         * platform/graphics/win/ImageDecoderDirect2D.h:
4022         * platform/graphics/win/ImageDirect2D.cpp:
4023         (WebCore::BitmapImage::setRenderTarget): Deleted.
4024         * platform/graphics/win/NativeImageDirect2D.cpp: Add missing include.
4025         * platform/graphics/win/PatternDirect2D.cpp: 
4026         (WebCore::Pattern::createPlatformPattern): Revise for new signature.
4027         * rendering/FilterEffectRenderer.cpp:
4028         (WebCore::FilterEffectRenderer::allocateBackingStoreIfNeeded): Pass GraphicsContext
4029         to ImageBuffer constructor.
4030         (WebCore::FilterEffectRendererHelper::beginFilterEffect): Pass target context to
4031         filter when allocating backing store.
4032         * rendering/FilterEffectRenderer.h: Add GraphicsContext as argument to constructor.
4033         * rendering/RenderLayer.cpp:
4034         (WebCore::RenderLayer::hasFilterThatIsPainting): Supply GraphicsContext argument when
4035         building new FilterEffectRenderer and helper.
4036         (WebCore::RenderLayer::setupFilters): Ditto.
4037         * svg/graphics/SVGImage.cpp:
4038         (WebCore::SVGImage::nativeImageForCurrentFrame): Revise to take optional GraphicsContext
4039         argument.
4040         (WebCore::SVGImage::nativeImage): Ditto.
4041         * svg/graphics/SVGImage.h:
4042         * svg/graphics/SVGImageForContainer.cpp:
4043         (WebCore::SVGImageForContainer::nativeImageForCurrentFrame): Ditto.
4044         * svg/graphics/SVGImageForContainer.h:
4045
4046 2016-10-14  Chris Dumez  <cdumez@apple.com>
4047
4048         Unreviewed, rolling out r207319.
4049
4050         Regressed Dromaeo and may have caused crashes under
4051         GuardMalloc (rdar://problem/28780835)
4052
4053         Reverted changeset:
4054
4055         "[Web IDL] Add support for [SameObject] extended attribute"
4056         https://bugs.webkit.org/show_bug.cgi?id=163414
4057         http://trac.webkit.org/changeset/207319
4058
4059 2016-10-14  Anders Carlsson  <andersca@apple.com>
4060
4061         Clean up BackForwardClient
4062         https://bugs.webkit.org/show_bug.cgi?id=163454
4063
4064         Reviewed by Sam Weinig.
4065
4066         Remove iOS specific member functions that are only used from WebKit.
4067
4068         * history/BackForwardClient.h:
4069         * loader/EmptyClients.cpp:
4070
4071 2016-10-13  Anders Carlsson  <andersca@apple.com>
4072
4073         Move BackForwardList from WebCore to WebKitLegacy
4074         https://bugs.webkit.org/show_bug.cgi?id=163418
4075
4076         Reviewed by Tim Horton.
4077
4078         * CMakeLists.txt:
4079         * WebCore.xcodeproj/project.pbxproj:
4080         * history/BackForwardController.cpp:
4081         (WebCore::BackForwardController::BackForwardController):
4082         * history/BackForwardController.h:
4083         * loader/EmptyClients.cpp:
4084         (WebCore::fillWithEmptyClients):
4085         * page/Page.cpp:
4086         (WebCore::Page::Page):
4087
4088 2016-10-14  Manuel Rego Casasnovas  <rego@igalia.com>
4089
4090         [css-grid] Changing the argument on fit-content() doesn't cause the grid to be relayout
4091         https://bugs.webkit.org/show_bug.cgi?id=163434
4092
4093         Reviewed by Sergio Villar Senin.
4094
4095         When fit-content() was implemented a new attribute
4096         m_fitContentTrackBreadth was added to GridTrackSize.
4097         However we forgot to include it in the == operator implementation,
4098         so we were missing the changes on that value.
4099
4100         Now if you change the argument of a fit-content() track,
4101         the track size is properly recomputed.
4102
4103         Test: fast/css-grid-layout/grid-change-fit-content-argument.html
4104
4105         * rendering/style/GridTrackSize.h:
4106         (WebCore::GridTrackSize::operator==): Check m_fitContentTrackBreadth.
4107
4108 2016-10-14  Commit Queue  <commit-queue@webkit.org>
4109
4110         Unreviewed, rolling out r207317.
4111         https://bugs.webkit.org/show_bug.cgi?id=163448
4112
4113         This change caused an existing LayoutTest to fail on all
4114         platforms (Requested by ryanhaddad on #webkit).