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