[CSS Parser] Support unprefixed image-sets
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-10-29  Dave Hyatt  <hyatt@apple.com>
2
3         [CSS Parser] Support unprefixed image-sets
4         https://bugs.webkit.org/show_bug.cgi?id=164198
5
6         Reviewed by Dean Jackson.
7
8         * css/CSSValueKeywords.in:
9         * css/parser/CSSPropertyParserHelpers.cpp:
10         (WebCore::CSSPropertyParserHelpers::consumeImage):
11
12 2016-10-30  Yusuke Suzuki  <utatane.tea@gmail.com>
13
14         [DOM] Introduce WebCore::jsDynamicDowncast
15         https://bugs.webkit.org/show_bug.cgi?id=164137
16
17         Reviewed by Darin Adler.
18
19         In WebCore, we have several extended JSTypes, like JSElementType.
20         For these types, WebCore offers the faster casting function compared
21         to JSC::jsDynamicCast. For example, for JSElementType, we have
22         jsElementCast.
23
24         The problem is that we may fall into the slow code if we choose
25         JSC::jsDynamicCast by accident. Selecting the appropriate function
26         requires special care in the IDL code generator when we would like
27         to use faster casting functions.
28
29         This patch implements a new casting function, WebCore::jsDynamicDowncast.
30         It is a thin wrapper to the JSC::jsDynamicCast. But it selects the
31         faster casting functions correctly by template specialization.
32
33         We do not choose the way specializing JSC::jsDynamicCast directly.
34         If we forget to include the header that specializes JSC::jsDyanmicCast,
35         it does not cause any compile errors, but it causes performance regression.
36         This bug is hard to figure out. To avoid this problem, we add a new function.
37
38         Outside JSC, only Tools' DumpRenderTree uses JSC::jsDynamicCast.
39         This code has FIXME that we should use JSC APIs instead of directly calling
40         JSC thingy. So this should be solved in the layer of JSC APIs and changing
41         this jsDynamicCast to WebCore's jsDynamicDowncast and exposing WebCore's thingy
42         are not good change. So we leave the code as is.
43
44         * WebCore.xcodeproj/project.pbxproj:
45         * bindings/js/JSApplePaySessionCustom.cpp:
46         (WebCore::JSApplePaySession::completeShippingMethodSelection):
47         (WebCore::JSApplePaySession::completeShippingContactSelection):
48         (WebCore::JSApplePaySession::completePaymentMethodSelection):
49         * bindings/js/JSDOMBinding.cpp:
50         (WebCore::reportException):
51         * bindings/js/JSDOMBinding.h:
52         (WebCore::castThisValue):
53         (WebCore::toArrayBufferView):
54         * bindings/js/JSDOMIterator.h:
55         (WebCore::IteratorTraits>::next):
56         * bindings/js/JSDOMWindowShell.cpp:
57         (WebCore::JSDOMWindowShell::toWrapped):
58         * bindings/js/JSDictionary.cpp:
59         (WebCore::JSDictionary::convertValue):
60         * bindings/js/JSDocumentCustom.h:
61         (WebCore::jsDocumentCast):
62         * bindings/js/JSDynamicDowncast.h: Added.
63         (WebCore::JSDynamicCastTrait::cast):
64         (WebCore::JSDynamicCastTrait<JSNode>::cast):
65         (WebCore::JSDynamicCastTrait<JSElement>::cast):
66         (WebCore::JSDynamicCastTrait<JSDocument>::cast):
67         (WebCore::JSDynamicCastTrait<JSEvent>::cast):
68         (WebCore::jsDynamicDowncast):
69         * bindings/js/JSElementCustom.h:
70         (WebCore::jsElementCast):
71         * bindings/js/JSEventCustom.h:
72         (WebCore::jsEventCast):
73         * bindings/js/JSEventListener.cpp:
74         (WebCore::setDocumentEventHandlerAttribute):
75         * bindings/js/JSEventTargetCustom.cpp:
76         (WebCore::jsEventTargetCast):
77         * bindings/js/JSMediaStreamTrackCustom.cpp:
78         (WebCore::JSMediaStreamTrack::getSettings):
79         (WebCore::JSMediaStreamTrack::getCapabilities):
80         * bindings/js/JSNodeCustom.h:
81         (WebCore::jsNodeCast):
82         * bindings/js/JSPluginElementFunctions.cpp:
83         (WebCore::pluginElementPropertyGetter):
84         * bindings/js/JSReadableStreamPrivateConstructors.cpp:
85         (WebCore::constructJSReadableStreamDefaultReader):
86         * bindings/js/JSReadableStreamSourceCustom.cpp:
87         (WebCore::startReadableStream):
88         (WebCore::JSReadableStreamSource::start):
89         (WebCore::pullReadableStream):
90         * bindings/js/JSWorkerGlobalScopeBase.cpp:
91         (WebCore::toJSDedicatedWorkerGlobalScope):
92         * bindings/js/ScriptModuleLoader.cpp:
93         (WebCore::ScriptModuleLoader::evaluate):
94         * bindings/js/SerializedScriptValue.cpp:
95         (WebCore::CloneSerializer::serialize):
96         * bindings/js/StructuredClone.cpp:
97         (WebCore::structuredCloneArrayBufferView):
98         * bindings/scripts/CodeGeneratorJS.pm:
99         (GetCastingHelperForThisObject):
100         (GenerateImplementation):
101         * bindings/scripts/test/JS/JSInterfaceName.cpp:
102         (WebCore::jsInterfaceNameConstructor):
103         (WebCore::setJSInterfaceNameConstructor):
104         (WebCore::JSInterfaceName::toWrapped):
105         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
106         (WebCore::BindingCaller<JSTestActiveDOMObject>::castForAttribute):
107         (WebCore::BindingCaller<JSTestActiveDOMObject>::castForOperation):
108         (WebCore::jsTestActiveDOMObjectConstructor):
109         (WebCore::setJSTestActiveDOMObjectConstructor):
110         (WebCore::JSTestActiveDOMObject::toWrapped):
111         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
112         (WebCore::BindingCaller<JSTestCEReactions>::castForAttribute):
113         (WebCore::BindingCaller<JSTestCEReactions>::castForOperation):
114         (WebCore::jsTestCEReactionsConstructor):
115         (WebCore::setJSTestCEReactionsConstructor):
116         (WebCore::JSTestCEReactions::toWrapped):
117         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
118         (WebCore::BindingCaller<JSTestCEReactionsStringifier>::castForAttribute):
119         (WebCore::BindingCaller<JSTestCEReactionsStringifier>::castForOperation):
120         (WebCore::jsTestCEReactionsStringifierConstructor):
121         (WebCore::setJSTestCEReactionsStringifierConstructor):
122         (WebCore::JSTestCEReactionsStringifier::toWrapped):
123         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
124         (WebCore::jsTestClassWithJSBuiltinConstructorConstructor):
125         (WebCore::setJSTestClassWithJSBuiltinConstructorConstructor):
126         (WebCore::JSTestClassWithJSBuiltinConstructor::toWrapped):
127         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
128         (WebCore::jsTestCustomConstructorWithNoInterfaceObjectConstructor):
129         (WebCore::setJSTestCustomConstructorWithNoInterfaceObjectConstructor):
130         (WebCore::JSTestCustomConstructorWithNoInterfaceObject::toWrapped):
131         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
132         (WebCore::BindingCaller<JSTestCustomNamedGetter>::castForOperation):
133         (WebCore::jsTestCustomNamedGetterConstructor):
134         (WebCore::setJSTestCustomNamedGetterConstructor):
135         (WebCore::JSTestCustomNamedGetter::toWrapped):
136         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
137         (WebCore::BindingCaller<JSTestDOMJIT>::castForAttribute):
138         (WebCore::jsTestDOMJITConstructor):
139         (WebCore::setJSTestDOMJITConstructor):
140         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
141         (WebCore::BindingCaller<JSTestEventConstructor>::castForAttribute):
142         (WebCore::jsTestEventConstructorConstructor):
143         (WebCore::setJSTestEventConstructorConstructor):
144         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
145         (WebCore::BindingCaller<JSTestEventTarget>::castForOperation):
146         (WebCore::jsTestEventTargetConstructor):
147         (WebCore::setJSTestEventTargetConstructor):
148         (WebCore::JSTestEventTarget::toWrapped):
149         * bindings/scripts/test/JS/JSTestException.cpp:
150         (WebCore::BindingCaller<JSTestException>::castForAttribute):
151         (WebCore::jsTestExceptionConstructor):
152         (WebCore::setJSTestExceptionConstructor):
153         (WebCore::JSTestException::toWrapped):
154         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
155         (WebCore::jsTestGenerateIsReachableConstructor):
156         (WebCore::setJSTestGenerateIsReachableConstructor):
157         (WebCore::JSTestGenerateIsReachable::toWrapped):
158         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
159         (WebCore::BindingCaller<JSTestGlobalObject>::castForAttribute):
160         (WebCore::BindingCaller<JSTestGlobalObject>::castForOperation):
161         (WebCore::jsTestGlobalObjectConstructor):
162         (WebCore::setJSTestGlobalObjectConstructor):
163         (WebCore::JSTestGlobalObject::toWrapped):
164         * bindings/scripts/test/JS/JSTestInterface.cpp:
165         (WebCore::BindingCaller<JSTestInterface>::castForAttribute):
166         (WebCore::BindingCaller<JSTestInterface>::castForOperation):
167         (WebCore::jsTestInterfaceConstructor):
168         (WebCore::setJSTestInterfaceConstructor):
169         (WebCore::JSTestInterface::toWrapped):
170         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
171         (WebCore::BindingCaller<JSTestInterfaceLeadingUnderscore>::castForAttribute):
172         (WebCore::jsTestInterfaceLeadingUnderscoreConstructor):
173         (WebCore::setJSTestInterfaceLeadingUnderscoreConstructor):
174         (WebCore::JSTestInterfaceLeadingUnderscore::toWrapped):
175         * bindings/scripts/test/JS/JSTestIterable.cpp:
176         (WebCore::BindingCaller<JSTestIterable>::castForOperation):
177         (WebCore::jsTestIterableConstructor):
178         (WebCore::setJSTestIterableConstructor):
179         (WebCore::JSTestIterable::toWrapped):
180         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
181         (WebCore::BindingCaller<JSTestJSBuiltinConstructor>::castForAttribute):
182         (WebCore::BindingCaller<JSTestJSBuiltinConstructor>::castForOperation):
183         (WebCore::jsTestJSBuiltinConstructorConstructor):
184         (WebCore::setJSTestJSBuiltinConstructorConstructor):
185         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
186         (WebCore::BindingCaller<JSTestMediaQueryListListener>::castForOperation):
187         (WebCore::jsTestMediaQueryListListenerConstructor):
188         (WebCore::setJSTestMediaQueryListListenerConstructor):
189         (WebCore::JSTestMediaQueryListListener::toWrapped):
190         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
191         (WebCore::jsTestNamedConstructorConstructor):
192         (WebCore::setJSTestNamedConstructorConstructor):
193         (WebCore::JSTestNamedConstructor::toWrapped):
194         * bindings/scripts/test/JS/JSTestNode.cpp:
195         (WebCore::BindingCaller<JSTestNode>::castForAttribute):
196         (WebCore::BindingCaller<JSTestNode>::castForOperation):
197         (WebCore::jsTestNodeConstructor):
198         (WebCore::setJSTestNodeConstructor):
199         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
200         (WebCore::BindingCaller<JSTestNondeterministic>::castForAttribute):
201         (WebCore::BindingCaller<JSTestNondeterministic>::castForOperation):
202         (WebCore::jsTestNondeterministicConstructor):
203         (WebCore::setJSTestNondeterministicConstructor):
204         (WebCore::JSTestNondeterministic::toWrapped):
205         * bindings/scripts/test/JS/JSTestObj.cpp:
206         (WebCore::BindingCaller<JSTestObj>::castForAttribute):
207         (WebCore::BindingCaller<JSTestObj>::castForOperation):
208         (WebCore::jsTestObjConstructor):
209         (WebCore::setJSTestObjConstructor):
210         (WebCore::JSTestObj::toWrapped):
211         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
212         (WebCore::jsTestOverloadedConstructorsConstructor):
213         (WebCore::setJSTestOverloadedConstructorsConstructor):
214         (WebCore::JSTestOverloadedConstructors::toWrapped):
215         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
216         (WebCore::jsTestOverloadedConstructorsWithSequenceConstructor):
217         (WebCore::setJSTestOverloadedConstructorsWithSequenceConstructor):
218         (WebCore::JSTestOverloadedConstructorsWithSequence::toWrapped):
219         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
220         (WebCore::BindingCaller<JSTestOverrideBuiltins>::castForOperation):
221         (WebCore::jsTestOverrideBuiltinsConstructor):
222         (WebCore::setJSTestOverrideBuiltinsConstructor):
223         (WebCore::JSTestOverrideBuiltins::toWrapped):
224         * bindings/scripts/test/JS/JSTestSerialization.cpp:
225         (WebCore::BindingCaller<JSTestSerialization>::castForAttribute):
226         (WebCore::BindingCaller<JSTestSerialization>::castForOperation):
227         (WebCore::jsTestSerializationConstructor):
228         (WebCore::setJSTestSerializationConstructor):
229         (WebCore::JSTestSerialization::toWrapped):
230         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
231         (WebCore::BindingCaller<JSTestSerializedScriptValueInterface>::castForAttribute):
232         (WebCore::jsTestSerializedScriptValueInterfaceConstructor):
233         (WebCore::setJSTestSerializedScriptValueInterfaceConstructor):
234         (WebCore::JSTestSerializedScriptValueInterface::toWrapped):
235         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
236         (WebCore::BindingCaller<JSTestTypedefs>::castForAttribute):
237         (WebCore::BindingCaller<JSTestTypedefs>::castForOperation):
238         (WebCore::jsTestTypedefsConstructor):
239         (WebCore::setJSTestTypedefsConstructor):
240         (WebCore::JSTestTypedefs::toWrapped):
241         * bridge/objc/WebScriptObject.mm:
242         (-[WebScriptObject setValue:forKey:]):
243         * bridge/runtime_array.cpp:
244         (JSC::RuntimeArray::lengthGetter):
245         * bridge/runtime_method.cpp:
246         (JSC::RuntimeMethod::lengthGetter):
247         * html/HTMLMediaElement.cpp:
248         (WebCore::controllerJSValue):
249         (WebCore::HTMLMediaElement::updateCaptionContainer):
250         (WebCore::HTMLMediaElement::didAddUserAgentShadowRoot):
251         * inspector/InspectorDOMAgent.cpp:
252         (WebCore::InspectorDOMAgent::buildObjectForEventListener):
253
254 2016-10-29  Dave Hyatt  <hyatt@apple.com>
255
256         [CSS Parser] Add font-variant-* keyword property support
257         https://bugs.webkit.org/show_bug.cgi?id=164195
258
259         Reviewed by Zalan Bujtas.
260
261         * css/parser/CSSParserFastPaths.cpp:
262         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
263
264 2016-10-29  Dave Hyatt  <hyatt@apple.com>
265
266         [CSS Parser] Fix text-emphasis-position parsing
267         https://bugs.webkit.org/show_bug.cgi?id=164197
268
269         Reviewed by Zalan Bujtas.
270
271         * css/parser/CSSParserFastPaths.cpp:
272         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
273         (WebCore::CSSParserFastPaths::isKeywordPropertyID):
274         * css/parser/CSSPropertyParser.cpp:
275         (WebCore::consumeTextEmphasisPosition):
276         (WebCore::CSSPropertyParser::parseSingleValue):
277
278 2016-10-29  Darin Adler  <darin@apple.com>
279
280         Convert more of DOM from ExceptionCode to Exception
281         https://bugs.webkit.org/show_bug.cgi?id=164173
282
283         Reviewed by Ryosuke Niwa.
284
285         * Modules/mediastream/MediaDevices.cpp:
286         (WebCore::MediaDevices::getUserMedia): Use ExceptionOr.
287         (WebCore::MediaDevices::enumerateDevices): Ditto.
288         * Modules/mediastream/MediaDevices.h: Updated for above.
289         * Modules/mediastream/MediaDevices.idl: Use non-legacy exceptions.
290
291         * Modules/mediastream/MediaEndpointSessionDescription.cpp:
292         Added now-needed include of ExceptionCode.h.
293
294         * Modules/mediastream/RTCConfiguration.cpp:
295         (WebCore::parseIceServer): Use ExceptionOr.
296         (WebCore::RTCConfiguration::create): Ditto.
297         (WebCore::RTCConfiguration::initialize): Ditto.
298         * Modules/mediastream/RTCConfiguration.h: Updated for above.
299         * Modules/mediastream/RTCConfiguration.idl: Use non-legacy exceptions.
300
301         * Modules/mediastream/RTCDTMFSender.cpp:
302         (WebCore::RTCDTMFSender::create): Use ExceptionOr.
303         (WebCore::RTCDTMFSender::insertDTMF): Ditto.
304         * Modules/mediastream/RTCDTMFSender.h: Updated for above.
305         * Modules/mediastream/RTCDTMFSender.idl: Use non-legacy exceptions.
306
307         * Modules/mediastream/RTCDataChannel.cpp:
308         (WebCore::RTCDataChannel::create): Use ExceptionOr.
309         (WebCore::RTCDataChannel::setBinaryType): Ditto.
310         (WebCore::RTCDataChannel::send): Ditto.
311         (WebCore::RTCDataChannel::didReceiveRawData): Ditto.
312         * Modules/mediastream/RTCDataChannel.h: Updated for above.
313         Also fhcanged resturn values to use const AtomicString& and
314         unsigned instead of unsigned long. Also made more private.
315         Also changed BinaryType into an enum class.
316         * Modules/mediastream/RTCDataChannel.idl: Use non-legacy exceptions.
317
318         * Modules/mediastream/RTCIceCandidate.cpp:
319         (WebCore::RTCIceCandidate::create): Use ExceptionOr.
320         * Modules/mediastream/RTCIceCandidate.h: Updated for above.
321         * Modules/mediastream/RTCIceCandidate.idl: Use non-legacy exception.
322
323         * Modules/mediastream/RTCOfferAnswerOptions.cpp:
324         (WebCore::RTCOfferOptions::create): Use ExceptionOr.
325         (WebCore::RTCAnswerOptions::create): Ditto.
326         * Modules/mediastream/RTCOfferAnswerOptions.h: Updated for above.
327         Also removed all virtual functions since nothing here is polymorphic
328         and initalized data members in the header.
329
330         * Modules/mediastream/RTCPeerConnection.cpp:
331         (WebCore::RTCPeerConnection::initializeWith): Use ExceptionOr.
332         (WebCore::RTCPeerConnection::addTrack): Ditto.
333         (WebCore::RTCPeerConnection::removeTrack): Ditto.
334         (WebCore::RTCPeerConnection::addTransceiver): Ditto.
335         (WebCore::RTCPeerConnection::completeAddTransceiver): Ditto.
336         (WebCore::RTCPeerConnection::queuedCreateOffer): Ditto.
337         (WebCore::RTCPeerConnection::queuedCreateAnswer): Ditto.
338         (WebCore::RTCPeerConnection::setConfiguration): Ditto.
339         (WebCore::RTCPeerConnection::createDataChannel): Ditto.
340         * Modules/mediastream/RTCPeerConnection.h: Updated for above.
341         * Modules/mediastream/RTCPeerConnection.idl: Use non-legacy exceptions.
342
343         * Modules/mediastream/RTCRtpSender.cpp:
344         (WebCore::RTCRtpSender::replaceTrack): Use ExceptionOr.
345         * Modules/mediastream/RTCRtpSender.h: Updated for above.
346         * Modules/mediastream/RTCRtpSender.idl: Use non-legacy exception.
347
348         * Modules/mediastream/RTCSessionDescription.cpp:
349         (WebCore::RTCSessionDescription::create): Use ExceptoinOr.
350         * Modules/mediastream/RTCSessionDescription.h: Updated for above.
351         (WebCore::RTCSessionDescription::~RTCSessionDescription):
352         * Modules/mediastream/RTCSessionDescription.idl: Use non-legacy exceptions.
353
354         * Modules/navigatorcontentutils/NavigatorContentUtils.cpp:
355         (WebCore::verifyCustomHandlerURL): Just return a boolean, no exception.
356         (WebCore::verifyProtocolHandlerScheme): Ditto.
357         (WebCore::NavigatorContentUtils::registerProtocolHandler): Use ExceptionOr.
358         (WebCore::NavigatorContentUtils::isProtocolHandlerRegistered): Ditto.
359         (WebCore::NavigatorContentUtils::unregisterProtocolHandler): Ditto.
360         * Modules/navigatorcontentutils/NavigatorContentUtils.h: Updated for above.
361         * Modules/navigatorcontentutils/NavigatorContentUtils.idl: Use non-legacy exceptions.
362
363         * bindings/js/JSMediaDevicesCustom.cpp:
364         (WebCore::JSMediaDevicesGetUserMediaPromiseFunction): Use propagateException.
365
366         * bindings/scripts/CodeGeneratorJS.pm:
367         (NeedsExplicitPropagateExceptionCall): Added. Helper function to decide whether
368         we need to call propagateException explicitly, if return value processing is not
369         going to propagate the exception for us.
370         (GenerateParametersCheck): Moved the code from GenerateReturnParameters inline
371         because it's almost as short as the function call. Use the newly created
372         NeedsExplicitPropagateExceptionCall function, which properly handles the case
373         where the return value is a promise.
374         (GenerateReturnParameters): Deleted.
375
376         * dom/CharacterData.cpp:
377         (WebCore::CharacterData::substringData): Use ExceptionOr.
378         (WebCore::CharacterData::insertData): Ditto.
379         (WebCore::CharacterData::deleteData): Ditto.
380         (WebCore::CharacterData::replaceData): Ditto.
381         * dom/CharacterData.h: Updated for above.
382         * dom/CharacterData.idl: Use non-legacy exceptions.
383
384         * dom/DataTransferItemList.h: Tried to use ExceptionOr, but this seems
385         like dead code that doesn't compile.
386         * dom/DataTransferItemList.idl: Use non-legacy exceptions.
387
388         * dom/MessagePort.idl: Use non-legacy exceptions, except this has
389         already been converted and was a custom binding.
390
391         * dom/MutationObserver.cpp:
392         (WebCore::MutationObserver::observe): Use ExceptionOr.
393         * dom/MutationObserver.h: Updated for above.
394         * dom/MutationObserver.idl: Use non-legacy exception.
395
396         * dom/Range.cpp:
397         (WebCore::deleteCharacterData): Updated use of calls that now use
398         ExceptionOr.
399         (WebCore::Range::processContentsBetweenOffsets): Ditto.
400         (WebCore::Range::insertNode): Ditto.
401
402         * dom/ShadowRoot.cpp:
403         (WebCore::ShadowRoot::setInnerHTML): Use ExceptionOr.
404         * dom/ShadowRoot.h: Updated for above.
405         * dom/ShadowRoot.idl: Use non-legacy exception.
406
407         * dom/Text.cpp:
408         (WebCore::Text::splitText): Use ExceptionOr.
409         (WebCore::Text::replaceWholeText): Removed unused ExceptionCode&.
410         * dom/Text.h: Updated for above.
411         * dom/Text.idl: Use non-legacy exception.
412
413         * editing/ApplyBlockElementCommand.cpp:
414         (WebCore::isNewLineAtPosition): Rewrote to use data rather than
415         substringData; more efficient.
416
417         * editing/DeleteFromTextNodeCommand.cpp:
418         (WebCore::DeleteFromTextNodeCommand::doApply): Updated to work with
419         functions that return ExceptionOr.
420         (WebCore::DeleteFromTextNodeCommand::doUnapply): Removed IGNORE_EXCEPTION.
421
422         * editing/InsertIntoTextNodeCommand.cpp:
423         (WebCore::InsertIntoTextNodeCommand::InsertIntoTextNodeCommand):
424         Use WTFMove to avoid a little bit of reference count churn.
425         (WebCore::InsertIntoTextNodeCommand::doApply): Removed IGNORE_EXCEPTION.
426         (WebCore::InsertIntoTextNodeCommand::doReapply): Removed ExceptionCode.
427         (WebCore::InsertIntoTextNodeCommand::doUnapply): Removed IGNORE_EXCEPTION.
428
429         * editing/SplitTextNodeCommand.cpp:
430         (WebCore::SplitTextNodeCommand::doApply): Updated to work with functions
431         that return ExceptionCode.
432         (WebCore::SplitTextNodeCommand::doUnapply): Removed ASSERT_NO_EXCEPTION.
433         (WebCore::SplitTextNodeCommand::insertText1AndTrimText2): Updated to work
434         with functions that return ExceptionCode.
435
436         * html/HTMLTextFormControlElement.cpp:
437         Added now-needed include of ExceptionCode.h.
438
439         * inspector/DOMEditor.cpp: Removed ExceptionCode out argument from calls
440         to replaceWholeText, which never throws an exception.
441
442 2016-10-29  Dean Jackson  <dino@apple.com>
443
444         Parse color() function
445         https://bugs.webkit.org/show_bug.cgi?id=164146
446         <rdar://problems/29007218>
447
448         Reviewed by Darin Adler.
449
450         Support the new CSS color() function:
451         https://drafts.csswg.org/css-color/#color-function
452
453         There are separate code paths for the old and new CSS parser.
454
455         Tests: css3/color/color-function-computed-style.html
456                css3/color/color-function-parsing.html
457
458         * css/CSSComputedStyleDeclaration.cpp: Use Color directly, not via rgb().
459         (WebCore::ComputedStyleExtractor::currentColorOrValidColor):
460         (WebCore::ComputedStyleExtractor::valueForShadow):
461         (WebCore::ComputedStyleExtractor::propertyValue):
462
463         * css/CSSValueKeywords.in: Note that there is a color function, but the
464         keyword is already defined. Also add keywords for the color spaces.
465         * css/SVGCSSValueKeywords.in: sRGB is used outside of SVG now.
466
467         * css/parser/CSSParser.cpp: Old CSS parser code to handle color().
468         (WebCore::isPercent): Helper to tell if a ValueWithCalculation is a percentage or not.
469         (WebCore::CSSParser::parseColorInt): Renamed.
470         (WebCore::CSSParser::parseColorDouble): Helper to get a Number/Percentage into a double
471         (WebCore::CSSParser::parseRGBParameters):
472         (WebCore::CSSParser::parseColorFunctionParameters):
473         (WebCore::CSSParser::parseHSLParameters):
474         (WebCore::CSSParser::parseColorFromValue):
475         (WebCore::CSSParser::colorIntFromValue): Deleted.
476         * css/parser/CSSParser.h:
477
478         * css/parser/CSSPropertyParserHelpers.cpp: New CSS parser code to handle color().
479         (WebCore::CSSPropertyParserHelpers::parseColorFunctionParameters):
480         (WebCore::CSSPropertyParserHelpers::parseColorFunction):
481
482         * platform/graphics/Color.h:
483         (WebCore::Color::isValid): An extended color is valid.
484         (WebCore::Color::rgb): Move the code to a standalone inline
485         so that I could add a longer comment.
486
487         * platform/graphics/ExtendedColor.cpp:
488         (WebCore::ExtendedColor::cssText): Alpha output is only needed if != 1.
489
490         * platform/graphics/cg/ColorCG.cpp: Handle ExtendedColor -> CGColor.
491         (WebCore::leakCGColor):
492         (WebCore::cachedCGColor):
493
494 2016-10-29  Dave Hyatt  <hyatt@apple.com>
495
496         [CSS Parser] Disable -webkit-text-size-adjust when the context says to.
497         https://bugs.webkit.org/show_bug.cgi?id=164191
498
499         Reviewed by Dean Jackson.
500
501         * css/parser/CSSPropertyParser.cpp:
502         (WebCore::CSSPropertyParser::parseSingleValue):
503
504 2016-10-29  Dave Hyatt  <hyatt@apple.com>
505
506         [CSS Parser] Match old parser's image-rendering values
507         https://bugs.webkit.org/show_bug.cgi?id=164190
508
509         Reviewed by Dean Jackson.
510
511         * css/parser/CSSParserFastPaths.cpp:
512         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
513
514 2016-10-29  Dave Hyatt  <hyatt@apple.com>
515
516         [CSS Parser] Support -webkit-text value for background-clip and -webkit-background-clip
517         https://bugs.webkit.org/show_bug.cgi?id=164189
518
519         Reviewed by Dean Jackson.
520
521         * css/parser/CSSPropertyParser.cpp:
522         (WebCore::consumeBackgroundBox):
523         (WebCore::consumePrefixedBackgroundBox):
524
525 2016-10-29  Joseph Pecoraro  <pecoraro@apple.com>
526
527         Remove some unnecessary includes
528         https://bugs.webkit.org/show_bug.cgi?id=164174
529
530         Reviewed by Darin Adler.
531
532 2016-10-29  Dave Hyatt  <hyatt@apple.com>
533
534         [CSS Parser] Support -webkit-aspect-ratio
535         https://bugs.webkit.org/show_bug.cgi?id=164187
536
537         Reviewed by Simon Fraser.
538
539         * css/parser/CSSPropertyParser.cpp:
540         (WebCore::consumeWebkitAspectRatio):
541         (WebCore::CSSPropertyParser::parseSingleValue):
542
543 2016-10-29  Dave Hyatt  <hyatt@apple.com>
544
545         [CSS Parser] Support the caps lock indicator appearance
546         https://bugs.webkit.org/show_bug.cgi?id=164186
547
548         Reviewed by Simon Fraser.
549
550         * css/parser/CSSParserFastPaths.cpp:
551         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
552
553 2016-10-29  Dave Hyatt  <hyatt@apple.com>
554
555         [CSS Parser] Support the alt property
556         https://bugs.webkit.org/show_bug.cgi?id=164184
557
558         Reviewed by Simon Fraser.
559
560         * css/parser/CSSPropertyParser.cpp:
561         (WebCore::consumeAlt):
562         (WebCore::CSSPropertyParser::parseSingleValue):
563
564 2016-10-29  Dave Hyatt  <hyatt@apple.com>
565
566         [CSS Parser] Add support for -webkit-hyphenate-limit-* properties
567         https://bugs.webkit.org/show_bug.cgi?id=164183
568
569         Reviewed by Simon Fraser.
570
571         * css/parser/CSSPropertyParser.cpp:
572         (WebCore::consumeHyphenateLimit):
573         (WebCore::CSSPropertyParser::parseSingleValue):
574
575 2016-10-29  Dave Hyatt  <hyatt@apple.com>
576
577         [CSS Parser] Fix transform-origin and perspective-origin to parse as shorthands
578         https://bugs.webkit.org/show_bug.cgi?id=164178
579
580         Reviewed by Zalan Bujtas.
581
582         * css/CSSPropertyNames.in:
583         Patch the transform-origin-x/y and perspective-origin-x/y properties
584         to use new converters that can handle keywords.
585
586         * css/StyleBuilderConverter.h:
587         (WebCore::StyleBuilderConverter::convertPositionComponentX):
588         (WebCore::StyleBuilderConverter::convertPositionComponentY):
589         Add the new converters. They just call convertPositionComponent method
590         that we already use for object-position and background-position.
591
592         * css/parser/CSSPropertyParser.cpp:
593         (WebCore::CSSPropertyParser::consumeTransformOrigin):
594         (WebCore::CSSPropertyParser::consumePerspectiveOrigin):
595         Changed to treat the properties as shorthands and add the longhand
596         properties once parsed.
597
598         (WebCore::CSSPropertyParser::parseSingleValue):
599         (WebCore::CSSPropertyParser::parseShorthand):
600         * css/parser/CSSPropertyParser.h:
601         Move the parsing into the shorthand method, since we're still treating
602         these properties as shorthands.
603
604 2016-10-29  Dave Hyatt  <hyatt@apple.com>
605
606         [CSS Parser] Support -webkit-background-composite
607         https://bugs.webkit.org/show_bug.cgi?id=164179
608
609         Reviewed by Zalan Bujtas.
610
611         * css/parser/CSSPropertyParser.cpp:
612         (WebCore::consumeBackgroundComponent):
613         (WebCore::CSSPropertyParser::parseSingleValue):
614
615 2016-10-29  Youenn Fablet  <youenn@apple.com>
616
617         REGRESSION (r207754): LayoutTest http/tests/security/svg-image-with-css-cross-domain.html is a flaky failure
618         https://bugs.webkit.org/show_bug.cgi?id=163922
619
620         Reviewed by Alex Christensen.
621
622         Test: http/tests/security/cached-svg-image-with-css-cross-domain.html
623
624         Raw data was not copied in cloned CachedCSSStyleSheet while it is used by some of its clients.
625         Updated CachedCSSStyleSheet and CachedImage cloning to copy its raw data.
626
627         * loader/cache/CachedCSSStyleSheet.cpp:
628         (WebCore::CachedCSSStyleSheet::setBodyDataFrom):
629         * loader/cache/CachedImage.cpp:
630         (WebCore::CachedImage::setBodyDataFrom):
631         * loader/cache/CachedResource.h:
632         (WebCore::CachedResource::mayTryReplaceEncodedData):
633
634 2016-10-29  Youenn Fablet  <youenn@apple.com>
635
636         REGRESSION (Safari 10 / r189445): WKWebView and WebView no longer allow async XMLHttpRequest timeout to exceed 60 seconds
637         https://bugs.webkit.org/show_bug.cgi?id=163814
638         <rdar://problem/28917420>
639
640         Reviewed by Darin Adler.
641
642         Tests: http/tests/xmlhttprequest/resetting-timeout-to-zero.html
643                http/tests/xmlhttprequest/timeout-greater-than-default-network-timeout.html
644
645         * xml/XMLHttpRequest.cpp:
646         (WebCore::XMLHttpRequest::setTimeout): If the XHR timeout is active, resetting the timeout to zero should lead to using the default network timeout.
647         Since it is difficult to update the timeout once the request is sent, we mimic the default network timeout with a 60 seconds XHR timeout.
648         (WebCore::XMLHttpRequest::createRequest): Setting network timeout to infinity if the XHR timeout is active.
649
650 2016-10-29  Youenn Fablet  <youenn@apple.com>
651
652         MediaEndpoint::generateDtlsInfo is not needed
653         https://bugs.webkit.org/show_bug.cgi?id=164130
654
655         Reviewed by Eric Carlson.
656
657         No change of behavior.
658
659         Removing MediaEndpoint::generateDtlsInfo as it can be called directly from createMediaEndpointOwr.
660
661         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
662         (WebCore::MediaEndpointPeerConnection::MediaEndpointPeerConnection):
663         * platform/mediastream/MediaEndpoint.cpp:
664         * platform/mediastream/MediaEndpoint.h:
665         * platform/mediastream/openwebrtc/MediaEndpointOwr.cpp:
666         (WebCore::createMediaEndpointOwr):
667         * platform/mediastream/openwebrtc/MediaEndpointOwr.h:
668         * platform/mock/MockMediaEndpoint.cpp:
669         (WebCore::MockMediaEndpoint::MockMediaEndpoint):
670         (WebCore::MockMediaEndpoint::generateDtlsInfo): Deleted.
671         * platform/mock/MockMediaEndpoint.h:
672
673 2016-10-28  Wenson Hsieh  <wenson_hsieh@apple.com>
674
675         Unreviewed, add Input Events to the features list.
676
677         * features.json:
678
679 2016-10-28  Darin Adler  <darin@apple.com>
680
681         Fix mismerge that broke a CEReactions test.
682
683         * html/HTMLOptionsCollection.idl: Add back CEReactions to the remove function.
684
685 2016-10-28  Darin Adler  <darin@apple.com>
686
687         Move all classes in the HTML directory from ExceptionCode to Exception
688         https://bugs.webkit.org/show_bug.cgi?id=163876
689
690         Reviewed by Sam Weinig.
691
692         * bindings/js/JSDOMBinding.cpp:
693         (WebCore::shouldAllowAccessToNode): Deleted.
694         (WebCore::BindingSecurity::shouldAllowAccessToFrame): Moved function into the
695         BindingSecurity namespace. Also changed arguments to references.
696         (WebCore::BindingSecurity::shouldAllowAccessToDOMWindow): Ditto.
697         (WebCore::BindingSecurity::shouldAllowAccessToNode): Changed argument type
698         from pointer to reference.
699
700         * bindings/js/JSDOMBinding.h: Removed top level shouldAllowAccessTo functions,
701         moving all of them into the BindingSecurity namespace. Changed BindingSecurity
702         from a class into a namespace. Added new checkSecurityForNode functions that
703         can be used directly to implement CheckSecurityForNode; they turn the node
704         into a null, which is no change in behavior from what bindings already did.
705
706         * bindings/js/JSDOMWindowCustom.cpp:
707         (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess): Changed argument
708         type for passed-in string to const String& instead of String&.
709         (WebCore::JSDOMWindow::getOwnPropertySlot): Updated for BindingSecurity changes.
710         (WebCore::JSDOMWindow::getOwnPropertySlotByIndex): Ditto.
711         (WebCore::JSDOMWindow::put): Ditto.
712
713         * bindings/js/JSHTMLCanvasElementCustom.cpp:
714         (WebCore::attributesFor3DContext): Renamed from get3DContextAttributes and
715         changed to use a return value instead of an out argument.
716         (WebCore::JSHTMLCanvasElement::getContext): Updated for the above.
717         (WebCore::JSHTMLCanvasElement::toDataURL): Rewrote to handle ExceptionOr
718         and also to use Optional<double> instead of const double*.
719
720         * bindings/js/JSHTMLFrameElementCustom.cpp:
721         (WebCore::JSHTMLFrameElement::setLocation): Moved the logic from
722         allowSettingJavascriptURL in here and updated for BindingSecurity changes.
723
724         * bindings/js/JSHTMLOptionsCollectionCustom.cpp:
725         (WebCore::JSHTMLOptionsCollection::setLength): Use propagateException.
726         Also streamlined the code a bit.
727         (WebCore::JSHTMLOptionsCollection::indexSetter): Updated for new name and
728         argument types for selectElementIndexSetter.
729
730         * bindings/js/JSHTMLSelectElementCustom.cpp:
731         (WebCore::selectElementIndexSetter): Updated name and argument types and
732         to use propagateException.
733         (WebCore::JSHTMLSelectElement::indexSetter): Updated for above.
734         * bindings/js/JSHTMLSelectElementCustom.h: Ditto.
735
736         * bindings/js/JSLocationCustom.cpp:
737         (WebCore::JSLocation::getOwnPropertySlotDelegate): Updated for changes to
738         BindingSecurity.
739         (WebCore::JSLocation::putDelegate): Ditto. Also rearranged logic a bit.
740
741         * bindings/js/ScriptController.cpp:
742         (WebCore::ScriptController::canAccessFromCurrentOrigin): Updated for
743         changes to BindingSecurity.
744
745         * bindings/scripts/CodeGeneratorJS.pm:
746         (GenerateImplementation): Removed old support for CheckSecurityForNode.
747         (NativeToJSValue): Added new support for CheckSecurityForNode, which uses
748         the new checkSecurityForNode function, and works properly with ExceptionOr.
749
750         * bindings/scripts/test/JS/JSTestObj.cpp: Updated for change below.
751
752         * dom/ChildNode.idl: Move the remove function to non-legacy exception.
753         Needed now because this needs to match the one in HTMLSelectElement.
754
755         * dom/Element.cpp:
756         (WebCore::Element::dispatchMouseForceWillBegin): Refactored a little bit.
757         (WebCore::Element::mergeWithNextTextNode): Support ExceptionOr for remove.
758         (WebCore::Element::setOuterHTML): Support ExceptionOr for
759         createFragmentForInnerOuterHTML.
760         (WebCore::Element::setInnerHTML): Ditto.
761         (WebCore::Element::insertAdjacentHTML): Ditto.
762
763         * dom/Node.cpp:
764         (WebCore::Node::remove): Use ExceptionOr.
765         (WebCore::Node::normalize): Remove use of IGNORE_EXCEPTION.
766         * dom/Node.h: Use ExceptionOr for remove.
767
768         * dom/Range.cpp:
769         (WebCore::Range::insertNode): Updated for change to remove.
770         (WebCore::Range::createContextualFragment): Updated for change
771         to WebCore::createContextualFragment.
772
773         * dom/ShadowRoot.cpp:
774         (WebCore::ShadowRoot::setInnerHTML): Use ExceptionOr for
775         createFragmentForInnerOuterHTML and replaceChildrenWithFragment.
776
777         * editing/AppendNodeCommand.cpp:
778         (WebCore::AppendNodeCommand::doUnapply): Remove IGNORE_EXCEPTION.
779         * editing/InsertNodeBeforeCommand.cpp:
780         (WebCore::InsertNodeBeforeCommand::doUnapply): Ditto.
781         * editing/MergeIdenticalElementsCommand.cpp:
782         (WebCore::MergeIdenticalElementsCommand::doApply): Ditto.
783         * editing/RemoveNodeCommand.cpp:
784         (WebCore::RemoveNodeCommand::doApply): Ditto.
785         * editing/SplitElementCommand.cpp:
786         (WebCore::SplitElementCommand::doUnapply): Ditto.
787         * editing/SplitTextNodeCommand.cpp:
788         (WebCore::SplitTextNodeCommand::doUnapply): Ditto.
789         * editing/WrapContentsInDummySpanCommand.cpp:
790         (WebCore::WrapContentsInDummySpanCommand::doUnapply): Ditto.
791
792         * editing/Editor.cpp:
793         (WebCore::Editor::insertDictationPhrases): Deleted. Moved this
794         iOS-specific function to EditorIOS.mm.
795         (WebCore::Editor::setDictationPhrasesAsChildOfElement): Ditto.
796         (WebCore::Editor::confirmMarkedText): Ditto.
797         (WebCore::Editor::setTextAsChildOfElement): Ditto.
798         (WebCore::Editor::ensureLastEditCommandHasCurrentSelectionIfOpenForMoreTyping): Ditto.
799
800         * editing/ios/EditorIOS.mm:
801         (WebCore::Editor::fontForSelection): Remove ASSERT_NO_EXCEPTION.
802         (WebCore::Editor::fontAttributesForSelectionStart): Ditto.
803         (WebCore::Editor::insertDictationPhrases): Moved here from Editor.cpp.
804         (WebCore::Editor::setDictationPhrasesAsChildOfElement): Ditto. Also
805         updated code that used remove to not pass an ExceptionCode.
806         (WebCore::Editor::confirmMarkedText): Ditto.
807         (WebCore::Editor::setTextAsChildOfElement): Ditto.
808         (WebCore::Editor::ensureLastEditCommandHasCurrentSelectionIfOpenForMoreTyping): Ditto.
809
810         * editing/mac/EditorMac.mm:
811         (WebCore::Editor::fontForSelection): Remove ASSERT_NO_EXCEPTION.
812         (WebCore::Editor::fontAttributesForSelectionStart): Ditto.
813
814         * editing/markup.cpp:
815         (WebCore::createFragmentForInnerOuterHTML): Use ExceptionOr.
816         (WebCore::createContextualFragment): Ditto.
817         (WebCore::replaceChildrenWithFragment): Ditto.
818         (WebCore::replaceChildrenWithText): Ditto.
819         * editing/markup.h: Updated for above changes.
820
821         * html/BaseChooserOnlyDateAndTimeInputType.cpp:
822         (WebCore::BaseChooserOnlyDateAndTimeInputType::updateAppearance):
823         Removed ASSERT_NO_EXCEPTION.
824
825         * html/BaseDateAndTimeInputType.cpp:
826         (WebCore::BaseDateAndTimeInputType::setValueAsDate): Use ExceptionOr.
827         (WebCore::BaseDateAndTimeInputType::setValueAsDecimal): Ditto.
828         * html/BaseDateAndTimeInputType.h: Updated for above changes.
829
830         * html/DateTimeLocalInputType.cpp:
831         (WebCore::DateTimeLocalInputType::setValueAsDate): Use ExceptionOr.
832         * html/DateTimeLocalInputType.h: Updated for above changes.
833
834         * html/DOMTokenList.cpp:
835         (WebCore::DOMTokenList::validateToken): Use ExceptionOr.
836         (WebCore::DOMTokenList::validateTokens): Ditto.
837         (WebCore::DOMTokenList::addInternal): Ditto.
838         (WebCore::DOMTokenList::add): Ditto.
839         (WebCore::DOMTokenList::removeInternal): Ditto.
840         (WebCore::DOMTokenList::remove): Ditto.
841         (WebCore::DOMTokenList::toggle): Ditto.
842         (WebCore::DOMTokenList::replace): Ditto.
843         (WebCore::DOMTokenList::supports): Ditto.
844         * html/DOMTokenList.h: Updated for above changes.
845         * html/DOMTokenList.idl: Use non-legacy exceptions.
846
847         * html/DOMURL.cpp:
848         (WebCore::DOMURL::DOMURL): Just take the two URL objects and let
849         the create functions do all the processing.
850         (WebCore::DOMURL::create): Use ExceptionOr, and move the processing
851         of the URLs here out of the constructors.
852         (WebCore::DOMURL::setHref): Use ExceptionOr.
853         * html/DOMURL.h: Updated for above changes.
854         * html/DOMURL.idl: Use non-legacy exceptions.
855
856         * html/FTPDirectoryDocument.cpp:
857         (WebCore::FTPDirectoryDocumentParser::appendEntry): Remove
858         IGNORE_EXCEPTION and use releaseReturnValue().
859
860         * html/HTMLCanvasElement.cpp:
861         (WebCore::HTMLCanvasElement::toDataURL): Use ExceptionOr.
862         * html/HTMLCanvasElement.h: Updated for above changes.
863         * html/HTMLCanvasElement.idl: Use non-legacy exception.
864
865         * html/HTMLElement.cpp:
866         (WebCore::HTMLElement::textToFragment): Use ExceptionOr.
867         (WebCore::HTMLElement::setInnerText): Ditto.
868         (WebCore::HTMLElement::setOuterText): Ditto.
869         (WebCore::HTMLElement::setContentEditable): Ditto.
870         (WebCore::HTMLElement::translateAttributeMode): Deleted.
871         (WebCore::HTMLElement::translate): Moved the logic from the
872         translateAttributeMode function in here.
873         * html/HTMLElement.h: Updated for above changes.
874         * html/HTMLElement.idl: Use non-legacy exceptions.
875
876         * html/HTMLEmbedElement.idl: Use non-legacy exception.
877         * html/HTMLFrameElement.idl: Ditto.
878
879         * html/HTMLFrameOwnerElement.cpp:
880         (WebCore::HTMLFrameOwnerElement::getSVGDocument): Use ExceptionOr.
881         * html/HTMLFrameOwnerElement.h: Updated for above.
882
883         * html/HTMLIFrameElement.idl: Use non-legacy exception.
884
885         * html/HTMLInputElement.cpp:
886         (WebCore::HTMLInputElement::stepUp): Use ExceptionOr.
887         (WebCore::HTMLInputElement::stepDown): Ditto.
888         (WebCore::HTMLInputElement::setValue): Ditto.
889         (WebCore::HTMLInputElement::setValueAsDate): Ditto.
890         (WebCore::HTMLInputElement::setValueAsNumber): Ditto.
891         (WebCore::HTMLInputElement::setSize): Ditto.
892         (WebCore::HTMLInputElement::maxLengthAttributeChanged): Use the
893         new internalSetMaxLength function; old code relied on a setMaxLength
894         that was different from the one exposed to bindings.
895         (WebCore::HTMLInputElement::minLengthAttributeChanged): Ditto.
896         (WebCore::HTMLInputElement::setRangeText): Use ExceptionOr.
897         * html/HTMLInputElement.h: Updated for above changes. Also use
898         data member initialization for InputElementClickState instead of
899         a constructor.
900         * html/HTMLInputElement.idl: Use non-legacy exception.
901
902         * html/HTMLMarqueeElement.cpp:
903         (WebCore::HTMLMarqueeElement::setLoop): Use ExceptionOr.
904         (WebCore::HTMLMarqueeElement::renderMarquee): Tweaked.
905         * html/HTMLMarqueeElement.h: Updated for above changes.
906         * html/HTMLMarqueeElement.idl: Ditto.
907
908         * html/HTMLMediaElement.cpp:
909         (WebCore::HTMLMediaElement::TrackGroup::TrackGroup):
910         Initialize most data members in class definition rather than
911         the constructor.
912         (WebCore::HTMLMediaElement::HTMLMediaElement): Ditto.
913         (WebCore::HTMLMediaElement::~HTMLMediaElement): Updated since
914         removeMediaElement now takes a reference.
915         (WebCore::HTMLMediaElement::updateActiveTextTrackCues): Use
916         a modern for loop to streamline code.
917         (WebCore::HTMLMediaElement::textTrackModeChanged): Updated since
918         track now returns a reference.
919         (WebCore::HTMLMediaElement::setCurrentTimeForBindings): Renamed
920         to prevent ambiguity with the other version that has slightly
921         different semantics and overloading and changed to use ExceptionOr.
922         (WebCore::HTMLMediaElement::playInternal): Updated to use reference.
923         (WebCore::HTMLMediaElement::setVolume): Use ExceptionOr.
924         (WebCore::HTMLMediaElement::mediaPlayerDidAddAudioTrack): Take a
925         reference instead of a PassRefPtr.
926         (WebCore::HTMLMediaElement::mediaPlayerDidAddTextTrack): Ditto.
927         (WebCore::HTMLMediaElement::mediaPlayerDidAddVideoTrack): Ditto.
928         (WebCore::HTMLMediaElement::mediaPlayerDidRemoveAudioTrack): Ditto.
929         (WebCore::HTMLMediaElement::mediaPlayerDidRemoveTextTrack): Ditto.
930         (WebCore::HTMLMediaElement::mediaPlayerDidRemoveVideoTrack): Ditto.
931         (WebCore::HTMLMediaElement::addTextTrack): Use ExceptionOr.
932         (WebCore::HTMLMediaElement::didAddTextTrack): Use a reference.
933         (WebCore::HTMLMediaElement::didRemoveTextTrack): Ditto.
934         (WebCore::HTMLMediaElement::maxBufferedTime): Update to use different
935         interface to time ranges that does not need to deal with exceptions.
936         (WebCore::HTMLMediaElement::setController): Pass references.
937         (WebCore::HTMLMediaElement::outOfBandTrackSources): Use reference.
938         * html/HTMLMediaElement.h: Updated for above.
939         * html/HTMLMediaElement.idl: Use non-legacy exceptions.
940
941         * html/HTMLObjectElement.idl: Use non-legacy exception.
942
943         * html/HTMLOptionElement.cpp:
944         (WebCore::HTMLOptionElement::createForJSConstructor): Use ExceptionOr.
945         * html/HTMLOptionElement.h: Updated for above change.
946         * html/HTMLOptionElement.idl: Use non-legacy exception.
947
948         * html/HTMLOptionsCollection.cpp:
949         (WebCore::HTMLOptionsCollection::setLength): Use ExceptionOr.
950         * html/HTMLOptionsCollection.h: Updated for above change.
951         * html/HTMLOptionsCollection.idl: Use non-legacy exception.
952
953         * html/HTMLProgressElement.cpp:
954         (WebCore::HTMLProgressElement::setValue): Removed non-finite handling
955         because that is now handled by the bindings.
956         (WebCore::HTMLProgressElement::setMax): Ditto.
957         * html/HTMLProgressElement.h: Updated for above.
958         * html/HTMLProgressElement.idl: Changed attributes to be double instead
959         of unrestricted double, and this was able to remove exceptions.
960
961         * html/HTMLSelectElement.cpp:
962         (WebCore::HTMLSelectElement::removeByIndex): Drop IGNORE_EXCEPTION.
963         (WebCore::HTMLSelectElement::remove): Use ExceptionOr.
964         (WebCore::HTMLSelectElement::setOption): Ditto.
965         (WebCore::HTMLSelectElement::setLength): Ditto.
966         * html/HTMLSelectElement.h: Updated for above changes.
967         * html/HTMLSelectElement.idl: Use non-legacy exceptions.
968
969         * html/HTMLTableElement.cpp:
970         (WebCore::HTMLTableElement::setCaption): Use ExceptionOr.
971         (WebCore::HTMLTableElement::setTHead): Ditto.
972         (WebCore::HTMLTableElement::setTFoot): Ditto.
973         (WebCore::HTMLTableElement::createTHead): Streamline a bit.
974         (WebCore::HTMLTableElement::deleteTHead): Ditto.
975         (WebCore::HTMLTableElement::createTFoot): Ditto.
976         (WebCore::HTMLTableElement::deleteTFoot): Ditto.
977         (WebCore::HTMLTableElement::createTBody): Ditto.
978         (WebCore::HTMLTableElement::createCaption): Ditto.
979         (WebCore::HTMLTableElement::insertRow): Use ExceptionOr.
980         (WebCore::HTMLTableElement::deleteRow): Ditto.
981         * html/HTMLTableElement.h: Updated for above changes.
982         * html/HTMLTableElement.idl: Use non-legacy exceptions.
983
984         * html/HTMLTableRowElement.cpp:
985         (WebCore::findTable): Added.
986         (WebCore::HTMLTableRowElement::rowIndex): Streamline a bit using the
987         findTable function above.
988         (WebCore::findRows): Added.
989         (WebCore::HTMLTableRowElement::sectionRowIndex): Streamline a bit using
990         the findRows function above.
991         (WebCore::HTMLTableRowElement::insertCell): Use ExceptionOr.
992         (WebCore::HTMLTableRowElement::deleteCell): Ditto.
993         (WebCore::HTMLTableRowElement::setCells): Deleted.
994         * html/HTMLTableRowElement.h: Updated for the above. The setCells function
995         was dead code.
996         * html/HTMLTableRowElement.idl: Use non-legacy exceptions.
997
998         * html/HTMLTableSectionElement.cpp:
999         (WebCore::HTMLTableSectionElement::additionalPresentationAttributeStyle):
1000         Tweaked a bit to use early return.
1001         (WebCore::HTMLTableSectionElement::insertRow): Use ExceptionOr.
1002         (WebCore::HTMLTableSectionElement::deleteRow): Ditto.
1003         (WebCore::HTMLTableSectionElement::numRows): Use childrenOfType.
1004         (WebCore::HTMLTableSectionElement::align): Deleted.
1005         (WebCore::HTMLTableSectionElement::setAlign): Deleted.
1006         (WebCore::HTMLTableSectionElement::ch): Deleted.
1007         (WebCore::HTMLTableSectionElement::setCh): Deleted.
1008         (WebCore::HTMLTableSectionElement::chOff): Deleted.
1009         (WebCore::HTMLTableSectionElement::setChOff): Deleted.
1010         (WebCore::HTMLTableSectionElement::vAlign): Deleted.
1011         (WebCore::HTMLTableSectionElement::setVAlign): Deleted.
1012         * html/HTMLTableSectionElement.h: Updated for the above.
1013         * html/HTMLTableSectionElement.idl: Use non-legacy exception.
1014
1015         * html/HTMLTextAreaElement.cpp:
1016         (WebCore::HTMLTextAreaElement::maxLengthAttributeChanged): Use the new
1017         internalSetMaxLength function; old code relied on a setMaxLength
1018         that was different from the one exposed to bindings.
1019         (WebCore::HTMLTextAreaElement::minLengthAttributeChanged): Ditto.
1020         (WebCore::HTMLTextAreaElement::updatePlaceholderText): Removed
1021         ASSERT_NO_EXCEPTION.
1022         * html/HTMLTextAreaElement.idl: Use non-legacy exceptions.
1023
1024         * html/HTMLTextFormControlElement.cpp:
1025         (WebCore::HTMLTextFormControlElement::setRangeText): Use ExceptionOr.
1026         (WebCore::HTMLTextFormControlElement::setInnerTextValue): Ditto.
1027         (WebCore::HTMLTextFormControlElement::setMaxLength): Ditto.
1028         (WebCore::HTMLTextFormControlElement::setMinLength): Ditto.
1029         * html/HTMLTextFormControlElement.h: Updated for above changes.
1030         Also renamed the setMin/MaxLength function overloads for internal use
1031         to internSetMin/MaxLength and made them protected.
1032
1033         * html/HTMLTrackElement.cpp:
1034         (WebCore::HTMLTrackElement::~HTMLTrackElement): Call clearElement on the
1035         track to break the connection. Before this was done as a side effect of
1036         clearClient, but that is called in other cases where we do not want to
1037         clear the link back to the track element.
1038         (WebCore::HTMLTrackElement::insertedInto): Removed code that uses the
1039         track function for its side effect of creating a track; no longer needed.
1040         Rewrote this so it's more symmetric with removedFrom.
1041         (WebCore::HTMLTrackElement::removedFrom): Pass reference. Also reordered
1042         and removed an unnecessary check for null parent.
1043         (WebCore::HTMLTrackElement::parseAttribute): Use track.
1044         (WebCore::HTMLTrackElement::kind): Ditto.
1045         (WebCore::HTMLTrackElement::track): Renamed ensureTrack to this. Also
1046         removed the redundant code to call setTrackElement; we no longer change
1047         the track element on a track until the track element is destroyed.
1048         (WebCore::HTMLTrackElement::scheduleLoad): Use track.
1049         (WebCore::HTMLTrackElement::loadTimerFired): Ditto.
1050         (WebCore::HTMLTrackElement::setReadyState): Ditto.
1051         (WebCore::HTMLTrackElement::readyState): Ditto.
1052         (WebCore::HTMLTrackElement::mediaElement): Rearranged to use early return.
1053         * html/HTMLTrackElement.h: Updated for above changes.
1054
1055         * html/HTMLVideoElement.cpp:
1056         (WebCore::HTMLVideoElement::webkitEnterFullscreen): Use ExceptionOr.
1057         * html/HTMLVideoElement.h: Removed the functions used just for
1058         capitalization reasons; that's now handled in the bindings.
1059         * html/HTMLVideoElement.idl: Use non-legacy bindings and ImplementedAs.
1060
1061         * html/ImageData.cpp:
1062         (WebCore::ImageData::create): Return ExceptionOr.
1063         * html/ImageData.h: Updated for above changes.
1064         * html/ImageData.idl: Use non-legacy exceptions.
1065
1066         * html/InputType.cpp:
1067         (WebCore::InputType::setValueAsDate): Use ExceptionOr.
1068         (WebCore::InputType::setValueAsDouble): Ditto.
1069         (WebCore::InputType::setValueAsDecimal): Ditto.
1070         (WebCore::InputType::applyStep): Ditto.
1071         (WebCore::InputType::stepUp): Ditto.
1072         (WebCore::InputType::stepUpFromRenderer): Removed IGNORE_EXCEPTION.
1073         * html/InputType.h: Updated for the above.
1074
1075         * html/MediaController.cpp:
1076         (MediaController::addMediaElement): Take a reference instead of a pointer.
1077         (MediaController::removeMediaElement): Ditto.
1078         (MediaController::containsMediaElement): Ditto.
1079         (MediaController::setVolume): Use ExceptionOr.
1080         (MediaController::bringElementUpToSpeed): Take a reference.
1081         * html/MediaController.h: Updated for above changes. Also made lots of
1082         function overrides private.
1083         * html/MediaController.idl: Use non-legacy exception.
1084
1085         * html/MediaControllerInterface.h: Use ExceptionOr for setVolume.
1086
1087         * html/NumberInputType.cpp:
1088         (WebCore::RealNumberRenderSize::max): Use aggregate initialization instead
1089         of a constructor.
1090         (WebCore::calculateRenderSize): Ditto.
1091         (WebCore::NumberInputType::setValueAsDouble): Use ExceptionOr.
1092         (WebCore::NumberInputType::setValueAsDecimal): Ditto.
1093         * html/NumberInputType.h: Updated for above changes.
1094
1095         * html/RangeInputType.cpp:
1096         (WebCore::RangeInputType::RangeInputType): Initialize scalar data member
1097         in class definition instead of here.
1098         (WebCore::RangeInputType::setValueAsDecimal): Use ExceptionOr.
1099         (WebCore::RangeInputType::handleKeydownEvent): Removed IGNORE_EXCEPTION.
1100         * html/RangeInputType.h: Updated for above changes.
1101
1102         * html/TextFieldInputType.cpp:
1103         (WebCore::TextFieldInputType::updatePlaceholderText): Removed
1104         ASSERT_NO_EXCEPTION.
1105
1106         * html/TimeRanges.cpp:
1107         (WebCore::TimeRanges::start): Use ExceptionOr.
1108         (WebCore::TimeRanges::end): Ditto.
1109         * html/TimeRanges.h: Updated for the above.
1110         * html/TimeRanges.idl: Use non-legacy exceptions.
1111
1112         * html/URLUtils.idl: Use non-legacy exception.
1113
1114         * html/ValidationMessage.cpp:
1115         (WebCore::ValidationMessage::setMessageDOMAndStartTimer): Removed
1116         ASSERT_NO_EXCEPTION, IGNORE_EXCEPTION, and other exception-ignoring idioms.
1117         * html/parser/HTMLTreeBuilder.cpp:
1118         (WebCore::HTMLTreeBuilder::processStartTagForInBody): Ditto.
1119         * html/shadow/MediaControlElementTypes.cpp:
1120         (WebCore::MediaControlVolumeSliderElement::defaultEventHandler): Ditto.
1121         * html/shadow/MediaControlElements.cpp:
1122         (WebCore::MediaControlPanelElement::setPosition): Ditto.
1123         (WebCore::MediaControlPanelElement::resetPosition): Ditto.
1124         (WebCore::MediaControlStatusDisplayElement::update): Ditto.
1125         (WebCore::MediaControlClosedCaptionsTrackListElement::updateDisplay): Ditto.
1126         (WebCore::MediaControlFullscreenVolumeMinButtonElement::defaultEventHandler): Ditto.
1127         (WebCore::MediaControlFullscreenVolumeMaxButtonElement::defaultEventHandler): Ditto.
1128         * html/shadow/MediaControls.cpp:
1129         (WebCore::MediaControls::updateCurrentTimeDisplay): Ditto.
1130         * html/shadow/MediaControlsApple.cpp:
1131         (WebCore::MediaControlsApple::updateCurrentTimeDisplay): Ditto.
1132
1133
1134         * html/track/LoadableTextTrack.cpp:
1135         (WebCore::LoadableTextTrack::LoadableTextTrack): Take reference.
1136         (WebCore::LoadableTextTrack::~LoadableTextTrack): Deleted.
1137         (WebCore::LoadableTextTrack::clearClient): Deleted override. We no longer
1138         want to clear m_trackElement when clearing the client.
1139         (WebCore::LoadableTextTrack::setTrackElement): Deleted.
1140         (WebCore::LoadableTextTrack::id): Changed to use
1141         attributeWithoutSynchronization for better performance and idAttr instead
1142         of a string constant.
1143         * html/track/LoadableTextTrack.h: Updated for above changes. Added a new
1144         clearElement function. Made the element and isDefault functions private.
1145
1146         * html/track/VTTCue.cpp:
1147         (WebCore::VTTCue::~VTTCue): Removed ASSERT_NO_EXCEPTION, IGNORE_EXCEPTION,
1148         and other exception-ignoring idioms.
1149         (WebCore::VTTCue::removeDisplayTree): Ditto.
1150         * html/track/VTTRegion.cpp:
1151         (WebCore::VTTRegion::displayLastTextTrackCueBox): Ditto.
1152         (WebCore::VTTRegion::willRemoveTextTrackCueBox): Ditto.
1153
1154         * inspector/InspectorDOMAgent.cpp:
1155         (WebCore::InspectorDOMAgent::pushNodeByBackendIdToFrontend):
1156         Rewrote to avoid multiplehash table lookups and added a FIXME about
1157         the peculiar code here.
1158         (WebCore::InspectorDOMAgent::resolveNode): Streamlined.
1159         (WebCore::InspectorDOMAgent::nodeAsScriptValue): Use the new
1160         checkSecurityForNode instead of the old shouldAllowAccessToNode.
1161
1162         * platform/graphics/ImageBuffer.h: Take Optional<double> instead of
1163         const double* in toDataURL. Renamed ImageDataToDataURL to just dataURL.
1164
1165         * platform/graphics/MediaPlayer.cpp:
1166         (WebCore::MediaPlayer::addAudioTrack): Take a reference instead of PassRefPtr.
1167         (WebCore::MediaPlayer::removeAudioTrack): Ditto.
1168         (WebCore::MediaPlayer::addTextTrack): Ditto.
1169         (WebCore::MediaPlayer::removeTextTrack): Ditto.
1170         (WebCore::MediaPlayer::addVideoTrack): Ditto.
1171         (WebCore::MediaPlayer::removeVideoTrack): Ditto.
1172         * platform/graphics/MediaPlayer.h: Updated for the above.
1173
1174         * platform/graphics/PlatformTimeRanges.h: Exported a couple of functions
1175         that are now used in WebKit.
1176
1177         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
1178         (WebCore::MediaPlayerPrivateAVFoundation::clearTextTracks): Use a modern for loop.
1179         (WebCore::MediaPlayerPrivateAVFoundation::processNewAndRemovedTextTracks):
1180         Fixed a bug that would cause this function to fail to process half the tracks.
1181         Also updated for the change from PassRefPtr to references.
1182
1183         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1184         (WebCore::determineChangedTracksFromNewTracksAndOldItems): Pass references.
1185         (WebCore::MediaPlayerPrivateAVFoundationObjC::audioSourceProvider): Ditto.
1186         (WebCore::MediaPlayerPrivateAVFoundationObjC::processMetadataTrack): Ditto.
1187         (WebCore::assetMetadataKeyNames): Tweaked formatting.
1188         (WebCore::itemKVOProperties): Ditto.
1189         (WebCore::playerKVOProperties): Ditto.
1190
1191         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
1192         (WebCore::updateTracksOfType): Pass references.
1193
1194         * platform/graphics/cairo/ImageBufferCairo.cpp:
1195         (WebCore::ImageBuffer::toDataURL): Use Optional<double>
1196
1197         * platform/graphics/cg/ImageBufferCG.cpp:
1198         (WebCore::createBitmapImageAfterScalingIfNeeded): Use auto.
1199         (WebCore::encodeImage): Ditto. Also renamed from CGImageEncodeToData.
1200         (WebCore::dataURL): Ditto. Also renamed from CGImageToDataURL and from
1201         ImageDataToDataURL.
1202         (WebCore::ImageBuffer::toDataURL): Ditto.
1203
1204         * platform/graphics/efl/ImageBufferEfl.cpp:
1205         (WebCore::encodeImageJPEG): Use Optional<double>
1206         (WebCore::ImageBuffer::toDataURL): Ditto.
1207
1208         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1209         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideo): Pass
1210         a reference instead of pointer.
1211         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfAudio): Ditto.
1212         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfText): Ditto.
1213         (WebCore::MediaPlayerPrivateGStreamer::processMpegTsSection): Ditto.
1214         (WebCore::MediaPlayerPrivateGStreamer::processTableOfContents): Ditto.
1215
1216         * platform/graphics/gtk/ImageBufferGtk.cpp:
1217         (WebCore::encodeImage): Use Optional<double>
1218         (WebCore::ImageBuffer::toDataURL): Ditto.
1219
1220         * platform/graphics/win/ImageBufferDirect2D.cpp:
1221         (WebCore::ImageBuffer::toDataURL): Use Optional<double>
1222
1223         * platform/image-encoders/JPEGImageEncoder.cpp:
1224         (WebCore::compressRGBABigEndianToJPEG): Use Optional<double>
1225         * platform/image-encoders/JPEGImageEncoder.h: Ditto.
1226
1227         * platform/ios/WebPlaybackSessionInterfaceAVKit.mm:
1228         (WebCore::WebPlaybackSessionInterfaceAVKit::seekableRangesChanged):
1229         Updated for change to TimeRanges.
1230
1231         * platform/mac/WebVideoFullscreenHUDWindowController.mm:
1232         (-[WebVideoFullscreenHUDWindowController setVolume:]): Removed IGNORE_EXCEPTION.
1233         * xml/parser/XMLDocumentParserLibxml2.cpp:
1234         (WebCore::XMLDocumentParser::endElementNs): Ditto.
1235
1236         * rendering/RenderThemeGtk.cpp:
1237         (WebCore::RenderThemeGtk::paintMediaSliderTrack): Updated for changes to
1238         the TimeRanges class.
1239
1240 2016-10-28  Dave Hyatt  <hyatt@apple.com>
1241
1242         [CSS Parser] Allow @font-face src descriptor's format function to contain identifiers
1243         https://bugs.webkit.org/show_bug.cgi?id=164169
1244
1245         Reviewed by Simon Fraser.
1246
1247         * css/parser/CSSPropertyParser.cpp:
1248         (WebCore::consumeFontFaceSrcURI):
1249
1250 2016-10-28  Jer Noble  <jer.noble@apple.com>
1251
1252         WebAudio does not resume when moving from background to foreground tab.
1253         https://bugs.webkit.org/show_bug.cgi?id=164043
1254
1255         Reviewed by Darin Adler.
1256
1257         Test: webaudio/page-canstartmedia.html
1258
1259         * Modules/webaudio/AudioContext.cpp:
1260         (WebCore::AudioContext::mediaCanStart):
1261
1262 2016-10-28  Wenson Hsieh  <wenson_hsieh@apple.com>
1263
1264         iOS autocorrection does not trigger an input event of inputType "insertReplacementText"
1265         https://bugs.webkit.org/show_bug.cgi?id=164077
1266         <rdar://problem/28987810>
1267
1268         Reviewed by Simon Fraser.
1269
1270         Fixes candidate insertion on iOS, so that it fires input events of type "insertReplacementText" and adds two
1271         iOS unit tests covering this change as well as the test infrastructure needed to support these tests. See
1272         comments below for more details.
1273
1274         Tests: fast/events/ios/before-input-events-prevent-candidate-insertion.html
1275                fast/events/ios/input-events-insert-replacement-text.html
1276
1277         * dom/TextEvent.h:
1278
1279         Adds isAutocompletion() to TextEvent, as well as the TextEventInputAutocompletion text input type. When the
1280         Editor handles this TextEvent, it will use this information when creating or modifying the corresponding typing
1281         command.
1282
1283         * dom/TextEventInputType.h:
1284         * editing/Editor.cpp:
1285         (WebCore::Editor::insertText):
1286         (WebCore::Editor::insertTextWithoutSendingTextEvent):
1287         * editing/Editor.h:
1288         * editing/TypingCommand.cpp:
1289         (WebCore::editActionForTypingCommand):
1290
1291         Now takes whether the command is autocorrection into account. If so, the corresponding edit action should be
1292         EditActionInsertReplacement rather than EditActionTypingInsertText.
1293
1294         (WebCore::TypingCommand::TypingCommand):
1295         (WebCore::TypingCommand::deleteSelection):
1296         (WebCore::TypingCommand::deleteKeyPressed):
1297         (WebCore::TypingCommand::forwardDeleteKeyPressed):
1298         (WebCore::TypingCommand::insertText):
1299         (WebCore::TypingCommand::insertLineBreak):
1300         (WebCore::TypingCommand::insertParagraphSeparatorInQuotedContent):
1301         (WebCore::TypingCommand::insertParagraphSeparator):
1302         (WebCore::TypingCommand::inputEventData):
1303         (WebCore::TypingCommand::willAddTypingToOpenCommand):
1304         * editing/TypingCommand.h:
1305
1306         Adds a new TypingCommand option, IsAutocompletion.
1307
1308 2016-10-28  Commit Queue  <commit-queue@webkit.org>
1309
1310         Unreviewed, rolling out r207700.
1311         https://bugs.webkit.org/show_bug.cgi?id=164168
1312
1313         We are ready after r208086 (Requested by alexchristensen on
1314         #webkit).
1315
1316         Reverted changeset:
1317
1318         "Unreviewed, rolling out r207582."
1319         https://bugs.webkit.org/show_bug.cgi?id=163819
1320         http://trac.webkit.org/changeset/207700
1321
1322 2016-10-28  Dave Hyatt  <hyatt@apple.com>
1323
1324         [CSS Parser] Allow unknown properties in will-change
1325         https://bugs.webkit.org/show_bug.cgi?id=164165
1326
1327         Reviewed by Simon Fraser.
1328
1329         * css/parser/CSSPropertyParser.cpp:
1330         (WebCore::consumeWillChange):
1331
1332 2016-10-28  Alex Christensen  <achristensen@webkit.org>
1333
1334         Partially revert 207805 after resolution in URL spec issue 87
1335         https://bugs.webkit.org/show_bug.cgi?id=164142
1336
1337         Reviewed by Andy Estes.
1338
1339         Covered by updated layout tests and API tests.
1340
1341         * platform/URLParser.cpp:
1342         (WebCore::URLParser::isSingleDotPathSegment):
1343         (WebCore::URLParser::isDoubleDotPathSegment):
1344         (WebCore::URLParser::consumeSingleDotPathSegment):
1345         (WebCore::URLParser::consumeDoubleDotPathSegment):
1346         Treat %2e%2e as .. and %2e as . but only if it is entirety of the path segment.
1347         There are tests for URLs like http://host/abc%2edef which have not changed because
1348         the %2e is not the entirety of the path segment.
1349
1350 2016-10-28  Alex Christensen  <achristensen@webkit.org>
1351
1352         URLParser should not try to interpret host of URLs with unrecognized schemes as IPv4 address
1353         https://bugs.webkit.org/show_bug.cgi?id=164154
1354
1355         Reviewed by Andy Estes.
1356
1357         This is needed to match behavior of all browsers.
1358         This is being discussed in the spec at https://github.com/whatwg/url/issues/148
1359
1360         Covered by new API tests.
1361
1362         * platform/URLParser.cpp:
1363         (WebCore::URLParser::parseHostAndPort):
1364         Only try to parse and canonicalize the host as an IPv4 address if the scheme is special (http, wss, etc.)
1365
1366 2016-10-28  Chris Dumez  <cdumez@apple.com>
1367
1368         DOMStringMap reports properties as non-enumerable
1369         https://bugs.webkit.org/show_bug.cgi?id=164114
1370
1371         Reviewed by Sam Weinig.
1372
1373         DOMStringMap's named properties should be configurable, enumerable
1374         and writable as per:
1375         - https://heycam.github.io/webidl/#getownproperty-guts (2.7-9)
1376         - https://html.spec.whatwg.org/multipage/dom.html#domstringmap
1377
1378         Firefox and Chrome agree with the specification. However, WebKit
1379         was doing the complete opposite.
1380
1381         No new tests, updated existing test.
1382
1383         * bindings/js/JSDOMStringMapCustom.cpp:
1384         (WebCore::JSDOMStringMap::getOwnPropertySlotDelegate):
1385
1386 2016-10-28  Ryosuke Niwa  <rniwa@webkit.org>
1387
1388         Add CEReactions to the remaining HTML DOM APIs
1389         https://bugs.webkit.org/show_bug.cgi?id=163969
1390
1391         Reviewed by Chris Dumez.
1392
1393         Added CEReactions to the remaining DOM and HTML APIs as needed.
1394
1395         Tests: fast/custom-elements/reactions-for-indieui.html
1396                fast/custom-elements/reactions/Document.html
1397                fast/custom-elements/reactions/HTMLAnchorElement.html
1398                fast/custom-elements/reactions/HTMLOptionElement.html
1399                fast/custom-elements/reactions/HTMLOptionsCollection.html
1400                fast/custom-elements/reactions/HTMLOutputElement.html
1401                fast/custom-elements/reactions/HTMLSelectElement.html
1402                fast/custom-elements/reactions/HTMLTableElement.html
1403                fast/custom-elements/reactions/HTMLTableRowElement.html
1404                fast/custom-elements/reactions/HTMLTableSectionElement.html
1405                fast/custom-elements/reactions/HTMLTitleElement.html
1406                fast/custom-elements/reactions/ShadowRoot.html
1407
1408         * bindings/js/JSHTMLOptionsCollectionCustom.cpp:
1409         (WebCore::JSHTMLOptionsCollection::setLength):
1410         (WebCore::JSHTMLOptionsCollection::indexSetter):
1411         * bindings/js/JSHTMLSelectElementCustom.cpp:
1412         (WebCore::JSHTMLSelectElement::indexSetter):
1413         * dom/CharacterData.idl:
1414         * dom/Document.idl:
1415         * dom/Element.idl:
1416         * dom/ShadowRoot.idl:
1417         * html/HTMLAnchorElement.idl:
1418         * html/HTMLDocument.idl:
1419         * html/HTMLOptionElement.idl:
1420         * html/HTMLOptionsCollection.idl:
1421         * html/HTMLOutputElement.idl:
1422         * html/HTMLSelectElement.idl:
1423         * html/HTMLTableElement.idl:
1424         * html/HTMLTableRowElement.idl:
1425         * html/HTMLTableSectionElement.idl:
1426         * html/HTMLTitleElement.idl:
1427
1428 2016-10-28  Antoine Quint  <graouts@apple.com>
1429
1430         [Modern Media Controls] Media Controller: volume control support
1431         https://bugs.webkit.org/show_bug.cgi?id=163727
1432
1433         Reviewed by Dean Jackson.
1434
1435         We introduce the VolumeSupport class which brings support for modifying the media
1436         volume by interacting with the mute volume slider in the media controls and correctly
1437         reflecting the media's volume should it be changed via the media API.
1438
1439         Tests: media/modern-media-controls/volume-support/volume-support-click.html
1440                media/modern-media-controls/volume-support/volume-support-drag.html
1441                media/modern-media-controls/volume-support/volume-support-media-api-mute.html
1442                media/modern-media-controls/volume-support/volume-support-media-api.html
1443
1444         * Modules/modern-media-controls/js-files:
1445         * Modules/modern-media-controls/media/media-controller.js:
1446         (MediaController):
1447         * Modules/modern-media-controls/media/volume-support.js: Added.
1448         (VolumeSupport.prototype.get control):
1449         (VolumeSupport.prototype.get mediaEvents):
1450         (VolumeSupport.prototype.controlValueWillStartChanging):
1451         (VolumeSupport.prototype.controlValueDidChange):
1452         (VolumeSupport.prototype.syncControl):
1453         (VolumeSupport):
1454         * WebCore.xcodeproj/project.pbxproj:
1455
1456 2016-10-28  Yusuke Suzuki  <utatane.tea@gmail.com>
1457
1458         [DOMJIT] Rename CallDOM to CallDOMGetter
1459         https://bugs.webkit.org/show_bug.cgi?id=164157
1460
1461         Reviewed by Keith Miller.
1462
1463         No behavior change.
1464
1465         * bindings/scripts/CodeGeneratorJS.pm:
1466         (GenerateHeader):
1467         * bindings/scripts/test/JS/JSTestDOMJIT.h:
1468         * domjit/JSDocumentDOMJIT.cpp:
1469         (WebCore::DocumentDocumentElementDOMJIT::callDOMGetter):
1470         (WebCore::DocumentDocumentElementDOMJIT::callDOM): Deleted.
1471         * domjit/JSNodeDOMJIT.cpp:
1472         (WebCore::createCallDOMGetterForOffsetAccess):
1473         (WebCore::NodeFirstChildDOMJIT::callDOMGetter):
1474         (WebCore::NodeLastChildDOMJIT::callDOMGetter):
1475         (WebCore::NodeNextSiblingDOMJIT::callDOMGetter):
1476         (WebCore::NodePreviousSiblingDOMJIT::callDOMGetter):
1477         (WebCore::NodeParentNodeDOMJIT::callDOMGetter):
1478         (WebCore::NodeNodeTypeDOMJIT::callDOMGetter):
1479         (WebCore::NodeOwnerDocumentDOMJIT::callDOMGetter):
1480         (WebCore::createCallDOMForOffsetAccess): Deleted.
1481         (WebCore::NodeFirstChildDOMJIT::callDOM): Deleted.
1482         (WebCore::NodeLastChildDOMJIT::callDOM): Deleted.
1483         (WebCore::NodeNextSiblingDOMJIT::callDOM): Deleted.
1484         (WebCore::NodePreviousSiblingDOMJIT::callDOM): Deleted.
1485         (WebCore::NodeParentNodeDOMJIT::callDOM): Deleted.
1486         (WebCore::NodeNodeTypeDOMJIT::callDOM): Deleted.
1487         (WebCore::NodeOwnerDocumentDOMJIT::callDOM): Deleted.
1488
1489 2016-10-28  Dave Hyatt  <hyatt@apple.com>
1490
1491         [CSS Parser] Fix font-family parsing inside @font-face
1492         https://bugs.webkit.org/show_bug.cgi?id=164155
1493
1494         Reviewed by Simon Fraser.
1495
1496         * css/parser/CSSPropertyParser.cpp:
1497         (WebCore::CSSPropertyParser::parseFontFaceDescriptor):
1498         Use the full font-family parsing that returns a CSSValueList,
1499         since we can handle multiple families.
1500
1501 2016-10-28  Per Arne Vollan  <pvollan@apple.com>
1502
1503         [Win][Direct2D] Implement ImageBufferData::putData.
1504         https://bugs.webkit.org/show_bug.cgi?id=164151
1505
1506         Reviewed by Brent Fulgham.
1507
1508         * platform/graphics/win/ImageBufferDataDirect2D.cpp:
1509         (WebCore::ImageBufferData::getData):
1510         (WebCore::ImageBufferData::putData):
1511
1512 2016-10-28  Dave Hyatt  <hyatt@apple.com>
1513
1514         [CSS Parser] Support hanging-punctuation
1515         https://bugs.webkit.org/show_bug.cgi?id=164153
1516
1517         Reviewed by Simon Fraser.
1518
1519         * css/parser/CSSPropertyParser.cpp:
1520         (WebCore::consumeHangingPunctuation):
1521         (WebCore::CSSPropertyParser::parseSingleValue):
1522
1523 2016-10-28  Yusuke Suzuki  <utatane.tea@gmail.com>
1524
1525         [DOMJIT] Implement Document::documentElement
1526         https://bugs.webkit.org/show_bug.cgi?id=164113
1527
1528         Reviewed by Sam Weinig.
1529
1530         Test: js/dom/domjit-accessor-document-element.html
1531
1532         This patch implements document.documentElement DOMJIT accessor.
1533         Similar to ownerDocument accessor, the way to access to document.documentElement
1534         from JIT code is already prepared for CSSJIT. DOMJIT just utilizes the existing
1535         functionality: using documentElementMemoryOffset().
1536
1537         document.documentElement is frequently called in jQuery. Especially, every time
1538         we call jQuery.attr(), this is called.
1539
1540         To implement Document accessor, we clean up some code in DOMJITHelpers.
1541         We create the cpp file for DOMJITHelpers and move some helpers to it.
1542         And we also implement DOMJIT::checkDOM<DOMInterface> for convenience.
1543         It returns appropriate CheckDOM patchpoint implementation.
1544
1545         This patch improves Dromaeo jslib-attr-jquery.html 10% (481.64 v.s. 532.54).
1546
1547         * CMakeLists.txt:
1548         * WebCore.xcodeproj/project.pbxproj:
1549         * cssjit/SelectorCompiler.cpp:
1550         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsScopeRoot):
1551         * dom/Document.idl:
1552         * domjit/DOMJITAbstractHeapRepository.h:
1553         * domjit/DOMJITCheckDOM.h: Copied from Source/WebCore/domjit/DOMJITAbstractHeapRepository.h.
1554         (WebCore::DOMJIT::TypeChecker<Node>::branchIfFail):
1555         (WebCore::DOMJIT::TypeChecker<Document>::branchIfFail):
1556         (WebCore::DOMJIT::TypeChecker<Event>::branchIfFail):
1557         (WebCore::DOMJIT::TypeChecker<Element>::branchIfFail):
1558         (WebCore::DOMJIT::checkDOM):
1559         * domjit/DOMJITHelpers.cpp: Copied from Source/WebCore/domjit/DOMJITAbstractHeapRepository.h.
1560         (WebCore::DOMJIT::loadDocument):
1561         (WebCore::DOMJIT::loadDocumentElement):
1562         * domjit/DOMJITHelpers.h:
1563         (WebCore::DOMJIT::toWrapperSlow):
1564         (WebCore::DOMJIT::loadDocument): Deleted.
1565         * domjit/JSDocumentDOMJIT.cpp: Added.
1566         (WebCore::DocumentDocumentElementDOMJIT::checkDOM):
1567         (WebCore::DocumentDocumentElementDOMJIT::callDOM):
1568         * domjit/JSNodeDOMJIT.cpp:
1569         (WebCore::createCallDOMForOffsetAccess):
1570         (WebCore::NodeFirstChildDOMJIT::checkDOM):
1571         (WebCore::NodeLastChildDOMJIT::checkDOM):
1572         (WebCore::NodeNextSiblingDOMJIT::checkDOM):
1573         (WebCore::NodePreviousSiblingDOMJIT::checkDOM):
1574         (WebCore::NodeParentNodeDOMJIT::checkDOM):
1575         (WebCore::NodeNodeTypeDOMJIT::checkDOM):
1576         (WebCore::NodeOwnerDocumentDOMJIT::checkDOM):
1577         (WebCore::NodeOwnerDocumentDOMJIT::callDOM):
1578         (WebCore::toWrapperSlow): Deleted.
1579         (WebCore::checkNode): Deleted.
1580
1581 2016-10-28  Dave Hyatt  <hyatt@apple.com>
1582
1583         [CSS Parser] Support initial-letter
1584         https://bugs.webkit.org/show_bug.cgi?id=164150
1585
1586         Reviewed by Simon Fraser.
1587
1588         * css/parser/CSSPropertyParser.cpp:
1589         (WebCore::consumeInitialLetter):
1590         (WebCore::CSSPropertyParser::parseSingleValue):
1591
1592 2016-10-28  Simon Fraser  <simon.fraser@apple.com>
1593
1594         Remove some unused code in RenderLayerCompositor::computeExtent()
1595         https://bugs.webkit.org/show_bug.cgi?id=163934
1596
1597         Reviewed by Zalan Bujtas.
1598
1599         viewportRect was never used.
1600
1601         * rendering/RenderLayerCompositor.cpp:
1602         (WebCore::RenderLayerCompositor::computeExtent):
1603
1604 2016-10-28  Sam Weinig  <sam@webkit.org>
1605
1606         [WebIDL] Update parser and code generators to only access type information through the type property
1607         https://bugs.webkit.org/show_bug.cgi?id=164141
1608
1609         Reviewed by Anders Carlsson.
1610
1611         Update IDLParser structs:
1612         - domSignature: Rename idlType to type. Specify that type is a domType.
1613         - domInterface: Remove name and parent. Specify that type and parentType are a domTypes.
1614         - domFunction: Specify that signature is a domSignature.
1615         - domAttribute: Remove unused type. Specify that signature is a domSignature.
1616         - domIterable: Remove idlKeyType and valueKeyType. Specify that keyType and valueType are a domTypes
1617         - domConstant: Specify that type is a domType.
1618         - domEnum: Specify that type is a domType.
1619         - domDictionary: Remove name and parent. Specify that type and parentType are a domTypes.
1620         - Typedef: Rename idlType to type and specify that it is a domType.
1621
1622         * bindings/scripts/IDLParser.pm:
1623         Remove redundant properties and specify type info in structs where possible.
1624
1625         * bindings/scripts/CodeGenerator.pm:
1626         (IsSVGTypeNeedingTearOffForType): Renamed to remove ForType suffix.
1627         (IsSVGTypeWithWritablePropertiesNeedingTearOffForType): Renamed to remove ForType suffix.
1628         (GetSVGTypeNeedingTearOffForType): Renamed to remove ForType suffix.
1629         (GetSVGWrappedTypeNeedingTearOffForType): Renamed to remove ForType suffix.
1630
1631         Update to always access type information through type accessors. Remove use of removed
1632         properties.
1633
1634         * bindings/scripts/CodeGeneratorJS.pm:
1635         (IsNullableType): Deleted.
1636         (StripNullable): Deleted.
1637         Remove unused functions.
1638
1639         Update to always access type information through type accessors. Remove use of removed
1640         properties.
1641
1642         * bindings/scripts/generate-bindings.pl:
1643         Update to always access type information through type accessors. Remove use of removed
1644         properties.
1645
1646 2016-10-28  Dave Hyatt  <hyatt@apple.com>
1647
1648         [CSS Parser] Support bopomofo Ruby
1649         https://bugs.webkit.org/show_bug.cgi?id=164148
1650
1651         Reviewed by Simon Fraser.
1652
1653         * css/parser/CSSParserFastPaths.cpp:
1654         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
1655
1656 2016-10-28  Dave Hyatt  <hyatt@apple.com>
1657
1658         [CSS Parser] Add support for -webkit-canvas images
1659         https://bugs.webkit.org/show_bug.cgi?id=164144
1660
1661         Reviewed by Simon Fraser.
1662
1663         * css/CSSValueKeywords.in:
1664         * css/parser/CSSParser.cpp:
1665         (WebCore::CSSParserContext::CSSParserContext):
1666         * css/parser/CSSPropertyParserHelpers.cpp:
1667         (WebCore::CSSPropertyParserHelpers::consumeWebkitCanvas):
1668         (WebCore::CSSPropertyParserHelpers::consumeGeneratedImage):
1669         (WebCore::CSSPropertyParserHelpers::isGeneratedImage):
1670
1671 2016-10-27  Geoffrey Garen  <ggaren@apple.com>
1672
1673         One file per class for Executable.h/.cpp
1674         https://bugs.webkit.org/show_bug.cgi?id=164099
1675
1676         Reviewed by Saam Barati.
1677
1678         * ForwardingHeaders/runtime/Executable.h: Removed.
1679         * ForwardingHeaders/runtime/FunctionExecutable.h: Copied from Source/WebCore/ForwardingHeaders/runtime/Executable.h.
1680         * bindings/js/JSLazyEventListener.cpp:
1681         * bindings/js/JSMainThreadExecStateInstrumentation.h:
1682
1683 2016-10-28  Dave Hyatt  <hyatt@apple.com>
1684
1685         [CSS Parser] Clean up gradient parsing
1686         https://bugs.webkit.org/show_bug.cgi?id=164139
1687
1688         Reviewed by Dean Jackson.
1689
1690         * css/CSSGradientValue.cpp:
1691         (WebCore::positionFromValue):
1692         (WebCore::CSSGradientValue::computeEndPoint):
1693         * css/parser/CSSPropertyParserHelpers.cpp:
1694         (WebCore::CSSPropertyParserHelpers::consumeDeprecatedGradient):
1695         (WebCore::CSSPropertyParserHelpers::consumeGradientColorStops):
1696         (WebCore::CSSPropertyParserHelpers::consumeDeprecatedRadialGradient):
1697         (WebCore::CSSPropertyParserHelpers::consumeRadialGradient):
1698         (WebCore::CSSPropertyParserHelpers::consumeLinearGradient):
1699
1700 2016-10-28  Dean Jackson  <dino@apple.com>
1701
1702         New CSS Parser should use Colors not RGBA32s
1703         https://bugs.webkit.org/show_bug.cgi?id=164124
1704         <rdar://problem/29000373>
1705
1706         Reviewed by Darin Adler.
1707
1708         The old parser has moved from using RGBA32 values to using
1709         Colors directly. This was so we could support ExtendedColors
1710         via the new color() syntax.
1711
1712         Update the new CSS parser to do the same.
1713
1714         * css/parser/CSSPropertyParserHelpers.cpp:
1715         (WebCore::CSSPropertyParserHelpers::parseRGBParameters):
1716         (WebCore::CSSPropertyParserHelpers::parseHSLParameters):
1717         (WebCore::CSSPropertyParserHelpers::parseHexColor):
1718         (WebCore::CSSPropertyParserHelpers::parseColorFunction):
1719         (WebCore::CSSPropertyParserHelpers::consumeColor):
1720
1721 2016-10-28  Dean Jackson  <dino@apple.com>
1722
1723         Allow new CSS parser to handle insertRule, etc via parseRule
1724         https://bugs.webkit.org/show_bug.cgi?id=164122
1725         <rdar://problem/29000101>
1726
1727         Reviewed by Darin Adler.
1728
1729         Call the new CSS parser from CSSParser::parseRule if enabled. This
1730         allows style added via the CSSOM insertRule to go through
1731         the parser.
1732
1733         I tested this across our layout tests that use insertRule. It
1734         works fine, but does cause some filter tests to fail. This is
1735         because the new parser does not generate WebKitCSSFilterValues,
1736         but I think the CSSFunctionValue is good enough. I'll remove
1737         WebKitCSSFilterValue separately.
1738
1739         * css/parser/CSSParser.cpp:
1740         (WebCore::CSSParser::parseRule): Call CSSParserImpl::parseRule.
1741
1742 2016-10-28  Simon Fraser  <simon.fraser@apple.com>
1743
1744         Wrong blur radius for filter: drop-shadow()
1745         https://bugs.webkit.org/show_bug.cgi?id=163667
1746
1747         Reviewed by Darin Adler.
1748         
1749         The "stdDev" parameter to <feDropShadow> and <feGaussianBlur> represents the standard
1750         deviation (σ) of the Gaussian blur function. CSS filters drop-shadow() and blur() follow
1751         this with their radius parameter.
1752         
1753         However, CSS box-shadow and text-shadow use 2σ to describe the blur radius, since this
1754         is conveniently close to the number of pixels the effect of the blur extends out.
1755         
1756         feDropShadow, which is used by non-accelerated filter: drop-shadow(), was using
1757         the wrong blur radius because it passed its stdDev directly to ShadowBlur. ShadowBlur
1758         was written for CSS box-shadow, so expected its input "blur radius" to be twice the
1759         stdDev.
1760         
1761         Tests: css3/filters/drop-shadow-blur-radius.html
1762                svg/filters/feDropShadow-blur-radius.html
1763
1764         * platform/graphics/filters/FEDropShadow.cpp:
1765         (WebCore::FEDropShadow::platformApplySoftware):
1766
1767 2016-10-28  Youenn Fablet  <youenn@apple.com>
1768
1769         Expose RTCPeerConnection unprefixed
1770         https://bugs.webkit.org/show_bug.cgi?id=164060
1771
1772         Reviewed by Darin Adler.
1773
1774         Covered by rebased and activated tests.
1775
1776         * Modules/mediastream/RTCPeerConnection.idl:
1777
1778 2016-10-28  Dave Hyatt  <hyatt@apple.com>
1779
1780         [CSS Parser] Support the marquee properties
1781         https://bugs.webkit.org/show_bug.cgi?id=164132
1782
1783         Reviewed by Zalan Bujtas.
1784
1785         * css/parser/CSSParserFastPaths.cpp:
1786         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
1787         * css/parser/CSSPropertyParser.cpp:
1788         (WebCore::consumeWebkitMarqueeIncrement):
1789         (WebCore::consumeWebkitMarqueeRepetition):
1790         (WebCore::consumeWebkitMarqueeSpeed):
1791         (WebCore::CSSPropertyParser::parseSingleValue):
1792         (WebCore::CSSPropertyParser::parseShorthand):
1793
1794 2016-10-28  Dave Hyatt  <hyatt@apple.com>
1795
1796         [CSS Parser] Miscellaneous bug fixes
1797         https://bugs.webkit.org/show_bug.cgi?id=164131
1798
1799         Reviewed by Zalan Bujtas.
1800
1801         * css/CSSComputedStyleDeclaration.cpp:
1802         (WebCore::ComputedStyleExtractor::propertyValue):
1803         * css/CSSPropertyNames.in:
1804         The prefix was incorrectly dropped from -webkit-column-progression.
1805         Put it back.
1806
1807         * css/StyleBuilderConverter.h:
1808         (WebCore::StyleBuilderConverter::convertPositionComponent):
1809         (WebCore::StyleBuilderConverter::convertObjectPosition):
1810         Fix object-position parsing so that the position components can
1811         be ids.
1812
1813         * css/StyleBuilderCustom.h:
1814         (WebCore::StyleBuilderCustom::applyValueContent):
1815         The new parser doesn't make a list for content:none, since none can't be
1816         a component of a list anyway. Add code to handle this case in the
1817         apply function.
1818
1819         * css/parser/CSSParser.cpp:
1820         (WebCore::isValidKeywordPropertyAndValue):
1821         Put the prefix back on -webkit-column-progression.
1822
1823         * css/parser/CSSParserFastPaths.cpp:
1824         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
1825         (WebCore::CSSParserFastPaths::isKeywordPropertyID):
1826         Same.
1827
1828         * css/parser/CSSParserImpl.cpp:
1829         (WebCore::CSSParserImpl::parsePageSelector):
1830         Make sure match type is checked, since our code asserts if it isn't.
1831
1832         * css/parser/CSSPropertyParser.cpp:
1833         (WebCore::validWidthOrHeightKeyword):
1834         (WebCore::consumeLineGrid):
1835         (WebCore::CSSPropertyParser::parseSingleValue):
1836         Add support for the line-grid properties and for -webkit-nbsp-mode.
1837
1838 2016-10-28  Antti Koivisto  <antti@apple.com>
1839
1840         Always use iOS preload behavior
1841         https://bugs.webkit.org/show_bug.cgi?id=164127
1842
1843         Reviewed by Andreas Kling.
1844
1845         On non-iOS platforms we were delaying issuing lower priority preload (images mostly) until document has body.
1846         This should be unnecessary as networking layer prioritization should ensure higher priority resources are
1847         loaded earlier. Testing on iOS has showed that more aggressive behavior is a win.
1848
1849         This patch switches to iOS behavior on all platforms (and simplified the logic).
1850
1851         * html/parser/HTMLResourcePreloader.cpp:
1852         (WebCore::HTMLResourcePreloader::preload):
1853         * loader/LinkLoader.cpp:
1854         (WebCore::LinkLoader::preloadIfNeeded):
1855         * loader/cache/CachedResourceLoader.cpp:
1856         (WebCore::CachedResourceLoader::performPostLoadActions):
1857         (WebCore::CachedResourceLoader::preload):
1858         (WebCore::CachedResourceLoader::isPreloaded):
1859         (WebCore::CachedResourceLoader::checkForPendingPreloads): Deleted.
1860         (WebCore::CachedResourceLoader::requestPreload): Deleted.
1861         (WebCore::CachedResourceLoader::clearPendingPreloads): Deleted.
1862         * loader/cache/CachedResourceLoader.h:
1863
1864 2016-10-28  Youenn Fablet  <youenn@apple.com>
1865
1866         [Fetch] Ensure redirection count is no more than 20 in case of cross origin requests
1867         https://bugs.webkit.org/show_bug.cgi?id=164117
1868
1869         Reviewed by Sam Weinig.
1870
1871         Tests: imported/w3c/web-platform-tests/fetch/api/redirect/redirect-count-cross-origin-worker.html
1872                imported/w3c/web-platform-tests/fetch/api/redirect/redirect-count-cross-origin.html
1873
1874         Introducing a ResourceLoaderOptions that defines the maximum redirection count.
1875         By default, it is set to 20 as per fetch specification.
1876
1877         This option is used by SubresourceLoader to cancel load if its redirection count is above that maximum.
1878         DocumentThreadableLoader stopping redirections to make preflight if needed, it now uses the maxRedirectCount loader option to ensure
1879         that the total number of redirections is 20.
1880
1881         * loader/DocumentThreadableLoader.cpp:
1882         (WebCore::DocumentThreadableLoader::redirectReceived):
1883         * loader/ResourceLoaderOptions.h:
1884         * loader/SubresourceLoader.cpp:
1885         (WebCore::SubresourceLoader::willSendRequestInternal):
1886         * loader/SubresourceLoader.h:
1887
1888 2016-10-28  Fujii Hironori  <Hironori.Fujii@sony.com>
1889
1890         generate-bindings-all.pl should recompile supplemented IDL if its supplemental IDL are added or removed
1891         https://bugs.webkit.org/show_bug.cgi?id=164054
1892
1893         Reviewed by Michael Catanzaro.
1894
1895         generate-bindings-all.pl determines which IDL to recompile by
1896         comparing timestamps of generated files, source IDL and its
1897         dependencies.  But this is not enough. If a new supplemental IDL
1898         is added, its supplemented IDL needs to be recompiled even though
1899         the timestamp of the supplemental IDL is older than the
1900         generated files.
1901
1902         * bindings/scripts/generate-bindings-all.pl: Read supplemental
1903         dependency file both before and after invoking preprocess-idls.pl.
1904         Recompile IDL files if its supplemental dependencies are added or
1905         removed.
1906
1907 2016-10-28  Youenn Fablet  <youenn@apple.com>
1908
1909         PeerMediaDescription does not need to be refcounted
1910         https://bugs.webkit.org/show_bug.cgi?id=164059
1911
1912         Reviewed by Darin Adler.
1913
1914         No change of behavior.
1915
1916         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
1917         (WebCore::MediaEndpointPeerConnection::createOfferTask):
1918         (WebCore::MediaEndpointPeerConnection::createAnswerTask):
1919         (WebCore::createSourceMap):
1920         (WebCore::MediaEndpointPeerConnection::setLocalDescriptionTask):
1921         (WebCore::MediaEndpointPeerConnection::setRemoteDescriptionTask):
1922         (WebCore::MediaEndpointPeerConnection::addIceCandidateTask):
1923         (WebCore::MediaEndpointPeerConnection::gotIceCandidate):
1924         * Modules/mediastream/MediaEndpointPeerConnection.h:
1925         * Modules/mediastream/SDPProcessor.cpp:
1926         (WebCore::configurationFromJSON):
1927         (WebCore::configurationToJSON):
1928         (WebCore::SDPProcessor::generateCandidateLine):
1929         (WebCore::SDPProcessor::parseCandidateLine):
1930         * platform/mediastream/IceCandidate.h:
1931         * platform/mediastream/MediaEndpointSessionConfiguration.h:
1932         (WebCore::MediaEndpointSessionConfiguration::mediaDescriptions):
1933         (WebCore::MediaEndpointSessionConfiguration::addMediaDescription):
1934         (WebCore::MediaEndpointSessionConfiguration::clone):
1935         * platform/mediastream/PeerMediaDescription.h:
1936         (WebCore::PeerMediaDescription::addPayload):
1937         (WebCore::PeerMediaDescription::addSsrc):
1938         (WebCore::PeerMediaDescription::clearSsrcs):
1939         (WebCore::PeerMediaDescription::addIceCandidate):
1940         (WebCore::PeerMediaDescription::create): Deleted.
1941         (WebCore::PeerMediaDescription::~PeerMediaDescription): Deleted.
1942         (WebCore::PeerMediaDescription::type): Deleted.
1943         (WebCore::PeerMediaDescription::setType): Deleted.
1944         (WebCore::PeerMediaDescription::port): Deleted.
1945         (WebCore::PeerMediaDescription::setPort): Deleted.
1946         (WebCore::PeerMediaDescription::address): Deleted.
1947         (WebCore::PeerMediaDescription::setAddress): Deleted.
1948         (WebCore::PeerMediaDescription::mode): Deleted.
1949         (WebCore::PeerMediaDescription::setMode): Deleted.
1950         (WebCore::PeerMediaDescription::mid): Deleted.
1951         (WebCore::PeerMediaDescription::setMid): Deleted.
1952         (WebCore::PeerMediaDescription::payloads): Deleted.
1953         (WebCore::PeerMediaDescription::setPayloads): Deleted.
1954         (WebCore::PeerMediaDescription::rtcpMux): Deleted.
1955         (WebCore::PeerMediaDescription::setRtcpMux): Deleted.
1956         (WebCore::PeerMediaDescription::rtcpAddress): Deleted.
1957         (WebCore::PeerMediaDescription::setRtcpAddress): Deleted.
1958         (WebCore::PeerMediaDescription::rtcpPort): Deleted.
1959         (WebCore::PeerMediaDescription::setRtcpPort): Deleted.
1960         (WebCore::PeerMediaDescription::mediaStreamId): Deleted.
1961         (WebCore::PeerMediaDescription::setMediaStreamId): Deleted.
1962         (WebCore::PeerMediaDescription::mediaStreamTrackId): Deleted.
1963         (WebCore::PeerMediaDescription::setMediaStreamTrackId): Deleted.
1964         (WebCore::PeerMediaDescription::dtlsSetup): Deleted.
1965         (WebCore::PeerMediaDescription::setDtlsSetup): Deleted.
1966         (WebCore::PeerMediaDescription::dtlsFingerprintHashFunction): Deleted.
1967         (WebCore::PeerMediaDescription::setDtlsFingerprintHashFunction): Deleted.
1968         (WebCore::PeerMediaDescription::dtlsFingerprint): Deleted.
1969         (WebCore::PeerMediaDescription::setDtlsFingerprint): Deleted.
1970         (WebCore::PeerMediaDescription::cname): Deleted.
1971         (WebCore::PeerMediaDescription::setCname): Deleted.
1972         (WebCore::PeerMediaDescription::ssrcs): Deleted.
1973         (WebCore::PeerMediaDescription::iceUfrag): Deleted.
1974         (WebCore::PeerMediaDescription::setIceUfrag): Deleted.
1975         (WebCore::PeerMediaDescription::icePassword): Deleted.
1976         (WebCore::PeerMediaDescription::setIcePassword): Deleted.
1977         (WebCore::PeerMediaDescription::iceCandidates): Deleted.
1978         (WebCore::PeerMediaDescription::clone): Deleted.
1979         (WebCore::PeerMediaDescription::PeerMediaDescription): Deleted.
1980         * platform/mediastream/mac/MediaEndpointMac.cpp:
1981         (WebCore::MediaEndpointMac::addRemoteCandidate):
1982         (WebCore::MediaEndpointMac::OnIceCandidate):
1983         * platform/mediastream/mac/MediaEndpointMac.h:
1984         * platform/mediastream/openwebrtc/MediaEndpointOwr.cpp:
1985         (WebCore::MediaEndpointOwr::updateSendConfiguration):
1986         * platform/mediastream/openwebrtc/MediaEndpointOwr.h:
1987         * platform/mock/MockMediaEndpoint.cpp:
1988         (WebCore::MockMediaEndpoint::updateConfigurationMids):
1989
1990 2016-10-28  Antoine Quint  <graouts@apple.com>
1991
1992         [Modern Media Controls] Media Controller: scrubbing support
1993         https://bugs.webkit.org/show_bug.cgi?id=163726
1994         <rdar://problem/27989481>
1995
1996         Reviewed by Dean Jackson.
1997
1998         We introduce the ScrubberSupport class which brings support for scrubbing the media
1999         by interacting with the scrubber in the media controls and correctly reflecting
2000         the media's current time as set via the media API.
2001
2002         Tests: media/modern-media-controls/scrubber-support/scrubber-support-click.html
2003                media/modern-media-controls/scrubber-support/scrubber-support-drag.html
2004                media/modern-media-controls/scrubber-support/scrubber-support-media-api.html
2005
2006         * Modules/modern-media-controls/js-files:
2007         * Modules/modern-media-controls/media/media-controller.js:
2008         (MediaController):
2009         * Modules/modern-media-controls/media/scrubbing-support.js: Added.
2010         (ScrubbingSupport.prototype.get control):
2011         (ScrubbingSupport.prototype.get mediaEvents):
2012         (ScrubbingSupport.prototype.controlValueWillStartChanging):
2013         (ScrubbingSupport.prototype.controlValueDidChange):
2014         (ScrubbingSupport.prototype.controlValueDidStopChanging):
2015         (ScrubbingSupport.prototype.syncControl):
2016         (ScrubbingSupport):
2017         * WebCore.xcodeproj/project.pbxproj:
2018
2019 2016-10-28  Alex Christensen  <achristensen@webkit.org>
2020
2021         Fix Windows WebGL build after r208022
2022         https://bugs.webkit.org/show_bug.cgi?id=164091
2023
2024         * platform/graphics/opengl/Extensions3DOpenGLCommon.h:
2025         * platform/graphics/opengl/Extensions3DOpenGLES.cpp:
2026         (WebCore::Extensions3DOpenGLES::Extensions3DOpenGLES):
2027         * platform/graphics/opengl/Extensions3DOpenGLES.h:
2028         * platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
2029         (WebCore::GraphicsContext3D::getExtensions):
2030
2031 2016-10-27  Youenn Fablet  <youenn@apple.com>
2032
2033         [Fetch API] Fetch ReadableStream should only clone the second branch
2034         https://bugs.webkit.org/show_bug.cgi?id=164058
2035
2036         Reviewed by Darin Adler.
2037
2038         Covered by rebased tests.
2039
2040         * Modules/streams/ReadableStreamInternals.js:
2041         (readableStreamTeePullFunction):
2042
2043 2016-10-27  Alex Christensen  <achristensen@webkit.org>
2044
2045         Update ANGLE
2046         https://bugs.webkit.org/show_bug.cgi?id=164101
2047
2048         Reviewed by Darin Adler.
2049
2050         ShCheckVariablesWithinPackingLimits has changed signatures from taking a ShVariableInfo* and length
2051         to taking a std::vector<sh::ShaderVariable> which requires more information about the shader variables
2052         than we kept in GraphicsContext3D::SymbolInfo.  I removed the SymbolInfo class because it was redundant
2053         with ANGLE's sh::ShaderVariable and now unused.
2054
2055         Covered by existing WebGL tests.
2056
2057         * CMakeLists.txt:
2058         * PlatformMac.cmake:
2059         * PlatformWin.cmake:
2060         * platform/graphics/ANGLEWebKitBridge.cpp:
2061         (WebCore::appendSymbol):
2062         (WebCore::getStructInfo):
2063         (WebCore::getSymbolInfo):
2064         (WebCore::ANGLEWebKitBridge::compileShaderSource):
2065         * platform/graphics/ANGLEWebKitBridge.h:
2066         (WebCore::ANGLEShaderSymbol::isSampler): Deleted.
2067         * platform/graphics/GraphicsContext3D.h:
2068         (WebCore::GraphicsContext3D::SymbolInfo::SymbolInfo): Deleted.
2069         (WebCore::GraphicsContext3D::SymbolInfo::operator==): Deleted.
2070         * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
2071         (WebCore::Extensions3DOpenGLCommon::getTranslatedShaderSourceANGLE):
2072         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
2073         (WebCore::GraphicsContext3D::checkVaryingsPacking):
2074         (WebCore::GraphicsContext3D::precisionsMatch):
2075         (WebCore::GraphicsContext3D::mappedSymbolName):
2076         (WebCore::GraphicsContext3D::originalSymbolName):
2077
2078 2016-10-27  Simon Fraser  <simon.fraser@apple.com>
2079
2080         Remove RenderStyle::isRunningAcceleratedAnimation()
2081         https://bugs.webkit.org/show_bug.cgi?id=164109
2082
2083         Reviewed by David Hyatt.
2084
2085         RenderStyle::isRunningAcceleratedAnimation() was added in r40876 to handle interrupted
2086         accelerated transitions, and to allow RenderLayer::currentTransform() to know when it
2087         has to manually get the animated style.
2088         
2089         The latter can now use isRunningAcceleratedAnimationOnRenderer(), and interrupting
2090         accelerated transitions seems to work fine without it, so remove it.
2091
2092         * page/animation/ImplicitAnimation.cpp:
2093         (WebCore::ImplicitAnimation::animate):
2094         * page/animation/KeyframeAnimation.cpp:
2095         (WebCore::KeyframeAnimation::animate):
2096         * rendering/RenderLayer.cpp:
2097         (WebCore::RenderLayer::currentTransform):
2098         * rendering/style/RenderStyle.h:
2099         (WebCore::RenderStyle::isRunningAcceleratedAnimation): Deleted.
2100         (WebCore::RenderStyle::setIsRunningAcceleratedAnimation): Deleted.
2101         * rendering/style/StyleRareNonInheritedData.cpp:
2102         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
2103         (WebCore::StyleRareNonInheritedData::operator==):
2104         * rendering/style/StyleRareNonInheritedData.h:
2105
2106 2016-10-27  Myles C. Maxfield  <mmaxfield@apple.com>
2107
2108         Teach WebGL code about new buffer targets in WebGL2
2109         https://bugs.webkit.org/show_bug.cgi?id=163924
2110
2111         Reviewed by Dean Jackson.
2112
2113         WebGL 2 adds new buffer targets. Instead of completely reimplementing
2114         the functions again for WebGL 2, we can simply check if we are using
2115         a new kind of context to conditionally enable support.
2116
2117         Test: fast/canvas/webgl/webgl2-buffer-targets.html
2118
2119         * html/canvas/WebGL2RenderingContext.h:
2120         * html/canvas/WebGL2RenderingContext.idl:
2121         * html/canvas/WebGLBuffer.cpp:
2122         (WebCore::WebGLBuffer::associateBufferDataImpl):
2123         (WebCore::WebGLBuffer::associateBufferSubDataImpl):
2124         (WebCore::WebGLBuffer::setTarget):
2125         * html/canvas/WebGLBuffer.h:
2126         * html/canvas/WebGLRenderingContextBase.cpp:
2127         (WebCore::WebGLRenderingContextBase::bindBuffer):
2128         (WebCore::WebGLRenderingContextBase::getBufferParameter):
2129         (WebCore::WebGLRenderingContextBase::validateBufferDataParameters):
2130         * html/canvas/WebGLRenderingContextBase.h:
2131
2132 2016-10-27  Dave Hyatt  <hyatt@apple.com>
2133
2134         [CSS Parser] Enhance grid-auto-flow parsing to allow dense first.
2135         https://bugs.webkit.org/show_bug.cgi?id=164110
2136
2137         Reviewed by Simon Fraser.
2138
2139         * css/StyleBuilderConverter.h:
2140         (WebCore::StyleBuilderConverter::convertGridAutoFlow):
2141
2142 2016-10-27  Simon Fraser  <simon.fraser@apple.com>
2143
2144         constify the CSSValue arguments to StyleBuilderConverter functions
2145         https://bugs.webkit.org/show_bug.cgi?id=164106
2146
2147         Reviewed by Zalan Bujtas.
2148
2149         Make almost all the CSSValue& arguments const (this makes it clear that they
2150         are in params, not out params). Only a few that are CSSImageValues are non-const,
2151         because they fall into a non-const code path.
2152
2153         * css/StyleBuilderConverter.h:
2154         (WebCore::StyleBuilderConverter::convertLengthOrAuto):
2155         (WebCore::StyleBuilderConverter::convertLengthSizing):
2156         (WebCore::StyleBuilderConverter::convertLengthMaxSizing):
2157         (WebCore::StyleBuilderConverter::convertComputedLength):
2158         (WebCore::StyleBuilderConverter::convertLineWidth):
2159         (WebCore::StyleBuilderConverter::convertSpacing):
2160         (WebCore::StyleBuilderConverter::convertToRadiusLength):
2161         (WebCore::StyleBuilderConverter::convertRadius):
2162         (WebCore::StyleBuilderConverter::convertObjectPosition):
2163         (WebCore::StyleBuilderConverter::convertTextDecoration):
2164         (WebCore::StyleBuilderConverter::convertNumber):
2165         (WebCore::StyleBuilderConverter::convertNumberOrAuto):
2166         (WebCore::StyleBuilderConverter::convertWebkitHyphenateLimitLines):
2167         (WebCore::StyleBuilderConverter::convertTransform):
2168         (WebCore::StyleBuilderConverter::convertString):
2169         (WebCore::StyleBuilderConverter::convertStringOrAuto):
2170         (WebCore::StyleBuilderConverter::convertStringOrNone):
2171         (WebCore::StyleBuilderConverter::valueToEmphasisPosition):
2172         (WebCore::StyleBuilderConverter::convertTextEmphasisPosition):
2173         (WebCore::StyleBuilderConverter::convertTextAlign):
2174         (WebCore::StyleBuilderConverter::convertClipPath):
2175         (WebCore::StyleBuilderConverter::convertResize):
2176         (WebCore::StyleBuilderConverter::convertMarqueeRepetition):
2177         (WebCore::StyleBuilderConverter::convertMarqueeSpeed):
2178         (WebCore::StyleBuilderConverter::convertQuotes):
2179         (WebCore::StyleBuilderConverter::convertTextUnderlinePosition):
2180         (WebCore::StyleBuilderConverter::convertReflection):
2181         (WebCore::StyleBuilderConverter::convertInitialLetter):
2182         (WebCore::StyleBuilderConverter::convertTextStrokeWidth):
2183         (WebCore::StyleBuilderConverter::convertLineBoxContain):
2184         (WebCore::StyleBuilderConverter::convertTextDecorationSkip):
2185         (WebCore::StyleBuilderConverter::convertScrollSnapPoints):
2186         (WebCore::StyleBuilderConverter::convertSnapCoordinatePair):
2187         (WebCore::StyleBuilderConverter::convertScrollSnapCoordinates):
2188         (WebCore::StyleBuilderConverter::createGridTrackBreadth):
2189         (WebCore::StyleBuilderConverter::createGridTrackSize):
2190         (WebCore::StyleBuilderConverter::createGridTrackList):
2191         (WebCore::StyleBuilderConverter::createGridPosition):
2192         (WebCore::StyleBuilderConverter::convertGridTrackSizeList):
2193         (WebCore::StyleBuilderConverter::convertGridTrackSize):
2194         (WebCore::StyleBuilderConverter::convertGridPosition):
2195         (WebCore::StyleBuilderConverter::convertGridAutoFlow):
2196         (WebCore::StyleBuilderConverter::convertWordSpacing):
2197         (WebCore::StyleBuilderConverter::convertPerspective):
2198         (WebCore::StyleBuilderConverter::convertMarqueeIncrement):
2199         (WebCore::StyleBuilderConverter::convertFilterOperations):
2200         (WebCore::StyleBuilderConverter::convertFontFeatureSettings):
2201         (WebCore::StyleBuilderConverter::convertFontVariationSettings):
2202         (WebCore::StyleBuilderConverter::convertTouchCallout):
2203         (WebCore::StyleBuilderConverter::convertTapHighlightColor):
2204         (WebCore::StyleBuilderConverter::convertOverflowScrolling):
2205         (WebCore::StyleBuilderConverter::convertSVGLength):
2206         (WebCore::StyleBuilderConverter::convertSVGLengthVector):
2207         (WebCore::StyleBuilderConverter::convertStrokeDashArray):
2208         (WebCore::StyleBuilderConverter::convertPaintOrder):
2209         (WebCore::StyleBuilderConverter::convertOpacity):
2210         (WebCore::StyleBuilderConverter::convertSVGURIReference):
2211         (WebCore::StyleBuilderConverter::convertSVGColor):
2212         (WebCore::StyleBuilderConverter::convertSelfOrDefaultAlignmentData):
2213         (WebCore::StyleBuilderConverter::convertContentAlignmentData):
2214         (WebCore::StyleBuilderConverter::convertGlyphOrientation):
2215         (WebCore::StyleBuilderConverter::convertGlyphOrientationOrAuto):
2216         (WebCore::StyleBuilderConverter::convertLineHeight):
2217         (WebCore::StyleBuilderConverter::convertFontSynthesis):
2218         (WebCore::StyleBuilderConverter::convertPageBreakBetween):
2219         (WebCore::StyleBuilderConverter::convertPageBreakInside):
2220         (WebCore::StyleBuilderConverter::convertColumnBreakBetween):
2221         (WebCore::StyleBuilderConverter::convertColumnBreakInside):
2222         (WebCore::StyleBuilderConverter::convertRegionBreakBetween):
2223         (WebCore::StyleBuilderConverter::convertRegionBreakInside):
2224         (WebCore::StyleBuilderConverter::convertHangingPunctuation):
2225
2226 2016-10-27  Dave Hyatt  <hyatt@apple.com>
2227
2228         [CSS Parser] Add support for a reference box to -webkit-clip-path
2229         https://bugs.webkit.org/show_bug.cgi?id=164107
2230
2231         Reviewed by Simon Fraser.
2232
2233         * css/parser/CSSPropertyParser.cpp:
2234         (WebCore::consumeBasicShape):
2235         (WebCore::consumeBasicShapeOrBox):
2236         (WebCore::consumeWebkitClipPath):
2237
2238 2016-10-27  Yusuke Suzuki  <utatane.tea@gmail.com>
2239
2240         [DOM] Add JSEventType
2241         https://bugs.webkit.org/show_bug.cgi?id=164096
2242
2243         Reviewed by Darin Adler.
2244
2245         Event is inherited by many Event classes. But, Event's accessors and interfaces are
2246         frequently called. For example, event.{type, target, srcElement} for accessors. And
2247         event.stopPropagation() and event.preventDefault() functions.
2248
2249         However, since the user-visible event instance is typically the instance of the subclass,
2250         jsDynamicCast<JSEvent*>() walks several classes before it succeeds. It is costly.
2251
2252         In this patch, we add a new WebCore JSType JSEventType for JSEvent and add a new
2253         function jsEventCast. That supports a super fast cast operation. And it paves the way
2254         for implementing DOM accessors of Event in DOMJIT.
2255
2256         No behavior change.
2257
2258         * WebCore.xcodeproj/project.pbxproj:
2259         * bindings/js/JSDOMWrapper.h:
2260         * bindings/js/JSEventCustom.h: Added.
2261         (WebCore::jsEventCast):
2262         * bindings/scripts/CodeGeneratorJS.pm:
2263         (GetJSTypeForNode):
2264         (GenerateHeader):
2265         (GetCastingHelperForThisObject):
2266         * bindings/scripts/test/JS/JSTestEventConstructor.h:
2267         (WebCore::JSTestEventConstructor::createStructure):
2268         * dom/Event.idl:
2269         * domjit/DOMJITHelpers.h:
2270         (WebCore::DOMJIT::branchIfEvent):
2271         (WebCore::DOMJIT::branchIfNotEvent):
2272
2273 2016-10-27  Simon Fraser  <simon.fraser@apple.com>
2274
2275         Rename StyleRareNonInheritedData::opacity to m_opacity
2276         https://bugs.webkit.org/show_bug.cgi?id=164104
2277
2278         Reviewed by Dave Hyatt.
2279
2280         Pure rename.
2281
2282         * rendering/style/RenderStyle.cpp:
2283         (WebCore::RenderStyle::changeRequiresLayerRepaint):
2284         * rendering/style/RenderStyle.h:
2285         (WebCore::RenderStyle::opacity):
2286         (WebCore::RenderStyle::setOpacity):
2287         * rendering/style/StyleRareNonInheritedData.cpp:
2288         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
2289         (WebCore::StyleRareNonInheritedData::operator==):
2290         * rendering/style/StyleRareNonInheritedData.h:
2291         (WebCore::StyleRareNonInheritedData::hasOpacity):
2292
2293 2016-10-27  Simon Fraser  <simon.fraser@apple.com>
2294
2295         If an animation's keyframes affect stacking context properties, create stacking context while the animation is running
2296         https://bugs.webkit.org/show_bug.cgi?id=164094
2297
2298         Reviewed by Dean Jackson.
2299
2300         The CSS animations spec <https://drafts.csswg.org/css-animations-1/> now makes it
2301         clear that a keyframe animation animating properties which can affect stacking context
2302         should establish stacking context while it's running, or filling-forwards. This is part
2303         of the "the user agent must act as if the will-change property...includes all the properties
2304         animated by the animation" clause.
2305
2306         Implement by having CompositeAnimation::animate() track whether running animations should
2307         create stacking context, replacing existing code in AnimationController::updateAnimations()
2308         which only looked at opacity and transform. Transitions are also checked to see if they need
2309         to trigger stacking context.
2310
2311         This allows for the removal of a 0.9999 hack when blending opacity.
2312
2313         Tests: animations/stacking-context-fill-forwards.html
2314                animations/stacking-context-not-fill-forwards.html
2315                animations/stacking-context-unchanged-while-running.html
2316
2317         * page/animation/AnimationController.cpp:
2318         (WebCore::AnimationController::updateAnimations):
2319         * page/animation/CSSPropertyAnimation.cpp:
2320         * page/animation/CompositeAnimation.cpp:
2321         (WebCore::CompositeAnimation::animate):
2322         * page/animation/KeyframeAnimation.cpp:
2323         (WebCore::KeyframeAnimation::KeyframeAnimation):
2324         (WebCore::KeyframeAnimation::computeStackingContextImpact):
2325         (WebCore::KeyframeAnimation::animate):
2326         * page/animation/KeyframeAnimation.h:
2327         * rendering/RenderLayer.cpp:
2328         (WebCore::RenderLayer::currentTransform):
2329         * rendering/style/WillChangeData.cpp:
2330         (WebCore::WillChangeData::propertyCreatesStackingContext):
2331         (WebCore::propertyCreatesStackingContext): Deleted.
2332         * rendering/style/WillChangeData.h:
2333
2334 2016-10-27  Sam Weinig  <sam@webkit.org>
2335
2336         [WebIDL] Move code generators off of domSignature::type and onto domSignature::idlType
2337         https://bugs.webkit.org/show_bug.cgi?id=164089
2338
2339         Reviewed by Alex Christensen.
2340
2341         Make more IDLParser structures contain domTypes for type descriptions, rather than strings:
2342         - domInterface gains type and parentType.
2343         - domConstant gains type.
2344         - domEnum gains type.
2345         - domDictionary gains type and parentType.
2346
2347         With these structs now containing domTypes, we can update the CodeGenerators to operate on
2348         domTypes exclusively, rather than types as strings. This allows us to consistently have access
2349         to information such as subtypes and nullability.
2350
2351         * bindings/scripts/CodeGenerator.pm:
2352         Update helpers to operate of domTypes. The one exception is SkipIncludeHeader, which
2353         still operates on a type name, since it is called late in code generation on the textual
2354         form of type names in the include list. 
2355
2356         * bindings/scripts/CodeGeneratorJS.pm:
2357         Update to use domTypes.
2358
2359         * bindings/scripts/IDLParser.pm:
2360         - Add domType accessors to domInterface, domConstant, domEnum, and domDictionary
2361           and populate them.
2362         - Remove type accessors from domSignature (domType is accessible from idlType).
2363         - Remove special cases for sequence and FrozenArray, now that they are always
2364           accessed as domTypes.
2365
2366         * html/HTMLEmbedElement.idl:
2367         * html/HTMLFrameElement.idl:
2368         * html/HTMLFrameOwnerElement.cpp:
2369         (WebCore::HTMLFrameOwnerElement::getSVGDocument):
2370         * html/HTMLFrameOwnerElement.h:
2371         * html/HTMLIFrameElement.idl:
2372         * html/HTMLObjectElement.idl:
2373         Fix interfaces declaring getSVGDocument() to correctly have it return
2374         a Document, rather than an SVGDocument, which does exist anymore. To
2375         make the bindings happy, also change the signature of HTMLFrameOwnerElement::getSVGDocument
2376         to return a Document.
2377
2378         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
2379         * bindings/scripts/test/JS/JSTestInterface.cpp:
2380         * bindings/scripts/test/JS/JSTestObj.cpp:
2381         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
2382         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
2383         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
2384         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2385         Update test results to remove some redundant headers (Already included JSFoo.h, so no need for Foo.h).
2386
2387 2016-10-27  Myles C. Maxfield  <mmaxfield@apple.com>
2388
2389         [macOS] [WebGL2] Temporarily upgrade WebGL 2's internal OpenGL context from version 2.1 to 3.2
2390         https://bugs.webkit.org/show_bug.cgi?id=164091
2391
2392         Reviewed by Dean Jackson.
2393
2394         In order to test WebGL2 correctly, I had to upgrade the macOS's OpenGL 
2395         context to a 3.2-compatible context to make sure the new symbols are
2396         accepted. Eventually, this 3.2-compatible context will have to be
2397         reverted and replaced with an ANGLE context. The current 3.2-compatible
2398         context is just for testing.
2399
2400         Test: fast/canvas/webgl/webgl2-context-creation.html
2401
2402         * html/canvas/WebGLBuffer.cpp: Use "nullptr" instead of 0.
2403         (WebCore::WebGLBuffer::associateBufferData):
2404         * html/canvas/WebGLRenderingContextBase.cpp: Use make_unique() instead
2405         of the unique_ptr constructor.
2406         (WebCore::WebGLRenderingContextBase::create):
2407         * platform/graphics/GraphicsContext3D.h: GraphicsContext should know
2408         if it is using a 3.2-compatible context because some parts of 2.1 are
2409         removed in these contexts, and replaced with new things which aren't
2410         in 2.1.
2411         * platform/graphics/mac/GraphicsContext3DMac.mm:
2412         (WebCore::setPixelFormat): Use kCGLPFAOpenGLProfile to specify an
2413         OpenGL 3.2 context.
2414         (WebCore::GraphicsContext3D::GraphicsContext3D): GL_CLAMP is deprecated
2415         in OpenGL 3.2. Fortunately, GL_CLAMP_TO_EDGE isn't deprecated and does
2416         exactly what we want. In OpenGL3.2, point sprites are always enabled,
2417         so there's no need to enable them in those contexts.
2418         (WebCore::GraphicsContext3D::isGLES2Compliant):
2419         * platform/graphics/opengl/Extensions3DOpenGL.cpp: In OpenGL 3.2,
2420         glGetString() no longer accepts GL_EXTENSIONS. Instead, glGetStringi()
2421         is used instead. Unfortunately, glGetString() is not available in
2422         OpenGL 2.1 contexts, so we need to use one or the other based on the
2423         version of the context we're using.
2424         (WebCore::Extensions3DOpenGL::Extensions3DOpenGL):
2425         (WebCore::Extensions3DOpenGL::getExtensions):
2426         * platform/graphics/opengl/Extensions3DOpenGL.h:
2427         * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
2428         (WebCore::Extensions3DOpenGLCommon::Extensions3DOpenGLCommon):
2429         (WebCore::Extensions3DOpenGLCommon::initializeAvailableExtensions):
2430         Instead of modifying getExtensions() to use glGetStringi(), it makes
2431         better sense to modify this function because getExtensions() returns
2432         a string. Building up a string just to split it up again is silly, so
2433         modifying this function instead makes more sense.
2434         * platform/graphics/opengl/Extensions3DOpenGLCommon.h:
2435         * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
2436         (WebCore::GraphicsContext3D::getIntegerv): GL_MAX_VARYING_FLOATS is
2437         removed in OpenGL 3.2 contexts. However, it is replaced by
2438         GL_MAX_VARYING_COMPONENTS, though this is deprecated but not removed.
2439         In the more recent OpenGL context versions, GL_MAX_VARYING_VECTORS is
2440         recommended instead, but that isn't available in OpenGL 3.2.
2441         (WebCore::GraphicsContext3D::getExtensions):
2442
2443 2016-10-27  Megan Gardner  <megan_gardner@apple.com>
2444
2445         Add support for wide gamut for ShareableBitmap for image popovers
2446         https://bugs.webkit.org/show_bug.cgi?id=164001
2447
2448         Reviewed by Simon Fraser.
2449
2450         Add a function to return a CGColorSpaceRef for extended sRGB.
2451
2452         This is currently untestable, so no tests added.
2453
2454         * platform/graphics/cg/GraphicsContextCG.cpp:
2455         (WebCore::extendedSRGBColorSpaceRef):
2456
2457 2016-10-25  Brent Fulgham  <bfulgham@apple.com>
2458
2459         [Win][Direct2D] Create a RAII Helper Class for the Render Target
2460         https://bugs.webkit.org/show_bug.cgi?id=164005
2461
2462         Reviewed by Alex Christensen.
2463
2464         Tested by existing SVG, image, and Canvas layout tests.
2465
2466         * platform/graphics/GraphicsContext.h:
2467         * platform/graphics/win/GradientDirect2D.cpp:
2468         (WebCore::Gradient::fill): Use new convenience helper class.
2469         * platform/graphics/win/GraphicsContextDirect2D.cpp:
2470         (WebCore::GraphicsContext::didBeginDraw):
2471         (WebCore::GraphicsContextPlatformPrivate::GraphicsContextPlatformPrivate):
2472         (WebCore::GraphicsContextPlatformPrivate::~GraphicsContextPlatformPrivate): Add an
2473         assertion that we are in a valid state when cleaning up the graphics context.
2474         (WebCore::GraphicsContextPlatformPrivate::clip): Clipping can only happen in a Draw operation.
2475         Open a new BeginDraw if asked to Clip. The Begin must stay active when this method returns,
2476         as the Clip layer is only valid during a Draw operation.
2477         (WebCore::GraphicsContextPlatformPrivate::beginDraw): Added.
2478         (WebCore::GraphicsContextPlatformPrivate::endDraw): Added.
2479         (WebCore::GraphicsContext::beginDrawIfNeeded): Added.
2480         (WebCore::GraphicsContext::endDraw): Added.
2481         (WebCore::GraphicsContext::drawWithoutShadow): Revise to use new RenderTargetHelper class.
2482         (WebCore::GraphicsContext::drawWithShadow): Ditto.
2483         (WebCore::GraphicsContext::platformFillRoundedRect): Ditto.
2484         (WebCore::GraphicsContext::fillRectWithRoundedHole): Ditto.
2485         (WebCore::GraphicsContext::setDidBeginDraw): Deleted.
2486         * platform/graphics/win/GraphicsContextPlatformPrivateDirect2D.h:
2487         (WebCore::GraphicsContextPlatformPrivate::didBeginDraw): Revise to use count instead of
2488         a separate boolean.
2489         * platform/graphics/win/ImageBufferDataDirect2D.cpp:
2490         (WebCore::ImageBufferData::getData): Revise to use new RenderTargetHelper class.
2491         * platform/graphics/win/NativeImageDirect2D.cpp:
2492         (WebCore::drawNativeImage): Ditto.
2493         * platform/graphics/win/RenderTargetHelper.h: Added.
2494         (WebCore::RenderTargetHelper::RenderTargetHelper):
2495         (WebCore::RenderTargetHelper::~RenderTargetHelper):
2496         (WebCore::RenderTargetHelper::endDraw):
2497         * svg/graphics/SVGImage.cpp:
2498         (WebCore::SVGImage::nativeImage): Revise to use new RenderTargetHelper class.
2499
2500 2016-10-27  Wenson Hsieh  <wenson_hsieh@apple.com>
2501
2502         Support "insertFromDrop" and "deleteByDrag" for the InputEvent spec
2503         https://bugs.webkit.org/show_bug.cgi?id=163948
2504         <rdar://problem/28921433>
2505
2506         Reviewed by Darin Adler.
2507
2508         Implements support for "insertFromDrop" and "deleteByDrag" inputTypes. These are fired when dragging and
2509         dropping text in editable areas. To do this, we introduce EditActionInsertFromDrop and EditActionDeleteByDrag
2510         (renamed from EditActionDrag, which is no longer necessary after this patch).
2511
2512         When moving text from an editable element to another, we will use a DeleteSelectionCommand to delete the text
2513         from the source element and a ReplaceSelectionCommand to insert the text into the destination element. This
2514         means that we currently fire two input events on the source and destination elements (i.e. given by the start
2515         and end selections) after both child editing commands of the MoveSelectionCommand have been applied. Instead, we
2516         need to fire events in this order:
2517
2518         1. beforeinput ("deleteByDrag") on the source
2519         2. Update DOM
2520         3. input ("deleteByDrag") on the source
2521
2522         4. beforeinput ("insertFromDrop") on the destination
2523         5. Update DOM
2524         6. input ("insertFromDrop") on the destination
2525
2526         To accomplish this, we allow an edit command to defer dispatching input events to its child commands via
2527         CompositeEditCommand::shouldDispatchInputEvents, which the MoveSelectionCommand overrides. Additionally,
2528         when applying the MoveSelectionCommand, we now apply() the child DeleteSelectionCommand and
2529         ReplaceSelectionCommand instead of using doApply(). This allows these children to separately dispatch input
2530         events, and also handle preventDefault() separately.
2531
2532         Tests: fast/events/before-input-events-prevent-drag-and-drop.html
2533                fast/events/input-events-drag-and-drop.html
2534                fast/events/input-events-insert-by-drop.html
2535
2536         * editing/CompositeEditCommand.cpp:
2537         (WebCore::CompositeEditCommand::apply):
2538         (WebCore::CompositeEditCommand::composition):
2539
2540         Searches for the top-level command and returns its composition. Also ASSERTs that the m_command of all child
2541         commands along the way is null. In places where we used to ASSERT that command.composition() should be null, we
2542         now perform the assertion here instead.
2543
2544         * editing/CompositeEditCommand.h:
2545         (WebCore::CompositeEditCommand::shouldDispatchInputEvents):
2546
2547         This is true by default, which means that if apply() is called for a composite edit command that does not
2548         override this to return false, it will try to dispatch input events. In most cases, the parent command will call
2549         on the child command to doApply(), bypassing this check.
2550
2551         (WebCore::CompositeEditCommand::composition): Deleted.
2552         * editing/EditAction.h:
2553         * editing/EditCommand.cpp:
2554         (WebCore::inputTypeNameForEditingAction):
2555         (WebCore::EditCommand::isEditingTextAreaOrTextInput):
2556         (WebCore::EditCommand::setStartingSelection):
2557         (WebCore::EditCommand::setEndingSelection):
2558         (WebCore::EditCommand::setParent):
2559         * editing/Editor.cpp:
2560         (WebCore::Editor::willApplyEditing):
2561         (WebCore::Editor::appliedEditing):
2562
2563         After applying editing, only adjust the current selection and notify clients of selection change if the applied
2564         command was a top-level command; otherwise, these actions should wait until all child commands of the top-level
2565         command have been applied. In particular, we should not register the applied command as an undo step.
2566
2567         * editing/MoveSelectionCommand.cpp:
2568         (WebCore::MoveSelectionCommand::doApply):
2569         (WebCore::MoveSelectionCommand::editingAction):
2570         * editing/MoveSelectionCommand.h:
2571         * page/DragController.cpp:
2572         (WebCore::DragController::concludeEditDrag):
2573
2574         For the cases where we're not deleting text from the drag source (i.e. we're just applying a
2575         ReplaceSelectionCommand) pass in EditActionInsertFromDrop as the EditAction when creating the command.
2576
2577 2016-10-27  Per Arne Vollan  <pvollan@apple.com>
2578
2579         [Win][Direct2D] Implement GraphicsContext::releaseWindowsContext.
2580         https://bugs.webkit.org/show_bug.cgi?id=163988
2581
2582         Reviewed by Brent Fulgham.
2583
2584         This method is needed to draw native controls.
2585
2586         * platform/graphics/win/GraphicsContextDirect2D.cpp:
2587         (WebCore::GraphicsContext::releaseWindowsContext):
2588
2589 2016-10-27  Joseph Pecoraro  <pecoraro@apple.com>
2590
2591         Web Inspector: Worker should recover if Inspector is closed and never sent Worker.initialized command
2592         https://bugs.webkit.org/show_bug.cgi?id=164073
2593
2594         Reviewed by Brian Burg.
2595
2596         Test: inspector/worker/worker-recover-if-inspector-close.html
2597
2598         * workers/WorkerInspectorProxy.cpp:
2599         (WebCore::WorkerInspectorProxy::disconnectFromWorkerInspectorController):
2600         Ensure we stop the debugger only task loop if needed when the last debugger
2601         message comes in.
2602
2603 2016-10-27  Joseph Pecoraro  <pecoraro@apple.com>
2604
2605         Web Inspector: Include ConsoleAgent in Workers - real console.log support
2606         https://bugs.webkit.org/show_bug.cgi?id=163844
2607         <rdar://problem/28903328>
2608
2609         Reviewed by Brian Burg.
2610
2611         Test: inspector/worker/console-basic.html
2612
2613         This introduces a real ConsoleAgent in the Worker InspectorController.
2614         We no longer need to pass partial ConsoleMessage objects to be logged
2615         through the Page, we can just send the full ConsoleMessages to a
2616         frontend once it connects to the Worker.
2617
2618         In order to guarantee that the Worker InspectorController is properly
2619         all Workers will start paused if there is an Inspector attached to
2620         the Page. The frontend _must_ call the new Worker.initialized method
2621         after sending its setup commands to the Worker. This ensures we get
2622         handle all initialization commands (like Agent.enable(), and
2623         setting state like breakpoints) before any script executes in the
2624         Worker. This mirrors the Inspector.initialized method that does the
2625         same thing for JSContext auto-attach of the Main target.
2626
2627         In the backend, the wait until initialized state is just running
2628         the WorkerThread's RunLoop in a special debugger mode to only process
2629         debugger commands until we are ready. This will effectively be
2630         the same as pausing so it is generalized into WorkerThread.
2631
2632         * CMakeLists.txt:
2633         * WebCore.xcodeproj/project.pbxproj:
2634         * inspector/InspectorAllInOne.cpp:
2635         New files.
2636
2637         * inspector/InspectorWorkerAgent.cpp:
2638         (WebCore::InspectorWorkerAgent::initialized):
2639         (WebCore::InspectorWorkerAgent::shouldWaitForDebuggerOnStart):
2640         * inspector/InspectorWorkerAgent.h:
2641         Add the new initialized method. This just uses the proxy to send
2642         a message to be handled on the Worker Thread and unpause.
2643
2644         * inspector/WorkerConsoleAgent.cpp:
2645         (WebCore::WorkerConsoleAgent::WorkerConsoleAgent):
2646         (WebCore::WorkerConsoleAgent::addInspectedNode):
2647         * inspector/WorkerConsoleAgent.h:
2648         * inspector/WorkerInspectorController.cpp:
2649         (WebCore::WorkerInspectorController::WorkerInspectorController):
2650         Add a ConsoleAgent to WorkerInspectorController.
2651
2652         * workers/WorkerInspectorProxy.h:
2653         * workers/WorkerInspectorProxy.cpp:
2654         (WebCore::WorkerInspectorProxy::workerStartMode):
2655         (WebCore::WorkerInspectorProxy::resumeWorkerIfPaused):
2656         (WebCore::WorkerInspectorProxy::connectToWorkerInspector):
2657         (WebCore::WorkerInspectorProxy::disconnectFromWorkerInspector):
2658         (WebCore::WorkerInspectorProxy::sendMessageToWorkerInspector):
2659         Use the debugger mode when sending messages to the WorkerThread.
2660
2661         * workers/Worker.cpp:
2662         (WebCore::Worker::notifyFinished):
2663         * workers/WorkerMessagingProxy.cpp:
2664         (WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
2665         (WebCore::WorkerMessagingProxy::postConsoleMessageToWorkerObject): Deleted.
2666         * workers/WorkerMessagingProxy.h:
2667         * workers/WorkerReportingProxy.h:
2668         * workers/WorkerGlobalScope.cpp:
2669         (WebCore::WorkerGlobalScope::addConsoleMessage):
2670         (WebCore::WorkerGlobalScope::addMessage):
2671         * workers/WorkerGlobalScope.h:
2672         * workers/WorkerGlobalScopeProxy.h:
2673         Remove legacy partial console support.
2674
2675         * workers/WorkerRunLoop.h:
2676         * workers/WorkerRunLoop.cpp:
2677         (WebCore::WorkerRunLoop::debuggerMode):
2678         * workers/WorkerThread.h:
2679         * workers/WorkerThread.cpp:
2680         (WebCore::WorkerThread::workerThread):
2681         (WebCore::WorkerThread::startRunningDebuggerTasks):
2682         (WebCore::WorkerThread::stopRunningDebuggerTasks):
2683         General code for spinning the WorkerThread and only processing debugger
2684         (Inspector) commands. Use this when starting the thread to ensure the
2685         frontend initializes the Worker's Agents before any JavaScript executes.
2686
2687         * page/PageConsoleClient.cpp:
2688         * workers/WorkerConsoleClient.cpp:
2689         (WebCore::WorkerConsoleClient::count):
2690         (WebCore::WorkerConsoleClient::time):
2691         (WebCore::WorkerConsoleClient::timeEnd):
2692         * inspector/InspectorConsoleInstrumentation.h: Removed.
2693         * inspector/InspectorInstrumentation.cpp:
2694         (WebCore::InspectorInstrumentation::startConsoleTimingImpl):
2695         (WebCore::InspectorInstrumentation::stopConsoleTimingImpl):
2696         (WebCore::InspectorInstrumentation::shouldWaitForDebuggerOnStartImpl):
2697         * inspector/InspectorInstrumentation.h:
2698         (WebCore::InspectorInstrumentation::shouldWaitForDebuggerOnStart):
2699         (WebCore::InspectorInstrumentation::addMessageToConsole):
2700         (WebCore::InspectorInstrumentation::consoleCount):
2701         (WebCore::InspectorInstrumentation::takeHeapSnapshot):
2702         (WebCore::InspectorInstrumentation::startConsoleTiming):
2703         (WebCore::InspectorInstrumentation::stopConsoleTiming):
2704         (WebCore::InspectorInstrumentation::consoleTimeStamp):
2705         (WebCore::InspectorInstrumentation::startProfiling):
2706         (WebCore::InspectorInstrumentation::stopProfiling):
2707         Implement a few more basic console APIs that required ConsoleAgent.
2708
2709 2016-10-27  Joseph Pecoraro  <pecoraro@apple.com>
2710
2711         Web Inspector: Include RuntimeAgent in Workers - evaluate in Worker context
2712         https://bugs.webkit.org/show_bug.cgi?id=163835
2713         <rdar://problem/28901465>
2714
2715         Reviewed by Brian Burg.
2716
2717         Tests: inspector/unit-tests/target-manager.html
2718                inspector/worker/runtime-basic.html
2719
2720         * CMakeLists.txt:
2721         * WebCore.xcodeproj/project.pbxproj:
2722         * inspector/InspectorAllInOne.cpp:
2723         New file.
2724
2725         * inspector/InspectorWebAgentBase.h:
2726         (WebCore::WorkerAgentContext::WorkerAgentContext):
2727         New agent context creation struct for Workers.
2728
2729         * inspector/WorkerInspectorController.cpp:
2730         (WebCore::WorkerInspectorController::WorkerInspectorController):
2731         Create a RuntimeAgent for Workers.
2732
2733         * inspector/WorkerRuntimeAgent.cpp: Added.
2734         (WebCore::WorkerRuntimeAgent::WorkerRuntimeAgent):
2735         (WebCore::WorkerRuntimeAgent::didCreateFrontendAndBackend):
2736         (WebCore::WorkerRuntimeAgent::willDestroyFrontendAndBackend):
2737         (WebCore::WorkerRuntimeAgent::injectedScriptForEval):
2738         * inspector/WorkerRuntimeAgent.h: Added.
2739         Workers currently only ever have a single execution context.
2740
2741 2016-10-27  Joseph Pecoraro  <pecoraro@apple.com>
2742
2743         Web Inspector: Introduce Page WorkerAgent and Worker InspectorController
2744         https://bugs.webkit.org/show_bug.cgi?id=163817
2745         <rdar://problem/28899063>
2746
2747         Reviewed by Brian Burg.
2748
2749         Test: inspector/worker/worker-create-and-terminate.html
2750
2751         From the perspective of an Inspector frontend, Workers are
2752         like a special JavaScript context, separate from the page, that
2753         may have its own set of Agents. This patch adds the necessary
2754         backend infrastructure to provide WorkerGlobalObject with an
2755         InspectorController and the means to communicate with a frontend
2756         through a Page's WorkerAgent.
2757
2758         Pages now get a WorkerAgent. This informs the frontend about
2759         created and terminated Workers. It also provides a communication
2760         channel to dispatch and return inspector protocol messages to
2761         each of the Workers. The Page side always interacts with the
2762         WorkerInspectorProxy on the main thread. The Page's Worker Agent
2763         can sends and receives messages to WorkerInspectorControllers.
2764
2765         WorkerGlobalScopes now get a WorkerInspectorController which
2766         will eventually contain its own set of agents. There are no
2767         agents yet, but they will be added individually in follow-up
2768         patches. The Worker side always interacts with the
2769         WorkerGlobalScope on the worker thread. WorkerInspectorController
2770         dispatches messages on its agents.
2771
2772         All communication with Worker agents goes through Worker.sendMessageToWorker,
2773         which tunnels the command request to the Worker's InspectorController
2774         and agents. At the protocol level, worker agent command responses and
2775         worker agent events are sent as events through Worker.dispatchMessageFromWorker.
2776         On the frontend, the message dispatcher code will pair up replies with
2777         their commands, and no-reply messages as events, like normal. So calling
2778         worker agent methods in the frontend will be no different from the
2779         existing callback/promise-based ways.
2780
2781         * CMakeLists.txt:
2782         * WebCore.xcodeproj/project.pbxproj:
2783         * inspector/InspectorAllInOne.cpp:
2784         Add new files.
2785
2786         * bindings/js/WorkerScriptController.cpp:
2787         (WebCore::WorkerScriptController::WorkerScriptController):
2788         (WebCore::WorkerScriptController::initScript):
2789         * bindings/js/WorkerScriptController.h:
2790         Some cleanup.
2791
2792         * inspector/InspectorController.cpp:
2793         (WebCore::InspectorController::InspectorController):
2794         * inspector/InspectorController.h:
2795         * inspector/InstrumentingAgents.cpp:
2796         (WebCore::InstrumentingAgents::reset):
2797         * inspector/InstrumentingAgents.h:
2798         (WebCore::InstrumentingAgents::inspectorWorkerAgent):
2799         (WebCore::InstrumentingAgents::setInspectorWorkerAgent):
2800         * inspector/InspectorInstrumentation.cpp:
2801         (WebCore::InspectorInstrumentation::workerStartedImpl):
2802         (WebCore::InspectorInstrumentation::workerTerminatedImpl):
2803         (WebCore::InspectorInstrumentation::instrumentingAgentsForWorkerGlobalScope):
2804         * inspector/InspectorInstrumentation.h:
2805         (WebCore::InspectorInstrumentation::workerStarted):
2806         (WebCore::InspectorInstrumentation::workerTerminated):
2807         (WebCore::InspectorInstrumentation::instrumentingAgentsForContext):
2808         Give the Page a WorkerAgent and Instrumentation methods for
2809         Worker creation and termination.
2810
2811         * inspector/InspectorWorkerAgent.h: Added.
2812         * inspector/InspectorWorkerAgent.cpp: Added.
2813         (WebCore::InspectorWorkerAgent::InspectorWorkerAgent):
2814         (WebCore::InspectorWorkerAgent::didCreateFrontendAndBackend):
2815         (WebCore::InspectorWorkerAgent::willDestroyFrontendAndBackend):
2816         (WebCore::InspectorWorkerAgent::enable):
2817         (WebCore::InspectorWorkerAgent::disable):
2818         (WebCore::InspectorWorkerAgent::workerStarted):
2819         (WebCore::InspectorWorkerAgent::workerTerminated):
2820         (WebCore::InspectorWorkerAgent::connectToAllWorkerInspectorProxiesForPage):
2821         (WebCore::InspectorWorkerAgent::disconnectFromAllWorkerInspectorProxies):
2822         (WebCore::InspectorWorkerAgent::connectToWorkerInspectorProxy):
2823         (WebCore::InspectorWorkerAgent::disconnectFromWorkerInspectorProxy):
2824         Handle connecting to Workers. This performs the "connectFrontend"
2825         and "disconnectFrontend" dance with each Worker's InspectorController.
2826         We only connect to workers when the Worker domain is enabled.
2827
2828         (WebCore::InspectorWorkerAgent::sendMessageToWorker):
2829         (WebCore::InspectorWorkerAgent::sendMessageFromWorkerToFrontend):
2830         Proxying messages to individual messages happens through the
2831         WorkerInspectorProxy. That takes care of passing messages
2832         across threads for us.
2833
2834         * workers/WorkerInspectorProxy.cpp: Added.
2835         (WebCore::WorkerInspectorProxy::allWorkerInspectorProxies):
2836         (WebCore::WorkerInspectorProxy::WorkerInspectorProxy):
2837         (WebCore::WorkerInspectorProxy::~WorkerInspectorProxy):
2838         (WebCore::WorkerInspectorProxy::workerStarted):
2839         (WebCore::WorkerInspectorProxy::workerTerminated):
2840         (WebCore::WorkerInspectorProxy::connectToWorkerInspector):
2841         (WebCore::WorkerInspectorProxy::disconnectFromWorkerInspector):
2842         (WebCore::WorkerInspectorProxy::sendMessageToWorkerInspector):
2843         (WebCore::WorkerInspectorProxy::sendMessageFromWorkerToFrontend):
2844         * workers/WorkerInspectorProxy.h: Added.
2845         (WebCore::WorkerInspectorProxy::PageChannel::~PageChannel):
2846         (WebCore::WorkerInspectorProxy::url):
2847         (WebCore::WorkerInspectorProxy::identifier):
2848         (WebCore::WorkerInspectorProxy::scriptExecutionContext):
2849         The WorkerInspectorProxy simplifies the cross thread communication
2850         between the Page Inspector and Worker Inspector. It also provides
2851         a clean interface between the two sides.
2852
2853         * inspector/WorkerToPageFrontendChannel.h: Added.
2854         * inspector/WorkerInspectorController.h: Added.
2855         * inspector/WorkerInspectorController.cpp: Added.
2856         (WebCore::WorkerInspectorController::WorkerInspectorController):
2857         (WebCore::WorkerInspectorController::~WorkerInspectorController):
2858         (WebCore::WorkerInspectorController::workerTerminating):
2859         (WebCore::WorkerInspectorController::connectFrontend):
2860         (WebCore::WorkerInspectorController::disconnectFrontend):
2861         (WebCore::WorkerInspectorController::dispatchMessageFromFrontend):
2862         (WebCore::WorkerInspectorController::functionCallHandler):
2863         (WebCore::WorkerInspectorController::evaluateHandler):
2864         (WebCore::WorkerInspectorController::vm):
2865         A basic InspectorController for a WorkerGlobalScope.
2866         No agents yet, they will come soon.
2867
2868         * inspector/WorkerScriptDebugServer.h:
2869         * inspector/WorkerScriptDebugServer.cpp:
2870         (WebCore::WorkerScriptDebugServer::WorkerScriptDebugServer):
2871         (WebCore::WorkerScriptDebugServer::attachDebugger):
2872         (WebCore::WorkerScriptDebugServer::detachDebugger):
2873         (WebCore::WorkerScriptDebugServer::recompileAllJSFunctions):
2874         (WebCore::WorkerScriptDebugServer::runEventLoopWhilePaused):
2875         (WebCore::WorkerScriptDebugServer::reportException):
2876         (WebCore::WorkerScriptDebugServer::interruptAndRunTask):
2877         A basic WorkerScriptDebug server for a WorkerGlobalScope.
2878         Not really used until we implement DebuggerAgent, but needed for InspectorEnvironment.
2879
2880         * workers/WorkerGlobalScope.cpp:
2881         (WebCore::WorkerGlobalScope::WorkerGlobalScope):
2882         * workers/WorkerGlobalScope.h:
2883         (WebCore::WorkerGlobalScope::inspectorController):
2884         Give the WorkerGlobalScope an InspectorController.
2885
2886         * workers/WorkerThread.cpp:
2887         (WebCore::WorkerThread::stop):
2888         Ensure the Worker InspectorController is immediately on
2889         the WorkerThread when it is about to be closed.
2890
2891         * workers/WorkerMessagingProxy.cpp:
2892         (WebCore::WorkerMessagingProxy::WorkerMessagingProxy):
2893         (WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
2894         (WebCore::WorkerMessagingProxy::postMessageToPageInspector):
2895         (WebCore::WorkerMessagingProxy::workerGlobalScopeDestroyedInternal):
2896         (WebCore::WorkerMessagingProxy::terminateWorkerGlobalScope):
2897         * workers/WorkerMessagingProxy.h:
2898         * workers/WorkerReportingProxy.h:
2899         Call into the WorkerInspectorProxy for any inspector related logic,
2900         such as creation, termination, and messages received from the Worker.
2901
2902 2016-10-27  Dave Hyatt  <hyatt@apple.com>
2903
2904         [CSS Parser] Implement CSS variables
2905         https://bugs.webkit.org/show_bug.cgi?id=164075
2906
2907         Reviewed by Dean Jackson.
2908
2909         * CMakeLists.txt:
2910         * WebCore.xcodeproj/project.pbxproj:
2911         Add CSSCustomPropertyValue.cpp to the project.
2912
2913         * css/CSSCustomPropertyValue.cpp: Added.
2914         (WebCore::CSSCustomPropertyValue::checkVariablesForCycles):
2915         (WebCore::CSSCustomPropertyValue::resolveVariableReferences):
2916         * css/CSSCustomPropertyValue.h:
2917         These functions abstract the old and new implementations of CSS
2918         variables so that the callers don't have to worry about it.
2919
2920         * css/CSSValue.cpp:
2921         (WebCore::CSSValue::equals):
2922         Make sure CSSVariableReferenceValue and CSSPendingSubstitutionValue
2923         have equals implemented.
2924
2925         (WebCore::CSSValue::isInvalidCustomPropertyValue): Deleted.
2926         This code was dead and never called.
2927
2928         * css/CSSValue.h:
2929         (WebCore::CSSValue::isCustomPropertyValue):
2930         (WebCore::CSSValue::hasVariableReferences):
2931         Add a helper function for asking if a CSSValue has variable references.
2932         This abstracts the old and new implementations so that callers can
2933         ask if the value has variables without caring which implementation is
2934         being used.
2935
2936         * css/CSSValueList.cpp:
2937         (WebCore::CSSValueList::checkVariablesForCycles):
2938         * css/CSSValueList.h:
2939         In order to abstract the old and new variables implementations, custom
2940         properties now store CSSCustomPropertyValue as their values instead of
2941         raw values. The old implementation needs to be patched to deal with this
2942         wrapper being present now.
2943
2944         * css/CSSVariableData.cpp:
2945         (WebCore::CSSVariableData::checkVariablesForCycles):
2946         (WebCore::CSSVariableData::checkVariablesForCyclesWithRange):
2947         (WebCore::CSSVariableData::resolveVariableFallback):
2948         (WebCore::CSSVariableData::resolveVariableReference):
2949         (WebCore::CSSVariableData::resolveVariableReferences):
2950         (WebCore::CSSVariableData::resolveTokenRange):
2951         * css/CSSVariableData.h:
2952         Implementation of cycle checking and variable resolution. The logic of
2953         this implementation is the same as the old. It walks CSSParserTokens
2954         instead of the old CSSParser structures.
2955
2956         * css/CSSVariableReferenceValue.cpp:
2957         (WebCore::CSSVariableReferenceValue::customCSSText):
2958         Add support for serialization caching, just like the old implementation
2959         had in CSSVariableDependentValue.
2960
2961         (WebCore::CSSVariableReferenceValue::checkVariablesForCycles):
2962         * css/CSSVariableReferenceValue.h:
2963         Add cycle checking and variable resolution helper functions.
2964
2965         * css/CSSVariableValue.cpp:
2966         (WebCore::CSSVariableValue::buildParserValueListSubstitutingVariables):
2967         Patched to account for the change in storage of custom properties to
2968         have custom property value wrappers.
2969
2970         * css/StyleProperties.cpp:
2971         (WebCore::StyleProperties::getPropertyValue):
2972         (WebCore::StyleProperties::borderSpacingValue):
2973         (WebCore::StyleProperties::getLayeredShorthandValue):
2974         (WebCore::StyleProperties::getShorthandValue):
2975         (WebCore::StyleProperties::getCommonValue):
2976         (WebCore::StyleProperties::getPropertyCSSValue):
2977         (WebCore::StyleProperties::asText):
2978         Clean up the resolution of pending substitution values. Instead of hacking
2979         it into every possible StyleShorthandProperty crawling function, obtain
2980         the shorthand for the property up front, access the first longhand, and
2981         if we see a pending substitution value, perform the substitution.
2982
2983         * css/StyleResolver.cpp:
2984         (WebCore::StyleResolver::MatchResult::addMatchedProperties):
2985         (WebCore::StyleResolver::applyProperty):
2986         (WebCore::StyleResolver::resolvedVariableValue):
2987         * css/StyleResolver.h:
2988         Add support for the new implementation in all the same places as the old.
2989
2990         * css/parser/CSSParser.cpp:
2991         (WebCore::CSSParser::parseInlineStyleDeclaration):
2992         (WebCore::CSSParser::parseValueWithVariableReferences):
2993         (WebCore::CSSParser::parseVariableDependentValue): Deleted.
2994         * css/parser/CSSParser.h:
2995         Rename parseVariableDependentValue to parseValueWithVariableReferences,
2996         since it is operating on three distinct value types now. Turn on new
2997         parser support for parseInlineStyleDeclaration.
2998
2999         * css/parser/CSSParserImpl.cpp:
3000         (WebCore::filterProperties):
3001         (WebCore::CSSParserImpl::parseVariableValue): Deleted.
3002         (WebCore::CSSParserImpl::parseCustomPropertySet): Deleted.
3003         * css/parser/CSSParserImpl.h:
3004         Remove parser functions that aren't relevant to our implementation
3005         of CSS variables.
3006
3007         * css/parser/CSSVariableParser.cpp:
3008         (WebCore::classifyVariableRange):
3009         Add support for the CSS4 'revert' keyword to the new variable parser.
3010
3011         * rendering/style/RenderStyle.cpp:
3012         (WebCore::RenderStyle::checkVariablesInCustomProperties):
3013         Modified to store CSSCustomPropertyValues as the values always now and
3014         to use the method abstractions on CSSCustomPropertyValue to resolve
3015         cycles and perform substitutions.
3016
3017         * rendering/style/RenderStyle.h:
3018         (WebCore::RenderStyle::setCustomPropertyValue):
3019         (WebCore::RenderStyle::getCustomPropertyValue):
3020         * rendering/style/StyleCustomPropertyData.h:
3021         (WebCore::StyleCustomPropertyData::operator==):
3022         (WebCore::StyleCustomPropertyData::setCustomPropertyValue):
3023         (WebCore::StyleCustomPropertyData::getCustomPropertyValue):
3024         Tighten up the map to store CSSCustomPropertyValue instead of just
3025         CSSValue.
3026
3027 2016-10-27  Zalan Bujtas  <zalan@apple.com>
3028
3029         RenderMultiColumnFlowThread::processPossibleSpannerDescendant should take RenderObject& instead of RenderObject*
3030         https://bugs.webkit.org/show_bug.cgi?id=164072
3031
3032         Reviewed by Simon Fraser.
3033
3034         No change in functionality.
3035
3036         * rendering/RenderFlowThread.h:
3037         * rendering/RenderMultiColumnFlowThread.cpp:
3038         (WebCore::findSetRendering):
3039         (WebCore::isValidColumnSpanner):
3040         (WebCore::RenderMultiColumnFlowThread::processPossibleSpannerDescendant):
3041         (WebCore::RenderMultiColumnFlowThread::flowThreadDescendantInserted):
3042         (WebCore::RenderMultiColumnFlowThread::findSetRendering): Deleted.
3043         * rendering/RenderMultiColumnFlowThread.h:
3044         * rendering/RenderMultiColumnSet.cpp:
3045         (WebCore::precedesRenderer):
3046         (WebCore::RenderMultiColumnSet::containsRendererInFlowThread):
3047         * rendering/RenderMultiColumnSet.h:
3048         * rendering/RenderMultiColumnSpannerPlaceholder.cpp:
3049         (WebCore::RenderMultiColumnSpannerPlaceholder::createAnonymous):
3050         (WebCore::RenderMultiColumnSpannerPlaceholder::RenderMultiColumnSpannerPlaceholder):
3051         * rendering/RenderMultiColumnSpannerPlaceholder.h:
3052         * rendering/RenderObject.cpp:
3053         (WebCore::RenderObject::insertedIntoTree):
3054
3055 2016-10-27  Brent Fulgham  <bfulgham@apple.com>
3056
3057         Prevent hit tests from being performed on an invalid render tree
3058         https://bugs.webkit.org/show_bug.cgi?id=163877
3059         <rdar://problem/28675761>
3060
3061         Reviewed by Simon Fraser.
3062
3063         Changeset r200971 added code to ensure that layout is up-to-date before hit testing, but did
3064         so only for the main frame. It was still possible to enter cross-frame hit testing with a
3065         subframe needing style recalc. In that situation, the subframe's updateLayout() would get
3066         called, which could trigger a compositing change that marked the parent frame as needing style
3067         recalc. A subsequent layout on the parent frame (for example by hit testing traversing into
3068         a second subframe) could then mutate the parent frame's layer tree while hit testing was
3069         traversing it.
3070         
3071         This patch modifies the hit test logic to ensure that a recursive layout is performed so that
3072         we always perform hit tests on a clean set of frames. It also adds some assertions to warn
3073         us if we encounter this invalid state.
3074
3075         Tested by fast/layers/prevent-hit-test-during-layout.html.
3076
3077         * dom/Document.cpp:
3078         (WebCore::Document::scheduleStyleRecalc): Assert that we are not hit testing
3079         during style recalculation.
3080         * page/EventHandler.cpp:
3081         (WebCore::EventHandler::hitTestResultAtPoint): Ensure that we have a clean render tree
3082         when hit testing.
3083         * page/FrameView.cpp:
3084         (WebCore::FrameView::setNeedsLayout): Assert that we are not in the process of hit testing
3085         when we schedule a layout.
3086         * rendering/RenderView.cpp:
3087         (WebCore::RenderView::hitTest): Mark RenderView as in an active hit test.
3088         * rendering/RenderView.h:
3089
3090 2016-10-27  Zan Dobersek  <zdobersek@igalia.com>
3091
3092         BufferSource should behave as an union
3093         https://bugs.webkit.org/show_bug.cgi?id=164056
3094
3095         Reviewed by Chris Dumez.
3096
3097         WebIDL typedefs BufferSource as (ArrayBufferView or ArrayBuffer).
3098         To follow that definition, IDLBufferSource is now type-aliased
3099         to IDLUnion<IDLInterface<ArrayBufferView>, IDLInterface<ArrayBuffer>>.
3100
3101         Converter<IDLBufferSource> template specialization can now be
3102         removed since the default specialization for IDLUnion will be
3103         used.
3104
3105         C++ implementations still work through a BufferSource object.
3106         That class now has an implicit constructor that consumes the
3107         Variant object. The data() and length() methods on the class
3108         now iterate the variant to find an existing object that can
3109         provide a pointer to the data or the length of it.
3110
3111         * Modules/mediasource/SourceBuffer.cpp:
3112         (WebCore::SourceBuffer::appendBuffer):
3113         * bindings/generic/IDLTypes.h:
3114         * bindings/js/BufferSource.h:
3115         (WebCore::BufferSource::BufferSource):
3116         (WebCore::BufferSource::data):
3117         (WebCore::BufferSource::length):
3118         * bindings/js/JSDOMConvert.h:
3119         (WebCore::Converter<IDLBufferSource>::convert): Deleted.
3120
3121 2016-10-27  Chris Dumez  <cdumez@apple.com>
3122
3123         Merge Element::ShadowRootMode and ShadowRoot::Mode enumerations
3124         https://bugs.webkit.org/show_bug.cgi?id=164063
3125
3126         Reviewed by Sam Weinig.
3127
3128         Merge Element::ShadowRootMode and ShadowRoot::Mode enumerations now
3129         that we support having IDL string enumerations in their own IDL file.
3130
3131         No new tests, no Web-exposed behavior change.
3132
3133         * CMakeLists.txt:
3134         * DerivedSources.cpp:
3135         * DerivedSources.make:
3136         * WebCore.xcodeproj/project.pbxproj:
3137         * css/ElementRuleCollector.cpp:
3138         (WebCore::ElementRuleCollector::collectMatchingRules):
3139         (WebCore::ElementRuleCollector::matchAuthorShadowPseudoElementRules):
3140         (WebCore::ElementRuleCollector::collectMatchingShadowPseudoElementRules):
3141         * css/SelectorChecker.cpp:
3142         (WebCore::SelectorChecker::matchRecursively):
3143         * dom/CustomElementRegistry.cpp:
3144         (WebCore::enqueueUpgradeInShadowIncludingTreeOrder):
3145         * dom/Element.cpp:
3146         (WebCore::Element::bindingsOffsetParent):
3147         (WebCore::Element::addShadowRoot):
3148         (WebCore::Element::attachShadow):
3149         (WebCore::Element::shadowRootForBindings):
3150         (WebCore::Element::userAgentShadowRoot):
3151         (WebCore::Element::ensureUserAgentShadowRoot):
3152         * dom/Element.h:
3153         * dom/Element.idl:
3154         * dom/InlineStyleSheetOwner.cpp:
3155         (WebCore::parserContextForElement):
3156         * dom/Node.cpp:
3157         (WebCore::Node::isUnclosedNode):
3158         (WebCore::Node::assignedSlotForBindings):
3159         (WebCore::Node::isInUserAgentShadowTree):
3160         * dom/ShadowRoot.cpp:
3161         (WebCore::ShadowRoot::ShadowRoot):
3162         * dom/ShadowRoot.h:
3163         * dom/ShadowRoot.idl:
3164         * dom/ShadowRootMode.h: Added.
3165         * dom/ShadowRootMode.idl: Copied from Source/WebCore/dom/ShadowRoot.idl.
3166         * dom/SlotAssignment.cpp:
3167         (WebCore::SlotAssignment::didChangeSlot):
3168         * html/HTMLSummaryElement.cpp:
3169         (WebCore::HTMLSummaryElement::create):
3170         * inspector/InspectorDOMAgent.cpp:
3171         (WebCore::shadowRootType):
3172         * rendering/HitTestResult.cpp:
3173         (WebCore::moveOutOfUserAgentShadowTree):
3174         * rendering/RenderElement.cpp:
3175         (WebCore::RenderElement::selectionPseudoStyle):
3176         * rendering/RenderLayer.cpp:
3177         (WebCore::rendererForScrollbar):
3178         * style/StyleScope.cpp:
3179         (WebCore::Style::Scope::shouldUseSharedUserAgentShadowTreeStyleResolver):
3180         (WebCore::Style::Scope::didChangeStyleSheetEnvironment):
3181         * svg/SVGElement.cpp:
3182         (WebCore::SVGElement::correspondingUseElement):
3183         * testing/Internals.cpp:
3184         (WebCore::Internals::shadowRootType):
3185
3186 2016-10-27  Chris Dumez  <cdumez@apple.com>
3187
3188         Element parameter to CanvasRenderingContext2D.drawFocusIfNeeded() should not be nullable
3189         https://bugs.webkit.org/show_bug.cgi?id=164062
3190
3191         Reviewed by Darin Adler.
3192
3193         Element parameter to CanvasRenderingContext2D.drawFocusIfNeeded() should not be nullable:
3194         - https://html.spec.whatwg.org/#canvasuserinterface
3195
3196         Firefox and Chrome agree with the specification.
3197
3198         Test: fast/canvas/draw-focus-if-needed-null-element.html
3199
3200         * html/canvas/CanvasRenderingContext2D.cpp:
3201         (WebCore::CanvasRenderingContext2D::drawFocusIfNeeded):
3202         (WebCore::CanvasRenderingContext2D::drawFocusIfNeededInternal):
3203         * html/canvas/CanvasRenderingContext2D.h:
3204         * html/canvas/CanvasRenderingContext2D.idl:
3205
3206 2016-10-27  Yusuke Suzuki  <utatane.tea@gmail.com>
3207
3208         [DOMJIT][CSSJIT] Share code with DOMJIT
3209         https://bugs.webkit.org/show_bug.cgi?id=164006
3210
3211         Reviewed by Mark Lam.
3212
3213         Move CSSJIT's getDocument function to DOMJIT and share it with DOMJIT.
3214         And rename it to "loadDocument", it is closer name to the JSC's convention.
3215
3216         No behavior change.
3217
3218         * cssjit/SelectorCompiler.cpp:
3219         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateSpecialFailureInQuirksModeForActiveAndHoverIfNeeded):
3220         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeValueExactMatching):
3221         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementHasTagName):
3222         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsRoot):
3223         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsScopeRoot):
3224         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsTarget):
3225         (WebCore::SelectorCompiler::getDocument): Deleted.
3226         * domjit/DOMJITHelpers.h:
3227         (WebCore::DOMJIT::loadDocument):
3228         * domjit/JSNodeDOMJIT.cpp:
3229         (WebCore::NodeOwnerDocumentDOMJIT::callDOM):
3230
3231 2016-10-27  Youenn Fablet  <youenn@apple.com>
3232
3233         REGRESSION(r207753-207755): ASSERTION FAILED: m_parsedStyleSheetCache->isInMemoryCache()
3234         https://bugs.webkit.org/show_bug.cgi?id=163905
3235
3236         Reviewed by Antti Koivisto.
3237
3238         Covered by existing tests and http/tests/security/cached-cross-origin-shared-css-stylesheet.html
3239
3240         Small refactoring to do more member fields initialization in StyleSheetContents header.
3241         Refactored StyleSheetContents::m_isInMemoryCache to be a counter instead of a boolean.
3242         This allows StyleSheetContents to be linked to several CachedCSSStyleSheets.
3243
3244         * css/StyleSheetContents.cpp:
3245         (WebCore::StyleSheetContents::StyleSheetContents):
3246         (WebCore::StyleSheetContents::addedToMemoryCache):
3247         (WebCore::StyleSheetContents::removedFromMemoryCache):
3248         * css/StyleSheetContents.h:
3249         * loader/cache/CachedCSSStyleSheet.cpp:
3250         (WebCore::CachedCSSStyleSheet::setBodyDataFrom): Making reuse of saveParsedStyleSheet to handle update of StyleSheetContents cache count.
3251
3252 2016-10-27  Sergio Villar Senin  <svillar@igalia.com>
3253
3254         Unreviewed. Build fix for gcc.
3255
3256         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
3257         (WebCore::MediaPlayerPrivateGStreamerMSE::maxTimeSeekable):
3258
3259 2016-10-27  Youenn Fablet  <youenn@apple.com>
3260
3261         MediaPayload does not need to be refcounted
3262         https://bugs.webkit.org/show_bug.cgi?id=164015
3263
3264         Reviewed by Eric Carlson.
3265
3266         No change of behavior.
3267         Making MediaPayload a struct and no-longer ref-counted.
3268         Small performance improvements in MediaEndpointOwr.
3269
3270         * Modules/mediastream/MediaEndpointPeerConnection.h:
3271         * Modules/mediastream/SDPProcessor.cpp:
3272         (WebCore::configurationFromJSON):
3273         (WebCore::configurationToJSON):
3274         * platform/mediastream/MediaEndpoint.h:
3275         * platform/mediastream/MediaPayload.h:
3276         (WebCore::MediaPayload::addParameter):
3277         (WebCore::MediaPayload::create): Deleted.
3278         (WebCore::MediaPayload::~MediaPayload): Deleted.
3279         (WebCore::MediaPayload::type): Deleted.
3280         (WebCore::MediaPayload::setType): Deleted.
3281         (WebCore::MediaPayload::encodingName): Deleted.
3282         (WebCore::MediaPayload::setEncodingName): Deleted.
3283         (WebCore::MediaPayload::clockRate): Deleted.
3284         (WebCore::MediaPayload::setClockRate): Deleted.
3285         (WebCore::MediaPayload::channels): Deleted.
3286         (WebCore::MediaPayload::setChannels): Deleted.
3287         (WebCore::MediaPayload::ccmfir): Deleted.
3288         (WebCore::MediaPayload::setCcmfir): Deleted.
3289         (WebCore::MediaPayload::nackpli): Deleted.
3290         (WebCore::MediaPayload::setNackpli): Deleted.
3291         (WebCore::MediaPayload::nack): Deleted.
3292         (WebCore::MediaPayload::setNack): Deleted.
3293         (WebCore::MediaPayload::parameters): Deleted.
3294         (WebCore::MediaPayload::clone): Deleted.
3295         (WebCore::MediaPayload::MediaPayload): Deleted.
3296         * platform/mediastream/PeerMediaDescription.h:
3297         (WebCore::PeerMediaDescription::payloads):
3298         (WebCore::PeerMediaDescription::addPayload):
3299         (WebCore::PeerMediaDescription::setPayloads):
3300         (WebCore::PeerMediaDescription::clone):
3301         * platform/mediastream/openwebrtc/MediaEndpointOwr.cpp:
3302         (WebCore::MediaEndpointOwr::getDefaultAudioPayloads):
3303         (WebCore::MediaEndpointOwr::getDefaultVideoPayloads):
3304         (WebCore::MediaEndpointOwr::filterPayloads):
3305         * platform/mock/MockMediaEndpoint.cpp:
3306         (WebCore::MockMediaEndpoint::getDefaultAudioPayloads):
3307         (WebCore::MockMediaEndpoint::getDefaultVideoPayloads):
3308         (WebCore::MockMediaEndpoint::filterPayloads):
3309
3310 2016-10-26  Dan Bernstein  <mitz@apple.com>
3311
3312         Improved the last build fix.
3313
3314         Darin pointed out I could have kept the function inline and just removed the WEBCORE_EXPORT.
3315
3316         * Modules/mediastream/UserMediaRequest.cpp:
3317         (WebCore::UserMediaRequest::document): Deleted.
3318         * Modules/mediastream/UserMediaRequest.h:
3319         (WebCore::UserMediaRequest::document):
3320
3321 2016-10-26  Chris Dumez  <cdumez@apple.com>
3322
3323         [Web IDL] Add support for having string enumerations in their own IDL file
3324         https://bugs.webkit.org/show_bug.cgi?id=164025
3325
3326         Reviewed by Darin Adler.
3327
3328         Add support for having string enumerations in their own IDL file to facilitate
3329         sharing them. Use this new support to implement IDBTransactionMode enumeration
3330         for IndexedDB:
3331         - https://www.w3.org/TR/IndexedDB/#idl-def-IDBTransactionMode
3332
3333         No new tests, rebaselined existing tests.
3334
3335         * CMakeLists.txt:
3336         * DerivedSources.cpp:
3337         * DerivedSources.make:
3338         * Modules/indexeddb/IDBDatabase.cpp:
3339         (WebCore::IDBDatabase::transaction):
3340         (WebCore::IDBDatabase::startVersionChangeTransaction):
3341         * Modules/indexeddb/IDBDatabase.h:
3342         * Modules/indexeddb/IDBDatabase.idl:
3343         * Modules/indexeddb/IDBOpenDBRequest.cpp:
3344         (WebCore::IDBOpenDBRequest::onUpgradeNeeded):
3345         * Modules/indexeddb/IDBTransaction.cpp:
3346         (WebCore::IDBTransaction::IDBTransaction):
3347         * Modules/indexeddb/IDBTransaction.h:
3348         (WebCore::IDBTransaction::mode):
3349         (WebCore::IDBTransaction::isVersionChange):
3350         (WebCore::IDBTransaction::isReadOnly):
3351         * Modules/indexeddb/IDBTransaction.idl:
3352         * Modules/indexeddb/IDBTransactionMode.h: Added.
3353         * Modules/indexeddb/IDBTransactionMode.idl: Copied from Source/WebCore/Modules/indexeddb/IDBTransaction.idl.
3354         * Modules/indexeddb/IndexedDB.h:
3355         * Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
3356         (WebCore::IDBServer::MemoryBackingStoreTransaction::MemoryBackingStoreTransaction):
3357         (WebCore::IDBServer::MemoryBackingStoreTransaction::objectStoreRenamed):
3358         (WebCore::IDBServer::MemoryBackingStoreTransaction::indexRenamed):
3359         (WebCore::IDBServer::MemoryBackingStoreTransaction::abort):
3360         * Modules/indexeddb/server/MemoryBackingStoreTransaction.h:
3361         (WebCore::IDBServer::MemoryBackingStoreTransaction::isVersionChange):
3362         (WebCore::IDBServer::MemoryBackingStoreTransaction::isWriting):
3363         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
3364         (WebCore::IDBServer::SQLiteIDBBackingStore::beginTransaction):
3365         (WebCore::IDBServer::SQLiteIDBBackingStore::abortTransaction):
3366         (WebCore::IDBServer::SQLiteIDBBackingStore::commitTransaction):
3367         (WebCore::IDBServer::SQLiteIDBBackingStore::createObjectStore):
3368         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteObjectStore):
3369         (WebCore::IDBServer::SQLiteIDBBackingStore::renameObjectStore):
3370         (WebCore::IDBServer::SQLiteIDBBackingStore::clearObjectStore):
3371         (WebCore::IDBServer::SQLiteIDBBackingStore::createIndex):
3372         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteIndex):
3373         (WebCore::IDBServer::SQLiteIDBBackingStore::renameIndex):
3374         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteRecord):
3375         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteRange):
3376         (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord):
3377         (WebCore::IDBServer::SQLiteIDBBackingStore::generateKeyNumber):
3378         (WebCore::IDBServer::SQLiteIDBBackingStore::revertGeneratedKeyNumber):
3379         (WebCore::IDBServer::SQLiteIDBBackingStore::maybeUpdateKeyGeneratorNumber):
3380         * Modules/indexeddb/server/SQLiteIDBTransaction.cpp:
3381         (WebCore::IDBServer::SQLiteIDBTransaction::begin):
3382         * Modules/indexeddb/server/SQLiteIDBTransaction.h:
3383         (WebCore::IDBServer::SQLiteIDBTransaction::mode):
3384         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
3385         (WebCore::IDBServer::UniqueIDBDatabase::enqueueTransaction):
3386         (WebCore::IDBServer::UniqueIDBDatabase::takeNextRunnableTransaction):
3387         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
3388         (WebCore::IDBServer::UniqueIDBDatabaseConnection::establishTransaction):
3389         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
3390         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::UniqueIDBDatabaseTransaction):
3391         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::originalDatabaseInfo):
3392         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::isVersionChange):
3393         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::isReadOnly):
3394         * Modules/indexeddb/shared/IDBTransactionInfo.cpp:
3395         (WebCore::IDBTransactionInfo::clientTransaction):
3396         (WebCore::IDBTransactionInfo::versionChange):
3397         (WebCore::IDBTransactionInfo::loggingString):
3398         * Modules/indexeddb/shared/IDBTransactionInfo.h:
3399         (WebCore::IDBTransactionInfo::mode):
3400         * WebCore.xcodeproj/project.pbxproj:
3401         * bindings/scripts/CodeGenerator.pm:
3402         (ProcessDocument):
3403         (IsEnumType):
3404         (GetEnumByName):
3405         (IsExternalEnumType):
3406         (ValidEnumValues):
3407         * bindings/scripts/CodeGeneratorJS.pm:
3408         (GenerateEnumeration):
3409         (AddToImplIncludesForIDLType):
3410         (GetEnumerationClassName):
3411         (GenerateEnumerationHeader):
3412         (GenerateEnumerationImplementation):
3413         (GenerateEnumerationImplementationContent):
3414         (GenerateEnumerationsImplementationContent):
3415         (GenerateEnumerationHeaderContent):
3416         (GenerateEnumerationsHeaderContent):
3417         * bindings/scripts/test/JS/JSTestObj.cpp:
3418         (WebCore::jsTestObjPrototypeFunctionMethodWithEnumArgCaller):
3419         (WebCore::jsTestObjPrototypeFunctionMethodWithStandaloneEnumArg):
3420         (WebCore::jsTestObjPrototypeFunctionMethodWithStandaloneEnumArgCaller):
3421         * bindings/scripts/test/JS/JSTestStandaloneEnumeration.cpp: Added.
3422         (WebCore::convertEnumerationToJS):
3423         (WebCore::parseEnumeration<TestStandaloneEnumeration>):
3424         (WebCore::convertEnumeration<TestStandaloneEnumeration>):
3425         (WebCore::expectedEnumerationValues<TestStandaloneEnumeration>):
3426         * bindings/scripts/test/JS/JSTestStandaloneEnumeration.h: Added.
3427         * bindings/scripts/test/TestObj.idl:
3428         * bindings/scripts/test/TestStandaloneEnumeration.idl: Copied from Source/WebCore/Modules/indexeddb/IDBTransaction.idl.
3429         * inspector/InspectorIndexedDBAgent.cpp:
3430
3431 2016-10-26  Dan Bernstein  <mitz@apple.com>
3432
3433         Fixed the WebKit2 build.
3434
3435         * Modules/mediastream/UserMediaRequest.cpp:
3436         (WebCore::UserMediaRequest::document): Moved the definition of this function to here from…
3437         * Modules/mediastream/UserMediaRequest.h:
3438         (WebCore::UserMediaRequest::document): …here, so that the WebKit2 build doesn’t encounter an
3439           exported inline function.
3440
3441 2016-10-26  Yusuke Suzuki  <utatane.tea@gmail.com>
3442
3443         [DOMJIT] Implement Node::ownerDocument
3444         https://bugs.webkit.org/show_bug.cgi?id=164004
3445
3446         Reviewed by Darin Adler.
3447
3448         Test: js/dom/domjit-accessor-owner-document.html
3449
3450         Implement Node.ownerDocument DOMJIT accessor.
3451         According to the result of the profiler, jQuery's prop()
3452         function is frequently called in Ember.js SpeedoMeter.
3453         And this function calls jQuery.isXMLDoc(). And this isXMLDoc()
3454         function calls element.ownerDocument accessor. And our WebKit
3455         inspector also uses ownerDocument accessor frequently.
3456
3457         Interesting thing is this ownerDocument functionality is used
3458         in CSSJIT, so CSSJIT has similar helper function to look up the
3459         owner document of the element. As a result, all the necessary
3460         functionality is already implemented, DOMJIT just utilizes it.
3461         For example, Node::treeScopeMemoryOffset() and
3462         TreeScope::documentScopeMemoryOffset() is implemented before this
3463         patch.
3464
3465         In the future, we will convert CSSJIT's Assembler& to CCallHelpers&
3466         and share the code with DOMJIT[1].
3467
3468         [1]: https://bugs.webkit.org/show_bug.cgi?id=164006
3469
3470         * dom/Node.idl:
3471         * domjit/DOMJITAbstractHeapRepository.h:
3472         * domjit/JSNodeDOMJIT.cpp:
3473         (WebCore::NodeOwnerDocumentDOMJIT::checkDOM):
3474         (WebCore::NodeOwnerDocumentDOMJIT::callDOM):
3475
3476 2016-10-26  Chris Dumez  <cdumez@apple.com>
3477
3478         Replace IDBKeyPath with a WTF::Variant
3479         https://bugs.webkit.org/show_bug.cgi?id=163909
3480
3481         Reviewed by Darin Adler.
3482
3483         Replace IDBKeyPath class with the IDBKeyPathVariant type entirely
3484         and rename IDBKeyPathVariant to IDBKeyPath.
3485
3486         Unfortunately, IDBKeyPath still needs some special handling when
3487         returned to the JavaScript because we do not have a toJS() accepting
3488         a WTF::Variant as input yet.
3489
3490         There should be no significant behavior change except that
3491         IDBIndex.keyPath / IDBObjectStore.keyPath now returns an array of
3492         Strings instead of a DOMStringList object when the IDBKeyPath
3493         contains a vector. This is a progression and matches the
3494         specification:
3495         - https://www.w3.org/TR/IndexedDB/#widl-IDBIndex-keyPath
3496         - https://www.w3.org/TR/IndexedDB/#widl-IDBObjectStore-keyPath
3497
3498         No new tests, rebaselined existing tests.
3499
3500         * Modules/indexeddb/IDBCursor.cpp:
3501         (WebCore::IDBCursor::update):
3502         * Modules/indexeddb/IDBDatabase.h:
3503         * Modules/indexeddb/IDBGetResult.cpp:
3504         (WebCore::IDBGetResult::isolatedCopy):
3505         * Modules/indexeddb/IDBKeyPath.cpp:
3506         (WebCore::isIDBKeyPathValid):
3507         (WebCore::IDBKeyPathIsolatedCopy):
3508         * Modules/indexeddb/IDBKeyPath.h:
3509         (WebCore::IDBKeyPathIsolatedCopy):
3510         * Modules/indexeddb/IDBObjectStore.cpp:
3511         (WebCore::IDBObjectStore::keyPath):
3512         (WebCore::IDBObjectStore::putOrAdd):
3513         (WebCore::IDBObjectStore::createIndex):
3514         * Modules/indexeddb/IDBObjectStore.h:
3515         * Modules/indexeddb/server/IDBSerialization.cpp:
3516         (WebCore::serializeIDBKeyPath):
3517         (WebCore::deserializeIDBKeyPath):
3518         * Modules/indexeddb/server/IDBSerialization.h:
3519         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
3520         (WebCore::IDBServer::SQLiteIDBBackingStore::extractExistingDatabaseInfo):
3521         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
3522         (WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd):
3523         * Modules/indexeddb/shared/IDBDatabaseInfo.cpp:
3524         (WebCore::IDBDatabaseInfo::createNewObjectStore):
3525         * Modules/indexeddb/shared/IDBDatabaseInfo.h:
3526         * Modules/indexeddb/shared/IDBIndexInfo.cpp:
3527         (WebCore::IDBIndexInfo::IDBIndexInfo):
3528         (WebCore::IDBIndexInfo::isolatedCopy):
3529         * Modules/indexeddb/shared/IDBIndexInfo.h:
3530         * Modules/indexeddb/shared/IDBObjectStoreInfo.cpp:
3531         (WebCore::IDBObjectStoreInfo::IDBObjectStoreInfo):
3532         (WebCore::IDBObjectStoreInfo::createNewIndex):
3533         (WebCore::IDBObjectStoreInfo::isolatedCopy):
3534         * Modules/indexeddb/shared/IDBObjectStoreInfo.h:
3535         (WebCore::IDBObjectStoreInfo::keyPath):
3536         * bindings/js/IDBBindingUtilities.cpp:
3537         (WebCore::injectIDBKeyIntoScriptValue):
3538         (WebCore::maybeCreateIDBKeyFromScriptValueAndKeyPath):
3539         (WebCore::canInjectIDBKeyIntoScriptValue):
3540         (WebCore::createKeyPathArray):
3541         (WebCore::toJS):
3542         * bindings/js/IDBBindingUtilities.h:
3543         * inspector/InspectorIndexedDBAgent.cpp:
3544
3545 2016-10-26  Zalan Bujtas  <zalan@apple.com>
3546
3547         Ignore out-of-flow siblings when searching for a spanner candidate.
3548         https://bugs.webkit.org/show_bug.cgi?id=164042.
3549         <rdar://problem/28758456>
3550
3551         Reviewed by Simon Fraser.
3552
3553         While searching for the spanner candidates in a flow thread, we have to take into account
3554         whether renderers are in- or out-of-flow.
3555         What it means is that while traversing the renderer tree to find the the candidate
3556         renderer (next sibling/ancestor's next child in pre-order traversal), we have to check if the candidate
3557         is in the same layout context too.
3558
3559         Test: fast/multicol/crash-when-spanner-candidate-is-out-of-flow.html
3560
3561         * rendering/RenderMultiColumnFlowThread.cpp:
3562         (WebCore::spannerPlacehoderCandidate):
3563         (WebCore::RenderMultiColumnFlowThread::processPossibleSpannerDescendant):
3564
3565 2016-10-26  Brian Burg  <bburg@apple.com>
3566
3567         Web Inspector: remove unused bool return value from FrontendChannel::sendMessageToFrontend
3568         https://bugs.webkit.org/show_bug.cgi?id=164046
3569
3570         Reviewed by Joseph Pecoraro.
3571
3572         * inspector/InspectorClient.cpp:
3573         (WebCore::InspectorClient::doDispatchMessageOnFrontendPage):
3574         * inspector/InspectorClient.h:
3575         * testing/Internals.cpp:
3576         (WebCore::InspectorStubFrontend::sendMessageToFrontend):
3577
3578 2016-10-26  Chris Dumez  <cdumez@apple.com>
3579
3580         The URLSearchParams constructor should take a union in parameter
3581         https://bugs.webkit.org/show_bug.cgi?id=163906
3582
3583         Reviewed by Darin Adler.
3584
3585         The URLSearchParams constructor should take a union in parameter:
3586         - https://url.spec.whatwg.org/#urlsearchparams
3587
3588         No new tests, no web-exposed behavior change.
3589
3590         * html/URLSearchParams.h:
3591         (WebCore::URLSearchParams::create):
3592         * html/URLSearchParams.idl:
3593
3594 2016-10-26  Sam Weinig  <sam@webkit.org>
3595
3596         [WebIDL] Move more string conversions over to JSDOMConvert
3597         https://bugs.webkit.org/show_bug.cgi?id=164021
3598
3599         Reviewed by Tim Horton.
3600
3601         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
3602         (WebCore::JSCSSStyleDeclaration::putDelegate):
3603         * bindings/js/JSDOMWindowCustom.cpp:
3604         (WebCore::JSDOMWindow::open):
3605         (WebCore::JSDOMWindow::showModalDialog):
3606         (WebCore::handlePostMessage):
3607         * bindings/js/JSHTMLCanvasElementCustom.cpp:
3608         (WebCore::JSHTMLCanvasElement::toDataURL):
3609         * bindings/js/JSHistoryCustom.cpp:
3610         (WebCore::JSHistory::pushState):
3611         (WebCore::JSHistory::replaceState):
3612         Switch to convert functions.
3613
3614         * bindings/js/JSApplePaySessionCustom.cpp:
3615         (WebCore::JSApplePaySession::completeShippingMethodSelection):
3616         (WebCore::JSApplePaySession::completeShippingContactSelection):
3617         * bindings/js/JSCryptoAlgorithmDictionary.cpp:
3618         (WebCore::createAesKeyGenParams):
3619         (WebCore::createRsaKeyGenParams):
3620         * bindings/js/JSDocumentCustom.cpp:
3621         (WebCore::JSDocument::getCSSCanvasContext):
3622         * bindings/js/JSMockContentFilterSettingsCustom.cpp:
3623         (WebCore::JSMockContentFilterSettings::setDecisionPoint):
3624         (WebCore::toDecision):
3625         * bindings/js/JSNodeFilterCustom.cpp:
3626         (WebCore::JSNodeFilter::acceptNode):
3627         * bindings/js/JSDOMBinding.cpp:
3628         (WebCore::toSmallerInt):
3629         (WebCore::toSmallerUInt):
3630         (WebCore::toInt8EnforceRange):
3631         (WebCore::toUInt8EnforceRange):
3632         (WebCore::toInt8Clamp):
3633         (WebCore::toUInt8Clamp):
3634         (WebCore::toInt8):
3635         (WebCore::toUInt8):
3636         (WebCore::toInt16EnforceRange):
3637         (WebCore::toUInt16EnforceRange):
3638         (WebCore::toInt16Clamp):
3639         (WebCore::toUInt16Clamp):
3640         (WebCore::toInt16):
3641         (WebCore::toUInt16):
3642         Use updated IntegerConversionConfiguration naming.
3643
3644         (WebCore::valueToStringTreatingNullAsEmptyString): Deleted.
3645         (WebCore::valueToStringWithUndefinedOrNullCheck): Deleted.
3646         (WebCore::valueToUSVStringTreatingNullAsEmptyString): Deleted.
3647         (WebCore::valueToUSVStringWithUndefinedOrNullCheck): Deleted.
3648         * bindings/js/JSDOMBinding.h:
3649         Remove unused functions.
3650
3651         * bindings/js/JSDOMConvert.h:
3652         (WebCore::convert):
3653         Add StringConversionConfiguration, to match IntegerConversionConfiguration which moved here,
3654         and make them both enum classes. Remove SFINAE based overloading of convert<>, which is not
3655         needed if we get rid of the default parameter, which we can, since the two parameter convert
3656         routes to the right place.
3657
3658         (WebCore::Converter<IDLNullable<T>>::convert):
3659         Add overloads converts that take a Integer/String configuration.
3660
3661         (WebCore::Converter<IDLByte>::convert):
3662         (WebCore::Converter<IDLOctet>::convert):
3663         (WebCore::Converter<IDLShort>::convert):
3664         (WebCore::Converter<IDLUnsignedShort>::convert):
3665         (WebCore::Converter<IDLLong>::convert):
3666         (WebCore::Converter<IDLUnsignedLong>::convert):
3667         (WebCore::Converter<IDLLongLong>::convert):
3668         (WebCore::Converter<IDLUnsignedLongLong>::convert):
3669         Use updated IntegerConversionConfiguration naming.
3670
3671         (WebCore::Converter<IDLDOMString>::convert):
3672         (WebCore::Converter<IDLUSVString>::convert):
3673         Add a configuration parameter, similar to the one used for integers
3674         that changes the behavior of string conversions to return an empty
3675         string for null.
3676
3677         * bindings/js/JSDOMIterator.h:
3678         (WebCore::iteratorCreate):
3679         (WebCore::IteratorTraits>::asJS):
3680         (WebCore::appendForEachArguments):
3681         Simplify a bit by extracting the SFINAE helpers into a EnableIfMap and EnableIfSet.
3682
3683         * bindings/scripts/CodeGeneratorJS.pm:
3684         (GetIntegerConversionConfiguration):
3685         (GetStringConversionConfiguration):
3686         (JSValueToNativeIsHandledByDOMConvert):
3687         (JSValueToNative):
3688         Add support for converting more string types and passing the StringConversionConfiguration.
3689
3690 2016-10-26  Dan Bernstein  <mitz@apple.com>
3691
3692         When pasting web archive, width specifiers in srcset attribute change into density specifiers
3693         https://bugs.webkit.org/show_bug.cgi?id=164027
3694         <rdar://problem/28964948>
3695
3696         Reviewed by Tim Horton.
3697
3698         Updated editing/pasteboard/img-srcset-copy-paste-canonicalization.html.
3699
3700         * html/HTMLImageElement.cpp:
3701         (WebCore::HTMLImageElement::completeURLsInAttributeValue): Use 'w' when writing out a width
3702           specifier.
3703
3704 2016-10-26  Antoine Quint  <graouts@apple.com>
3705
3706         [Modern Media Controls] Media Controller: playback support
3707         https://bugs.webkit.org/show_bug.cgi?id=163678
3708         <rdar://problem/27989479>
3709
3710         Reviewed by Dean Jackson.
3711
3712         We introduce the PlaybackSupport class which brings support for playing and pausing
3713         the media by clicking on the play/pause button in the media controls and correctly
3714         reflecting the media's playback state as the media is played or paused via the media API.
3715
3716         * Modules/modern-media-controls/js-files:
3717         * Modules/modern-media-controls/media/media-controller.js:
3718         (MediaController):
3719         * Modules/modern-media-controls/media/playback-support.js: Copied from Source/WebCore/Modules/modern-media-controls/media/media-controller.js.
3720         (PlaybackSupport.prototype.get control):
3721         (PlaybackSupport.prototype.get mediaEvents):
3722         (PlaybackSupport.prototype.buttonWasClicked):
3723         (PlaybackSupport.prototype.syncControl):
3724         (PlaybackSupport):
3725         * WebCore.xcodeproj/project.pbxproj:
3726
3727 2016-10-26  Chris Dumez  <cdumez@apple.com>
3728
3729         Regression(r203848): 百度糯米 app fails to load content due to a JavaScript error
3730         https://bugs.webkit.org/show_bug.cgi?id=163967
3731         <rdar://problem/28707838>
3732
3733         Reviewed by Ryosuke Niwa.
3734
3735         Add quirk for 百度糯米 app making the 2 last parameters to Event.prototype.initEvent()
3736         optional.
3737
3738         No new tests, change only impacts this specific application.
3739
3740         * bindings/scripts/CodeGeneratorJS.pm:
3741         (GeneratePropertiesHashTable):
3742         * dom/Event.cpp:
3743         (WebCore::Event::initEventForBindings):
3744         * dom/Event.h:
3745         * dom/Event.idl:
3746         * platform/RuntimeApplicationChecks.h:
3747         * platform/RuntimeApplicationChecks.mm:
3748         (WebCore::IOSApplication::isBaiduNuomi):
3749
3750 2016-10-26  Chris Dumez  <cdumez@apple.com>
3751
3752         First parameter to TextTrack.addCue() / removeCue() should not be nullable
3753         https://bugs.webkit.org/show_bug.cgi?id=164020
3754
3755         Reviewed by Eric Carlson.
3756
3757         First parameter to TextTrack.addCue() / removeCue() should not be nullable:
3758         - https://html.spec.whatwg.org/#texttrack
3759
3760         Firefox and Chrome agree with the specification.
3761
3762         Test: media/track/texttrack-addCue-null.html
3763
3764         * html/track/InbandDataTextTrack.cpp:
3765         (WebCore::InbandDataTextTrack::removeDataCue):
3766         (WebCore::InbandDataTextTrack::removeCue):
3767         * html/track/InbandDataTextTrack.h:
3768         * html/track/InbandGenericTextTrack.cpp:
3769         (WebCore::InbandGenericTextTrack::addGenericCue):
3770         (WebCore::InbandGenericTextTrack::removeGenericCue):
3771         (WebCore::InbandGenericTextTrack::removeCue):
3772         * html/track/InbandGenericTextTrack.h:
3773         * html/track/TextTrack.cpp:
3774         (WebCore::TextTrack::addCue):
3775         (WebCore::TextTrack::removeCue):
3776         * html/track/TextTrack.h:
3777         * html/track/TextTrack.idl:
3778
3779 2016-10-26  Antoine Quint  <graouts@apple.com>
3780
3781         [Modern Media Controls] Media Controller: elapsed and remaining time support
3782         https://bugs.webkit.org/show_bug.cgi?id=163679
3783         <rdar://problem/28851675>
3784
3785         Reviewed by Dean Jackson.
3786
3787         We introduce the ElapsedTimeSupport and RemainingTimeSupport classes which bring
3788         support for displaying the elapsed and remaining time in the time control.
3789
3790         Tests: media/modern-media-controls/elapsed-time-support/elapsed-time-support.html
3791                media/modern-media-controls/remaining-time-support/remaining-time-support.html
3792
3793         * Modules/modern-media-controls/js-files:
3794         * Modules/modern-media-controls/media/elapsed-time-support.js: Added.
3795         (ElapsedTimeSupport.prototype.get control):
3796         (ElapsedTimeSupport.prototype.get mediaEvents):
3797         (ElapsedTimeSupport.prototype.syncControl):
3798         (ElapsedTimeSupport):
3799         * Modules/modern-media-controls/media/media-controller.js:
3800         (MediaController):
3801         * Modules/modern-media-controls/media/remaining-time-support.js: Added.
3802         (RemainingTimeSupport.prototype.get control):
3803         (RemainingTimeSupport.prototype.get mediaEvents):
3804         (RemainingTimeSupport.prototype.syncControl):
3805         (RemainingTimeSupport):
3806         * WebCore.xcodeproj/project.pbxproj:
3807
3808 2016-10-26  Dave Hyatt  <hyatt@apple.com>
3809
3810         [CSS Parser] Unify CSSCustomPropertyValue and CSSCustomPropertyDeclaration
3811         https://bugs.webkit.org/show_bug.cgi?id=164019
3812
3813         Reviewed by Zalan Bujtas.
3814
3815         * CMakeLists.txt:
3816         * WebCore.xcodeproj/project.pbxproj:
3817         * css/CSSCustomPropertyDeclaration.cpp: Removed.
3818         * css/CSSCustomPropertyDeclaration.h: Removed.
3819         Get rid of CSSCustomPropertyDeclaration.
3820
3821         * css/CSSCustomPropertyValue.h:
3822         Add new constructors to handle the new variable data format (either a CSSValueId or a
3823         CSSVariableData object that holds parser tokens).
3824
3825         * css/CSSValue.cpp:
3826         (WebCore::CSSValue::cssText):
3827         (WebCore::CSSValue::destroy):
3828         * css/CSSValue.h:
3829         (WebCore::CSSValue::isCustomPropertyDeclaration): Deleted.
3830         Get rid of CSSCustomPropertyDeclaration cases.
3831
3832         * css/CSSVariableData.h:
3833         Switch to CSSCustomPropertyValue.
3834
3835         * css/StyleResolver.cpp:
3836         (WebCore::StyleResolver::applyProperty):
3837         We've renamed the old parser variable data to deprecatedValue to make it clear it's going
3838         to be removed eventually.
3839
3840         * css/parser/CSSParserImpl.cpp:
3841         (WebCore::filterProperties):
3842         (WebCore::CSSParserImpl::consumeVariableValue):
3843         * css/parser/CSSVariableParser.cpp:
3844         (WebCore::CSSVariableParser::parseDeclarationValue):
3845         * css/parser/CSSVariableParser.h:
3846         Switch to CSSCustomPropertyValue.
3847
3848 2016-10-26  Youenn Fablet  <youenn@apple.com>
3849
3850         Enable SDPProcessor for Mac bots
3851         https://bugs.webkit.org/show_bug.cgi?id=163940
3852
3853         Reviewed by Eric Carlson.
3854
3855         Covered by activated tests.
3856
3857         Activating processing of SDPProcessor scripts for Mac bots.
3858         Moving platform/mediastream/openwebrtc/SDPProcessorScriptResource.cpp to platform/mediastream/SDPProcessorScriptResource.cpp.
3859         This file is not tied to openwebrtc and allows retrieving the SDPProcessor script resource file content.
3860
3861         * DerivedSources.make:
3862         * PlatformGTK.cmake:
3863         * WebCore.xcodeproj/project.pbxproj:
3864         * platform/mediastream/SDPProcessorScriptResource.cpp:
3865         (WebCore::SDPProcessorScriptResource::scriptString):
3866         * platform/mediastream/openwebrtc/SDPProcessorScriptResource.cpp: Removed.
3867
3868 2016-10-26  Dave Hyatt  <hyatt@apple.com>
3869
3870         [CSS Parser] Get functional pseudos parsing
3871         https://bugs.webkit.org/show_bug.cgi?id=164018
3872
3873         Reviewed by Zalan Bujtas.
3874
3875         * css/parser/CSSParserValues.cpp:
3876         (WebCore::CSSParserSelector::parsePseudoClassSelectorFromStringView):
3877         Remove the ( check so that we can parse strings that end in (.
3878
3879         * css/parser/CSSSelectorParser.cpp:
3880         (WebCore::CSSSelectorParser::consumePseudo):
3881         Put in a hack that adds a ( to the end of the string so that it will be found in the map.
3882
3883 2016-10-26  Zan Dobersek  <zdobersek@igalia.com>
3884
3885         Unreviewed. Fixing compiler warnings in PlaybackPipeline
3886         that are popping up in GTK+ builds.
3887
3888         * platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
3889         (WebCore::PlaybackPipeline::addSourceBuffer):
3890         (WebCore::PlaybackPipeline::attachTrack):
3891
3892 2016-10-26  Youenn Fablet  <youennf@gmail.com>
3893
3894         IceCandidate does not need to be refcounted
3895         https://bugs.webkit.org/show_bug.cgi?id=163944
3896
3897         Reviewed by Eric Carlson.
3898
3899         No change of behavior.
3900
3901         Simplifying IceCandidate class into a simple structure, no longer refcounted.
3902         Updated call sites accordingly.
3903         Updated SDP parsing of candidates to return a Variant instead of having both a return and an out parameter.
3904
3905         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
3906         (WebCore::MediaEndpointPeerConnection::addIceCandidateTask):
3907         (WebCore::MediaEndpointPeerConnection::gotIceCandidate):
3908         * Modules/mediastream/MediaEndpointPeerConnection.h:
3909         * Modules/mediastream/SDPProcessor.cpp:
3910         (WebCore::createCandidateObject):
3911         (WebCore::createCandidate):
3912         (WebCore::iceCandidateFromJSON):
3913         (WebCore::configurationToJSON):
3914         (WebCore::SDPProcessor::parseCandidateLine):
3915         * Modules/mediastream/SDPProcessor.h:
3916         (WebCore::SDPProcessor::ParsingResult::parsingStatus):
3917         (WebCore::SDPProcessor::ParsingResult::candidate):
3918         * platform/mediastream/IceCandidate.h:
3919         * platform/mediastream/MediaEndpoint.cpp:
3920         * platform/mediastream/MediaEndpoint.h:
3921         * platform/mediastream/PeerMediaDescription.h:
3922         (WebCore::PeerMediaDescription::iceCandidates):
3923         (WebCore::PeerMediaDescription::addIceCandidate):
3924         (WebCore::PeerMediaDescription::clone):
3925         * platform/mediastream/openwebrtc/MediaEndpointOwr.cpp:
3926         (WebCore::MediaEndpointOwr::updateSendConfiguration):
3927         (WebCore::MediaEndpointOwr::addRemoteCandidate):
3928         (WebCore::MediaEndpointOwr::dispatchNewIceCandidate):
3929         (WebCore::MediaEndpointOwr::internalAddRemoteCandidate):
3930         * platform/mediastream/openwebrtc/MediaEndpointOwr.h:
3931         * platform/mock/MockMediaEndpoint.cpp:
3932         (WebCore::MockMediaEndpoint::addRemoteCandidate):
3933         (WebCore::MockMediaEndpoint::dispatchFakeIceCandidates):
3934         * platform/mock/MockMediaEndpoint.h:
3935
3936 2016-10-26  Andreas Kling  <akling@apple.com>
3937
3938         Fix mach port leak in ResourceUsageThread.
3939         <https://webkit.org/b/164012>
3940
3941         Reviewed by Antti Koivisto.
3942
3943         The threads returned by task_threads() need to be deallocated.
3944
3945         * page/cocoa/ResourceUsageThreadCocoa.mm:
3946         (WebCore::cpuUsage):
3947
3948 2016-10-26  Nael Ouedraogo  <nael.ouedraogo@crf.canon.fr>
3949
3950         WebRTC: The RTCTrackEventInit dictionary needs required members
3951         https://bugs.webkit.org/show_bug.cgi?id=158536
3952
3953         Reviewed by Chris Dumez.
3954
3955         Update RTCTrackEvent IDL as per specification.
3956
3957         No additional test required, rebase existing tests.
3958
3959         * Modules/mediastream/RTCTrackEvent.idl:
3960
3961 2016-10-26  Enrique Ocaña González  <eocanha@igalia.com>
3962
3963         [GStreamer][GTK+][MSE] Unreviewed debug build fix.
3964
3965         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
3966         (WebCore::AppendPipeline::resetPipeline):
3967         * platform/graphics/gstreamer/mse/AppendPipeline.h:
3968
3969 2016-10-26  Enrique Ocaña González  <eocanha@igalia.com>
3970
3971         [cmake][GStreamer][MSE][EME] Build MSE and EME code after refactoring
3972         https://bugs.webkit.org/show_bug.cgi?id=162928
3973
3974         Reviewed by Xabier Rodriguez-Calvar.
3975
3976         Consolidate all the source file tree changes after refactoring.
3977
3978         This patch is co-authored with Philippe Normand <philn@igalia.com> (EME support).
3979
3980         * platform/GStreamer.cmake:
3981