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