Update serializer and iterator binding generated code
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-10-13  Youenn Fablet  <youenn@apple.com>
2
3         Update serializer and iterator binding generated code
4         https://bugs.webkit.org/show_bug.cgi?id=163325
5
6         Reviewed by Darin Adler.
7
8         No change of behavior.
9         Covered by existing tests and rebased binding generated code.
10
11         Making use of BindingCaller::callOperation within serializer and iterator operations.
12         Refactored serializer code to use direct attribute getters.
13
14         * bindings/js/JSDOMIterator.h:
15         (WebCore::iteratorCreate):
16         (WebCore::iteratorForEach):
17         * bindings/scripts/CodeGeneratorJS.pm:
18         (GenerateSerializerFunction):
19         (GenerateImplementationIterableFunctions):
20         * bindings/scripts/test/JS/JSTestIterable.cpp:
21         (WebCore::jsTestIterablePrototypeFunctionSymbolIteratorCaller):
22         (WebCore::jsTestIterablePrototypeFunctionSymbolIterator):
23         (WebCore::jsTestIterablePrototypeFunctionEntriesCaller):
24         (WebCore::jsTestIterablePrototypeFunctionEntries):
25         (WebCore::jsTestIterablePrototypeFunctionKeysCaller):
26         (WebCore::jsTestIterablePrototypeFunctionKeys):
27         (WebCore::jsTestIterablePrototypeFunctionValuesCaller):
28         (WebCore::jsTestIterablePrototypeFunctionValues):
29         (WebCore::jsTestIterablePrototypeFunctionForEachCaller):
30         (WebCore::jsTestIterablePrototypeFunctionForEach):
31         * bindings/scripts/test/JS/JSTestNode.cpp:
32         (WebCore::jsTestNodePrototypeFunctionSymbolIteratorCaller):
33         (WebCore::jsTestNodePrototypeFunctionSymbolIterator):
34         (WebCore::jsTestNodePrototypeFunctionEntriesCaller):
35         (WebCore::jsTestNodePrototypeFunctionEntries):
36         (WebCore::jsTestNodePrototypeFunctionKeysCaller):
37         (WebCore::jsTestNodePrototypeFunctionKeys):
38         (WebCore::jsTestNodePrototypeFunctionValuesCaller):
39         (WebCore::jsTestNodePrototypeFunctionValues):
40         (WebCore::jsTestNodePrototypeFunctionForEachCaller):
41         (WebCore::jsTestNodePrototypeFunctionForEach):
42         (WebCore::jsTestNodePrototypeFunctionToJSON):
43         * bindings/scripts/test/JS/JSTestObj.cpp:
44         (WebCore::jsTestObjPrototypeFunctionToJSON):
45
46 2016-10-13  Alex Christensen  <achristensen@webkit.org>
47
48         Fix API test after r207318.
49         https://bugs.webkit.org/show_bug.cgi?id=162951
50
51         This fixes the API test WebKit2.PendingAPIRequestURL which asserted when trying to hash a null String.
52
53         * loader/DocumentLoader.cpp:
54         (WebCore::isRemoteWebArchive):
55         If the mimeType is a null String, it is not in the set webArchiveMIMETypes, so return false instead of hashing it.
56
57 2016-10-13  Alex Christensen  <achristensen@webkit.org>
58
59         Hosts of URLs with non-special schemes should be case-sensitive, and non-ASCII characters in such hosts should be punycode-encoded
60         https://bugs.webkit.org/show_bug.cgi?id=163413
61
62         Reviewed by Tim Horton.
63
64         This retains compatibility with the canonicalization Chrome, Firefox, and Safari with uppercase characters
65         in the hosts of URLs with unrecognized schemes.  Safari treats such characters as the host, while Firefox
66         and Chrome treat such characters as part of the path, starting with the "//" after the ':'
67         Behavior of non-ASCII characters is inconsistent, and since we need to have a host, we should punycode-encode
68         the host to be consistent with special schemes because percent-encoding hosts sometimes is inconsistent.
69         
70         This solution was proposed to the spec in https://github.com/whatwg/url/issues/148
71
72         Covered by updated API and layout tests.
73
74         * platform/URLParser.cpp:
75         (WebCore::URLParser::parse):
76         (WebCore::URLParser::percentDecode):
77         (WebCore::URLParser::domainToASCII):
78         (WebCore::URLParser::hasInvalidDomainCharacter):
79         (WebCore::URLParser::parseHostAndPort):
80         (WebCore::URLParser::formURLDecode):
81         (WebCore::percentDecode): Deleted.
82         (WebCore::domainToASCII): Deleted.
83         (WebCore::hasInvalidDomainCharacter): Deleted.
84         (WebCore::formURLDecode): Deleted.
85         * platform/URLParser.h:
86
87 2016-10-13  Chris Dumez  <cdumez@apple.com>
88
89         [Web IDL] Add support for [SameObject] extended attribute
90         https://bugs.webkit.org/show_bug.cgi?id=163414
91
92         Reviewed by Darin Adler.
93
94         Add support for [SameObject] Web IDL extended attribute:
95         - https://heycam.github.io/webidl/#SameObject
96
97         Start using it on DOM / HTML attributes where the specification
98         mandates it.
99
100         Test: js/dom/SameObject-support.html
101
102         * bindings/scripts/CodeGeneratorJS.pm:
103         (ShouldCacheAttribute):
104         (GenerateHeader):
105         (GenerateImplementation):
106         * bindings/scripts/IDLAttributes.txt:
107         * dom/DataTransfer.idl:
108         * dom/Document.idl:
109         * dom/Element.idl:
110         * dom/MutationRecord.idl:
111         * dom/Node.idl:
112         * dom/NodeIterator.idl:
113         * dom/ParentNode.idl:
114         * dom/TreeWalker.idl:
115         * html/HTMLAnchorElement.idl:
116         * html/HTMLAreaElement.idl:
117         * html/HTMLButtonElement.idl:
118         * html/HTMLDataListElement.idl:
119         * html/HTMLDocument.idl:
120         * html/HTMLElement.idl:
121         * html/HTMLFieldSetElement.idl:
122         * html/HTMLFormElement.idl:
123         * html/HTMLIFrameElement.idl:
124         * html/HTMLInputElement.idl:
125         * html/HTMLKeygenElement.idl:
126         * html/HTMLLinkElement.idl:
127         * html/HTMLMapElement.idl:
128         * html/HTMLMediaElement.idl:
129         * html/HTMLMeterElement.idl:
130         * html/HTMLOutputElement.idl:
131         * html/HTMLProgressElement.idl:
132         * html/HTMLSelectElement.idl:
133         * html/HTMLTableElement.idl:
134         * html/HTMLTableRowElement.idl:
135         * html/HTMLTableSectionElement.idl:
136         * html/HTMLTextAreaElement.idl:
137         * page/Location.idl:
138         * page/Navigator.idl:
139
140 2016-10-13  Andy Estes  <aestes@apple.com>
141
142         [iOS] Support Web Archive previews generated by QuickLook
143         https://bugs.webkit.org/show_bug.cgi?id=162951
144         <rdar://problem/28607920>
145
146         Reviewed by Brady Eidson.
147
148         QuickLook might generate a Web Archive preview for some resource types, but WebKit would
149         refuse to load it due to the prohibition on loading remote Web Archives. Even though the
150         original resource might be from a remote origin, the QuickLook-generated preview is a
151         trusted local resource, so allow it to be loaded.
152
153         No test possible.
154
155         * loader/DocumentLoader.cpp:
156         (WebCore::isRemoteWebArchive): Added. Moved the remote web archive check from
157         continueAfterContentPolicy() to here, and added a check for responses containing the
158         QuickLook preview protocol.
159         (WebCore::DocumentLoader::continueAfterContentPolicy): Called isRemoteWebArchive().
160
161 2016-10-13  Dean Jackson  <dino@apple.com>
162
163         CSS parsing should use Color not RGBA32
164         https://bugs.webkit.org/show_bug.cgi?id=163423
165         <rdar://problem/28766903>
166
167         Reviewed by Simon Fraser.
168
169         In order to allow CSS to use the ExtendedColor variant of
170         Color, we need to stop using RGBA32. This is a fairly big
171         change that goes through all the places in the parser
172         related to colors, and moves them from RGBA32 to Color.
173
174         No change in functionality, so covered by existing tests.
175
176         * WebCore.xcodeproj/project.pbxproj: Add the new ColorHash.h file.
177
178         * css/CSSPrimitiveValue.cpp: CSSPrimitiveValue now can hold a Color*
179         rather than an unsigned int for colors.
180         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
181         (WebCore::CSSPrimitiveValue::cleanup):
182         (WebCore::CSSPrimitiveValue::getRGBColorValue):
183         (WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText):
184         (WebCore::CSSPrimitiveValue::cloneForCSSOM):
185         (WebCore::CSSPrimitiveValue::equals):
186         * css/CSSPrimitiveValue.h: Move to Color* and also use some
187         nullptrs.
188         * css/CSSPrimitiveValueMappings.h:
189         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Add a new inline
190         constructor.
191
192         * css/CSSValuePool.cpp: Move to Color.
193         (WebCore::CSSValuePool::CSSValuePool):
194         (WebCore::CSSValuePool::createColorValue):
195         * css/CSSValuePool.h: Change the ColorValueCache to a new type.
196
197         * css/StyleResolver.cpp: Move to Color.
198         (WebCore::StyleResolver::colorFromPrimitiveValue):
199         * css/parser/CSSParser.cpp:
200         (WebCore::parseColorValue):
201         (WebCore::CSSParser::parseColor):
202         (WebCore::CSSParser::parseColorFromString):
203         (WebCore::CSSParser::parseSystemColor):
204         (WebCore::fastParseColorInternal):
205         (WebCore::CSSParser::fastParseColor):
206         (WebCore::CSSParser::parseColorFromValue):
207         * css/parser/CSSParser.h:
208         * css/parser/CSSParserFastPaths.cpp:
209         (WebCore::fastParseColorInternal):
210         (WebCore::CSSParserFastPaths::parseColor):
211         * css/parser/CSSPropertyParserHelpers.cpp:
212         (WebCore::CSSPropertyParserHelpers::consumeColor):
213         * css/parser/SVGCSSParser.cpp:
214         (WebCore::CSSParser::parseSVGValue):
215         (WebCore::CSSParser::parseSVGPaint):
216         (WebCore::CSSParser::parseSVGColor):
217         * editing/EditingStyle.cpp:
218         (WebCore::cssValueToColor):
219         (WebCore::textColorFromStyle):
220         (WebCore::backgroundColorFromStyle):
221         (WebCore::rgbaBackgroundColorInEffect):
222         (WebCore::EditingStyle::prepareToApplyAt):
223         (WebCore::isTransparentColorValue):
224         (WebCore::cssValueToRGBA): Deleted.
225         * editing/cocoa/HTMLConverter.mm:
226         (HTMLConverterCaches::colorPropertyValueForNode):
227         * html/HTMLBodyElement.cpp:
228         (WebCore::HTMLBodyElement::parseAttribute):
229         * html/canvas/CanvasGradient.cpp:
230         (WebCore::CanvasGradient::addColorStop):
231         * html/canvas/CanvasRenderingContext2D.cpp: Ditto, but leave a FIXME to
232         remind myself to come back when colorWithOverrideAlpha has been updated.
233         (WebCore::CanvasRenderingContext2D::setStrokeStyle):
234         (WebCore::CanvasRenderingContext2D::setFillStyle):
235         (WebCore::CanvasRenderingContext2D::setShadowColor):
236         (WebCore::CanvasRenderingContext2D::setShadow):
237         * html/canvas/CanvasStyle.cpp:
238         (WebCore::isCurrentColorString):
239         (WebCore::parseColor):
240         (WebCore::currentColor):
241         (WebCore::parseColorOrCurrentColor):
242         (WebCore::CanvasStyle::createFromString):
243         (WebCore::CanvasStyle::createFromStringWithOverrideAlpha):
244         * html/canvas/CanvasStyle.h:
245         * svg/SVGColor.cpp:
246         (WebCore::SVGColor::colorFromRGBColorString):
247
248         * platform/graphics/Color.h: Add new constructors for the special
249         empty and deleted Color values used in HashTables.
250         (WebCore::Color::Color):
251         (WebCore::Color::isHashTableDeletedValue):
252         (WebCore::Color::asUint64): New accessor to get the raw uint64_t value.
253
254         * platform/graphics/ColorHash.h: Added. Implement the traits for a Color HashTable.
255         (WTF::ColorHash::hash):
256         (WTF::ColorHash::equal):
257         (WTF::HashTraits<WebCore::Color>::emptyValue):
258         (WTF::HashTraits<WebCore::Color>::constructDeletedValue):
259         (WTF::HashTraits<WebCore::Color>::isDeletedValue):
260
261 2016-10-13  Nan Wang  <n_wang@apple.com>
262
263         AX: [Mac] better accessibility support for Summary elements
264         https://bugs.webkit.org/show_bug.cgi?id=163367
265         <rdar://problem/28745010>
266
267         Reviewed by Chris Fleizach.
268
269         Exposed summary elements as AXButton and used the text node's content
270         as AXTitle. Also exposed the details parent's expanded status on the summary
271         element, so that users would see it as a collapsed/expanded button.
272
273         Changes are covered in the modified tests.
274
275         * accessibility/AccessibilityObject.cpp:
276         (WebCore::AccessibilityObject::parentObjectUnignored):
277         (WebCore::AccessibilityObject::scrollViewAncestor):
278         (WebCore::AccessibilityObject::headingElementForNode):
279         (WebCore::AccessibilityObject::matchedParent):
280         (WebCore::AccessibilityObject::isDescendantOfObject):
281         (WebCore::AccessibilityObject::isInsideARIALiveRegion):
282         (WebCore::AccessibilityObject::elementAccessibilityHitTest):
283         (WebCore::AccessibilityObject::isExpanded):
284         (WebCore::AccessibilityObject::isARIAHidden):
285         (WebCore::AccessibilityObject::focusableAncestor):
286         (WebCore::AccessibilityObject::editableAncestor):
287         * accessibility/AccessibilityObject.h:
288         (WebCore::AccessibilityObject::isSummary):
289         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
290         (-[WebAccessibilityObjectWrapper _accessibilityListAncestor]):
291         (-[WebAccessibilityObjectWrapper _accessibilityLandmarkAncestor]):
292         (-[WebAccessibilityObjectWrapper _accessibilityTableAncestor]):
293         (-[WebAccessibilityObjectWrapper _accessibilityFieldsetAncestor]):
294         (-[WebAccessibilityObjectWrapper tableCellParent]):
295         (-[WebAccessibilityObjectWrapper tableParent]):
296         (-[WebAccessibilityObjectWrapper convertPointToScreenSpace:]):
297         (-[WebAccessibilityObjectWrapper convertRectToScreenSpace:]):
298         (-[WebAccessibilityObjectWrapper detailParentForSummaryObject:]):
299         (-[WebAccessibilityObjectWrapper detailParentForObject:]):
300         (matchedParent): Deleted.
301         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
302         (-[WebAccessibilityObjectWrapper additionalAccessibilityAttributeNames]):
303         (createAccessibilityRoleMap):
304         (-[WebAccessibilityObjectWrapper roleDescription]):
305         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
306
307 2016-10-13  Zalan Bujtas  <zalan@apple.com>
308
309         [Clean RenderTree] LayoutTests/imported/blink/fast/table/crash-bad-child-table-continuation.html fails.
310         https://bugs.webkit.org/show_bug.cgi?id=163399
311
312         Reviewed by David Hyatt.
313
314         When we try to insert a renderer before a child whose direct parent is a (anonymus) RenderTable, continuation logic
315         should dismiss the RenderTable as the parent and find a more appropriate ancestor.
316         RenderTables assumes a certain descendant tree structure which might not be available in the continuation.
317
318         Will be testable with webkit.org/b/162834
319
320         * rendering/RenderInline.cpp:
321         (WebCore::canUseAsParentForContinuation):
322         (WebCore::RenderInline::addChildToContinuation):
323
324 2016-10-13  Alex Christensen  <achristensen@webkit.org>
325
326         Disable URLParser for non-Safari iOS and Mac apps for now
327         https://bugs.webkit.org/show_bug.cgi?id=163397
328
329         Reviewed by Tim Horton.
330
331         r207268 was an awful hack, and it was insufficient.
332         Disable the URLParser for other apps for now.  Hopefully we can enable it everywhere soon.
333
334         No change in behavior for testing infrastructure.  
335         Old URLs were well tested before making the switch, and nothing has changed for them.
336
337         * platform/URLParser.cpp:
338         (WebCore::URLParser::parse):
339         (WebCore::URLParser::parseHostAndPort):
340         (WebCore::URLParser::setEnabled):
341         (WebCore::URLParser::enabled):
342         * platform/URLParser.h:
343
344 2016-10-13  Chris Dumez  <cdumez@apple.com>
345
346         Rename [ConstructorTemplate=*] to [LegacyConstructorTemplate=*]
347         https://bugs.webkit.org/show_bug.cgi?id=163390
348
349         Reviewed by Darin Adler.
350
351         Rename [ConstructorTemplate=*] to [LegacyConstructorTemplate=*] as the
352         modern way of doing this is to use a constructor that takes in a
353         dictionary. I am working on getting rid of this extended attribute
354         entirely but the remaining uses require better support for union types.
355
356         * Modules/applepay/ApplePayValidateMerchantEvent.idl:
357         * Modules/indexeddb/IDBVersionChangeEvent.idl:
358         * Modules/mediastream/RTCTrackEvent.idl:
359         * bindings/scripts/CodeGenerator.pm:
360         (IsConstructorTemplate):
361         * bindings/scripts/CodeGeneratorJS.pm:
362         (GenerateConstructorDefinition):
363         (IsConstructable):
364         * bindings/scripts/IDLAttributes.txt:
365         * dom/Event.idl:
366         * dom/ProgressEvent.idl:
367         * dom/UIEvent.idl:
368         * html/track/TrackEvent.idl:
369
370 2016-10-13  Ryan Haddad  <ryanhaddad@apple.com>
371
372         Unreviewed, rolling out r207297.
373
374         This change broke the iOS build.
375
376         Reverted changeset:
377
378         "Disable URLParser for non-Safari iOS and Mac apps for now"
379         https://bugs.webkit.org/show_bug.cgi?id=163397
380         http://trac.webkit.org/changeset/207297
381
382 2016-10-13  Anders Carlsson  <andersca@apple.com>
383
384         Get rid of the HistoryItemVector typedef
385         https://bugs.webkit.org/show_bug.cgi?id=163398
386
387         Reviewed by Beth Dakin.
388
389         Expand the HistoryitemVector typedef instead to make it more clear what types we are dealing with.
390
391         * history/BackForwardList.cpp:
392         (WebCore::BackForwardList::backListWithLimit):
393         (WebCore::BackForwardList::forwardListWithLimit):
394         (WebCore::BackForwardList::entries):
395         * history/BackForwardList.h:
396         * history/HistoryItem.cpp:
397         (WebCore::HistoryItem::children):
398         * history/HistoryItem.h:
399         * loader/HistoryController.cpp:
400         (WebCore::HistoryController::currentFramesMatchItem):
401
402 2016-10-13  Antoine Quint  <graouts@apple.com>
403
404         [Modern Media Controls] MediaControls base class
405         https://bugs.webkit.org/show_bug.cgi?id=163387
406         <rdar://problem/28753955>
407
408         Reviewed by Dean Jackson.
409
410         Introducing the new MediaControls class which will serve as a basis for all media controls.
411         We will introduce specific MediaControls subclasses for macOS inline, macOS fullscreen and
412         iOS inline in future patches.
413
414         Tests: media/modern-media-controls/media-controls/media-controls-constructor.html
415                media/modern-media-controls/media-controls/media-controls-placard.html
416                media/modern-media-controls/media-controls/media-controls-start-button.html
417
418         * Modules/modern-media-controls/controls/media-controls.css: Added.
419         (.media-controls,):
420         * Modules/modern-media-controls/controls/media-controls.js: Added.
421         (MediaControls.):
422         (MediaControls.prototype.get showsStartButton):
423         (MediaControls.prototype.set showsStartButton):
424         (MediaControls.prototype.get showsPlacard):
425         (MediaControls.prototype.showPlacard):
426         (MediaControls.prototype.hidePlacard):
427
428 2016-10-13  Alex Christensen  <achristensen@webkit.org>
429
430         Disable URLParser for non-Safari iOS and Mac apps for now
431         https://bugs.webkit.org/show_bug.cgi?id=163397
432
433         Reviewed by Tim Horton.
434
435         r207268 was an awful hack, and it was insufficient.
436         Disable the URLParser for other apps for now.  Hopefully we can enable it everywhere soon.
437
438         No change in behavior for testing infrastructure.  
439         Old URLs were well tested before making the switch, and nothing has changed for them.
440
441         * platform/URLParser.cpp:
442         (WebCore::URLParser::parse):
443         (WebCore::URLParser::parseHostAndPort):
444         (WebCore::URLParser::setEnabled):
445         (WebCore::URLParser::enabled):
446         * platform/URLParser.h:
447
448 2016-10-13  Antoine Quint  <graouts@apple.com>
449
450         [Modern Media Controls] TimeControl and TimeLabel
451         https://bugs.webkit.org/show_bug.cgi?id=163356
452         <rdar://problem/28741376>
453
454         Reviewed by Dean Jackson.
455
456         We introduce the TimeControl and TimeLabel classes. A TimeControl object
457         provides two TimeLabels, one for the elapsed time, one for the remaining
458         time, and a Scrubber in between them. Depending on a TimeControl's width,
459         it will adjust its layout such that the scrubber takes all the available
460         space between the labels, and can indicate whether it's large enough to
461         meet the minimal required width to show the scrubber, such that a container
462         node may decide not to show the TimeControl at all.
463
464         TimeLabel nodes simply show an integer time value in miliseconds in a
465         nicely formatted way.
466
467         Tests: media/modern-media-controls/time-control/time-control.html
468                media/modern-media-controls/time-label/time-label.html
469
470         * Modules/modern-media-controls/controls/time-control.js: Added.
471         (TimeControl.prototype.get width):
472         (TimeControl.prototype.set width):
473         (TimeControl.prototype.get isSufficientlyWide):
474         * Modules/modern-media-controls/controls/time-label.css: Added.
475         (.time-label):
476         * Modules/modern-media-controls/controls/time-label.js: Added.
477         (TimeLabel.prototype.get value):
478         (TimeLabel.prototype.set value):
479         (TimeLabel.prototype.commitProperty):
480         (TimeLabel.prototype._formattedTime):
481
482 2016-10-13  Jer Noble  <jer.noble@apple.com>
483
484         CRASH at WebCore::SourceBuffer::removeCodedFrames + 37
485         https://bugs.webkit.org/show_bug.cgi?id=163336
486
487         Reviewed by Alex Christensen.
488
489         Test: media/media-source/media-source-remove-crash.html
490
491         A null-deref crash can occur if a SourceBuffer is removed from a MediaSource after
492         SourceBuffer.remove() is called, but before the removeTimer is fired.
493
494         * Modules/mediasource/SourceBuffer.cpp:
495         (WebCore::SourceBuffer::removeTimerFired):
496
497 2016-10-13  Michael Catanzaro  <mcatanzaro@igalia.com>
498
499         [SOUP] SHOULD NEVER BE REACHED ../../Source/WebCore/platform/URL.cpp(1291) : void WebCore::URL::parse(const WTF::String&)
500         https://bugs.webkit.org/show_bug.cgi?id=163392
501
502         Reviewed by Alex Christensen.
503
504         Fix the URL constructor to work with URLParser.
505
506         * platform/soup/URLSoup.cpp:
507         (WebCore::URL::URL):
508
509 2016-10-13  Ryan Haddad  <ryanhaddad@apple.com>
510
511         Unreviewed, rolling out r207286.
512
513         Caused LayoutTest http/tests/misc/acid3.html to fail.
514
515         Reverted changeset:
516
517         "Share inline stylesheets between shadow trees"
518         https://bugs.webkit.org/show_bug.cgi?id=163353
519         http://trac.webkit.org/changeset/207286
520
521 2016-10-13  Sergio Villar Senin  <svillar@igalia.com>
522
523         [css-grid] Use min-size instead of min-content contribution for intrinsic maximums resolution
524         https://bugs.webkit.org/show_bug.cgi?id=163283
525
526         Reviewed by Manuel Rego Casasnovas.
527
528         This was recently modified in the specs
529         https://hg.csswg.org/drafts/diff/575fb847e29d/css-grid/Overview.bs. Specifically this is
530         addressing the last one. It used to be "min-content contribution" but now it says "min-size
531         contribution".
532
533         * rendering/RenderGrid.cpp:
534         (WebCore::RenderGrid::currentItemSizeForTrackSizeComputationPhase):
535
536 2016-10-11  Sergio Villar Senin  <svillar@igalia.com>
537
538         [css-grid] Fix intrinsic maximums resolution with fit-content and auto
539         https://bugs.webkit.org/show_bug.cgi?id=163282
540
541         Reviewed by Manuel Rego Casasnovas.
542
543         The step 2.5 in section 12.5 https://drafts.csswg.org/css-grid/#algo-content of the specs,
544         details how to sizes tracks with intrinsic max track sizing functions.
545
546         Not so long ago there were only two max track sizing functions min-content and max-content
547         (auto was always resolved to max-content). However there were some recent changes that force
548         us to consider 2 new values: auto (which is not internally translated to max-content
549         although it still works the same) and specially the newly added fit-content.
550
551         Some of the new test cases are commented due to bug http://wkb.ug/163283.
552
553         Test: fast/css-grid-layout/grid-intrinsic-maximums.html
554
555         * rendering/RenderGrid.cpp:
556         (WebCore::RenderGrid::shouldProcessTrackForTrackSizeComputationPhase):
557         * rendering/style/GridTrackSize.h:
558         (WebCore::GridTrackSize::cacheMinMaxTrackBreadthTypes):
559         (WebCore::GridTrackSize::hasIntrinsicMinTrackBreadth):
560         (WebCore::GridTrackSize::hasIntrinsicMaxTrackBreadth):
561         (WebCore::GridTrackSize::hasAutoOrMinContentMinTrackBreadthAndIntrinsicMaxTrackBreadth):
562
563 2016-10-13  Miguel Gomez  <magomez@igalia.com>
564
565         [GTK] Video playback doesn't work properly with accelerated compositing disabled
566         https://bugs.webkit.org/show_bug.cgi?id=163386
567
568         Reviewed by Carlos Garcia Campos.
569
570         Trigger a repaint of the player when a new frame arrives and accelerated compositing is disabled.
571
572         Covered by existent tests.
573
574         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
575         (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
576
577 2016-10-13  Antti Koivisto  <antti@apple.com>
578
579         Share inline stylesheets between shadow trees
580         https://bugs.webkit.org/show_bug.cgi?id=163353
581
582         Reviewed by Ryosuke Niwa and Andreas Kling.
583
584         If shadow trees have identical inline stylesheets the data structures can be shared.
585         In future this will also allow sharing style resolvers.
586
587         * css/parser/CSSParserMode.h:
588         (WebCore::CSSParserContextHash::hash):
589         (WebCore::CSSParserContextHash::equal):
590         (WTF::HashTraits<WebCore::CSSParserContext>::constructDeletedValue):
591         (WTF::HashTraits<WebCore::CSSParserContext>::isDeletedValue):
592         (WTF::HashTraits<WebCore::CSSParserContext>::emptyValue):
593
594             Make CSSParserContext hashable.
595
596         * dom/InlineStyleSheetOwner.cpp:
597         (WebCore::makeInlineStyleSheetCacheKey):
598         (WebCore::inlineStyleSheetCache):
599
600             Implement a simple cache for sharing stylesheets with identical text and context.
601
602         (WebCore::InlineStyleSheetOwner::createSheet):
603         (WebCore::InlineStyleSheetOwner::clearCache):
604         * dom/InlineStyleSheetOwner.h:
605         * platform/MemoryPressureHandler.cpp:
606         (WebCore::MemoryPressureHandler::releaseNoncriticalMemory):
607
608 2016-10-13  Antti Koivisto  <antti@apple.com>
609
610         Revert patch landed with wrong commit message.
611
612 2016-10-12  Per Arne Vollan  <pvollan@apple.com>
613
614         [Win] Encode function pointers.
615         https://bugs.webkit.org/show_bug.cgi?id=163331
616
617         Reviewed by Brent Fulgham.
618
619         We should encode stored function pointers.
620
621         * platform/win/SoftLinking.h:
622
623 2016-10-13  Youenn Fablet  <youenn@apple.com>
624
625         Remove CachedResourceRequest::mutableResourceRequest
626         https://bugs.webkit.org/show_bug.cgi?id=163277
627
628         Reviewed by Sam Weinig.
629
630         No change of behavior.
631
632         Removing CachedResourceRequest::mutableResourceRequest requires call sites to either update the ResourceRequest
633         before creating the CachedResourceRequest or to add methods at CachedResourceRequest.
634
635         Adding CachedResourceRequest::releaseResourceRequest for CachedResource constructor.
636
637         Most new CachedResourceRequest methods are used by CachedResourceLoader which is passed a CachedResourceRequest.
638         This allows code in CachedResourceLoader to be easier to read.
639
640         * css/CSSImageSetValue.cpp:
641         (WebCore::CSSImageSetValue::loadBestFitImage):
642         * css/CSSImageValue.cpp:
643         (WebCore::CSSImageValue::loadImage):
644         * dom/ScriptElement.cpp:
645         (WebCore::ScriptElement::requestScriptWithCache):
646         * loader/CrossOriginAccessControl.cpp:
647         (WebCore::createAccessControlPreflightRequest):
648         * loader/CrossOriginAccessControl.h:
649         * loader/CrossOriginPreflightChecker.cpp:
650         (WebCore::CrossOriginPreflightChecker::startPreflight):
651         (WebCore::CrossOriginPreflightChecker::doPreflight):
652         * loader/DocumentThreadableLoader.cpp:
653         (WebCore::DocumentThreadableLoader::loadRequest):
654         * loader/MediaResourceLoader.cpp:
655         (WebCore::MediaResourceLoader::requestResource):
656         * loader/cache/CachedResource.cpp:
657         (WebCore::CachedResource::CachedResource):
658         * loader/cache/CachedResourceLoader.cpp:
659         (WebCore::CachedResourceLoader::requestImage):
660         (WebCore::CachedResourceLoader::requestUserCSSStyleSheet):
661         (WebCore::CachedResourceLoader::prepareFetch):
662         (WebCore::CachedResourceLoader::updateHTTPRequestHeaders):
663         (WebCore::CachedResourceLoader::requestResource):
664         (WebCore::acceptHeaderValueFromType): Deleted.
665         (WebCore::updateRequestAccordingCacheMode): Deleted.
666         * loader/cache/CachedResourceRequest.cpp:
667         (WebCore::CachedResourceRequest::setAsPotentiallyCrossOrigin):
668         (WebCore::CachedResourceRequest::updateForAccessControl):
669         (WebCore::CachedResourceRequest::upgradeInsecureRequestIfNeeded):
670         (WebCore::CachedResourceRequest::setDomainForCachePartition):
671         (WebCore::acceptHeaderValueFromType):
672         (WebCore::CachedResourceRequest::setAcceptHeaderIfNone):
673         (WebCore::CachedResourceRequest::updateAccordingCacheMode):
674         (WebCore::CachedResourceRequest::removeFragmentIdentifierIfNeeded):
675         (WebCore::CachedResourceRequest::applyBlockedStatus):
676         * loader/cache/CachedResourceRequest.h:
677         (WebCore::CachedResourceRequest::releaseResourceRequest):
678         (WebCore::CachedResourceRequest::setCachingPolicy):
679         (WebCore::CachedResourceRequest::mutableResourceRequest): Deleted.
680         (WebCore::CachedResourceRequest::setCacheModeToNoStore): Deleted.
681         * loader/icon/IconLoader.cpp:
682         (WebCore::IconLoader::startLoading):
683         * platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
684         (WebCore::WebCoreAVCFResourceLoader::startLoading):
685         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
686         (WebCore::WebCoreAVFResourceLoader::startLoading):
687
688 2016-10-13  Antti Koivisto  <antti@apple.com>
689
690         Support scoped style for user agent shadow trees
691         https://bugs.webkit.org/show_bug.cgi?id=163212
692         <rdar://problem/28715318>
693
694         Reviewed by Ryosuke Niwa and Andreas Kling.
695
696         This patch adds support for user agent shadow trees that have scoped style. This means
697         that the shadows can be styled via <style> elements contained in the tree instead of
698         using pseudo elements on the global UA sheet. Since the style is scoped it can use
699         normal id and class selectors.
700
701         Elements in the shadow tree can still be exposed for author styling if needed by giving
702         them pseudo ids
703
704         The patch also uses the new mechanism for the <meter> element.
705
706         The mechanism is not optimized yet, each shadow tree gets its own copy of style-related data
707         structures. This can be improved later.
708
709         * CMakeLists.txt:
710         * DerivedSources.make:
711         * WebCore.xcodeproj/project.pbxproj:
712         * css/ElementRuleCollector.cpp:
713         (WebCore::MatchRequest::MatchRequest):
714         (WebCore::ElementRuleCollector::addMatchedRule):
715         (WebCore::ElementRuleCollector::matchAuthorShadowPseudoElementRules):
716
717             Make treeContextOrdinal an int so we can use negative ordinals. This is used to allow author pseudo
718             elements from earlier tree context to win over the shadow tree (matching CSS scoping spec language).
719
720         * css/ElementRuleCollector.h:
721         * css/StyleResolver.cpp:
722         (WebCore::StyleResolver::MatchResult::addMatchedProperties):
723         (WebCore::StyleResolver::CascadedProperties::addImportantMatches):
724         * css/StyleResolver.h:
725         * css/html.css:
726         (meter::-webkit-meter-inner-element): Deleted.
727         (meter::-webkit-meter-bar): Deleted.
728         (meter::-webkit-meter-optimum-value): Deleted.
729         (meter::-webkit-meter-suboptimum-value): Deleted.
730         (meter::-webkit-meter-even-less-good-value): Deleted.
731
732             Remove meter pseudo elements from the UA sheet.
733
734         * html/HTMLMeterElement.cpp:
735         (WebCore::HTMLMeterElement::childShouldCreateRenderer):
736
737             Don't create shadow renderers when we have appearance (are using RenderMeter).
738
739         (WebCore::setValueClass):
740
741             Move this logic here from MeterShadowElement.cpp.
742             Set both class and pseudo id. The latter is needed to keep author styling working.
743
744         (WebCore::HTMLMeterElement::didElementStateChange):
745         (WebCore::HTMLMeterElement::renderMeter):
746
747             RenderMeter is now only instantiated when appearance is enabled.
748
749         (WebCore::HTMLMeterElement::didAddUserAgentShadowRoot):
750
751             Build the shadow tree out of <div>s instead of special shadow elements.
752
753         * html/HTMLMeterElement.h:
754         * html/shadow/MeterShadowElement.cpp: Removed.
755         * html/shadow/MeterShadowElement.h: Removed.
756
757             Not needed anymore.
758
759         * html/shadow/meterElementShadow.css: Added.
760         (div#inner):
761         (div#bar):
762         (div#value):
763         (div#value.optimum):
764         (div#value.suboptimum):
765         (div#value.even-less-good):
766
767             Stylesheet for meter element shadow tree using normal id and class selectors.
768
769         * style/StyleScope.cpp:
770         (WebCore::Style::Scope::shouldUseSharedUserAgentShadowTreeStyleResolver):
771
772             Switch to per-scope style resolver for UA shadow trees if there is stylesheets in the tree.
773
774         (WebCore::Style::Scope::resolver):
775         (WebCore::Style::Scope::resolverIfExists):
776         * style/StyleScope.h:
777
778 2016-10-12  Chris Dumez  <cdumez@apple.com>
779
780         [Web IDL] Drop support for legacy [ConstructorConditional=*]
781         https://bugs.webkit.org/show_bug.cgi?id=163368
782
783         Reviewed by Ryosuke Niwa.
784
785         Drop support for legacy [ConstructorConditional=*] webkit-specific IDL
786         extended attribute. This was introduced to disable DOM4 event
787         constructors at compile time. However, nowadays, those constructors are
788         enabled everywhere.
789
790         * Configurations/FeatureDefines.xcconfig:
791         * bindings/scripts/CodeGenerator.pm:
792         (GenerateConstructorConditionalString): Deleted.
793         * bindings/scripts/CodeGeneratorJS.pm:
794         (GenerateConstructorHelperMethods):
795         * bindings/scripts/IDLAttributes.txt:
796         * bindings/scripts/test/JS/JSTestInterface.cpp:
797         (WebCore::JSTestInterfaceConstructor::getConstructData): Deleted.
798         * bindings/scripts/test/TestInterface.idl:
799         * dom/UIEvent.idl:
800
801 2016-10-12  Chris Dumez  <cdumez@apple.com>
802
803         The bindings generator should provide a better error message when it does not find a dictionary definition
804         https://bugs.webkit.org/show_bug.cgi?id=163377
805
806         Reviewed by Ryosuke Niwa.
807
808         The bindings generator should provide a better error message when it does
809         not find a dictionary definition.
810
811         * bindings/scripts/CodeGenerator.pm:
812         (GetDictionaryByName):
813         * bindings/scripts/CodeGeneratorJS.pm:
814         (assert):
815         (GenerateDictionaryImplementationContent):
816         (GenerateHeader):
817         (GenerateDictionaryHeader):
818
819 2016-10-12  Chris Dumez  <cdumez@apple.com>
820
821         Update WebKitMediaKeyMessageEvent / WebKitMediaKeyNeededEvent to stop using legacy [ConstructorTemplate=Event]
822         https://bugs.webkit.org/show_bug.cgi?id=163369
823
824         Reviewed by Ryosuke Niwa.
825
826         Update WebKitMediaKeyMessageEvent / WebKitMediaKeyNeededEvent to stop
827         using legacy [ConstructorTemplate=Event] and use regular constructors
828         instead.
829
830         This also adds support for having dictionary members that are typed
831         arrays because this was needed.
832
833         Test: fast/events/webkit-media-key-events-constructor.html
834
835         * Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.cpp:
836         (WebCore::WebKitMediaKeyMessageEvent::WebKitMediaKeyMessageEvent):
837         * Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.h:
838         (WebCore::WebKitMediaKeyMessageEvent::create):
839         (WebCore::WebKitMediaKeyMessageEvent::createForBindings): Deleted.
840         * Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.idl:
841         * Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.cpp:
842         (WebCore::WebKitMediaKeyNeededEvent::WebKitMediaKeyNeededEvent):
843         * Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.h:
844         (WebCore::WebKitMediaKeyNeededEvent::create):
845         (WebCore::WebKitMediaKeyNeededEvent::createForBindings): Deleted.
846         * Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.idl:
847         * bindings/js/JSDOMConvert.h:
848         (WebCore::Converter<IDLInterface<JSC::GenericTypedArrayView<Adaptor>>>::convert):
849         * bindings/scripts/CodeGeneratorJS.pm:
850         (GenerateDefaultValue):
851         * dom/InputEvent.cpp:
852         (WebCore::InputEvent::InputEvent):
853         * dom/InputEvent.h:
854         * dom/InputEvent.idl:
855
856 2016-10-12  Chris Dumez  <cdumez@apple.com>
857
858         Update HTMLSelectElement::recalcListItems() to ignore nested optgroup elements
859         https://bugs.webkit.org/show_bug.cgi?id=163358
860
861         Reviewed by Kent Tamura.
862
863         Update HTMLSelectElement::recalcListItems() to ignore nested optgroup elements.
864         As per the specification, we only want optgroup elements that are direct
865         children of the select element. This also matches the behavior of Chrome.
866
867         Test: fast/dom/HTMLSelectElement/nested-optgroup.html
868
869         * html/HTMLSelectElement.cpp:
870         (WebCore::HTMLSelectElement::recalcListItems):
871
872 2016-10-12  Zalan Bujtas  <zalan@apple.com>
873
874         RenderRubyRun should not mark child renderers dirty at the end of layout.
875         https://bugs.webkit.org/show_bug.cgi?id=163359
876         <rdar://problem/28711840>
877
878         Reviewed by David Hyatt.
879
880         The current layout logic does not support marking renderers dirty for subsequent layouts.
881         Layout needs to exit with a clean tree.
882         Should relayoutChild be insufficient, we could also mark the base/text dirty for the justified content.
883
884         Test: fast/ruby/rubyrun-has-bad-child.html
885
886         * rendering/RenderBlockLineLayout.cpp:
887         (WebCore::RenderBlockFlow::updateRubyForJustifiedText):
888         * rendering/RenderRubyRun.cpp:
889         (WebCore::RenderRubyRun::layout):
890         (WebCore::RenderRubyRun::layoutBlock):
891         * rendering/RenderRubyRun.h:
892
893 2016-10-12  Simon Fraser  <simon.fraser@apple.com>
894
895         Crash when using megaplan.ru
896         https://bugs.webkit.org/show_bug.cgi?id=163276
897         rdar://problem/28446672
898
899         Reviewed by Sam Weinig.
900
901         Make sure we allocate enough space in the vector of CGPoints that we use for path building.
902
903         Test: css3/masking/large-clip-path.html
904
905         * platform/graphics/cg/PathCG.cpp:
906         (WebCore::Path::polygonPathFromPoints):
907
908 2016-10-12  Alex Christensen  <achristensen@webkit.org>
909
910         Fix out-of-bounds reading in URLParser when parsing improperly percent-encoded values
911         https://bugs.webkit.org/show_bug.cgi?id=163376
912
913         Reviewed by Saam Barati.
914
915         Covered by new API tests, which used to crash under asan.
916
917         * platform/URLParser.cpp:
918         (WebCore::percentDecode):
919         If you subtract 2 from size_t's smaller than 2, you're gonna have a bad time.
920
921 2016-10-12  Alex Christensen  <achristensen@webkit.org>
922
923         Mail needs nonspecial URLs to keep case in host and not have slash after host
924         https://bugs.webkit.org/show_bug.cgi?id=163373
925
926         Reviewed by Saam Barati.
927         
928         Mail uses urls like scheme://HoSt which were not changed when canonicalized 
929         before enabling the URLParser but now are canonicalized to scheme://host/
930         I manually verified this fixes the issue.
931         This should be reverted once Mail will accept modern canonicalized URLs.
932
933         * platform/URLParser.cpp:
934         (WebCore::URLParser::parse):
935         (WebCore::URLParser::parseHostAndPort):
936         * platform/URLParser.h:
937         If the application is mail and the scheme is nonspecial, don't make the host lower case and don't add a slash after the host.
938
939 2016-10-11  Dean Jackson  <dino@apple.com>
940
941         Add preliminary support for extended colors to WebCore::Color
942         https://bugs.webkit.org/show_bug.cgi?id=162878
943         <rdar://problem/28596413>
944
945         Reviewed by Darin Adler.
946
947         Add an ExtendedColor class that will hold the data necessary
948         for wider-than-sRGB (and more precise) colors. In order to
949         avoid increasing the size of Color, implement a tagged
950         pointer that is either referencing an ExtendedColor, or
951         is a 64-bit number with the top 32-bits being the RGBA, and
952         the bottom 2 bits indicating an invalid RGBA or a valid RGBA,
953         plus the tag.
954
955         Add copy constructors and operator= so that the new Color objects
956         are correctly copied.
957
958         There isn't yet a way to create an ExtendedColor. That's coming
959         in a followup patch (and will require changes to the CSS parser).
960
961         Covered by existing tests, and new API tests in Color.
962
963         * CMakeLists.txt:
964         * WebCore.xcodeproj/project.pbxproj: Add new files.
965
966         * platform/graphics/Color.cpp: Update everything to use m_rgbaAndFlags
967         instead of m_color + m_valid.
968         (WebCore::Color::Color):
969         (WebCore::Color::~Color):
970         (WebCore::Color::operator=):
971         (WebCore::Color::nameForRenderTreeAsText):
972         (WebCore::Color::setNamedColor):
973         (WebCore::Color::light):
974         (WebCore::Color::dark):
975         (WebCore::Color::setValid):
976         (WebCore::Color::setExtended):
977         (WebCore::Color::isExtended):
978         (WebCore::Color::asExtended):
979         * platform/graphics/Color.h: Implement the tagged union.
980         (WebCore::Color::Color):
981         (WebCore::Color::isValid):
982         (WebCore::Color::red):
983         (WebCore::Color::green):
984         (WebCore::Color::blue):
985         (WebCore::Color::alpha):
986         (WebCore::Color::rgb):
987         (WebCore::Color::setRGB):
988         (WebCore::operator==):
989
990         * platform/graphics/ExtendedColor.cpp: New file. Holds floating point
991         red, green, blue and alpha, plus a color space.
992         (WebCore::ExtendedColor::create):
993         (WebCore::ExtendedColor::~ExtendedColor):
994         (WebCore::ExtendedColor::ref):
995         (WebCore::ExtendedColor::deref):
996         * platform/graphics/ExtendedColor.h:
997         (WebCore::ExtendedColor::red):
998         (WebCore::ExtendedColor::green):
999         (WebCore::ExtendedColor::blue):
1000         (WebCore::ExtendedColor::alpha):
1001         (WebCore::ExtendedColor::colorSpace):
1002         (WebCore::ExtendedColor::ExtendedColor):
1003
1004         * platform/graphics/cg/ColorCG.cpp: Update the constructors for
1005         the platform specific color classes.
1006         (WebCore::Color::Color):
1007         * platform/graphics/gtk/ColorGtk.cpp:
1008         (WebCore::Color::Color):
1009         * platform/graphics/win/ColorDirect2D.cpp:
1010         (WebCore::Color::Color):
1011
1012         * rendering/RenderEmbeddedObject.cpp: Use NeverDestroyed.
1013         (WebCore::replacementTextRoundedRectPressedColor):
1014         (WebCore::replacementTextRoundedRectColor):
1015         (WebCore::replacementTextColor):
1016         (WebCore::unavailablePluginBorderColor):
1017
1018         * rendering/RenderFrameSet.cpp: Ditto.
1019         (WebCore::borderStartEdgeColor):
1020         (WebCore::borderEndEdgeColor):
1021         (WebCore::borderFillColor):
1022
1023         * rendering/RenderTableCell.cpp: This grows in size slightly
1024         because it can no longer pack bits.
1025
1026 2016-10-12  Antoine Quint  <graouts@apple.com>
1027
1028         [Modern Media Controls] Sliders: scrubber and volume
1029         https://bugs.webkit.org/show_bug.cgi?id=163328
1030         <rdar://problem/28733838>
1031
1032         Reviewed by Dean Jackson.
1033
1034         We add a new Slider class that provides a custom slider backed by an
1035         invisible <input type="range"> element and a fill underlay to provide
1036         a custom color between the left edge of the slider and the slider thumb.
1037         As the slider's value changes, a UI delegate receives messages to track
1038         such changes.
1039
1040         Tests: media/modern-media-controls/scrubber/scrubber.html
1041                media/modern-media-controls/slider/slider-constructor.html
1042                media/modern-media-controls/slider/slider-fill.html
1043                media/modern-media-controls/slider/slider-styles.html
1044                media/modern-media-controls/volume-slider/volume-slider-value.html
1045                media/modern-media-controls/volume-slider/volume-slider.html
1046
1047         * Modules/modern-media-controls/controls/scrubber.css: Added.
1048         (.scrubber.slider > input::-webkit-slider-thumb):
1049         * Modules/modern-media-controls/controls/scrubber.js: Added.
1050         (Scrubber):
1051         * Modules/modern-media-controls/controls/slider.css: Added.
1052         (.slider):
1053         (.slider > input,):
1054         (.slider > .fill):
1055         (.slider > input):
1056         (.slider > input::-webkit-slider-thumb):
1057         * Modules/modern-media-controls/controls/slider.js: Added.
1058         (Slider.prototype.get value):
1059         (Slider.prototype.set value):
1060         (Slider.prototype.get width):
1061         (Slider.prototype.set width):
1062         (Slider.prototype.handleEvent):
1063         (Slider.prototype.commitProperty):
1064         (Slider.prototype._handleInputEvent):
1065         (Slider.prototype._handleChangeEvent):
1066         (Slider.prototype._updateFill):
1067         * Modules/modern-media-controls/controls/volume-slider.css: Added.
1068         (.volume.slider > input::-webkit-slider-thumb):
1069         * Modules/modern-media-controls/controls/volume-slider.js: Added.
1070         (VolumeSlider):
1071
1072 2016-10-12  Wenson Hsieh  <wenson_hsieh@apple.com>
1073
1074         Add experimental support for the "formatForeColor" inputType
1075         https://bugs.webkit.org/show_bug.cgi?id=163348
1076         <rdar://problem/28739334>
1077
1078         Reviewed by Ryosuke Niwa.
1079
1080         Adds support for the "formatForeColor" attribute. This patch introduces a simple hook in Editor.cpp to extract
1081         data for an input event from an EditingStyle when performing an editing action.
1082
1083         Test: fast/events/input-events-forecolor-data.html
1084
1085         * editing/EditCommand.cpp:
1086         (WebCore::inputTypeNameForEditingAction):
1087         * editing/Editor.cpp:
1088         (WebCore::inputEventDataForEditingStyleAndAction):
1089
1090         Added a new static helper to compute the data attribute of an InputEvent when handling a style change.
1091
1092         (WebCore::Editor::computeAndSetTypingStyle):
1093
1094 2016-10-12  Chris Dumez  <cdumez@apple.com>
1095
1096         [Web IDL] Generated bindings include the wrong header when ImplementedAs is used on a dictionary
1097         https://bugs.webkit.org/show_bug.cgi?id=163352
1098
1099         Reviewed by Ryosuke Niwa.
1100
1101         Generated bindings include the wrong header when ImplementedAs is used
1102         on a dictionary.
1103
1104         * bindings/scripts/CodeGeneratorJS.pm:
1105         (GenerateDictionaryHeader):
1106         * bindings/scripts/test/JS/JSTestObj.cpp:
1107         (WebCore::jsTestObjPrototypeFunctionOperationWithExternalDictionaryParameterCaller):
1108         * bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
1109         (WebCore::convertDictionary<DictionaryImplName>):
1110         (WebCore::convertDictionary<TestStandaloneDictionary>): Deleted.
1111         * bindings/scripts/test/JS/JSTestStandaloneDictionary.h:
1112         * bindings/scripts/test/TestStandaloneDictionary.idl:
1113
1114 2016-10-12  Yusuke Suzuki  <utatane.tea@gmail.com>
1115
1116         [DOMJIT][JSC] Explore the way to embed nodeType into JSC::JSType in WebCore
1117         https://bugs.webkit.org/show_bug.cgi?id=163245
1118
1119         Reviewed by Filip Pizlo.
1120
1121         Node.nodeType accessor is so frequently called. For example, jQuery's $ function uses
1122         this to distinguish DOM objects from the other JS objects. So every time you call `$(dom)`,
1123         nodeType accessor is called. In addition to that, jQuery's prev, next, parent etc. also uses
1124         this `nodeType`. And Ember.js also uses it. And ... So this function is super critical for DOM
1125         performance.
1126
1127         The challenge is that there is no room for putting NodeType into C++ Node class. Node class
1128         has a 32bit field to store some data. However, these bits are already exhausted. Extending
1129         Node class is unacceptable since it significantly enlarges memory consumption of WebKit (Node
1130         is everywhere!). Unfortunately, current Node::nodeType is implemented as a virtual function
1131         even though this function is frequently called from JS world.
1132
1133         Interestingly, we already store some duplicate data in JSObject, JSC::JSType. WebCore already
1134         extends it with JSElementType, JSNodeType, and JSDocumentWrapperType. And these types are
1135         corresponding to specific NodeTypes. For example, JSElementType should have ELEMENT_NODE type.
1136
1137         This patch further extends this JSC::JSType in WebCore side safely. We embed NodeType bits into
1138         JSC::JSType. This design offers significantly faster nodeType implementation. Furthermore, it
1139         makes DOMJIT easy for nodeType accessor.
1140
1141         Even without the IC change[1], Dromaeo dom-query shows 8 - 10% improvement,
1142         1452.96 runs/s vs 1578.56 runs/s. We can expect that this improvement will be applied to the
1143         other benchmarks / real applications when the IC change is landed.
1144
1145         [1]: https://bugs.webkit.org/show_bug.cgi?id=163226
1146
1147         * WebCore.xcodeproj/project.pbxproj:
1148         * bindings/js/JSDOMWrapper.h:
1149         * bindings/js/JSNodeCustom.h:
1150         (WebCore::JSNode::nodeType):
1151         * bindings/scripts/CodeGeneratorJS.pm:
1152         (GetJSTypeForNode):
1153         (GenerateHeader):
1154         * dom/Node.idl:
1155         * dom/NodeConstants.h: Copied from Source/JavaScriptCore/domjit/DOMJITGetterSetter.h.
1156         * domjit/JSNodeDOMJIT.cpp:
1157         (WebCore::createCallDOMForOffsetAccess):
1158         (WebCore::NodeFirstChildDOMJIT::callDOM):
1159         (WebCore::NodeLastChildDOMJIT::callDOM):
1160         (WebCore::NodeNextSiblingDOMJIT::callDOM):
1161         (WebCore::NodePreviousSiblingDOMJIT::callDOM):
1162         (WebCore::NodeParentNodeDOMJIT::callDOM):
1163         (WebCore::NodeNodeTypeDOMJIT::checkDOM):
1164         (WebCore::NodeNodeTypeDOMJIT::callDOM):
1165
1166 2016-10-12  Chris Dumez  <cdumez@apple.com>
1167
1168         Update more events to stop using legacy [ConstructorTemplate=Event]
1169         https://bugs.webkit.org/show_bug.cgi?id=163339
1170
1171         Reviewed by Ryosuke Niwa.
1172
1173         Update more events to stop using legacy [ConstructorTemplate=Event]
1174         and use regular constructors instead.
1175
1176         No new tests, updated existing tests.
1177
1178         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
1179         (WebCore::convertDictionary<TestEventConstructor::Init>):
1180         (WebCore::JSTestEventConstructorConstructor::construct):
1181         (WebCore::JSTestEventConstructorConstructor::prototypeForStructure):
1182         (WebCore::JSTestEventConstructor::JSTestEventConstructor):
1183         (WebCore::JSTestEventConstructor::createPrototype):
1184         (WebCore::JSTestEventConstructorPrototype::create): Deleted.
1185         (WebCore::JSTestEventConstructorPrototype::createStructure): Deleted.
1186         (WebCore::JSTestEventConstructorPrototype::JSTestEventConstructorPrototype): Deleted.
1187         (WebCore::setJSTestEventConstructorConstructor): Deleted.
1188         (WebCore::JSTestEventConstructor::getConstructor): Deleted.
1189         * bindings/scripts/test/JS/JSTestEventConstructor.h:
1190         (WebCore::JSTestEventConstructor::wrapped):
1191         (WebCore::JSTestEventConstructor::create): Deleted.
1192         (WebCore::toJS): Deleted.
1193         (WebCore::toJSNewlyCreated): Deleted.
1194         * bindings/scripts/test/TestEventConstructor.idl:
1195         * css/CSSFontFaceLoadEvent.cpp:
1196         (WebCore::CSSFontFaceLoadEvent::CSSFontFaceLoadEvent):
1197         * css/CSSFontFaceLoadEvent.h:
1198         * css/CSSFontFaceLoadEvent.idl:
1199         * html/canvas/WebGLContextEvent.cpp:
1200         (WebCore::WebGLContextEvent::WebGLContextEvent):
1201         * html/canvas/WebGLContextEvent.h:
1202         * html/canvas/WebGLContextEvent.idl:
1203         * storage/StorageEvent.cpp:
1204         (WebCore::StorageEvent::create):
1205         (WebCore::StorageEvent::StorageEvent):
1206         * storage/StorageEvent.h:
1207         * storage/StorageEvent.idl:
1208
1209 2016-10-12  Andreas Kling  <akling@apple.com>
1210
1211         Make Document::existingAXObjectCache() fast with accessibility disabled.
1212         <https://webkit.org/b/163347>
1213
1214         Reviewed by Antti Koivisto.
1215
1216         Instruments says we were spending 2.3% of Dromaeo/dom-modify.html in this function,
1217         traversing ancestors. Track whether we've ever had a cache, and use that knowledge
1218         to return early if possible.
1219
1220         * dom/Document.cpp:
1221         (WebCore::Document::existingAXObjectCache):
1222         (WebCore::Document::axObjectCache):
1223
1224 2016-10-12  Jeremy Huddleston Sequoia  <jeremyhu@apple.com>
1225
1226         [SOUP] trunk r207192 fails to compile due to missing std::function being unavailable (missing #include <functional>)
1227         https://bugs.webkit.org/show_bug.cgi?id=163340
1228
1229         Reviewed by Michael Catanzaro.
1230
1231         * platform/network/soup/SoupNetworkSession.h: Add missing #include <functional>
1232
1233 2016-10-12  Brent Fulgham  <bfulgham@apple.com>
1234
1235         [WebGL] Revise vertex array attribute checks to account for lazy memory allocation.
1236         https://bugs.webkit.org/show_bug.cgi?id=163149
1237         <rdar://problem/28629774>
1238
1239         Reviewed by Dean Jackson.
1240
1241         Tested by fast/canvas/webgl/webgl-drawarrays-crash-2.html
1242
1243         * html/canvas/WebGLRenderingContextBase.cpp:
1244         (WebCore::WebGLRenderingContextBase::validateVertexAttributes):
1245
1246 2016-10-12  Wenson Hsieh  <wenson_hsieh@apple.com>
1247
1248         Now playing media sessions are always cleared for the active foreground tab
1249         https://bugs.webkit.org/show_bug.cgi?id=163310
1250         <rdar://problem/28573301>
1251
1252         Reviewed by Jer Noble.
1253
1254         Currently, we clear out Now Playing info whenever we set the visibility of Now Playing controls to Never. This
1255         is incorrect, as the Now Playing session needs to still be active (just not visible) in this state. Instead, we
1256         should not be taking the active/foregrounded-ness of a media session for Now Playing into account in
1257         MediaElementSession::canShowControlsManager so that even if a media session is in the active/foreground tab, we
1258         will update the Now Playing session with the latest info. However, when setting the visibility, we now check
1259         and see if the session allows Now Playing visibility, and set the Now Playing visibility to Always or Never
1260         depending on the answer.
1261
1262         Tweaked existing unit tests in NowPlayingControlsTests.
1263
1264         * html/MediaElementSession.cpp:
1265         (WebCore::MediaElementSession::canShowControlsManager):
1266         (WebCore::MediaElementSession::allowsNowPlayingControlsVisibility):
1267         (WebCore::MediaElementSession::pageAllowsNowPlayingControls): Deleted.
1268         * html/MediaElementSession.h:
1269         * platform/audio/PlatformMediaSession.h:
1270         (WebCore::PlatformMediaSession::allowsNowPlayingControlsVisibility):
1271         * platform/audio/mac/MediaSessionManagerMac.mm:
1272         (WebCore::MediaSessionManagerMac::updateNowPlayingInfo):
1273
1274 2016-10-12  Zalan Bujtas  <zalan@apple.com>
1275
1276         Refactor LineLayoutState's float box handling.
1277         https://bugs.webkit.org/show_bug.cgi?id=163286
1278
1279         Reviewed by David Hyatt.
1280         
1281         We keep track of float boxes both per line (RootInlineBox::m_floats) and
1282         per flow block (LineLayoutState::m_floats) during layout.
1283         As we lay out the lines and iterate through RootInlineBox::m_floats, we
1284         increment LineLayoutState::m_floatIndex. This LineLayoutState::m_floatIndex is
1285         later used to find the matching float box in the per-block-flow float list.
1286         This logic works fine as long as the lists and the index manipulation are tightly coded.
1287         However due to the complexity of the line/float layout code, this is no longer the case.
1288
1289         This patch makes float box handling more secure by changing this index based setup
1290         to a list iterator. It helps to eliminate potential vector overflow issues.
1291
1292         LineLayoutState::FloatList (new class) keeps track of all the floats for the block flow.
1293         It groups the float box related functions/members and provides an iterator interface to ensure safer
1294         syncing between this and the line based floats.
1295
1296         No change in functionality.
1297
1298         * rendering/RenderBlockFlow.h:
1299         * rendering/RenderBlockLineLayout.cpp:
1300         (WebCore::RenderBlockFlow::appendFloatingObjectToLastLine):
1301         (WebCore::repaintDirtyFloats):
1302         (WebCore::RenderBlockFlow::layoutRunsAndFloats):
1303         (WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
1304         (WebCore::RenderBlockFlow::linkToEndLineIfNeeded):
1305         (WebCore::RenderBlockFlow::layoutLineBoxes):
1306         (WebCore::RenderBlockFlow::checkFloatInCleanLine):
1307         (WebCore::RenderBlockFlow::determineStartPosition):
1308         (WebCore::RenderBlockFlow::determineEndPosition):
1309         (WebCore::RenderBlockFlow::repaintDirtyFloats): Deleted.
1310         (WebCore::RenderBlockFlow::checkFloatsInCleanLine): Deleted.
1311         * rendering/line/LineLayoutState.h:
1312         (WebCore::FloatWithRect::create):
1313         (WebCore::FloatWithRect::renderer):
1314         (WebCore::FloatWithRect::rect):
1315         (WebCore::FloatWithRect::everHadLayout):
1316         (WebCore::FloatWithRect::adjustRect):
1317         (WebCore::FloatWithRect::FloatWithRect):
1318         (WebCore::LineLayoutState::FloatList::append):
1319         (WebCore::LineLayoutState::FloatList::setLastFloat):
1320         (WebCore::LineLayoutState::FloatList::lastFloat):
1321         (WebCore::LineLayoutState::FloatList::setLastCleanFloat):
1322         (WebCore::LineLayoutState::FloatList::lastCleanFloat):
1323         (WebCore::LineLayoutState::FloatList::floatWithRect):
1324         (WebCore::LineLayoutState::FloatList::begin):
1325         (WebCore::LineLayoutState::FloatList::end):
1326         (WebCore::LineLayoutState::FloatList::find):
1327         (WebCore::LineLayoutState::FloatList::isEmpty):
1328         (WebCore::LineLayoutState::LineLayoutState):
1329         (WebCore::LineLayoutState::floatList):
1330         (WebCore::LineLayoutState::lastFloat): Deleted.
1331         (WebCore::LineLayoutState::setLastFloat): Deleted.
1332         (WebCore::LineLayoutState::floats): Deleted.
1333         (WebCore::LineLayoutState::floatIndex): Deleted.
1334         (WebCore::LineLayoutState::setFloatIndex): Deleted.
1335
1336 2016-10-12  Said Abou-Hallawa  <sabouhallawa@apple.com>
1337
1338         Unreviewed, fix Windows build break after r207182.
1339
1340         * platform/graphics/cg/ImageDecoderCG.cpp:
1341
1342 2016-10-12  Chris Dumez  <cdumez@apple.com>
1343
1344         Update remaining DOM events to stop using legacy [ConstructorTemplate=Event]
1345         https://bugs.webkit.org/show_bug.cgi?id=163319
1346
1347         Reviewed by Darin Adler.
1348
1349         Update remaining DOM events to stop using legacy [ConstructorTemplate=Event]
1350         and use regular constructors instead.
1351
1352         No new tests, updated existing tests.
1353
1354         * dom/AutocompleteErrorEvent.h:
1355         * dom/AutocompleteErrorEvent.idl:
1356         * dom/BeforeLoadEvent.h:
1357         * dom/BeforeLoadEvent.idl:
1358         * dom/CompositionEvent.cpp:
1359         (WebCore::CompositionEvent::CompositionEvent):
1360         * dom/CompositionEvent.h:
1361         * dom/CompositionEvent.idl:
1362         * dom/ErrorEvent.cpp:
1363         (WebCore::ErrorEvent::ErrorEvent):
1364         * dom/ErrorEvent.h:
1365         * dom/ErrorEvent.idl:
1366         * dom/FocusEvent.cpp:
1367         (WebCore::FocusEvent::FocusEvent):
1368         * dom/FocusEvent.h:
1369         * dom/FocusEvent.idl:
1370         * dom/HashChangeEvent.h:
1371         * dom/HashChangeEvent.idl:
1372         * dom/OverflowEvent.cpp:
1373         (WebCore::OverflowEvent::OverflowEvent):
1374         * dom/OverflowEvent.h:
1375         * dom/OverflowEvent.idl:
1376         * dom/PageTransitionEvent.cpp:
1377         (WebCore::PageTransitionEvent::PageTransitionEvent):
1378         * dom/PageTransitionEvent.h:
1379         * dom/PageTransitionEvent.idl:
1380         * dom/PopStateEvent.cpp:
1381         (WebCore::PopStateEvent::PopStateEvent):
1382         (WebCore::PopStateEvent::create):
1383         * dom/PopStateEvent.h:
1384         * dom/PopStateEvent.idl:
1385         * dom/SecurityPolicyViolationEvent.h:
1386         * dom/SecurityPolicyViolationEvent.idl:
1387         * dom/TouchEvent.cpp:
1388         (WebCore::TouchEvent::TouchEvent):
1389         * dom/TouchEvent.h:
1390         * dom/TouchEvent.idl:
1391         * dom/TransitionEvent.cpp:
1392         (WebCore::TransitionEvent::TransitionEvent):
1393         * dom/TransitionEvent.h:
1394         * dom/TransitionEvent.idl:
1395         * dom/WebKitAnimationEvent.cpp:
1396         (WebCore::WebKitAnimationEvent::WebKitAnimationEvent):
1397         * dom/WebKitAnimationEvent.h:
1398         * dom/WebKitAnimationEvent.idl:
1399         * dom/WebKitTransitionEvent.cpp:
1400         (WebCore::WebKitTransitionEvent::WebKitTransitionEvent):
1401         * dom/WebKitTransitionEvent.h:
1402         * dom/WebKitTransitionEvent.idl:
1403
1404 2016-10-12  Chris Dumez  <cdumez@apple.com>
1405
1406         Stop using PassRefPtr in platform/efl
1407         https://bugs.webkit.org/show_bug.cgi?id=163321
1408
1409         Reviewed by Laszlo Gombos.
1410
1411         Stop using PassRefPtr in platform/efl.
1412
1413         * platform/efl/BatteryProviderEfl.cpp:
1414         (WebCore::batteryProperties):
1415         (WebCore::BatteryProviderEfl::setBatteryStatus):
1416         (WebCore::BatteryProviderEfl::dispatchEvent):
1417         * platform/efl/BatteryProviderEfl.h:
1418         * platform/efl/BatteryProviderEflClient.h:
1419         * platform/efl/PlatformSpeechSynthesisProviderEfl.cpp:
1420         (WebCore::PlatformSpeechSynthesisProviderEfl::voiceName):
1421         (WebCore::PlatformSpeechSynthesisProviderEfl::speak):
1422         * platform/efl/PlatformSpeechSynthesisProviderEfl.h:
1423
1424 2016-10-12  Youenn Fablet  <youenn@apple.com>
1425
1426         Attribute setter binding generated code should use more references
1427         https://bugs.webkit.org/show_bug.cgi?id=163275
1428
1429         Reviewed by Alex Christensen.
1430
1431         No change of behavior.
1432
1433         * bindings/scripts/CodeGeneratorJS.pm:
1434         (JSValueToNative):
1435         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
1436         * bindings/scripts/test/JS/JSTestInterface.cpp:
1437         * bindings/scripts/test/JS/JSTestNode.cpp:
1438         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
1439         * bindings/scripts/test/JS/JSTestObj.cpp:
1440         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
1441         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
1442
1443 2016-10-11  Youenn Fablet  <youenn@apple.com>
1444
1445         Refactor binding generated casted-this checks for methods
1446         https://bugs.webkit.org/show_bug.cgi?id=163198
1447
1448         Reviewed by Darin Adler.
1449
1450         Covered by existing tests and binding rebased tests..
1451
1452         Introducing BindingCaller::callMethod and callPromiseMethod to encapsulate casted-this checks for methods.
1453         This is supported for all methods except seralizer and iterators methods.
1454
1455         Introduced castForMethod similarly to castForAttribute.
1456         Moved this from static methods of JSClass to static methods of BindingCaller<JSClass>
1457         This allows removing the corresponding declarations from JSClass header file.
1458
1459         Note the difference of handling thisValue between the two in case of CustomProxyToJSObject.
1460         This should be made more consistent.
1461
1462         In case of bad casted this check, CustomProxyToJSObject objects will throw a TypeError with an error message like other methods.
1463         Before the patch, a TypeError without error message was thrown.
1464
1465         EventTarget being different, added a specialization of BindingCaller for it.
1466         This allows also removing some binding generated code dedicated to EventTarget.
1467         A similar approach might also be done for CustomProxyToJSObject objects to further simplify the binding generator.
1468
1469
1470         * bindings/js/JSDOMBinding.cpp:
1471         (WebCore::rejectPromiseWithThisTypeError):
1472         * bindings/js/JSDOMBinding.h:
1473         (WebCore::BindingCaller::callPromiseMethod):
1474         (WebCore::BindingCaller::callMethod):
1475         * bindings/js/JSEventTargetCustom.h:
1476         (WebCore::BindingCaller<JSEventTarget>::callMethod):
1477         * bindings/scripts/CodeGeneratorJS.pm:
1478         (GenerateHeader):
1479         (GenerateImplementation):
1480         (GenerateFunctionCastedThis): Deleted.
1481         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
1482         * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
1483         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
1484         * bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
1485         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
1486         * bindings/scripts/test/JS/JSTestEventTarget.h:
1487         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
1488         * bindings/scripts/test/JS/JSTestGlobalObject.h:
1489         * bindings/scripts/test/JS/JSTestInterface.cpp:
1490         * bindings/scripts/test/JS/JSTestInterface.h:
1491         * bindings/scripts/test/JS/JSTestIterable.cpp:
1492         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
1493         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.h:
1494         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
1495         * bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
1496         * bindings/scripts/test/JS/JSTestNode.cpp:
1497         * bindings/scripts/test/JS/JSTestNode.h:
1498         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
1499         * bindings/scripts/test/JS/JSTestNondeterministic.h:
1500         * bindings/scripts/test/JS/JSTestObj.cpp:
1501         * bindings/scripts/test/JS/JSTestObj.h:
1502         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
1503         * bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
1504         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
1505         * bindings/scripts/test/JS/JSTestTypedefs.h:
1506
1507 2016-10-11  Youenn Fablet  <youenn@apple.com>
1508
1509         MediaResourceLoader::requestResource should take a ResourceRequest&& as input
1510         https://bugs.webkit.org/show_bug.cgi?id=160397
1511
1512         Reviewed by Alex Christensen.
1513
1514         No change in behavior.
1515
1516         * loader/MediaResourceLoader.cpp:
1517         (WebCore::MediaResourceLoader::requestResource): Passing a ResourceRequest&& as input parameter.
1518         * loader/MediaResourceLoader.h:
1519         * platform/graphics/PlatformMediaResourceLoader.h: Ditto.
1520         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
1521         (webKitWebSrcStart): Creating an extra copy since MediaResourceLoader::requestResource expects a Resourcerequest&&.
1522
1523 2016-10-11  Chris Dumez  <cdumez@apple.com>
1524
1525         Update AnimationEvent to stop using legacy [ConstructorTemplate=Event]
1526         https://bugs.webkit.org/show_bug.cgi?id=163312
1527
1528         Reviewed by Ryosuke Niwa.
1529
1530         Update AnimationEvent to stop using legacy [ConstructorTemplate=Event]
1531         and use a regular constructor as in the specification:
1532         - https://drafts.csswg.org/css-animations/#interface-animationevent
1533
1534         * dom/AnimationEvent.cpp:
1535         (WebCore::AnimationEvent::AnimationEvent):
1536         * dom/AnimationEvent.h:
1537         * dom/AnimationEvent.idl:
1538
1539 2016-10-11  Chris Dumez  <cdumez@apple.com>
1540
1541         Update DeviceProximityEvent to stop using legacy [ConstructorTemplate=Event]
1542         https://bugs.webkit.org/show_bug.cgi?id=163311
1543
1544         Reviewed by Ryosuke Niwa.
1545
1546         Update DeviceProximityEvent to stop using legacy [ConstructorTemplate=Event]
1547         and use a regular constructor instead, as in the specification:
1548         - https://www.w3.org/TR/2015/WD-proximity-20150903/#deviceproximityevent-interface
1549
1550         * Modules/proximity/DeviceProximityEvent.cpp:
1551         (WebCore::DeviceProximityEvent::DeviceProximityEvent):
1552         * Modules/proximity/DeviceProximityEvent.h:
1553         (WebCore::DeviceProximityEvent::create):
1554         (WebCore::DeviceProximityEventInit::DeviceProximityEventInit): Deleted.
1555         * Modules/proximity/DeviceProximityEvent.idl:
1556
1557 2016-10-11  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1558
1559         Unreviewed, EFL build fix because of r207173.
1560
1561         * testing/InternalSettings.cpp:
1562         (WebCore::InternalSettings::forcedPrefersReducedMotionValue):
1563
1564 2016-10-11  Said Abou-Hallawa  <sabouhallawa@apple.com>
1565
1566         [CG] Add the option to immediately decode an image frame and control its memory caching
1567         https://bugs.webkit.org/show_bug.cgi?id=163298
1568
1569         Reviewed by Simon Fraser.
1570
1571         This patch fixes two things. (1) An option is added to immediately decode an
1572         image frame. This can be done by adding kCGImageSourceShouldCacheImmediately
1573         to the ImageSource options dictionary. (2) BitmapImage should also control
1574         when the image frame is actually deleted from memory. This can be done by
1575         calling CGImageSourceCreateThumbnailAtIndex(). CG does not keep a reference
1576         to the returned CGImageRef.
1577
1578         * platform/graphics/ImageFrame.h: Adding the DecodingMode enum class.
1579         Ideally this should be a member of ImageDecoder class. But since we
1580         have three header files for ImageDecoder, this can be added here till
1581         the three files combined in one header file.
1582
1583         * platform/graphics/ImageFrameCache.cpp:
1584         (WebCore::ImageFrameCache::setRenderTarget): Deleted.
1585         * platform/graphics/ImageFrameCache.h:
1586         * platform/graphics/ImageSource.cpp:
1587         (WebCore::ImageSource::setRenderTarget):
1588         * platform/graphics/ImageSource.h:
1589         (WebCore::ImageSource::setRenderTarget): Deleted.
1590         Unrelated change. The native image decoder is available from the ImageSource.
1591         ImageSource::setTarget() does not need not to get it through ImageFrameCache.
1592         
1593         * platform/graphics/cg/ImageDecoderCG.cpp:
1594         (WebCore::createImageSourceOptions): Clean this function by using CFMutableDictionary.
1595         (WebCore::imageSourceOptions): Cache two default ImageSource options and create new
1596         ones for the non default cases.
1597
1598         (WebCore::ImageDecoder::createFrameImageAtIndex): Use the appropriate ImageSource function
1599
1600         * platform/graphics/cg/ImageDecoderCG.h:
1601         * platform/graphics/win/ImageDecoderDirect2D.cpp:
1602         (WebCore::ImageDecoder::createFrameImageAtIndex):
1603         * platform/graphics/win/ImageDecoderDirect2D.h:
1604         * platform/image-decoders/ImageDecoder.cpp:
1605         (WebCore::ImageDecoder::createFrameImageAtIndex):
1606         * platform/image-decoders/ImageDecoder.h:
1607          Change functions' signature to include a DecodingMode argument.
1608
1609 2016-10-11  Chris Dumez  <cdumez@apple.com>
1610
1611         select.options may return too many option elements
1612         https://bugs.webkit.org/show_bug.cgi?id=163296
1613
1614         Reviewed by Ryosuke Niwa.
1615
1616         select.options may return too many option elements. We're only supposed
1617         to return the option element children of the select element, and the
1618         option element children of all the optgroup element children of the
1619         select element, in tree order:
1620         - https://html.spec.whatwg.org/#dom-select-options
1621         - https://html.spec.whatwg.org/#concept-select-option-list
1622
1623         Firefox and Chrome agrees with the specification. However, WebKit was
1624         returning all the option elements that are descendants of the select
1625         element.
1626
1627         Test: imported/w3c/web-platform-tests/html/infrastructure/common-dom-interfaces/collections/htmloptionscollection.html
1628
1629         * html/HTMLOptionsCollection.h:
1630
1631 2016-10-11  Alex Christensen  <achristensen@webkit.org>
1632
1633         Fix assertion when creating first WebCore::URL from non-main thread after r207162
1634         https://bugs.webkit.org/show_bug.cgi?id=163304
1635
1636         Reviewed by Filip Pizlo.
1637
1638         This fixes assertions when running UserContentWorld.NormalWorld API tests.
1639
1640         * platform/text/TextEncodingRegistry.cpp:
1641         (WebCore::buildBaseTextCodecMaps):
1642         (WebCore::atomicCanonicalTextEncodingName):
1643         The new URLParser requires a TextEncoding& in its constructor, which defaults to UTF8Encoding.
1644         When creating the first TextEncoding in a process, it calls buildBaseTextCodecMaps which asserts
1645         it's on the main thread because it initializes static variables.  Since we are getting a lock right 
1646         after this call anyway, just put this function call inside the lock.
1647
1648 2016-10-11  Dean Jackson  <dino@apple.com>
1649
1650         color-gamut media query shouldn't ASSERT on invalid values
1651         https://bugs.webkit.org/show_bug.cgi?id=163303
1652         <rdar://problem/28724566>
1653
1654         Reviewed by Simon Fraser.
1655
1656         Remove the ASSERT_NOT_REACHED in the evaluation, since it
1657         can be hit when there is a valid CSS keyword that is not
1658         expected in the query.
1659
1660         Updated fast/media/mq-color-gamut.html
1661
1662         * css/MediaQueryEvaluator.cpp:
1663         (WebCore::colorGamutEvaluate):
1664
1665 2016-10-11  Chris Dumez  <cdumez@apple.com>
1666
1667         Update MediaStream events to stop using legacy [ConstructorTemplate=Event]
1668         https://bugs.webkit.org/show_bug.cgi?id=163289
1669
1670         Reviewed by Sam Weinig.
1671
1672         Update MediaStream events to stop using legacy [ConstructorTemplate=Event]
1673         and use regular constructors instead.
1674
1675         * Modules/mediastream/MediaStreamEvent.cpp:
1676         (WebCore::MediaStreamEvent::create):
1677         (WebCore::MediaStreamEvent::MediaStreamEvent):
1678         * Modules/mediastream/MediaStreamEvent.h:
1679         * Modules/mediastream/MediaStreamEvent.idl:
1680         * Modules/mediastream/MediaStreamTrackEvent.cpp:
1681         (WebCore::MediaStreamTrackEvent::create):
1682         (WebCore::MediaStreamTrackEvent::MediaStreamTrackEvent):
1683         * Modules/mediastream/MediaStreamTrackEvent.h:
1684         * Modules/mediastream/MediaStreamTrackEvent.idl:
1685         * Modules/mediastream/OverconstrainedErrorEvent.h:
1686         (WebCore::OverconstrainedErrorEvent::create):
1687         (WebCore::OverconstrainedErrorEvent::OverconstrainedErrorEvent):
1688         (WebCore::OverconstrainedErrorEvent::~OverconstrainedErrorEvent): Deleted.
1689         * Modules/mediastream/OverconstrainedErrorEvent.idl:
1690         * Modules/mediastream/RTCDTMFToneChangeEvent.cpp:
1691         (WebCore::RTCDTMFToneChangeEvent::create):
1692         (WebCore::RTCDTMFToneChangeEvent::RTCDTMFToneChangeEvent):
1693         * Modules/mediastream/RTCDTMFToneChangeEvent.h:
1694         * Modules/mediastream/RTCDTMFToneChangeEvent.idl:
1695         * Modules/mediastream/RTCTrackEvent.cpp:
1696         (WebCore::RTCTrackEvent::create):
1697         (WebCore::RTCTrackEvent::RTCTrackEvent):
1698         * Modules/mediastream/RTCTrackEvent.h:
1699         * Modules/mediastream/RTCTrackEvent.idl:
1700
1701 2016-10-11  Chris Dumez  <cdumez@apple.com>
1702
1703         Update UIRequestEvent to stop using legacy [ConstructorTemplate=Event]
1704         https://bugs.webkit.org/show_bug.cgi?id=163288
1705
1706         Reviewed by Darin Adler.
1707
1708         Update UIRequestEvent to stop using legacy [ConstructorTemplate=Event]
1709         and use a constructor as in the specification:
1710         - https://dvcs.w3.org/hg/IndieUI/raw-file/default/src/indie-ui-events.html#UIRequestEvent
1711
1712         * Modules/indieui/UIRequestEvent.cpp:
1713         (WebCore::UIRequestEvent::create):
1714         (WebCore::UIRequestEvent::UIRequestEvent):
1715         (WebCore::UIRequestEvent::createForBindings): Deleted.
1716         * Modules/indieui/UIRequestEvent.h:
1717         * Modules/indieui/UIRequestEvent.idl:
1718
1719 2016-10-11  Dean Jackson  <dino@apple.com>
1720
1721         Implement prefers-reduced-motion media query
1722         https://bugs.webkit.org/show_bug.cgi?id=163250
1723         <rdar://problem/28704129>
1724
1725         Reviewed by Simon Fraser.
1726
1727         Implement the prefers-reduced-motion media query, as
1728         described in https://github.com/w3c/csswg-drafts/issues/442.
1729
1730         Tests: fast/media/mq-prefers-reduced-motion-forced-value.html
1731                fast/media/mq-prefers-reduced-motion.html
1732
1733         * Configurations/WebCoreTestSupport.xcconfig: Link against AppKit and UIKit.
1734
1735         * css/CSSValueKeywords.in: New keyword for "reduce".
1736
1737         * css/MediaFeatureNames.h: Add prefers-reduced-motion.
1738         * css/MediaQueryEvaluator.cpp:
1739         (WebCore::prefersReducedMotionEvaluate):
1740         * css/MediaQueryExp.cpp:
1741         (WebCore::featureWithValidIdent):
1742         (WebCore::isFeatureValidWithoutValue):
1743
1744         * platform/Theme.h: New API to detect the system accessibility settings.
1745         (WebCore::Theme::userPrefersReducedMotion):
1746         * platform/ios/ThemeIOS.h:
1747         * platform/ios/ThemeIOS.mm:
1748         (WebCore::ThemeIOS::userPrefersReducedMotion):
1749         * platform/mac/ThemeMac.h:
1750         * platform/mac/ThemeMac.mm:
1751         (WebCore::ThemeMac::userPrefersReducedMotion):
1752
1753         * testing/Internals.cpp: Expose the same API to internals, so that
1754         a test can examine the value too.
1755         (WebCore::Internals::userPrefersReducedMotion):
1756         * testing/Internals.h:
1757         * testing/Internals.idl:
1758         * testing/Internals.mm:
1759         (WebCore::Internals::userPrefersReducedMotion):
1760
1761         * page/Settings.h: New setting to override the system value...
1762         * page/Settings.in:
1763
1764         * testing/InternalSettings.cpp: ... plumbed through internals.
1765         (WebCore::InternalSettings::Backup::Backup):
1766         (WebCore::InternalSettings::Backup::restoreTo):
1767         (WebCore::InternalSettings::forcedPrefersReducedMotionValue):
1768         (WebCore::InternalSettings::setForcedPrefersReducedMotionValue):
1769         * testing/InternalSettings.h:
1770         * testing/InternalSettings.idl:
1771         * testing/Internals.cpp:
1772         (WebCore::Internals::userPrefersReducedMotion):
1773         * testing/Internals.h:
1774         * testing/Internals.idl:
1775         * testing/Internals.mm:
1776         (WebCore::Internals::userPrefersReducedMotion):
1777
1778
1779 2016-10-10  Ryosuke Niwa  <rniwa@webkit.org>
1780
1781         Annotate DOM API with CEReactions
1782         https://bugs.webkit.org/show_bug.cgi?id=163268
1783
1784         Reviewed by Darin Adler.
1785
1786         Added CEReactions IDL attribute to APIs defined in https://dom.spec.whatwg.org.
1787
1788         No new tests since existing tests cover the code change.
1789         Added a dedicated code generation test: JSTestCEReactions.idl and TestCEReactionsStringifier.idl.
1790
1791         * bindings/scripts/CodeGeneratorJS.pm:
1792         (GenerateImplementation): Generate CustomElementReactionStack in attribute setters. In the case of PutForwards,
1793         check the extended attributes of the target attribute's stringifier.
1794         * bindings/scripts/test/JS/JSTestCEReactions.cpp: Added.
1795         * bindings/scripts/test/JS/JSTestCEReactions.h: Added.
1796         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp: Added.
1797         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.h: Added.
1798         * bindings/scripts/test/JS/JSTestObj.cpp:
1799         (WebCore::jsTestObjPrototypeFunctionMethodWithNeedsCustomElementReactionStack): Deleted.
1800         * bindings/scripts/test/TestCEReactions.idl: Added.
1801         * bindings/scripts/test/TestCEReactionsStringifier.idl: Added.
1802         * bindings/scripts/test/TestObj.idl:
1803         * dom/Attr.idl:
1804         * dom/ChildNode.idl:
1805         * dom/Document.idl:
1806         * dom/Element.idl:
1807         * dom/NamedNodeMap.idl:
1808         * dom/Node.idl:
1809         * dom/ParentNode.idl:
1810         * dom/Range.idl:
1811         * html/DOMTokenList.idl:
1812
1813 2016-10-11  Chris Dumez  <cdumez@apple.com>
1814
1815         Update CloseEvent to stop using legacy [ConstructorTemplate=Event]
1816         https://bugs.webkit.org/show_bug.cgi?id=163293
1817
1818         Reviewed by Darin Adler.
1819
1820         Update CloseEvent to stop using legacy [ConstructorTemplate=Event] and
1821         use a regular constructor as in the specification:
1822         - https://html.spec.whatwg.org/multipage/comms.html#the-closeevent-interfaces
1823
1824         No new tests, updated existing test.
1825
1826         * Modules/websockets/CloseEvent.h:
1827         (WebCore::CloseEvent::create):
1828         (WebCore::CloseEvent::CloseEvent):
1829         * Modules/websockets/CloseEvent.idl:
1830
1831 2016-10-11  Yusuke Suzuki  <utatane.tea@gmail.com>
1832
1833         [DOMJIT] DOMJIT::Patchpoint should have a way to receive constant folded arguments
1834         https://bugs.webkit.org/show_bug.cgi?id=163224
1835
1836         Reviewed by Filip Pizlo.
1837
1838         * domjit/DOMJITHelpers.h:
1839         (WebCore::DOMJITHelpers::toWrapper):
1840         * domjit/JSNodeDOMJIT.cpp:
1841         (WebCore::createCallDOMForOffsetAccess):
1842
1843 2016-10-11  Alex Christensen  <achristensen@webkit.org>
1844
1845         Enable URLParser by default
1846         https://bugs.webkit.org/show_bug.cgi?id=162660
1847         <rdar://28601706>
1848
1849         Reviewed by Sam Weinig.
1850
1851         Covered by updates to many LayoutTests.
1852
1853         * platform/URLParser.cpp:
1854         Make the default value true for URLParser::enabled.
1855         This is the most impactful and well-documented one-line change I've ever written.
1856
1857 2016-10-11  Daniel Bates  <dabates@apple.com>
1858
1859         [iOS] REGRESSION (r197953): User gesture required to load video in iOS 9-built apps
1860         https://bugs.webkit.org/show_bug.cgi?id=163244
1861         <rdar://problem/27250015>
1862
1863         Reviewed by Jer Noble.
1864
1865         Adds a new setting to toggle requiring a user gesture to load a video (enabled by default).
1866         Disable this setting for apps built against iOS 9 or earlier.
1867
1868         Tests: media/loadedmetadata-fires-without-user-gesture-when-setRequiresUserGestureToLoadVideo-false.html
1869                media/require-user-gesture-to-load-video.html
1870
1871         * html/HTMLMediaElement.cpp:
1872         (WebCore::HTMLMediaElement::HTMLMediaElement): Only require a user gesture to load a video
1873         when Settings::requiresUserGestureToLoadVideo() is true.
1874         * page/Settings.cpp: Enable setting requiresUserGestureToLoadVideo by default.
1875         * page/Settings.in: Add setting, requiresUserGestureToLoadVideo.
1876
1877 2016-10-11  Sam Weinig  <sam@webkit.org>
1878
1879         Fix the iOS build.
1880
1881         * bindings/js/JSDOMConvert.h:
1882
1883 2016-10-11  Daniel Bates  <dabates@apple.com>
1884
1885         [iOS] Sandbox QuickLook previews
1886         https://bugs.webkit.org/show_bug.cgi?id=163240
1887         <rdar://problem/25961633>
1888
1889         Fix bad merge following r207151.
1890
1891         * platform/network/cf/ResourceResponse.h: Define m_isQuickLook.
1892
1893 2016-10-11  Daniel Bates  <dabates@apple.com>
1894
1895         [iOS] Sandbox QuickLook previews
1896         https://bugs.webkit.org/show_bug.cgi?id=163240
1897         <rdar://problem/25961633>
1898
1899         Reviewed by Brent Fulgham.
1900
1901         Use a unique origin for- and limit the capabilities of- QuickLook previews.
1902
1903         Tests: http/tests/quicklook/at-import-stylesheet-blocked.html
1904                http/tests/quicklook/base-url-blocked.html
1905                http/tests/quicklook/cross-origin-iframe-blocked.html
1906                http/tests/quicklook/csp-header-ignored.html
1907                http/tests/quicklook/document-domain-is-empty-string.html
1908                http/tests/quicklook/external-stylesheet-blocked.html
1909                http/tests/quicklook/hide-referer-on-navigation.html
1910                http/tests/quicklook/submit-form-blocked.html
1911                http/tests/quicklook/top-navigation-blocked.html
1912
1913         * dom/Document.cpp:
1914         (WebCore::Document::processHttpEquiv): Call ContentSecurityPolicy::didReceiveHeader().
1915         (WebCore::Document::processReferrerPolicy): Do not process referrer policy for QuickLook previews.
1916         (WebCore::Document::initSecurityContext): Apply sandbox for QuickLook previews.
1917         (WebCore::Document::shouldEnforceQuickLookSandbox): Added.
1918         (WebCore::Document::applyQuickLookSandbox): Added.
1919         * dom/Document.h:
1920         * page/csp/ContentSecurityPolicy.h: Change accessibility of didReceiveHeader() from private to public.
1921         (WebCore::ContentSecurityPolicy::processHTTPEquiv): Deleted.
1922         * platform/network/cf/ResourceResponse.h:
1923         (WebCore::ResourceResponse::isQuickLook): Added.
1924         (WebCore::ResourceResponse::setIsQuickLook): Added.
1925         * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
1926         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveResponse): Modified to mark
1927         resource response as a QuickLook preview, if appropriate. Also remove the name of the first argument
1928         and the need to use UNUSED_PARAM(connection) as we no longer make use of the first argument
1929         following r207151.
1930         * platform/network/ios/QuickLook.mm:
1931         (-[WebResourceLoaderQuickLookDelegate _sendDidReceiveResponseIfNecessary]): Ditto.
1932         * platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
1933         (-[WebCoreResourceHandleAsDelegate connection:didReceiveResponse:]): Ditto. Fix style nits,
1934         including renaming the function argument "r" to "resource" to better describe its purpose.
1935
1936 2016-10-11  Alex Christensen  <achristensen@webkit.org>
1937
1938         Fix bindings tests after r207150.
1939
1940         * bindings/scripts/test/JS/JSTestObj.cpp:
1941         (WebCore::convertDictionary<TestObj::Dictionary>):
1942
1943 2016-10-11  Alex Christensen  <achristensen@webkit.org>
1944
1945         URLParser should percent-encode non-ASCII and non-printable characters in fragment
1946         https://bugs.webkit.org/show_bug.cgi?id=163287
1947
1948         Reviewed by Brady Eidson.
1949
1950         Based on discussion in https://github.com/whatwg/url/issues/150
1951         If that discussion decides to keep the spec as-is (which keeps non-ASCII characters in the fragment
1952         to match IE and Edge's behavior, which Chrome has followed for special schemes) then we can revert
1953         this change later after enabling the URL parser.  Making this change keeps behavior matching Safari
1954         and Firefox, as well as Chrome's handling of non-special schemes, such as data URLs.
1955
1956         Covered by updated API tests.
1957
1958         * platform/URLParser.cpp:
1959         (WebCore::URLParser::appendToASCIIBuffer):
1960         (WebCore::URLParser::copyURLPartsUntil):
1961         (WebCore::URLParser::syntaxViolation):
1962         (WebCore::URLParser::currentPosition):
1963         (WebCore::URLParser::parse):
1964         (WebCore::URLParser::fragmentSyntaxViolation): Deleted.
1965         * platform/URLParser.h:
1966         No more non-ASCII characters in canonicalized URLs.
1967
1968 2016-10-11  Alex Christensen  <achristensen@webkit.org>
1969
1970         Remove dead networking code
1971         https://bugs.webkit.org/show_bug.cgi?id=163263
1972
1973         Reviewed by Daniel Bates.
1974
1975         There are no more Cocoa platforms using CFURLConnection.
1976         USE(CFNETWORK) is being replaced by USE(CFURLCONNECTION) and it is only used on the AppleWin port.
1977
1978         No change in behavior.
1979
1980         * WebCore.xcodeproj/project.pbxproj:
1981         * WebCorePrefix.h:
1982         * loader/DocumentLoader.h:
1983         * loader/EmptyClients.h:
1984         * loader/FrameLoaderClient.h:
1985         * loader/ResourceLoader.cpp:
1986         (WebCore::ResourceLoader::didReceiveAuthenticationChallenge):
1987         * loader/ResourceLoader.h:
1988         * loader/SubresourceLoader.h:
1989         * loader/cf/ResourceLoaderCFNet.cpp:
1990         * loader/cocoa/SubresourceLoaderCocoa.mm:
1991         (WebCore::SubresourceLoader::willCacheResponse): Deleted.
1992         * loader/mac/DocumentLoaderMac.cpp:
1993         * loader/mac/ResourceLoaderMac.mm:
1994         (WebCore::ResourceLoader::willCacheResponse): Deleted.
1995         * page/mac/PageMac.mm:
1996         (WebCore::Page::platformInitialize):
1997         (WebCore::Page::addSchedulePair):
1998         (WebCore::Page::removeSchedulePair):
1999         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2000         (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForResponseToAuthenticationChallenge):
2001         (WebCore::WebCoreNSURLAuthenticationChallengeClient::create): Deleted.
2002         (WebCore::WebCoreNSURLAuthenticationChallengeClient::WebCoreNSURLAuthenticationChallengeClient): Deleted.
2003         * platform/mac/WebCoreSystemInterface.h:
2004         * platform/network/NetworkStorageSession.h:
2005         * platform/network/ProtectionSpace.h:
2006         * platform/network/ProtectionSpaceBase.cpp:
2007         * platform/network/ResourceHandle.cpp:
2008         * platform/network/ResourceHandle.h:
2009         * platform/network/ResourceHandleClient.cpp:
2010         * platform/network/ResourceHandleClient.h:
2011         (WebCore::ResourceHandleClient::willCacheResponse):
2012         (WebCore::ResourceHandleClient::shouldCacheResponse):
2013         * platform/network/ResourceHandleInternal.h:
2014         (WebCore::ResourceHandleInternal::ResourceHandleInternal):
2015         * platform/network/ResourceRequestBase.cpp:
2016         * platform/network/cf/AuthenticationCF.cpp:
2017         (WebCore::AuthenticationChallenge::AuthenticationChallenge):
2018         (WebCore::createCF):
2019         (WebCore::core):
2020         * platform/network/cf/AuthenticationCF.h:
2021         * platform/network/cf/AuthenticationChallenge.h:
2022         * platform/network/cf/CookieJarCFNet.cpp:
2023         * platform/network/cf/CredentialStorageCFNet.cpp:
2024         (WebCore::CredentialStorage::getFromPersistentStorage):
2025         (WebCore::CredentialStorage::saveToPersistentStorage): Deleted.
2026         * platform/network/cf/LoaderRunLoopCF.cpp:
2027         * platform/network/cf/LoaderRunLoopCF.h:
2028         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
2029         (WebCore::NetworkStorageSession::cookieStorage):
2030         * platform/network/cf/ProtectionSpaceCFNet.cpp:
2031         * platform/network/cf/ProtectionSpaceCFNet.h:
2032         * platform/network/cf/ResourceError.h:
2033         * platform/network/cf/ResourceErrorCF.cpp:
2034         * platform/network/cf/ResourceHandleCFNet.cpp:
2035         (WebCore::shouldSniffConnectionProperty):
2036         (WebCore::ResourceHandle::createCFURLConnection):
2037         (WebCore::ResourceHandle::start):
2038         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
2039         (WebCore::ResourceHandle::tryHandlePasswordBasedAuthentication):
2040         (WebCore::ResourceHandle::receivedCredential):
2041         (WebCore::ResourceHandle::schedule): Deleted.
2042         (WebCore::ResourceHandle::unschedule): Deleted.
2043         * platform/network/cf/ResourceHandleCFURLConnectionDelegate.cpp:
2044         * platform/network/cf/ResourceHandleCFURLConnectionDelegate.h:
2045         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
2046         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::setupRequest):
2047         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
2048         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::canRespondToProtectionSpace):
2049         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.h:
2050         * platform/network/cf/ResourceRequest.h:
2051         (WebCore::ResourceRequest::encodingRequiresPlatformData):
2052         * platform/network/cf/ResourceRequestCFNet.cpp:
2053         (WebCore::findCFURLRequestCopyContentDispositionEncodingFallbackArrayFunction):
2054         (WebCore::ResourceRequest::doUpdatePlatformRequest):
2055         (WebCore::ResourceRequest::doUpdatePlatformHTTPBody):
2056         (WebCore::ResourceRequest::doUpdateResourceRequest):
2057         (WebCore::ResourceRequest::setStorageSession):
2058         (WebCore::findCFURLRequestSetContentDispositionEncodingFallbackArrayFunction): Deleted.
2059         * platform/network/cf/ResourceRequestCFNet.h:
2060         * platform/network/cf/ResourceResponse.h:
2061         (WebCore::ResourceResponse::ResourceResponse):
2062         * platform/network/cf/ResourceResponseCFNet.cpp:
2063         (WebCore::ResourceResponse::cfURLResponse):
2064         (WebCore::ResourceResponse::platformCertificateInfo):
2065         * platform/network/cf/SynchronousLoaderClientCFNet.cpp:
2066         * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
2067         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::setupRequest):
2068         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::setupConnectionScheduling):
2069         (WebCore::adjustMIMETypeIfNecessary):
2070         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveResponse):
2071         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::willCacheResponse):
2072         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::canRespondToProtectionSpace):
2073         * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.h:
2074         * platform/network/cocoa/CredentialCocoa.h:
2075         * platform/network/cocoa/CredentialCocoa.mm:
2076         (WebCore::Credential::Credential): Deleted.
2077         (WebCore::Credential::cfCredential): Deleted.
2078         * platform/network/cocoa/ProtectionSpaceCocoa.h:
2079         * platform/network/cocoa/ProtectionSpaceCocoa.mm:
2080         (WebCore::ProtectionSpace::ProtectionSpace): Deleted.
2081         (WebCore::ProtectionSpace::cfSpace): Deleted.
2082         * platform/network/cocoa/ResourceRequestCocoa.mm:
2083         (WebCore::ResourceRequest::nsURLRequest):
2084         * platform/network/cocoa/ResourceResponseCocoa.mm:
2085         (WebCore::ResourceResponse::platformCertificateInfo):
2086         (WebCore::ResourceResponse::nsURLResponse): Deleted.
2087         (WebCore::ResourceResponse::ResourceResponse): Deleted.
2088         * platform/network/ios/QuickLook.h:
2089         * platform/network/ios/QuickLook.mm:
2090         (-[WebQuickLookHandleAsDelegate initWithConnectionDelegate:]): Deleted.
2091         (-[WebQuickLookHandleAsDelegate connection:didReceiveDataArray:]): Deleted.
2092         (-[WebQuickLookHandleAsDelegate connection:didReceiveData:lengthReceived:]): Deleted.
2093         (-[WebQuickLookHandleAsDelegate connectionDidFinishLoading:]): Deleted.
2094         (-[WebQuickLookHandleAsDelegate connection:didFailWithError:]): Deleted.
2095         (-[WebQuickLookHandleAsDelegate detachHandle]): Deleted.
2096         (WebCore::QuickLookHandle::create): Deleted.
2097         (WebCore::QuickLookHandle::cfResponse): Deleted.
2098         * platform/network/ios/ResourceHandleIOS.mm: Removed.
2099         * platform/network/ios/ResourceRequestIOS.mm: Removed.
2100         * platform/network/mac/AuthenticationMac.mm:
2101         (-[WebCoreAuthenticationClientAsChallengeSender setCFChallenge:]): Deleted.
2102         (-[WebCoreAuthenticationClientAsChallengeSender cfChallenge]): Deleted.
2103         (WebCore::core): Deleted.
2104         (WebCore::mac): Deleted.
2105         * platform/network/mac/CookieJarMac.mm:
2106         (WebCore::setCookiesFromDOM):
2107         (WebCore::cookieStorage):
2108         (WebCore::addCookie):
2109         * platform/network/mac/CredentialStorageMac.mm:
2110         * platform/network/mac/FormDataStreamMac.h:
2111         * platform/network/mac/FormDataStreamMac.mm:
2112         * platform/network/mac/ResourceErrorMac.mm:
2113         (NSErrorFromCFError): Deleted.
2114         (WebCore::ResourceError::ResourceError): Deleted.
2115         (WebCore::ResourceError::nsError): Deleted.
2116         (WebCore::ResourceError::operator NSError *): Deleted.
2117         * platform/network/mac/ResourceHandleMac.mm:
2118         (WebCore::ResourceHandle::continueWillCacheResponse):
2119         (WebCore::ResourceHandle::getConnectionTimingData): Deleted.
2120         * platform/network/mac/ResourceRequestMac.mm: Removed.
2121         * platform/network/mac/SynchronousLoaderClient.mm:
2122         (WebCore::SynchronousLoaderClient::platformBadResponseError):
2123         * platform/network/mac/WebCoreResourceHandleAsDelegate.h:
2124         * platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
2125         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.h:
2126         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
2127         * platform/network/mac/WebCoreURLResponse.mm:
2128         (WebCore::synthesizeRedirectResponseIfNecessary):
2129         * platform/win/TemporaryLinkStubs.cpp:
2130         * testing/js/WebCoreTestSupportPrefix.h:
2131
2132 2016-10-10  Sam Weinig  <sam@webkit.org>
2133
2134         Use IDLTypes in more places
2135         https://bugs.webkit.org/show_bug.cgi?id=163247
2136
2137         Reviewed by Darin Adler.
2138
2139         Switch JS -> Native type conversions to use convert<IDLType>(...) rather
2140         than convert<NativeType>(...). This allows us to differentiate things like
2141         conversion from JSValue to DOMString vs. JSValue to USVString which have different
2142         rules.
2143
2144         * bindings/generic/IDLTypes.h:
2145         Add predicate for integer types.
2146
2147         * bindings/js/IDBBindingUtilities.cpp:
2148         (WebCore::idbKeyPathFromValue):
2149         * bindings/js/JSApplePaySessionCustom.cpp:
2150         (WebCore::JSApplePaySession::completeShippingMethodSelection):
2151         (WebCore::JSApplePaySession::completeShippingContactSelection):
2152         * bindings/js/JSCryptoAlgorithmDictionary.cpp:
2153         (WebCore::createAesKeyGenParams):
2154         (WebCore::createRsaKeyGenParams):
2155         * bindings/js/JSCustomElementRegistryCustom.cpp:
2156         (WebCore::JSCustomElementRegistry::define):
2157         * bindings/js/JSDocumentCustom.cpp:
2158         (WebCore::JSDocument::getCSSCanvasContext):
2159         * bindings/js/JSMockContentFilterSettingsCustom.cpp:
2160         (WebCore::JSMockContentFilterSettings::setDecisionPoint):
2161         (WebCore::toDecision):
2162         * bindings/js/JSNodeFilterCustom.cpp:
2163         (WebCore::JSNodeFilter::acceptNode):
2164         Switch to new convert<IDLType> style.
2165
2166         * bindings/js/JSDOMBinding.h:
2167         (WebCore::toRefPtrNativeArray): Deleted.
2168         (WebCore::toNativeArray): Deleted.
2169         These can now be called as convert<IDLSequence<IDLInterface<T>>> and convert<IDLType> respectively.
2170
2171         * bindings/js/JSDOMConvert.h:
2172         (WebCore::Converter<IDLNullable<T>>::convert):
2173         (WebCore::Converter<IDLBoolean>::convert):
2174         (WebCore::Converter<IDLInterface<T>>::convert):
2175         (WebCore::Converter<IDLByte>::convert):
2176         (WebCore::Converter<IDLOctet>::convert):
2177         (WebCore::Converter<IDLShort>::convert):
2178         (WebCore::Converter<IDLUnsignedShort>::convert):
2179         (WebCore::Converter<IDLLong>::convert):
2180         (WebCore::Converter<IDLUnsignedLong>::convert):
2181         (WebCore::Converter<IDLLongLong>::convert):
2182         (WebCore::Converter<IDLUnsignedLongLong>::convert):
2183         (WebCore::Converter<IDLFloat>::convert):
2184         (WebCore::Converter<IDLUnrestrictedFloat>::convert):
2185         (WebCore::Converter<IDLDouble>::convert):
2186         (WebCore::Converter<IDLUnrestrictedDouble>::convert):
2187         (WebCore::Converter<IDLDOMString>::convert):
2188         (WebCore::Converter<IDLUSVString>::convert):
2189         (WebCore::Detail::ArrayConverter::convert):
2190         (WebCore::Converter<IDLSequence<T>>::convert):
2191         (WebCore::Converter<IDLFrozenArray<T>>::convert):
2192         (WebCore::Converter<IDLDictionary<T>>::convert):
2193         (WebCore::Converter<IDLEnumeration<T>>::convert):
2194         (WebCore::Detail::VariadicConverterBase::convert):
2195         (WebCore::Detail::VariadicConverterBase<IDLInterface<T>>::convert):
2196         (WebCore::convertVariadicArguments):
2197         (WebCore::convertWrapperType): Deleted.
2198         (WebCore::convertWrapperTypeSequence): Deleted.
2199         (WebCore::Converter<bool>::convert): Deleted.
2200         (WebCore::Converter<String>::convert): Deleted.
2201         (WebCore::Converter<Vector<T>>::convert): Deleted.
2202         (WebCore::Converter<int8_t>::convert): Deleted.
2203         (WebCore::Converter<uint8_t>::convert): Deleted.
2204         (WebCore::Converter<int16_t>::convert): Deleted.
2205         (WebCore::Converter<uint16_t>::convert): Deleted.
2206         (WebCore::Converter<int32_t>::convert): Deleted.
2207         (WebCore::Converter<uint32_t>::convert): Deleted.
2208         (WebCore::Converter<int64_t>::convert): Deleted.
2209         (WebCore::Converter<uint64_t>::convert): Deleted.
2210         Switch Converter to be specialized on IDLTypes. Add support for IDLNullable, IDLSequence, and IDLFrozenArray.
2211
2212         * bindings/scripts/CodeGenerator.pm:
2213         (GetFlattenedMemberTypes): Deleted.
2214         (GetNumberOfNullableMemberTypes): Deleted.
2215         (GetIDLUnionMemberTypes): Deleted.
2216         (GetBaseIDLType): Deleted.
2217         (GetIDLType): Deleted.
2218         Move IDLType conversion logic to CodeGeneratorJS so it can use GetEnumerationClassName and GetDictionaryClassName.
2219
2220         * bindings/scripts/CodeGeneratorJS.pm:
2221         (AddToImplIncludesForIDLType):
2222         Add support for sequences, FrozenArrays and external dictionaries.
2223
2224         (GenerateEnumerationsImplementationContent):
2225         (GenerateEnumerationsHeaderContent):
2226         Change the name of parse<enum> and convert<enum> to parseEnumeration<enum> and convertEnumeration<enum>
2227         to make them more consistent with dictionary conversion specialization and not interfere with the convert
2228         function specialization.
2229
2230         (GenerateDictionaryImplementationContent):
2231         Simplify by using convert<IDLType>.
2232
2233         (GetFlattenedMemberTypes):
2234         (GetNumberOfNullableMemberTypes):
2235         (GetIDLUnionMemberTypes):
2236         (GetBaseIDLType):
2237         (GetIDLType):
2238         Moved from CodeGenerator.pm
2239
2240         (IsHandledByDOMConvert):
2241         (JSValueToNative):
2242         Start switching JSValueToNative over to using convert<IDLType>. Use IsHandledByDOMConvert as a predicate
2243         for what is supported.
2244
2245         * bindings/scripts/IDLParser.pm:
2246         (applyTypedefs):
2247         (cloneType):
2248         (applyTypedefsForSignature):
2249         (parseTypedef):
2250         (parseOperationOrIterator):
2251         (parseSpecialOperation):
2252         Make typedefs work with aggregate types (unions, sequences and FrozenArrays).
2253
2254         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
2255         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
2256         * bindings/scripts/test/JS/JSTestObj.cpp:
2257         * bindings/scripts/test/JS/JSTestObj.h:
2258         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
2259         * bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
2260         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2261         Update test results.
2262
2263         * bindings/scripts/test/TestTypedefs.idl:
2264         Add additional tests for typedefs that use unions and sequences.
2265
2266         * testing/InternalSettings.idl:
2267         Change the name of a parameter to avoid a name collision.
2268
2269 2016-10-11  Konstantin Tokarev  <annulen@yandex.ru>
2270
2271         Fixed compilation with !ENABLE(SVG_FONTS)
2272         https://bugs.webkit.org/show_bug.cgi?id=163281
2273
2274         Reviewed by Csaba Osztrogon√°c.
2275
2276         No new tests needed.
2277
2278         * loader/cache/CachedResourceLoader.cpp:
2279         (WebCore::CachedResourceLoader::shouldUpdateCachedResourceWithCurrentRequest):
2280
2281 2016-10-11  Brent Fulgham  <bfulgham@apple.com>
2282
2283         Unreviewed build fix after r207140.
2284
2285         * PlatformAppleWin.cmake: Add missing compile file.
2286
2287 2016-10-10  Brent Fulgham  <bfulgham@apple.com>
2288
2289         [Win][Direct2D] Add initial Pattern handling implementation
2290         https://bugs.webkit.org/show_bug.cgi?id=163270
2291
2292         Reviewed by Simon Fraser.
2293
2294         Provide an implemenation of Patterns for Direct2D.
2295
2296         No new tests. Covered by fast/borders/border-image-01.html and others.
2297
2298         * platform/graphics/GraphicsContext.h:
2299         * platform/graphics/Pattern.h: Add D2D definitions.
2300         * platform/graphics/win/GraphicsContextDirect2D.cpp:
2301         (WebCore::GraphicsContext::solidStrokeBrush): Use a more generic return type.
2302         (WebCore::GraphicsContext::solidFillBrush): Ditto.
2303         (WebCore::GraphicsContext::patternStrokeBrush): Added.
2304         (WebCore::GraphicsContext::patternFillBrush): Added.
2305         (WebCore::GraphicsContext::drawPattern): Provide D2D implementation.
2306         (WebCore::GraphicsContext::applyStrokePattern): Ditto.
2307         (WebCore::GraphicsContext::applyFillPattern): Ditto.
2308         (WebCore::GraphicsContext::drawPath): Use stroke pattern if available.
2309         (WebCore::GraphicsContext::fillPath): Use fill pattern if available.
2310         (WebCore::GraphicsContext::strokePath): Use stroke pattern if available.
2311         (WebCore::GraphicsContext::fillRect): Use fill pattern if available.
2312         * platform/graphics/win/GraphicsContextPlatformPrivateDirect2D.h:
2313         * platform/graphics/win/PatternDirect2D.cpp: Added.
2314
2315 2016-10-11  Per Arne Vollan  <pvollan@apple.com>
2316
2317         [Win] Compile fix.
2318         https://bugs.webkit.org/show_bug.cgi?id=163272
2319
2320         Reviewed by Brent Fulgham.
2321
2322         When compiling with older SDKs, some CoreText symbols are redefined.
2323         This patch checks if the relevant CoreText header file has been
2324         included before defining the symbol.
2325
2326         * platform/spi/win/CoreTextSPIWin.h:
2327
2328 2016-10-11  Antoine Quint  <graouts@apple.com>
2329
2330         [Modern Media Controls] Buttons container
2331         https://bugs.webkit.org/show_bug.cgi?id=163238
2332         <rdar://problem/28701864>
2333
2334         Reviewed by Dean Jackson.
2335
2336         We add a new ButtonsContainer class which contains a group of Button objects
2337         and positions them based on the provided padding and margin between buttons.
2338         Buttons that aren't enabled or marked as dropped are not added to the tree of
2339         LayoutNodes, and thus the DOM.
2340
2341         Additionally, we fix a few issues we found while working on tests for ButtonsContainer
2342         where LayoutNodes would schedule layout callbacks even when they would not do any work
2343         during the layout callback due to not resetting the `needsLayout` flag to false and
2344         removing any scheduled tasks when a layout was completed.
2345
2346         Finally, we fix a few style issues that had not been caught so far and an unused
2347         `size` property on IconButton.
2348
2349         Tests: media/modern-media-controls/buttons-container/buttons-container-buttons-property.html
2350                media/modern-media-controls/buttons-container/buttons-container-constructor.html
2351                media/modern-media-controls/buttons-container/buttons-container-layout.html
2352
2353         * Modules/modern-media-controls/controls/airplay-button.js:
2354         (AirplayButton.prototype.set on):
2355         (AirplayButton):
2356         * Modules/modern-media-controls/controls/buttons-container.css:
2357         (.buttons-container):
2358         * Modules/modern-media-controls/controls/buttons-container.js:
2359         (ButtonsContainer.prototype.get buttons):
2360         (ButtonsContainer.prototype.set buttons):
2361         (ButtonsContainer.prototype.layout):
2362         * Modules/modern-media-controls/controls/icon-button.js:
2363         * Modules/modern-media-controls/controls/layout-node.js:
2364         (LayoutNode.prototype.set needsLayout):
2365         (LayoutNode.prototype.markDirtyProperty):
2366         (LayoutNode.prototype._markNodeManipulation):
2367         (LayoutNode.prototype._updateDirtyState):
2368         (performScheduledLayout):
2369         (elementFromString):
2370         * Modules/modern-media-controls/controls/scheduler.js:
2371         (const.scheduler.new.prototype.unscheduleLayout):
2372
2373 2016-10-11  Youenn Fablet  <youenn@apple.com>
2374
2375         [Fetch API] Support Request cache mode
2376         https://bugs.webkit.org/show_bug.cgi?id=162281
2377
2378         Reviewed by Alex Christensen.
2379
2380         Covered by updated test.
2381
2382         Added support for only-if-cached mode at Request level.
2383
2384         Added support for cache mode at CachedResourceLoader, by setting HTTP headers and ResourceRequest cache policy
2385         based on https://fetch.spec.whatwg.org/#concept-request-cache-mode and https://fetch.spec.whatwg.org/#http-network-or-cache-fetch.
2386
2387         Disabled default cache policy computation (done in FrameLoader) when cache mode is different from the default.
2388         Activated no-store cache mode for EventSource as per https://html.spec.whatwg.org/#the-eventsource-interface.
2389
2390         * Modules/fetch/FetchRequest.cpp:
2391         (WebCore::setCache): Adding support for only-if-cached.
2392         (WebCore::buildOptions): Throw if only-if-cached and fetch mode is not same-origin.
2393         * loader/FetchOptions.h: Adding support for only-if-cached.
2394         * loader/FrameLoader.cpp:
2395         (WebCore::FrameLoader::defaultRequestCachingPolicy): Introduced to ease readability.
2396         (WebCore::FrameLoader::addExtraFieldsToRequest): Updating cache policy only if request has the default cache policy.
2397         This allows bypassing the default behavior for fetch cache mode different from "default".
2398         * loader/FrameLoader.h:
2399         * loader/cache/CachedResourceLoader.cpp:
2400         (WebCore::updateRequestAccordingCacheMode): Introduced to set headers and request cache policy according fetch cache mode.
2401         (WebCore::CachedResourceLoader::requestResource):
2402         (WebCore::CachedResourceLoader::loadResource):
2403         (WebCore::CachedResourceLoader::determineRevalidationPolicy): Ensure bypassing the memory cache in no-store and reload cases.
2404         We reload in case of cache mode=reload to refresh the meory cache entry.
2405         * loader/cache/CachedResourceRequest.h:
2406         (WebCore::CachedResourceRequest::setCacheModeToNoStore):
2407         * page/EventSource.cpp:
2408         (WebCore::EventSource::connect): Use no-store cache mode as per https://html.spec.whatwg.org/#the-eventsource-interface.
2409         * platform/network/HTTPHeaderMap.cpp:
2410         (WebCore::HTTPHeaderMap::addIfNotPresent): Helper routine.
2411         * platform/network/HTTPHeaderMap.h:
2412         * platform/network/HTTPHeaderValues.cpp:
2413         * platform/network/HTTPHeaderValues.h:
2414         * platform/network/ResourceRequestBase.cpp:
2415         (WebCore::ResourceRequestBase::addHTTPHeaderFieldIfNotPresent):
2416         (WebCore::ResourceRequestBase::addHTTPHeaderField):
2417         (WebCore::ResourceRequestBase::hasHTTPHeaderField):
2418         * platform/network/ResourceRequestBase.h:
2419
2420 2016-10-10  Antti Koivisto  <antti@apple.com>
2421
2422         Stop copying author shadow pseudo rules into shadow tree style resolver
2423         https://bugs.webkit.org/show_bug.cgi?id=163232
2424
2425         Reviewed by Darin Adler.
2426
2427         * css/ElementRuleCollector.cpp:
2428         (WebCore::ElementRuleCollector::collectMatchingRules):
2429         (WebCore::ElementRuleCollector::matchAuthorRules):
2430         (WebCore::ElementRuleCollector::matchAuthorShadowPseudoElementRules):
2431
2432             If we are resolving a user agent shadow tree also look up pseudo element rules from the host scope author sheet.
2433             This is needed to keep web exposed ::-webkit-foo pseudo elements working.
2434
2435         (WebCore::ElementRuleCollector::collectMatchingShadowPseudoElementRules):
2436
2437             Factor to a function.
2438
2439         * css/ElementRuleCollector.h:
2440         * css/RuleSet.cpp:
2441         (WebCore::RuleSet::copyShadowPseudoElementRulesFrom): Deleted.
2442         * css/RuleSet.h:
2443         * dom/Document.cpp:
2444         (WebCore::Document::userAgentShadowTreeStyleResolver):
2445         * style/StyleScope.cpp:
2446         (WebCore::Style::Scope::updateStyleResolver):
2447
2448             No need to awkwardly copy these rules anymore.
2449
2450 2016-10-11  Chris Dumez  <cdumez@apple.com>
2451
2452         Update IDBVersionChangeEvent to stop using legacy [ConstructorTemplate=Event]
2453         https://bugs.webkit.org/show_bug.cgi?id=163266
2454
2455         Reviewed by Darin Adler.
2456
2457         Update IDBVersionChangeEvent to stop using legacy [ConstructorTemplate=Event]
2458         and use a regular constructor instead, as in the specification:
2459         - http://w3c.github.io/IndexedDB/#request-idbversionchangeevent
2460
2461         This patch also fixes a bug where the IDBVersionChangeEvent was ignoring the
2462         EventInit dictionary members passed by the JavaScript (e.g. bubbles).
2463
2464         No new tests, updated existing test.
2465
2466         * Modules/indexeddb/IDBVersionChangeEvent.cpp:
2467         (WebCore::IDBVersionChangeEvent::IDBVersionChangeEvent):
2468         * Modules/indexeddb/IDBVersionChangeEvent.h:
2469         * Modules/indexeddb/IDBVersionChangeEvent.idl:
2470         * bindings/js/JSDOMConvert.h:
2471         (WebCore::convertNullable):
2472         (WebCore::convert): Deleted.
2473         * bindings/scripts/CodeGeneratorJS.pm:
2474         (GenerateDefaultValue):
2475         (GenerateDictionaryImplementationContent):
2476         * bindings/scripts/test/JS/JSTestObj.cpp:
2477         (WebCore::convertDictionary<TestObj::Dictionary>):
2478         * bindings/scripts/test/TestObj.idl:
2479
2480 2016-10-11  Chris Dumez  <cdumez@apple.com>
2481
2482         Update WebKitPlaybackTargetAvailabilityEvent to stop using legacy [ConstructorTemplate=Event]
2483         https://bugs.webkit.org/show_bug.cgi?id=163265
2484
2485         Reviewed by Darin Adler.
2486
2487         Update WebKitPlaybackTargetAvailabilityEvent to stop using legacy
2488         [ConstructorTemplate=Event] and use a regular constructor instead.
2489
2490         * Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.cpp:
2491         (WebCore::WebKitPlaybackTargetAvailabilityEvent::WebKitPlaybackTargetAvailabilityEvent):
2492         * Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.h:
2493         (WebCore::WebKitPlaybackTargetAvailabilityEvent::createForBindings):
2494         (WebCore::WebKitPlaybackTargetAvailabilityEvent::~WebKitPlaybackTargetAvailabilityEvent): Deleted.
2495         * Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.idl:
2496
2497 2016-10-10  Zan Dobersek  <zdobersek@igalia.com>
2498
2499         Add ENABLE_ENCRYPTED_MEDIA configuration option
2500         https://bugs.webkit.org/show_bug.cgi?id=163219
2501
2502         Reviewed by Darin Adler.
2503
2504         * Configurations/FeatureDefines.xcconfig:
2505         Add the ENABLE_ENCRYPTED_MEDIA configuration option. It will be used
2506         to enable or disable the new EME implementation at build-time.
2507         * DerivedSources.make: Group the legacy option and the new option together.
2508
2509 2016-10-10  Youenn Fablet  <youenn@apple.com>
2510
2511         CachedResourceRequest constructor should be made more efficient
2512         https://bugs.webkit.org/show_bug.cgi?id=163210
2513
2514         Reviewed by Alex Christensen.
2515
2516         No change of behavior.
2517
2518         Refactoring to use one CachedResourceRequest constructor that will move its request and charset to improve efficiency.
2519
2520         * css/StyleRuleImport.cpp:
2521         (WebCore::StyleRuleImport::requestStyleSheet):
2522         * dom/ProcessingInstruction.cpp:
2523         (WebCore::ProcessingInstruction::checkStyleSheet):
2524         * html/HTMLLinkElement.cpp:
2525         (WebCore::HTMLLinkElement::process):
2526         * html/parser/HTMLResourcePreloader.cpp:
2527         (WebCore::PreloadRequest::resourceRequest):
2528         * loader/cache/CachedResourceRequest.cpp:
2529         (WebCore::CachedResourceRequest::CachedResourceRequest):
2530         * loader/cache/CachedResourceRequest.h:
2531
2532 2016-10-10  Adam Bergkvist  <adam.bergkvist@ericsson.com> and Alejandro G. Castro <alex@igalia.com>
2533
2534         WebRTC: Make MediaEndpointPeerConnection handle remotely assigned mids correctly
2535         https://bugs.webkit.org/show_bug.cgi?id=163202
2536
2537         Reviewed by Eric Carlson.
2538
2539         An RTCRtpTransceiver has a null mid until it's been associated with a
2540         media description (with a mid) [1]. During that time, it's identified by
2541         a provisional mid that might become its real mid, but the transceiver
2542         can also get its mid assigned by a remote media description. In the
2543         second case, the mid value is initially unknown. A transceiver's
2544         RTCRtpSender must directly (synchronously in the script) provide a muted
2545         remote source that is playable by, for example, a media element. This
2546         source is initially registered in the MediaEndpoint (WebRTC backend)
2547         with the transceiver's provisional mid. So, if the real mid is set by a
2548         remote description, the registered mid must be updated to preserve the
2549         association between the registered source and the transceiver.
2550
2551         [1] https://w3c.github.io/webrtc-pc/archives/20160913/webrtc.html#dom-rtcrtptransceiver-mid
2552
2553         Test: fast/mediastream/RTCPeerConnection-remotely-assigned-transceiver-mid.html
2554
2555         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
2556         Don't break after finding the first transceiver in the loop that builds the send source map.
2557         Update the mid used to register the muted remote source if the a transceiver's mid gets
2558         assigned by a remote media description.
2559         (WebCore::createSourceMap):
2560         (WebCore::MediaEndpointPeerConnection::setRemoteDescriptionTask):
2561         * platform/mediastream/MediaEndpoint.cpp:
2562         * platform/mediastream/MediaEndpoint.h:
2563         * platform/mock/MockMediaEndpoint.cpp:
2564         (WebCore::MockMediaEndpoint::MockMediaEndpoint):
2565         (WebCore::MockMediaEndpoint::updateReceiveConfiguration):
2566         (WebCore::MockMediaEndpoint::updateSendConfiguration):
2567         (WebCore::MockMediaEndpoint::createMutedRemoteSource):
2568         (WebCore::MockMediaEndpoint::replaceMutedRemoteSourceMid):
2569         (WebCore::MockMediaEndpoint::emulatePlatformEvent):
2570         Add "unmute-remote-sources-by-mid" action that emulates data arriving on media descriptions
2571         which unmutes the remote sources.
2572         (WebCore::MockMediaEndpoint::updateConfigurationMids):
2573         (WebCore::MockMediaEndpoint::unmuteRemoteSourcesByMid):
2574         (WebCore::MockMediaEndpoint::unmuteTimerFired):
2575         * platform/mock/MockMediaEndpoint.h:
2576
2577 2016-10-10  Darin Adler  <darin@apple.com>
2578
2579         Move audio module off of legacy exceptions
2580         https://bugs.webkit.org/show_bug.cgi?id=163269
2581
2582         Reviewed by Alex Christensen.
2583
2584         * Modules/webaudio/AnalyserNode.cpp:
2585         (WebCore::AnalyserNode::setFftSize): Use ExceptionOr.
2586         (WebCore::AnalyserNode::setMinDecibels): Ditto.
2587         (WebCore::AnalyserNode::setMaxDecibels): Ditto.
2588         (WebCore::AnalyserNode::setSmoothingTimeConstant): Ditto.
2589         * Modules/webaudio/AnalyserNode.h: Update for above.
2590         * Modules/webaudio/AnalyserNode.idl: Ditto.
2591
2592         * Modules/webaudio/AudioBasicInspectorNode.cpp:
2593         (WebCore::AudioBasicInspectorNode::AudioBasicInspectorNode):
2594         Initialize m_needAutomaticPull in class definition.
2595         (WebCore::AudioBasicInspectorNode::connect): Use ExceptionOr.
2596         (WebCore::AudioBasicInspectorNode::disconnect): Ditto.
2597         * Modules/webaudio/AudioBasicInspectorNode.h: Updated for above.
2598
2599         * Modules/webaudio/AudioBuffer.cpp:
2600         (WebCore::AudioBuffer::createFromAudioFileData): Use reference.
2601         (WebCore::AudioBuffer::AudioBuffer): Initialize m_gain in class definition.
2602         (WebCore::AudioBuffer::getChannelData): Use ExceptionOr.
2603         (WebCore::AudioBuffer::channelData): Rename to disambiguate with getChannelData.
2604         (WebCore::AudioBuffer::zero): Use modern for loop.
2605         * Modules/webaudio/AudioBuffer.h: Update for above.
2606         * Modules/webaudio/AudioBuffer.idl: Ditto.
2607
2608         * Modules/webaudio/AudioBufferSourceNode.cpp:
2609         (WebCore::AudioBufferSourceNode::process): Use reference.
2610         (WebCore::AudioBufferSourceNode::setBuffer): Use channelData.
2611         (WebCore::AudioBufferSourceNode::start): Use ExceptionOr.
2612         (WebCore::AudioBufferSourceNode::startPlaying): Ditto.
2613         * Modules/webaudio/AudioBufferSourceNode.h: Update for above.
2614         * Modules/webaudio/AudioBufferSourceNode.idl: Ditto.
2615
2616         * Modules/webaudio/AudioContext.cpp:
2617         (WebCore::AudioContext::createBuffer): Use ExceptionOr.
2618         (WebCore::AudioContext::createMediaElementSource): Ditto.
2619         (WebCore::AudioContext::createMediaStreamSource): Ditto.
2620         (WebCore::AudioContext::createScriptProcessor): Ditto.
2621         (WebCore::AudioContext::createDelay): Ditto.
2622         (WebCore::AudioContext::createChannelSplitter): Ditto.
2623         (WebCore::AudioContext::createChannelMerger): Ditto.
2624         (WebCore::AudioContext::createPeriodicWave): Ditto.
2625         * Modules/webaudio/AudioContext.h: Update for above.
2626         * Modules/webaudio/AudioContext.idl: Ditto.
2627
2628         * Modules/webaudio/AudioDestinationNode.h: Use unsigned instead
2629         of unsigned long for maxChannelCount.
2630
2631         * Modules/webaudio/AudioNode.cpp:
2632         (WebCore::AudioNode::connect): Use ExceptionOr.
2633         (WebCore::AudioNode::disconnect): Ditto.
2634         (WebCore::AudioNode::channelCount): Use unsigned.
2635         (WebCore::AudioNode::setChannelCount): Use ExceptionOr and unsigned.
2636         (WebCore::AudioNode::setChannelCountMode): Ditto.
2637         (WebCore::AudioNode::setChannelInterpretation): Ditto.
2638         * Modules/webaudio/AudioNode.h: Update for above.
2639         * Modules/webaudio/AudioNode.idl: Ditto.
2640
2641         * Modules/webaudio/AudioScheduledSourceNode.cpp:
2642         (WebCore::AudioScheduledSourceNode::AudioScheduledSourceNode):
2643         Initialize data members in class definition.
2644         (WebCore::AudioScheduledSourceNode::updateSchedulingInfo): Take
2645         a reference instead of a pointer to the audio bus.
2646         (WebCore::AudioScheduledSourceNode::start): Use ExceptionOr.
2647         (WebCore::AudioScheduledSourceNode::stop): Ditto.
2648         * Modules/webaudio/AudioScheduledSourceNode.h: Update for above.
2649
2650         * Modules/webaudio/ConvolverNode.cpp:
2651         (WebCore::ConvolverNode::ConvolverNode): Initialize m_normalize
2652         in class definition.
2653         (WebCore::ConvolverNode::setBuffer): Use ExceptionOr.
2654         * Modules/webaudio/ConvolverNode.h: Update for above.
2655         * Modules/webaudio/ConvolverNode.idl: Ditto.
2656
2657         * Modules/webaudio/DefaultAudioDestinationNode.cpp:
2658         (WebCore::DefaultAudioDestinationNode::DefaultAudioDestinationNode):
2659         Initialize m_numberOfInputChannels in class definition.
2660         (WebCore::DefaultAudioDestinationNode::maxChannelCount): Use unsigned.
2661         (WebCore::DefaultAudioDestinationNode::setChannelCount): Use ExceptionOr.
2662         * Modules/webaudio/DefaultAudioDestinationNode.h: Update for changes above.
2663
2664         * Modules/webaudio/DelayNode.cpp:
2665         (WebCore::DelayNode::DelayNode): Moved exception logic out of constructor.
2666         (WebCore::DelayNode::create): Added. Moved exception logic in here.
2667         (WebCore::DelayNode::delayTime): Moved typecast here from header.
2668         * Modules/webaudio/DelayNode.h: Update for above.
2669
2670         * Modules/webaudio/OfflineAudioContext.cpp:
2671         (WebCore::OfflineAudioContext::OfflineAudioContext): Marked inline.
2672         (WebCore::OfflineAudioContext::create): Use ExceptionOr.
2673         (WebCore::OfflineAudioContext::~OfflineAudioContext): Deleted. Unneeded.
2674         * Modules/webaudio/OfflineAudioContext.h: Update for above.
2675         * Modules/webaudio/OfflineAudioContext.idl: Ditto.
2676
2677         * Modules/webaudio/OfflineAudioDestinationNode.cpp:
2678         (WebCore::OfflineAudioDestinationNode::offlineRender): Use channelData.
2679
2680         * Modules/webaudio/OscillatorNode.cpp:
2681         (WebCore::OscillatorNode::OscillatorNode): Updated for change to setType.
2682         (WebCore::OscillatorNode::setType): Use ExceptionOr.
2683         (WebCore::OscillatorNode::process): Use a reference.
2684         * Modules/webaudio/OscillatorNode.h: Update for above.
2685         * Modules/webaudio/OscillatorNode.idl: Ditto.
2686
2687         * Modules/webaudio/ScriptProcessorNode.cpp:
2688         (WebCore::ScriptProcessorNode::process): Use channelData.
2689
2690         * bindings/js/JSDOMBinding.h: Added overloads of toJS to it can be used on
2691         references to array buffers and array buffer views, not just pointers.
2692
2693 2016-10-10  Youenn Fablet  <youenn@apple.com>
2694
2695         Change HTTPHeaderValues from a struct to a namespace
2696         https://bugs.webkit.org/show_bug.cgi?id=163203
2697
2698         Reviewed by Alex Christensen.
2699
2700         No change of behavior.
2701
2702         * Modules/fetch/FetchBody.cpp:
2703         (WebCore::FetchBody::extract):
2704         * platform/network/HTTPHeaderValues.cpp:
2705         (WebCore::HTTPHeaderValues::textPlainContentType):
2706         (WebCore::HTTPHeaderValues::formURLEncodedContentType):
2707         (WebCore::HTTPHeaderValues::TextPlainContentType): Deleted.
2708         (WebCore::HTTPHeaderValues::FormURLEncodedContentType): Deleted.
2709         * platform/network/HTTPHeaderValues.h:
2710         * xml/XMLHttpRequest.cpp:
2711         (WebCore::XMLHttpRequest::send):
2712
2713 2016-10-10  Chris Dumez  <cdumez@apple.com>
2714
2715         Update WheelEvent / MouseEvent to stop using legacy [ConstructorTemplate=Event]
2716         https://bugs.webkit.org/show_bug.cgi?id=163254
2717
2718         Reviewed by Darin Adler.
2719
2720         Update WheelEvent / MouseEvent to stop using legacy [ConstructorTemplate=Event]
2721         and use a regular constructor instead, as in the specification:
2722         - https://www.w3.org/TR/uievents/#interface-mouseevent
2723         - https://www.w3.org/TR/uievents/#interface-wheelevent
2724
2725         * CMakeLists.txt:
2726         * DerivedSources.cpp:
2727         * DerivedSources.make:
2728         * WebCore.xcodeproj/project.pbxproj:
2729
2730         * bindings/scripts/CodeGeneratorJS.pm:
2731         (GenerateHeader):
2732         (GenerateDictionaryHeader):
2733         Fix our broken dependency tracking when it comes to dictionaries.
2734
2735         * dom/MouseEvent.cpp:
2736         (WebCore::MouseEvent::create):
2737         (WebCore::MouseEvent::MouseEvent):
2738         * dom/MouseEvent.h:
2739         * dom/MouseEvent.idl:
2740         * dom/MouseEventInit.h: Added.
2741         * dom/MouseEventInit.idl: Added.
2742         * dom/MouseRelatedEvent.cpp:
2743         (WebCore::MouseRelatedEvent::MouseRelatedEvent):
2744         * dom/MouseRelatedEvent.h:
2745         * dom/UIEventWithKeyState.h:
2746         (WebCore::UIEventWithKeyState::UIEventWithKeyState):
2747         * dom/WheelEvent.cpp:
2748         (WebCore::WheelEvent::WheelEvent):
2749         * dom/WheelEvent.h:
2750         * dom/WheelEvent.idl:
2751
2752 2016-10-10  Chris Dumez  <cdumez@apple.com>
2753
2754         Add support for languagechange event
2755         https://bugs.webkit.org/show_bug.cgi?id=163222
2756
2757         Reviewed by Ryosuke Niwa.
2758
2759         Add support for languagechange event:
2760         - https://html.spec.whatwg.org/#dom-navigator-languages
2761
2762         Firefox and Chrome already support this.
2763
2764         Test: fast/dom/window-languagechange-event.html
2765
2766         * dom/EventNames.h:
2767         * html/HTMLAttributeNames.in:
2768         * html/HTMLBodyElement.cpp:
2769         (WebCore::HTMLBodyElement::createWindowEventHandlerNameMap):
2770         * page/DOMWindow.cpp:
2771         (WebCore::languagesChangedCallback):
2772         (WebCore::DOMWindow::DOMWindow):
2773         (WebCore::DOMWindow::~DOMWindow):
2774         (WebCore::DOMWindow::languagesChanged):
2775         (WebCore::DOMWindow::canShowModalDialog): Deleted.
2776         (WebCore::DOMWindow::removeEventListener): Deleted.
2777         * page/DOMWindow.h:
2778         * page/WindowEventHandlers.idl:
2779
2780 2016-10-10  Chris Dumez  <cdumez@apple.com>
2781
2782         Update GamepadEvent to stop using legacy [ConstructorTemplate=Event]
2783         https://bugs.webkit.org/show_bug.cgi?id=163243
2784
2785         Reviewed by Darin Adler.
2786
2787         Update GamepadEvent to stop using legacy [ConstructorTemplate=Event]
2788         and use a proper constructor as in the specification:
2789         - https://w3c.github.io/gamepad/#gamepadevent-interface
2790
2791         * Modules/gamepad/GamepadEvent.cpp:
2792         (WebCore::GamepadEvent::GamepadEvent):
2793         * Modules/gamepad/GamepadEvent.h:
2794         (WebCore::GamepadEvent::create):
2795         (WebCore::GamepadEvent::~GamepadEvent): Deleted.
2796         * Modules/gamepad/GamepadEvent.idl:
2797
2798 2016-10-10  Darin Adler  <darin@apple.com>
2799
2800         Move Fetch from legacy to new DOM exceptions
2801         https://bugs.webkit.org/show_bug.cgi?id=163195
2802
2803         Reviewed by Chris Dumez.
2804
2805         * Modules/fetch/FetchHeaders.cpp:
2806         (WebCore::canWriteHeader): Use ExceptionOr.
2807         (WebCore::FetchHeaders::append): Ditto.
2808         (WebCore::FetchHeaders::remove): Ditto.
2809         (WebCore::FetchHeaders::get): Ditto.
2810         (WebCore::FetchHeaders::has): Ditto.
2811         (WebCore::FetchHeaders::set): Ditto.
2812         (WebCore::FetchHeaders::filterAndFill): Ditto.
2813         (WebCore::FetchHeaders::Iterator::next): Got rid of unneeded code to
2814         clear out m_keys after the last call to next, since it will be deleted
2815         as soon as the iterator is deleted.
2816
2817         * Modules/fetch/FetchHeaders.h: Use pragma once. Use ExceptionOr.
2818
2819         * Modules/fetch/FetchHeaders.idl: Move to non-legacy exceptions.
2820
2821         * Modules/fetch/FetchRequest.cpp:
2822         (WebCore::FetchRequest::setBody): Use ExceptionOr.
2823         (WebCore::FetchRequest::clone): Ditto.
2824
2825         * Modules/fetch/FetchRequest.h: Use pragma once. Use ExceptionOr.
2826
2827         * Modules/fetch/FetchRequest.idl: Move to non-legacy exceptions.
2828
2829         * Modules/fetch/FetchResponse.cpp:
2830         (WebCore::FetchResponse::redirect): Use ExceptionOr.
2831         (WebCore::FetchResponse::setStatus): Ditto.
2832
2833         * Modules/fetch/FetchResponse.h: Use ExceptionOr.
2834
2835         * Modules/fetch/FetchResponse.idl: Move to non-legacy exceptions.
2836
2837         * bindings/js/JSDOMBinding.h: Added implementation of toJSNullableString.
2838
2839         * bindings/scripts/CodeGeneratorJS.pm:
2840         (NativeToJSValue): Call toJSNullableString and toJSString for
2841         functions that return ExceptionOr<String>.
2842
2843 2016-10-10  Nan Wang  <n_wang@apple.com>
2844
2845         AX: Expose invalid status for input types with that information
2846         https://bugs.webkit.org/show_bug.cgi?id=163252
2847         <rdar://problem/28704409>
2848
2849         Reviewed by Chris Fleizach.
2850
2851         For input types with invalid input value, we should expose the invalid 
2852         status to the assitive technology.
2853
2854         Test: accessibility/mac/invalid-status-for-input-types.html
2855
2856         * accessibility/AccessibilityObject.cpp:
2857         (WebCore::AccessibilityObject::invalidStatus):
2858
2859 2016-10-10  Konstantin Tokarev  <annulen@yandex.ru>
2860
2861         Added override specifier to PluginViewBase::isPluginViewBase()
2862         https://bugs.webkit.org/show_bug.cgi?id=163218
2863
2864         Reviewed by Alex Christensen.
2865
2866         No new tests needed.
2867
2868         * plugins/PluginViewBase.h:
2869
2870 2016-10-10  Alex Christensen  <achristensen@webkit.org>
2871
2872         Don't run SecurityOrigin's port through URLParser
2873         https://bugs.webkit.org/show_bug.cgi?id=163253
2874
2875         Reviewed by Brady Eidson.
2876
2877         No change in behavior.
2878
2879         * page/SecurityOrigin.cpp:
2880         (WebCore::SecurityOrigin::maybeCreateFromDatabaseIdentifier):
2881         (WebCore::SecurityOrigin::create):
2882         We used to parse URLs like "file://:0/" which are valid when using URL::parse
2883         but aren't valid when we start using the URLParser, which matches other browsers' failure
2884         to parse URLs with a port but no host. There is no reason to write and parse the port.
2885         Setting m_port directly accomplishes the same thing.
2886  
2887 2016-10-10  Said Abou-Hallawa  <sabouhallawa@apple.com>
2888
2889         <Error>: CGContextSetLineDash: invalid dash array: at least one element must be non-zero
2890         https://bugs.webkit.org/show_bug.cgi?id=138555
2891
2892         Reviewed by Simon Fraser.
2893
2894         Ensure the dashArray has at least one non-zero element before calling
2895         GraphicsContext::setLineDash(). Call GraphicsContext::setStrokeStyle()
2896         instead, if the dashArray does not have one.
2897
2898         * rendering/svg/SVGRenderSupport.cpp:
2899         (WebCore::SVGRenderSupport::applyStrokeStyleToContext):
2900
2901 2016-10-10  Brent Fulgham  <bfulgham@apple.com>
2902
2903         [Win][Direct2D] Correct Radial Graident Bug
2904         https://bugs.webkit.org/show_bug.cgi?id=163241
2905
2906         Reviewed by Darin Adler.
2907
2908         Radial gradients were not working correctly under Direct2D because the
2909         points and radius values used were incorrect. D2D wants a center point and
2910         an offset, not a start and end point. It wants an X and Y radius (for an
2911         ellipse), not a radius at the start point, and a radius at the end point.
2912
2913         Covered by existing fast/gradients/css-radial-gradients.html (and others).
2914
2915         * platform/graphics/Image.cpp:
2916         (WebCore::Image::drawTiled): Remove 'notImplemented' code path.
2917         * platform/graphics/win/GradientDirect2D.cpp:
2918         (WebCore::Gradient::generateGradient): Use correct input values to
2919         the Radial Gradient constructor.
2920         (WebCore::Gradient::fill): Generate a gradient if we have no active
2921         one to use.
2922
2923 2016-10-10  Jiewen Tan  <jiewen_tan@apple.com>
2924
2925         Rename CryptoAlgorithmParameters to CryptoAlgorithmParametersDeprecated
2926         https://bugs.webkit.org/show_bug.cgi?id=163163
2927         <rdar://problem/28681544>
2928
2929         Reviewed by Brent Fulgham.
2930
2931         Replace all uses of 'CryptoAlgorithmParameters' with 'CryptoAlgorithmParametersDeprecated' in preparation for a new CryptoAlgorithmParameters type.
2932
2933         No changes of behaviors. No new tests.
2934
2935         * Modules/encryptedmedia/CDMSessionClearKey.cpp:
2936         * WebCore.xcodeproj/project.pbxproj:
2937         * bindings/js/JSCryptoAlgorithmDictionary.cpp:
2938         * bindings/js/JSCryptoAlgorithmDictionary.h:
2939         * bindings/js/JSCryptoKeySerializationJWK.cpp:
2940         * bindings/js/JSCryptoKeySerializationJWK.h:
2941         * bindings/js/JSWebKitSubtleCryptoCustom.cpp:
2942         * crypto/CryptoAlgorithm.cpp:
2943         * crypto/CryptoAlgorithm.h:
2944         * crypto/CryptoAlgorithmParametersDeprecated.h: Renamed from Source/WebCore/crypto/CryptoAlgorithmParameters.h.
2945         * crypto/CryptoKeySerialization.h:
2946         * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
2947         * crypto/algorithms/CryptoAlgorithmAES_CBC.h:
2948         * crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
2949         * crypto/algorithms/CryptoAlgorithmAES_KW.h:
2950         * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
2951         * crypto/algorithms/CryptoAlgorithmHMAC.h:
2952         * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
2953         * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h:
2954         * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
2955         * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h:
2956         * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
2957         * crypto/algorithms/CryptoAlgorithmRSA_OAEP.h:
2958         * crypto/algorithms/CryptoAlgorithmSHA1.cpp:
2959         * crypto/algorithms/CryptoAlgorithmSHA1.h:
2960         * crypto/algorithms/CryptoAlgorithmSHA224.cpp:
2961         * crypto/algorithms/CryptoAlgorithmSHA224.h:
2962         * crypto/algorithms/CryptoAlgorithmSHA256.cpp:
2963         * crypto/algorithms/CryptoAlgorithmSHA256.h:
2964         * crypto/algorithms/CryptoAlgorithmSHA384.cpp:
2965         * crypto/algorithms/CryptoAlgorithmSHA384.h:
2966         * crypto/algorithms/CryptoAlgorithmSHA512.cpp:
2967         * crypto/algorithms/CryptoAlgorithmSHA512.h:
2968         * crypto/keys/CryptoKeySerializationRaw.cpp:
2969         * crypto/gnutls/CryptoAlgorithmAES_CBCGnuTLS.cpp:
2970         * crypto/gnutls/CryptoAlgorithmHMACGnuTLS.cpp:
2971         * crypto/gnutls/CryptoAlgorithmRSA_OAEPGnuTLS.cpp:
2972         * crypto/gnutls/CryptoAlgorithmRSASSA_PKCS1_v1_5GnuTLS.cpp:
2973         * crypto/keys/CryptoKeySerializationRaw.h:
2974         * crypto/mac/CryptoAlgorithmAES_CBCMac.cpp:
2975         * crypto/mac/CryptoAlgorithmHMACMac.cpp:
2976         * crypto/mac/CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp:
2977         * crypto/mac/CryptoAlgorithmRSA_OAEPMac.cpp:
2978         * crypto/parameters/CryptoAlgorithmAesCbcParamsDeprecated.h: Renamed from Source/WebCore/crypto/parameters/CryptoAlgorithmAesCbcParams.h.
2979         * crypto/parameters/CryptoAlgorithmAesKeyGenParamsDeprecated.h: Renamed from Source/WebCore/crypto/parameters/CryptoAlgorithmAesKeyGenParams.h.
2980         * crypto/parameters/CryptoAlgorithmHmacKeyParamsDeprecated.h: Renamed from Source/WebCore/crypto/parameters/CryptoAlgorithmHmacKeyParams.h.
2981         * crypto/parameters/CryptoAlgorithmHmacParamsDeprecated.h: Renamed from Source/WebCore/crypto/parameters/CryptoAlgorithmHmacParams.h.
2982         * crypto/parameters/CryptoAlgorithmRsaKeyGenParamsDeprecated.h: Renamed from Source/WebCore/crypto/parameters/CryptoAlgorithmRsaKeyGenParams.h.
2983         * crypto/parameters/CryptoAlgorithmRsaKeyParamsWithHashDeprecated.h: Renamed from Source/WebCore/crypto/parameters/CryptoAlgorithmRsaKeyParamsWithHash.h.
2984         * crypto/parameters/CryptoAlgorithmRsaOaepParamsDeprecated.h: Renamed from Source/WebCore/crypto/parameters/CryptoAlgorithmRsaOaepParams.h.
2985         * crypto/parameters/CryptoAlgorithmRsaSsaParamsDeprecated.h: Renamed from Source/WebCore/crypto/parameters/CryptoAlgorithmRsaSsaParams.h.
2986
2987 2016-10-10  Darin Adler  <darin@apple.com>
2988
2989         Move NotificationCenter from legacy to new DOM exceptions
2990         https://bugs.webkit.org/show_bug.cgi?id=163217
2991
2992         Reviewed by Chris Dumez.
2993
2994         * Modules/notifications/DOMWindowNotifications.cpp:
2995         (WebCore::DOMWindowNotifications::webkitNotifications): Pass reference to
2996         document instead of pointer. Also use auto and early return.
2997
2998         * Modules/notifications/Notification.cpp:
2999         (WebCore::Notification::Notification): Move checks that can lead to
3000         throwing an exception out of the constructor into the create function.
3001         (WebCore::Notification::create): Changed to use ExceptionOr. Also moved
3002         checks that can lead to throwing an exception here.
3003         (WebCore::Notification::show): Update since NotificationController::client
3004         now returns a reference.
3005         (WebCore::Notification::permission): Ditto.
3006         (WebCore::Notification::requestPermission): Ditto.
3007
3008         * Modules/notifications/Notification.h: Updated for above changes.
3009
3010         * Modules/notifications/NotificationCenter.cpp:
3011         (WebCore::NotificationCenter::create): Take a reference to the script execution
3012         context instead of a pointer.
3013         (WebCore::NotificationCenter::NotificationCenter): Ditto.
3014         (WebCore::NotificationCenter::createNotification): Use ExceptionOr.
3015         (WebCore::NotificationCenter::requestPermission): Take an rvalue reference.
3016
3017         * Modules/notifications/NotificationCenter.h: Use pragma once.
3018         Marked the class final. Updated for changes above.
3019
3020         * Modules/notifications/NotificationCenter.idl: Use non-legacy exceptions.
3021
3022         * Modules/notifications/NotificationController.cpp:
3023         (WebCore::NotificationController::NotificationController): Use a reference rather
3024         than a pointer for m_client, since it is never null.
3025         (WebCore::NotificationController::~NotificationController): Ditto.
3026         (WebCore::NotificationController::clientFrom): Updated for the change above.
3027
3028         * Modules/notifications/NotificationController.h: Updated for the change above.
3029
3030         * Modules/notifications/WorkerGlobalScopeNotifications.cpp:
3031         (WebCore::WorkerGlobalScopeNotifications::webkitNotifications): Updated to
3032         pass a reference for the script execution context. Also added FIXME about the
3033         fact that the client is always null.
3034
3035 2016-10-10  Antoine Quint  <graouts@apple.com>
3036
3037         [Modern Media Controls] Placards
3038         https://bugs.webkit.org/show_bug.cgi?id=163110
3039         <rdar://problem/28669342>
3040
3041         Reviewed by Dean Jackson.
3042
3043         Inline media controls need to display placards when the video is no longer playing inline,
3044         such as when the video is playing fullscreen or via AirPlay. To that end, we introduce a
3045         new Placard class and two subclasses for display during fullscreen or AirPlay playback.
3046         Note that localization will be done in a later patch.
3047
3048         Tests: media/modern-media-controls/airplay-placard/airplay-placard.html
3049                media/modern-media-controls/pip-placard/pip-placard.html
3050                media/modern-media-controls/placard/placard.html
3051
3052         * Modules/modern-media-controls/controls/airplay-placard.js:
3053         (AirplayPlacard):
3054         * Modules/modern-media-controls/controls/icon-service.js:
3055         * Modules/modern-media-controls/controls/pip-placard.js:
3056         (PiPPlacard):
3057         * Modules/modern-media-controls/controls/placard.css:
3058         (.placard):
3059         (.placard .container):
3060         (.placard .icon):
3061         (.placard .title,):
3062         (.placard .title):
3063         (.placard .description):
3064         * Modules/modern-media-controls/controls/placard.js:
3065         (Placard.):
3066         * Modules/modern-media-controls/images/iOS/airplay-placard@1x.png: Added.
3067         * Modules/modern-media-controls/images/iOS/airplay-placard@2x.png: Added.
3068         * Modules/modern-media-controls/images/iOS/airplay-placard@3x.png: Added.
3069         * Modules/modern-media-controls/images/iOS/pip-placard@1x.png: Added.
3070         * Modules/modern-media-controls/images/iOS/pip-placard@2x.png: Added.
3071         * Modules/modern-media-controls/images/iOS/pip-placard@3x.png: Added.
3072         * Modules/modern-media-controls/images/macOS/airplay-placard@1x.png: Added.
3073         * Modules/modern-media-controls/images/macOS/airplay-placard@2x.png: Added.
3074         * Modules/modern-media-controls/images/macOS/pip-placard@1x.png: Added.
3075         * Modules/modern-media-controls/images/macOS/pip-placard@2x.png: Added.
3076
3077 2016-10-10  Chris Dumez  <cdumez@apple.com>
3078
3079         Add support for Navigator.languages attribute
3080         https://bugs.webkit.org/show_bug.cgi?id=163220
3081
3082         Reviewed by Darin Adler.
3083
3084         Add support for Navigator.languages attribute:
3085         - https://html.spec.whatwg.org/#navigatorlanguage
3086
3087         Firefox and Chrome already support this.
3088
3089         Currently, we always return a single language for privacy reasons so
3090         this API does not actually bring anything new besides interoperability
3091         with other browsers and compliance with the HTML specification.
3092
3093         No new tests, rebaselined existing tests.
3094
3095         * page/NavigatorBase.cpp:
3096         (WebCore::NavigatorBase::languages):
3097         * page/NavigatorBase.h:
3098         * page/NavigatorLanguage.idl:
3099
3100 2016-10-10  Brent Fulgham  <bfulgham@apple.com>
3101
3102         [Win][Direct2D] Implement dashed and dotted border line drawing
3103         https://bugs.webkit.org/show_bug.cgi?id=163235
3104
3105         Reviewed by Alex Christensen.
3106
3107         Covered by existing fast/border tests.
3108
3109         * platform/graphics/GraphicsContext.cpp: Use custom 'setPlatformStrokeStyle' for D2D.
3110         * platform/graphics/Path.cpp:
3111         (WebCore::Path::length): Don't use default implementation for Direct2D.
3112         * platform/graphics/win/GraphicsContextDirect2D.cpp:
3113         (WebCore::GraphicsContextPlatformPrivate::brushWithColor): Initialize pointer to nullptr.
3114         (WebCore::GraphicsContext::drawRect): Use proper stroke style.
3115         (WebCore::GraphicsContextPlatformPrivate::setLineCap): Added.
3116         (WebCore::GraphicsContextPlatformPrivate::setLineJoin): Added.
3117         (WebCore::GraphicsContextPlatformPrivate::setStrokeStyle): Added.
3118         (WebCore::GraphicsContextPlatformPrivate::setMiterLimit): Added.
3119         (WebCore::GraphicsContextPlatformPrivate::setDashOffset): Added.
3120         (WebCore::GraphicsContextPlatformPrivate::setPatternWidth): Added.
3121         (WebCore::GraphicsContextPlatformPrivate::setPatternOffset): Added.
3122         (WebCore::GraphicsContextPlatformPrivate::setStrokeThickness): Added.
3123         (WebCore::GraphicsContextPlatformPrivate::setDashes): Added.
3124         (WebCore::GraphicsContextPlatformPrivate::recomputeStrokeStyle): Added.
3125         (WebCore::GraphicsContextPlatformPrivate::strokeStyle): Added.
3126         (WebCore::GraphicsContext::drawLine): Use proper stroke style.
3127         (WebCore::GraphicsContext::drawEllipse): Ditto.
3128         (WebCore::GraphicsContext::drawPath): Ditto.
3129         (WebCore::GraphicsContext::strokePath): Ditto.
3130         (WebCore::GraphicsContext::setPlatformStrokeStyle): Added.
3131         (WebCore::GraphicsContext::setMiterLimit): Tell D2D context about miter limit.
3132         (WebCore::GraphicsContext::setLineCap): Ditto for line cap.
3133         (WebCore::GraphicsContext::setLineDash): Ditto for dashes.
3134         (WebCore::GraphicsContext::setLineJoin): Ditto for join style.
3135         (WebCore::GraphicsContext::setPlatformStrokeThickness): Ditto for stroke thickness.
3136         (WebCore::GraphicsContext::platformStrokeEllipse): Use proper stroke style.
3137         * platform/graphics/win/GraphicsContextPlatformPrivateDirect2D.h:
3138         * platform/graphics/win/PathDirect2D.cpp:
3139         (WebCore::Path::currentPoint): Zero-initialize a value.
3140         (WebCore::Path::length): Added.
3141
3142 2016-10-10  Chris Dumez  <cdumez@apple.com>
3143
3144         Update ProgressEvent to stop using legacy [ConstructorTemplate=Event]
3145         https://bugs.webkit.org/show_bug.cgi?id=163221
3146
3147         Reviewed by Darin Adler.
3148
3149         Update ProgressEvent to stop using legacy [ConstructorTemplate=Event]
3150         and use a regular constructor as in the specification:
3151         - https://xhr.spec.whatwg.org/#firing-events-using-the-progressevent-interface
3152
3153         * dom/ProgressEvent.cpp:
3154         (WebCore::ProgressEvent::ProgressEvent):
3155         * dom/ProgressEvent.h:
3156         (WebCore::ProgressEvent::create):
3157         * dom/ProgressEvent.idl:
3158
3159 2016-10-10  Wenson Hsieh  <wenson_hsieh@apple.com>
3160
3161         Address some review feedback from r206979 and r207010
3162         https://bugs.webkit.org/show_bug.cgi?id=163236
3163
3164         Reviewed by Tim Horton.
3165
3166         In TypingCommand.h, some methods on TypingCommand should be marked as final to reflect the fact that they
3167         override methods in CompositeEditCommand. Also, HTMLFormControlElement::dispatchFormControlInputEvent does not
3168         need to specify HTMLElement::dispatchInputEvent() when calling dispatchInputEvent().
3169
3170         No new tests, since there is no behavior change.
3171
3172         * editing/TypingCommand.h:
3173         * html/HTMLFormControlElement.cpp:
3174         (WebCore::HTMLFormControlElement::dispatchFormControlInputEvent):
3175
3176 2016-10-10  Chris Dumez  <cdumez@apple.com>
3177
3178         Update MessageEvent to stop using legacy [ConstructorTemplate=Event]
3179         https://bugs.webkit.org/show_bug.cgi?id=163187
3180
3181         Reviewed by Darin Adler.
3182
3183         Update MessageEvent to stop using legacy [ConstructorTemplate=Event] and
3184         use a regular constructor as in the specification:
3185         - https://html.spec.whatwg.org/multipage/comms.html#the-messageevent-interfaces
3186
3187         No new tests, updated existing test.
3188
3189         * bindings/js/JSDOMBinding.h:
3190         (WebCore::toRefPtrNativeArray):
3191         * bindings/js/JSDOMConvert.h:
3192         (WebCore::convertWrapperTypeSequence):
3193         (WebCore::convertWrapperType): Deleted.
3194         * bindings/scripts/CodeGeneratorJS.pm:
3195         (GenerateDefaultValue):
3196         (GenerateDictionaryImplementationContent):
3197         (GetNativeType):
3198         * dom/MessageEvent.cpp:
3199         (WebCore::MessageEvent::MessageEvent):
3200         (WebCore::MessageEvent::create):
3201         (WebCore::MessageEvent::trySerializeData):
3202         (WebCore::MessageEvent::createForBindings): Deleted.
3203         (WebCore::MessageEvent::initMessageEvent): Deleted.
3204         * dom/MessageEvent.h:
3205         * dom/MessageEvent.idl:
3206
3207 2016-10-10  Antoine Quint  <graouts@apple.com>
3208
3209         [Modern Media Controls] Buttons
3210         https://bugs.webkit.org/show_bug.cgi?id=163109
3211         <rdar://problem/28668954>
3212
3213         Reviewed by Dean Jackson.
3214
3215         We introduce specific IconButton subclasses for the various buttons we will be using
3216         in media controls on macOS (inline and fullscreen) and iOS. One class, StartButton, is
3217         a subclass of Button and not IconButton because we're only interested in having it display
3218         an <img> element rather than use a mask and requires additional DOM structure.
3219
3220         Tests: media/modern-media-controls/airplay-button/airplay-button-on.html
3221                media/modern-media-controls/airplay-button/airplay-button.html
3222                media/modern-media-controls/aspect-ratio-button/aspect-ratio-button.html
3223                media/modern-media-controls/forward-button/forward-button.html
3224                media/modern-media-controls/fullscreen-button/fullscreen-button.html
3225                media/modern-media-controls/mute-button/mute-button.html
3226                media/modern-media-controls/pip-button/pip-button.html
3227                media/modern-media-controls/play-pause-button/play-pause-button.html
3228                media/modern-media-controls/rewind-button/rewind-button.html
3229                media/modern-media-controls/skip-back-button/skip-back-button.html
3230                media/modern-media-controls/start-button/start-button.html
3231                media/modern-media-controls/tracks-button/tracks-button.html
3232
3233         * Modules/modern-media-controls/controls/airplay-button.css:
3234         (button.airplay.on):
3235         * Modules/modern-media-controls/controls/airplay-button.js:
3236         (AirplayButton):
3237         (AirplayButton.prototype.set on):
3238         * Modules/modern-media-controls/controls/aspect-ratio-button.js:
3239         (AspectRatioButton):
3240         (AspectRatioButton.prototype.get scalesToFill):
3241         (AspectRatioButton.prototype.set scalesToFill):
3242         * Modules/modern-media-controls/controls/forward-button.js:
3243         (ForwardButton):
3244         * Modules/modern-media-controls/controls/fullscreen-button.js:
3245         (FullscreenButton):
3246         * Modules/modern-media-controls/controls/icon-button.js:
3247         * Modules/modern-media-controls/controls/icon-service.js:
3248         * Modules/modern-media-controls/controls/mute-button.js:
3249         (MuteButton):
3250         (MuteButton.prototype.get muted):
3251         (MuteButton.prototype.set muted):
3252         * Modules/modern-media-controls/controls/pip-button.js:
3253         (PiPButton):
3254         * Modules/modern-media-controls/controls/play-pause-button.js:
3255         (PlayPauseButton):
3256         (PlayPauseButton.prototype.get playing):
3257         (PlayPauseButton.prototype.set playing):
3258         * Modules/modern-media-controls/controls/rewind-button.js:
3259         (RewindButton):
3260         * Modules/modern-media-controls/controls/skip-back-button.js:
3261         (SkipBackButton):
3262         * Modules/modern-media-controls/controls/start-button.js:
3263         (StartButton):
3264         * Modules/modern-media-controls/controls/tracks-button.js:
3265         (TracksButton):
3266         * Modules/modern-media-controls/images/iOS/airplay@1x.png: Added.
3267         * Modules/modern-media-controls/images/iOS/airplay@2x.png: Added.
3268         * Modules/modern-media-controls/images/iOS/enter-fullscreen@1x.png: Added.
3269         * Modules/modern-media-controls/images/iOS/enter-fullscreen@2x.png: Added.
3270         * Modules/modern-media-controls/images/iOS/enter-fullscreen@3x.png: Added.
3271         * Modules/modern-media-controls/images/iOS/interval-skip-back@1x.png: Added.
3272         * Modules/modern-media-controls/images/iOS/interval-skip-back@2x.png: Added.
3273         * Modules/modern-media-controls/images/iOS/interval-skip-back@3x.png: Added.
3274         * Modules/modern-media-controls/images/iOS/pause@1x.png: Added.
3275         * Modules/modern-media-controls/images/iOS/pip-in@1x.png: Added.
3276         * Modules/modern-media-controls/images/iOS/pip-in@2x.png: Added.
3277         * Modules/modern-media-controls/images/iOS/pip-in@3x.png: Added.
3278         * Modules/modern-media-controls/images/iOS/play@1x.png: Added.
3279         * Modules/modern-media-controls/images/iOS/play@2x.png: Added.
3280         * Modules/modern-media-controls/images/iOS/play@3x.png: Added.
3281         * Modules/modern-media-controls/images/iOS/start@1x.png: Added.
3282         * Modules/modern-media-controls/images/macOS/airplay-fullscreen@1x.png: Added.
3283         * Modules/modern-media-controls/images/macOS/airplay-fullscreen@2x.png: Added.
3284         * Modules/modern-media-controls/images/macOS/airplay@1x.png: Added.
3285         * Modules/modern-media-controls/images/macOS/airplay@2x.png: Added.
3286         * Modules/modern-media-controls/images/macOS/enter-fullscreen@1x.png: Added.
3287         * Modules/modern-media-controls/images/macOS/enter-fullscreen@2x.png: Added.
3288         * Modules/modern-media-controls/images/macOS/exit-fullscreen@1x.png: Added.
3289         * Modules/modern-media-controls/images/macOS/exit-fullscreen@2x.png: Added.
3290         * Modules/modern-media-controls/images/macOS/forward@1x.png: Added.
3291         * Modules/modern-media-controls/images/macOS/forward@2x.png: Added.
3292         * Modules/modern-media-controls/images/macOS/interval-skip-back@1x.png: Added.
3293         * Modules/modern-media-controls/images/macOS/interval-skip-back@2x.png: Added.
3294         * Modules/modern-media-controls/images/macOS/media-selection-fullscreen@1x.png: Added.
3295         * Modules/modern-media-controls/images/macOS/media-selection-fullscreen@2x.png: Added.
3296         * Modules/modern-media-controls/images/macOS/media-selection@1x.png: Added.
3297         * Modules/modern-media-controls/images/macOS/media-selection@2x.png: Added.
3298         * Modules/modern-media-controls/images/macOS/pip-in@1x.png: Added.
3299         * Modules/modern-media-controls/images/macOS/pip-in@2x.png: Added.
3300         * Modules/modern-media-controls/images/macOS/play-fullscreen@1x.png: Added.
3301         * Modules/modern-media-controls/images/macOS/play-fullscreen@2x.png: Added.
3302         * Modules/modern-media-controls/images/macOS/play@1x.png: Added.
3303         * Modules/modern-media-controls/images/macOS/play@2x.png: Added.
3304         * Modules/modern-media-controls/images/macOS/rewind@1x.png: Added.
3305         * Modules/modern-media-controls/images/macOS/rewind@2x.png: Added.
3306         * Modules/modern-media-controls/images/macOS/scale-to-fill@1x.png: Added.
3307         * Modules/modern-media-controls/images/macOS/scale-to-fill@2x.png: Added.
3308         * Modules/modern-media-controls/images/macOS/scale-to-fit@1x.png: Added.
3309         * Modules/modern-media-controls/images/macOS/scale-to-fit@2x.png: Added.
3310         * Modules/modern-media-controls/images/macOS/volume-mute@1x.png: Added.
3311         * Modules/modern-media-controls/images/macOS/volume-mute@2x.png: Added.
3312         * Modules/modern-media-controls/images/macOS/volume@1x.png: Added.
3313         * Modules/modern-media-controls/images/macOS/volume@2x.png: Added.
3314
3315 2016-10-10  Nan Wang  <n_wang@apple.com>
3316
3317         AX: Update AXPlaceHolder algorithm
3318         https://bugs.webkit.org/show_bug.cgi?id=163229
3319
3320         Reviewed by Chris Fleizach.
3321
3322         From https://w3c.github.io/html-aam/
3323         When the placeholder and aria-placeholder attributes are both present, we
3324         should expose the value of the placeholder attribute. Updated the algorithm
3325         for that.
3326
3327         Changes are covered in the modified test.
3328
3329         * accessibility/AccessibilityObject.cpp:
3330         (WebCore::AccessibilityObject::placeholderValue):
3331
3332 2016-10-10  Yusuke Suzuki  <utatane.tea@gmail.com>
3333
3334         [DOMJIT] Implement Node accessors in DOMJIT
3335         https://bugs.webkit.org/show_bug.cgi?id=163005
3336
3337         Reviewed by Filip Pizlo.
3338
3339         This patch implements DOMJIT accessors in WebCore. We plan to offer 2 things in DOMJIT.
3340
3341             1. Hand written DOM inlining.
3342
3343             We inject DOMJIT::Patchpoint compiler into JSC. And JSC uses this to inline DOM operation,
3344             and drop type checks. Since the operation is fully inlined, potentially it has large
3345             performance boost. Note that CSS Selector JIT compiler already does the similar things:
3346             accessing parentNode etc. directly by using offsets.
3347
3348             2. Exposing signature information.
3349
3350             We will offer function type signature by some representation and pass it to JSC.
3351             JSC will use to drop type checks. Since IDL code generator already knows this,
3352             we can automatically generate such a information. Since we don't perform any inlining,
3353             the performance boost may be limited. But it's worth doing.
3354
3355         This patch implements the first one, hand written DOM inlining facility. We add a new IDL attribute,
3356         "DOMJIT". This means that "This readonly attribute have a DOMJIT patchpoint compiler".
3357         We annotate several accessors at first. "firstChild", "lastChild", "nextSibling", "previousSibling",
3358         and "parentNode". And we implement DOMJIT::Patchpoint for that in JSNodeDOMJIT.cpp.
3359
3360         This patchpoint will be integrated into JSC's DFG and FTL. And these tiers can drop type checks and
3361         inline the entire code of these accessors. JSC compiler still does not know much about DOM. And WebCore
3362         does not know much about each tier of JSC. WebCore just offers the generic patchpoints and they are
3363         used in both DFG and FTL tiers. The layer separation is still kept.
3364
3365         While very small microbenchmark[1] shows performance benefit, still we cannot improve DOM
3366         benchmarks due to the lack of following implementations. Once the following implementations
3367         are implemented, we will get performance boost.
3368
3369         1. Super polymorphic sites.
3370
3371             This inlining is super effective if we run some microbenchmarks. However, Dromaeo does not
3372             show so much performance benefit. This is because Dromaeo's dom-traverse.html is super
3373             polymorphic call site where JSC gives up optimization. For example, in the following
3374             dromaeo's benchmark, we can see so various DOM nodes at the `cur.firstChild` site, like,
3375             HTMLDivElement, HTMLAnchorElement, Text, Comment etc. JSC gives up optimization since we
3376             encounter so many Structures. This should be optimized since they share the large part of
3377             prototype-chain and they hit the exactly same CustomGetter, Node.prototype.firstChild.
3378             We will handle this and when we optimize it, this DOMJIT works well on Dromaeo.
3379
3380                 test( "firstChild", function(){
3381                     var nodes = document.body.childNodes, nl = nodes.length;
3382
3383                     for ( var i = 0; i < num; i++ ) {
3384                         for ( var j = 0; j < nl; j++ ) {
3385                             var cur = nodes[j];
3386                             while ( cur )
3387                                 cur = cur.firstChild;
3388                             ret = cur;
3389                         }
3390                     }
3391                 });
3392
3393         2. Emit code in IC.
3394
3395             Currently, we only optimize DOMJIT accessors in DFG and FTL. However, we should leverage
3396             this DOMJIT::Patchpoint to emit inlined code even in Inline Caching (IC). We will emit
3397             CheckDOM's code for IC's guard phase, and emit CallDOM's code for IC's get phase. This
3398             offers performance benefit even if we live in baseline JIT code. And this should be easy.
3399
3400         [1]: With the following one, we can see 3x improvement (26ms v.s. 80ms).
3401
3402             var element = document.getElementsByTagName('div')[3];
3403             var before = Date.now();
3404             for (var i = 0; i < 1e7; ++i)
3405                 element.firstChild;
3406             console.log(Date.now() - before);
3407
3408         * CMakeLists.txt:
3409         * ForwardingHeaders/domjit/DOMJITGetterSetter.h:
3410         * ForwardingHeaders/domjit/DOMJITPatchpoint.h: Copied from Source/JavaScriptCore/domjit/DOMJITSlowPathCalls.h.
3411         * ForwardingHeaders/domjit/DOMJITPatchpointParams.h: Copied from Source/JavaScriptCore/domjit/DOMJITSlowPathCalls.h.
3412         * WebCore.xcodeproj/project.pbxproj:
3413         * bindings/js/JSDOMGlobalObject.h:
3414         * bindings/js/JSDOMWrapper.h:
3415         (WebCore::JSDOMWrapper::offsetOfWrapped):
3416         (WebCore::JSDOMWrapper::wrapped): Deleted.
3417         * bindings/js/ScriptWrappable.h:
3418         (WebCore::ScriptWrappable::offsetOfWrapper):
3419         * bindings/scripts/CodeGeneratorJS.pm:
3420         (GetJSCAttributesForAttribute):
3421         (GenerateHeader):
3422         (GeneratePropertiesHashTable):
3423         (GenerateImplementation):
3424         (GenerateHashTableValueArray):
3425         * bindings/