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