Web Inspector: Remove unused and untested Page.setTouchEmulationEnabled command
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-11-15  Joseph Pecoraro  <pecoraro@apple.com>
2
3         Web Inspector: Remove unused and untested Page.setTouchEmulationEnabled command
4         https://bugs.webkit.org/show_bug.cgi?id=164793
5
6         Reviewed by Matt Baker.
7
8         * inspector/InspectorPageAgent.cpp:
9         (WebCore::InspectorPageAgent::willDestroyFrontendAndBackend):
10         (WebCore::InspectorPageAgent::updateTouchEventEmulationInPage): Deleted.
11         (WebCore::InspectorPageAgent::setTouchEmulationEnabled): Deleted.
12         * inspector/InspectorPageAgent.h:
13
14 2016-11-15  Jiewen Tan  <jiewen_tan@apple.com>
15
16         Unreviewed, quick fix for r208751
17
18         * bindings/js/JSSubtleCryptoCustom.cpp:
19         (WebCore::jsSubtleCryptoFunctionExportKeyPromise):
20
21 2016-11-15  Chris Dumez  <cdumez@apple.com>
22
23         Unreviewed, fix build after r208710.
24
25         Inline functions should not be marked as WEBCORE_EXPORT.
26
27         * dom/QualifiedName.h:
28
29 2016-11-15  Brent Fulgham  <bfulgham@apple.com>
30
31         strncpy may leave unterminated string in WebCore::URL::init
32         https://bugs.webkit.org/show_bug.cgi?id=74473
33         <rdar://problem/10576626>
34
35         Reviewed by David Kilzer.
36
37         Reviving an old patch by David Kilzer! This should have been integrated years ago.
38
39         No new tests. No change in behavior.
40
41         * platform/URL.cpp:
42         (WebCore::URL::init): Make sure we always enter 'parse' with a
43         null-terminated string.
44
45 2016-11-15  Jiewen Tan  <jiewen_tan@apple.com>
46
47         Followup patch for r208737
48
49         Reviewed by Yusuke Suzuki.
50
51         * bindings/js/JSSubtleCryptoCustom.cpp:
52         (WebCore::jsSubtleCryptoFunctionExportKeyPromise):
53
54 2016-11-14  Simon Fraser  <simon.fraser@apple.com>
55
56         [iOS WK2] Implement support for visual viewports
57         https://bugs.webkit.org/show_bug.cgi?id=164765
58
59         Reviewed by Tim Horton.
60
61         Adopt the visual viewport scrolling model in iOS WK2.
62
63         This is more complex than the Mac implementation for two primary reasons. First,
64         WKWebView needs to to able to control the rectangle used for fixed position layout
65         to get the correct behavior when zooming all the way out, and because iOS displays
66         pages scaled down, exposing document overflow such that the layout viewport rectangle
67         has to get larger than the initial containing block size (which does not happen on Mac).
68
69         This is achieved by pushing a "layoutViewportOverrideRect" down onto FrameView, in
70         a similar way to the customFixedPositionRect that's used now. We share that name
71         for now in code that is agnostic to its use (e.g. VisibleContentRectUpdateInfo).
72
73         I tried so hard to write tests, but ran into various problems (webkit.org/b/164762,
74         webkit.org/b/164764). Will add tests via webkit.org/b/164764.
75
76         * page/FrameView.cpp:
77         (WebCore::FrameView::fixedScrollableAreaBoundsInflatedForScrolling): layoutViewportOrigin()
78         was removed.
79         (WebCore::FrameView::setBaseLayoutViewportOrigin): Rename with "base" to make it clearer that
80         it can be overridden.
81         (WebCore::FrameView::setLayoutViewportOverrideRect):
82         (WebCore::FrameView::baseLayoutViewportSize): Renamed.
83         (WebCore::FrameView::updateLayoutViewport): Logging.
84         (WebCore::FrameView::layoutViewportRect):
85         (WebCore::FrameView::scrollPositionForFixedPosition):
86         (WebCore::FrameView::unscaledMaximumScrollPosition): During page transitions on iOS, it
87         was possible for unscaledDocumentRect to be empty, but visibleSize() to be non-empty, leading
88         to odd negative max scroll offsets, so clamp to 0,0.
89         (WebCore::FrameView::setLayoutViewportOrigin): Deleted.
90         * page/FrameView.h:
91         * page/scrolling/AsyncScrollingCoordinator.cpp:
92         (WebCore::AsyncScrollingCoordinator::reconcileScrollingState): scrollPositionForFixedPosition() already does the
93         visualViewportEnabled() check.
94         * page/scrolling/mac/ScrollingTreeFixedNode.mm:
95         (WebCore::ScrollingTreeFixedNode::updateLayersAfterAncestorChange):
96         * platform/graphics/FloatSize.cpp:
97         (WebCore::FloatSize::constrainedBetween): Added for consistency with the other geometry types.
98         * platform/graphics/FloatSize.h:
99         * platform/graphics/LayoutSize.cpp:
100         (WebCore::LayoutSize::constrainedBetween): Ditto.
101         * platform/graphics/LayoutSize.h:
102         * rendering/RenderView.cpp:
103         (WebCore::RenderView::clientLogicalWidthForFixedPosition): If we have an override layout viewport, its size might be different
104         from the RenderView's size (the initial containing block), so we need to use the layoutViewportRect here.
105         (WebCore::RenderView::clientLogicalHeightForFixedPosition):
106
107 2016-11-15  Myles C. Maxfield  <mmaxfield@apple.com>
108
109         [WebGL] Remove unused Chromium-specific OpenGL extensions
110         https://bugs.webkit.org/show_bug.cgi?id=164782
111
112         Reviewed by Dean Jackson.
113
114         No new tests because there is no behavior change.
115
116         * html/canvas/WebGL2RenderingContext.cpp:
117         (WebCore::WebGL2RenderingContext::copyBufferSubData):
118         (WebCore::WebGL2RenderingContext::clear):
119         (WebCore::WebGL2RenderingContext::getExtension):
120         * html/canvas/WebGLCompressedTextureS3TC.cpp:
121         (WebCore::WebGLCompressedTextureS3TC::supported):
122         * html/canvas/WebGLDepthTexture.cpp:
123         (WebCore::WebGLDepthTexture::supported):
124         * html/canvas/WebGLDrawBuffers.cpp:
125         (WebCore::WebGLDrawBuffers::satisfiesWebGLRequirements):
126         * html/canvas/WebGLFramebuffer.cpp:
127         (WebCore::WebGLFramebuffer::onAccess):
128         * html/canvas/WebGLFramebuffer.h:
129         * html/canvas/WebGLRenderingContext.cpp:
130         (WebCore::WebGLRenderingContext::getExtension):
131         (WebCore::WebGLRenderingContext::clear):
132         * html/canvas/WebGLRenderingContextBase.cpp:
133         (WebCore::WebGLRenderingContextBase::setupFlags):
134         (WebCore::WebGLRenderingContextBase::bufferData):
135         (WebCore::WebGLRenderingContextBase::bufferSubData):
136         (WebCore::WebGLRenderingContextBase::copyTexSubImage2D):
137         (WebCore::WebGLRenderingContextBase::validateDrawArrays):
138         (WebCore::WebGLRenderingContextBase::validateDrawElements):
139         (WebCore::WebGLRenderingContextBase::readPixels):
140         (WebCore::WebGLRenderingContextBase::texImage2DBase):
141         (WebCore::WebGLRenderingContextBase::copyTexImage2D):
142         * html/canvas/WebGLRenderingContextBase.h:
143         (WebCore::WebGLRenderingContextBase::isGLES2NPOTStrict):
144         (WebCore::WebGLRenderingContextBase::isErrorGeneratedOnOutOfBoundsAccesses): Deleted.
145         (WebCore::WebGLRenderingContextBase::isResourceSafe): Deleted.
146         * platform/graphics/GraphicsContext3D.cpp:
147         (WebCore::GraphicsContext3D::texImage2DResourceSafe):
148         * platform/graphics/GraphicsContext3D.h:
149         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
150         (WebCore::GraphicsContext3D::isResourceSafe): Deleted.
151
152 2016-11-14  Brent Fulgham  <bfulgham@apple.com>
153
154         Correct handling of changing input type
155         https://bugs.webkit.org/show_bug.cgi?id=164759
156         <rdar://problem/29211174>
157
158         Reviewed by Darin Adler.
159
160         Test: fast/forms/search-cancel-button-change-input.html
161
162         It is possible for JavaScript to change the type property of an input field. WebKit
163         needs to gracefully handle this case.
164
165         Add a type traits specialization so we can properly downcast InputType elements.
166         Use this to only call search functions on actual search input types.
167
168         * html/HTMLInputElement.cpp:
169         (WebCore::HTMLInputElement::onSearch): Only perform search functions if the
170         input type is actually a search field.
171         * html/InputType.h: Add type traits specialization for 'downcast' template.
172         * html/SearchInputType.h: Ditto.
173
174 2016-11-15  Zalan Bujtas  <zalan@apple.com>
175
176         CounterNode::insertAfter and ::removeChild should take references.
177         https://bugs.webkit.org/show_bug.cgi?id=164780
178
179         Reviewed by Simon Fraser.
180
181         No change in functionality.
182
183         * rendering/CounterNode.cpp:
184         (WebCore::CounterNode::insertAfter):
185         (WebCore::CounterNode::removeChild):
186         * rendering/CounterNode.h:
187         * rendering/RenderCounter.cpp:
188         (WebCore::makeCounterNode):
189         (WebCore::destroyCounterNodeWithoutMapRemoval):
190         (WebCore::updateCounters):
191
192 2016-11-15  Antti Koivisto  <antti@apple.com>
193
194         slot doesn't work as a flex container
195         https://bugs.webkit.org/show_bug.cgi?id=160740
196         <rdar://problem/28605080>
197
198         Reviewed by Ryosuke Niwa.
199
200         Test: fast/shadow-dom/css-scoping-slot-flex.html
201
202         The style adjustment for flex children needs to be based on their parent box style rather
203         than the composed tree parent. This can be different when display:contents is involved.
204
205         * css/MediaQueryMatcher.cpp:
206         (WebCore::MediaQueryMatcher::documentElementUserAgentStyle):
207         * css/StyleMedia.cpp:
208         (WebCore::StyleMedia::matchMedium):
209         * css/StyleResolver.cpp:
210         (WebCore::StyleResolver::StyleResolver):
211         (WebCore::StyleResolver::styleForElement):
212
213             Optionally provide parent box style so we can do adjustments based on it when computing style for rendering.
214
215         (WebCore::StyleResolver::styleForKeyframe):
216         (WebCore::StyleResolver::pseudoStyleForElement):
217         (WebCore::equivalentBlockDisplay):
218
219             Avoid boolean parameters.
220
221         (WebCore::StyleResolver::adjustRenderStyle):
222
223             Do the display:contents adjustment first and treat 'content' like 'none' later'. We never want to override
224             'contents' with adjustments.
225             Use parent box style for flex/grid adjustments instead of the DOM parent style.
226
227         * css/StyleResolver.h:
228         * rendering/RenderNamedFlowFragment.cpp:
229         (WebCore::RenderNamedFlowFragment::computeStyleInRegion):
230         * style/StyleTreeResolver.cpp:
231         (WebCore::Style::TreeResolver::styleForElement):
232
233             Call with parent box style.
234
235         (WebCore::Style::TreeResolver::parentBoxStyle):
236
237             Find the parent box style if any.
238
239         * style/StyleTreeResolver.h:
240         * svg/SVGElementRareData.h:
241         (WebCore::SVGElementRareData::overrideComputedStyle):
242
243 2016-11-15  Joseph Pecoraro  <pecoraro@apple.com>
244
245         Misc Inspector backend cleanup
246         https://bugs.webkit.org/show_bug.cgi?id=164768
247
248         Reviewed by Brian Burg.
249
250         * inspector/DOMPatchSupport.cpp:
251         * inspector/InspectorApplicationCacheAgent.cpp:
252         * inspector/InspectorApplicationCacheAgent.h:
253         * inspector/InspectorCSSAgent.cpp:
254         * inspector/InspectorCSSAgent.h:
255         * inspector/InspectorDOMAgent.cpp:
256         (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
257         * inspector/InspectorDOMAgent.h:
258         * inspector/InspectorDOMDebuggerAgent.h:
259         * inspector/InspectorDOMStorageAgent.cpp:
260         * inspector/InspectorDOMStorageAgent.h:
261         * inspector/InspectorDatabaseAgent.cpp:
262         * inspector/InspectorDatabaseAgent.h:
263         * inspector/InspectorFrontendClientLocal.cpp:
264         (WebCore::InspectorFrontendClientLocal::frontendLoaded):
265         * inspector/InspectorIndexedDBAgent.cpp:
266         (WebCore::ClearObjectStoreListener::create): Deleted.
267         (WebCore::ClearObjectStoreListener::~ClearObjectStoreListener): Deleted.
268         (WebCore::ClearObjectStoreListener::ClearObjectStoreListener): Deleted.
269         (WebCore::ClearObjectStore::create): Deleted.
270         (WebCore::ClearObjectStore::ClearObjectStore): Deleted.
271         * inspector/InspectorLayerTreeAgent.cpp:
272         * inspector/InspectorLayerTreeAgent.h:
273         * inspector/InspectorNetworkAgent.h:
274         * inspector/InspectorPageAgent.cpp:
275         * inspector/InspectorPageAgent.h:
276         * inspector/InspectorReplayAgent.cpp:
277         * inspector/InspectorReplayAgent.h:
278         * inspector/InspectorTimelineAgent.cpp:
279         (WebCore::InspectorTimelineAgent::stopFromConsole):
280         * inspector/InspectorTimelineAgent.h:
281         * inspector/PageRuntimeAgent.h:
282
283 2016-11-14  Myles C. Maxfield  <mmaxfield@apple.com>
284
285         [WebGL] Migrate construction functions from pointers to references
286         https://bugs.webkit.org/show_bug.cgi?id=164749
287
288         Reviewed by Zalan Bujtas.
289
290         Mechanical find/replace.
291
292         No new tests because there is no behavior change.
293
294         * html/canvas/ANGLEInstancedArrays.cpp:
295         (WebCore::ANGLEInstancedArrays::ANGLEInstancedArrays):
296         (WebCore::ANGLEInstancedArrays::supported):
297         (WebCore::ANGLEInstancedArrays::drawArraysInstancedANGLE):
298         (WebCore::ANGLEInstancedArrays::drawElementsInstancedANGLE):
299         (WebCore::ANGLEInstancedArrays::vertexAttribDivisorANGLE):
300         * html/canvas/ANGLEInstancedArrays.h:
301         * html/canvas/EXTBlendMinMax.cpp:
302         (WebCore::EXTBlendMinMax::EXTBlendMinMax):
303         * html/canvas/EXTBlendMinMax.h:
304         * html/canvas/EXTFragDepth.cpp:
305         (WebCore::EXTFragDepth::EXTFragDepth):
306         * html/canvas/EXTFragDepth.h:
307         * html/canvas/EXTShaderTextureLOD.cpp:
308         (WebCore::EXTShaderTextureLOD::EXTShaderTextureLOD):
309         * html/canvas/EXTShaderTextureLOD.h:
310         * html/canvas/EXTTextureFilterAnisotropic.cpp:
311         (WebCore::EXTTextureFilterAnisotropic::EXTTextureFilterAnisotropic):
312         * html/canvas/EXTTextureFilterAnisotropic.h:
313         * html/canvas/EXTsRGB.cpp:
314         (WebCore::EXTsRGB::EXTsRGB):
315         * html/canvas/EXTsRGB.h:
316         * html/canvas/OESElementIndexUint.cpp:
317         (WebCore::OESElementIndexUint::OESElementIndexUint):
318         * html/canvas/OESElementIndexUint.h:
319         * html/canvas/OESStandardDerivatives.cpp:
320         (WebCore::OESStandardDerivatives::OESStandardDerivatives):
321         * html/canvas/OESStandardDerivatives.h:
322         * html/canvas/OESTextureFloat.cpp:
323         (WebCore::OESTextureFloat::OESTextureFloat):
324         * html/canvas/OESTextureFloat.h:
325         * html/canvas/OESTextureFloatLinear.cpp:
326         (WebCore::OESTextureFloatLinear::OESTextureFloatLinear):
327         * html/canvas/OESTextureFloatLinear.h:
328         * html/canvas/OESTextureHalfFloat.cpp:
329         (WebCore::OESTextureHalfFloat::OESTextureHalfFloat):
330         * html/canvas/OESTextureHalfFloat.h:
331         * html/canvas/OESTextureHalfFloatLinear.cpp:
332         (WebCore::OESTextureHalfFloatLinear::OESTextureHalfFloatLinear):
333         * html/canvas/OESTextureHalfFloatLinear.h:
334         * html/canvas/OESVertexArrayObject.cpp:
335         (WebCore::OESVertexArrayObject::OESVertexArrayObject):
336         (WebCore::OESVertexArrayObject::createVertexArrayOES):
337         (WebCore::OESVertexArrayObject::deleteVertexArrayOES):
338         (WebCore::OESVertexArrayObject::isVertexArrayOES):
339         (WebCore::OESVertexArrayObject::bindVertexArrayOES):
340         * html/canvas/WebGL2RenderingContext.cpp:
341         (WebCore::WebGL2RenderingContext::initializeVertexArrayObjects):
342         (WebCore::WebGL2RenderingContext::initializeShaderExtensions):
343         (WebCore::WebGL2RenderingContext::drawBuffers):
344         (WebCore::WebGL2RenderingContext::createVertexArray):
345         (WebCore::WebGL2RenderingContext::isVertexArray):
346         (WebCore::WebGL2RenderingContext::bindVertexArray):
347         (WebCore::WebGL2RenderingContext::getExtension):
348         (WebCore::WebGL2RenderingContext::getSupportedExtensions):
349         * html/canvas/WebGLBuffer.cpp:
350         (WebCore::WebGLBuffer::create):
351         (WebCore::WebGLBuffer::WebGLBuffer):
352         * html/canvas/WebGLBuffer.h:
353         * html/canvas/WebGLCompressedTextureATC.cpp:
354         (WebCore::WebGLCompressedTextureATC::WebGLCompressedTextureATC):
355         (WebCore::WebGLCompressedTextureATC::supported):
356         * html/canvas/WebGLCompressedTextureATC.h:
357         * html/canvas/WebGLCompressedTexturePVRTC.cpp:
358         (WebCore::WebGLCompressedTexturePVRTC::WebGLCompressedTexturePVRTC):
359         (WebCore::WebGLCompressedTexturePVRTC::supported):
360         * html/canvas/WebGLCompressedTexturePVRTC.h:
361         * html/canvas/WebGLCompressedTextureS3TC.cpp:
362         (WebCore::WebGLCompressedTextureS3TC::WebGLCompressedTextureS3TC):
363         (WebCore::WebGLCompressedTextureS3TC::supported):
364         * html/canvas/WebGLCompressedTextureS3TC.h:
365         * html/canvas/WebGLContextObject.cpp:
366         (WebCore::WebGLContextObject::WebGLContextObject):
367         * html/canvas/WebGLContextObject.h:
368         * html/canvas/WebGLDebugRendererInfo.cpp:
369         (WebCore::WebGLDebugRendererInfo::WebGLDebugRendererInfo):
370         * html/canvas/WebGLDebugRendererInfo.h:
371         * html/canvas/WebGLDebugShaders.cpp:
372         (WebCore::WebGLDebugShaders::WebGLDebugShaders):
373         (WebCore::WebGLDebugShaders::getTranslatedShaderSource):
374         * html/canvas/WebGLDebugShaders.h:
375         * html/canvas/WebGLDepthTexture.cpp:
376         (WebCore::WebGLDepthTexture::WebGLDepthTexture):
377         (WebCore::WebGLDepthTexture::supported):
378         * html/canvas/WebGLDepthTexture.h:
379         * html/canvas/WebGLDrawBuffers.cpp:
380         (WebCore::WebGLDrawBuffers::WebGLDrawBuffers):
381         (WebCore::WebGLDrawBuffers::supported):
382         (WebCore::WebGLDrawBuffers::drawBuffersWEBGL):
383         (WebCore::WebGLDrawBuffers::satisfiesWebGLRequirements):
384         * html/canvas/WebGLDrawBuffers.h:
385         * html/canvas/WebGLExtension.cpp:
386         (WebCore::WebGLExtension::WebGLExtension):
387         * html/canvas/WebGLExtension.h:
388         (WebCore::WebGLExtension::ref):
389         (WebCore::WebGLExtension::deref):
390         (WebCore::WebGLExtension::context):
391         * html/canvas/WebGLFramebuffer.cpp:
392         (WebCore::WebGLFramebuffer::create):
393         (WebCore::WebGLFramebuffer::WebGLFramebuffer):
394         (WebCore::WebGLFramebuffer::drawBuffersIfNecessary):
395         * html/canvas/WebGLFramebuffer.h:
396         * html/canvas/WebGLLoseContext.cpp:
397         (WebCore::WebGLLoseContext::WebGLLoseContext):
398         (WebCore::WebGLLoseContext::loseContext):
399         (WebCore::WebGLLoseContext::restoreContext):
400         * html/canvas/WebGLLoseContext.h:
401         * html/canvas/WebGLObject.cpp:
402         (WebCore::WebGLObject::WebGLObject):
403         * html/canvas/WebGLObject.h:
404         * html/canvas/WebGLProgram.cpp:
405         (WebCore::WebGLProgram::create):
406         (WebCore::WebGLProgram::WebGLProgram):
407         * html/canvas/WebGLProgram.h:
408         * html/canvas/WebGLQuery.cpp:
409         (WebCore::WebGLQuery::create):
410         (WebCore::WebGLQuery::WebGLQuery):
411         * html/canvas/WebGLQuery.h:
412         * html/canvas/WebGLRenderbuffer.cpp:
413         (WebCore::WebGLRenderbuffer::create):
414         (WebCore::WebGLRenderbuffer::WebGLRenderbuffer):
415         * html/canvas/WebGLRenderbuffer.h:
416         * html/canvas/WebGLRenderingContext.cpp:
417         (WebCore::WebGLRenderingContext::initializeVertexArrayObjects):
418         (WebCore::WebGLRenderingContext::getExtension):
419         (WebCore::WebGLRenderingContext::getSupportedExtensions):
420         * html/canvas/WebGLRenderingContextBase.cpp:
421         (WebCore::WebGLRenderingContextBase::create):
422         (WebCore::WebGLRenderingContextBase::setupFlags):
423         (WebCore::WebGLRenderingContextBase::checkObjectToBeBound):
424         (WebCore::WebGLRenderingContextBase::createBuffer):
425         (WebCore::WebGLRenderingContextBase::createFramebuffer):
426         (WebCore::WebGLRenderingContextBase::createTexture):
427         (WebCore::WebGLRenderingContextBase::createProgram):
428         (WebCore::WebGLRenderingContextBase::createRenderbuffer):
429         (WebCore::WebGLRenderingContextBase::createShader):
430         (WebCore::WebGLRenderingContextBase::deleteObject):
431         (WebCore::WebGLRenderingContextBase::validateWebGLObject):
432         (WebCore::WebGLRenderingContextBase::framebufferRenderbuffer):
433         (WebCore::WebGLRenderingContextBase::framebufferTexture2D):
434         (WebCore::WebGLRenderingContextBase::getUniform):
435         (WebCore::WebGLRenderingContextBase::readPixels):
436         (WebCore::WebGLRenderingContextBase::loseContextImpl):
437         (WebCore::WebGLRenderingContextBase::maybeRestoreContext):
438         (WebCore::WebGLRenderingContextBase::supportsDrawBuffers):
439         * html/canvas/WebGLSampler.cpp:
440         (WebCore::WebGLSampler::create):
441         (WebCore::WebGLSampler::WebGLSampler):
442         * html/canvas/WebGLSampler.h:
443         * html/canvas/WebGLShader.cpp:
444         (WebCore::WebGLShader::create):
445         (WebCore::WebGLShader::WebGLShader):
446         * html/canvas/WebGLShader.h:
447         * html/canvas/WebGLSharedObject.cpp:
448         (WebCore::WebGLSharedObject::WebGLSharedObject):
449         * html/canvas/WebGLSharedObject.h:
450         * html/canvas/WebGLSync.cpp:
451         (WebCore::WebGLSync::create):
452         (WebCore::WebGLSync::WebGLSync):
453         * html/canvas/WebGLSync.h:
454         * html/canvas/WebGLTexture.cpp:
455         (WebCore::WebGLTexture::create):
456         (WebCore::WebGLTexture::WebGLTexture):
457         * html/canvas/WebGLTexture.h:
458         * html/canvas/WebGLTransformFeedback.cpp:
459         (WebCore::WebGLTransformFeedback::create):
460         (WebCore::WebGLTransformFeedback::WebGLTransformFeedback):
461         * html/canvas/WebGLTransformFeedback.h:
462         * html/canvas/WebGLVertexArrayObject.cpp:
463         (WebCore::WebGLVertexArrayObject::create):
464         (WebCore::WebGLVertexArrayObject::WebGLVertexArrayObject):
465         * html/canvas/WebGLVertexArrayObject.h:
466         * html/canvas/WebGLVertexArrayObjectBase.cpp:
467         (WebCore::WebGLVertexArrayObjectBase::WebGLVertexArrayObjectBase):
468         * html/canvas/WebGLVertexArrayObjectBase.h:
469         * html/canvas/WebGLVertexArrayObjectOES.cpp:
470         (WebCore::WebGLVertexArrayObjectOES::create):
471         (WebCore::WebGLVertexArrayObjectOES::WebGLVertexArrayObjectOES):
472         (WebCore::WebGLVertexArrayObjectOES::deleteObjectImpl):
473         * html/canvas/WebGLVertexArrayObjectOES.h:
474         * platform/graphics/GraphicsContext3D.h:
475         * platform/graphics/gpu/Texture.cpp:
476         (WebCore::convertFormat):
477         * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
478         (WebCore::GraphicsContext3D::readPixelsAndConvertToBGRAIfNecessary):
479         (WebCore::GraphicsContext3D::reshapeFBOs):
480         (WebCore::GraphicsContext3D::getIntegerv):
481         (WebCore::GraphicsContext3D::getExtensions):
482         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
483         (WebCore::GraphicsContext3D::validateDepthStencil):
484         (WebCore::GraphicsContext3D::drawArraysInstanced):
485         (WebCore::GraphicsContext3D::drawElementsInstanced):
486         (WebCore::GraphicsContext3D::vertexAttribDivisor):
487
488 2016-11-15  Joanmarie Diggs  <jdiggs@igalia.com>
489
490         AX: Need to update implicit/default values for aria-valuemin, aria-valuenow, and aria-valuemax
491         https://bugs.webkit.org/show_bug.cgi?id=164773
492
493         Reviewed by Chris Fleizach.
494
495         Return the values stated in the ARIA 1.1 spec, namely:
496         - aria-valuemin is 0 for roles other than spinbutton
497         - aria-valuemax is 100 for roles other than spinbutton
498         - aria-valuenow is half way between aria-valuemax and aria-valuemin
499           for roles other than spinbutton, and 0 for spinbutton
500
501         For spinbutton, the spec states that "there is no minimum/maximum value."
502         But at least in the case of ATK/AT-SPI2, the accessible value interface
503         is expected to provide a number. Therefore, expose the values we use to
504         constrain input type="number": -std::numeric_limits<float>::max() and
505         std::numeric_limits<float>::max().
506
507         Test: accessibility/spinbutton-implicit-values.html
508
509         * accessibility/AccessibilityNodeObject.cpp:
510         (WebCore::AccessibilityNodeObject::valueForRange):
511         (WebCore::AccessibilityNodeObject::maxValueForRange):
512         (WebCore::AccessibilityNodeObject::minValueForRange):
513
514 2016-11-14  Jiewen Tan  <jiewen_tan@apple.com>
515
516         Update SubtleCrypto::exportKey to match the latest spec
517         https://bugs.webkit.org/show_bug.cgi?id=164722
518         <rdar://problem/29251740>
519
520         Reviewed by Brent Fulgham.
521
522         This patch does following few things:
523         1. It updates the SubtleCrypto::exportKey method to match the latest spec:
524            https://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-exportKey.
525            It also refers to the latest Editor's Draft to a certain degree:
526            https://w3c.github.io/webcrypto/Overview.html#SubtleCrypto-method-exportKey.
527         2. It implements exportKey operations of the following algorithms: AES-CBC, AES-KW,
528            HMAC, RSAES-PKCS1-V1_5, RSASSA-PKCS1-V1_5, and RSA-OAEP.
529         3. It also fixes the following bugs:
530            https://bugs.webkit.org/show_bug.cgi?id=156114,
531            <rdar://problem/21773066>.
532         Note: We currently only support Raw and Jwk key format.
533
534         Tests: crypto/subtle/aes-cbc-generate-export-key-jwk-length-128.html
535                crypto/subtle/aes-cbc-generate-export-key-jwk-length-192.html
536                crypto/subtle/aes-cbc-generate-export-key-jwk-length-256.html
537                crypto/subtle/aes-cbc-generate-export-key-raw.html
538                crypto/subtle/aes-export-key-malformed-parameters.html
539                crypto/subtle/aes-kw-generate-export-key-jwk-length-128.html
540                crypto/subtle/aes-kw-generate-export-key-jwk-length-192.html
541                crypto/subtle/aes-kw-generate-export-key-jwk-length-256.html
542                crypto/subtle/aes-kw-generate-export-raw-key.html
543                crypto/subtle/export-key-malformed-parameters.html
544                crypto/subtle/hmac-export-key-malformed-parameters.html
545                crypto/subtle/hmac-generate-export-key-jwk-sha1.html
546                crypto/subtle/hmac-generate-export-key-jwk-sha224.html
547                crypto/subtle/hmac-generate-export-key-jwk-sha256.html
548                crypto/subtle/hmac-generate-export-key-jwk-sha384.html
549                crypto/subtle/hmac-generate-export-key-jwk-sha512.html
550                crypto/subtle/hmac-generate-export-raw-key.html
551                crypto/subtle/hmac-import-key-malformed-parameters.html
552                crypto/subtle/rsa-export-key-malformed-parameters.html
553                crypto/subtle/rsa-oaep-generate-export-key-jwk-sha1.html
554                crypto/subtle/rsa-oaep-generate-export-key-jwk-sha224.html
555                crypto/subtle/rsa-oaep-generate-export-key-jwk-sha256.html
556                crypto/subtle/rsa-oaep-generate-export-key-jwk-sha384.html
557                crypto/subtle/rsa-oaep-generate-export-key-jwk-sha512.html
558                crypto/subtle/rsaes-pkcs1-v1_5-generate-export-key-jwk.html
559                crypto/subtle/rsassa-pkcs1-v1_5-generate-export-key-jwk-sha1.html
560                crypto/subtle/rsassa-pkcs1-v1_5-generate-export-key-jwk-sha224.html
561                crypto/subtle/rsassa-pkcs1-v1_5-generate-export-key-jwk-sha256.html
562                crypto/subtle/rsassa-pkcs1-v1_5-generate-export-key-jwk-sha384.html
563                crypto/subtle/rsassa-pkcs1-v1_5-generate-export-key-jwk-sha512.html
564                crypto/workers/subtle/aes-generate-export-key-jwk.html
565                crypto/workers/subtle/aes-generate-export-key-raw.html
566                crypto/workers/subtle/hmac-generate-export-key-jwk.html
567                crypto/workers/subtle/hmac-generate-export-key-raw.html
568                crypto/workers/subtle/rsa-generate-export-key-jwk.html
569
570         * bindings/js/JSSubtleCryptoCustom.cpp:
571         (WebCore::toJSValueFromJsonWebKey):
572         (WebCore::jsSubtleCryptoFunctionExportKeyPromise):
573         (WebCore::JSSubtleCrypto::exportKey):
574         * crypto/CryptoAlgorithm.cpp:
575         (WebCore::CryptoAlgorithm::exportKey):
576         * crypto/CryptoAlgorithm.h:
577         * crypto/SubtleCrypto.idl:
578         * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
579         (WebCore::CryptoAlgorithmAES_CBC::importKey):
580         (WebCore::CryptoAlgorithmAES_CBC::exportKey):
581         * crypto/algorithms/CryptoAlgorithmAES_CBC.h:
582         * crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
583         (WebCore::CryptoAlgorithmAES_KW::importKey):
584         (WebCore::CryptoAlgorithmAES_KW::exportKey):
585         * crypto/algorithms/CryptoAlgorithmAES_KW.h:
586         * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
587         (WebCore::CryptoAlgorithmHMAC::importKey):
588         (WebCore::CryptoAlgorithmHMAC::exportKey):
589         * crypto/algorithms/CryptoAlgorithmHMAC.h:
590         * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
591         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::importKey):
592         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::exportKey):
593         * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h:
594         * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
595         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey):
596         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::exportKey):
597         * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h:
598         * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
599         (WebCore::CryptoAlgorithmRSA_OAEP::importKey):
600         (WebCore::CryptoAlgorithmRSA_OAEP::exportKey):
601         * crypto/algorithms/CryptoAlgorithmRSA_OAEP.h:
602         * crypto/keys/CryptoKeyAES.cpp:
603         (WebCore::CryptoKeyAES::exportJwk):
604         * crypto/keys/CryptoKeyAES.h:
605         * crypto/keys/CryptoKeyHMAC.cpp:
606         (WebCore::CryptoKeyHMAC::exportJwk):
607         * crypto/keys/CryptoKeyHMAC.h:
608         * crypto/keys/CryptoKeyRSA.cpp:
609         (WebCore::CryptoKeyRSA::exportJwk):
610         * crypto/keys/CryptoKeyRSA.h:
611
612 2016-11-15  Jon Lee  <jonlee@apple.com>
613
614         Remove HasMediaCaptureDevice
615         https://bugs.webkit.org/show_bug.cgi?id=164767
616         <rdar://problem/29263696>
617
618         Reviewed by Eric Carlson.
619
620         * Modules/mediastream/MediaStream.cpp:
621         (WebCore::MediaStream::mediaState): Remove HasMediaCaptureDevice in state.
622         * page/MediaProducer.h:
623         * testing/Internals.cpp:
624         (WebCore::Internals::pageMediaState): Remove it in the media string.
625
626 2016-11-14  Dave Hyatt  <hyatt@apple.com>
627
628         [CSS Parser] Fix font-synthesis and text-decoration-skip parsing
629         https://bugs.webkit.org/show_bug.cgi?id=164736
630
631         Reviewed by Dean Jackson.
632
633         Fix the properties to not allow duplicate values, to reject when
634         garbage values are included, to require that none be a singleton,
635         and to preserve the declaration order of the properties.
636
637         * css/StyleBuilderConverter.h:
638         (WebCore::StyleBuilderConverter::convertTextDecorationSkip):
639         * css/parser/CSSParser.cpp:
640         (WebCore::CSSParser::parseFontSynthesis):
641         (WebCore::CSSParser::parseTextDecorationSkip):
642         * css/parser/CSSPropertyParser.cpp:
643         (WebCore::consumeFontSynthesis):
644         (WebCore::consumeTextDecorationSkip):
645         (WebCore::CSSPropertyParser::parseSingleValue):
646
647 2016-11-15  Daniel Bates  <dabates@apple.com>
648
649         Disallow loads using HTTP 0.9 at the ResourceHandle/NetworkDataTask level
650         https://bugs.webkit.org/show_bug.cgi?id=164662
651         <rdar://problem/29268514>
652
653         Reviewed by Reviewed by Alex Christensen and Brady Eidson.
654
655         Currently we disallow non-default HTTP 0.9 loads at the ResourceLoader level and disallow
656         subresource loads using HTTP 0.9 on a default port when the embedding page loads using a
657         different HTTP version. However loads can still be initiated from other loaders (e.g. FrameLoader)
658         with regards to the first issue. The latter issue does not afford much protection and
659         increases code complexity. Instead we should simplify our policy and move our code to the
660         lowest networking abstraction level, ResourceHandle/NetworkDataTask, so that we disallow
661         all non-default port loads using HTTP 0.9 regardless of the loader used.
662
663         Tests: http/tests/security/http-0.9/image-default-port-allowed.html
664                http/tests/security/http-0.9/xhr-blocked.html
665
666         * loader/DocumentLoader.cpp:
667         (WebCore::DocumentLoader::responseReceived): Remove logic to cancel an HTTP 0.9 load from here.
668         We will cancel the HTTP 0.9 load at the ResourceHandle/NetworkDataTask level.
669         * loader/ResourceLoader.cpp:
670         (WebCore::ResourceLoader::didReceiveResponse): Ditto.
671         * platform/URL.h: Export stringCenterEllipsizedToLength() so that we can use it in WebKit2.
672         * platform/network/BlobResourceHandle.cpp:
673         (WebCore::BlobResourceHandle::notifyResponseOnSuccess): Modified to call ResourceHandle::didReceiveResponse().
674         (WebCore::BlobResourceHandle::notifyResponseOnError): Ditto.
675         * platform/network/ResourceHandle.cpp:
676         (WebCore::ResourceHandle::didReceiveResponse): Added. Fail the load if it is using HTTP 0.9.
677         Otherwise notify the client that we received a response.
678         (WebCore::ResourceHandle::platformContinueSynchronousDidReceiveResponse): Added. Perform any
679         additional platform-specific logic after notifying the resource handle client of the received
680         response. Only the libsoup backend overwrites this member function to do something meaningful.
681         * platform/network/ResourceHandle.h:
682         * platform/network/ResourceResponseBase.h:
683         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
684         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse): Modified to
685         call ResourceHandle::didReceiveResponse().
686         * platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
687         (-[WebCoreResourceHandleAsDelegate connection:didReceiveResponse:]): Ditto.
688         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
689         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]): Ditto.
690         * platform/network/soup/ResourceHandleSoup.cpp:
691         (WebCore::nextMultipartResponsePartCallback): Ditto.
692         (WebCore::sendRequestCallback): Ditto.
693         (WebCore::ResourceHandle::platformContinueSynchronousDidReceiveResponse): Added. Turns around and
694         calls continueAfterDidReceiveResponse().
695
696 2016-11-15  Zalan Bujtas  <zalan@apple.com>
697
698         [MultiCol] Render tree should be all clean by the end of FrameView::layout().
699         https://bugs.webkit.org/show_bug.cgi?id=162833
700
701         Reviewed by Simon Fraser.
702
703         This is a temporary workaround until after we addressed render tree mutation during layout (webkit.org/b/163849).
704
705         Test: fast/inline/out-of-flow-quotation-text-with-multicolumn.html
706
707         * page/FrameView.cpp:
708         (WebCore::FrameView::layout):
709         * rendering/RenderMultiColumnFlowThread.cpp:
710         (WebCore::RenderMultiColumnFlowThread::populate):
711         (WebCore::RenderMultiColumnFlowThread::evacuateAndDestroy):
712         * rendering/RenderQuote.cpp:
713         (WebCore::RenderQuote::attachQuote): Populating/evacuating the flow should not trigger quotation text changes.
714         (WebCore::RenderQuote::detachQuote):
715         * rendering/RenderView.h:
716         (WebCore::RenderTreeInternalMutationScope::RenderTreeInternalMutationScope):
717         (WebCore::RenderTreeInternalMutationScope::~RenderTreeInternalMutationScope):
718
719 2016-11-15  Eric Carlson  <eric.carlson@apple.com>
720
721         REGRESSION (r208606?): LayoutTest fast/mediastream/enumerating-crash.html is a flaky crash
722         https://bugs.webkit.org/show_bug.cgi?id=164715
723
724         Reviewed by Jon Lee.
725
726         No new tests, fixes a crash in an existing test.
727
728         * Modules/mediastream/UserMediaRequest.cpp:
729         (WebCore::UserMediaRequest::document): Return nullptr when the script execution context has
730           been cleared.
731         * Modules/mediastream/UserMediaRequest.h:
732         (WebCore::UserMediaRequest::document): Deleted.
733
734 2016-11-15  Alejandro G. Castro  <alex@igalia.com>
735
736         WebRTC: update MediaStream-MediaElement-srcObject.html test and unskip it
737         https://bugs.webkit.org/show_bug.cgi?id=159343
738
739         Reviewed by Philippe Normand.
740
741         Test updated.
742
743         We can not initialize the srcObject attribute when creating the mediaplayer
744         or we would be removing the srcObject we are going to use.
745
746         * html/HTMLMediaElement.cpp:
747         (WebCore::HTMLMediaElement::createMediaPlayer):
748
749 2016-11-14  Alex Christensen  <achristensen@webkit.org>
750
751         Move SecurityOrigin::createFromDatabaseIdentifier to SecurityOriginData
752         https://bugs.webkit.org/show_bug.cgi?id=164720
753
754         Reviewed by Brady Eidson.
755
756         This is adding to r208558 where we moved databaseIdentifier to SecurityOriginData so we
757         don't have to use SecurityOrigin in the DatabaseProcess.  This is a step towards only using 
758         SecurityOrigin (and the SchemeRegistry) in the WebProcess. SecurityOriginData is for other 
759         processes and IPC. There should be no change in behaviour.
760
761         * Modules/webdatabase/Database.cpp:
762         (WebCore::Database::Database):
763         (WebCore::Database::securityOrigin):
764         * Modules/webdatabase/Database.h:
765         * Modules/webdatabase/DatabaseContext.cpp:
766         (WebCore::DatabaseContext::securityOrigin):
767         * Modules/webdatabase/DatabaseContext.h:
768         * Modules/webdatabase/DatabaseManager.cpp:
769         (WebCore::DatabaseManager::tryToOpenDatabaseBackend):
770         (WebCore::DatabaseManager::fullPathForDatabase):
771         (WebCore::DatabaseManager::detailsForNameAndOrigin):
772         * Modules/webdatabase/DatabaseManager.h:
773         * Modules/webdatabase/DatabaseManagerClient.h:
774         (WebCore::DatabaseManagerClient::dispatchDidAddNewOrigin):
775         * Modules/webdatabase/DatabaseTracker.cpp:
776         (WebCore::DatabaseTracker::hasAdequateQuotaForOrigin):
777         (WebCore::DatabaseTracker::canEstablishDatabase):
778         (WebCore::DatabaseTracker::retryCanEstablishDatabase):
779         (WebCore::DatabaseTracker::hasEntryForOriginNoLock):
780         (WebCore::DatabaseTracker::hasEntryForDatabase):
781         (WebCore::DatabaseTracker::maximumSize):
782         (WebCore::DatabaseTracker::originPath):
783         (WebCore::DatabaseTracker::fullPathForDatabaseNoLock):
784         (WebCore::DatabaseTracker::fullPathForDatabase):
785         (WebCore::DatabaseTracker::origins):
786         (WebCore::DatabaseTracker::databaseNamesNoLock):
787         (WebCore::DatabaseTracker::databaseNames):
788         (WebCore::DatabaseTracker::detailsForNameAndOrigin):
789         (WebCore::DatabaseTracker::setDatabaseDetails):
790         (WebCore::DatabaseTracker::addOpenDatabase):
791         (WebCore::DatabaseTracker::removeOpenDatabase):
792         (WebCore::DatabaseTracker::originLockFor):
793         (WebCore::DatabaseTracker::deleteOriginLockFor):
794         (WebCore::DatabaseTracker::usage):
795         (WebCore::DatabaseTracker::quotaNoLock):
796         (WebCore::DatabaseTracker::quota):
797         (WebCore::DatabaseTracker::setQuota):
798         (WebCore::DatabaseTracker::addDatabase):
799         (WebCore::DatabaseTracker::deleteDatabasesModifiedSince):
800         (WebCore::DatabaseTracker::deleteOrigin):
801         (WebCore::DatabaseTracker::isDeletingDatabaseOrOriginFor):
802         (WebCore::DatabaseTracker::recordCreatingDatabase):
803         (WebCore::DatabaseTracker::doneCreatingDatabase):
804         (WebCore::DatabaseTracker::creatingDatabase):
805         (WebCore::DatabaseTracker::canDeleteDatabase):
806         (WebCore::DatabaseTracker::recordDeletingDatabase):
807         (WebCore::DatabaseTracker::doneDeletingDatabase):
808         (WebCore::DatabaseTracker::isDeletingDatabase):
809         (WebCore::DatabaseTracker::canDeleteOrigin):
810         (WebCore::DatabaseTracker::isDeletingOrigin):
811         (WebCore::DatabaseTracker::recordDeletingOrigin):
812         (WebCore::DatabaseTracker::doneDeletingOrigin):
813         (WebCore::DatabaseTracker::deleteDatabase):
814         (WebCore::DatabaseTracker::deleteDatabaseFile):
815         (WebCore::DatabaseTracker::removeDeletedOpenedDatabases):
816         (WebCore::DatabaseTracker::scheduleNotifyDatabaseChanged):
817         * Modules/webdatabase/DatabaseTracker.h:
818         * Modules/webdatabase/SQLTransactionCoordinator.cpp:
819         (WebCore::getDatabaseIdentifier):
820         * inspector/InspectorDOMStorageAgent.cpp:
821         (WebCore::InspectorDOMStorageAgent::findStorageArea):
822         * loader/EmptyClients.cpp:
823         * page/DOMWindow.cpp:
824         (WebCore::DOMWindow::sessionStorage):
825         * page/SecurityOrigin.cpp:
826         (WebCore::SecurityOrigin::maybeCreateFromDatabaseIdentifier): Deleted.
827         (WebCore::SecurityOrigin::createFromDatabaseIdentifier): Deleted.
828         * page/SecurityOrigin.h:
829         * page/SecurityOriginData.cpp:
830         (WebCore::SecurityOriginData::fromDatabaseIdentifier):
831         * page/SecurityOriginData.h:
832         (WebCore::SecurityOriginData::SecurityOriginData):
833         * storage/StorageArea.h:
834         * storage/StorageEventDispatcher.cpp:
835         (WebCore::StorageEventDispatcher::dispatchSessionStorageEvents):
836         (WebCore::StorageEventDispatcher::dispatchLocalStorageEvents):
837         (WebCore::StorageEventDispatcher::dispatchSessionStorageEventsToFrames):
838         (WebCore::StorageEventDispatcher::dispatchLocalStorageEventsToFrames):
839         * storage/StorageEventDispatcher.h:
840         * storage/StorageNamespace.h:
841         * storage/StorageNamespaceProvider.cpp:
842         (WebCore::StorageNamespaceProvider::localStorageArea):
843
844 2016-11-14  Joseph Pecoraro  <pecoraro@apple.com>
845
846         Web Inspector: Worker debugging should pause all targets and view call frames in all targets
847         https://bugs.webkit.org/show_bug.cgi?id=164305
848         <rdar://problem/29056192>
849
850         Reviewed by Timothy Hatcher.
851
852         Tests: inspector/debugger/continueUntilNextRunLoop
853                inspector/worker/debugger-multiple-targets-pause
854
855         * workers/WorkerMessagingProxy.cpp:
856         (WebCore::WorkerMessagingProxy::postMessageToPageInspector):
857         Switch from postTask (callOnMainThread) to RunLoop::main().dispatch so
858         that a paused Worker can send Inspector protocol messages responses
859         back through the Main Page's InspectorWorkerAgent even if the Page
860         itself is paused and MainThread callbacks are paused.
861
862         * workers/WorkerRunLoop.h:
863         (WebCore::WorkerRunLoop::isNested):
864         * workers/WorkerRunLoop.cpp:
865         (WebCore::WorkerRunLoop::runInMode):
866         When running a nested WorkerRunLoop, running inspector debugger
867         commands, we should not fire timers on the Worker. Timers would
868         then be happening out of order and would not be debuggable.
869
870         * dom/EventTarget.cpp:
871         (WebCore::EventTarget::fireEventListeners):
872         * inspector/InspectorDOMDebuggerAgent.cpp:
873         (WebCore::InspectorDOMDebuggerAgent::pauseOnNativeEventIfNeeded):
874         (WebCore::InspectorDOMDebuggerAgent::clear):
875         (WebCore::InspectorDOMDebuggerAgent::didPause): Deleted.
876         * inspector/InspectorDOMDebuggerAgent.h:
877         * inspector/InspectorInstrumentation.cpp:
878         (WebCore::InspectorInstrumentation::willHandleEventImpl):
879         (WebCore::InspectorInstrumentation::didFireTimerImpl):
880         (WebCore::InspectorInstrumentation::didHandleEventImpl): Deleted.
881         (WebCore::InspectorInstrumentation::cancelPauseOnNativeEvent): Deleted.
882         * inspector/InspectorInstrumentation.h:
883         (WebCore::InspectorInstrumentation::willHandleEvent):
884         (WebCore::InspectorInstrumentation::didHandleEvent): Deleted.
885         Remove unnecessary code where WebCore is trying to keep track
886         of pause on next statement but that state is already more
887         accurately provided by InspectorDebuggerAgent.
888
889 2016-11-14  Myles C. Maxfield  <mmaxfield@apple.com>
890
891         [WebGL2] Teach WebGLRenderingContextBase about new texture internal formats
892         https://bugs.webkit.org/show_bug.cgi?id=164525
893
894         Reviewed by Dean Jackson.
895
896         Test: fast/canvas/webgl/webgl2-texture-upload-enums.html
897
898         This patch migrates the existing WebGL calls texImage2D(), texSubImage2D(),
899         and readPixels() to understand the new WebGL 2 texture types. In WebGL1, the
900         format and the internalFormat were required to be the same, and we had this
901         assumption baked into many places in these functions. In WebGL 2, those two
902         values are often different, which means I had to fix all of these assumptions
903         in our code. Also, rather than have two completely separate parallel
904         implementations of these functions, a more forward-looking approach is to
905         have one implementation which has a few checks to isWebGL1() in strategic
906         places. (This way, bugs only have to be fixed in a single place). Therefore,
907         this patch deletes the WebGL 2 versions of these functions.
908
909         * html/canvas/WebGL2RenderingContext.cpp: These functions are moved to
910         WebGLRenderingContextBase.
911         (WebCore::WebGL2RenderingContext::isIntegerFormat):
912         (WebCore::WebGL2RenderingContext::copyTexImage2D): Deleted.
913         (WebCore::WebGL2RenderingContext::texSubImage2DBase): Deleted.
914         (WebCore::WebGL2RenderingContext::texSubImage2DImpl): Deleted.
915         (WebCore::WebGL2RenderingContext::texSubImage2D): Deleted.
916         (WebCore::WebGL2RenderingContext::validateTexFuncParameters): Deleted.
917         (WebCore::WebGL2RenderingContext::validateTexFuncFormatAndType): Deleted.
918         (WebCore::WebGL2RenderingContext::validateTexFuncData): Deleted.
919         * html/canvas/WebGL2RenderingContext.h: Moved function implementations to
920         WebGLRenderingContextBase.
921         * html/canvas/WebGLRenderingContext.cpp: Ditto.
922         (WebCore::WebGLRenderingContext::copyTexImage2D): Deleted.
923         (WebCore::WebGLRenderingContext::texSubImage2DBase): Deleted.
924         (WebCore::WebGLRenderingContext::texSubImage2DImpl): Deleted.
925         (WebCore::WebGLRenderingContext::texSubImage2D): Deleted.
926         (WebCore::WebGLRenderingContext::validateTexFuncParameters): Deleted.
927         (WebCore::WebGLRenderingContext::validateTexFuncFormatAndType): Deleted.
928         (WebCore::WebGLRenderingContext::validateTexFuncData): Deleted.
929         * html/canvas/WebGLRenderingContext.h: Moved function implementations to
930         WebGLRenderingContextBase.
931         * html/canvas/WebGLRenderingContextBase.cpp:
932         (WebCore::WebGLRenderingContextBase::validateSettableTexInternalFormat):
933         Teach about new depth texture formats.
934         (WebCore::WebGLRenderingContextBase::copyTexSubImage2D): Rename
935         "internalformat" to "internalFormat". Teach about the distinction between
936         format and internalFormat. When pre-filling textures with 0s to work around
937         buggy drivers, we need a new way of knowing which format/type arguments to
938         pass to texSubImage2D() which are compatible with the texture's internal
939         format. The implementation of this function was added to GraphicsContext3D
940         and is called here.
941         (WebCore::WebGLRenderingContextBase::generateMipmap): Teach about the
942         distinction between format and internalFormat.
943         (WebCore::internalFormatTheme): This is used so readPixels() knows what
944         kind of format/type arguments are compatible with the texture's internal
945         format.
946         (WebCore::numberOfComponentsForFormat): Ditto.
947         (WebCore::numberOfComponentsForInternalFormat): Ditto.
948         (WebCore::WebGLRenderingContextBase::readPixels): Many more format/type
949         combinations are required in order to test the various new kinds of
950         textures.
951         (WebCore::WebGLRenderingContextBase::texImage2DBase): Rename internalformat
952         to internalFormat, and teach about the distinction between format and
953         internalFormat.
954         (WebCore::WebGLRenderingContextBase::validateTexFunc): Ditto.
955         (WebCore::WebGLRenderingContextBase::texImage2D): Ditto.
956         (WebCore::WebGLRenderingContextBase::texSubImage2DImpl): Moved from
957         WebGLRenderingContext.
958         (WebCore::WebGLRenderingContextBase::texSubImage2D): Ditto.
959         (WebCore::WebGLRenderingContextBase::validateArrayBufferType): Ditto.
960         (WebCore::WebGLRenderingContextBase::validateTexFuncData): Ditto.
961         (WebCore::WebGLRenderingContextBase::validateTexFuncParameters): Ditto.
962         (WebCore::WebGLRenderingContextBase::validateTexFuncFormatAndType): Ditto.
963         This is the main function where the new internalFormats are dealt with.
964         The OpenGL ES spec lists a table of all the internalFormats and all their
965         compatible format/type values. This table is entered into this function to
966         check that the combinations are correct.
967         (WebCore::WebGLRenderingContextBase::texSubImage2DBase): Moved from
968         WebGLRenderingContext.
969         (WebCore::WebGLRenderingContextBase::copyTexImage2D): Ditto.
970         (WebCore::WebGLRenderingContextBase::validateSettableTexFormat): Deleted.
971         * html/canvas/WebGLRenderingContextBase.h: No longer overrides virtual
972         functions.
973         * platform/graphics/GraphicsContext3D.cpp:
974         (WebCore::GraphicsContext3D::computeFormatAndTypeParameters): Because
975         this is inside GraphicsContext3D, it doesn't need any isWebGL1() checks.
976         Teach about new enums.
977         (WebCore::GraphicsContext3D::possibleFormatAndTypeForInternalFormat):
978         Ditto.
979         (WebCore::GraphicsContext3D::packImageData):
980         (WebCore::GraphicsContext3D::packPixels): It is possible to try to
981         copy data from a video into one of these new formats. Currently, we
982         implement this by swizzling on the CPU. Rather than implementing all the
983         swizzling functions in this patch (which would make this patch much
984         larger), simply bail in this case. We will implement this later.
985         (WebCore::GraphicsContext3D::getClearBitsByFormat): Update.
986         * platform/graphics/GraphicsContext3D.h:
987         (WebCore::GraphicsContext3D::hasAlpha): Ditto.
988         (WebCore::GraphicsContext3D::hasColor): Ditto.
989
990 2016-11-14  Simon Fraser  <simon.fraser@apple.com>
991
992         Scrolling when zoomed doesn't always use the correct layout viewport
993         https://bugs.webkit.org/show_bug.cgi?id=164756
994
995         Reviewed by Dean Jackson.
996
997         The scrolling thread was always using the layout viewport rect pushed onto it and
998         never computing a new one, so when scrolling around after zooming position:fixed
999         elements would not get the expected visual viewport behavior.
1000
1001         Fix by having ScrollingTreeFrameScrollingNode updating its notion of the layout viewport
1002         on scrolls.
1003
1004         Not testable because we can't dump the scrolling tree on Mac (yet).
1005
1006         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
1007         (WebCore::ScrollingTreeFrameScrollingNode::setLayoutViewport):
1008         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
1009         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPositionWithoutContentEdgeConstraints):
1010
1011 2016-11-14  Ryosuke Niwa  <rniwa@webkit.org>
1012
1013         document.createElementNS doesn't construct a custom element
1014         https://bugs.webkit.org/show_bug.cgi?id=164700
1015
1016         Reviewed by Darin Adler.
1017
1018         Fixed the bug that document.createElementNS doesn't create a custom element or enqueue it to upgrade.
1019
1020         Also made constructCustomElementSynchronously not call the custom element constructors with the element's
1021         local name as the first argument, which was a non-standard behavior added during prototyping.
1022
1023         Test: fast/custom-elements/DOMImplementation-createDocument.html
1024               fast/custom-elements/document-createElementNS.html
1025
1026         * bindings/js/JSCustomElementInterface.cpp:
1027         (WebCore::JSCustomElementInterface::constructElementWithFallback): Added a variant that takes QualifiedName
1028         instead of AtomicString.
1029         (WebCore::constructCustomElementSynchronously): Don't add the local name as an argument.
1030         * bindings/js/JSCustomElementInterface.h:
1031
1032         * dom/CustomElementRegistry.cpp:
1033         (WebCore::CustomElementRegistry::findInterface): Just find the interface based on the local name after
1034         checking the namespace URI to be that of the XHTML. We need to ignore the prefix for the purpose of looking
1035         up the custom element definition as specified in the latest HTML specification:
1036         https://html.spec.whatwg.org/multipage/scripting.html#look-up-a-custom-element-definition
1037
1038         * dom/DOMImplementation.cpp:
1039         (WebCore::DOMImplementation::createDocument): Added an assertion to make sure we don't invoke scripts while
1040         constructing the document element.
1041
1042         * dom/Document.cpp:
1043         (WebCore::createUpgradeCandidateElement): Made this function create a HTMLUnknownElement instead of returning
1044         nullptr to share more code. Also added a variant which takes QualifiedName.
1045         (WebCore::isValidHTMLElementName): Added; helpers for createHTMLElementWithNameValidation to call isValidName
1046         on Document with the right argument.
1047         (WebCore::createHTMLElementWithNameValidation): Templatized the function to be called with either AtomicString
1048         or QualifiedName for the name.
1049         (WebCore::createFallbackHTMLElement):
1050         (WebCore::Document::createElementNS): Call createHTMLElementWithNameValidation to create a custom element if
1051         possible. This function ends up re-validating the element name before creating a HTMLUnknownElement but that
1052         shouldn't be a common scenario to matter. In fact, createElementNS is a rarely used API.
1053
1054 2016-11-14  Chris Dumez  <cdumez@apple.com>
1055
1056         Avoid copying attributes vector when constructing a CustomElement in HTMLTreeBuilder
1057         https://bugs.webkit.org/show_bug.cgi?id=164734
1058
1059         Reviewed by Ryosuke Niwa.
1060
1061         Avoid copying attributes vector when constructing a CustomElement in HTMLTreeBuilder.
1062
1063         * html/parser/HTMLConstructionSite.cpp:
1064         (WebCore::HTMLConstructionSite::insertCustomElement):
1065         * html/parser/HTMLConstructionSite.h:
1066         * html/parser/HTMLStackItem.h:
1067         (WebCore::HTMLStackItem::HTMLStackItem):
1068         (WebCore::HTMLStackItem::create):
1069         * html/parser/HTMLTreeBuilder.cpp:
1070         (WebCore::HTMLTreeBuilder::didCreateCustomOrCallbackElement):
1071
1072 2016-11-14  Chris Dumez  <cdumez@apple.com>
1073
1074         Inline QualifiedName::toString() method
1075         https://bugs.webkit.org/show_bug.cgi?id=164726
1076
1077         Reviewed by Ryosuke Niwa.
1078
1079         Inline QualifiedName::toString() method to limit performance impact of r208674.
1080
1081         * dom/QualifiedName.cpp:
1082         (WebCore::QualifiedName::toString): Deleted.
1083         * dom/QualifiedName.h:
1084         (WebCore::QualifiedName::toString):
1085
1086 2016-11-14  Dave Hyatt  <hyatt@apple.com>
1087
1088         [CSS Parser] Support the font-synthesis property
1089         https://bugs.webkit.org/show_bug.cgi?id=164728
1090
1091         Reviewed by Dean Jackson.
1092
1093         * css/parser/CSSPropertyParser.cpp:
1094         (WebCore::consumeFontSynthesis):
1095         (WebCore::CSSPropertyParser::parseSingleValue):
1096
1097 2016-11-12  Sam Weinig  <sam@webkit.org>
1098
1099         [SVG] Moving more special casing of SVG out of the bindings - SVGNumber/SVGPoint/SVGRect/SVGLength/SVGTransform/SVGMatrix
1100         https://bugs.webkit.org/show_bug.cgi?id=164696
1101
1102         Reviewed by Darin Adler.
1103
1104         - Make SVGNumber, SVGPoint, SVGRect, SVGLength, SVGTransform and SVGMatrix
1105           real classes and stop special casing them in the bindings generator. This 
1106           removes the remaining non-list SVG specializations from the bindings generator.
1107         - Renamed existing SVGLength, SVGTransform and SVGMatrix to SVGLengthValue, 
1108           SVGTransformValue and SVGMatrixValue. There are no SVNumberValue, SVGPointValue 
1109           and SVGRectValue classes, as float, FloatPoint and FloatRect can be used 
1110           directly. Going forward, we can get rid of SVGMatrixValue as well, and just
1111           use AffineTransform, but that will be done in a separate change.
1112
1113         * WebCore.xcodeproj/project.pbxproj:
1114         * CMakeLists.txt:
1115         Add new files.
1116
1117         * bindings/js/JSSVGLengthCustom.cpp:
1118         (WebCore::JSSVGLength::value): Deleted.
1119         (WebCore::JSSVGLength::setValue): Deleted.
1120         (WebCore::JSSVGLength::convertToSpecifiedUnits): Deleted.
1121         Removed. This can now be generated completely.
1122
1123         * bindings/scripts/CodeGenerator.pm:
1124         (SkipIncludeHeader):
1125         Remove special casing of SVGNumber. A header for it now exists.
1126
1127         (GetSVGWrappedTypeNeedingTearOff):
1128         Remove special casing SVGPropertyTearOffs. None remain.
1129
1130         (ShouldPassWrapperByReference):
1131         Allow all tear off types to be passed by reference.
1132
1133         (IsSVGTypeWithWritablePropertiesNeedingTearOff):
1134         Remove now unused function.
1135
1136         * bindings/scripts/CodeGeneratorJS.pm:
1137         (GetImplClassName):
1138         (GenerateHeader):
1139         (GenerateImplementation):
1140         (GenerateParametersCheck):
1141         (GenerateImplementationFunctionCall):
1142         (GetSVGPropertyTypes):
1143         (NativeToJSValue):
1144         (GenerateConstructorDefinition):
1145         Remove non-property tear off specific code. 
1146         
1147         (IsNativeType): 
1148         Remove unused function.
1149
1150         * css/CSSPropertyNames.in:
1151         * css/SVGCSSComputedStyleDeclaration.cpp:
1152         (WebCore::strokeDashArrayToCSSValueList):
1153         (WebCore::ComputedStyleExtractor::svgPropertyValue):
1154         * css/StyleBuilderConverter.h:
1155         (WebCore::StyleBuilderConverter::convertSVGLengthValue):
1156         (WebCore::StyleBuilderConverter::convertSVGLengthVector):
1157         (WebCore::StyleBuilderConverter::convertStrokeDashArray):
1158         * css/StyleBuilderCustom.h:
1159         (WebCore::StyleBuilderCustom::applyValueBaselineShift):
1160         * page/animation/CSSPropertyAnimation.cpp:
1161         (WebCore::blendFunc):
1162         (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
1163         * rendering/style/RenderStyle.h:
1164         (WebCore::RenderStyle::strokeDashArray):
1165         (WebCore::RenderStyle::setStrokeDashArray):
1166         (WebCore::RenderStyle::baselineShiftValue):
1167         (WebCore::RenderStyle::setBaselineShiftValue):
1168         (WebCore::RenderStyle::kerning):
1169         (WebCore::RenderStyle::setKerning):
1170         * rendering/style/SVGRenderStyle.h:
1171         (WebCore::SVGRenderStyle::initialStrokeDashArray):
1172         (WebCore::SVGRenderStyle::initialBaselineShiftValue):
1173         (WebCore::SVGRenderStyle::initialKerning):
1174         (WebCore::SVGRenderStyle::setStrokeDashArray):
1175         (WebCore::SVGRenderStyle::setKerning):
1176         (WebCore::SVGRenderStyle::setBaselineShiftValue):
1177         (WebCore::SVGRenderStyle::strokeDashArray):
1178         (WebCore::SVGRenderStyle::kerning):
1179         (WebCore::SVGRenderStyle::baselineShiftValue):
1180         * rendering/style/SVGRenderStyleDefs.h:
1181         Update for name change of SVGLength to SVGLengthValue.
1182
1183         * rendering/svg/RenderSVGImage.cpp:
1184         Remove unused include.
1185
1186         * html/canvas/DOMPath.h:
1187         Add an overload that takes a DOMMatrix, now that it is distinct from
1188         AffineTransform.
1189
1190         * rendering/svg/RenderSVGRoot.cpp:
1191         (WebCore::RenderSVGRoot::buildLocalToBorderBoxTransform):
1192         Update for name change of SVGPoint to FloatPoint.
1193
1194         * rendering/svg/SVGRenderSupport.cpp:
1195         (WebCore::SVGRenderSupport::applyStrokeStyleToContext):
1196         * rendering/svg/SVGRenderTreeAsText.cpp:
1197         (WebCore::writeStyle):
1198         * rendering/svg/SVGTextLayoutEngineBaseline.cpp:
1199         (WebCore::SVGTextLayoutEngineBaseline::calculateBaselineShift):
1200         * rendering/svg/SVGTextLayoutEngineSpacing.cpp:
1201         (WebCore::SVGTextLayoutEngineSpacing::calculateCSSKerningAndSpacing):
1202         Update for name change of SVGLength to SVGLengthValue.
1203
1204         * rendering/svg/SVGTextQuery.cpp:
1205         (WebCore::SVGTextQuery::startPositionOfCharacter):
1206         (WebCore::SVGTextQuery::endPositionOfCharacter):
1207         (WebCore::SVGTextQuery::characterNumberAtPosition):
1208         * rendering/svg/SVGTextQuery.h:
1209         Update for name change of SVGPoint to FloatPoint.
1210
1211         * svg/LinearGradientAttributes.h:
1212         * svg/PatternAttributes.h:
1213         * svg/RadialGradientAttributes.h:
1214         Update for name change of SVGLength to SVGLengthValue.
1215
1216         * svg/SVGAllInOne.cpp:
1217         Remove SVGLength.cpp
1218
1219         * svg/SVGAngle.h:
1220         Add missing newline.
1221
1222         * svg/SVGAnimateTransformElement.cpp:
1223         (WebCore::SVGAnimateTransformElement::SVGAnimateTransformElement):
1224         (WebCore::SVGAnimateTransformElement::parseAttribute):
1225         * svg/SVGAnimateTransformElement.h:
1226         Update for name change of SVGTransform to SVGTransformValue.
1227         
1228         * svg/SVGAnimatedLength.cpp:
1229         (WebCore::SVGAnimatedLengthAnimator::SVGAnimatedLengthAnimator):
1230         (WebCore::SVGAnimatedLengthAnimator::constructFromString):
1231         (WebCore::SVGAnimatedLengthAnimator::addAnimatedTypes):
1232         (WebCore::parseLengthFromString):
1233         (WebCore::SVGAnimatedLengthAnimator::calculateAnimatedValue):
1234         (WebCore::SVGAnimatedLengthAnimator::calculateDistance):
1235         * svg/SVGAnimatedLength.h:
1236         * svg/SVGAnimatedLengthList.cpp:
1237         (WebCore::SVGAnimatedLengthListAnimator::SVGAnimatedLengthListAnimator):
1238         (WebCore::SVGAnimatedLengthListAnimator::addAnimatedTypes):
1239         (WebCore::parseLengthListFromString):
1240         (WebCore::SVGAnimatedLengthListAnimator::calculateAnimatedValue):
1241         * svg/SVGAnimatedLengthList.h:
1242         Update for name change of SVGLength to SVGLengthValue.
1243
1244         * svg/SVGAnimatedNumberList.h:
1245         Include the new SVGNumber.h and switch typedef to type alias.
1246
1247         * svg/SVGAnimatedPointList.cpp:
1248         Add now necessary include of SVGPoint.h
1249
1250         * svg/SVGAnimatedRect.h:
1251         Update for name change of SVGPropertyTearOff<FloatRect> to SVGRect.
1252     
1253         * svg/SVGAnimatedTransformList.cpp:
1254         (WebCore::SVGAnimatedTransformListAnimator::SVGAnimatedTransformListAnimator):
1255         (WebCore::SVGAnimatedTransformListAnimator::addAnimatedTypes):
1256         (WebCore::SVGAnimatedTransformListAnimator::calculateAnimatedValue):
1257         (WebCore::SVGAnimatedTransformListAnimator::calculateDistance):
1258         Update for name change of SVGTransform to SVGTransformValue.
1259
1260         * svg/SVGAnimatedType.cpp:
1261         (WebCore::SVGAnimatedType::createLength):
1262         (WebCore::SVGAnimatedType::setValueAsString):
1263         * svg/SVGAnimatedType.h:
1264         (WebCore::SVGAnimatedType::length):
1265         * svg/SVGCircleElement.cpp:
1266         (WebCore::SVGCircleElement::parseAttribute):
1267         * svg/SVGCursorElement.cpp:
1268         (WebCore::SVGCursorElement::parseAttribute):
1269         * svg/SVGDocument.cpp:
1270         (WebCore::SVGDocument::startPan):
1271         * svg/SVGEllipseElement.cpp:
1272         (WebCore::SVGEllipseElement::parseAttribute):
1273         * svg/SVGFilterElement.cpp:
1274         (WebCore::SVGFilterElement::parseAttribute):
1275         * svg/SVGFilterPrimitiveStandardAttributes.cpp:
1276         (WebCore::SVGFilterPrimitiveStandardAttributes::parseAttribute):
1277         * svg/SVGForeignObjectElement.cpp:
1278         (WebCore::SVGForeignObjectElement::parseAttribute):
1279         * svg/SVGImageElement.cpp:
1280         (WebCore::SVGImageElement::parseAttribute):
1281         * svg/SVGLengthContext.cpp:
1282         (WebCore::SVGLengthContext::resolveRectangle):
1283         (WebCore::SVGLengthContext::resolvePoint):
1284         (WebCore::SVGLengthContext::resolveLength):
1285         * svg/SVGLengthContext.h:
1286         * svg/SVGLengthList.cpp:
1287         (WebCore::SVGLengthList::parse):
1288         * svg/SVGLengthList.h:
1289         (WebCore::SVGPropertyTraits<SVGLengthList>::initialValue):
1290         * svg/SVGLineElement.cpp:
1291         (WebCore::SVGLineElement::parseAttribute):
1292         * svg/SVGLinearGradientElement.cpp:
1293         (WebCore::SVGLinearGradientElement::parseAttribute):
1294         * svg/SVGMarkerElement.cpp:
1295         (WebCore::SVGMarkerElement::parseAttribute):
1296         * svg/SVGMaskElement.cpp:
1297         (WebCore::SVGMaskElement::parseAttribute):
1298         * svg/SVGPatternElement.cpp:
1299         (WebCore::SVGPatternElement::parseAttribute):
1300         * svg/SVGRadialGradientElement.cpp:
1301         (WebCore::SVGRadialGradientElement::parseAttribute):
1302         * svg/SVGRectElement.cpp:
1303         (WebCore::SVGRectElement::parseAttribute):
1304         * svg/SVGTextPathElement.cpp:
1305         (WebCore::SVGTextPathElement::parseAttribute):
1306         Update for name change of SVGLength to SVGLengthValue.
1307
1308         * svg/SVGLength.cpp: Removed.
1309         * svg/SVGLength.h:
1310         (WebCore::SVGLength::create):
1311         (WebCore::SVGLength::unitType):
1312         (WebCore::SVGLength::valueForBindings):
1313         (WebCore::SVGLength::setValueForBindings):
1314         (WebCore::SVGLength::valueInSpecifiedUnits):
1315         (WebCore::SVGLength::setValueInSpecifiedUnits):
1316         (WebCore::SVGLength::valueAsString):
1317         (WebCore::SVGLength::setValueAsString):
1318         (WebCore::SVGLength::newValueSpecifiedUnits):
1319         (WebCore::SVGLength::convertToSpecifiedUnits):
1320         (WebCore::SVGLength::SVGLength):
1321         Implement the SVGLength interface as a tear off.
1322
1323         * svg/SVGLength.idl:
1324         Add annotations for exceptions, custom naming, and remove now unnecessary
1325         custom binding annotation.
1326
1327         * svg/SVGLengthValue.cpp: Copied from Source/WebCore/svg/SVGLength.cpp.
1328         * svg/SVGLengthValue.h: Copied from Source/WebCore/svg/SVGLength.h.
1329
1330         * svg/SVGGraphicsElement.cpp:
1331         (WebCore::SVGGraphicsElement::getCTMForBindings):
1332         (WebCore::SVGGraphicsElement::getScreenCTMForBindings):
1333         (WebCore::SVGGraphicsElement::getBBoxForBindings):
1334         * svg/SVGGraphicsElement.h:
1335         Add bindings specific versions of transformation access functions that return
1336         tear offs.
1337
1338         * svg/SVGGraphicsElement.idl:
1339         Annotate tear off returning functions with NewObject and ImplementedAs as necessary.
1340
1341         * svg/SVGLocatable.cpp:
1342         (WebCore::SVGLocatable::getTransformToElement):
1343         * svg/SVGLocatable.h:
1344         Change getTransformToElement to return a Ref<SVGMatrix> as that is what the binding
1345         wants.
1346
1347         * svg/SVGMatrix.h:
1348         Implement the SVGMatrix interface as a tear off.
1349         
1350         * svg/SVGMatrix.idl:
1351         Add annotations for exceptions. Remove meaningless Immutable annotation.
1352
1353         * svg/SVGMatrixValue.h: Copied from Source/WebCore/svg/SVGMatrix.h.
1354
1355         * svg/SVGNumber.h: Added.
1356         (WebCore::SVGNumber::create):
1357         (WebCore::SVGNumber::valueForBindings):
1358         (WebCore::SVGNumber::setValueForBindings):
1359         (WebCore::SVGNumber::SVGNumber):
1360         Implement the SVGNumber interface as a tear off.
1361
1362         * svg/SVGNumber.idl:
1363         Add exception annotation and custom naming annotations.
1364
1365         * svg/SVGNumberList.h:
1366         Update for name change of SVGPropertyTearOff<float> to SVGNumber.
1367
1368         * svg/SVGPathElement.cpp:
1369         (WebCore::SVGPathElement::getPointAtLength):
1370         * svg/SVGPathElement.h:
1371         Make getPointAtLength return a Ref<SVGPoint> to match the bindings.
1372
1373         * svg/SVGPathElement.idl:
1374         Annotate getPointAtLength with [NewObject].
1375
1376         * svg/SVGPathTraversalStateBuilder.cpp:
1377         (WebCore::SVGPathTraversalStateBuilder::currentPoint):
1378         * svg/SVGPathTraversalStateBuilder.h:
1379         * svg/SVGPathUtilities.cpp:
1380         (WebCore::getPointAtLengthOfSVGPathByteStream):
1381         * svg/SVGPathUtilities.h:
1382         * svg/SVGPointList.cpp:
1383         (WebCore::SVGPointList::valueAsString):
1384         * svg/SVGPointList.h:
1385         * svg/SVGPolyElement.cpp:
1386         Update for name change of SVGPoint to FloatPoint.
1387         
1388         * svg/SVGPoint.h:
1389         (WebCore::SVGPoint::create):
1390         (WebCore::SVGPoint::x):
1391         (WebCore::SVGPoint::setX):
1392         (WebCore::SVGPoint::y):
1393         (WebCore::SVGPoint::setY):
1394         (WebCore::SVGPoint::matrixTransform):
1395         (WebCore::SVGPoint::SVGPoint):
1396         Implement the SVGPoint interface as a tear off. Remove typedef of FloatPoint
1397         to SVGPoint.
1398
1399         * svg/SVGPoint.idl:
1400         Add exception and NewObject annotations.
1401
1402         * svg/SVGRect.h:
1403         (WebCore::SVGRect::create):
1404         (WebCore::SVGRect::x):
1405         (WebCore::SVGRect::setX):
1406         (WebCore::SVGRect::y):
1407         (WebCore::SVGRect::setY):
1408         (WebCore::SVGRect::width):
1409         (WebCore::SVGRect::setWidth):
1410         (WebCore::SVGRect::height):
1411         (WebCore::SVGRect::setHeight):
1412         Implement the SVGRect interface as a tear off. FloatRect SVGPropertyTraits have 
1413         been moved to SVGRectTraits.h.
1414
1415         * svg/SVGRect.idl:
1416         Add exception annotations.
1417
1418         * svg/SVGRectTraits.h: Copied from Source/WebCore/svg/SVGRect.cpp.
1419         
1420         * svg/SVGSVGElement.cpp:
1421         (WebCore::SVGSVGElement::viewport):
1422         (WebCore::SVGSVGElement::currentTranslate):
1423         (WebCore::SVGSVGElement::parseAttribute):
1424         (WebCore::SVGSVGElement::collectIntersectionOrEnclosureList):
1425         (WebCore::SVGSVGElement::getIntersectionList):
1426         (WebCore::SVGSVGElement::getEnclosureList):
1427         (WebCore::SVGSVGElement::checkIntersection):
1428         (WebCore::SVGSVGElement::checkEnclosure):
1429         (WebCore::SVGSVGElement::createSVGNumber):
1430         (WebCore::SVGSVGElement::createSVGLength):
1431         (WebCore::SVGSVGElement::createSVGPoint):
1432         (WebCore::SVGSVGElement::createSVGMatrix):
1433         (WebCore::SVGSVGElement::createSVGRect):
1434         (WebCore::SVGSVGElement::createSVGTransform):
1435         (WebCore::SVGSVGElement::createSVGTransformFromMatrix):
1436         * svg/SVGSVGElement.h:
1437         (WebCore::SVGSVGElement::currentTranslateValue):
1438         (WebCore::SVGSVGElement::currentTranslate): Deleted.
1439         (WebCore::SVGSVGElement::createSVGNumber): Deleted.
1440         Update functions taking tear off values to take the wrappers, and update
1441         the factory functions returning tear offs, to return the wrappers.
1442         
1443         * svg/SVGSVGElement.idl:
1444         Annotate functions/properties returning tear offs with [NewObject].
1445
1446         * svg/SVGTextContentElement.cpp:
1447         (WebCore::SVGTextContentElement::synchronizeTextLength):
1448         (WebCore::SVGTextContentElement::lookupOrCreateTextLengthWrapper):
1449         (WebCore::SVGTextContentElement::textLengthAnimated):
1450         (WebCore::SVGTextContentElement::getStartPositionOfChar):
1451         (WebCore::SVGTextContentElement::getEndPositionOfChar):
1452         (WebCore::SVGTextContentElement::getExtentOfChar):
1453         (WebCore::SVGTextContentElement::getCharNumAtPosition):
1454         (WebCore::SVGTextContentElement::parseAttribute):
1455         * svg/SVGTextContentElement.h:
1456         (WebCore::SVGTextContentElement::specifiedTextLength):
1457         Update functions returning tear off values to return the wrappers
1458         and ones taking the values to take the wrappers.
1459
1460         * svg/SVGTextContentElement.idl:
1461         Annotate functions/properties returning tear offs with [NewObject].
1462
1463         * svg/SVGTransform.cpp:
1464         (WebCore::SVGTransform::matrix):
1465         * svg/SVGTransform.h:
1466         (WebCore::SVGTransform::create):
1467         (WebCore::SVGTransform::type):
1468         (WebCore::SVGTransform::angle):
1469         (WebCore::SVGTransform::setMatrix):
1470         (WebCore::SVGTransform::setTranslate):
1471         (WebCore::SVGTransform::setScale):
1472         (WebCore::SVGTransform::setRotate):
1473         (WebCore::SVGTransform::setSkewX):
1474         (WebCore::SVGTransform::setSkewY):
1475         Implement the SVGTransform interface as a tear off.
1476
1477         * svg/SVGTransform.idl:
1478         Add ConstantsScope annotation to allow the constants to be defined on 
1479         SVGTransformValue. Add exception and NewObject annotations.
1480
1481         * svg/SVGTransformDistance.cpp:
1482         (WebCore::SVGTransformDistance::SVGTransformDistance):
1483         (WebCore::SVGTransformDistance::scaledDistance):
1484         (WebCore::SVGTransformDistance::addSVGTransforms):
1485         (WebCore::SVGTransformDistance::addToSVGTransform):
1486         (WebCore::SVGTransformDistance::distance):
1487         * svg/SVGTransformDistance.h:
1488         * svg/SVGTransformList.cpp:
1489         (WebCore::SVGTransformList::createSVGTransformFromMatrix):
1490         (WebCore::SVGTransformList::consolidate):
1491         * svg/SVGTransformList.h:
1492         (WebCore::SVGPropertyTraits<SVGTransformList>::initialValue):
1493         * svg/SVGTransformable.cpp:
1494         (WebCore::SVGTransformable::parseTransformValue):
1495         (WebCore::parseAndSkipType):
1496         (WebCore::SVGTransformable::parseTransformType):
1497         (WebCore::SVGTransformable::parseTransformAttribute):
1498         * svg/SVGTransformable.h:
1499         * svg/SVGUseElement.cpp:
1500         (WebCore::SVGUseElement::parseAttribute):
1501         Update for name change of SVGTransform to SVGTransformValue.
1502
1503         * svg/SVGTransformList.idl:
1504         Annotate functions returning tear offs with NewObject.
1505
1506         * svg/SVGTransformValue.cpp: Copied from Source/WebCore/svg/SVGTransform.cpp.
1507         * svg/SVGTransformValue.h: Copied from Source/WebCore/svg/SVGTransform.h.
1508
1509         * svg/SVGZoomEvent.cpp:
1510         (WebCore::SVGZoomEvent::zoomRectScreen):
1511         (WebCore::SVGZoomEvent::previousTranslate):
1512         (WebCore::SVGZoomEvent::newTranslate):
1513         * svg/SVGZoomEvent.h:
1514         Update for change to SVGPoint/SVGRect. SVGPoint values become FloatPoints. Functions
1515         returning SVGPoint/SVGRect now return Ref<SVGPoint>/Ref<SVGRect>.
1516
1517         * svg/SVGZoomEvent.idl:
1518         Annotate function returning tear off with NewObject.
1519
1520         * svg/properties/SVGAnimatedListPropertyTearOff.h:
1521         (WebCore::SVGAnimatedListPropertyTearOff::findItem):
1522         Switch typedefs to type aliases. Define ListItemTearOff using SVGPropertyTraits
1523         to get the correct tear off type (as we do for the other list property tear off 
1524         classes.)
1525  
1526         * svg/properties/SVGListProperty.h:
1527         (WebCore::SVGListProperty::clearValues):
1528         (WebCore::SVGListProperty::clearValuesAndWrappers):
1529         (WebCore::SVGListProperty::initializeValues):
1530         (WebCore::SVGListProperty::initializeValuesAndWrappers):
1531         (WebCore::SVGListProperty::getItemValues):
1532         (WebCore::SVGListProperty::getItemValuesAndWrappers):
1533         (WebCore::SVGListProperty::insertItemBeforeValues):
1534         (WebCore::SVGListProperty::insertItemBeforeValuesAndWrappers):
1535         (WebCore::SVGListProperty::canReplaceItem):
1536         (WebCore::SVGListProperty::replaceItemValues):
1537         (WebCore::SVGListProperty::replaceItemValuesAndWrappers):
1538         (WebCore::SVGListProperty::canRemoveItem):
1539         (WebCore::SVGListProperty::removeItemValues):
1540         (WebCore::SVGListProperty::removeItemValuesAndWrappers):
1541         (WebCore::SVGListProperty::appendItemValues):
1542         (WebCore::SVGListProperty::appendItemValuesAndWrappers):
1543         * svg/properties/SVGListPropertyTearOff.h:
1544         (WebCore::SVGListPropertyTearOff::initialize):
1545         (WebCore::SVGListPropertyTearOff::getItem):
1546         (WebCore::SVGListPropertyTearOff::insertItemBefore):
1547         (WebCore::SVGListPropertyTearOff::replaceItem):
1548         (WebCore::SVGListPropertyTearOff::removeItem):
1549         (WebCore::SVGListPropertyTearOff::appendItem):
1550         * svg/properties/SVGPathSegListPropertyTearOff.h:
1551         * svg/properties/SVGStaticListPropertyTearOff.h:
1552         * svg/properties/SVGTransformListPropertyTearOff.h:
1553         Change functions returning PtrListItemTearOff, to instead return
1554         Ref<ListItemTearOff>. To accomplish this, remove unreachable conditions
1555         that were returning nullptr, and replace them with a assertions (these
1556         were cases where a function like canGetItem() was called, and it only
1557         did one of two things, returning an exception, or returned true).
1558
1559         * svg/properties/SVGMatrixTearOff.h:
1560         Update for SVGMatrix's addition, this can now inherit from SVGMatrix. Remove
1561         incorrect comment and update some SVGMatrix types to SVGMatrixValues.
1562
1563         * svg/properties/SVGStaticPropertyTearOff.h:
1564         Require the use of SVGStaticPropertyTearOff to pass in the tear off type, rather
1565         than the value type, so it can be directly inherited from. This allow the one user 
1566         of this class, SVGSVGElement::currentTranslate, to specialize on SVGPoint directly. 
1567
1568         * bindings/scripts/test/JS/JSTestObj.cpp:
1569         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
1570         Update test results now that svg property tear offs are not handled specially.
1571
1572 2016-11-14  Youenn Fablet  <youenn@apple.com>
1573
1574         Move updateSignalingState to PeerConnectionBackend
1575         https://bugs.webkit.org/show_bug.cgi?id=164719
1576
1577         Reviewed by Eric Carlson.
1578
1579         No change of behavior.
1580
1581         Refactoring MediaEndpointPeerConnection signaling state update to PeerConnectionBackend.
1582         It is not specific to MediaEndpointPeerConnection and can be reused for other backends.
1583
1584         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
1585         (WebCore::MediaEndpointPeerConnection::setLocalDescriptionTask):
1586         (WebCore::MediaEndpointPeerConnection::setRemoteDescriptionTask):
1587         * Modules/mediastream/PeerConnectionBackend.cpp:
1588         (WebCore::PeerConnectionBackend::updateSignalingState):
1589         * Modules/mediastream/PeerConnectionBackend.h:
1590
1591 2016-11-14  Dean Jackson  <dino@apple.com>
1592
1593         Handle filter() image type in new CSS Parser
1594         https://bugs.webkit.org/show_bug.cgi?id=164673
1595         <rdar://problems/29231376>
1596
1597         Reviewed by Darin Adler.
1598
1599         Add support for the <image> type filter() to the
1600         new CSS Parser. This involved moving some functions
1601         from CSSPropertyParser into CSSPropertyParserHelpers.
1602
1603         Covered by fast/filter-image tests.
1604
1605         * css/CSSValueKeywords.in:
1606         * css/parser/CSSPropertyParser.cpp:
1607         (WebCore::consumeShadow):
1608         (WebCore::parseSingleShadow): Deleted.
1609         (WebCore::consumeFilterFunction): Deleted.
1610         (WebCore::consumeFilter): Deleted.
1611         * css/parser/CSSPropertyParserHelpers.cpp:
1612         (WebCore::CSSPropertyParserHelpers::consumeFilterImage):
1613         (WebCore::CSSPropertyParserHelpers::consumeGeneratedImage):
1614         (WebCore::CSSPropertyParserHelpers::isGeneratedImage):
1615         (WebCore::CSSPropertyParserHelpers::consumeFilterFunction):
1616         (WebCore::CSSPropertyParserHelpers::consumeFilter):
1617         (WebCore::CSSPropertyParserHelpers::consumeSingleShadow):
1618         * css/parser/CSSPropertyParserHelpers.h:
1619
1620 2016-11-14  Dave Hyatt  <hyatt@apple.com>
1621
1622         [CSS Parser] Support percentages in word-spacing
1623         https://bugs.webkit.org/show_bug.cgi?id=164721
1624
1625         Reviewed by Dean Jackson.
1626
1627         * css/parser/CSSPropertyParser.cpp:
1628         (WebCore::consumeLetterSpacing):
1629         (WebCore::consumeWordSpacing):
1630         (WebCore::consumeSpacing): Deleted.
1631
1632 2016-11-14  Joanmarie Diggs  <jdiggs@igalia.com>
1633
1634         AX: In ARIA 1.1, the implicit value for aria-level on headings is 2
1635         https://bugs.webkit.org/show_bug.cgi?id=164714
1636
1637         Reviewed by Chris Fleizach.
1638
1639         Return 2 rather than 0 if there is not a valid author-provided value
1640         for aria-level on an ARIA heading.
1641
1642         No new tests required as we have sufficient coverage. Added one new
1643         test case to heading-level.html and updated expectations for it and
1644         for xml-roles-exposed.html.
1645
1646         * accessibility/AccessibilityNodeObject.cpp:
1647         (WebCore::AccessibilityNodeObject::headingLevel):
1648
1649 2016-11-14  Youenn Fablet  <youenn@apple.com>
1650
1651         Refresh RTCDataChannel abstract infrastructure
1652         https://bugs.webkit.org/show_bug.cgi?id=164680
1653
1654         Reviewed by Darin Adler.
1655
1656         No real changes, except that a mock data channel is now returned for layout test.
1657         Covered by activated and rebased test.
1658
1659         Adding support for mock data channel.
1660         Updating data channel creation by using dictionary binding infrastructure.
1661         Storing of options directly in RTCDataChannel to reduce the use of the data channel handler.
1662
1663         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
1664         (WebCore::MediaEndpointPeerConnection::createDataChannelHandler):
1665         * Modules/mediastream/MediaEndpointPeerConnection.h:
1666         * Modules/mediastream/PeerConnectionBackend.h:
1667         * Modules/mediastream/RTCDataChannel.cpp:
1668         (WebCore::RTCDataChannel::create):
1669         (WebCore::RTCDataChannel::RTCDataChannel):
1670         (WebCore::RTCDataChannel::bufferedAmount):
1671         (WebCore::RTCDataChannel::~RTCDataChannel): Deleted.
1672         (WebCore::RTCDataChannel::label): Deleted.
1673         (WebCore::RTCDataChannel::ordered): Deleted.
1674         (WebCore::RTCDataChannel::maxRetransmitTime): Deleted.
1675         (WebCore::RTCDataChannel::maxRetransmits): Deleted.
1676         (WebCore::RTCDataChannel::protocol): Deleted.
1677         (WebCore::RTCDataChannel::negotiated): Deleted.
1678         (WebCore::RTCDataChannel::id): Deleted.
1679         * Modules/mediastream/RTCDataChannel.h:
1680         * Modules/mediastream/RTCDataChannelEvent.cpp:
1681         (WebCore::RTCDataChannelEvent::create):
1682         (WebCore::RTCDataChannelEvent::RTCDataChannelEvent):
1683         (WebCore::RTCDataChannelEvent::~RTCDataChannelEvent): Deleted.
1684         * Modules/mediastream/RTCDataChannelEvent.h:
1685         * Modules/mediastream/RTCPeerConnection.cpp:
1686         (WebCore::RTCPeerConnection::createDataChannel):
1687         * Modules/mediastream/RTCPeerConnection.h:
1688         * Modules/mediastream/RTCPeerConnection.idl:
1689         * platform/mediastream/MediaEndpoint.cpp:
1690         (WebCore::EmptyMediaEndpoint::EmptyMediaEndpoint): Deleted.
1691         * platform/mediastream/MediaEndpoint.h:
1692         * platform/mediastream/RTCDataChannelHandler.h:
1693         * platform/mediastream/RTCDataChannelHandlerClient.h:
1694         * platform/mediastream/RTCPeerConnectionHandler.h:
1695         (WebCore::RTCDataChannelInit::RTCDataChannelInit): Deleted.
1696         * platform/mediastream/openwebrtc/MediaEndpointOwr.cpp:
1697         (WebCore::MediaEndpointOwr::createDataChannelHandler):
1698         * platform/mediastream/openwebrtc/MediaEndpointOwr.h:
1699         * platform/mock/MockMediaEndpoint.cpp:
1700         (WebCore::MockMediaEndpoint::createDataChannelHandler):
1701         * platform/mock/MockMediaEndpoint.h:
1702         * platform/mock/RTCDataChannelHandlerMock.cpp:
1703         (WebCore::RTCDataChannelHandlerMock::RTCDataChannelHandlerMock):
1704         * platform/mock/RTCDataChannelHandlerMock.h:
1705
1706 2016-11-14  David Kilzer  <ddkilzer@apple.com>
1707
1708         Bug 164702: WebContent crash due to checked unsigned overflow in WebCore: WebCore::RenderLayerCompositor::requiresCompositingLayer const + 1104
1709         <https://webkit.org/b/164702>
1710         <rdar://problem/29236368>
1711
1712         Reviewed by Darin Adler.
1713
1714         Test: inspector/layers/layers-compositing-reasons.html
1715
1716         * rendering/RenderLayerCompositor.cpp:
1717         (WebCore::RenderLayerCompositor::requiresCompositingForCanvas):
1718         Don't composite if the canvas area overflows.
1719
1720 2016-11-14  Chris Dumez  <cdumez@apple.com>
1721
1722         Fix the !ENABLE(FETCH_API) build after r208613
1723         https://bugs.webkit.org/show_bug.cgi?id=164713
1724
1725         Reviewed by Youenn Fablet.
1726
1727         * bindings/scripts/CodeGeneratorJS.pm:
1728         (GenerateImplementation):
1729
1730 2016-11-13  Darin Adler  <darin@apple.com>
1731
1732         Remove many includes of ExceptionCode.h
1733         https://bugs.webkit.org/show_bug.cgi?id=164706
1734
1735         Reviewed by Alex Christensen.
1736
1737         * Modules/encryptedmedia/CDMPrivateClearKey.cpp: Removed include of ExceptionCode.h.
1738         * Modules/encryptedmedia/CDMPrivateMediaPlayer.cpp: Ditto.
1739         * Modules/fetch/FetchBodyOwner.cpp: Ditto.
1740
1741         * Modules/indexeddb/IDBDatabase.cpp: Added include of ExceptionCode.h.
1742
1743         * Modules/indexeddb/IDBDatabase.h: Removed include of ExceptionCode.h.
1744         * Modules/indexeddb/IDBDatabaseException.cpp: Ditto.
1745
1746         * Modules/indexeddb/IDBIndex.cpp: Added include of ExceptionCode.h.
1747         * Modules/indexeddb/IDBObjectStore.cpp: Ditto.
1748
1749         * Modules/mediastream/MediaConstraintsImpl.cpp: Removed include of ExceptionCode.h.
1750         * Modules/mediastream/MediaDevicesEnumerationRequest.cpp: Ditto.
1751         * Modules/mediastream/MediaDevicesRequest.cpp: Ditto.
1752         * Modules/mediastream/MediaStream.cpp: Ditto.
1753         * Modules/mediastream/MediaStreamTrack.cpp: Ditto.
1754         * Modules/mediastream/RTCDTMFSender.cpp: Ditto.
1755         * Modules/mediastream/RTCDataChannel.cpp: Ditto.
1756         * Modules/mediastream/RTCPeerConnection.cpp: Ditto.
1757
1758         * Modules/notifications/Notification.h: Removed definition of ExceptionCode.
1759         * Modules/streams/ReadableStreamSource.h: Ditto.
1760         * Modules/webaudio/BiquadFilterNode.cpp: Ditto.
1761
1762         * Modules/webaudio/PannerNode.cpp: Removed inclde of ExceptionCode.h.
1763         * Modules/webaudio/WaveShaperNode.cpp: Ditto.
1764
1765         * Modules/webdatabase/Database.cpp:
1766         (WebCore::guidForOriginAndName): Reimplemented using HashMap::ensure.
1767         * Modules/webdatabase/Database.h: Renamed DatabaseGuid to DatabaseGUID and defined
1768         it here instead of a in DatabaseBasicTypes.h; removed that include.
1769
1770         * Modules/webdatabase/DatabaseBasicTypes.h: Removed.
1771
1772         * Modules/webdatabase/DatabaseManager.h: Removed include of DatabaseBasicTypes.h.
1773         * Modules/webdatabase/DatabaseTask.h: Ditto.
1774
1775         * Modules/webdatabase/SQLTransactionBackend.cpp: Removed include of ExceptionCode.h.
1776
1777         * Modules/webdatabase/SQLTransactionBackend.h: Removed include of DatabaseBasicTypes.h.
1778
1779         * WebCore.xcodeproj/project.pbxproj: Removed DatabaseBasicTypes.h, also let Xcode
1780         edit the file.
1781
1782         * bindings/js/ScriptModuleLoader.cpp: Removed include of ExceptionCode.h.
1783         * bindings/js/SerializedScriptValue.cpp: Ditto.
1784         * bindings/js/StructuredClone.cpp: Ditto.
1785
1786         * bindings/scripts/CodeGeneratorJS.pm:
1787         (GenerateParametersCheck): Removed unnecessary include of ExceptionCode.h.
1788
1789         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
1790         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
1791         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
1792         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
1793         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
1794         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
1795         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
1796         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
1797         * bindings/scripts/test/JS/JSTestInterface.cpp:
1798         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
1799         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
1800         * bindings/scripts/test/JS/JSTestNode.cpp:
1801         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
1802         * bindings/scripts/test/JS/JSTestObj.cpp:
1803         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
1804         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
1805         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
1806         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
1807         Updated.
1808
1809         * css/CSSMediaRule.cpp: Removed include of ExceptionCode.h.
1810         * css/CSSSupportsRule.cpp: Ditto.
1811         * dom/ClientRectList.cpp: Ditto.
1812
1813         * dom/DOMCoreException.cpp: Added include of ExceptionCode.h.
1814
1815         * dom/DOMImplementation.cpp: Removed include of ExceptionCode.h.
1816         * dom/ExceptionBase.h: Ditto.
1817
1818         * dom/Node.cpp: Added include of ExceptionCode.h.
1819
1820         * dom/NodeIterator.cpp: Removed include of ExceptionCode.h.
1821         (WebCore::NodeIterator::NodePointer::NodePointer): Marked this inline.
1822         (WebCore::NodeIterator::NodePointer::clear): Ditto.
1823         (WebCore::NodeIterator::NodePointer::moveToNext): Ditto.
1824         (WebCore::NodeIterator::NodePointer::moveToPrevious): Ditto.
1825         (WebCore::NodeIterator::NodeIterator): Ditto.
1826         (WebCore::NodeIterator::create): Moved this here from the header.
1827         Now the constructor is inlined instead of this function.
1828         (WebCore::NodeIterator::detach): Deleted. Moved to header.
1829         * dom/NodeIterator.h: Removed definition of ExceptionCode, fixed indentation
1830         of this file and made a few changes as mentioned above.
1831
1832         * dom/ProcessingInstruction.cpp: Removed include of ExceptionCode.h.
1833
1834         * dom/Text.cpp: Added include of ExceptionCode.h.
1835
1836         * dom/TreeWalker.cpp: Removed include of ExceptionCode.h.
1837         * editing/FrameSelection.cpp: Ditto.
1838         * fileapi/WebKitBlobBuilder.cpp: Ditto.
1839         * history/CachedFrame.cpp: Ditto.
1840         * html/HTMLDocument.cpp: Ditto.
1841         * html/HTMLMeterElement.cpp: Ditto.
1842         * html/HTMLObjectElement.cpp: Ditto.
1843         * html/HTMLOptionElement.cpp: Ditto.
1844
1845         * html/HTMLOptionsCollection.cpp: Removed include of ExceptionCode.h.
1846         (WebCore::HTMLOptionsCollection::add): Changed argument to const& to avoid a
1847         little bit of reference count churn.
1848         * html/HTMLOptionsCollection.h: Updated for above.
1849
1850         * html/HTMLProgressElement.cpp: Removed include of ExceptionCode.h.
1851
1852         * html/HTMLSelectElement.cpp:
1853         (WebCore::HTMLSelectElement::add): Changed argument to const& to avoid a
1854         little bit of reference count churn.
1855         * html/HTMLSelectElement.h: Updated for above.
1856
1857         * html/HTMLTextAreaElement.cpp: Removed include of ExceptionCode.h.
1858         * html/canvas/CanvasPattern.cpp: Ditto.
1859
1860         * html/canvas/WebGLContextGroup.h: Removed definition of ExceptionCode.
1861
1862         * html/track/AudioTrack.h: Removed include of ExceptionCode.h.
1863         * html/track/TextTrack.h: Ditto.
1864
1865         * html/track/VTTCue.cpp: Added include of ExceptionCode.h.
1866         * html/track/VTTRegion.cpp: Ditto.
1867
1868         * html/track/VideoTrack.h: Removed include of ExceptionCode.h.
1869         * inspector/DOMEditor.cpp: Ditto.
1870
1871         * inspector/InspectorDatabaseAgent.cpp: Removed include of ExceptionCode.h.
1872         Tweaked the code in the file a bit, marking more things final and making them
1873         private. ALso simplified a couple of the functions a bit.
1874         (WebCore::InspectorDatabaseAgent::didOpenDatabase):
1875         (WebCore::InspectorDatabaseAgent::getDatabaseTableNames):
1876         (WebCore::InspectorDatabaseAgent::executeSQL):
1877         (WebCore::InspectorDatabaseAgent::databaseForId):
1878
1879         * inspector/InspectorIndexedDBAgent.cpp: Removed include of ExceptionCode.h.
1880
1881         * inspector/InspectorStyleSheet.cpp: Added include of ExceptionCode.h.
1882
1883         * page/FocusController.cpp: Removed include of ExceptionCode.h.
1884
1885         * page/Location.h: Removed definition of ExceptionCode.
1886
1887         * page/Page.cpp: Removed include of ExceptionCode.h.
1888         * platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm: Ditto.
1889         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm: Ditto.
1890         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm: Ditto.
1891         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm: Ditto.
1892
1893         * storage/StorageArea.h: Removed definition of ExceptionCode.
1894
1895         * svg/SVGCircleElement.cpp: Removed include of ExceptionCode.h.
1896
1897         * svg/SVGColor.cpp: Added include of ExceptionCode.h.
1898         * svg/SVGPaint.cpp: Ditto.
1899
1900         * svg/SVGStyleElement.cpp: Removed include of ExceptionCode.h.
1901
1902         * svg/properties/SVGListProperty.h: Added include of ExceptionCode.h.
1903
1904         * workers/Worker.cpp: Removed include of ExceptionCode.h.
1905         * workers/WorkerMessagingProxy.cpp: Ditto.
1906
1907         * xml/XMLSerializer.cpp: Removed unneeded includes.
1908         (WebCore::XMLSerializer::serializeToString): Use nullptr.
1909         * xml/XMLSerializer.h: Removed definition of ExceptionCode, fixed indentation
1910         of this file, and made a couple tweaks.
1911
1912 2016-11-14  Youenn Fablet  <youenn@apple.com>
1913
1914         MediaStreamPrivate::create should take vectors of Ref
1915         https://bugs.webkit.org/show_bug.cgi?id=164670
1916
1917         Reviewed by Sam Weinig.
1918
1919         No change of behavior.
1920
1921         * Modules/webaudio/MediaStreamAudioDestinationNode.cpp:
1922         (WebCore::MediaStreamAudioDestinationNode::MediaStreamAudioDestinationNode):
1923         * platform/mediastream/MediaStreamPrivate.cpp:
1924         (WebCore::MediaStreamPrivate::create):
1925         * platform/mediastream/MediaStreamPrivate.h:
1926         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
1927         (WebCore::RealtimeMediaSourceCenterMac::createMediaStream):
1928         * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp:
1929         (WebCore::RealtimeMediaSourceCenterOwr::mediaSourcesAvailable):
1930         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
1931         (WebCore::MockRealtimeMediaSourceCenter::createMediaStream):
1932
1933 2016-11-14  Joanmarie Diggs  <jdiggs@igalia.com>
1934
1935         AX: [ATK] Expose STATE_SINGLE_LINE and STATE_MULTI_LINE for ARIA searchbox role
1936         https://bugs.webkit.org/show_bug.cgi?id=164712
1937
1938         Reviewed by Chris Fleizach.
1939
1940         Include SearchFieldRole when adding STATE_SINGLE_LINE and STATE_MULTI_LINE
1941         to AtkStateSet.
1942
1943         Test: accessibility/gtk/singleline-and-multiline.html
1944
1945         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
1946         (setAtkStateSetFromCoreObject):
1947
1948 2016-11-14  Youenn Fablet  <youennf@gmail.com>
1949
1950         RTCRtpTransceiver should have Ref of sender and receiver
1951         https://bugs.webkit.org/show_bug.cgi?id=164665
1952
1953         Reviewed by Darin Adler.
1954
1955         No change of behavior.
1956
1957         Making RTCRptTransceiver have Ref<RTCRtpSender> and Ref<RTCRtpReceiver>.
1958         Transforming transceiver set list of senders and receivers as vectors of references to reduce count churning.
1959         Also making RTCRptTransceiver have a Ref<RTCIceTransport> instead of a RefPtr.
1960
1961         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
1962         (WebCore::MediaEndpointPeerConnection::createOfferTask):
1963         (WebCore::MediaEndpointPeerConnection::createAnswerTask):
1964         (WebCore::createSourceMap):
1965         (WebCore::MediaEndpointPeerConnection::setRemoteDescriptionTask):
1966         (WebCore::MediaEndpointPeerConnection::createReceiver):
1967         (WebCore::MediaEndpointPeerConnection::replaceTrack):
1968         * Modules/mediastream/MediaEndpointPeerConnection.h:
1969         * Modules/mediastream/PeerConnectionBackend.h:
1970         * Modules/mediastream/RTCPeerConnection.cpp:
1971         (WebCore::RTCPeerConnection::addTrack):
1972         (WebCore::RTCPeerConnection::removeTrack):
1973         (WebCore::RTCPeerConnection::close):
1974         * Modules/mediastream/RTCPeerConnection.h:
1975         * Modules/mediastream/RTCRtpTransceiver.cpp:
1976         (WebCore::RTCRtpTransceiver::RTCRtpTransceiver):
1977         * Modules/mediastream/RTCRtpTransceiver.h:
1978         (WebCore::RTCRtpTransceiver::create):
1979         (WebCore::RTCRtpTransceiver::sender):
1980         (WebCore::RTCRtpTransceiver::receiver):
1981         (WebCore::RTCRtpTransceiver::iceTransport):
1982         (WebCore::RtpTransceiverSet::senders):
1983         (WebCore::RtpTransceiverSet::receivers):
1984
1985 2016-11-14  Csaba Osztrogonác  <ossy@webkit.org>
1986
1987         Fix various --minimal build issue
1988         https://bugs.webkit.org/show_bug.cgi?id=164479
1989
1990         Reviewed by Darin Adler.
1991
1992         * dom/Node.cpp:
1993         * platform/audio/PlatformMediaSessionManager.cpp:
1994         * testing/Internals.cpp:
1995         (WebCore::Internals::captionsStyleSheetOverride):
1996
1997 2016-11-14  Csaba Osztrogonác  <ossy@webkit.org>
1998
1999         Fix the !ENABLE(VIDEO_TRACK) build
2000         https://bugs.webkit.org/show_bug.cgi?id=164476
2001
2002         Reviewed by Darin Adler.
2003
2004         * css/RuleSet.cpp:
2005         (WebCore::RuleSet::addRule):
2006         * css/parser/CSSParserValues.h:
2007         (WebCore::CSSParserSelector::needsImplicitShadowCombinatorForMatching):
2008         * css/parser/CSSSelectorParser.cpp:
2009         (WebCore::isPseudoElementFunction):
2010         (WebCore::CSSSelectorParser::consumePseudo):
2011
2012 2016-11-14  Miguel Gomez  <magomez@igalia.com>
2013
2014         [GTK] Do not use gstreamer-gl when accelerated compositing is disabled
2015         https://bugs.webkit.org/show_bug.cgi?id=164481
2016
2017         Reviewed by Žan Doberšek.
2018
2019         Check whether accelerated compositing is enabled before creating the gstreamer-gl video sink.
2020
2021         No new tests (Covered by existing tests).
2022
2023         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2024         (WebCore::MediaPlayerPrivateGStreamerBase::createVideoSink):
2025
2026 2016-11-14  Csaba Osztrogonác  <ossy@webkit.org>
2027
2028         Fix the !ENABLE(CSS_BOX_DECORATION_BREAK) build
2029         https://bugs.webkit.org/show_bug.cgi?id=164478
2030
2031         Reviewed by Darin Adler.
2032
2033         * css/parser/CSSParserFastPaths.cpp:
2034         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
2035
2036 2016-11-14  Csaba Osztrogonác  <ossy@webkit.org>
2037
2038         Fix the !ENABLE(CSS_GRID_LAYOUT) build
2039         https://bugs.webkit.org/show_bug.cgi?id=164477
2040
2041         Reviewed by Darin Adler.
2042
2043         * css/parser/CSSParserFastPaths.cpp:
2044         (WebCore::isSimpleLengthPropertyID):
2045         * css/parser/CSSPropertyParser.cpp:
2046         (WebCore::CSSPropertyParser::parseSingleValue):
2047         (WebCore::CSSPropertyParser::parseShorthand):
2048
2049 2016-11-14  Csaba Osztrogonác  <ossy@webkit.org>
2050
2051         [EFL] Suppress build warning in generated Geoclue2Interface.c
2052         https://bugs.webkit.org/show_bug.cgi?id=164475
2053
2054         Reviewed by Darin Adler.
2055
2056         * PlatformEfl.cmake:
2057
2058 2016-11-10  Philippe Normand  <pnormand@igalia.com>
2059
2060         [GStreamer][OWR] poor video rendering in apprtc
2061         https://bugs.webkit.org/show_bug.cgi?id=164585
2062
2063         Reviewed by Xabier Rodriguez-Calvar.
2064
2065         The apprtc service uses 3 video elements in total, one for local, one
2066         for remote and one called preview. During a call only remote and
2067         preview are displayed, preview being linked to the same mediastream as
2068         local. The consequence is that 2 OWR video renderers of the same
2069         source are created. When gst-gl is enabled this isn't a problem but
2070         when it is disabled a performance issue appears and the webkit video
2071         sink starts dropping frames.
2072
2073         The solution is to have the video renderer shared between the 2
2074         media players in this scenario.
2075
2076         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2077         (WebCore::MediaPlayerPrivateGStreamerBase::videoSink): Add video sink getter.
2078         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.cpp:
2079         (WebCore::MediaPlayerPrivateGStreamerOwr::load): Make sure the m_streamPrivate is
2080         set before creating the video sink.
2081         (WebCore::MediaPlayerPrivateGStreamerOwr::createVideoSink): Re-use video renderer
2082         and sink if they have previously been created for another media player.
2083         * platform/mediastream/MediaStreamPrivate.h: Store GStreamer sink and renderer so
2084         they can be potentially used by multiple media players.
2085         (WebCore::MediaStreamPrivate::setVideoRenderer):
2086         (WebCore::MediaStreamPrivate::getVideoSinkElement):
2087         (WebCore::MediaStreamPrivate::getVideoRenderer):
2088
2089 2016-11-13  Fujii Hironori  <Hironori.Fujii@sony.com>
2090
2091         [HarfBuzz] HarfBuzzShaper should not assume numGlyphs is greater than 0
2092         https://bugs.webkit.org/show_bug.cgi?id=164500
2093
2094         Reviewed by Myles C. Maxfield.
2095
2096         Test: fast/text/international/harfbuzz-runs-with-no-glyph.html
2097
2098         HarfBuzzShaper assumes numGlyphs of HarfBuzzRun is greater than
2099         zero. But this is not necessarily true. If a font does not have a
2100         glyph of SPACE (U+0020), HarfBuzz removes ignorable glyphs. In
2101         this case, HarfBuzzRun can have no glyphs.
2102
2103         * platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
2104         (WebCore::HarfBuzzShaper::HarfBuzzRun::applyShapeResult): Resize
2105         m_offsets to one if m_numGlyphs is zero.
2106         * platform/graphics/harfbuzz/HarfBuzzShaper.h:
2107         (WebCore::HarfBuzzShaper::HarfBuzzRun::glyphs): Use Vector::data()
2108         instread of operator[0].
2109         (WebCore::HarfBuzzShaper::HarfBuzzRun::advances): Ditto.
2110         (WebCore::HarfBuzzShaper::HarfBuzzRun::offsets): Ditto.
2111         (WebCore::HarfBuzzShaper::HarfBuzzRun::glyphToCharacterIndexes): Ditto.
2112
2113 2016-11-13  Chris Dumez  <cdumez@apple.com>
2114
2115         REGRESSION (204441): newsplex.com map does not load
2116         https://bugs.webkit.org/show_bug.cgi?id=164705
2117         <rdar://problem/28753438>
2118
2119         Reviewed by Darin Adler.
2120
2121         Update getElementsByTagName(qualifiedName) implementation to match more closely
2122         the specification at:
2123         - https://dom.spec.whatwg.org/#dom-document-getelementsbytagname
2124         - https://dom.spec.whatwg.org/#concept-getelementsbytagname
2125         - https://dom.spec.whatwg.org/#concept-element-qualified-name
2126
2127         In particular, we no longer split the input qualifiedName into a prefix and a
2128         localName in order to compare those to element.prefix() / element.localName().
2129         Instead, we keep the input qualifiedName as is and compare it to the element's
2130         qualifiedName. This matters for HTML elements inside an HTML document that have
2131         a semicolon in their localname (e.g. 'wx:map'). For this example, the element's
2132         localName and its qualified name are both 'wx:map'. Calling
2133         getElementsByTagName('wx:map') should return it. However, if you split the input
2134         qualifiedName into a prefix and a localName, you end up checking:
2135         'wx' == null && 'map' == 'wx:map'
2136         which does not match.
2137
2138         Test: fast/dom/getElementsByTagName-HTMLElement-prefix.html
2139
2140         * dom/TagCollection.cpp:
2141         (WebCore::TagCollection::TagCollection):
2142         (WebCore::TagCollection::~TagCollection):
2143         (WebCore::HTMLTagCollection::HTMLTagCollection):
2144         (WebCore::HTMLTagCollection::~HTMLTagCollection):
2145         (WebCore::makeQualifiedName): Deleted.
2146         (WebCore::splitQualifiedName): Deleted.
2147         * dom/TagCollection.h:
2148         (WebCore::TagCollection::elementMatches):
2149         (WebCore::HTMLTagCollection::elementMatches):
2150
2151 2016-11-13  Darin Adler  <darin@apple.com>
2152
2153         Remove ExceptionCodePlaceholder
2154         https://bugs.webkit.org/show_bug.cgi?id=164703
2155
2156         Reviewed by Sam Weinig.
2157
2158         * CMakeLists.txt: Removed ExceptionCodePlaceholder.cpp.
2159         * WebCore.xcodeproj/project.pbxproj: Removed ExceptionCodePlaceholder.h/cpp.
2160         Also let Xcode make a change to the file, I think removing an unreferenced
2161         dead entry for a file that is already listed under a different ID.
2162         * dom/DOMAllInOne.cpp: Removed ExceptionCodePlaceholder.cpp.
2163         * dom/ExceptionCodePlaceholder.cpp: Removed.
2164         * dom/ExceptionCodePlaceholder.h: Removed.
2165         * inspector/InspectorDatabaseAgent.cpp: Removed include of ExceptionCodePlaceholder.h.
2166
2167 2016-11-13  Darin Adler  <darin@apple.com>
2168
2169         Fix exception handling in SQL database code, streamline and update code
2170         https://bugs.webkit.org/show_bug.cgi?id=164685
2171
2172         Reviewed by Sam Weinig.
2173
2174         Removed some old abstraction layers that were no longer in use. For example,
2175         i n many cases, calls were going through DatabaseManager, which called through
2176         an abstract class AbstractDatabaseServer to a concrete class DatabaseServer,
2177         which then called through to DatabaseTracker. Clients now mostly just call
2178         DatabaseTracker directly.
2179
2180         * CMakeLists.txt: Removed DatabaseServer.cpp and SQLTransactionClient.cpp.
2181
2182         * Modules/webdatabase/AbstractDatabaseServer.h: Removed.
2183
2184         * Modules/webdatabase/DOMWindowWebDatabase.cpp:
2185         (WebCore::DOMWindowWebDatabase::openDatabase): Use ExceptionOr instead of
2186         DatabaseError to communicate DOM exceptions from DatabaseManager.
2187
2188         * Modules/webdatabase/Database.cpp:
2189         (WebCore::Database::Database): Use a reference instead of a RefPtr&& for database
2190         context. Use unsigned instead of unsigned long. Modernize code to use more
2191         initialization rather than assignment, to initialize scalar data members in the
2192         class definition, and to use HashMap::ensure.
2193         (WebCore::Database::databaseThread): Added. This class asserts that there is a
2194         thread in the constructor, and so it is useful to have a helper for all the other
2195         functions that assumes the thread is present and returns a reference rather than
2196         a pointer.
2197         (WebCore::Database::~Database): Updated since m_scriptExecutionContext is now
2198         a Ref instead of a RefPtr.
2199         (WebCore::Database::openAndVerifyVersion): Use ExceptionOr and databaseThread.
2200         (WebCore::Database::close): Use databaseThread.
2201         (WebCore::Database::performClose): Ditto.
2202         (WebCore::DoneCreatingDatabaseOnExitCaller::DoneCreatingDatabaseOnExitCaller):
2203         Use a reference. Removed unused m_openSuccceeded.
2204         (WebCore::DoneCreatingDatabaseOnExitCaller::~DoneCreatingDatabaseOnExitCaller):
2205         Use DatabaseTracker::singleton by its new name.
2206         (WebCore::DoneCreatingDatabaseOnExitCaller::setOpenSucceeded): Deleted.
2207         (WebCore::Database::performOpenAndVerify): Use ExceptionOr and update for above.
2208         (WebCore::Database::closeDatabase): Updated for name change.
2209         (WebCore::Database::scheduleTransaction): Updated for above, simplified and
2210         streamlined.
2211         (WebCore::Database::scheduleTransactionStep): Use databaseThread.
2212         (WebCore::Database::transactionClient): Deleted. This object is no longer needed.
2213         (WebCore::Database::transactionCoordinator): Use databaseThread.
2214         (WebCore::Database::markAsDeletedAndClose): Removed unnecessary null check for
2215         databaseThread, which can never be null.
2216         (WebCore::Database::estimatedSize): Use unsigned, not unsigned long.
2217         (WebCore::Database::disableAuthorizer): Removed assertion about RefPtr that is
2218         now a Ref and never could have been null.
2219         (WebCore::Database::enableAuthorizer): Ditto.
2220         (WebCore::Database::setAuthorizerPermissions): Ditto.
2221         (WebCore::Database::lastActionChangedDatabase): Ditto.
2222         (WebCore::Database::lastActionWasInsert): Ditto.
2223         (WebCore::Database::resetDeletes): Ditto.
2224         (WebCore::Database::hadDeletes): Ditto.
2225         (WebCore::Database::resetAuthorizer): Removed null check for a RefPtr that is now
2226         a Ref and never could have been null.
2227         (WebCore::Database::runTransaction): Simplified a bit.
2228         (WebCore::Database::tableNames): Use databaseThread.
2229         (WebCore::Database::securityOrigin): Changed to return a reference instead of a
2230         pointer because all the callers need it to do that. If called on the wrong thread,
2231         this will now do a RELEASE_ASSERT_NOT_REACHED. In the old code it would return a
2232         null pointer and then the caller would dereference it a moment later, so it would
2233         still be a crash.
2234         (WebCore::Database::maximumSize): Removed const since it's not really needed and
2235         the DatabaseTracker wants a non-const reference to this database.
2236         (WebCore::Database::didCommitWriteTransaction): Added. Moved this code here from
2237         SQLTransactionClient. There is no abstraction layer, so no reason to not have
2238         this code, quite comparable to the rest of the code in the class, here. I am
2239         assuming this served some more useful purpose back when we had a different back end
2240         for Chromium?
2241         (WebCore::Database::didExceedQuota): Ditto.
2242         * Modules/webdatabase/Database.h: Updated for above changes. Made some functions
2243         return references instead of pointers. Use Ref instead of RefPtr for some things that
2244         can never be null.
2245         * Modules/webdatabase/Database.idl: Added ImplementationLacksVTable because the
2246         Database class is not polymorphic.
2247
2248         * Modules/webdatabase/DatabaseContext.cpp:
2249         (WebCore::DatabaseContext::DatabaseContext): Take a reference instead of a pointer.
2250         Moved data member initialization into class definition. Remove code that tries to do
2251         debug accounting and databasecontext registration and instead just make sure to keep
2252         the ScriptExecutionContext pointing at the DatabaseContext.
2253         (WebCore::DatabaseContext::~DatabaseContext): Ditto.
2254         (WebCore::DatabaseContext::stopDatabases): Ditto.
2255         * Modules/webdatabase/DatabaseContext.h: Updated for the above. Also used the
2256         scriptExecutionContext function inherited from the base class intead of adding our
2257         own, and added a existingDatabaseThread() function, letting us get at the database
2258         thread efficiently without creating a new one.
2259
2260         * Modules/webdatabase/DatabaseError.h: Removed. We now use DOM exceptions directly
2261         instead of our own error enumeration that has to be translated to a DOM exception.
2262
2263         * Modules/webdatabase/DatabaseManager.cpp: Moved the ProposedDatabase class here
2264         from the header file, and had it use references instead of pointers.
2265         (WebCore::DatabaseManager::DatabaseManager): Deleted. There was nothing left to
2266         initialize once the refactoring was done.
2267         (WebCore::DatabaseManager::initialize): Call DatabaseTracker directly instead of
2268         calling through m_server.
2269         (WebCore::DatabaseManager::setClient): Ditto.
2270         (WebCore::DatabaseManager::databaseDirectoryPath): Deleted. Callers will use the
2271         function in DatabaseTracker directly.
2272         (WebCore::DatabaseManager::setDatabaseDirectoryPath): Ditto.
2273         (WebCore::DatabaseManager::existingDatabaseContextFor): Deleted. Callers will use
2274         the ScriptExecutionContext::databaseContext function instead.
2275         (WebCore::DatabaseManager::databaseContext): Renamed from databaseContextFor.
2276         (WebCore::DatabaseManager::registerDatabaseContext): Deleted.
2277         (WebCore::DatabaseManager::unregisterDatabaseContext): Deleted.
2278         (WebCore::DatabaseManager::didConstructDatabaseContext): Deleted.
2279         (WebCore::DatabaseManager::didDestructDatabaseContext): Deleted.
2280         (WebCore::DatabaseManager::exceptionCodeForDatabaseError): Deleted.
2281         (WebCore::logOpenDatabaseError): Tweaked conditionals a bit.
2282         (WebCore::DatabaseManager::openDatabaseBackend): Use ExceptionOr. Changed to call
2283         tryToOpenDatabaseBackend function here in this class rather than using m_server.
2284         (WebCore::DatabaseManager::tryToOpenDatabaseBackend): Added. Moved here from the
2285         DatabaseServer class.
2286         (WebCore::DatabaseManager::addProposedDatabase): Take a reference.
2287         (WebCore::DatabaseManager::removeProposedDatabase): Ditto.
2288         (WebCore::DatabaseManager::openDatabase): Use ExceptionOr.
2289         (WebCore::DatabaseManager::hasOpenDatabases): Use ScriptContext::databaseContext
2290         directly instead of using helper functions in this class.
2291         (WebCore::DatabaseManager::stopDatabases): Ditto.
2292         (WebCore::DatabaseManager::fullPathForDatabase): Take a reference and also call
2293         DatabaseTracker directly instead of calling through m_server.
2294         (WebCore::DatabaseManager::hasEntryForOrigin): Deleted. Callers will use the
2295         function in DatabaseTracker directly.
2296         (WebCore::DatabaseManager::origins): Ditto.
2297         (WebCore::DatabaseManager::databaseNamesForOrigin): Ditto.
2298         (WebCore::DatabaseManager::detailsForNameAndOrigin): Call DatabaseTracker directly
2299         instead of calling through m_server.
2300         (WebCore::DatabaseManager::usageForOrigin): Deleted. Callers will use the
2301         function in DatabaseTracker directly.
2302         (WebCore::DatabaseManager::quotaForOrigin): Ditto.
2303         (WebCore::DatabaseManager::setQuota): Ditto.
2304         (WebCore::DatabaseManager::deleteAllDatabasesImmediately): Ditto.
2305         (WebCore::DatabaseManager::deleteOrigin): Ditto.
2306         (WebCore::DatabaseManager::deleteDatabase): Ditto.
2307         (WebCore::DatabaseManager::closeAllDatabases): Ditto.
2308         (WebCore::DatabaseManager::logErrorMessage): Take a reference.
2309         * Modules/webdatabase/DatabaseManager.h: Updated for changes above.
2310
2311         * Modules/webdatabase/DatabaseManagerClient.h: Use references for security origins.
2312         Also changed #if for iOS so that other platforms can call the iOS-specific functions
2313         and they have inline empty bodies; lets us clean up call sites to not need conditionals.
2314
2315         * Modules/webdatabase/DatabaseServer.cpp: Removed.
2316         * Modules/webdatabase/DatabaseServer.h: Removed.
2317
2318         * Modules/webdatabase/DatabaseTask.cpp:
2319         (WebCore::isolatedCopy): Added. Helper functions for making isolated copies of
2320         exceptions, which can contain strings.
2321         (WebCore::DatabaseOpenTask::DatabaseOpenTask): Use ExceptionOr<void> instead of
2322         a DatabaseError, a String, and a success boolean.
2323         (WebCore::DatabaseOpenTask::doPerformTask): Updated to use ExceptoinOr.
2324         (WebCore::DatabaseTableNamesTask::DatabaseTableNamesTask): Renamed.
2325         (WebCore::DatabaseTableNamesTask::doPerformTask): Added a comment.
2326         * Modules/webdatabase/DatabaseTask.h: Updated for above changes.
2327
2328         * Modules/webdatabase/DatabaseThread.cpp:
2329         (WebCore::DatabaseThread::DatabaseThread): Initialized data members in the class
2330         definition. Removed m_transactionClient.
2331         (WebCore::DatabaseThread::recordDatabaseOpen): Take a reference.
2332         (WebCore::DatabaseThread::recordDatabaseClosed): Ditto.
2333         (WebCore::DatabaseThread::scheduleTask): Use an rvalue reference.
2334         (WebCore::DatabaseThread::scheduleImmediateTask): Ditto.
2335         (WebCore::DatabaseThread::unscheduleDatabaseTasks): Use a lambda instead of a
2336         class for the same-database predicate.
2337         * Modules/webdatabase/DatabaseThread.h: Updated for above.
2338
2339         * Modules/webdatabase/DatabaseTracker.cpp:
2340         (WebCore::isolatedCopy): Added. Helper for making an isolated copy of a vector
2341         of strings.
2342         (WebCore::DatabaseTracker::singleton): Renamed from tracker.
2343         (WebCore::DatabaseTracker::DatabaseTracker): Moved the code from
2344         setDatabaseDirectoryPath in here.
2345         (WebCore::DatabaseTracker::setDatabaseDirectoryPath): Deleted.
2346         (WebCore::DatabaseTracker::databaseDirectoryPath): Deleted.
2347         (WebCore::DatabaseTracker::hasAdequateQuotaForOrigin): Use ExceptionOr.
2348         (WebCore::DatabaseTracker::canEstablishDatabase): Ditto.
2349         (WebCore::DatabaseTracker::retryCanEstablishDatabase): Ditto.
2350         (WebCore::DatabaseTracker::hasEntryForOriginNoLock): Take a reference.
2351         (WebCore::DatabaseTracker::hasEntryForOrigin): Deleted.
2352         (WebCore::DatabaseTracker::hasEntryForDatabase): Take a reference.
2353         (WebCore::DatabaseTracker::maximumSize): Renamed from getMaxSizeForDatabase
2354         and changed to take a reference.
2355         (WebCore::DatabaseTracker::originPath): Take a reference.
2356         (WebCore::DatabaseTracker::fullPathForDatabaseNoLock): Ditto.
2357         (WebCore::DatabaseTracker::fullPathForDatabase): Ditto.
2358         (WebCore::DatabaseTracker::origins): Changed to use a return value instead
2359         of using an out argument.
2360         (WebCore::DatabaseTracker::databaseNamesNoLock): Ditto. Also renamed from
2361         databaseNamesForOriginNoLock.
2362         (WebCore::DatabaseTracker::databaseNames): Ditto. Also renamed from
2363         databaseNamesForOrigin.
2364         (WebCore::DatabaseTracker::detailsForNameAndOrigin): Take a reference.
2365         (WebCore::DatabaseTracker::setDatabaseDetails): Ditto.
2366         (WebCore::DatabaseTracker::doneCreatingDatabase): Ditto.
2367         (WebCore::DatabaseTracker::addOpenDatabase): Ditto.
2368         (WebCore::DatabaseTracker::removeOpenDatabase): Ditto.
2369         (WebCore::DatabaseTracker::getOpenDatabases): Deleted.
2370         (WebCore::DatabaseTracker::originLockFor): Take a reference.
2371         (WebCore::DatabaseTracker::deleteOriginLockFor): Take a reference.
2372         (WebCore::DatabaseTracker::usage): Renamed from usageForOrigin. Take a reference.
2373         (WebCore::DatabaseTracker::quotaNoLock): Renamed from quotaForOriginNoLock.
2374         Take a reference.
2375         (WebCore::DatabaseTracker::quota): Renamed from quatoForOrigin. Take a reference.
2376         (WebCore::DatabaseTracker::setQuota): Take a reference.
2377         (WebCore::DatabaseTracker::addDatabase): Ditto.
2378         (WebCore::DatabaseTracker::deleteAllDatabasesImmediately): Updated now that
2379         origins has a return value.
2380         (WebCore::DatabaseTracker::deleteDatabasesModifiedSince): Ditto.
2381         (WebCore::DatabaseTracker::deleteOrigin): Take a reference.
2382         (WebCore::DatabaseTracker::isDeletingDatabaseOrOriginFor): Ditto.
2383         (WebCore::DatabaseTracker::recordCreatingDatabase): Updated to take a reference,
2384         use unique_ptr, and use HashCountedSet.
2385         (WebCore::DatabaseTracker::doneCreatingDatabase): Ditto.
2386         (WebCore::DatabaseTracker::creatingDatabase): Ditto.
2387         (WebCore::DatabaseTracker::canDeleteDatabase): Take a reference.
2388         (WebCore::DatabaseTracker::recordDeletingDatabase): Updated to take a reference,
2389         and use unique_ptr.
2390         (WebCore::DatabaseTracker::doneDeletingDatabase): Ditto.
2391         (WebCore::DatabaseTracker::isDeletingDatabase): Ditto.
2392         (WebCore::DatabaseTracker::canDeleteOrigin): Take a reference.
2393         (WebCore::DatabaseTracker::isDeletingOrigin): Ditto.
2394         (WebCore::DatabaseTracker::recordDeletingOrigin): Ditto.
2395         (WebCore::DatabaseTracker::doneDeletingOrigin): Ditto.
2396         (WebCore::DatabaseTracker::deleteDatabase): Ditto.
2397         (WebCore::DatabaseTracker::deleteDatabaseFile): Ditto.
2398         (WebCore::DatabaseTracker::removeDeletedOpenedDatabases): Ditto.
2399         (WebCore::DatabaseTracker::scheduleNotifyDatabaseChanged): Ditto.
2400         (WebCore::DatabaseTracker::notifyDatabasesChanged): Ditto.
2401         * Modules/webdatabase/DatabaseTracker.h: Updated for above changes.
2402
2403         * Modules/webdatabase/SQLStatement.cpp:
2404         (WebCore::SQLStatement::SQLStatement): Updated since Database::scriptExecutionContext
2405         now returns a reference.
2406
2407         * Modules/webdatabase/SQLTransaction.cpp:
2408         (WebCore::SQLTransaction::SQLTransaction): Moved data member initialization to
2409         the calss definition. Also updated since Database::scriptExecutionContext now
2410         returns a reference.
2411         (WebCore::SQLTransaction::executeSQL): Use ExceptionOr.
2412         (WebCore::SQLTransaction::checkAndHandleClosedDatabase): Updated since
2413         databaseContext now returns a reference.
2414         (WebCore::SQLTransaction::deliverQuotaIncreaseCallback): Updated to call
2415         didExceedQuota on the database instead of the transaction client.
2416         (WebCore::SQLTransaction::postflightAndCommit): Updated to call
2417         didCommitWriteTransaction on the database instead of the transaction client.
2418         (WebCore::SQLTransaction::acquireOriginLock): Updated for name change of
2419         DatabaseTracker::tracker to DatbaseTracker::singleton.
2420         * Modules/webdatabase/SQLTransaction.h: Updated for above.
2421         * Modules/webdatabase/SQLTransaction.idl: Added MayThrowException to
2422         executeSql. Not technically needed since it's a custom binding.
2423
2424         * Modules/webdatabase/SQLTransactionBackend.cpp:
2425         (WebCore::SQLTransactionBackend::doCleanup): Updated assertion to use
2426         Database::databaseThread.
2427         (WebCore::SQLTransactionBackend::notifyDatabaseThreadIsShuttingDown): Ditto.
2428
2429         * Modules/webdatabase/SQLTransactionClient.cpp: Removed.
2430         * Modules/webdatabase/SQLTransactionClient.h: Removed.
2431
2432         * Modules/webdatabase/SQLTransactionCoordinator.cpp:
2433         (WebCore::getDatabaseIdentifier): Updated to pass a reference.
2434
2435         * WebCore.xcodeproj/project.pbxproj: Removed various deleted files.
2436         Also let Xcode change the whitespace on some lines.
2437
2438         * bindings/js/JSSQLTransactionCustom.cpp:
2439         (WebCore::JSSQLTransaction::executeSql): Use ExceptionOr, specifically by
2440         using the propagateException function.
2441
2442         * dom/ScriptExecutionContext.h: Added databaseContext function. Before, we
2443         had setDatabaseContext, but no way to inspect the pointer that was stored.
2444
2445         * inspector/InspectorDatabaseAgent.cpp: Removed IGNORE_EXCEPTION in a call
2446         to executeSQL, which no longer has an ExceptionCode out argument.
2447
2448         * loader/FrameLoader.cpp:
2449         (WebCore::FrameLoader::stopLoading): Pass a reference in the call to
2450         DatabaseManager::stopDatabases.
2451
2452 2016-11-13  Dan Bernstein  <mitz@apple.com>
2453
2454         Try to fix building with newer versions of clang.
2455
2456         * page/FrameView.h: Don’t export an inline function.
2457
2458 2016-11-13  Darin Adler  <darin@apple.com>
2459
2460         Move crypto code from ExceptionCode to ExceptionOr
2461         https://bugs.webkit.org/show_bug.cgi?id=164698
2462
2463         Reviewed by Sam Weinig.
2464
2465         * bindings/js/JSCryptoAlgorithmDictionary.cpp:
2466         (WebCore::JSCryptoAlgorithmDictionary::getAlgorithmIdentifier):
2467         Use the new identifier function instead of getIdentifierForName.
2468         * bindings/js/JSSubtleCryptoCustom.cpp:
2469         (WebCore::normalizeCryptoAlgorithmParameters): Ditto.
2470         (WebCore::toCryptoKeyUsageBitmap): Removed a stray meaningless const.
2471         (WebCore::jsSubtleCryptoFunctionGenerateKeyPromise): Pass
2472         ScriptExecutionContext as a reference instead of a pointer.
2473
2474         * bindings/js/JSWebKitSubtleCryptoCustom.cpp:
2475         (WebCore::createAlgorithmFromJSValue): Use the more efficient version
2476         of setDOMException that uses scope.
2477         (WebCore::JSWebKitSubtleCrypto::encrypt): Ditto. Also updated to use
2478         ExceptionOr instead of ExceptionCode.
2479         (WebCore::JSWebKitSubtleCrypto::decrypt): Ditto.
2480         (WebCore::JSWebKitSubtleCrypto::sign): Ditto.
2481         (WebCore::JSWebKitSubtleCrypto::verify): Ditto.
2482         (WebCore::JSWebKitSubtleCrypto::digest): Ditto.
2483         (WebCore::JSWebKitSubtleCrypto::generateKey): Ditto.
2484         (WebCore::importKey): Ditto.
2485         (WebCore::JSWebKitSubtleCrypto::wrapKey): Ditto.
2486         (WebCore::JSWebKitSubtleCrypto::unwrapKey): Ditto.
2487
2488         * crypto/CryptoAlgorithm.cpp:
2489         (WebCore::CryptoAlgorithm::CryptoAlgorithm): Deleted.
2490         (WebCore::CryptoAlgorithm::~CryptoAlgorithm): Deleted.
2491         (WebCore::CryptoAlgorithm::generateKey): Use ExceptionOr.
2492         (WebCore::CryptoAlgorithm::encrypt): Ditto.
2493         (WebCore::CryptoAlgorithm::decrypt): Ditto.
2494         (WebCore::CryptoAlgorithm::sign): Ditto.
2495         (WebCore::CryptoAlgorithm::verify): Ditto.
2496         (WebCore::CryptoAlgorithm::digest): Ditto.
2497         (WebCore::CryptoAlgorithm::deriveKey): Ditto.
2498         (WebCore::CryptoAlgorithm::deriveBits): Ditto.
2499         (WebCore::CryptoAlgorithm::importKey): Ditto.
2500         (WebCore::CryptoAlgorithm::encryptForWrapKey): Ditto.
2501         (WebCore::CryptoAlgorithm::decryptForUnwrapKey): Ditto.
2502         * crypto/CryptoAlgorithm.h: Use ExceptionOr.
2503         Moved the destructor into the header since it's more efficient for
2504         derived classes to have it inlined. Removed the protected constructor
2505         because since there are pure virtual functions in the class, there is
2506         no risk of anyone misusing the public constructor.
2507
2508         * crypto/CryptoAlgorithmRegistry.cpp:
2509         (WebCore::CryptoAlgorithmRegistry::identifier): Renamed from
2510         getIdentifierForName and changed to use an Optional rather than
2511         using a boolean plus an out argument.
2512         (WebCore::CryptoAlgorithmRegistry::name): Renamed to name from
2513         nameForIdentifier. Also updated to share a single map containing
2514         both names and constructors.
2515         (WebCore::CryptoAlgorithmRegistry::create): Share single map as above.
2516         (WebCore::CryptoAlgorithmRegistry::registerAlgorithm): Updated assertions
2517         to a mroe straightforward style. Share single map for names and constructors.
2518         * crypto/CryptoAlgorithmRegistry.h: Updated for above.
2519
2520         * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
2521         (WebCore::CryptoAlgorithmAES_CBC::CryptoAlgorithmAES_CBC): Deleted.
2522         (WebCore::CryptoAlgorithmAES_CBC::~CryptoAlgorithmAES_CBC): Deleted.
2523         (WebCore::CryptoAlgorithmAES_CBC::keyAlgorithmMatches): Use references, ExceptionOr.
2524         (WebCore::CryptoAlgorithmAES_CBC::generateKey): Ditto.
2525         (WebCore::CryptoAlgorithmAES_CBC::encrypt): Ditto.
2526         (WebCore::CryptoAlgorithmAES_CBC::decrypt): Ditto.
2527         (WebCore::CryptoAlgorithmAES_CBC::importKey): Ditto.
2528         * crypto/algorithms/CryptoAlgorithmAES_CBC.h: Updated for above.
2529         Also use constexpr for s_name and s_identifier.
2530
2531         * crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
2532         (WebCore::CryptoAlgorithmAES_KW::CryptoAlgorithmAES_KW): Deleted.
2533         (WebCore::CryptoAlgorithmAES_KW::~CryptoAlgorithmAES_KW): Deleted.
2534         (WebCore::CryptoAlgorithmAES_KW::keyAlgorithmMatches): Use references, ExceptionOr.
2535         (WebCore::CryptoAlgorithmAES_KW::generateKey): Ditto.
2536         (WebCore::CryptoAlgorithmAES_KW::importKey): Ditto.
2537         (WebCore::CryptoAlgorithmAES_KW::encryptForWrapKey): Ditto.
2538         (WebCore::CryptoAlgorithmAES_KW::decryptForUnwrapKey): Ditto.
2539         * crypto/algorithms/CryptoAlgorithmAES_KW.h: Updated for above.
2540         Also use constexpr for s_name and s_identifier.
2541
2542         * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
2543         (WebCore::CryptoAlgorithmHMAC::CryptoAlgorithmHMAC): Deleted.
2544         (WebCore::CryptoAlgorithmHMAC::~CryptoAlgorithmHMAC): Deleted.
2545         (WebCore::CryptoAlgorithmHMAC::generateKey): Use references, ExceptionOr.
2546         (WebCore::CryptoAlgorithmHMAC::sign): Ditto.
2547         (WebCore::CryptoAlgorithmHMAC::verify): Ditto.
2548         (WebCore::CryptoAlgorithmHMAC::importKey): Ditto.
2549         * crypto/algorithms/CryptoAlgorithmHMAC.h: Updated for above.
2550         Also use constexpr for s_name and s_identifier.
2551
2552         * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
2553         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::CryptoAlgorithmRSAES_PKCS1_v1_5): Deleted.
2554         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::~CryptoAlgorithmRSAES_PKCS1_v1_5): Deleted.
2555         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::generateKey): Use references, ExceptionOr.
2556         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::encrypt): Ditto.
2557         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::decrypt): Ditto.
2558         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::importKey): Ditto.
2559         * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h: Updated for above.
2560         Also use constexpr for s_name and s_identifier.
2561
2562         * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
2563         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::CryptoAlgorithmRSASSA_PKCS1_v1_5): Deleted.
2564         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::~CryptoAlgorithmRSASSA_PKCS1_v1_5): Deleted.
2565         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::generateKey): Use references, ExceptionOr.
2566         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::sign): Ditto.
2567         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::verify): Ditto.
2568         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey): Ditto.
2569         * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h: Updated for above.
2570         Also use constexpr for s_name and s_identifier.
2571
2572         * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
2573         (WebCore::CryptoAlgorithmRSA_OAEP::CryptoAlgorithmRSA_OAEP): Deleted.
2574         (WebCore::CryptoAlgorithmRSA_OAEP::~CryptoAlgorithmRSA_OAEP): Deleted.
2575         (WebCore::CryptoAlgorithmRSA_OAEP::generateKey): Use references, ExceptionOr.
2576         (WebCore::CryptoAlgorithmRSA_OAEP::encrypt): Ditto.
2577         (WebCore::CryptoAlgorithmRSA_OAEP::decrypt): Ditto.
2578         (WebCore::CryptoAlgorithmRSA_OAEP::importKey): Ditto.
2579         * crypto/algorithms/CryptoAlgorithmRSA_OAEP.h: Updated for above.
2580         Also use constexpr for s_name and s_identifier.
2581
2582         * crypto/algorithms/CryptoAlgorithmSHA1.cpp:
2583         (WebCore::CryptoAlgorithmSHA1::CryptoAlgorithmSHA1): Deleted.
2584         (WebCore::CryptoAlgorithmSHA1::~CryptoAlgorithmSHA1): Deleted.
2585         (WebCore::CryptoAlgorithmSHA1::digest): Use ExceptionOr.
2586         * crypto/algorithms/CryptoAlgorithmSHA1.h: Updated for above.
2587         Also use constexpr for s_name and s_identifier.
2588
2589         * crypto/algorithms/CryptoAlgorithmSHA224.cpp:
2590         (WebCore::CryptoAlgorithmSHA224::CryptoAlgorithmSHA224): Deleted.
2591         (WebCore::CryptoAlgorithmSHA224::~CryptoAlgorithmSHA224): Deleted.
2592         (WebCore::CryptoAlgorithmSHA224::digest): Use ExceptionOr.
2593         * crypto/algorithms/CryptoAlgorithmSHA224.h: Updated for above.
2594         Also use constexpr for s_name and s_identifier.
2595
2596         * crypto/algorithms/CryptoAlgorithmSHA256.cpp:
2597         (WebCore::CryptoAlgorithmSHA256::CryptoAlgorithmSHA256): Deleted.
2598         (WebCore::CryptoAlgorithmSHA256::~CryptoAlgorithmSHA256): Deleted.
2599         (WebCore::CryptoAlgorithmSHA256::digest): Use ExceptionOr.
2600         * crypto/algorithms/CryptoAlgorithmSHA256.h: Updated for above.
2601         Also use constexpr for s_name and s_identifier.
2602
2603         * crypto/algorithms/CryptoAlgorithmSHA384.cpp:
2604         (WebCore::CryptoAlgorithmSHA384::CryptoAlgorithmSHA384): Deleted.
2605         (WebCore::CryptoAlgorithmSHA384::~CryptoAlgorithmSHA384): Deleted.
2606         (WebCore::CryptoAlgorithmSHA384::digest): Use ExceptionOr.
2607         * crypto/algorithms/CryptoAlgorithmSHA384.h: Updated for above.
2608         Also use constexpr for s_name and s_identifier.
2609
2610         * crypto/algorithms/CryptoAlgorithmSHA512.cpp:
2611         (WebCore::CryptoAlgorithmSHA512::CryptoAlgorithmSHA512): Deleted.
2612         (WebCore::CryptoAlgorithmSHA512::~CryptoAlgorithmSHA512): Deleted.
2613         (WebCore::CryptoAlgorithmSHA512::digest): Use ExceptionOr.
2614         * crypto/algorithms/CryptoAlgorithmSHA512.h: Updated for above.
2615         Also use constexpr for s_name and s_identifier.
2616
2617         * crypto/gcrypt/CryptoAlgorithmHMACGCrypt.cpp:
2618         (WebCore::calculateSignature): Use Optional instead of a boolean
2619         return value and an out argument.
2620         (WebCore::CryptoAlgorithmHMAC::platformSign): Use ExceptionOr.
2621         (WebCore::CryptoAlgorithmHMAC::platformVerify): Ditto.
2622         * crypto/gnutls/CryptoAlgorithmAES_CBCGnuTLS.cpp:
2623         (WebCore::CryptoAlgorithmAES_CBC::platformEncrypt): Ditto.
2624         (WebCore::CryptoAlgorithmAES_CBC::platformDecrypt): Ditto.
2625         * crypto/gnutls/CryptoAlgorithmAES_KWGnuTLS.cpp:
2626         (WebCore::CryptoAlgorithmAES_KW::platformEncrypt): Ditto.
2627         (WebCore::CryptoAlgorithmAES_KW::platformDecrypt): Ditto.
2628         * crypto/gnutls/CryptoAlgorithmHMACGnuTLS.cpp:
2629         (WebCore::CryptoAlgorithmHMAC::platformSign): Ditto.
2630         (WebCore::CryptoAlgorithmHMAC::platformVerify): Ditto.
2631         * crypto/gnutls/CryptoAlgorithmRSAES_PKCS1_v1_5GnuTLS.cpp:
2632         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformEncrypt): Ditto.
2633         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformDecrypt): Ditto.
2634         * crypto/gnutls/CryptoAlgorithmRSASSA_PKCS1_v1_5GnuTLS.cpp:
2635         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformSign): Ditto.
2636         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformVerify): Ditto.
2637         * crypto/gnutls/CryptoAlgorithmRSA_OAEPGnuTLS.cpp:
2638         (WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt): Ditto.
2639         (WebCore::CryptoAlgorithmRSA_OAEP::platformDecrypt): Ditto.
2640
2641         * crypto/keys/CryptoKeyAES.cpp:
2642         (WebCore::CryptoKeyAES::buildAlgorithm): Updated to use name instead
2643         of nameForIdentifier.
2644         * crypto/keys/CryptoKeyHMAC.cpp: Ditto.
2645         (WebCore::CryptoKeyHMAC::buildAlgorithm):
2646
2647         * crypto/mac/CryptoAlgorithmAES_CBCMac.cpp:
2648         (WebCore::CryptoAlgorithmAES_CBC::platformEncrypt): Use ExceptionOr.
2649         (WebCore::CryptoAlgorithmAES_CBC::platformDecrypt): Ditto.
2650         * crypto/mac/CryptoAlgorithmAES_KWMac.cpp:
2651         (WebCore::CryptoAlgorithmAES_KW::platformEncrypt): Ditto.
2652         (WebCore::CryptoAlgorithmAES_KW::platformDecrypt): Ditto.
2653         * crypto/mac/CryptoAlgorithmHMACMac.cpp:
2654         (WebCore::commonCryptoHMACAlgorithm): Renamed from
2655         getCommonCryptoHMACAlgorithm and changed to use Optional instead of
2656         a boolean return value and an out argument.
2657         (WebCore::CryptoAlgorithmHMAC::platformSign): Use ExceptionOr.
2658         (WebCore::CryptoAlgorithmHMAC::platformVerify): Ditto.
2659         * crypto/mac/CryptoAlgorithmRSAES_PKCS1_v1_5Mac.cpp:
2660         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformEncrypt): Ditto.
2661         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformDecrypt): Ditto.
2662         * crypto/mac/CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp:
2663         (WebCore::cryptoDigestAlgorithm): Renamed from
2664         getCryptoDigestAlgorithm and changed to use Optional instead of
2665         a boolean return value and an out argument.
2666         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformSign): Use ExceptionOr.
2667         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformVerify): Ditto.
2668         * crypto/mac/CryptoAlgorithmRSA_OAEPMac.cpp:
2669         (WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt): Ditto.
2670         (WebCore::CryptoAlgorithmRSA_OAEP::platformDecrypt): Ditto.
2671
2672         * crypto/mac/CryptoKeyRSAMac.cpp:
2673         (WebCore::CryptoKeyRSA::buildAlgorithm): Updated to use name instead
2674         of nameForIdentifier.
2675
2676 2016-11-13  Joseph Pecoraro  <pecoraro@apple.com>
2677
2678         Use #pragma once in WebCore
2679         https://bugs.webkit.org/show_bug.cgi?id=164686
2680
2681         Reviewed by Michael Catanzaro.
2682
2683         * css/*.h:
2684         * plugins/*.h:
2685         * rendering/*.h:
2686         * style/*.h:
2687         * svg/*.h:
2688         * testing/*.h:
2689
2690 2016-11-12  Dan Bernstein  <mitz@apple.com>
2691
2692         Tried to fix the iOS build after r208666.
2693
2694         * platform/SuddenTermination.h:
2695
2696 2016-11-12  Simon Fraser  <simon.fraser@apple.com>
2697
2698         Add a way to get the UI-side scrolling tree as text via UIScriptController
2699         https://bugs.webkit.org/show_bug.cgi?id=164697
2700
2701         Reviewed by Zalan Bujtas.
2702
2703         Add dumping to ScrollingTreeNode and subclasses (previously, we could only dump
2704         the scrolling state tree). This re-uses the flags used for state tree dumping.
2705
2706         NodeIDs are not dumped by default because they can depend on earlier tests.
2707
2708         Test: scrollingcoordinator/ios/ui-scrolling-tree.html
2709
2710         * page/scrolling/ScrollingStateNode.h:
2711         * page/scrolling/ScrollingTree.cpp:
2712         (WebCore::ScrollingTree::scrollingTreeAsText):
2713         * page/scrolling/ScrollingTree.h:
2714         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
2715         (WebCore::ScrollingTreeFrameScrollingNode::dumpProperties):
2716         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
2717         * page/scrolling/ScrollingTreeNode.cpp:
2718         (WebCore::ScrollingTreeNode::dumpProperties):
2719         (WebCore::ScrollingTreeNode::dump):
2720         * page/scrolling/ScrollingTreeNode.h:
2721         * page/scrolling/ScrollingTreeScrollingNode.cpp:
2722         (WebCore::ScrollingTreeScrollingNode::dumpProperties):
2723         * page/scrolling/ScrollingTreeScrollingNode.h:
2724         * page/scrolling/mac/ScrollingTreeFixedNode.h:
2725         * page/scrolling/mac/ScrollingTreeFixedNode.mm:
2726         (WebCore::ScrollingTreeFixedNode::dumpProperties):
2727         * page/scrolling/mac/ScrollingTreeStickyNode.h:
2728         * page/scrolling/mac/ScrollingTreeStickyNode.mm:
2729         (WebCore::ScrollingTreeStickyNode::dumpProperties):
2730
2731 2016-11-12  Darin Adler  <darin@apple.com>
2732
2733         Remove some use of ExceptionCode in MediaStream
2734         https://bugs.webkit.org/show_bug.cgi?id=164690
2735
2736         Reviewed by Sam Weinig.
2737
2738         * Modules/mediastream/MediaDevices.cpp:
2739         (WebCore::MediaDevices::MediaDevices): Take a Document&.
2740         (WebCore::MediaDevices::create): Ditto.
2741         (WebCore::MediaDevices::~MediaDevices): Deleted.
2742         (WebCore::MediaDevices::getUserMedia): Check document for null and
2743         pass a reference to UserMediaRequest::start. Removed unused ExceptionCode
2744         argument to UserMediaRequest::start, since the only exception was for
2745         a null document.
2746         (WebCore::MediaDevices::enumerateDevices): Check document for null and
2747         pass a reference to MediaDevicesRequest::create. Removed exception
2748         handling entirely because MediaDevicesRequest::create was not ever
2749         raising an exception before.
2750         * Modules/mediastream/MediaDevices.h: Updated for above changes.
2751         * Modules/mediastream/MediaDevices.idl: Removed MayThrowException from
2752         enumerateDevices, because it never throws an exception.
2753
2754         * Modules/mediastream/MediaDevicesRequest.cpp:
2755         (WebCore::MediaDevicesRequest::MediaDevicesRequest): Take a Document&.
2756         Removed unused ExceptionCode& argument.
2757         (WebCore::MediaDevicesRequest::create): Ditto.
2758         * Modules/mediastream/MediaDevicesRequest.h: Updated for above changes.
2759
2760         * Modules/mediastream/NavigatorMediaDevices.cpp:
2761         (WebCore::NavigatorMediaDevices::mediaDevices): Pass a reference.
2762
2763         * Modules/mediastream/UserMediaRequest.cpp:
2764         (WebCore::UserMediaRequest::start): Use ExceptionOr.
2765         (WebCore::UserMediaRequest::UserMediaRequest): Take a Document& and
2766         a UserMediaController&.
2767         * Modules/mediastream/UserMediaRequest.h: Updated for above changes.
2768
2769 2016-11-12  Simon Fraser  <simon.fraser@apple.com>
2770
2771         [iOS WK2] Share some code with Mac for post-async-scroll state reconciliation
2772         https://bugs.webkit.org/show_bug.cgi?id=164694
2773
2774         Reviewed by Zalan Bujtas.
2775
2776         When an async scroll notifications get back to the main thread in
2777         AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll(), we call 
2778         syncViewportConstrainedLayerPositions() to poke the new layer positions on the
2779         GraphicsLayers to match the changes made on the scrolling thread.
2780
2781         However, this was not done on iOS, which will be problematic for a future patch
2782         where we require GraphicsLayer positions and the current fixedPositionViewport rect
2783         to have been computed when in a consistent state.
2784
2785         Fix by factoring some code into reconcileScrollingState(), which is called on iOS/WK2
2786         from WebPage::updateVisibleContentRects() rather than setting the FrameView's scroll offset
2787         directly.
2788
2789         Test: scrollingcoordinator/ios/sync-layer-positions-after-scroll.html
2790
2791         * page/WheelEventDeltaFilter.cpp:
2792         (WebCore::WheelEventDeltaFilter::filteredDelta):
2793         * page/scrolling/AsyncScrollingCoordinator.cpp:
2794         (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
2795         (WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
2796         (WebCore::AsyncScrollingCoordinator::syncViewportConstrainedLayerPositions):
2797         (WebCore::AsyncScrollingCoordinator::syncChildPositions): Deleted.
2798         * page/scrolling/AsyncScrollingCoordinator.h:
2799         * page/scrolling/ScrollingCoordinator.h:
2800         (WebCore::ScrollingCoordinator::reconcileScrollingState):
2801         (WebCore::ScrollingCoordinator::syncViewportConstrainedLayerPositions):
2802         (WebCore::ScrollingCoordinator::syncChildPositions): Deleted.
2803         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
2804         (WebCore::ScrollingTreeFrameScrollingNode::layoutViewportForScrollPosition):
2805         * platform/Logging.h:
2806         * platform/ScrollView.cpp:
2807         (WebCore::ScrollView::setScrollOffset):
2808         * platform/graphics/ca/TileController.cpp:
2809         (WebCore::TileController::adjustTileCoverageRect):
2810         * rendering/RenderLayer.cpp:
2811         (WebCore::RenderLayer::updateLayerPositionsAfterDocumentScroll):
2812
2813 2016-11-12  Zalan Bujtas  <zalan@apple.com>
2814
2815         RenderObject::flowThreadState should follow containing block instead of parent.
2816         https://bugs.webkit.org/show_bug.cgi?id=164629
2817
2818         Reviewed by Simon Fraser.
2819
2820         Currently every descendant of a region/multicolumn container is considered to be part of the
2821         flowthread including out-of-flow renderers. They all have the InsideFlowThread flag set.
2822         However since out-of-flow renderers are not really part of the flowthread layout context,
2823         whenever the layout code actually checks for their flowthread containers, we return nullptr and
2824         try to handle this seemingly defective state gracefully (that is, flag indicates "inside the flow thread" state,
2825         but there's no flow tread container).
2826  
2827         This patch fixes this confused state by setting the RenderObject::flowThreadState flag based on
2828         the containing block's state instead of the parent's.
2829
2830         Not testable, since we seem to manage out-of-flow elements just fine even
2831         when they have the InsideFlowThread flag set. 
2832
2833         * rendering/RenderBlock.cpp:
2834         (WebCore::RenderBlock::styleDidChange):
2835         * rendering/RenderElement.cpp:
2836         (WebCore::RenderElement::setStyle):
2837         (WebCore::RenderElement::adjustFlowThreadStateIncludingDescendants): This is an iterative DFS pre-order traversal so
2838         we set the flow state first on containers.
2839         * rendering/RenderElement.h:
2840         * rendering/RenderObject.cpp:
2841         (WebCore::RenderObject::computedFlowThreadState):
2842         (WebCore::RenderObject::initializeFlowThreadStateOnInsertion):
2843         * rendering/RenderObject.h:
2844
2845 2016-11-12  Ryosuke Niwa  <rniwa@webkit.org>
2846
2847         document.currentScript should be null when running a script inside a shadow tree
2848         https://bugs.webkit.org/show_bug.cgi?id=164693
2849
2850         Reviewed by Yusuke Suzuki.
2851
2852         Fixed the bug that we were returning the old or outer script element in document.currentScript
2853         while executing a script element inside a shadow tree. Return null instead.
2854
2855         New behavior matches the latest HTML5 specification:
2856         https://html.spec.whatwg.org/multipage/scripting.html#execute-the-script-block
2857         where it says for the classic script type, "if the script element's root is not a shadow root, then set
2858         the script element's node document's currentScript attribute to the script element. Otherwise, set it to null."
2859
2860         No new tests. imported/w3c/web-platform-tests/shadow-dom/Document-prototype-currentScript.html covers it.
2861
2862         * dom/CurrentScriptIncrementer.h:
2863         (WebCore::CurrentScriptIncrementer::CurrentScriptIncrementer): Push nullptr when the script element
2864         is inside a shadow tree.
2865         (WebCore::CurrentScriptIncrementer::~CurrentScriptIncrementer): Changed to use an early exit.
2866         * dom/Document.cpp:
2867         (WebCore::Document::pushCurrentScript): Removed the assertion since the argument can now be nullptr.
2868
2869 2016-11-12  Darin Adler  <darin@apple.com>
2870
2871         Remove a few assorted uses of ExceptionCode
2872         https://bugs.webkit.org/show_bug.cgi?id=164683
2873
2874         Reviewed by Chris Dumez.
2875
2876         * Modules/applepay/PaymentContact.h: Removed include of ExceptionCode.h.
2877         Also tidied up the constructor and destructor.
2878
2879         * Modules/indexeddb/IDBFactory.h: Removed typedef of ExceptionCode.
2880         * Modules/indexeddb/IDBKeyRange.h: Ditto.
2881
2882         * bindings/js/JSWebGLRenderingContextBaseCustom.cpp:
2883         (WebCore::getObjectParameter): Removed local ExceptionCode variable that
2884         was always 0.
2885         (WebCore::JSWebGLRenderingContextBase::getAttachedShaders): Ditto.
2886         (WebCore::dataFunctionf): Ditto.
2887         (WebCore::dataFunctioni): Ditto.
2888         (WebCore::dataFunctionMatrix): Ditto.
2889         * dom/ContainerNode.cpp:
2890         (WebCore::ContainerNode::cloneChildNodes): Ditto.
2891
2892         * dom/Document.h: Removed typedef of ExceptionCode.
2893         * dom/TreeWalker.h: Ditto.
2894         * editing/markup.h: Ditto.
2895         * html/ImageData.h: Ditto.
2896         * html/InputType.h: Ditto.
2897         * html/canvas/CanvasRenderingContext2D.h: Ditto.
2898         * html/canvas/WebGLDebugShaders.h: Ditto.
2899
2900         * page/DOMWindow.cpp:
2901         (WebCore::DOMWindow::setTimeout): Fixed typo where this was using
2902         ExceptionCode instead of Exception. The code would return an integer
2903         instead of an exception in this case. I could not produce a test that
2904         exercises this code path; I suspect it is an unreachable error condition.
2905         (WebCore::DOMWindow::setInterval): Ditto.
2906
2907         * replay/MemoizedDOMResult.h: Changed typedef of ExceptionCode into
2908         a using statement. Not sure what the longer term fix is.
2909
2910         * xml/parser/XMLDocumentParserLibxml2.cpp:
2911         (WebCore::PendingCallbacks::appendStartElementNSCallback): Renamed to use
2912         WebKit-style "numXXX" rather than "nb_xxx".
2913         (WebCore::PendingCallbacks::PendingStartElementNSCallback::~PendingStartElementNSCallback):
2914         Ditto.
2915         (WebCore::handleNamespaceAttributes): Ditto. Replaced ExceptionCode out
2916         argument with a boolean return value.
2917         (WebCore::handleElementAttributes): Ditto.
2918         (WebCore::XMLDocumentParser::startElementNs): Ditto. Updated for changes
2919         to the handle functions above.
2920         (WebCore::startElementNsHandler): More of the same.
2921         (WebCore::attributesStartElementNsHandler): Ditto.
2922
2923 2016-11-11  Darin Adler  <darin@apple.com>
2924
2925         Remove LegacyException support from bindings script
2926         https://bugs.webkit.org/show_bug.cgi?id=164516
2927
2928         Reviewed by Youenn Fablet.
2929
2930         Besides removing LegacyException support from the bindings script, this patch
2931         also removes most uses of ExceptionCodePlaceholder.h. Also, some call sites of
2932         createElement were using ASSERT_NO_EXCEPTION on an argument that was not even an
2933         ExceptionCode&, so to fix that, this changes most call sites to use specific create
2934         functions for specific element classes, rather than using Document::createElement.
2935
2936         * Modules/mediasource/SourceBuffer.cpp: Removed include of
2937         ExceptionCodePlaceholder.h.
2938         * Modules/mediastream/MediaStreamTrack.cpp: Ditto.
2939         * Modules/websockets/WebSocketChannel.cpp: Ditto.
2940         * bindings/js/JSBlobCustom.cpp: Ditto.
2941
2942         * bindings/scripts/CodeGeneratorJS.pm:
2943         (GenerateImplementation): Removed support for GetterMayThrowLegacyException,
2944         SetterMayThrowLegacyException, and MayThrowLegacyException.
2945         (GenerateParametersCheck): Ditto.
2946         (GenerateImplementationFunctionCall): Ditto.
2947         (GenerateConstructorDefinition): Ditto.
2948
2949         * bindings/scripts/IDLAttributes.txt: Removed ConstructorMayThrowLegacyException,
2950         GetterMayThrowLegacyException, MayThrowLegacyException, and SetterMayThrowLegacyException.
2951
2952         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
2953         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
2954         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
2955         * bindings/scripts/test/JS/JSTestInterface.cpp:
2956         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
2957         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
2958         * bindings/scripts/test/JS/JSTestObj.cpp:
2959         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
2960         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2961         Updated exepected results.
2962
2963         * bindings/scripts/test/TestImplements.idl: Use non-legacy exceptions.
2964         * bindings/scripts/test/TestInterface.idl: Ditto.
2965         * bindings/scripts/test/TestNamedConstructor.idl: Ditto.
2966         * bindings/scripts/test/TestObj.idl: Ditto.
2967         * bindings/scripts/test/TestSupplemental.idl: Ditto.
2968         * bindings/scripts/test/TestTypedefs.idl: Ditto.
2969
2970         * dom/ContainerNode.h: Removed include of ExceptionCodePlaceholder.h.
2971         * editing/AlternativeTextController.cpp: Ditto.
2972         * editing/AppendNodeCommand.cpp: Ditto.
2973
2974         * editing/CompositeEditCommand.cpp:
2975         (WebCore::CompositeEditCommand::moveParagraphs): Use specific create function
2976         instead of Document::createElement.
2977
2978         * editing/DeleteFromTextNodeCommand.cpp: Removed include of
2979         ExceptionCodePlaceholder.h.
2980         * editing/Editor.cpp: Ditto.
2981         * editing/EditorCommand.cpp: Ditto.
2982         * editing/FormatBlockCommand.cpp: Ditto.
2983
2984         * editing/IndentOutdentCommand.cpp:
2985         (WebCore::IndentOutdentCommand::tryIndentingAsListItem): Use specific create
2986         function instead of Document::createElement.
2987
2988         * editing/InsertListCommand.cpp: Removed include of ExceptionCodePlaceholder.h.
2989         * editing/InsertNodeBeforeCommand.cpp: Ditto.
2990         * editing/RemoveNodeCommand.cpp: Ditto.
2991         * editing/ReplaceSelectionCommand.cpp: Ditto.
2992         * editing/TextIterator.cpp: Ditto.
2993         * editing/WrapContentsInDummySpanCommand.cpp: Ditto.
2994
2995         * editing/cocoa/EditorCocoa.mm:
2996         (WebCore::Editor::styleForSelectionStart): Use specific create function instead
2997         of Document::createElement.
2998         * editing/htmlediting.cpp:
2999         (WebCore::createTabSpanElement): Ditto.
3000         * editing/ios/EditorIOS.mm:
3001         (WebCore::Editor::WebContentReader::readURL): Ditto.
3002         * editing/mac/EditorMac.mm:
3003         (WebCore::Editor::WebContentReader::readURL): Ditto.
3004
3005         * editing/markup.cpp: Removed include of ExceptionCodePlaceholder.h.
3006
3007         * html/FTPDirectoryDocument.cpp:
3008         (WebCore::FTPDirectoryDocumentParser::appendEntry): Use specific create function
3009         instead of Document::createElement.
3010         (WebCore::FTPDirectoryDocumentParser::createTDForFilename): Ditto.
3011         (WebCore::FTPDirectoryDocumentParser::loadDocumentTemplate): Ditto.
3012         (WebCore::FTPDirectoryDocumentParser::createBasicDocument): Ditto.
3013
3014         * html/HTMLEmbedElement.cpp:
3015         (WebCore::HTMLEmbedElement::create): Added overload that just takes a Document.
3016         * html/HTMLEmbedElement.h: Updated for above.
3017
3018         * html/HTMLMediaElement.cpp: Removed include of ExceptionCodePlaceholder.h.
3019
3020         * html/HTMLMetaElement.cpp:
3021         (WebCore::HTMLMetaElement::create): Added overload that just takes a Document.
3022         * html/HTMLMetaElement.h: Updated for above.
3023
3024         * html/HTMLOutputElement.cpp: Removed include of ExceptionCodePlaceholder.h.
3025
3026         * html/HTMLSelectElement.cpp: Ditto.
3027         (WebCore::HTMLSelectElement::setLength): Use specific create function
3028         instead of Document::createElement.
3029
3030         * html/HTMLSourceElement.cpp:
3031         (WebCore::HTMLSourceElement::create): Added overload that just takes a Document.
3032         * html/HTMLSourceElement.h: Updated for above.
3033
3034         * html/HTMLStyleElement.cpp:
3035         (WebCore::HTMLStyleElement::HTMLStyleElement): Moved data member initialization
3036         to class definition.
3037         (WebCore::HTMLStyleElement::create): Added overload that just takes a Document.
3038         * html/HTMLStyleElement.h: Updated for above. Also made finishParsingChildren public.
3039
3040         * html/HTMLTableElement.cpp: Removed include of ExceptionCodePlaceholder.h.
3041         * html/HTMLTextAreaElement.cpp: Ditto.
3042
3043         * html/HTMLVideoElement.cpp:
3044         (WebCore::HTMLVideoElement::create): Added overload that just takes a Document.
3045         * html/HTMLVideoElement.h: Updated for above.
3046
3047         * html/ImageDocument.cpp:
3048         (WebCore::ImageDocument::createDocumentStructure): Use specific create function
3049         instead of Document::createElement.
3050
3051         * html/InputType.cpp: Removed include of ExceptionCodePlaceholder.h.
3052
3053         * html/MediaDocument.cpp:
3054         (WebCore::MediaDocumentParser::createDocumentStructure): Use specific create
3055         function instead of Document::createElement.
3056         (WebCore::MediaDocument::replaceMediaElementTimerFired): Ditto.
3057         * html/PluginDocument.cpp:
3058         (WebCore::PluginDocumentParser::createDocumentStructure): Ditto.
3059
3060         * html/RangeInputType.cpp: Removed include of ExceptionCodePlaceholder.h.
3061
3062         * html/RubyElement.cpp:
3063         (WebCore::RubyElement::create): Added overload that just takes a Document.
3064         * html/RubyElement.h: Updated for above.
3065
3066         * html/RubyTextElement.cpp:
3067         (WebCore::RubyTextElement::create): Added overload that just takes a Document.
3068         * html/RubyTextElement.h: Updated for above.
3069
3070         * html/ValidationMessage.cpp: Removed include of ExceptionCodePlaceholder.h.
3071         * html/canvas/CanvasRenderingContext2D.cpp: Ditto.
3072         * html/shadow/MediaControlElementTypes.cpp: Ditto.
3073
3074         * html/shadow/MediaControlElements.cpp:
3075         (WebCore::MediaControlClosedCaptionsTrackListElement::rebuildTrackListMenu):
3076         Use specific create function instead of Document::createElement.
3077
3078         * html/shadow/MediaControls.cpp: Removed include of ExceptionCodePlaceholder.h.
3079         * html/shadow/MediaControlsApple.cpp: Ditto.
3080         * html/track/InbandDataTextTrack.cpp: Ditto.
3081         * html/track/InbandGenericTextTrack.cpp: Ditto.
3082         * html/track/InbandTextTrack.cpp: Ditto.
3083         * html/track/VTTRegion.cpp: Ditto.
3084
3085         * html/track/WebVTTElement.cpp:
3086         (WebCore::WebVTTElement::createEquivalentHTMLElement): Use specific create
3087         function instead of Document::createElement.
3088         * inspector/InspectorCSSAgent.cpp:
3089         (WebCore::InspectorCSSAgent::createInspectorStyleSheetForDocument): Ditto.
3090
3091         * page/ContextMenuController.cpp: Removed include of ExceptionCodePlaceholder.h.
3092         * page/DOMWindow.cpp: Ditto.
3093         * page/DragController.cpp: Ditto.
3094         * page/EventHandler.cpp: Ditto.
3095         * page/Page.cpp: Ditto.
3096         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: Ditto.
3097         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm: Ditto.
3098         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: Ditto.
3099         * platform/mac/PasteboardMac.mm: Ditto.
3100         * platform/mac/WebVideoFullscreenHUDWindowController.mm: Ditto.
3101         * platform/mock/mediasource/MockMediaPlayerMediaSource.cpp: Ditto.
3102         * platform/mock/mediasource/MockMediaSourcePrivate.cpp: Ditto.
3103         * rendering/RenderNamedFlowThread.cpp: Ditto.
3104         * rendering/RenderThemeEfl.cpp: Ditto.
3105         * rendering/RenderThemeMac.mm: Ditto.
3106         * rendering/style/SVGRenderStyle.h: Ditto.
3107         * svg/SVGTRefElement.cpp: Ditto.
3108
3109         * xml/XMLErrors.cpp:
3110         (WebCore::XMLErrors::XMLErrors): Take a reference and initialize data member
3111         in class definition.
3112         (WebCore::createXHTMLParserErrorHeader): Take a reference, and mostly use
3113         specific create functions instead of createElement.
3114         (WebCore::XMLErrors::insertErrorMessageBlock): Ditto.
3115         * xml/XMLErrors.h: Updated for above.
3116
3117         * xml/XMLTreeViewer.cpp: Removed include of ExceptionCodePlaceholder.h.
3118
3119         * xml/parser/XMLDocumentParser.cpp:
3120         (WebCore::XMLDocumentParser::handleError): Pass a reference.
3121
3122         * xml/parser/XMLDocumentParserLibxml2.cpp: Removed include of
3123         ExceptionCodePlaceholder.h.
3124
3125 2016-11-12  Dan Bernstein  <mitz@apple.com>
3126
3127         Clean up a couple of macOS *SPI headers
3128         https://bugs.webkit.org/show_bug.cgi?id=164687
3129
3130         Reviewed by Sam Weinig.
3131
3132         * platform/spi/cocoa/NSTouchBarSPI.h: Replaced hardcoded strings with global declarations.
3133         * platform/spi/mac/NSSpellCheckerSPI.h: Addressed FIXME by importing private header, and removed declarations
3134           that already appear in the SDK.
3135
3136 2016-11-12  Wenson Hsieh  <wenson_hsieh@apple.com>
3137
3138         The main content heuristic should be robust when handling large media elements
3139         https://bugs.webkit.org/show_bug.cgi?id=164676
3140         <rdar://problem/29211503>
3141
3142         Reviewed by Eric Carlson.
3143
3144         Handles integer overflow gracefully when performing the main content check for very large media elements. If the
3145         heuristic comes across such an element, it will now bail early and reject the video as main content. Also adds a
3146         new API test: VideoControlsManager.VideoControlsManagerPageWithEnormousVideo.
3147
3148         * html/MediaElementSession.cpp:
3149         (WebCore::isElementRectMostlyInMainFrame):
3150
3151 2016-11-12  Chris Dumez  <cdumez@apple.com>
3152
3153         Speed up setting attributes of input elements of type 'text'
3154         https://bugs.webkit.org/show_bug.cgi?id=164674
3155
3156         Reviewed by Ryosuke Niwa.
3157
3158         Speed up setting attributes of input elements of type 'text' by calling
3159         updateInnerTextValue() only when needed. It was previously called
3160         whenever an attribute was set, no matter it could impact its text value
3161         or not.
3162
3163         No new tests, no Web-exposed behavior change.
3164
3165         * html/HTMLInputElement.cpp:
3166         (WebCore::HTMLInputElement::parseAttribute):
3167         * html/InputType.cpp:
3168         (WebCore::InputType::attributeChanged):
3169         * html/InputType.h:
3170         * html/TextFieldInputType.cpp:
3171         (WebCore::TextFieldInputType::attributeChanged):
3172         * html/TextFieldInputType.h:
3173
3174 2016-11-12  Dan Bernstein  <mitz@apple.com>
3175
3176         Tried to fix the 32-bit build.
3177
3178         * platform/mac/WebPlaybackControlsManager.mm:
3179
3180 2016-11-12  Dan Bernstein  <mitz@apple.com>
3181
3182         Tried to fix the 32-bit build.
3183
3184         * platform/mac/WebPlaybackControlsManager.h:
3185
3186 2016-11-12  Dan Bernstein  <mitz@apple.com>
3187
3188         Tried to fix the build.
3189
3190         * platform/mac/WebPlaybackControlsManager.h: Declared conformance to
3191           AVFunctionBarPlaybackControlsControlling, which is expected in WebKit::WebViewImpl.
3192           Added ivar.
3193         * platform/mac/WebPlaybackControlsManager.mm:
3194           Synthesize seekToTime property needed for AVFunctionBarPlaybackControlsControlling
3195           conformance.
3196         (-[WebPlaybackControlsManager isSeeking]): Implement this
3197           AVFunctionBarPlaybackControlsControlling method.
3198         (-[WebPlaybackControlsManager seekToTime:toleranceBefore:toleranceAfter:]): Ditto.
3199
3200 2016-11-12  Dan Bernstein  <mitz@apple.com>
3201
3202         Tried to fix the build.
3203
3204         * platform/spi/cocoa/NSTouchBarSPI.h: Removed duplicate @interface declarations.
3205
3206 2016-11-12  Frederic Wang  <fwang@igalia.com>
3207
3208         Ensure MathML render tree are clean by the end of FrameView::layout().
3209         https://bugs.webkit.org/show_bug.cgi?id=162824
3210
3211         Reviewed by Darin Adler.
3212
3213         clearNeedsLayout is not called during the layout of invalid MathML markup. We introduce a new
3214         helper function to perform proper layout of such markup and we now call it from the various
3215         MathML layoutBlock functions. Additionally, we ensure that the preferred width is dirty after
3216         computation in RenderMathMLScripts::computePreferredLogicalWidths.
3217
3218         Test: mathml/invalid-markup.html
3219
3220         * rendering/mathml/RenderMathMLBlock.cpp:
3221         (WebCore::RenderMathMLBlock::layoutInvalidMarkup): Helper function to layout invalid markup.
3222         * rendering/mathml/RenderMathMLBlock.h: Declare layoutInvalidMarkup.
3223         * rendering/mathml/RenderMathMLFraction.cpp:
3224         (WebCore::RenderMathMLFraction::layoutBlock): Call layoutInvalidMarkup.
3225         * rendering/mathml/RenderMathMLRoot.cpp:
3226         (WebCore::RenderMathMLRoot::layoutBlock): Ditto.
3227         * rendering/mathml/RenderMathMLScripts.cpp:
3228         (WebCore::RenderMathMLScripts::computePreferredLogicalWidths): Set the preferred width dirty
3229         after computation to avoid that it is computed again and again.
3230         (WebCore::RenderMathMLScripts::layoutBlock): Call layoutInvalidMarkup.
3231         * rendering/mathml/RenderMathMLUnderOver.cpp:
3232         (WebCore::RenderMathMLUnderOver::layoutBlock): Ditto.
3233
3234 2016-11-12  Frederic Wang  <fwang@igalia.com>
3235
3236         Remove RenderMathMLOperator::shouldAllowStretching
3237         https://bugs.webkit.org/show_bug.cgi?id=164313
3238
3239         Reviewed by Darin Adler.
3240
3241         RenderMathMLOperator::shouldAllowStretching is an old function from early implementations of
3242         MathML. Its name is now confusing since it also includes non-stretchy large operators.
3243         Moreover, it is not really useful and is actually only used by two functions: useMathOperator
3244         and updateMathOperator. The former is almost equivalent and is used as a replacement of
3245         shouldAllowStretching everywhere else. We rewrite the two remaining calls with the finer
3246         test functions isStretchy() and isLargeOperatorInDisplayStyle().
3247
3248         No new tests, behavior unchanged.
3249
3250         * rendering/mathml/RenderMathMLOperator.cpp:
3251         (WebCore::RenderMathMLOperator::updateMathOperator): Reorder the conditionals to avoid the
3252         use of RenderMathMLOperator::shouldAllowStretching and match useMathOperator.
3253         (WebCore::RenderMathMLOperator::useMathOperator): Rewrite shouldAllowStretching() using
3254         isStretchy() and isLargeOperatorInDisplayStyle().
3255         (WebCore::RenderMathMLOperator::shouldAllowStretching): Deleted.
3256         * rendering/mathml/RenderMathMLOperator.h: Remove declaration of shouldAllowStretching.
3257
3258 2016-11-12  Joseph Pecoraro  <pecoraro@apple.com>
3259
3260         Use #pragma once in WebCore
3261         https://bugs.webkit.org/show_bug.cgi?id=164373
3262
3263         Reviewed by Darin Adler.
3264
3265         * Modules/*.h:
3266         * crypto/*.h:
3267         * cssjit/*.h:
3268         * editing/*.h:
3269         * fileapi/*.h:
3270         * history/*.h:
3271         * loader/*.h:
3272         * mathml/*.h:
3273         * page/*.h:
3274         * replay/*.h:
3275         * storage/*.h:
3276         * xml/*.h:
3277
3278         * editing/FrameSelection.cpp:
3279         * loader/ResourceLoadStatisticsStore.cpp:
3280         Remove unused LOG and DEBUG defines.
3281
3282 2016-11-12  Wenson Hsieh  <wenson_hsieh@apple.com>
3283
3284         Follow-up: fix the OpenSource build on Mac after r208642
3285         https://bugs.webkit.org/show_bug.cgi?id=164677
3286
3287         Reviewed by Ryosuke Niwa.
3288
3289         The playbackControlsController property should also be `assign`.
3290
3291         * platform/spi/cocoa/AVKitSPI.h:
3292
3293 2016-11-11  Wenson Hsieh  <wenson_hsieh@apple.com>
3294
3295         SPI imports in AVKitSPI.h should be guarded by USE(APPLE_INTERNAL_SDK)
3296         https://bugs.webkit.org/show_bug.cgi?id=164672
3297
3298         Reviewed by Dan Bernstein.
3299
3300         Fixes the OpenSource build when ENABLE(WEB_PLAYBACK_CONTROLS_MANAGER) is on.
3301
3302         * platform/spi/cocoa/AVKitSPI.h: Add USE(APPLE_INTERNAL_SDK) guards around AVKit function bar SPI headers.
3303         Additionally, define AVFunctionBarPlaybackControlsProvider in the case where AVKit SPI is unavailable.
3304
3305 2016-11-11  Ryosuke Niwa  <rniwa@webkit.org>
3306
3307         event.composedPath() does not include window
3308         https://bugs.webkit.org/show_bug.cgi?id=164609
3309         <rdar://problem/29210383>
3310
3311         Reviewed by Antti Koivisto.
3312
3313         Fixed the bug by including WindowContext be a part of the regular EventPath. This also simplifies
3314         dispatchEventInDOM which used to had a special logic for dispatching an event on the window.
3315
3316         Also fixed a bug in EventDispatcher::dispatchEvent that event.target would be nullptr when an event was
3317         dispatched inside a disconnected shadow tree or prevented from propagating to the document tree.
3318         Preserve the final target by simply saving event.target() prior to invoking the default event handler instead.
3319
3320         Test: fast/shadow-dom/event-path-with-window.html
3321
3322         * dom/EventDispatcher.cpp:
3323         (WebCore::WindowEventContext): Deleted. Moved to EventPath.cpp.
3324         (WebCore::dispatchEventInDOM): Removed the code for WindowContext. The generic event dispatching logic
3325         will do the same work now.
3326         (WebCore::EventDispatcher::dispatchEvent): Restore the original target instead of using that of WindowContext.
3327         * dom/EventPath.cpp:
3328         (WebCore::WindowEventContext): Moved from EventDispatcher.cpp. Also made it a subclass of EventContext.
3329         (WebCore::WindowEventContext::handleLocalEvents): Added.
3330         (WebCore::EventPath::EventPath): When the parent's nullptr, check if the current node is Document. If it is,
3331         follow https://dom.spec.whatwg.org/#interface-document where it says:
3332         "A document’s get the parent algorithm, given an event, returns null if event’s type attribute value is 'load'
3333          or document does not have a browsing context, and the document’s associated Window object otherwise."
3334         (WebCore::EventPath::setRelatedTarget): Skip over WindowContext.
3335         (WebCore::EventPath::retargetTouch): Ditto.
3336         (WebCore::EventPath::computePathUnclosedToTarget): When the target is DOMWindow, use its document as the target.
3337         Also, include any event target that is not a node in the event path.
3338
3339 2016-11-11  Dave Hyatt  <hyatt@apple.com>
3340
3341         [CSS Parser] Support all the correct blend modes
3342         https://bugs.webkit.org/show_bug.cgi?id=164669
3343
3344         Reviewed by Dean Jackson.
3345
3346         * css/parser/CSSParserFastPaths.cpp:
3347         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
3348
3349 2016-11-11  Alex Christensen  <achristensen@webkit.org>
3350
3351         Use SecurityOriginData as keys in StorageManager
3352         https://bugs.webkit.org/show_bug.cgi?id=159834
3353         <rdar://problem/27346948>
3354
3355         Reviewed by Brady Eidson.
3356
3357         No change in behavior.
3358
3359         * page/SecurityOriginData.h:
3360         (WebCore::SecurityOriginData::SecurityOriginData):
3361         (WebCore::SecurityOriginData::isEmpty):
3362         (WebCore::SecurityOriginData::isHashTableDeletedValue):
3363         (WebCore::SecurityOriginDataHashTraits::isEmptyValue):
3364         (WebCore::SecurityOriginDataHash::hash):
3365         (WebCore::SecurityOriginDataHash::equal):
3366         Add some hash functions so a SecurityOriginData can be used as a key in a HashMap.
3367
3368 2016-11-11  Ryosuke Niwa  <rniwa@webkit.org>
3369
3370         Hovering over a slotted Text node clears hover state
3371         https://bugs.webkit.org/show_bug.cgi?id=164002
3372         <rdar://problem/29040471>
3373
3374         Reviewed by Simon Fraser.
3375
3376         The bug was caused by HitTestResult::innerElement returning the parent element of a Text node without
3377         taking the shadow root or slots into account. For hit testing, we always want to use the "flat tree"
3378         or "composed tree" (imprecisely but close enough in this case).
3379