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