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