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