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