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