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