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