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