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