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