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