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