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