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