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