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