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