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