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