d707ebf19cd0b2ea82c574d31ab7ef4fd96015f8
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-08-30  Antti Koivisto  <antti@apple.com>
2
3         Remove StylePendingImage
4         https://bugs.webkit.org/show_bug.cgi?id=161245
5
6         Reviewed by Andreas Kling.
7
8         Instances of this confusing type are used as placeholders during style resolution.
9         We can get rid of it and make "pending" a state of StyleImage. This simplies the code and
10         will allow further improvements.
11
12         * WebCore.xcodeproj/project.pbxproj:
13         * css/CSSCrossfadeValue.cpp:
14         (WebCore::CSSCrossfadeValue::isPending):
15         (WebCore::CSSCrossfadeValue::blend):
16         * css/CSSCrossfadeValue.h:
17         * css/CSSCursorImageValue.cpp:
18         (WebCore::CSSCursorImageValue::CSSCursorImageValue):
19         (WebCore::CSSCursorImageValue::~CSSCursorImageValue):
20
21             Save the original URL since the underlying CSSImageValue may change.
22
23         (WebCore::CSSCursorImageValue::updateCursorElement):
24         (WebCore::CSSCursorImageValue::cursorElementRemoved):
25         (WebCore::CSSCursorImageValue::cursorElementChanged):
26         (WebCore::CSSCursorImageValue::loadImage):
27         (WebCore::CSSCursorImageValue::styleImage):
28         (WebCore::CSSCursorImageValue::isSVGCursor):
29         (WebCore::CSSCursorImageValue::cachedImageURL):
30         (WebCore::CSSCursorImageValue::updateCachedImage):
31         (WebCore::CSSCursorImageValue::detachPendingImage): Deleted.
32         (WebCore::CSSCursorImageValue::cachedImage): Deleted.
33         (WebCore::CSSCursorImageValue::cachedOrPendingImage): Deleted.
34         (WebCore::CSSCursorImageValue::clearCachedImage): Deleted.
35         * css/CSSCursorImageValue.h:
36         * css/CSSFilterImageValue.cpp:
37         (WebCore::CSSFilterImageValue::isPending):
38         * css/CSSFilterImageValue.h:
39         * css/CSSImageGeneratorValue.cpp:
40         (WebCore::CSSImageGeneratorValue::isPending):
41         (WebCore::CSSImageGeneratorValue::subimageIsPending):
42         (WebCore::CSSImageGeneratorValue::cachedImageForCSSValue):
43         * css/CSSImageGeneratorValue.h:
44         * css/CSSImageSetValue.cpp:
45         (WebCore::CSSImageSetValue::~CSSImageSetValue):
46         (WebCore::CSSImageSetValue::loadBestFitImage):
47         (WebCore::CSSImageSetValue::styleImage):
48         (WebCore::CSSImageSetValue::traverseSubresources):
49         (WebCore::CSSImageSetValue::detachPendingImage): Deleted.
50         (WebCore::CSSImageSetValue::bestFitImage): Deleted.
51         (WebCore::CSSImageSetValue::cachedOrPendingImageSet): Deleted.
52         * css/CSSImageSetValue.h:
53         * css/CSSImageValue.cpp:
54         (WebCore::CSSImageValue::CSSImageValue):
55         (WebCore::CSSImageValue::~CSSImageValue):
56         (WebCore::CSSImageValue::isPending):
57         (WebCore::CSSImageValue::styleImage):
58         (WebCore::CSSImageValue::loadImage):
59         (WebCore::CSSImageValue::traverseSubresources):
60         (WebCore::CSSImageValue::detachPendingImage): Deleted.
61         (WebCore::CSSImageValue::cachedOrPendingImage): Deleted.
62         (WebCore::CSSImageValue::cachedImage): Deleted.
63         * css/CSSImageValue.h:
64         (WebCore::CSSImageValue::create):
65         * css/StyleResolver.cpp:
66         (WebCore::StyleResolver::cachedOrPendingFromValue):
67         (WebCore::StyleResolver::generatedOrPendingFromValue):
68         (WebCore::StyleResolver::setOrPendingFromValue):
69         (WebCore::StyleResolver::cursorOrPendingFromValue):
70         * page/PageSerializer.cpp:
71         (WebCore::PageSerializer::retrieveResourcesForProperties):
72         * page/animation/CSSPropertyAnimation.cpp:
73         (WebCore::blendFilter):
74         (WebCore::crossfadeBlend):
75         * rendering/RenderImageResourceStyleImage.cpp:
76         (WebCore::RenderImageResourceStyleImage::image):
77         * rendering/shapes/ShapeOutsideInfo.cpp:
78         (WebCore::ShapeOutsideInfo::createShapeForImage):
79         * rendering/style/StyleCachedImage.cpp:
80         (WebCore::StyleCachedImage::StyleCachedImage):
81         (WebCore::StyleCachedImage::~StyleCachedImage):
82         (WebCore::StyleCachedImage::setCachedImage):
83         (WebCore::StyleCachedImage::cssValue):
84         (WebCore::StyleCachedImage::canRender):
85         (WebCore::StyleCachedImage::isPending):
86         (WebCore::StyleCachedImage::isLoaded):
87         (WebCore::StyleCachedImage::errorOccurred):
88         (WebCore::StyleCachedImage::imageSize):
89         (WebCore::StyleCachedImage::imageHasRelativeWidth):
90         (WebCore::StyleCachedImage::imageHasRelativeHeight):
91         (WebCore::StyleCachedImage::computeIntrinsicDimensions):
92         (WebCore::StyleCachedImage::usesImageContainerSize):
93         (WebCore::StyleCachedImage::setContainerSizeForRenderer):
94         (WebCore::StyleCachedImage::addClient):
95         (WebCore::StyleCachedImage::removeClient):
96         (WebCore::StyleCachedImage::image):
97         (WebCore::StyleCachedImage::knownToBeOpaque):
98         * rendering/style/StyleCachedImage.h:
99         * rendering/style/StyleGeneratedImage.cpp:
100         (WebCore::StyleGeneratedImage::isPending):
101         * rendering/style/StyleGeneratedImage.h:
102         * rendering/style/StyleImage.h:
103         (WebCore::StyleImage::isCachedImage):
104         (WebCore::StyleImage::StyleImage):
105         (WebCore::StyleImage::canRender): Deleted.
106         (WebCore::StyleImage::isPendingImage): Deleted.
107         * rendering/style/StylePendingImage.h: Removed.
108         * style/StylePendingResources.cpp:
109         (WebCore::Style::loadPendingImage):
110         (WebCore::Style::loadPendingImages):
111
112 2016-08-30  Philippe Normand  <pnormand@igalia.com>
113
114         [GStreamer] bump required version to 1.2.3
115         https://bugs.webkit.org/show_bug.cgi?id=159667
116
117         Reviewed by Xabier Rodriguez Calvar.
118
119         GStreamer 1.0.3 was released almost 4 years ago. GStreamer 1.2.3
120         being the version shipped in the Ubuntu LTS (14.04) it
121         feels reasonable to bump our requirement. Other major
122         distributions like Debian Jessie and Fedora ship GStreamer 1.4.x
123         already.
124
125         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
126         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
127         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
128         (WebCore::MediaPlayerPrivateGStreamerBase::updateTexture): Deleted.
129         * platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
130         (webkitVideoSinkProposeAllocation): Deleted.
131         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
132         (webKitWebSrcQueryWithParent): Deleted.
133
134 2016-08-29  Alex Christensen  <achristensen@webkit.org>
135
136         Fix Windows build after r205161
137
138         * bindings/js/JSPerformanceTimingCustom.cpp:
139
140 2016-08-29  Chris Dumez  <cdumez@apple.com>
141
142         We should throw a SecurityError when denying setting a cross-origin Location property
143         https://bugs.webkit.org/show_bug.cgi?id=161368
144
145         Reviewed by Ryosuke Niwa.
146
147         We should throw a SecurityError when denying setting a cross-origin
148         Location property:
149         - https://html.spec.whatwg.org/#location-set
150         - https://html.spec.whatwg.org/#crossoriginset-(-o,-p,-v,-receiver-)
151         - https://html.spec.whatwg.org/#location-getownproperty
152
153         Firefox and Chrome already throw. We currently ignore and log an error
154         message.
155
156         No new tests, updated existing tests.
157
158         * bindings/js/JSLocationCustom.cpp:
159         (WebCore::JSLocation::putDelegate):
160
161 2016-08-29  Brent Fulgham  <bfulgham@apple.com>
162
163         Avoid holding GlyphData in MathOperator
164         https://bugs.webkit.org/show_bug.cgi?id=161256
165         <rdar://problem/28033400>
166
167         Reviewed by Myles C. Maxfield.
168
169         Do not cache GlyphData in MathOperator elements, because the fonts referenced in the
170         GlyphData may be purged during low-memory conditions. Instead, we should store either
171         the relevant CodePoint, or the fallback Glyph (for the current system font).
172
173         Added an initialization function for GlyphAssemblyData, since unions containing structs
174         do not properly call constructors, resulting in garbage font/glyph content.
175
176         No new tests. Changes are covered by existing MathML test suite.
177
178         * rendering/mathml/MathOperator.cpp:
179         (WebCore::MathOperator::GlyphAssemblyData::initialize): Added.
180         (WebCore::MathOperator::MathOperator): Initialize m_assembly/m_variant.
181         (WebCore::MathOperator::setSizeVariant): Only store the glyph, not the font.
182         (WebCore::glyphDataForCodePointOrFallbackGlyph): Added helper function.
183         (WebCore::MathOperator::setGlyphAssembly): Do not rely on stored GlyphData.
184         (WebCore::MathOperator::calculateGlyphAssemblyFallback): Remove unneeded argument. Check
185         if a fallback glyph is being used and remember for later.
186         (WebCore::MathOperator::calculateStretchyData): Do not rely on stored GlyphData.
187         (WebCore::MathOperator::fillWithVerticalExtensionGlyph): Ditto.
188         (WebCore::MathOperator::fillWithHorizontalExtensionGlyph): Ditto.
189         (WebCore::MathOperator::paintVerticalGlyphAssembly): Ditto.
190         (WebCore::MathOperator::paintHorizontalGlyphAssembly): Ditto.
191         (WebCore::MathOperator::paint): Ditto.
192         * rendering/mathml/MathOperator.h:
193         (WebCore::MathOperator::GlyphAssemblyData::hasExtension): Added.
194         (WebCore::MathOperator::GlyphAssemblyData::hasMiddle): Added.
195         (WebCore::MathOperator::MathOperator): Deleted.
196
197 2016-08-29  Dean Jackson  <dino@apple.com>
198
199         JSON.stringify returns empty when used with performance.timing.
200         https://bugs.webkit.org/show_bug.cgi?id=151813
201         <rdar://problem/28066067>
202
203         Reviewed by Sam Weinig.
204
205         While we are waiting for our bindings generator to handle
206         "serializer", add a custom toJSON function that allows
207         performance.timing to be stringified.
208
209         Test: fast/dom/webtiming-performance-timing-stringify.html
210
211         * CMakeLists.txt: New file added.
212         * WebCore.xcodeproj/project.pbxproj: New file added.
213         * bindings/js/JSPerformanceTimingCustom.cpp: Added. Implements toJSON.
214         (WebCore::JSPerformanceTiming::toJSON):
215         * page/PerformanceTiming.idl: Add toJSON().
216
217 2016-08-29  Chris Dumez  <cdumez@apple.com>
218
219         Regression(r204923): It should be possible to set 'Location.href' cross origin
220         https://bugs.webkit.org/show_bug.cgi?id=161343
221         <rdar://problem/28063361>
222
223         Reviewed by Ryosuke Niwa.
224
225         It should be possible to set 'Location.href' cross origin:
226         - https://html.spec.whatwg.org/#crossoriginproperties-(-o-)
227
228         Firefox and Chrome allow this but we throw a SecurityError.
229
230         We already allow setting crossOrigin.window.location which is equivalent.
231
232         No new tests, updated existing test.
233
234         * bindings/js/JSLocationCustom.cpp:
235         (WebCore::JSLocation::putDelegate):
236         Refactor the [Put] delegate so that it does not log a security error
237         when setting 'href' attribute, given that setting it works as expected.
238         This fixes a bug in shipping Safari where setting 'href' would work but
239         log an error message anyway.
240
241         * bindings/scripts/CodeGeneratorJS.pm:
242         (GenerateImplementation):
243         Add support for [DoNotCheckSecurityOnSetter] IDL extended attribute,
244         in addition to the already supported [DoNotCheckSecurity] and
245         [DoNotCheckSecurityOnGetter].
246
247         * page/Location.idl:
248         Use [DoNotCheckSecurityOnSetter] on 'href' attribute as it can be
249         set cross-origin. This fixes the regression introduced in r204923.
250
251 2016-08-29  Chris Dumez  <cdumez@apple.com>
252
253         We should throw a SecurityError when denying setting a cross-origin Window property
254         https://bugs.webkit.org/show_bug.cgi?id=161339
255
256         Reviewed by Geoffrey Garen.
257
258         We should throw a SecurityError when denying setting a cross-origin Window property:
259         - https://html.spec.whatwg.org/#crossoriginset-(-o,-p,-v,-receiver-)
260         - https://html.spec.whatwg.org/#crossorigingetownpropertyhelper-(-o,-p-)
261
262         e.g. crossOriginWindow.name = "" should throw.
263
264         Firefox and Chrome already throw but WebKit merely ignores the call and logs an
265         error message.
266
267         No new tests, updated existing tests.
268
269         * bindings/js/JSDOMWindowCustom.cpp:
270         (WebCore::JSDOMWindow::put):
271
272 2016-08-29  Alex Christensen  <achristensen@webkit.org>
273
274         URLParser should parse about:blank
275         https://bugs.webkit.org/show_bug.cgi?id=161324
276
277         Reviewed by Brady Eidson.
278
279         Covered by new API tests.
280
281         * platform/URLParser.cpp:
282         (WebCore::URLParser::parse):
283
284 2016-08-29  Chris Dumez  <cdumez@apple.com>
285
286         document.createEvent("popstateevent") should create a PopStateEvent
287         https://bugs.webkit.org/show_bug.cgi?id=161321
288
289         Reviewed by Darin Adler.
290
291         document.createEvent("popstateevent") should create a PopStateEvent as per:
292         - https://dom.spec.whatwg.org/#dom-document-createevent
293
294         Firefox and Chrome match the specification but WebKit throws an exception,
295         which is risky compatibility-wise.
296
297         No new tests, rebaselined existing tests.
298
299         * dom/Document.cpp:
300         (WebCore::Document::createEvent):
301         * dom/PopStateEvent.cpp:
302         (WebCore::PopStateEvent::createForBindings):
303         * dom/PopStateEvent.h:
304
305 2016-08-29  Chris Dumez  <cdumez@apple.com>
306
307         We should throw a SecurityError when denying access to cross-origin Window properties
308         https://bugs.webkit.org/show_bug.cgi?id=161316
309
310         Reviewed by Darin Adler.
311
312         We should throw a SecurityError when denying access to cross-origin Window properties:
313         - https://html.spec.whatwg.org/#crossorigingetownpropertyhelper-(-o,-p-)
314         - https://html.spec.whatwg.org/#crossoriginproperties-(-o-)
315
316         Firefox and Chrome already throw.
317
318         No new tests, updated existing tests.
319
320         * bindings/js/JSDOMWindowCustom.cpp:
321         (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
322
323 2016-08-29  Youenn Fablet  <youenn@apple.com>
324
325         Image Loader should use FetchOptions::mode according its crossOrigin attribute
326         https://bugs.webkit.org/show_bug.cgi?id=161309
327
328         Reviewed by Darin Adler.
329
330         Test: http/tests/security/load-image-after-redirection.html
331
332         * loader/ImageLoader.cpp:
333         (WebCore::ImageLoader::updateFromElement): Using CachedResourceRequest::setAsPotentiallyCrossOrigin to set fetch mode.
334
335 2016-08-29  Frederic Wang  <fwang@igalia.com>
336
337         Use MathMLPresentationElement for all MathML presentation tags
338         https://bugs.webkit.org/show_bug.cgi?id=161297
339
340         Reviewed by Darin Adler.
341
342         Some tabular MathML elements as well as unsupported presentation MathML markup currently
343         create a generic MathMLElement instance. We make them instead use the
344         MathMLPresentationElement class since they are presentation MathML elements. This also
345         allows to make MathMLElement::isPresentationMathML always return false.
346
347         No new tests, already covered by existing tests.
348
349         * mathml/MathMLElement.cpp:
350         (WebCore::MathMLElement::isPresentationMathML): Deleted. Moved into the header file.
351         * mathml/MathMLElement.h:
352         (WebCore::MathMLElement::isPresentationMathML): Make this always return false now that all
353         presentation markup are handled by MathMLPresentationElement.
354         * mathml/MathMLPresentationElement.cpp:
355         (WebCore::MathMLPresentationElement::createElementRenderer): Make the fallback always call
356         MathMLElement::createElementRenderer. This preserves the behavior for the new elements
357         handled here and does not affect the old ones (table is handled above while all the others
358         are already handled in the derived class).
359         * mathml/mathtags.in: Use MathMLPresentationElement for all MathML presentation tags.
360
361 2016-08-29  Alex Christensen  <achristensen@webkit.org>
362
363         API test URLParserTest.ParserFailures failing ASSERT_NOT_REACHED
364         https://bugs.webkit.org/show_bug.cgi?id=161317
365
366         Reviewed by Brady Eidson.
367
368         Added an API test.
369
370         * platform/URLParser.cpp:
371         (WebCore::URLParser::parse):
372         Turns out, this state can be reached.
373
374 2016-08-29  Youenn Fablet  <youenn@apple.com>
375
376         [Fetch API] Response cloning should structureClone when teeing Response stream
377         https://bugs.webkit.org/show_bug.cgi?id=161147
378
379         Reviewed by Darin Adler.
380
381         Covered by updated test.
382
383         Implementing structure cloning for ArrayBuffer and ArrayBufferView objects.
384         Using this structure cloning in ReadableStream to support structureClone in the case of Fetch API.
385
386         * CMakeLists.txt: Adding StructureClone.cpp
387         * Modules/fetch/FetchResponse.js:
388         (clone): Setting structureClone to true
389         * Modules/streams/ReadableStreamInternals.js:
390         (doStructuredClone): Added to clone ArrayBuffer/ArrayBufferView chunks. Throwing exception otherwise.
391         (teeReadableStreamPullFunction): Using @doStructuredClone
392         * WebCore.xcodeproj/project.pbxproj: Adding StructureClone.cpp/.h
393         * bindings/js/JSDOMGlobalObject.cpp:
394         (WebCore::JSDOMGlobalObject::addBuiltinGlobals): Adding @ArrayBuffer and structuredCloneArrayBuffer and structuredCloneArrayBufferView private properties.
395         * bindings/js/StructuredClone.cpp: Added.
396         (WebCore::structuredCloneArrayBuffer): Cloning of ArrayBuffer as per
397         http://w3c.github.io/html/infrastructure.html#section-structuredclone step 11.
398        (WebCore::structuredCloneArrayBufferView): Cloning of ArrayBufferView as
399        perhttp://w3c.github.io/html/infrastructure.html#section-structuredclone, step 12.
400         * bindings/js/StructuredClone.h: Added.
401         * bindings/js/WebCoreBuiltinNames.h: 
402
403 2016-08-16  Carlos Garcia Campos  <cgarcia@igalia.com>
404
405         [GTK] Accelerated compositing does not work in Wayland
406         https://bugs.webkit.org/show_bug.cgi?id=115803
407
408         Reviewed by Michael Catanzaro.
409
410         The Wayland implementation in WebKit2 uses a nested display running in the UI process so that GL contexts created
411         in the web process need to be created in the nested display. We currently have a shared platform display that
412         should represent the connection to the actual display all applications connect to. This patch refactors the
413         GLContext API to ensure that GL contexts are always attached to a particular platform display. The create
414         methods receive an optional PlatformDisplay that will be used as the display of all GL operations of the created
415         GL context. The sharing GL context should also share the same display, it can't be global to the process, but to
416         the display, so it's now created on demand by the PlatformDisplay. In addition to the global shared display,
417         it's now possible to set a shared display for compositing that can be used when creating GL contexts. This makes
418         it possible to use a different display for compositing, connected to the nested display in wayland, even in non
419         wayland environments.
420         The patch also adds support for surfaceless EGL contexts that can be used for offscreen contexts. It also adds
421         support for offscreen wayland contexts, as a fallback in wayland in case surfaceless is not supported.
422         Some wayland code that is specific to the WebKit2 implementation has been moved to the WebKit2 layer.
423
424         * PlatformGTK.cmake:
425         * platform/graphics/GLContext.cpp:
426         (WebCore::initializeOpenGLShimsIfNeeded):
427         (WebCore::GLContext::createContextForWindow):
428         (WebCore::GLContext::createOffscreenContext):
429         (WebCore::GLContext::createSharingContext):
430         (WebCore::GLContext::GLContext):
431         (WebCore::GLContext::~GLContext):
432         (WebCore::GLContext::current):
433         (WebCore::activeContextList): Deleted.
434         * platform/graphics/GLContext.h:
435         (WebCore::GLContext::display):
436         * platform/graphics/GraphicsContext3DPrivate.cpp:
437         (WebCore::GraphicsContext3DPrivate::GraphicsContext3DPrivate):
438         (WebCore::GraphicsContext3DPrivate::platformContext):
439         (WebCore::GraphicsContext3DPrivate::paintToTextureMapper):
440         * platform/graphics/PlatformDisplay.cpp:
441         (WebCore::PlatformDisplay::createPlatformDisplay): Always use the default wayland display created by GTK+ for
442         the global shared display.
443         (WebCore::PlatformDisplay::sharedDisplayForCompositing):
444         (WebCore::PlatformDisplay::setSharedDisplayForCompositing):
445         (WebCore::PlatformDisplay::sharingGLContext):
446         (WebCore::eglDisplays): Helper HashSet to keep track of all PlatformDisplays with an EGL display intialized to
447         properly termimate them at exit.
448         (WebCore::PlatformDisplay::initializeEGLDisplay): Remove eglBindAPI() from display initialization, since it's
449         not a display initialization and it's thread specific, so it needs to be called on every thread where EGL is used.
450         (WebCore::PlatformDisplay::terminateEGLDisplay):
451         (WebCore::PlatformDisplay::eglDisplay): Deleted.
452         * platform/graphics/PlatformDisplay.h:
453         * platform/graphics/cairo/ImageBufferCairo.cpp:
454         (WebCore::ImageBufferData::~ImageBufferData):
455         (WebCore::ImageBufferData::createCompositorBuffer):
456         (WebCore::ImageBufferData::swapBuffersIfNeeded):
457         (WebCore::ImageBufferData::createCairoGLSurface):
458         (WebCore::ImageBufferData::paintToTextureMapper):
459         (WebCore::ImageBuffer::copyToPlatformTexture):
460         * platform/graphics/egl/GLContextEGL.cpp:
461         (WebCore::GLContextEGL::getEGLConfig):
462         (WebCore::GLContextEGL::createWindowContext):
463         (WebCore::GLContextEGL::createPbufferContext):
464         (WebCore::GLContextEGL::createSurfacelessContext):
465         (WebCore::GLContextEGL::createPixmapContext):
466         (WebCore::GLContextEGL::createWaylandContext):
467         (WebCore::GLContextEGL::createContext):
468         (WebCore::GLContextEGL::createSharingContext):
469         (WebCore::GLContextEGL::GLContextEGL):
470         (WebCore::GLContextEGL::~GLContextEGL):
471         (WebCore::GLContextEGL::defaultFrameBufferSize):
472         (WebCore::GLContextEGL::makeContextCurrent):
473         (WebCore::GLContextEGL::swapBuffers):
474         (WebCore::GLContextEGL::cairoDevice):
475         * platform/graphics/egl/GLContextEGL.h:
476         * platform/graphics/glx/GLContextGLX.cpp:
477         (WebCore::GLContextGLX::createWindowContext):
478         (WebCore::GLContextGLX::createPbufferContext):
479         (WebCore::GLContextGLX::createPixmapContext):
480         (WebCore::GLContextGLX::createContext):
481         (WebCore::GLContextGLX::createSharingContext):
482         (WebCore::GLContextGLX::GLContextGLX):
483         (WebCore::GLContextGLX::~GLContextGLX):
484         (WebCore::GLContextGLX::defaultFrameBufferSize):
485         (WebCore::GLContextGLX::makeContextCurrent):
486         (WebCore::GLContextGLX::swapBuffers):
487         (WebCore::GLContextGLX::cairoDevice):
488         (WebCore::GLContextGLX::waitNative): Deleted.
489         * platform/graphics/glx/GLContextGLX.h:
490         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
491         (WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext):
492         (WebCore::MediaPlayerPrivateGStreamerBase::nativeImageForCurrentTime):
493         * platform/graphics/wayland/PlatformDisplayWayland.cpp:
494         (WebCore::PlatformDisplayWayland::PlatformDisplayWayland):
495         (WebCore::PlatformDisplayWayland::~PlatformDisplayWayland):
496         (WebCore::PlatformDisplayWayland::initialize):
497         (WebCore::PlatformDisplayWayland::registryGlobal):
498         (WebCore::PlatformDisplayWayland::createSurface):
499         * platform/graphics/wayland/PlatformDisplayWayland.h:
500         (WebCore::PlatformDisplayWayland::native): Deleted.
501         * platform/graphics/wayland/WaylandEventSource.cpp: Removed.
502         * platform/graphics/wayland/WaylandSurface.cpp: Removed.
503         * platform/graphics/wayland/WebKitGtkWaylandClientProtocol.xml: Removed.
504         * platform/graphics/wayland/WlUniquePtr.h: Make it possible to use std::unique_ptr with Wayland objects.
505         (WebCore::WlPtrDeleter::operator()):
506
507 2016-08-29  Youenn Fablet  <youenn@apple.com>
508
509         [Fetch API] Add support for BufferSource bodies
510         https://bugs.webkit.org/show_bug.cgi?id=161087
511
512         Reviewed by Darin Adler.
513
514         Covered by updated tests.
515
516         Added support for ArrayBuffer, ArrayBufferView and FormData upload.
517         Added support for consuming ArrayBufferView.
518
519         To support FormData upload, FetchBOdy is now storing a FormData computed from the DOMFormData passed to the constructor.
520         This allows setting the content-type for FormData correctly with the boundary parameter.
521
522         * Modules/fetch/FetchBody.cpp:
523         (WebCore::FetchBody::bodyForInternalRequest): Adding support for FormData upload.
524         (WebCore::FetchBody::FetchBody): Adding ArrayBuffer and ArrayBufferView constructors.
525         (WebCore::FetchBody::extract): Extracting in case of BufferSource (i.e. ArrayBuffer or ArrayBufferView) and FormData.
526         (WebCore::FetchBody::consume): Adding support to consume ArrayBufferView.
527         (WebCore::FetchBody::consumeAsStream): Adding support to consume ArrayBufferView as a stream.
528         Cloned the ArrayBuffer before enqueuing it in  the stream.
529         (WebCore::FetchBody::consumeArrayBuffer): Cleaning m_data after being consumed.
530         (WebCore::FetchBody::consumeArrayBufferView): Adding support to consume ArrayBufferView.
531         (WebCore::FetchBody::consumeText): Cleaning m_text after being consumed.
532         (WebCore::FetchBody::consumeBlob): Ditto for m_blob.
533         (WebCore::FetchBody::bodyForInternalRequest): Adding support for ArrayBuffer and ArrayBufferView upload.
534         * Modules/fetch/FetchBody.h:
535         * Modules/fetch/FetchRequest.cpp:
536         (WebCore::FetchRequest::internalRequest): Passing ScriptExecutionContext as this is needed for FormData upload.
537         (WebCore::FetchRequest::setBody): Ditto.
538         * Modules/fetch/FetchResponse.cpp:
539         (WebCore::FetchResponse::initializeWith): Ditto.
540         (WebCore::FetchResponse::fetch): Removing FormData upload rejection check.
541
542 2016-08-26  Sergio Villar Senin  <svillar@igalia.com>
543
544         [css-grid] Do not recursively call layout during auto repeat computation
545         https://bugs.webkit.org/show_bug.cgi?id=161234
546
547         Reviewed by Manuel Rego Casasnovas.
548
549         The computation of auto repeat tracks was incorrectly recursively triggering
550         a layout in order to compute the available size. That was happening whenever
551         the width was indefinite. In such cases we should treat the width always as
552         indefinite without having to run any extra code. During the layout phase
553         we'll have the actual width available.
554
555         This fix also unveiled a few errors in one of the imported mozilla tests which were
556         incorrectly passing when they should not.
557
558         Test: fast/css-grid-layout/grid-indefinite-size-auto-repeat-crash.html
559
560         * rendering/RenderGrid.cpp:
561         (WebCore::RenderGrid::layoutBlock):
562         (WebCore::RenderGrid::computeIntrinsicLogicalWidths):
563         (WebCore::RenderGrid::computeAutoRepeatTracksCount):
564         (WebCore::RenderGrid::placeItemsOnGrid):
565         * rendering/RenderGrid.h:
566
567 2016-08-29  Youenn Fablet  <youenn@apple.com>
568
569         data:// URL behavior of XHR does not match spec
570         https://bugs.webkit.org/show_bug.cgi?id=109199
571
572         Reviewed by Darin Adler.
573
574         Covered by rebased tests.
575
576         Making data URLs same origin for XHR and fetch API.
577         This is the behavior when https://fetch.spec.whatwg.org/#same-origin-data-url-flag is set.
578         As per the specs, this flag is set for fetch API and XMLHttpRequest.
579         Introducing this flag in ThreadableLoader options, default value being false.
580         Setting flag for XHR and fetch API.
581
582         Fixing accuracy of data URL loading by setting status code and content-type HTTP header as per fetch specification.
583
584         As can be seen from the rebased tests, no constraint is put on the method used as the fetch specification is about to allow all methods for data URLs.
585
586         * Modules/fetch/FetchLoader.cpp:
587         (WebCore::FetchLoader::start): Setting same-origin-data-url-flag to true.
588         * loader/DocumentThreadableLoader.cpp:
589         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader): Making data URLs same origin if flag is set.
590         * loader/ResourceLoader.cpp:
591         (WebCore::ResourceLoader::loadDataURL): Setting status code and content-type header according specification.
592         * loader/ThreadableLoader.cpp:
593         (WebCore::ThreadableLoaderOptions::ThreadableLoaderOptions): Adding same-origin-data-url-flag option.
594         * loader/ThreadableLoader.h:
595         * loader/WorkerThreadableLoader.cpp:
596         (WebCore::LoaderTaskOptions::LoaderTaskOptions): Ensuring flag is preserved when going to the main thread.
597         * platform/network/DataURLDecoder.cpp:
598         (WebCore::DataURLDecoder::parseMediaType): Setting mediaType value, used by ResourceLoader to set the content-type header.
599         * platform/network/DataURLDecoder.h:
600         * xml/XMLHttpRequest.cpp:
601         (WebCore::XMLHttpRequest::createRequest): Setting same-origin-data-url-flag to true.
602
603 2016-08-25  Frederic Wang  <fwang@igalia.com>
604
605         Add support for non-BMP operators U+1EEF0 and U+1EEF1
606         https://bugs.webkit.org/show_bug.cgi?id=153984
607
608         Reviewed by Darin Adler.
609
610         Tests: mathml/presentation/non-bmp-operators-spacing.html
611                mathml/presentation/non-bmp-operators-stretching.html
612
613         * mathml/MathMLOperatorDictionary.cpp: We move the definition of operator dictionary Entry
614         here as it is not used by external code.
615         We now also accept non-BMP operators and add entries for U+1EEF0 and U+1EEF1.
616         (WebCore::extractProperty): Helper function to convert from Entry structure to a Property
617         structure.
618         (WebCore::MathMLOperatorDictionary::search): This function now accepts a non-BMP parameter
619         and returns a Property structure.
620         (WebCore::MathMLOperatorDictionary::isVertical): This function now accepts a non-BMP parameter.
621         * mathml/MathMLOperatorDictionary.h: Replace the Entry structure with a Property structure
622         which was used by MathMLOperatorElement. Update the signatures of search and isVertical.
623         * mathml/MathMLOperatorElement.cpp:
624         (WebCore::MathMLOperatorElement::parseOperatorChar): Remove the special case that excludes
625         non-BMP operators.
626         (WebCore::MathMLOperatorElement::computeDictionaryProperty): Rename the property structure
627         to use the one moved into MathMLOperatorDictionary.h. We no longer need to convert the result
628         of the search call.
629         (WebCore::MathMLOperatorElement::dictionaryProperty): Rename the property structure.
630         * mathml/MathMLOperatorElement.h: Make OperatorChar accept non-BMP operators.
631         MathMLOperatorElement::DictionaryProperty is now moved into MathMLOperatorDictionary
632         and renamed Property.
633         * rendering/mathml/MathOperator.cpp: Accept non-BMP operators.
634         * rendering/mathml/MathOperator.h: Ditto.
635         * rendering/mathml/RenderMathMLFencedOperator.cpp:
636         (WebCore::RenderMathMLFencedOperator::updateOperatorContent):  Adjust code to use the new
637         return type of MathMLOperatorDictionary::search.
638         * rendering/mathml/RenderMathMLFencedOperator.h: Accept non-BMP operators.
639         * rendering/mathml/RenderMathMLOperator.cpp: Ditto.
640         * rendering/mathml/RenderMathMLOperator.h: Ditto.
641
642 2016-08-28  Youenn Fablet  <youenn@apple.com>
643
644         [Fetch API] Ensure response cloning works when data is loading
645         https://bugs.webkit.org/show_bug.cgi?id=161137
646
647         Reviewed by Darin Adler.
648
649         Test: http/tests/fetch/clone-after-load-is-finished.html and updated wpt test
650
651         FetchBody is only able to clone data when requested by Response in case the data is already there.
652         If data is loaded from FetchLoader, each received chunk should be given to each cloned response.
653         The simplest approach is to create a ReadableStream body for the cloned Response and use it for the teeing.
654
655         * Modules/fetch/FetchResponse.cpp:
656         (WebCore::FetchResponse::BodyLoader::didSucceed): Postpone stream closing if there is still data to enqueue in the FetchBody.
657         * Modules/fetch/FetchResponse.h:
658         * Modules/fetch/FetchResponse.idl:
659         * Modules/fetch/FetchResponse.js:
660         (clone): If response is being loaded, create a ReadableStream body so that loaded data cloning is handled by ReadableStream tee.
661         * Modules/streams/ReadableStreamInternals.js: Restrict firstReadCallback to the case of a readable ReadableStream.
662         If stream is errored or closed, FetchResponse will already have disposed of its source.
663         (readFromReadableStreamDefaultReader):
664         * bindings/js/WebCoreBuiltinNames.h:
665
666 2016-08-28  Andreas Kling  <akling@apple.com>
667
668         document.title setter can't throw.
669         <https://webkit.org/b/161302>
670
671         Reviewed by Antti Koivisto.
672
673         Remove [SetterRaisesException] from document.title and replace
674         ExceptionCode propagation with ASSERT_NO_EXCEPTION.
675
676         Setting the .textContent of a SVGTitleElement or HTMLTitleElement
677         will never fail, so there's no exception to propagate.
678
679         * dom/Document.cpp:
680         (WebCore::Document::setTitle):
681         * dom/Document.h:
682         * dom/Document.idl:
683         * html/ImageDocument.cpp:
684         (WebCore::ImageDocument::finishedParsing):
685
686 2016-08-23  Frederic Wang  <fwang@igalia.com>
687
688         MathML renderers should use struct to pass long list of LayoutUnits
689         https://bugs.webkit.org/show_bug.cgi?id=161084
690
691         Reviewed by Darin Adler.
692
693         RenderMathMLFraction, RenderMathMLMenclose, RenderMathMLScripts and RenderMathMLUnderOver
694         have helper functions to retrieve a list of LayoutUnit parameters. We gather them in a single
695         struct instead of using a long list of LayoutUnit& parameters.
696
697         No new tests, behavior is unchanged.
698
699         * rendering/mathml/RenderMathMLFraction.cpp:
700         (WebCore::RenderMathMLFraction::getFractionParameters):
701         (WebCore::RenderMathMLFraction::getStackParameters):
702         (WebCore::RenderMathMLFraction::layoutBlock):
703         * rendering/mathml/RenderMathMLFraction.h:
704         * rendering/mathml/RenderMathMLMenclose.cpp:
705         (WebCore::RenderMathMLMenclose::getSpaceAroundContent):
706         (WebCore::RenderMathMLMenclose::computePreferredLogicalWidths):
707         (WebCore::RenderMathMLMenclose::layoutBlock):
708         * rendering/mathml/RenderMathMLMenclose.h:
709         * rendering/mathml/RenderMathMLScripts.cpp:
710         (WebCore::RenderMathMLScripts::getScriptMetricsAndLayoutIfNeeded):
711         (WebCore::RenderMathMLScripts::layoutBlock):
712         * rendering/mathml/RenderMathMLScripts.h:
713         * rendering/mathml/RenderMathMLUnderOver.cpp:
714         (WebCore::RenderMathMLUnderOver::getVerticalParameters):
715         (WebCore::RenderMathMLUnderOver::layoutBlock):
716         * rendering/mathml/RenderMathMLUnderOver.h:
717
718 2016-08-28  Andreas Kling  <akling@apple.com>
719
720         Clean up some .text attribute setters that don't throw.
721         <https://webkit.org/b/161292>
722
723         Reviewed by Darin Adler.
724
725         Remove [SetterRaisesException] for three .text attributes
726         and replace them with ASSERT_NO_EXCEPTION.
727
728         These setters behave like .textContent, which can't throw as
729         it's always okay to replace an Element's children with a Text.
730
731         * html/HTMLAnchorElement.cpp:
732         (WebCore::HTMLAnchorElement::setText):
733         * html/HTMLAnchorElement.h:
734         * html/HTMLAnchorElement.idl:
735         * html/HTMLOptionElement.cpp:
736         (WebCore::HTMLOptionElement::setText):
737         * html/HTMLOptionElement.h:
738         * html/HTMLOptionElement.idl:
739         * html/HTMLTitleElement.cpp:
740         (WebCore::HTMLTitleElement::setText):
741         * html/HTMLTitleElement.h:
742         * html/HTMLTitleElement.idl:
743
744 2016-08-24  Dave Hyatt  <hyatt@apple.com>
745
746         Initial landing of CSS Parser Tokenization (and files to support that). Not used yet.
747         https://bugs.webkit.org/show_bug.cgi?id=161174
748
749         This code is imported from Blink and is their CSS parser (modified to work in WebKit).
750         It is from commit e4bb90df7f2ed8a63975b5ed27a1b488cb9b146f, Mon Aug 22 2016.
751
752         Reviewed by Simon Fraser.
753
754         * CMakeLists.txt:
755         * WebCore.xcodeproj/project.pbxproj:
756         * css/CSSMarkup.cpp: Added.
757         (WebCore::isCSSTokenizerIdentifier):
758         (WebCore::serializeCharacter):
759         (WebCore::serializeCharacterAsCodePoint):
760         (WebCore::serializeIdentifier):
761         (WebCore::serializeString):
762         (WebCore::serializeURI):
763         (WebCore::serializeFontFamily):
764         * css/CSSMarkup.h: Added.
765         * css/CSSOMUtils.cpp: Removed.
766         * css/CSSOMUtils.h: Removed.
767         * css/CSSSelector.cpp:
768         * css/parser/CSSParserFastPaths.cpp: Added.
769         * css/parser/CSSParserFastPaths.h: Added.
770         * css/parser/CSSParserIdioms.h: Added.
771         (WebCore::isCSSSpace):
772         (WebCore::isNameStartCodePoint):
773         (WebCore::isNameCodePoint):
774         * css/parser/CSSParserObserver.h: Added.
775         (WebCore::CSSParserObserver::~CSSParserObserver):
776         * css/parser/CSSParserObserverWrapper.cpp: Added.
777         (WebCore::CSSParserObserverWrapper::startOffset):
778         (WebCore::CSSParserObserverWrapper::previousTokenStartOffset):
779         (WebCore::CSSParserObserverWrapper::endOffset):
780         (WebCore::CSSParserObserverWrapper::skipCommentsBefore):
781         (WebCore::CSSParserObserverWrapper::yieldCommentsBefore):
782         * css/parser/CSSParserObserverWrapper.h: Added.
783         (WebCore::CSSParserObserverWrapper::CSSParserObserverWrapper):
784         (WebCore::CSSParserObserverWrapper::observer):
785         (WebCore::CSSParserObserverWrapper::addComment):
786         (WebCore::CSSParserObserverWrapper::addToken):
787         (WebCore::CSSParserObserverWrapper::finalizeConstruction):
788         * css/parser/CSSParserToken.cpp: Added.
789         (WebCore::cssPrimitiveValueUnitFromTrie):
790         (WebCore::stringToUnitType):
791         (WebCore::CSSParserToken::CSSParserToken):
792         (WebCore::CSSParserToken::convertToDimensionWithUnit):
793         (WebCore::CSSParserToken::convertToPercentage):
794         (WebCore::CSSParserToken::delimiter):
795         (WebCore::CSSParserToken::numericSign):
796         (WebCore::CSSParserToken::numericValueType):
797         (WebCore::CSSParserToken::numericValue):
798         (WebCore::CSSParserToken::parseAsUnresolvedCSSPropertyID):
799         (WebCore::CSSParserToken::id):
800         (WebCore::CSSParserToken::functionId):
801         (WebCore::CSSParserToken::hasStringBacking):
802         (WebCore::CSSParserToken::copyWithUpdatedString):
803         (WebCore::CSSParserToken::valueDataCharRawEqual):
804         (WebCore::CSSParserToken::operator==):
805         (WebCore::CSSParserToken::serialize):
806         * css/parser/CSSParserToken.h: Added.
807         (WebCore::CSSParserToken::operator!=):
808         (WebCore::CSSParserToken::type):
809         (WebCore::CSSParserToken::value):
810         (WebCore::CSSParserToken::getHashTokenType):
811         (WebCore::CSSParserToken::getBlockType):
812         (WebCore::CSSParserToken::unitType):
813         (WebCore::CSSParserToken::unicodeRangeStart):
814         (WebCore::CSSParserToken::unicodeRangeEnd):
815         (WebCore::CSSParserToken::initValueFromStringView):
816         * css/parser/CSSParserTokenRange.cpp: Added.
817         (WebCore::CSSParserTokenRange::eofToken):
818         (WebCore::CSSParserTokenRange::makeSubRange):
819         (WebCore::CSSParserTokenRange::consumeBlock):
820         (WebCore::CSSParserTokenRange::consumeComponentValue):
821         (WebCore::CSSParserTokenRange::serialize):
822         * css/parser/CSSParserTokenRange.h: Added.
823         (WebCore::CSSParserTokenRange::CSSParserTokenRange):
824         (WebCore::CSSParserTokenRange::atEnd):
825         (WebCore::CSSParserTokenRange::end):
826         (WebCore::CSSParserTokenRange::peek):
827         (WebCore::CSSParserTokenRange::consume):
828         (WebCore::CSSParserTokenRange::consumeIncludingWhitespace):
829         (WebCore::CSSParserTokenRange::consumeWhitespace):
830         (WebCore::CSSParserTokenRange::begin):
831         * css/parser/CSSPropertyParser.cpp: Added.
832         (WebCore::hasPrefix):
833         (WebCore::cssPropertyID):
834         (WebCore::cssPropertyNameIOSAliasing):
835         (WebCore::isAppleLegacyCssValueKeyword):
836         (WebCore::cssValueKeywordID):
837         (WebCore::unresolvedCSSPropertyID):
838         * css/parser/CSSPropertyParser.h: Added.
839         (WebCore::CSSPropertyParser::inQuirksMode):
840         * css/parser/CSSPropertyParserHelpers.cpp: Added.
841         * css/parser/CSSPropertyParserHelpers.h: Added.
842         (WebCore::CSSPropertyParserHelpers::identMatches):
843         (WebCore::CSSPropertyParserHelpers::consumeIdent):
844         (WebCore::CSSPropertyParserHelpers::isCSSWideKeyword):
845         * css/parser/CSSTokenizer.cpp: Added.
846         (WebCore::CSSTokenizer::Scope::Scope):
847         (WebCore::CSSTokenizer::Scope::tokenRange):
848         (WebCore::CSSTokenizer::Scope::tokenCount):
849         (WebCore::isNewLine):
850         (WebCore::twoCharsAreValidEscape):
851         (WebCore::CSSTokenizer::CSSTokenizer):
852         (WebCore::CSSTokenizer::reconsume):
853         (WebCore::CSSTokenizer::consume):
854         (WebCore::CSSTokenizer::whiteSpace):
855         (WebCore::CSSTokenizer::blockStart):
856         (WebCore::CSSTokenizer::blockEnd):
857         (WebCore::CSSTokenizer::leftParenthesis):
858         (WebCore::CSSTokenizer::rightParenthesis):
859         (WebCore::CSSTokenizer::leftBracket):
860         (WebCore::CSSTokenizer::rightBracket):
861         (WebCore::CSSTokenizer::leftBrace):
862         (WebCore::CSSTokenizer::rightBrace):
863         (WebCore::CSSTokenizer::plusOrFullStop):
864         (WebCore::CSSTokenizer::asterisk):
865         (WebCore::CSSTokenizer::lessThan):
866         (WebCore::CSSTokenizer::comma):
867         (WebCore::CSSTokenizer::hyphenMinus):
868         (WebCore::CSSTokenizer::solidus):
869         (WebCore::CSSTokenizer::colon):
870         (WebCore::CSSTokenizer::semiColon):
871         (WebCore::CSSTokenizer::hash):
872         (WebCore::CSSTokenizer::circumflexAccent):
873         (WebCore::CSSTokenizer::dollarSign):
874         (WebCore::CSSTokenizer::verticalLine):
875         (WebCore::CSSTokenizer::tilde):
876         (WebCore::CSSTokenizer::commercialAt):
877         (WebCore::CSSTokenizer::reverseSolidus):
878         (WebCore::CSSTokenizer::asciiDigit):
879         (WebCore::CSSTokenizer::letterU):
880         (WebCore::CSSTokenizer::nameStart):
881         (WebCore::CSSTokenizer::stringStart):
882         (WebCore::CSSTokenizer::endOfFile):
883         (WebCore::CSSTokenizer::nextToken):
884         (WebCore::CSSTokenizer::consumeNumber):
885         (WebCore::CSSTokenizer::consumeNumericToken):
886         (WebCore::CSSTokenizer::consumeIdentLikeToken):
887         (WebCore::CSSTokenizer::consumeStringTokenUntil):
888         (WebCore::CSSTokenizer::consumeUnicodeRange):
889         (WebCore::isNonPrintableCodePoint):
890         (WebCore::CSSTokenizer::consumeUrlToken):
891         (WebCore::CSSTokenizer::consumeBadUrlRemnants):
892         (WebCore::CSSTokenizer::consumeSingleWhitespaceIfNext):
893         (WebCore::CSSTokenizer::consumeUntilCommentEndFound):
894         (WebCore::CSSTokenizer::consumeIfNext):
895         (WebCore::CSSTokenizer::consumeName):
896         (WebCore::CSSTokenizer::consumeEscape):
897         (WebCore::CSSTokenizer::nextTwoCharsAreValidEscape):
898         (WebCore::CSSTokenizer::nextCharsAreNumber):
899         (WebCore::CSSTokenizer::nextCharsAreIdentifier):
900         (WebCore::CSSTokenizer::registerString):
901         * css/parser/CSSTokenizer.h: Added.
902         (WebCore::CSSTokenizer::Scope::storeString):
903         * css/parser/CSSTokenizerInputStream.cpp: Added.
904         (WebCore::CSSTokenizerInputStream::CSSTokenizerInputStream):
905         (WebCore::CSSTokenizerInputStream::advanceUntilNonWhitespace):
906         (WebCore::CSSTokenizerInputStream::getDouble):
907         * css/parser/CSSTokenizerInputStream.h: Added.
908         (WebCore::CSSTokenizerInputStream::nextInputChar):
909         (WebCore::CSSTokenizerInputStream::peekWithoutReplacement):
910         (WebCore::CSSTokenizerInputStream::advance):
911         (WebCore::CSSTokenizerInputStream::pushBack):
912         (WebCore::CSSTokenizerInputStream::skipWhilePredicate):
913         (WebCore::CSSTokenizerInputStream::length):
914         (WebCore::CSSTokenizerInputStream::offset):
915         (WebCore::CSSTokenizerInputStream::rangeAt):
916         * platform/Length.h:
917
918 2016-08-28  Javier Fernandez  <jfernandez@igalia.com>
919
920         Should never be reached failure in WebCore::RenderFlexibleBox::alignChildren
921         https://bugs.webkit.org/show_bug.cgi?id=151591
922         <rdar://problem/27711829>
923
924         Reviewed by Darin Adler.
925
926         The align-self and align-items CSS properties were originally defined in the
927         Flexbible Box specification. The new CSS Box Alignment specification tries
928         to generalize them so they can be used by other layout models, as it's  the
929         case of the GridLayout spec.
930
931         Since we have implemented the Grid Layout spec behind a runtime flag, we should
932         do the same with the new syntax of these properties.
933
934         Test: css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled.html
935
936         * css/CSSParser.cpp:
937         (WebCore::isValidKeywordPropertyAndValue):
938         (WebCore::isKeywordPropertyID):
939         (WebCore::CSSParser::parseValue):
940         * rendering/RenderFlexibleBox.cpp:
941         (WebCore::RenderFlexibleBox::alignChildren):
942
943 2016-08-28  Frederic Wang  <fwang@igalia.com>
944
945         Improve parsing of the menclose notation attribute value
946         https://bugs.webkit.org/show_bug.cgi?id=161045
947
948         Reviewed by Darin Adler.
949
950         We improve the way the list of menclose notations is parsed to avoid allocating a vector and
951         accept any whitespace as separators.
952
953         New test cases in mathml/presentation/menclose-notation-equivalence.html
954
955         * mathml/MathMLMencloseElement.cpp: Include HTMLParserIdioms.h to use isHTMLSpace.
956         (WebCore::MathMLMencloseElement::addNotationFlags): Helper function to perform the relevant
957         addNotation calls from a notation name.
958         (WebCore::MathMLMencloseElement::parseNotationAttribute): Use only simple string operations
959         to determine the list of notations.
960         * mathml/MathMLMencloseElement.h: Declare the new helper function.
961
962 2016-08-28  Frederic Wang  <fwang@igalia.com>
963
964         Make MathMLSpaceElement and MathMLTokenElement inherit from MathMLPresentationElement
965         https://bugs.webkit.org/show_bug.cgi?id=161232
966
967         Reviewed by Darin Adler.
968
969         The mrow-like features of MathMLPresentationElement are now moved into RenderMathMLRow.
970         Hence we make MathMLSpaceElement and MathMLTokenElement inherit from the generic class
971         MathMLPresentationElement for presentation MathML elements.
972
973         No new tests, already covered by existing tests.
974
975         * mathml/MathMLSpaceElement.cpp:
976         (WebCore::MathMLSpaceElement::MathMLSpaceElement): Derive from MathMLPresentationElement.
977         (WebCore::MathMLSpaceElement::parseAttribute): Ditto.
978         * mathml/MathMLSpaceElement.h: Ditto. Override acceptsDisplayStyleAttribute as a small
979         optimization. isPresentationMathML is no longer needed.
980         * mathml/MathMLTokenElement.cpp:
981         (WebCore::MathMLTokenElement::MathMLTokenElement): Derive from MathMLPresentationElement.
982         (WebCore::MathMLTokenElement::didAttachRenderers): Ditto.
983         (WebCore::MathMLTokenElement::childrenChanged): Ditto.
984         (WebCore::MathMLTokenElement::parseAttribute): Deleted. No need to override this function
985         any more since it's already implemented in MathMLPresentationElement.
986         * mathml/MathMLTokenElement.h: Derive from MathMLPresentationElement. Override
987         acceptsDisplayStyleAttribute as a small optimization. isPresentationMathML is no longer
988         needed.
989
990 2016-08-28  Frederic Wang  <fwang@igalia.com>
991
992         RenderMathMLRow::firstLineBaseline does not need to be overridden in RenderMathMLMenclose
993         https://bugs.webkit.org/show_bug.cgi?id=161127
994
995         Reviewed by Darin Adler.
996
997         RenderMathMLRow::firstLineBaseline already provides the correct calculation of ascent for
998         non-empty menclose elements. Empty menclose elements are not used in practice so the
999         calculated value is irrelevant. Aligning on mrow (i.e. leaving firstLineBaseline to 0)
1000         is fine. This change allows to get rid of the m_ascent member and helps to keep good baseline
1001         alignment when the zoom level changes (bug 161126).
1002
1003         No new tests, already covered by existing tests.
1004
1005         * rendering/mathml/RenderMathMLMenclose.cpp:
1006         (WebCore::RenderMathMLMenclose::RenderMathMLMenclose): Remove initialization of m_ascent.
1007         (WebCore::RenderMathMLMenclose::layoutBlock): No need to calculate m_ascent. The height and
1008         content location can be determined without introducing local variables ascent or descent.
1009         (WebCore::RenderMathMLMenclose::firstLineBaseline): Deleted. We just use the implementation
1010         from RenderMathMLRow.
1011         * rendering/mathml/RenderMathMLMenclose.h: Delete m_ascent and do not override
1012         firstLineBaseline.
1013
1014 2016-08-28  Frederic Wang  <fwang@igalia.com>
1015
1016         More cleanup for the mpadded implementation
1017         https://bugs.webkit.org/show_bug.cgi?id=161136
1018
1019         Reviewed by Darin Adler.
1020
1021         We perform the following cleanup for the mpadded renderer class:
1022         1) We do not store the ascent on the class. This may make update more reliable and will
1023         help for general improvement of MathML ascents (bug 155879).
1024         2) We split resolveWidth/resolveAttributes into smaller functions and improve the coding
1025         style. This helps to calculate firstLineBaseline in 1).
1026         3) We do not override updateFromElement and styleDidChange to perform setNeedsLayout calls.
1027         These calls already seem unnecessary and can be removed even more safely after 1).
1028
1029         We add a test for style change. Change of attributes as well as metrics calcuation of empty
1030         and non-empty mpadded elements are already covered by other tests.
1031
1032         Test: mathml/presentation/mpadded-style-change.html
1033
1034         * rendering/mathml/RenderMathMLPadded.cpp:
1035         (WebCore::RenderMathMLPadded::voffset): New helper function to resolve voffset.
1036         (WebCore::RenderMathMLPadded::lspace): Ditto for lspace.
1037         (WebCore::RenderMathMLPadded::mpaddedWidth): Ditto for width.
1038         (WebCore::RenderMathMLPadded::mpaddedHeight): Ditto for height.
1039         (WebCore::RenderMathMLPadded::mpaddedDepth): Ditto for detph.
1040         (WebCore::RenderMathMLPadded::computePreferredLogicalWidths): Use mpaddedWidth().
1041         (WebCore::RenderMathMLPadded::layoutBlock): Use the new helper functions.
1042         (WebCore::RenderMathMLPadded::firstLineBaseline): Use voffset or mpaddedHeight for baseline
1043         calculation instead of m_padded.
1044         (WebCore::RenderMathMLPadded::resolveWidth): Deleted. Renamed mpaddedWidth.
1045         (WebCore::RenderMathMLPadded::resolveAttributes): Deleted. Split into smaller functions.
1046         (WebCore::RenderMathMLPadded::updateFromElement): Deleted. We do not need to call
1047         setNeedsLayout.
1048         (WebCore::RenderMathMLPadded::styleDidChange): Deleted. Ditto.
1049         * rendering/mathml/RenderMathMLPadded.h: Update function declaration and remove m_ascent.
1050
1051 2016-08-27  Alex Christensen  <achristensen@webkit.org>
1052
1053         URLParser should parse relative URLs
1054         https://bugs.webkit.org/show_bug.cgi?id=161282
1055
1056         Reviewed by Darin Adler.
1057
1058         Partially covered by new API tests, but once the parser is complete enough we can
1059         use the url web platform tests to more fully test this.  It's still a work in
1060         progress only used by tests.
1061
1062         * platform/URLParser.cpp:
1063         (WebCore::URLParser::urlLengthUntilPart):
1064         (WebCore::URLParser::copyURLPartsUntil):
1065         Added some helper functions to reduce redundant code.  When parsing relative URLs,
1066         we often want to copy large parts of the base URL, but the stopping point differs.
1067         (WebCore::URLParser::parse):
1068         The parser now returns a URL instead of an Optional<URL> because a URL has a m_isValid which behaves like Optional.
1069         * platform/URLParser.h:
1070         (WebCore::URLParser::parse):
1071
1072 2016-08-27  Chris Dumez  <cdumez@apple.com>
1073
1074         Update generated bindings to throw a SecurityError when denying cross-origin access to properties
1075         https://bugs.webkit.org/show_bug.cgi?id=161270
1076
1077         Reviewed by Darin Adler.
1078
1079         Update generated bindings to throw a SecurityError when denying cross-origin
1080         access to properties, as per the HTML specification:
1081         - https://html.spec.whatwg.org/#crossorigingetownpropertyhelper-(-o,-p-)
1082         - https://html.spec.whatwg.org/#crossoriginproperties-(-o-)
1083
1084         Firefox and Chrome already throw but Webkit was logging an error message and
1085         returning undefined instead.
1086
1087         No new tests, updated existing tests.
1088
1089         * bindings/js/JSDOMBinding.cpp:
1090         (WebCore::canAccessDocument):
1091         (WebCore::BindingSecurity::shouldAllowAccessToNode):
1092         * bindings/js/JSDOMBinding.h:
1093         * bindings/scripts/CodeGeneratorJS.pm:
1094         (GenerateImplementation):
1095
1096 2016-08-27  Chris Dumez  <cdumez@apple.com>
1097
1098         Follow-up fixes after r205030.
1099         https://bugs.webkit.org/show_bug.cgi?id=161216
1100
1101         Reviewed by Darin Adler.
1102
1103         * html/parser/HTMLParserIdioms.cpp:
1104         (WebCore::isHTMLSpaceOrDelimiter):
1105         (WebCore::isNumberStart):
1106         (WebCore::parseHTMLListOfOfFloatingPointNumberValues):
1107         * html/parser/HTMLParserIdioms.h:
1108
1109 2016-08-27  Rawinder Singh  <rawinder.singh-webkit@cisra.canon.com.au>
1110
1111         Add final keyword to final classes and overriden methods in WebCore/css
1112         https://bugs.webkit.org/show_bug.cgi?id=161182
1113
1114         Reviewed by Darin Adler.
1115
1116         - Mark classes in the WebCore/css directory final as appropriate.
1117         - Update WebCore/css classes so that overriden methods in final classes are marked final.
1118
1119         * css/CSSAnimationTriggerScrollValue.h:
1120         * css/CSSAspectRatioValue.h:
1121         * css/CSSBasicShapes.h:
1122         * css/CSSBorderImageSliceValue.h:
1123         * css/CSSCalculationValue.cpp:
1124         (WebCore::determineCategory):
1125         * css/CSSCalculationValue.h:
1126         * css/CSSCanvasValue.h:
1127         * css/CSSCharsetRule.h:
1128         * css/CSSComputedStyleDeclaration.h:
1129         * css/CSSContentDistributionValue.h:
1130         * css/CSSCrossfadeValue.h:
1131         * css/CSSCursorImageValue.h:
1132         * css/CSSCustomPropertyValue.h:
1133         * css/CSSFilterImageValue.h:
1134         * css/CSSFontFaceLoadEvent.h:
1135         * css/CSSFontFaceSrcValue.h:
1136         * css/CSSFontFeatureValue.h:
1137         * css/CSSFontSelector.h:
1138         * css/CSSFontValue.h:
1139         * css/CSSFunctionValue.h:
1140         * css/CSSGradientValue.h:
1141         * css/CSSGridAutoRepeatValue.h:
1142         * css/CSSGridLineNamesValue.h:
1143         * css/CSSGridTemplateAreasValue.h:
1144         * css/CSSImageSetValue.h:
1145         * css/CSSImageValue.h:
1146         * css/CSSInheritedValue.h:
1147         * css/CSSInitialValue.h:
1148         * css/CSSKeyframeRule.h:
1149         * css/CSSKeyframesRule.h:
1150         * css/CSSLineBoxContainValue.h:
1151         * css/CSSNamedImageValue.h:
1152         * css/CSSPrimitiveValue.h:
1153         * css/CSSReflectValue.h:
1154         * css/CSSRevertValue.h:
1155         * css/CSSRuleList.h:
1156         * css/CSSSegmentedFontFace.h:
1157         * css/CSSShadowValue.h:
1158         * css/CSSStyleSheet.cpp:
1159         * css/CSSStyleSheet.h:
1160         * css/CSSSupportsRule.h:
1161         * css/CSSTimingFunctionValue.h:
1162         * css/CSSUnicodeRangeValue.h:
1163         * css/CSSUnknownRule.h:
1164         * css/CSSUnsetValue.h:
1165         * css/CSSValue.cpp:
1166         * css/CSSVariableDependentValue.h:
1167         * css/CSSVariableValue.h:
1168         * css/Counter.h:
1169         * css/DOMCSSNamespace.h:
1170         * css/DashboardRegion.h:
1171         * css/LengthRepeat.h:
1172         * css/MediaList.h:
1173         * css/MediaQueryList.h:
1174         * css/MediaQueryMatcher.h:
1175         * css/Pair.h:
1176         * css/PropertySetCSSStyleDeclaration.h:
1177         * css/RGBColor.h:
1178         * css/Rect.h:
1179         * css/StyleMedia.h:
1180         * css/StyleProperties.h:
1181         * css/StyleRule.h:
1182         * css/StyleRuleImport.h:
1183         * css/StyleSheetContents.h:
1184         * css/StyleSheetList.h:
1185         * css/ViewportStyleResolver.h:
1186         * css/WebKitCSSFilterValue.h:
1187         * css/WebKitCSSRegionRule.h:
1188         * css/WebKitCSSTransformValue.h:
1189         * css/WebKitCSSViewportRule.h:
1190
1191 2016-08-27  Simon Fraser  <simon.fraser@apple.com>
1192
1193         Add more Editing logging
1194         https://bugs.webkit.org/show_bug.cgi?id=161287
1195
1196         Reviewed by Darin Adler.
1197
1198         Add logging which tracks how key events get from the UI process to the
1199         web process, and down to form fields.
1200
1201         * editing/Editor.cpp:
1202         (WebCore::Editor::handleTextEvent):
1203         (WebCore::Editor::appliedEditing):
1204         * editing/TypingCommand.cpp:
1205         (WebCore::TypingCommand::insertText):
1206         (WebCore::TypingCommand::insertTextAndNotifyAccessibility):
1207         * html/HTMLTextFormControlElement.cpp:
1208         (WebCore::HTMLTextFormControlElement::didEditInnerTextValue):
1209         * page/EventHandler.cpp:
1210         (WebCore::EventHandler::keyEvent):
1211         (WebCore::EventHandler::handleTextInputEvent):
1212
1213 2016-08-27  Sam Weinig  <sam@webkit.org>
1214
1215         Remove more custom JavaScript bindings
1216         https://bugs.webkit.org/show_bug.cgi?id=161293
1217
1218         Reviewed by Darin Adler.
1219
1220         Remove custom bindings for AudioContext, DOMFormData, MediaSession and WebKitPoint.
1221
1222         * Modules/mediasession/MediaSession.cpp:
1223         (WebCore::MediaSession::MediaSession):
1224         * Modules/mediasession/MediaSession.h:
1225         Change to take Document explicitly, since that is what it 
1226         expecting.
1227
1228         * Modules/webaudio/AudioContext.cpp:
1229         (WebCore::AudioContext::create):
1230         * Modules/webaudio/AudioContext.h:
1231         Remove unused ExceptionCode parameter.
1232
1233         * Modules/webaudio/AudioContext.idl:
1234         * html/DOMFormData.idl:
1235         * html/HTMLFormElement.idl:
1236         * page/WebKitPoint.idl:
1237         Switch to use the generated constructor.
1238
1239         * CMakeLists.txt:
1240         * WebCore.xcodeproj/project.pbxproj:
1241         * bindings/js/JSBindingsAllInOne.cpp:
1242         Remove files.
1243         
1244         * bindings/js/JSAudioContextCustom.cpp: Removed.
1245         * bindings/js/JSDOMFormDataCustom.cpp: Removed.
1246         * bindings/js/JSMediaSessionCustom.cpp: Removed.
1247         * bindings/js/JSWebKitPointCustom.cpp: Removed.
1248         Remove in favor of generated variants.
1249
1250         * bindings/js/JSHTMLInputElementCustom.h: Removed.
1251         Remove unused header.
1252
1253         * page/WebKitPoint.h:
1254         (WebCore::WebKitPoint::create):
1255         (WebCore::WebKitPoint::WebKitPoint):
1256         Move NaN replacement into the implementation and out of the bindings.
1257
1258 2016-08-27  Ryosuke Niwa  <rniwa@webkit.org>
1259
1260         Add adopted callback for custom elements
1261         https://bugs.webkit.org/show_bug.cgi?id=161284
1262
1263         Reviewed by Antti Koivisto.
1264
1265         Added the support for adoptedCallback: https://dom.spec.whatwg.org/#concept-node-adopt
1266         For now, we only support this callback on appendChild.
1267
1268         Test: fast/custom-elements/adopted-callback.html
1269
1270         * bindings/js/JSCustomElementInterface.cpp:
1271         (WebCore::JSCustomElementInterface::invokeCallback): Added JSDOMGlobalObject* as an argument to the callback so that
1272         we can invoke toJS on Document in invokeAdoptedCallback.
1273         (WebCore::JSCustomElementInterface::setAdoptedCallback): Added.
1274         (WebCore::JSCustomElementInterface::invokeAdoptedCallback): Added.
1275         (WebCore::JSCustomElementInterface::setAttributeChangedCallback):
1276         * bindings/js/JSCustomElementInterface.h:
1277         (WebCore::JSCustomElementInterface::hasConnectedCallback): Added.
1278         (WebCore::JSCustomElementInterface::hasDisconnectedCallback): Added.
1279         (WebCore::JSCustomElementInterface::hasAdoptedCallback): Added.
1280         * bindings/js/JSCustomElementRegistryCustom.cpp:
1281         (WebCore::JSCustomElementRegistry::define):
1282         * dom/CustomElementReactionQueue.cpp:
1283         (WebCore::CustomElementReactionQueueItem::CustomElementReactionQueueItem): Added a variant that takes two documents.
1284         (WebCore::CustomElementReactionQueueItem::invoke):
1285         (WebCore::CustomElementReactionQueue::enqueueConnectedCallbackIfNeeded): Fixed a bug that this function was always
1286         enqueuing a callback even when the interface didn't have connectedCallback. Also, there is no need to check
1287         the nullity of the interface since it should never be null.
1288         (WebCore::CustomElementReactionQueue::enqueueDisconnectedCallbackIfNeeded): Ditto.
1289         (WebCore::CustomElementReactionQueue::enqueueAdoptedCallbackIfNeeded): Added.
1290         (WebCore::CustomElementReactionQueue::enqueueAttributeChangedCallbackIfNeeded): Assert that the interface is never
1291         null instead of exiting early.
1292         * dom/CustomElementReactionQueue.h:
1293         * dom/Element.cpp:
1294         (WebCore::Element::didMoveToNewDocument): Added a call to enqueueAdoptedCallbackIfNeeded.
1295
1296 2016-08-27  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>
1297
1298         Fix the !PLATFORM(WIN) && USE(CURL) build.
1299         https://bugs.webkit.org/show_bug.cgi?id=161281
1300
1301         Reviewed by Alex Christensen.
1302
1303         * platform/network/curl/ResourceHandleCurl.cpp:
1304
1305 2016-08-27  Youenn Fablet  <youenn@apple.com>
1306
1307         [Fetch API] Opaque responses should not have any body
1308         https://bugs.webkit.org/show_bug.cgi?id=161130
1309
1310         Reviewed by Sam Weinig.
1311
1312         Covered by updated test.
1313
1314         Added a new ThreadableLoader option to receive or not opaque response body.
1315         By default, option is set to Receive.
1316         FetchLoader is setting it to DoNotReceive.
1317
1318         * Modules/fetch/FetchLoader.cpp:
1319         (WebCore::FetchLoader::start):
1320         * loader/DocumentThreadableLoader.cpp:
1321         (WebCore::DocumentThreadableLoader::didReceiveResponse): Calling didFinishLoading just after didReceiveResponse in case of Opaque responses.
1322         * loader/ThreadableLoader.cpp:
1323         (WebCore::ThreadableLoaderOptions::ThreadableLoaderOptions):
1324         * loader/ThreadableLoader.h:
1325         * loader/WorkerThreadableLoader.cpp:
1326         (WebCore::LoaderTaskOptions::LoaderTaskOptions):
1327
1328 2016-08-27  Youenn Fablet  <youenn@apple.com>
1329
1330         [Fetch API] opaqueredirect responses should have their URL set to the original URL
1331         https://bugs.webkit.org/show_bug.cgi?id=161194
1332
1333         Reviewed by Sam Weinig.
1334
1335         Covered by updated tests.
1336
1337         * loader/DocumentThreadableLoader.cpp:
1338         (WebCore::DocumentThreadableLoader::didReceiveResponse):
1339         * loader/SubresourceLoader.cpp: Removing isNull ASSERT since we now set the response URL.
1340         (WebCore::SubresourceLoader::willSendRequestInternal): Setting opaqueredirect response URL to the original URL.
1341
1342 2016-08-27  Andreas Kling  <akling@apple.com>
1343
1344         script.text should behave like script.textContent on setting
1345         <https://webkit.org/b/148852>
1346
1347         Reviewed by Chris Dumez.
1348
1349         HTMLScriptElement.text should behave just like .textContent when setting,
1350         so just forward setText() to setTextContent().
1351
1352         Test: import/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/script-text.html
1353
1354         * html/HTMLScriptElement.cpp:
1355         (WebCore::HTMLScriptElement::setText):
1356
1357 2016-08-27  Youenn Fablet  <youenn@apple.com>
1358
1359         [Fetch API] Blob type should be set from Response/Request contentType header
1360         https://bugs.webkit.org/show_bug.cgi?id=161228
1361
1362         Reviewed by Alex Christensen.
1363
1364         Covered by updated tests.
1365
1366         Renaming FetchBody::m_mimeType to m_contentType since that better relates to Content-Type header.
1367         Updated FetchRequest and FetchResponse to set m_contentType according request/response headers.
1368         Handled the case of a Request created from JS, a Response created from JS and a Response created internally to
1369         be used as resolve value in the fetch promise.
1370
1371         In case Content-Type is set but is empty, its empty value should be used for blob type.
1372         Updated contentType checks to use isNull in lieu of isEmpty.
1373
1374         * Modules/fetch/FetchBody.cpp:
1375         (WebCore::FetchBody::updateContentType): Routine to synchronize headers with m_contentType.
1376         (WebCore::FetchBody::FetchBody): Renamed m_mimeType to m_contentType.
1377         (WebCore::FetchBody::blob): Ditto.
1378         * Modules/fetch/FetchBody.h: Ditto.
1379         (WebCore::FetchBody::contentType):
1380         (WebCore::FetchBody::setMimeType): Deleted.
1381         (WebCore::FetchBody::mimeType): Deleted.
1382         * Modules/fetch/FetchRequest.cpp:
1383         (WebCore::FetchRequest::setBody): set FetchBody::m_contentType according HTTP headers.
1384         * Modules/fetch/FetchResponse.cpp:
1385         (WebCore::FetchResponse::initializeWith): Ditto.
1386         (WebCore::FetchResponse::BodyLoader::didReceiveResponse): Ditto.
1387
1388 2016-08-26  Alex Christensen  <achristensen@webkit.org>
1389
1390         Fix Windows build after r205065.
1391
1392         * Modules/webaudio/BiquadFilterNode.idl:
1393         * Modules/webaudio/PannerNode.idl:
1394         There's no WEB_AUDIO on Windows.
1395
1396 2016-08-26  Devin Rousso  <dcrousso+webkit@gmail.com>
1397
1398         REGRESSION (r203535): Web Inspector: Inspector overlay node info has disappeared
1399         https://bugs.webkit.org/show_bug.cgi?id=161264
1400
1401         Reviewed by Joseph Pecoraro.
1402
1403         No new tests.  Fixing JavaScript error in Inspector overlay.
1404
1405         * inspector/InspectorOverlay.cpp:
1406         (evaluateCommandInOverlay):
1407         (WebCore::InspectorOverlay::evaluateInOverlay):
1408         Add ASSERT to ensure that errors in the Inspector overlay will cause tests to crash.
1409
1410         * inspector/InspectorOverlayPage.js:
1411         (DOMBuilder.prototype.appendTextNode):
1412         Move textContent value to parameter of document.createTextNode.
1413
1414 2016-08-26  Sam Weinig  <sam@webkit.org>
1415
1416         Remove support for ENABLE_LEGACY_WEB_AUDIO
1417         https://bugs.webkit.org/show_bug.cgi?id=161262
1418
1419         Reviewed by Anders Carlsson.
1420
1421         * Configurations/FeatureDefines.xcconfig:
1422         Remove ENABLE_LEGACY_WEB_AUDIO.
1423
1424         * Modules/webaudio/AudioBufferSourceNode.cpp:
1425         (WebCore::AudioBufferSourceNode::noteGrainOn): Deleted.
1426         * Modules/webaudio/AudioBufferSourceNode.h:
1427         * Modules/webaudio/AudioBufferSourceNode.idl:
1428         (WebCore::AudioScheduledSourceNode::noteOn): Deleted.
1429         (WebCore::AudioScheduledSourceNode::noteOff): Deleted.
1430         * Modules/webaudio/AudioScheduledSourceNode.h:
1431         * Modules/webaudio/AudioScheduledSourceNode.cpp:
1432         Remove the looping attribute, as well as the noteOn, noteOff, and noteGrainOn functions.
1433
1434         * Modules/webaudio/AudioContext.idl:
1435         Remove the createGainNode, createDelayNode and createJavaScriptNode functions.
1436
1437         * Modules/webaudio/AudioParam.idl:
1438         Remove the setTargetValueAtTime function.
1439
1440         * Modules/webaudio/BiquadDSPKernel.cpp:
1441         (WebCore::BiquadDSPKernel::updateCoefficientsIfNecessary):
1442         * Modules/webaudio/BiquadFilterNode.cpp:
1443         (WebCore::BiquadFilterNode::type):
1444         (WebCore::BiquadFilterNode::setType):
1445         (WebCore::BiquadFilterNode::getFrequencyResponse):
1446         * Modules/webaudio/BiquadFilterNode.h:
1447         * Modules/webaudio/BiquadFilterNode.idl:
1448         * Modules/webaudio/BiquadProcessor.cpp:
1449         (WebCore::BiquadProcessor::BiquadProcessor):
1450         (WebCore::BiquadProcessor::setType):
1451         (WebCore::BiquadProcessor::getFrequencyResponse):
1452         * Modules/webaudio/BiquadProcessor.h:
1453         (WebCore::BiquadProcessor::type):
1454         * bindings/js/JSBiquadFilterNodeCustom.cpp: Removed.
1455         Rename BiquadProcessor::FilterType to BiquadFilterType and use it
1456         directly from the IDL. Remove legacy filter constants from the IDL
1457         and the need for a custom binding for the type attribute.
1458
1459         * Modules/webaudio/OscillatorNode.cpp:
1460         (WebCore::OscillatorNode::OscillatorNode):
1461         (WebCore::OscillatorNode::setType):
1462         (WebCore::OscillatorNode::setPeriodicWave):
1463         (WebCore::OscillatorNode::type): Deleted.
1464         * Modules/webaudio/OscillatorNode.h:
1465         (WebCore::OscillatorNode::type):
1466         * Modules/webaudio/OscillatorNode.idl:
1467         * Modules/webaudio/PeriodicWave.cpp:
1468         (WebCore::PeriodicWave::createSine):
1469         (WebCore::PeriodicWave::createSquare):
1470         (WebCore::PeriodicWave::createSawtooth):
1471         (WebCore::PeriodicWave::createTriangle):
1472         (WebCore::PeriodicWave::generateBasicWaveform):
1473         * Modules/webaudio/PeriodicWave.h:
1474         * bindings/js/JSOscillatorNodeCustom.cpp: Removed.
1475         Remove noteOn and noteOff functions and the type integer constants.
1476         Remove the need for a custom binding for the type attribute by renaming
1477         the type enum OscillatorNode::Type and putting the enum in the IDL.
1478
1479         * Modules/webaudio/PannerNode.cpp:
1480         (WebCore::PannerNode::PannerNode):
1481         (WebCore::PannerNode::process):
1482         (WebCore::PannerNode::setPanningModel):
1483         (WebCore::PannerNode::distanceModel):
1484         (WebCore::PannerNode::setDistanceModel):
1485         (WebCore::PannerNode::panningModel): Deleted.
1486         * Modules/webaudio/PannerNode.h:
1487         (WebCore::PannerNode::panningModel):
1488         * Modules/webaudio/PannerNode.idl:
1489         * bindings/js/JSPannerNodeCustom.cpp: Removed.
1490         * platform/audio/Distance.cpp:
1491         (WebCore::DistanceEffect::DistanceEffect):
1492         (WebCore::DistanceEffect::gain):
1493         * platform/audio/Distance.h:
1494         (WebCore::DistanceEffect::model):
1495         (WebCore::DistanceEffect::setModel):
1496         * platform/audio/EqualPowerPanner.cpp:
1497         (WebCore::EqualPowerPanner::EqualPowerPanner):
1498         * platform/audio/HRTFPanner.cpp:
1499         (WebCore::HRTFPanner::HRTFPanner):
1500         * platform/audio/Panner.cpp:
1501         (WebCore::Panner::create):
1502         * platform/audio/Panner.h:
1503         (WebCore::Panner::panningModel):
1504         (WebCore::Panner::Panner):
1505         Replace the panning model and distance model integer constants
1506         with IDL enum support, removing the need for a custom binding.
1507         Rename the supporting C++ enums to work with the bindings.
1508
1509         * bindings/js/JSAudioContextCustom.cpp:
1510         (WebCore::constructJSAudioContext):
1511         Remove deprecated way of creating an offline context.
1512
1513         * WebCore.xcodeproj/project.pbxproj:
1514         Update files.
1515
1516 2016-08-26  Johan K. Jensen  <johan_jensen@apple.com>
1517
1518         Web Inspector: Frontend should have access to Resource Timing information
1519         https://bugs.webkit.org/show_bug.cgi?id=160095
1520
1521         Reviewed by Alex Christensen.
1522
1523         Show correct information with Resource Timing information
1524         from ResourceLoader rather than DocumentLoader.
1525
1526         No new tests, frontend doesn't use the timing data yet.
1527
1528         * inspector/InspectorNetworkAgent.cpp:
1529         (WebCore::InspectorNetworkAgent::buildObjectForTiming):
1530         (WebCore::InspectorNetworkAgent::buildObjectForResourceResponse):
1531         (WebCore::InspectorNetworkAgent::buildObjectForCachedResource):
1532         (WebCore::InspectorNetworkAgent::willSendRequest):
1533         (WebCore::InspectorNetworkAgent::didReceiveResponse):
1534         (WebCore::InspectorNetworkAgent::didLoadResourceFromMemoryCache):
1535         (WebCore::buildObjectForTiming): Deleted.
1536         (WebCore::buildObjectForResourceResponse): Deleted.
1537         (WebCore::buildObjectForCachedResource): Deleted.
1538         Use ResourceLoader instead of DocumentLoader to get Resource Timing information.
1539         Move functions to member functions to access the executionStopWatch.
1540
1541         (WebCore::InspectorNetworkAgent::didFinishLoading):
1542         Use the load timing finishTime and convert to elapsed time for frontend.
1543
1544         * inspector/InspectorNetworkAgent.h:
1545         * loader/SubresourceLoader.cpp:
1546         (WebCore::SubresourceLoader::didFinishLoading):
1547         Pass the web process load timing on to the inspector.
1548
1549 2016-08-26  Chris Dumez  <cdumez@apple.com>
1550
1551         Unreviewed, fix Windows build after r205048.
1552
1553         * bindings/scripts/CodeGeneratorJS.pm:
1554         (getConditionalForFunctionConsideringOverloads):
1555         * bindings/scripts/test/JS/JSTestObj.cpp:
1556         (WebCore::jsTestObjPrototypeFunctionSingleConditionalOverload1):
1557         (WebCore::jsTestObjPrototypeFunctionSingleConditionalOverload2):
1558         (WebCore::jsTestObjPrototypeFunctionSingleConditionalOverload):
1559         * bindings/scripts/test/TestObj.idl:
1560
1561 2016-08-23  Ryosuke Niwa  <rniwa@webkit.org>
1562
1563         Adopted custom element's callbacks should continue to work
1564         https://bugs.webkit.org/show_bug.cgi?id=161065
1565
1566         Reviewed by Andreas Kling.
1567
1568         When a custom element is adopted into another document, its reaction callbacks need to continue to work.
1569         Because a different document may have its own global object, each custom element needs to remember its
1570         original global object or JSCustomElementInterface. This patch adds the latter to the element rare data.
1571
1572         Tests: fast/custom-elements/connected-callbacks.html
1573                fast/custom-elements/disconnected-callbacks.html
1574
1575         * bindings/js/JSCustomElementInterface.cpp:
1576         (WebCore::JSCustomElementInterface::constructElement):
1577         (WebCore::JSCustomElementInterface::upgradeElement):
1578         * dom/CustomElementReactionQueue.cpp:
1579         (WebCore::findInterfaceForCustomElement): Deleted.
1580         (WebCore::CustomElementReactionQueue::enqueueConnectedCallbackIfNeeded):
1581         (WebCore::CustomElementReactionQueue::enqueueDisconnectedCallbackIfNeeded):
1582         (WebCore::CustomElementReactionQueue::enqueueAttributeChangedCallbackIfNeeded):
1583         * dom/Element.cpp:
1584         (WebCore::Element::insertedInto): Invoke callbacks even when the current document is not a HTML document.
1585         (WebCore::Element::removedFrom): Ditto.
1586         (WebCore::Element::setCustomElementIsResolved): Moved from Node. Add the element interface to the rare data.
1587         (WebCore::Element::customElementInterface): Added.
1588         * dom/Element.h:
1589         * dom/ElementRareData.cpp:
1590         * dom/ElementRareData.h:
1591         (WebCore::ElementRareData::customElementInterface): Added.
1592         (WebCore::ElementRareData::setCustomElementInterface): Added.
1593         * dom/Node.h:
1594         ((WebCore::Node::setCustomElementIsResolved): Deleted.
1595
1596 2016-08-26  Zalan Bujtas  <zalan@apple.com>
1597
1598         ASSERT_NOT_REACHED() is touched in WebCore::minimumValueForLength
1599         https://bugs.webkit.org/show_bug.cgi?id=125781
1600         <rdar://problem/27684457>
1601
1602         Reviewed by Simon Fraser.
1603
1604         RenderTableSection::calcRowLogicalHeight misused minimumValueForLength to fallback to 0 for non-fixed values.
1605         While this patch fixes the assertion, the table section code needs works to support calc values. See webkit.org/b/161273.   
1606
1607         Test: fast/table/assert-on-min-max-content-values.html
1608
1609         * rendering/RenderTableSection.cpp:
1610         (WebCore::RenderTableSection::calcRowLogicalHeight):
1611
1612 2016-08-26  Andreas Kling  <akling@apple.com>
1613
1614         REGRESSION (r204987): fast/canvas-composite-* tests are now flaky assertion failures
1615         <https://webkit.org/b/161259>
1616
1617         Reviewed by Joseph Pecoraro.
1618
1619         Fix a blunder where HTMLCanvasElement::memoryCost() wasn't forwarding the inquiry
1620         to ImageBuffer but HTMLCanvasElement::externalMemoryCost() was.
1621
1622         This fixes flaky "externalMemorySize() <= extraMemorySize()" assertions on debug bots.
1623
1624         * html/HTMLCanvasElement.cpp:
1625         (WebCore::HTMLCanvasElement::memoryCost):
1626
1627 2016-08-26  Andreas Kling  <akling@apple.com>
1628
1629         The :enabled/:disabled selectors should only match elements that can be disabled.
1630         <https://webkit.org/b/161255>
1631
1632         Reviewed by Chris Dumez.
1633
1634         Per the HTML spec, only the following elements can be actually disabled:
1635
1636             button, input, select, textarea, optgroup, option, menuitem, fieldset
1637
1638         Since HTMLOutputElement inherits from HTMLFormControlElement, it had some
1639         misguided ideas about being disableable. This was causing it to get matched
1640         by :enabled and :disabled selectors.
1641
1642         Test: imported/w3c/web-platform-tests/html/semantics/selectors/pseudo-classes/disabled.html
1643
1644         * css/SelectorChecker.cpp:
1645         (WebCore::SelectorChecker::checkOne):
1646         * cssjit/SelectorCompiler.cpp:
1647         (WebCore::SelectorCompiler::addPseudoClassType):
1648         * css/SelectorCheckerTestFunctions.h:
1649         (WebCore::matchesDisabledPseudoClass):
1650         (WebCore::matchesEnabledPseudoClass): Renamed from isEnabled/isDisabled. Now only allows
1651         :enabled and :disabled selectors to match elements that are actually disableable.
1652
1653         * html/HTMLElement.h:
1654         * html/HTMLElement.cpp:
1655         (WebCore::HTMLElement::canBeActuallyDisabled):
1656         (WebCore::HTMLElement::isActuallyDisabled): Added supporting functions for the aforementioned selectors.
1657
1658         * html/HTMLFormControlElement.cpp:
1659         (WebCore::HTMLFormControlElement::parseAttribute): Don't care about disabled state
1660         changes in elements that are not disableable in the first place.
1661
1662 2016-08-26  Chris Dumez  <cdumez@apple.com>
1663
1664         REGRESSION(r204028): Fix unused-but-set-variable warning in generated JSNavigator.cpp
1665         https://bugs.webkit.org/show_bug.cgi?id=161252
1666
1667         Reviewed by Ryosuke Niwa.
1668
1669         Improve support for [Conditional] with overloaded operations in the IDL.
1670
1671         No new tests, updated bindings tests.
1672
1673         * bindings/scripts/CodeGeneratorJS.pm:
1674         (GenerateHeader):
1675         (GeneratePropertiesHashTable):
1676         (getConditionalForFunctionConsideringOverloads):
1677         (GenerateOverloadedFunctionOrConstructor):
1678         (GenerateImplementation):
1679         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
1680         (WebCore::jsTestGlobalObjectInstanceFunctionEnabledAtRuntimeOperation): Deleted.
1681         * bindings/scripts/test/JS/JSTestObj.cpp:
1682         (WebCore::jsTestObjPrototypeFunctionConditionalOverload1):
1683         (WebCore::jsTestObjPrototypeFunctionConditionalOverload2):
1684         (WebCore::jsTestObjPrototypeFunctionConditionalOverload):
1685         (WebCore::jsTestObjPrototypeFunctionEnabledAtRuntimeOperation): Deleted.
1686         (WebCore::jsTestObjConstructorFunctionOverloadedMethod1): Deleted.
1687         * bindings/scripts/test/TestObj.idl:
1688
1689 2016-08-26  Beth Dakin  <bdakin@apple.com>
1690
1691         charactersAroundPosition can be wrong because it crosses editing boundaries
1692         https://bugs.webkit.org/show_bug.cgi?id=161215
1693         -and corresponding-
1694         rdar://problem/27933564
1695
1696         Reviewed by Ryosuke Niwa.
1697
1698         charactersAroundPosition() should not cross editing boundaries. This patch fixes 
1699         that by making nextCharacterBoundaryInDirection() take an 
1700         EditingBoundaryCrossingRule parameter to pass onto VisiblePosition::next() and 
1701         VisiblePosition::previous().
1702
1703         * editing/VisibleUnits.cpp:
1704         (WebCore::nextCharacterBoundaryInDirection):
1705         (WebCore::positionOfNextBoundaryOfGranularity):
1706         (WebCore::charactersAroundPosition):
1707
1708 2016-08-26  Joseph Pecoraro  <pecoraro@apple.com>
1709
1710         Web Inspector: Test and address issues in IndexedDB.requestData
1711         https://bugs.webkit.org/show_bug.cgi?id=161178
1712         <rdar://problem/28002467>
1713
1714         Reviewed by Brian Burg.
1715
1716         Test: inspector/indexeddb/requestData.html
1717
1718         * inspector/InspectorIndexedDBAgent.cpp:
1719         (idbKeyRangeFromKeyRange):
1720         Parsing was too strict. "lower" and "upper" keys are optional.
1721
1722         (WebCore::DataLoader::execute):
1723         Ensure the skip count is passed forward.
1724
1725 2016-08-25  Joseph Pecoraro  <pecoraro@apple.com>
1726
1727         Web Inspector: Provide a way to clear an IndexedDB object store
1728         https://bugs.webkit.org/show_bug.cgi?id=161167
1729         <rdar://problem/27996932>
1730
1731         Reviewed by Brian Burg.
1732
1733         Test: inspector/indexeddb/clearObjectStore.html
1734
1735         * inspector/InspectorIndexedDBAgent.cpp:
1736         Make the transaction for clearing an object store readwrite
1737         instead of readonly, and activate it.
1738
1739 2016-08-26  Chris Dumez  <cdumez@apple.com>
1740
1741         Calling crossOriginWindow.toString() should not be allowed
1742         https://bugs.webkit.org/show_bug.cgi?id=161225
1743
1744         Reviewed by Andreas Kling.
1745
1746         Calling crossOriginWindow.toString() should not be allowed:
1747         - https://html.spec.whatwg.org/#crossoriginproperties-(-o-)
1748
1749         In WebKit, we were printing a security error in the console but
1750         returning "[object Window]" anyway.
1751
1752         In Firefox and Chrome, it throws an exception.
1753
1754         No new tests, updated existing test.
1755
1756         * bindings/js/JSDOMWindowCustom.cpp:
1757         (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
1758
1759 2016-08-26  Devin Rousso  <dcrousso+webkit@gmail.com>
1760
1761         Web Inspector: Some CSS selectors in the UI aren't escaped
1762         https://bugs.webkit.org/show_bug.cgi?id=151378
1763
1764         Reviewed by Joseph Pecoraro.
1765
1766         No new tests, but logic and results of existing tests updated:
1767         * inspector/dom/content-node-region-info.html:
1768         * inspector/dom/content-node-region-info-expected.txt:
1769         * inspector/dom/highlightNode-expected.txt:
1770         * inspector/dom/highlightSelector.html:
1771         * inspector/dom/highlightSelector-expected.txt:
1772
1773         * inspector/InspectorOverlay.cpp:
1774         (WebCore::buildObjectForElementData):
1775
1776         * inspector/InspectorOverlayPage.css:
1777         (.pseudo-type):
1778         (.tag-name): Deleted.
1779
1780         * inspector/InspectorOverlayPage.js:
1781         (_createElementTitle):
1782
1783 2016-08-25  Brent Fulgham  <bfulgham@apple.com>
1784
1785         Crash when getting font bounding rect
1786         https://bugs.webkit.org/show_bug.cgi?id=161202
1787         <rdar://problem/27986981>
1788
1789         Reviewed by Myles C. Maxfield.
1790
1791         We should never store GlyphData objects for later use, because they contain raw pointers to Font elements
1792         contained in caches, and those font caches get periodically purged.
1793
1794         Instead, we should hold onto the ‘key’ representing the GlyphData, and simply ask the system for the
1795         GlyphData the next time it is needed.
1796
1797         Tested by existing MathML tests under ASAN and GuardMalloc.
1798
1799         * rendering/mathml/RenderMathMLToken.cpp:
1800         (WebCore::RenderMathMLToken::RenderMathMLToken): Clean up constructors.
1801         (WebCore::RenderMathMLToken::computePreferredLogicalWidths): Use keys to get correct GlyphData when needed.
1802         (WebCore::RenderMathMLToken::updateMathVariantGlyph): Ditto.
1803         (WebCore::RenderMathMLToken::firstLineBaseline): Ditto.
1804         (WebCore::RenderMathMLToken::layoutBlock): Ditto.
1805         (WebCore::RenderMathMLToken::paint): Ditto.
1806         (WebCore::RenderMathMLToken::paintChildren): Ditto.
1807         * rendering/mathml/RenderMathMLToken.h:
1808
1809 2016-08-26  Chris Dumez  <cdumez@apple.com>
1810
1811         HTMLAreaElement's coords attributes parsing does not comply with the HTML specification
1812         https://bugs.webkit.org/show_bug.cgi?id=161216
1813
1814         Reviewed by Andreas Kling.
1815
1816         HTMLAreaElement's coords attributes parsing does not comply with the HTML specification:
1817         - https://html.spec.whatwg.org/#attr-area-coords
1818
1819         This patch aligns our parsing of this attribute with the specification and Chrome.
1820
1821         No new tests, rebaselined existing test.
1822
1823         * html/HTMLAreaElement.cpp:
1824         (WebCore::HTMLAreaElement::HTMLAreaElement):
1825         (WebCore::HTMLAreaElement::parseAttribute):
1826         (WebCore::HTMLAreaElement::getRegion):
1827         * html/HTMLAreaElement.h:
1828         * html/parser/HTMLParserIdioms.cpp:
1829         (WebCore::isHTMLSpaceOrDelimiter):
1830         (WebCore::isNumberStart):
1831         (WebCore::parseHTMLListOfOfFloatingPointNumberValuesInternal):
1832         (WebCore::parseHTMLListOfOfFloatingPointNumberValues):
1833         (WebCore::parseHTMLNonNegativeInteger): Deleted.
1834         * html/parser/HTMLParserIdioms.h:
1835
1836 2016-08-26  Csaba Osztrogonác  <ossy@webkit.org>
1837
1838         Fix the !ENABLE(WEB_SOCKETS) build
1839         https://bugs.webkit.org/show_bug.cgi?id=161251
1840
1841         Reviewed by Alex Christensen.
1842
1843         * page/SocketProvider.h:
1844
1845 2016-08-26  Csaba Osztrogonác  <ossy@webkit.org>
1846
1847         Fix the !ENABLE(WEB_TIMING) build
1848         https://bugs.webkit.org/show_bug.cgi?id=161250
1849
1850         Reviewed by Alex Christensen.
1851
1852         * loader/SubresourceLoader.cpp:
1853         (WebCore::SubresourceLoader::didFinishLoading):
1854         * loader/cache/CachedResourceLoader.h:
1855         (WebCore::CachedResourceLoader::resourceTimingInformation):
1856
1857 2016-08-26  Chris Dumez  <cdumez@apple.com>
1858
1859         Trying to access cross-origin Location properties should throw a SecurityError
1860         https://bugs.webkit.org/show_bug.cgi?id=161248
1861
1862         Reviewed by Alex Christensen.
1863
1864         Trying to access cross-origin Location properties should throw a SecurityError:
1865         - https://html.spec.whatwg.org/#crossorigingetownpropertyhelper-(-o,-p-)
1866         - https://html.spec.whatwg.org/#crossoriginproperties-(-o-)
1867
1868         Firefox and Chrome already throw. However, WebKit was logging an error message
1869         and returning undefined.
1870
1871         No new tests, updated existing tests.
1872
1873         * bindings/js/JSDOMBinding.cpp:
1874         (WebCore::throwSecurityError):
1875         * bindings/js/JSDOMBinding.h:
1876         * bindings/js/JSLocationCustom.cpp:
1877         (WebCore::JSLocation::getOwnPropertySlotDelegate):
1878
1879 2016-08-26  Per Arne Vollan  <pvollan@apple.com>
1880
1881         [Win] Warning fixes.
1882         https://bugs.webkit.org/show_bug.cgi?id=161241
1883
1884         Reviewed by Brent Fulgham.
1885
1886         MSVC warns about potential use of uninitialized variables.
1887
1888         * accessibility/AXObjectCache.cpp:
1889         * css/parser/CSSParserValues.cpp:
1890
1891 2016-08-26  Eric Carlson  <eric.carlson@apple.com>
1892
1893         [MediaStream] Add support for OverConstrainedErrorEvent
1894         https://bugs.webkit.org/show_bug.cgi?id=161199
1895         <rdar://problem/28011819>
1896
1897         Reviewed by Jer Noble.
1898
1899         Test: fast/events/constructors/overconstrained-error-event-constructor.html
1900
1901         * CMakeLists.txt:
1902         * DerivedSources.make:
1903         * Modules/mediastream/OverconstrainedErrorEvent.h: Added.
1904         (WebCore::OverconstrainedErrorEvent::~OverconstrainedErrorEvent):
1905         (WebCore::OverconstrainedErrorEvent::create):
1906         (WebCore::OverconstrainedErrorEvent::createForBindings):
1907         (WebCore::OverconstrainedErrorEvent::error):
1908         (WebCore::OverconstrainedErrorEvent::eventInterface):
1909         (WebCore::OverconstrainedErrorEvent::OverconstrainedErrorEvent):
1910         * Modules/mediastream/OverconstrainedErrorEvent.idl: Added.
1911
1912         * WebCore.xcodeproj/project.pbxproj: Add new files.
1913
1914         * bindings/js/JSDictionary.cpp:
1915         (WebCore::JSDictionary::convertValue): Add OverconstrainedErrorEvent converter.
1916         * bindings/js/JSDictionary.h:
1917
1918         * dom/EventNames.in: Add OverconstrainedErrorEvent.
1919
1920 2016-08-26  Frederic Wang  <fwang@igalia.com>
1921
1922         The annotation-xml element does not need to be behave as an mrow
1923         https://bugs.webkit.org/show_bug.cgi?id=161230
1924
1925         Reviewed by Manuel Rego Casasnovas.
1926
1927         In r204779, MathMLAnnotationElement was made a MathMLRowElement just because the
1928         annotation-xml element is generating a RenderMathMLRow. This later point is actually not
1929         needed since annotation-xml is just a wrapper for foreign elements and so does not need to
1930         handle special MathML features like operator spacing or stretching. We can thus move back
1931         MathMLAnnotationElement to a generic MathMLPresentationElement and instead make the
1932         annotation-xml element generate a generic RenderMathMLBlock renderer.
1933
1934         No new tests, semantics annotations already covered by existing tests.
1935
1936         * mathml/MathMLAnnotationElement.cpp: Replace RenderMathMLRow.h with RenderMathMLBlock.h
1937         (WebCore::MathMLAnnotationElement::MathMLAnnotationElement): Inherit from
1938         MathMLPresentationElement instead of MathMLRowElement.
1939         (WebCore::MathMLAnnotationElement::createElementRenderer): Make annotation-xml create a
1940         RenderMathMLBlock instead of a RenderMathMLRow.
1941         (WebCore::MathMLAnnotationElement::attributeChanged): Inherit from MathMLPresentationElement
1942         instead of MathMLRowElement.
1943         * mathml/MathMLAnnotationElement.h: Ditto.
1944
1945 2016-08-26  Csaba Osztrogonác  <ossy@webkit.org>
1946
1947         Typo fix after r56209
1948         https://bugs.webkit.org/show_bug.cgi?id=161246
1949
1950         Reviewed by Gyuyoung Kim.
1951
1952         * page/FrameView.cpp:
1953         (WebCore::FrameView::adjustMediaTypeForPrinting):
1954
1955 2016-08-26  Per Arne Vollan  <pvollan@apple.com>
1956
1957         [Win] Warning fixes.
1958         https://bugs.webkit.org/show_bug.cgi?id=161077
1959
1960         Reviewed by Brent Fulgham.
1961
1962         * css/CSSGrammar.y.includes:
1963         * css/RuleFeature.cpp:
1964         (WebCore::makeAttributeSelectorKey):
1965         * editing/TextIterator.cpp:
1966         (WebCore::SearchBuffer::SearchBuffer):
1967         * html/HTMLElement.cpp:
1968         (WebCore::HTMLElement::textToFragment):
1969         * html/MediaElementSession.h:
1970         * platform/URL.cpp:
1971         * platform/graphics/ca/GraphicsLayerCA.cpp:
1972         * platform/network/HTTPParsers.cpp:
1973         (WebCore::parseHTTPHeader):
1974         * rendering/InlineIterator.h:
1975         (WebCore::InlineIterator::clear):
1976         * rendering/RenderDeprecatedFlexibleBox.cpp:
1977         (WebCore::FlexBoxIterator::reset):
1978         * rendering/RenderText.cpp:
1979         (WebCore::RenderText::secureText):
1980         * rendering/mathml/RenderMathMLToken.cpp:
1981         (WebCore::mathVariant):
1982         * style/InlineTextBoxStyle.cpp:
1983         (WebCore::visualOverflowForDecorations):
1984         * xml/XPathGrammar.y:
1985
1986 2016-08-26  Nael Ouedraogo  <nael.ouedraogo@crf.canon.fr>
1987
1988         Make custom constructors consistent with generated bindings code
1989         https://bugs.webkit.org/show_bug.cgi?id=159550
1990
1991         Reviewed by Youenn Fablet.
1992
1993         Add assertion to check DOMConstructorObject* passed in ExecState is not null.
1994         Rename throwConstructorDocumentUnavailableError to throwConstructorScriptExecutionContextUnavailableError since
1995         ScriptExecutionContext is not necessarily a Document.
1996         Modify error message in case of argument error to be consistent with generated binding code: replace calls to
1997         throwVMError with calls to throwConstructorScriptExecutionContextUnavailableError and throwArgumentTypeError.
1998
1999         No new test required. Modify tests and tests expectations to align with new error messages.
2000
2001         * bindings/js/JSAudioContextCustom.cpp:
2002         (WebCore::constructJSAudioContext):
2003         * bindings/js/JSBlobCustom.cpp:
2004         (WebCore::constructJSBlob):
2005         * bindings/js/JSDOMBinding.cpp:
2006         (WebCore::throwConstructorScriptExecutionContextUnavailableError):
2007         * bindings/js/JSDOMBinding.h:
2008         * bindings/js/JSDOMConstructor.h:
2009         (WebCore::JSBuiltinConstructor<JSClass>::callConstructor):
2010         * bindings/js/JSDOMFormDataCustom.cpp:
2011         (WebCore::constructJSDOMFormData):
2012         * bindings/js/JSDataCueCustom.cpp:
2013         (WebCore::constructJSDataCue):
2014         * bindings/js/JSFileCustom.cpp:
2015         (WebCore::constructJSFile):
2016         * bindings/js/JSHTMLElementCustom.cpp:
2017         (WebCore::constructJSHTMLElement):
2018         * bindings/js/JSMediaSessionCustom.cpp:
2019         (WebCore::constructJSMediaSession):
2020         * bindings/js/JSMutationObserverCustom.cpp:
2021         (WebCore::constructJSMutationObserver):
2022         * bindings/js/JSReadableStreamPrivateConstructors.cpp:
2023         (WebCore::constructJSReadableStreamDefaultReader):
2024         * bindings/js/JSWorkerCustom.cpp:
2025         (WebCore::constructJSWorker):
2026         * bindings/scripts/CodeGeneratorJS.pm:
2027         (GenerateCallbackImplementation):
2028         (NativeToJSValue):
2029         (GenerateHashTableValueArray):
2030         (GenerateConstructorDefinition):
2031         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
2032         (WebCore::JSTestEventConstructorConstructor::construct):
2033         * bindings/scripts/test/JS/JSTestInterface.cpp:
2034         (WebCore::JSTestInterfaceConstructor::construct):
2035         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
2036         (WebCore::JSTestNamedConstructorNamedConstructor::construct):
2037         * bindings/scripts/test/JS/JSTestNode.cpp:
2038         (WebCore::JSTestNodeConstructor::construct):
2039         * bindings/scripts/test/JS/JSTestObj.cpp:
2040         (WebCore::JSTestObjConstructor::construct):
2041         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
2042         (WebCore::constructJSTestOverloadedConstructors1):
2043         (WebCore::constructJSTestOverloadedConstructors2):
2044         (WebCore::constructJSTestOverloadedConstructors3):
2045         (WebCore::constructJSTestOverloadedConstructors4):
2046         (WebCore::constructJSTestOverloadedConstructors5):
2047         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
2048         (WebCore::constructJSTestOverloadedConstructorsWithSequence1):
2049         (WebCore::constructJSTestOverloadedConstructorsWithSequence2):
2050         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2051         (WebCore::JSTestTypedefsConstructor::construct):
2052
2053 2016-08-25  Carlos Garcia Campos  <cgarcia@igalia.com>
2054
2055         Unreviewed. Fix GTK+ build after r204986 and r204996.
2056
2057         * page/DOMWindow.idl:
2058
2059 2016-08-25  Wenson Hsieh  <wenson_hsieh@apple.com>
2060
2061         Dragging against the end of the inline media scrubber causes the media scrubber to hide
2062         https://bugs.webkit.org/show_bug.cgi?id=161207
2063
2064         Reviewed by Eric Carlson.
2065
2066         Previously, we would re-enable behavior restrictions when firing an ended event. However, if the ended event is
2067         caused by the user seeking to the end of the video, the media controls would be taken away from under the user.
2068         To prevent this, we don't add the relevant behavior restrictions upon media ended if media was seeking before
2069         firing the event.
2070
2071         Tweaked an existing WebKit API test to cover this change.
2072
2073         * html/HTMLMediaElement.cpp:
2074         (WebCore::HTMLMediaElement::mediaPlayerTimeChanged):
2075         (WebCore::HTMLMediaElement::addBehaviorRestrictionsOnEndIfNecessary):
2076         * html/HTMLMediaElement.h:
2077         * html/MediaElementSession.cpp:
2078         (WebCore::MediaElementSession::canControlControlsManager):
2079
2080 2016-08-25  Andreas Kling  <akling@apple.com>
2081
2082         REGRESSION: RELEASE_ASSERT in ResourceUsageThread::platformThreadBody when ASan is enabled
2083         <https://webkit.org/b/161203>
2084         <rdar://problem/28011251>
2085
2086         Reviewed by Joseph Pecoraro.
2087
2088         * page/cocoa/ResourceUsageThreadCocoa.mm:
2089         (WebCore::ResourceUsageThread::platformThreadBody): Remove overly optimistic assertions about
2090         "GC owned" memory never being higher than total malloc memory usage. This accounting is not
2091         really exact and pretending otherwise will just lead to crashes.
2092
2093         * html/HTMLCanvasElement.cpp:
2094         (WebCore::HTMLCanvasElement::externalMemoryCost): Hook up HTMLCanvasElement to the ImageBuffer
2095         helper for reporting external memory cost. This makes accounting slightly more correct.
2096
2097 2016-08-25  Chris Dumez  <cdumez@apple.com>
2098
2099         Regression(r203623): Breaks App Store application
2100         https://bugs.webkit.org/show_bug.cgi?id=161206
2101         <rdar://problem/28015060>
2102
2103         Reviewed by Ryosuke Niwa.
2104
2105         Add quirks for the App Store application so that we log an error message
2106         when passing a Document node to Window.getComputedStyle() instead of
2107         throwing an exception.
2108
2109         * page/DOMWindow.cpp:
2110         (WebCore::DOMWindow::getComputedStyle):
2111         * page/DOMWindow.h:
2112         * page/DOMWindow.idl:
2113         * platform/RuntimeApplicationChecks.h:
2114         * platform/RuntimeApplicationChecks.mm:
2115         (WebCore::MacApplication::isAppStore):
2116
2117 2016-08-25  Said Abou-Hallawa  <sabouhallawa@apple.com>
2118
2119         REGRESSION (r203378): [iOS] The PDF image is rendered stretched if a sub image of it is cached first
2120         https://bugs.webkit.org/show_bug.cgi?id=160617
2121
2122         Reviewed by Tim Horton.
2123
2124         When caching only a sub-image of the PDF ensure the source rectangle starts
2125         at the top-left of the cached sub-image rectangle. When drawing the cached 
2126         sub-image to the destination context ensure the destination rectangle is the
2127         sub-image rectangle so no stretching or shrinking happens.
2128
2129         Test: fast/images/cached-clipped-pdf.html
2130
2131         * page/Settings.cpp:
2132         (WebCore::Settings::Settings):
2133         (WebCore::Settings::setCachedPDFImageEnabled): Deleted.
2134         * page/Settings.h:
2135         (WebCore::Settings::isCachedPDFImageEnabled): Deleted.
2136         * page/Settings.in:
2137         Change the boolean setting CachedPDFImageEnabled to be enum property and
2138         rename it PDFImageCachingPolicy. Allow the "PDFImageCachingBelowMemoryLimit"
2139         option to be available on a;; platforms. The "PDFImageCachingClipBoundsOnly"
2140         option is added for testing purpose. If forces recaching the PDF with each
2141         draw and it sets the cached image rectangle to the clipping rectangle.
2142         
2143         * platform/graphics/cg/PDFDocumentImage.cpp:
2144         (WebCore::PDFDocumentImage::setPdfImageCachingPolicy): Take an enum instead of boolean.
2145         (WebCore::cachedImageRect): 
2146         (WebCore::PDFDocumentImage::decodedSizeChanged): Enable PDFImageCachingBelowMemoryLimit
2147         on all platforms.
2148         (WebCore::PDFDocumentImage::updateCachedImageIfNeeded): Fix the source rectangle
2149         when caching a sub-image of the PDF.
2150         (WebCore::PDFDocumentImage::draw): Fix the destination rectangle when drawing
2151         a sub-image to the destination context.
2152         (WebCore::PDFDocumentImage::setCachedPDFImageEnabled): Deleted.
2153         * platform/graphics/cg/PDFDocumentImage.h:
2154         
2155         * rendering/RenderImage.cpp:
2156         (WebCore::RenderImage::paintIntoRect):
2157         
2158         * testing/InternalSettings.cpp:
2159         (WebCore::InternalSettings::Backup::Backup):
2160         (WebCore::InternalSettings::Backup::restoreTo):
2161         (WebCore::InternalSettings::setPDFImageCachingPolicy):
2162         (WebCore::InternalSettings::setCachedPDFImageEnabled): Deleted.
2163         * testing/InternalSettings.h:
2164         * testing/InternalSettings.idl:
2165         Change the internal setting CachedPDFImageEnabled to PDFImageCachingPolicy.
2166
2167 2016-08-25  Zalan Bujtas  <zalan@apple.com>
2168
2169         Infinite recursion crash in WebCore::RenderBlockFlow::layoutBlock
2170         https://bugs.webkit.org/show_bug.cgi?id=139474
2171         <rdar://problem/27705190>
2172
2173         Reviewed by David Hyatt.
2174
2175         We should just give up trying to avoid widow when the page is too small to break line.
2176
2177         Test: fast/multicol/assert-on-small-page-height-with-widow.html
2178
2179         * rendering/RenderBlockFlow.cpp:
2180         (WebCore::RenderBlockFlow::clearShouldBreakAtLineToAvoidWidowIfNeeded):
2181         (WebCore::RenderBlockFlow::adjustLinePositionForPagination):
2182         * rendering/RenderBlockFlow.h:
2183
2184 2016-08-24  Sam Weinig  <sam@webkit.org>
2185
2186         Add the ability to override the implementation name of IDL enums and dictionaries
2187         https://bugs.webkit.org/show_bug.cgi?id=161185
2188
2189         Reviewed by Anders Carlsson.
2190
2191         * bindings/scripts/CodeGenerator.pm:
2192         (ProcessDocument):
2193         Build a dictionary of IDL name -> implementation name overrides
2194         for enums and dictionaries up front based on ImplementedAs extended
2195         attribute.
2196
2197         (HasEnumImplementationNameOverride):
2198         (GetEnumImplementationNameOverride):
2199         (HasDictionaryImplementationNameOverride):
2200         (GetDictionaryImplementationNameOverride):
2201         Expose predicate and getter for name overrides.
2202
2203         * bindings/scripts/CodeGeneratorJS.pm:
2204         (GetEnumerationClassName):
2205         (GetDictionaryClassName):
2206         Use the override names as necessary.
2207
2208         * bindings/scripts/test/TestObj.idl:
2209         Add tests for enums and dictionaries with ImplementedAs extended
2210         attributes.
2211
2212 2016-08-25  Johan K. Jensen  <johan_jensen@apple.com>
2213
2214         Don't store networkLoadTiming in the disk cache
2215         https://bugs.webkit.org/show_bug.cgi?id=161161
2216
2217         Reviewed by Antti Koivisto.
2218
2219         No functionality changed. So, no new tests.
2220
2221         * platform/network/ResourceResponseBase.h:
2222         (WebCore::ResourceResponseBase::encode):
2223         (WebCore::ResourceResponseBase::decode):
2224
2225 2016-08-25  Johan K. Jensen  <johan_jensen@apple.com>
2226
2227         Update the Resource Timing implementation
2228         https://bugs.webkit.org/show_bug.cgi?id=161068
2229
2230         Reviewed by Alex Christensen.
2231
2232         Tests: imported/w3c/web-platform-tests/resource-timing/resource-timing.html
2233                imported/w3c/web-platform-tests/resource-timing/test_resource_timing.html
2234
2235         Update the Resource Timing implementation for better compatibility with the Resource Timing API spec.
2236         Use LoadTiming for general timing information about a resources load timeline.
2237         Mark timestamps for newly loaded resources as well as cached resources.
2238
2239         * loader/DocumentLoader.cpp:
2240         (WebCore::DocumentLoader::startLoadingMainResource):
2241         StartTime and fetchStart should be equal initially.
2242
2243         * loader/LoadTiming.cpp:
2244         (WebCore::LoadTiming::LoadTiming): Moved member initialization out. Removed constructor.
2245         * loader/LoadTiming.h:
2246         (WebCore::LoadTiming::markStartTimeAndFetchStart):
2247         Mark startTime and fetchStart simultaneously.
2248
2249         * loader/ResourceLoader.cpp:
2250         (WebCore::ResourceLoader::init):
2251         Mark the start time of resources.
2252
2253         * loader/ResourceLoader.h:
2254         (WebCore::ResourceLoader::loadTiming):
2255         Add LoadTiming info to handle a resources load timing.
2256
2257         * loader/ResourceTimingInformation.cpp:
2258         (WebCore::ResourceTimingInformation::addResourceTiming):
2259         * loader/ResourceTimingInformation.h:
2260         Only pass in the URL from the ResourceRequest.
2261         Pass LoadTiming instead of timestamps.
2262
2263         * loader/SubresourceLoader.cpp:
2264         (WebCore::SubresourceLoader::willSendRequestInternal):
2265         Mark redirects.
2266
2267         (WebCore::SubresourceLoader::didFinishLoading):
2268         Mark the responseEnd timestamp.
2269         Add the ResourceEntry to the timeline before notifyDone is called.
2270
2271         * loader/cache/CachedResourceLoader.cpp:
2272         (WebCore::CachedResourceLoader::requestResource):
2273         (WebCore::CachedResourceLoader::revalidateResource):
2274         (WebCore::CachedResourceLoader::loadDone):
2275         Mark timestamps for cached resources and use them instead of a cached LoadTiming.
2276
2277         * loader/cache/CachedResourceLoader.h:
2278         (WebCore::CachedResourceLoader::resourceTimingInformation):
2279         Add ResourceTimingInformation getter so SubresourceLoader.cpp can add entries before callbacks.
2280
2281         * page/Performance.cpp:
2282         (WebCore::Performance::addResourceTiming):
2283         * page/Performance.h:
2284         Update signature: URLs and LoadTiming instead of timestamps.
2285
2286         * page/PerformanceResourceTiming.cpp:
2287         (WebCore::PerformanceResourceTiming::PerformanceResourceTiming):
2288         (WebCore::PerformanceResourceTiming::redirectStart):
2289         (WebCore::PerformanceResourceTiming::redirectEnd):
2290         (WebCore::PerformanceResourceTiming::fetchStart):
2291         (WebCore::PerformanceResourceTiming::domainLookupStart):
2292         (WebCore::PerformanceResourceTiming::domainLookupEnd):
2293         (WebCore::PerformanceResourceTiming::connectStart):
2294         (WebCore::PerformanceResourceTiming::connectEnd):
2295         (WebCore::PerformanceResourceTiming::requestStart):
2296         (WebCore::PerformanceResourceTiming::responseStart):
2297         (WebCore::PerformanceResourceTiming::responseEnd):
2298         (WebCore::PerformanceResourceTiming::resourceTimeToDocumentMilliseconds):
2299         * page/PerformanceResourceTiming.h:
2300         Update signatures and properties to use LoadTiming.
2301         Use LoadTiming’s redirectStart/End, fetchStart, responseStart/End.
2302         Make sure dns and connection timestamps are in increasing order, even when cached.
2303
2304         * page/PerformanceResourceTiming.idl:
2305         Add responseStart.
2306
2307 2016-08-24  Anders Carlsson  <andersca@apple.com>
2308
2309         Simplify createMouseEvent in DragController
2310         https://bugs.webkit.org/show_bug.cgi?id=161168
2311
2312         Reviewed by Dan Bernstein.
2313
2314         * page/DragController.cpp:
2315         (WebCore::createMouseEvent):
2316         * platform/DragData.cpp:
2317         (WebCore::DragData::modifierKeyState): Deleted.
2318         * platform/DragData.h:
2319
2320 2016-08-25  Chris Dumez  <cdumez@apple.com>
2321
2322         DOMTokenList.value should be a stringifier attribute
2323         https://bugs.webkit.org/show_bug.cgi?id=161195
2324
2325         Reviewed by Darin Adler.
2326
2327         DOMTokenList.value should be a stringifier attribute:
2328         - https://dom.spec.whatwg.org/#domtokenlist
2329
2330         No new tests, this change is not observable from the Web.
2331
2332         * html/DOMTokenList.h:
2333         (WebCore::DOMTokenList::toString): Deleted.
2334         * html/DOMTokenList.idl:
2335         * html/HTMLLinkElement.cpp:
2336         (WebCore::HTMLLinkElement::iconSizes): Deleted.
2337         * html/HTMLLinkElement.h:
2338
2339 2016-08-25  Csaba Osztrogonác  <ossy@webkit.org>
2340
2341         [Mac][cmake] Unreviewed speculative buildfix after r204852, just for fun.
2342
2343         * PlatformMac.cmake:
2344
2345 2016-08-24  Frederic Wang  <fwang@igalia.com>
2346
2347         Do not store layout parameters on the RenderMathMLRoot class
2348         https://bugs.webkit.org/show_bug.cgi?id=161132
2349
2350         Reviewed by Darin Adler.
2351
2352         Storing layout parameters on the RenderMathMLRoot class is not really needed since reading
2353         the parameters from the MATH table is not too expensive and updateStyle() is currently always
2354         called in layoutBlock() and computePreferredLogicalWidths(). Most of these parameters are
2355         actually only used in layoutBlock(). We separate horizontal and vertical parameters since
2356         the latter are not needed for preferred width calculations. This removes the need for calling
2357         an updateStyle functions and may also fix update issues when zooming in or out.
2358
2359         No new tests, already covered by existing tests.
2360
2361         * rendering/mathml/MathMLStyle.cpp:
2362         (WebCore::MathMLStyle::updateStyleIfNeeded): No need to update layout parameters for the
2363         RenderMathMLRoot class.
2364         * rendering/mathml/RenderMathMLRoot.cpp:
2365         (WebCore::RenderMathMLRoot::styleDidChange): No need to update layout parameters.
2366         (WebCore::RenderMathMLRoot::horizontalParameters): Move code from updateStyle to retrieve the
2367         horizontal parameters.
2368         (WebCore::RenderMathMLRoot::verticalParameters): Ditto for vertical parameters.
2369         (WebCore::RenderMathMLRoot::computePreferredLogicalWidths): Call horizontalParameters() to
2370         get the kernings of the index instead of calling updateStyle().
2371         (WebCore::RenderMathMLRoot::layoutBlock): Call horizontalParameters() and
2372         verticalParameters() to get the layout parameters instead of calling updateStyle().
2373         (WebCore::RenderMathMLRoot::paint): Call horizontalParameters() and verticalParameters()
2374         to get the layout parameters.
2375         (WebCore::RenderMathMLRoot::updateFromElement): Deleted. No need to call updateStyle().
2376         (WebCore::RenderMathMLRoot::updateStyle): Deleted.
2377         * rendering/mathml/RenderMathMLRoot.h: Do not override updateFromElement(). Replace some
2378         layout parameters stored on the class with struct and helper functions to manipulate them.
2379
2380 2016-08-24  Chris Dumez  <cdumez@apple.com>
2381
2382         WorkerLocation.prototype.toString() should be enumerable
2383         https://bugs.webkit.org/show_bug.cgi?id=161183
2384
2385         Reviewed by Ryosuke Niwa.
2386
2387         WorkerLocation.prototype.toString() should be enumerable:
2388         - https://html.spec.whatwg.org/#workerlocation
2389         - http://heycam.github.io/webidl/#es-stringifier
2390
2391         No new tests, updated existing test.
2392
2393         * workers/WorkerLocation.h:
2394         (WebCore::WorkerLocation::toString): Deleted.
2395         * workers/WorkerLocation.idl:
2396         Also use USVString string type instead of DOMString to match the
2397         specification. There is no behavior change because those attributes
2398         are readonly.
2399
2400 2016-08-24  Chris Dumez  <cdumez@apple.com>
2401
2402         Location.toString() should be enumerable
2403         https://bugs.webkit.org/show_bug.cgi?id=161179
2404
2405         Reviewed by Geoffrey Garen.
2406
2407         Location.toString() should be enumerable as per:
2408         - https://html.spec.whatwg.org/#location
2409         - http://heycam.github.io/webidl/#es-stringifier
2410
2411         This patch stops hard-coding the toString() operation on the Location
2412         interface and makes the 'href' attribute a stringifier attribute instead,
2413         as per the specification. The generated toString() has the same behavior
2414         as it used to but it is now enumerable, as it should.
2415
2416         No new tests, updated existing test.
2417
2418         * bindings/js/JSLocationCustom.cpp:
2419         (WebCore::JSLocation::toStringFunction): Deleted.
2420         * page/Location.idl:
2421
2422 2016-08-24  Joseph Pecoraro  <pecoraro@apple.com>
2423
2424         Implement `CSS.escape` as per CSSOM
2425         https://bugs.webkit.org/show_bug.cgi?id=126337
2426
2427         Reviewed by Dean Jackson.
2428
2429         Test: css3/escape-dom-api.html
2430
2431         * css/CSSOMUtils.cpp:
2432         (WebCore::serializeIdentifier):
2433         Update serialization to match the latest version of the spec:
2434         <https://drafts.csswg.org/cssom/#serialize-an-identifier>
2435         New handling for 0x0, 0x7f, just "-", and "--" is now allowed.
2436
2437         * css/DOMCSSNamespace.cpp:
2438         (WebCore::DOMCSSNamespace::escape):
2439         * css/DOMCSSNamespace.h:
2440         * css/DOMCSSNamespace.idl:
2441         New CSS.escape method.
2442
2443 2016-08-24  Zalan Bujtas  <zalan@apple.com>
2444
2445         ASSERTION FAILED: contentSize >= 0 in WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax
2446         https://bugs.webkit.org/show_bug.cgi?id=155700
2447         <rdar://problem/27720727>
2448
2449         Reviewed by David Hyatt.
2450
2451         RenderBox::m_minPreferredLogicalWidth/m_maxPreferredLogicalWidth don't need special initial value since
2452         preferredLogicalWidthsDirty flag guards them. -1 as initial value can cause problems for renderers that don't
2453         override RenderBox::computePreferredLogicalWidths().    
2454
2455         Test: fast/ruby/assert-when-content-size-is-negative.html
2456
2457         * rendering/RenderBox.cpp:
2458         (WebCore::RenderBox::RenderBox):
2459         (WebCore::RenderBox::dirtyLineBoxes):
2460         (WebCore::RenderBox::deleteLineBoxWrapper):
2461         * rendering/RenderBox.h:
2462
2463 2016-08-24  Alex Christensen  <achristensen@webkit.org>
2464
2465         Import w3c URL tests
2466         https://bugs.webkit.org/show_bug.cgi?id=161177
2467
2468         Reviewed by Tim Horton.
2469
2470         Tests: imported/w3c/web-platform-tests/url/a-element-xhtml.xhtml
2471                imported/w3c/web-platform-tests/url/a-element.html
2472                imported/w3c/web-platform-tests/url/historical.html
2473                imported/w3c/web-platform-tests/url/interfaces.html
2474                imported/w3c/web-platform-tests/url/url-constructor.html
2475                imported/w3c/web-platform-tests/url/url-domainToUnicode.html
2476                imported/w3c/web-platform-tests/url/url-setters.html
2477                imported/w3c/web-platform-tests/url/urlsearchparams-append.html
2478                imported/w3c/web-platform-tests/url/urlsearchparams-constructor.html
2479                imported/w3c/web-platform-tests/url/urlsearchparams-delete.html
2480                imported/w3c/web-platform-tests/url/urlsearchparams-get.html
2481                imported/w3c/web-platform-tests/url/urlsearchparams-getall.html
2482                imported/w3c/web-platform-tests/url/urlsearchparams-has.html
2483                imported/w3c/web-platform-tests/url/urlsearchparams-set.html
2484                imported/w3c/web-platform-tests/url/urlsearchparams-stringifier.html
2485
2486         * platform/URL.cpp:
2487         (WebCore::URL::setQuery):
2488
2489 2016-08-24  Ryan Haddad  <ryanhaddad@apple.com>
2490
2491         Rebaseline bindings tests after r204923.
2492
2493         Unreviewed test gardening.
2494
2495         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
2496         (WebCore::jsTestActiveDOMObjectExcitingAttr):
2497         (WebCore::jsTestActiveDOMObjectPrototypeFunctionExcitingFunction):
2498
2499 2016-08-24  Jonathan Bedard  <jbedard@apple.com>
2500
2501         FocusController multiple dereferenced NULL pointers
2502         https://bugs.webkit.org/show_bug.cgi?id=160808
2503
2504         Reviewed by Darin Adler.
2505
2506         No new tests needed, fix does not change functionality.
2507
2508         This change fixes a number of NULL pointer dereferences which occur in FocusController.
2509
2510         * page/FocusController.cpp:
2511         (WebCore::isFocusableElementOrScopeOwner): Changed KeyboardEvent reference to pointer.
2512         (WebCore::isNonFocusableScopeOwner): Ditto.
2513         (WebCore::isFocusableScopeOwner): Ditto.
2514         (WebCore::shadowAdjustedTabIndex): Ditto.
2515
2516         (WebCore::FocusController::findFocusableElementAcrossFocusScope): Pass pointer instead of reference to KeyboardEvent.
2517         (WebCore::FocusController::nextFocusableElementWithinScope): Ditto.
2518         (WebCore::FocusController::previousFocusableElementWithinScope): Ditto.
2519         (WebCore::FocusController::findElementWithExactTabIndex): Ditto.
2520         (WebCore::nextElementWithGreaterTabIndex): Ditto.
2521         (WebCore::previousElementWithLowerTabIndex): Ditto.
2522         (WebCore::FocusController::nextFocusableElementOrScopeOwner): Ditto.
2523         (WebCore::FocusController::previousFocusableElementOrScopeOwner): Ditto.
2524         (WebCore::relinquishesEditingFocus): Ditto.
2525
2526 2016-08-24  Nan Wang  <n_wang@apple.com>
2527
2528         AX: VoiceOver on iOS ignores aria-checked on menuitemradio and menuitemcheckbox
2529         https://bugs.webkit.org/show_bug.cgi?id=161118
2530
2531         Reviewed by Chris Fleizach.
2532
2533         Added checkboxOrRadioValue and toggle trait to menuitemradio and menuitemcheckbox.
2534
2535         Test: accessibility/ios-simulator/menuitem-checked.html
2536
2537         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2538         (-[WebAccessibilityObjectWrapper accessibilityTraits]):
2539         (-[WebAccessibilityObjectWrapper accessibilityValue]):
2540
2541 2016-08-24  Chris Dumez  <cdumez@apple.com>
2542
2543         Assertion hit: ASSERT(!m_parserScheduler) in ~HTMLDocumentParser()
2544         https://bugs.webkit.org/show_bug.cgi?id=161083
2545         <rdar://problem/27986937>
2546
2547         Reviewed by Darin Adler.
2548
2549         Call cancelParsing() right before re-creating the new parser in
2550         Document::implicitOpen(). We would previously call removeChildren()
2551         in between which is was an issue because it can cause JS to be
2552         executed and therefore the parser to be re-created after we have
2553         cancelled parsing.
2554
2555         No new tests, unskipped html/browsers/browsing-the-web/unloading-documents/004.html
2556         which was consistently crashing.
2557
2558         * dom/Document.cpp:
2559         (WebCore::Document::implicitOpen):
2560
2561 2016-08-24  Eric Carlson  <eric.carlson@apple.com>
2562
2563         [MediaStream] Add support for OverConstrained Error
2564         https://bugs.webkit.org/show_bug.cgi?id=160790
2565         <rdar://problem/27815715>
2566
2567         Reviewed by Jer Noble.
2568
2569         Existing tests updated.
2570
2571         * DerivedSources.make:
2572         * Modules/mediastream/OverconstrainedError.h: Added.
2573         (WebCore::OverconstrainedError::create):
2574         (WebCore::OverconstrainedError::constraint):
2575         (WebCore::OverconstrainedError::message):
2576         (WebCore::OverconstrainedError::OverconstrainedError):
2577         * Modules/mediastream/OverconstrainedError.idl: Added.
2578         * WebCore.xcodeproj/project.pbxproj:
2579
2580 2016-08-24  Anders Carlsson  <andersca@apple.com>
2581
2582         Build the platform name dynamically for the phony WebKitLegacy framework
2583         https://bugs.webkit.org/show_bug.cgi?id=161163
2584
2585         Reviewed by Dan Bernstein.
2586
2587         * Configurations/WebKitLegacyStub.iOS.tbd:
2588         * WebCore.xcodeproj/project.pbxproj:
2589
2590 2016-08-24  Chris Dumez  <cdumez@apple.com>
2591
2592         It should not be possible to access Location attributes cross origin
2593         https://bugs.webkit.org/show_bug.cgi?id=161125
2594         <rdar://problem/27982472>
2595
2596         Reviewed by Brent Fulgham.
2597
2598         It should not be possible to access Location attributes cross origin:
2599         - https://html.spec.whatwg.org/#crossoriginproperties-(-o-)
2600
2601         We allow access to replace() as per the specification and consistently
2602         with Firefox. The specification seems to indicate we should allow access
2603         to 'href' but Firefox does not and we previously did not so I am not
2604         allowing it in this patch.
2605
2606         Test: http/tests/security/location-cross-origin.html
2607
2608         * bindings/scripts/CodeGeneratorJS.pm:
2609         (GenerateImplementation):
2610         * page/Location.idl:
2611
2612 2016-08-24  Joseph Pecoraro  <pecoraro@apple.com>
2613
2614         Add User Timing to the feature status page
2615         https://bugs.webkit.org/show_bug.cgi?id=161154
2616
2617         Reviewed by Darin Adler.
2618
2619         * features.json:
2620
2621 2016-08-24  Andreas Kling  <akling@apple.com>
2622
2623         Leaks bot hits an assertion in ResourceUsageThread::platformThreadBody
2624         <https://webkit.org/b/160534>
2625
2626         Reviewed by Joseph Pecoraro.
2627
2628         Use the correct malloc bucket when bmalloc is disabled (which is the case on leaks bots.)
2629
2630         * page/cocoa/ResourceUsageThreadCocoa.mm:
2631         (WebCore::ResourceUsageThread::platformThreadBody):
2632
2633 2016-08-24  Filip Pizlo  <fpizlo@apple.com>
2634
2635         Unreviewed, roll out r204901, r204897, r204866, r204856, r204854.
2636
2637         * ForwardingHeaders/heap/HeapInlines.h: Removed.
2638         * ForwardingHeaders/interpreter/Interpreter.h: Added.
2639         * ForwardingHeaders/runtime/AuxiliaryBarrierInlines.h: Removed.
2640         * Modules/indexeddb/IDBCursorWithValue.cpp:
2641         * Modules/indexeddb/client/TransactionOperation.cpp:
2642         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
2643         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2644         * bindings/js/JSApplePayPaymentAuthorizedEventCustom.cpp:
2645         * bindings/js/JSApplePayPaymentMethodSelectedEventCustom.cpp:
2646         * bindings/js/JSApplePayShippingContactSelectedEventCustom.cpp:
2647         * bindings/js/JSApplePayShippingMethodSelectedEventCustom.cpp:
2648         * bindings/js/JSClientRectCustom.cpp:
2649         * bindings/js/JSDOMBinding.cpp:
2650         * bindings/js/JSDOMBinding.h:
2651         * bindings/js/JSDeviceMotionEventCustom.cpp:
2652         * bindings/js/JSDeviceOrientationEventCustom.cpp:
2653         * bindings/js/JSErrorEventCustom.cpp:
2654         * bindings/js/JSIDBCursorWithValueCustom.cpp:
2655         * bindings/js/JSIDBIndexCustom.cpp:
2656         * bindings/js/JSPopStateEventCustom.cpp:
2657         * bindings/js/JSWebGL2RenderingContextCustom.cpp:
2658         * bindings/js/JSWorkerGlobalScopeCustom.cpp:
2659         * bindings/js/WorkerScriptController.cpp:
2660         * contentextensions/ContentExtensionParser.cpp:
2661         * dom/ErrorEvent.cpp:
2662         * html/HTMLCanvasElement.cpp:
2663         * html/MediaDocument.cpp:
2664         * inspector/CommandLineAPIModule.cpp:
2665         * loader/EmptyClients.cpp:
2666         * page/CaptionUserPreferences.cpp:
2667         * page/Frame.cpp:
2668         * page/PageGroup.cpp:
2669         * page/UserContentController.cpp:
2670         * platform/mock/mediasource/MockBox.cpp:
2671         * testing/GCObservation.cpp:
2672
2673 2016-08-24  Zalan Bujtas  <zalan@apple.com>
2674
2675         ASSERTION FAILED: childrenInline() in WebCore::RenderBlockFlow::hasLines
2676         https://bugs.webkit.org/show_bug.cgi?id=139396
2677         <rdar://problem/27704339>
2678
2679         Reviewed by David Hyatt.
2680
2681         RenderBlockFlow::hasLines() should be able to handle the block-children case.
2682
2683         Test: fast/ruby/assert-with-block-rt-child-and-emphasis.html
2684
2685         * rendering/RenderBlock.h:
2686         (WebCore::RenderBlock::hasLines): Deleted.
2687         * rendering/RenderBlockFlow.cpp:
2688         (WebCore::RenderBlockFlow::hasLines):
2689         * rendering/RenderBlockFlow.h:
2690
2691 2016-08-24  Carlos Garcia Campos  <cgarcia@igalia.com>
2692
2693         Unreviewed. Fix GObject DOM bindings API break after r204624 and r204648.
2694
2695         prefix, namespaceURI and localName attributes were moved from Node to Attr/Element in r204624 and prefix was
2696         also made readonly in r204648.
2697
2698         * bindings/gobject/WebKitDOMDeprecated.cpp:
2699         (webkit_dom_node_get_namespace_uri):
2700         (webkit_dom_node_get_prefix):
2701         (webkit_dom_node_set_prefix):
2702         (webkit_dom_node_get_local_name):
2703         * bindings/gobject/WebKitDOMDeprecated.h:
2704         * bindings/gobject/WebKitDOMDeprecated.symbols:
2705         * bindings/gobject/webkitdom.symbols:
2706
2707 2016-08-23  Simon Fraser  <simon.fraser@apple.com>
2708
2709         Add some logging for WKSelectionDrawingInfo
2710         https://bugs.webkit.org/show_bug.cgi?id=161055
2711
2712         Reviewed by Tim Horton.
2713
2714         Add TextStream dumping for SelectionRect.
2715
2716         * platform/ios/SelectionRect.cpp:
2717         (WebCore::operator<<):
2718         * platform/ios/SelectionRect.h:
2719
2720 2016-08-23  Frederic Wang  <fwang@igalia.com>
2721
2722         More consistent header inclusions in the MathML module
2723         https://bugs.webkit.org/show_bug.cgi?id=161080
2724
2725         Reviewed by Darin Adler.
2726
2727         We adjust header inclusion in the MathML module so that:
2728         - implementation file's own header is outside the #if ENABLE(MATHML)
2729         - There is always a blank line after the #if ENABLE(MATHML)
2730
2731         No new tests, behavior is unchanged.
2732
2733         * mathml/MathMLAnnotationElement.cpp:
2734         * mathml/MathMLAnnotationElement.h:
2735         * mathml/MathMLElement.cpp:
2736         * mathml/MathMLFractionElement.cpp:
2737         * mathml/MathMLFractionElement.h:
2738         * mathml/MathMLMathElement.cpp:
2739         * mathml/MathMLMathElement.h:
2740         * mathml/MathMLMencloseElement.cpp:
2741         * mathml/MathMLMencloseElement.h:
2742         * mathml/MathMLOperatorDictionary.cpp:
2743         * mathml/MathMLOperatorElement.cpp:
2744         * mathml/MathMLOperatorElement.h:
2745         * mathml/MathMLPaddedElement.cpp:
2746         * mathml/MathMLPaddedElement.h:
2747         * mathml/MathMLPresentationElement.cpp:
2748         * mathml/MathMLPresentationElement.h:
2749         * mathml/MathMLRowElement.cpp:
2750         * mathml/MathMLRowElement.h:
2751         * mathml/MathMLScriptsElement.cpp:
2752         * mathml/MathMLScriptsElement.h:
2753         * mathml/MathMLSelectElement.h:
2754         * mathml/MathMLSpaceElement.cpp:
2755         * mathml/MathMLSpaceElement.h:
2756         * mathml/MathMLTokenElement.cpp:
2757         * mathml/MathMLUnderOverElement.cpp:
2758         * mathml/MathMLUnderOverElement.h:
2759         * rendering/mathml/MathMLStyle.cpp:
2760         * rendering/mathml/MathOperator.cpp:
2761         * rendering/mathml/MathOperator.h:
2762         * rendering/mathml/RenderMathMLBlock.cpp:
2763         * rendering/mathml/RenderMathMLFenced.cpp:
2764         * rendering/mathml/RenderMathMLFencedOperator.cpp:
2765         * rendering/mathml/RenderMathMLFraction.cpp:
2766         * rendering/mathml/RenderMathMLMath.cpp:
2767         * rendering/mathml/RenderMathMLMenclose.cpp:
2768         * rendering/mathml/RenderMathMLMenclose.h:
2769         * rendering/mathml/RenderMathMLOperator.cpp:
2770         * rendering/mathml/RenderMathMLRoot.cpp:
2771         * rendering/mathml/RenderMathMLRow.cpp:
2772         * rendering/mathml/RenderMathMLScripts.cpp:
2773         * rendering/mathml/RenderMathMLUnderOver.cpp:
2774
2775 2016-08-23  Zalan Bujtas  <zalan@apple.com>
2776
2777         ASSERTION FAILED: !view().layoutStateEnabled() || style().styleType() == FIRST_LETTER in WebCore::RenderInline::clippedOverflowRectForRepaint
2778         https://bugs.webkit.org/show_bug.cgi?id=155363
2779         <rdar://problem/27720434>
2780
2781         Reviewed by David Hyatt.
2782
2783         Loosen ASSERT to include calls when the inline has a self painting layer. It's valid to end up here during layout when
2784         the layer's composite state changes.
2785
2786         Test: fast/layers/assert-on-self-painting-inline-with-scrolling.html
2787
2788         * rendering/RenderInline.cpp:
2789         (WebCore::RenderInline::clippedOverflowRectForRepaint):
2790
2791 2016-08-23  Anders Carlsson  <andersca@apple.com>
2792
2793         Create a phony WebKitLegacy framework that the WebCoreTestSupport dylib can find
2794         https://bugs.webkit.org/show_bug.cgi?id=161123
2795
2796         Reviewed by Dan Bernstein.
2797
2798         * Configurations/WebCore.xcconfig:
2799         Use the WebKitLegacy.tbd file from the phony framework.
2800
2801         * Configurations/WebCoreTestSupport.xcconfig:
2802         Look for WebKitLegacy.framework in the phony framework path.
2803
2804         * WebCore.xcodeproj/project.pbxproj:
2805         Add a new phase that creates a phony WebKitLegacy framework.
2806
2807 2016-08-23  Chris Dumez  <cdumez@apple.com>
2808
2809         Add support for CanvasRenderingContext2D.resetTransform()
2810         https://bugs.webkit.org/show_bug.cgi?id=161089
2811
2812         Reviewed by Simon Fraser.
2813
2814         Add support for CanvasRenderingContext2D.resetTransform():
2815         - https://html.spec.whatwg.org/#dom-context-2d-resettransform
2816
2817         Firefox and Chrome already support this.
2818
2819         Tests:
2820         imported/blink/fast/canvas/canvas-resetTransform.html
2821         imported/w3c/web-platform-tests/2dcontext/transformations/canvas_transformations_reset_001.html
2822
2823         * html/canvas/CanvasRenderingContext2D.cpp:
2824         (WebCore::CanvasRenderingContext2D::setTransform):
2825         (WebCore::CanvasRenderingContext2D::resetTransform):
2826         * html/canvas/CanvasRenderingContext2D.h:
2827         * html/canvas/CanvasRenderingContext2D.idl:
2828
2829 2016-08-23  Said Abou-Hallawa  <sabouhallawa@apple.com>
2830
2831         REGRESSION: SVG clip-path doesn't work on root <svg>
2832         https://bugs.webkit.org/show_bug.cgi?id=129180
2833
2834         Reviewed by Tim Horton.
2835
2836         Build the resources cache for the RenderSVGRoot element when it's been
2837         inserted in the render tree. Remove the resources cache before removing
2838         the RenderSVGRoot from the render tree. No worries for the child <svg>
2839         elements since their renderers are of type RenderSVGViewportContainer.
2840
2841         Tests: svg/clip-path/clip-path-on-svg-003.svg
2842                svg/clip-path/clip-path-on-svg-004.svg
2843
2844         * rendering/svg/RenderSVGRoot.cpp:
2845         (WebCore::RenderSVGRoot::insertedIntoTree):
2846         (WebCore::RenderSVGRoot::willBeRemovedFromTree):
2847         * rendering/svg/RenderSVGRoot.h:
2848         These changes are very similar to what we do for adding and removing the
2849         child SVG elements in RenderSVGRoot::addChild() and removeChild().
2850
2851 2016-08-23  Chris Dumez  <cdumez@apple.com>
2852
2853         HTMLAreaElement should have a stringifier
2854         https://bugs.webkit.org/show_bug.cgi?id=161105
2855
2856         Reviewed by Geoffrey Garen.
2857
2858         HTMLAreaElement should have a stringifier:
2859         - https://html.spec.whatwg.org/multipage/embedded-content.html#htmlareaelement
2860         - https://html.spec.whatwg.org/multipage/semantics.html#htmlhyperlinkelementutils
2861         - http://heycam.github.io/webidl/#idl-stringifiers
2862         - http://heycam.github.io/webidl/#es-stringifier
2863
2864         Chrome and Firefox already support this.
2865
2866         This patch does the following:
2867         - Add support for stringifier on attributes to our bindings generator.
2868         - Add stringifier to the HTMLHyperlinkElementUtils.href attribute as
2869           per the specification
2870         - Drops the explicit toString on HTMLAnchorElement as HTMLAnchorElement
2871           implements HTMLHyperlinkElementUtils.
2872
2873         Test: fast/dom/toString_attributes.html
2874
2875         * bindings/scripts/CodeGeneratorJS.pm:
2876         (GenerateInterface):
2877         (AddStringifierOperationIfNeeded):
2878         * bindings/scripts/IDLParser.pm:
2879         (parseAttributeOrOperationOrIterator):
2880         * html/HTMLAnchorElement.cpp:
2881         (WebCore::HTMLAnchorElement::toString): Deleted.
2882         * html/HTMLAnchorElement.h:
2883         * html/HTMLAnchorElement.idl:
2884         * html/HTMLHyperlinkElementUtils.idl:
2885
2886 2016-08-23  Alex Christensen  <achristensen@webkit.org>
2887
2888         Fix clean Windows build.
2889
2890         * PlatformWin.cmake:
2891         Add another forwarding headers directory.
2892
2893 2016-08-23  Zalan Bujtas  <zalan@apple.com>
2894
2895         ASSERTION FAILED: hasOverflowingCell == this->hasOverflowingCell() in WebCore::RenderTableSection::computeOverflowFromCells
2896         https://bugs.webkit.org/show_bug.cgi?id=155702
2897         <rdar://problem/27720731>
2898
2899         Reviewed by David Hyatt.
2900
2901         The simplified layout path for table/section should also clear the slow path flag for visual overflow (since it recomputes
2902         the overflow for the descendant cells). 
2903
2904         Test: fast/table/assert-when-visual-overflow-is-cleared.html
2905
2906         * rendering/RenderTableSection.cpp:
2907         (WebCore::RenderTableSection::layout):
2908
2909 2016-08-23  Myles C. Maxfield  <mmaxfield@apple.com>
2910
2911         [Cocoa] Reduce uses of CGFonts
2912         https://bugs.webkit.org/show_bug.cgi?id=160896
2913
2914         Reviewed by Darin Adler.
2915
2916         There are a few places where we unnecessarily use CGFonts instead of
2917         CTFonts. We have had an ongoing effort throughout the past few years
2918         of elliminating all of our uses of CGFonts, and this patch moves us
2919         in that direction.
2920
2921         Most of the changes in this patch are straightforward (e.g.
2922         CGFontGetUnitsPerEm() -> CTFontGetUnitsPerEm()). However, there is
2923         one notable change: from CGContextShowGlyphsWithAdvances() to
2924         CTFontDrawGlyphs(). This migration does not cause a performance
2925         regression.
2926
2927         No new tests because there is no behavior change.
2928
2929         * WebCore.xcodeproj/project.pbxproj: Delete unnecessary
2930         FontServicesIOS files.
2931         * platform/graphics/FontMetrics.h:
2932         (WebCore::FontMetrics::xHeight): Migrate to Optional<float>
2933         (WebCore::FontMetrics::setXHeight):
2934         (WebCore::FontMetrics::hasXHeight):
2935         (WebCore::FontMetrics::hasCapHeight): Ditto.
2936         (WebCore::FontMetrics::floatCapHeight):
2937         (WebCore::FontMetrics::setCapHeight):
2938         (WebCore::FontMetrics::capHeight):
2939         (WebCore::FontMetrics::setZeroWidth): No one ever used the
2940         m_hasZeroWidth variable, so this patch removes it.
2941         (WebCore::FontMetrics::reset):
2942         (WebCore::FontMetrics::FontMetrics): Deleted.
2943         (WebCore::FontMetrics::setHasXHeight): Deleted. No one ever calls
2944         this, so this patch removes it.
2945         (WebCore::FontMetrics::hasZeroWidth): Deleted.
2946         (WebCore::FontMetrics::setHasZeroWidth): Deleted.
2947         * platform/graphics/cocoa/FontCascadeCocoa.mm:
2948         (WebCore::TextMatrixRestorer::TextMatrixRestorer): Rather than leaving
2949         the text matrix stale after using it, this class cleans it up after us.
2950         This means that the text matrix doesn't have to be reset in other places
2951         which draw text.
2952         (WebCore::TextMatrixRestorer::~TextMatrixRestorer):
2953         (WebCore::TextMatrixRestorer::savedMatrix):
2954         (WebCore::showGlyphsWithAdvances): Migrate from
2955         CGContextShowGlyphsWithAdvances() to CTFontDrawGlyphs()
2956         (WebCore::FontCascade::drawGlyphs): See above comment about the text
2957         matrix.
2958         (WebCore::RenderingStyleSaver::RenderingStyleSaver): Deleted.
2959         (WebCore::RenderingStyleSaver::~RenderingStyleSaver): Deleted.
2960         * platform/graphics/cocoa/FontCocoa.mm:
2961         (WebCore::shouldUseAdjustment): Taken from FontServicesIOS.
2962         (WebCore::Font::platformInit): Migrate from CG to CT for some direct
2963         replacement API calls.
2964         (WebCore::Font::platformCharWidthInit): Ditto.
2965         (WebCore::Font::determinePitch): Ditto.
2966         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
2967         (WebCore::FontPlatformData::openTypeTable): Ditto.
2968         (WebCore::FontPlatformData::description): Ditto.
2969         * platform/graphics/ios/FontServicesIOS.h: Removed. No longer needed
2970         after migrating from CGContextShowGlyphsWithAdvances() to
2971         CTFontDrawGlyphs().
2972         (WebCore::FontServicesIOS::ascent): Deleted.
2973         (WebCore::FontServicesIOS::descent): Deleted.
2974         (WebCore::FontServicesIOS::lineGap): Deleted.
2975         (WebCore::FontServicesIOS::lineSpacing): Deleted.
2976         (WebCore::FontServicesIOS::xHeight): Deleted.
2977         (WebCore::FontServicesIOS::capHeight): Deleted.
2978         (WebCore::FontServicesIOS::unitsPerEm): Deleted.
2979         * platform/graphics/ios/FontServicesIOS.mm: Removed. Moved into
2980         Font::platformInit().
2981         (WebCore::shouldUseAdjustment): Deleted.
2982         (WebCore::isCourier): Deleted.
2983         (WebCore::FontServicesIOS::FontServicesIOS): Deleted.
2984         * platform/graphics/opentype/OpenTypeCG.cpp:
2985         (WebCore::OpenType::tryGetTypoMetrics): Migrate from CG to CT for some
2986         direct replacement API calls.
2987         * platform/graphics/opentype/OpenTypeCG.h: Ditto.
2988         * platform/graphics/win/FontCGWin.cpp:
2989         (WebCore::FontCascade::drawGlyphs): Restore the text matrix.
2990         * platform/graphics/win/SimpleFontDataCGWin.cpp:
2991         (WebCore::Font::platformWidthForGlyph): Deleted.
2992         * platform/spi/cg/CoreGraphicsSPI.h:
2993         * platform/spi/cocoa/CoreTextSPI.h:
2994         * rendering/RenderThemeIOS.mm:
2995         (WebCore::paintAttachmentText): Deleted.
2996         * rendering/RenderThemeMac.mm:
2997         (WebCore::paintAttachmentTitle): Deleted.
2998         (WebCore::paintAttachmentSubtitle): Deleted.
2999
3000 2016-08-23  Alex Christensen  <achristensen@webkit.org>
3001
3002         Fix CMake build after r204852.
3003
3004         * CMakeLists.txt:
3005         There were some non-ASCII characters here causing problems.
3006
3007 2016-08-22  Filip Pizlo  <fpizlo@apple.com>
3008
3009         Butterflies should be allocated in Auxiliary MarkedSpace instead of CopiedSpace and we should rewrite as much of the GC as needed to make this not a regression
3010         https://bugs.webkit.org/show_bug.cgi?id=160125
3011
3012         Reviewed by Geoffrey Garen.
3013
3014         No new tests because no new WebCore behavior.
3015         
3016         Just rewiring #includes.
3017
3018         * ForwardingHeaders/heap/HeapInlines.h: Added.
3019         * ForwardingHeaders/runtime/AuxiliaryBarrierInlines.h: Added.
3020         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
3021         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
3022         * bindings/js/JSApplePayPaymentAuthorizedEventCustom.cpp:
3023         * bindings/js/JSApplePayPaymentMethodSelectedEventCustom.cpp:
3024         * bindings/js/JSApplePayShippingContactSelectedEventCustom.cpp:
3025         * bindings/js/JSApplePayShippingMethodSelectedEventCustom.cpp:
3026         * bindings/js/JSClientRectCustom.cpp:
3027         * bindings/js/JSDOMBinding.h:
3028         * bindings/js/JSDOMStringListCustom.cpp:
3029         * bindings/js/JSErrorEventCustom.cpp:
3030         * bindings/js/JSPopStateEventCustom.cpp:
3031         * bindings/js/JSWebGL2RenderingContextCustom.cpp:
3032         * contentextensions/ContentExtensionParser.cpp:
3033         * dom/ErrorEvent.cpp:
3034         * inspector/CommandLineAPIModule.cpp:
3035         * testing/GCObservation.cpp:
3036         (WebCore::GCObservation::GCObservation):
3037
3038 2016-08-23  Brady Eidson  <beidson@apple.com>
3039
3040         WK2 Gamepad layout test support.
3041         https://bugs.webkit.org/show_bug.cgi?id=134671
3042
3043         Reviewed by Alex Christensen.
3044
3045         No new tests (Covered by changes to existing tests).
3046
3047         Add a MockGamepadProvider and expose it in WebCoreTestSupport.
3048         
3049         * CMakeLists.txt:
3050         * WebCore.xcodeproj/project.pbxproj:
3051
3052         * Modules/gamepad/Gamepad.cpp:
3053         (WebCore::Gamepad::Gamepad):
3054
3055         * bindings/generic/RuntimeEnabledFeatures.cpp:
3056         (WebCore::RuntimeEnabledFeatures::reset): Deleted. Gamepads should either always be enabled during tests
3057           (As in Mac WK2), or never enabled (As in all other platforms).
3058         * bindings/generic/RuntimeEnabledFeatures.h:
3059
3060         * platform/gamepad/GamepadProvider.h:
3061         (WebCore::GamepadProvider::isMockGamepadProvider):
3062
3063         * testing/MockGamepad.cpp: Copied from Source/WebKit2/Shared/Gamepad/GamepadData.cpp.
3064         (WebCore::MockGamepad::MockGamepad):
3065         (WebCore::MockGamepad::updateDetails):
3066         (WebCore::MockGamepad::setAxisValue):
3067         (WebCore::MockGamepad::setButtonValue):
3068         * testing/MockGamepad.h: Copied from Source/WebKit2/UIProcess/Gamepad/UIGamepad.h.
3069
3070         * testing/MockGamepadProvider.cpp: Added.
3071         (WebCore::MockGamepadProvider::singleton):
3072         (WebCore::MockGamepadProvider::MockGamepadProvider):
3073         (WebCore::MockGamepadProvider::startMonitoringGamepads):
3074         (WebCore::MockGamepadProvider::stopMonitoringGamepads):
3075         (WebCore::MockGamepadProvider::setMockGamepadDetails):
3076         (WebCore::MockGamepadProvider::connectMockGamepad):
3077         (WebCore::MockGamepadProvider::disconnectMockGamepad):
3078         (WebCore::MockGamepadProvider::setMockGamepadAxisValue):
3079         (WebCore::MockGamepadProvider::setMockGamepadButtonValue):
3080         (WebCore::MockGamepadProvider::gamepadInputActivity):
3081
3082         * testing/MockGamepadProvider.h: Copied from Source/WebKit2/WebProcess/Gamepad/WebGamepadProvider.h.
3083         (WebCore::MockGamepadProvider::~MockGamepadProvider):
3084
3085         * testing/js/WebCoreTestSupport.cpp:
3086         (WebCoreTestSupport::installMockGamepadProvider):
3087         (WebCoreTestSupport::connectMockGamepad):
3088         (WebCoreTestSupport::disconnectMockGamepad):
3089         (WebCoreTestSupport::setMockGamepadDetails):
3090         (WebCoreTestSupport::setMockGamepadAxisValue):
3091         (WebCoreTestSupport::setMockGamepadButtonValue):
3092         * testing/js/WebCoreTestSupport.h:
3093
3094 2016-08-23  Dave Hyatt  <hyatt@apple.com>
3095
3096         Add pref for enabling new CSS parsing and move parser files into subdirectory.
3097         https://bugs.webkit.org/show_bug.cgi?id=161095
3098
3099         Reviewed by Sam Weinig.
3100
3101         * CMakeLists.txt:
3102         * WebCore.xcodeproj/project.pbxproj:
3103         * css/CSSParser.cpp: Removed.
3104         * css/CSSParser.h: Removed.
3105         * css/CSSParserMode.h: Removed.
3106         * css/CSSParserValues.cpp: Removed.
3107         * css/CSSParserValues.h: Removed.
3108         * css/SVGCSSParser.cpp: Removed.
3109         * css/parser: Added.
3110         * css/parser/CSSParser.cpp: Copied from css/CSSParser.cpp.
3111         * css/parser/CSSParser.h: Copied from css/CSSParser.h.
3112         * css/parser/CSSParserMode.h: Copied from css/CSSParserMode.h.
3113         * css/parser/CSSParserValues.cpp: Copied from css/CSSParserValues.cpp.
3114         * css/parser/CSSParserValues.h: Copied from css/CSSParserValues.h.
3115         * css/parser/SVGCSSParser.cpp: Copied from css/SVGCSSParser.cpp.
3116         * page/Settings.in:
3117
3118 2016-08-23  Eric Carlson  <eric.carlson@apple.com>
3119
3120         [MediaStream] Templatize MediaConstraint
3121         https://bugs.webkit.org/show_bug.cgi?id=161092
3122
3123         Reviewed by Jer Noble.
3124
3125         No new tests, no functional change.
3126
3127         * platform/mediastream/MediaConstraints.cpp:
3128         (WebCore::BooleanConstraint::getExact):
3129         (WebCore::BooleanConstraint::getIdeal):
3130         (WebCore::MediaConstraint::getMin): Deleted.
3131         (WebCore::MediaConstraint::getMax): Deleted.
3132         (WebCore::MediaConstraint::getExact): Deleted.
3133         (WebCore::MediaConstraint::getIdeal): Deleted.
3134         (WebCore::IntConstraint::create): Deleted.
3135         (WebCore::IntConstraint::setMin): Deleted.
3136         (WebCore::IntConstraint::setMax): Deleted.
3137         (WebCore::IntConstraint::setExact): Deleted.
3138         (WebCore::IntConstraint::setIdeal): Deleted.
3139         (WebCore::IntConstraint::getMin): Deleted.
3140         (WebCore::IntConstraint::getMax): Deleted.
3141         (WebCore::IntConstraint::getExact): Deleted.
3142         (WebCore::IntConstraint::getIdeal): Deleted.
3143         (WebCore::DoubleConstraint::create): Deleted.
3144         (WebCore::DoubleConstraint::setMin): Deleted.
3145         (WebCore::DoubleConstraint::setMax): Deleted.
3146         (WebCore::DoubleConstraint::setExact): Deleted.
3147         (WebCore::DoubleConstraint::setIdeal): Deleted.
3148         (WebCore::DoubleConstraint::getMin): Deleted.
3149         (WebCore::DoubleConstraint::getMax): Deleted.
3150         (WebCore::DoubleConstraint::getExact): Deleted.
3151         (WebCore::DoubleConstraint::getIdeal): Deleted.
3152         (WebCore::BooleanConstraint::create): Deleted.
3153         (WebCore::BooleanConstraint::setExact): Deleted.
3154         (WebCore::BooleanConstraint::setIdeal): Deleted.
3155         (WebCore::StringConstraint::create): Deleted.
3156         * platform/mediastream/MediaConstraints.h:
3157         (WebCore::MediaConstraint::getMin):
3158         (WebCore::MediaConstraint::getMax):
3159         (WebCore::MediaConstraint::getExact):
3160         (WebCore::MediaConstraint::getIdeal):
3161         (WebCore::NumericConstraint::setMin):
3162         (WebCore::NumericConstraint::setMax):
3163         (WebCore::NumericConstraint::setExact):
3164         (WebCore::NumericConstraint::setIdeal):
3165         (WebCore::NumericConstraint::setHasMin): Deleted.
3166         (WebCore::NumericConstraint::setHasMax): Deleted.
3167         (WebCore::NumericConstraint::setHasExact): Deleted.
3168         (WebCore::NumericConstraint::setHasIdeal): Deleted.
3169         (WebCore::NumericConstraint::hasMin): Deleted.
3170         (WebCore::NumericConstraint::hasMax): Deleted.
3171         (WebCore::NumericConstraint::hasExact): Deleted.
3172         (WebCore::NumericConstraint::hasIdeal): Deleted.
3173
3174 2016-08-23  Anders Carlsson  <andersca@apple.com>
3175
3176         Add a workaround for iOS Frameworks that expect DOM bindings to be in WebCore
3177         https://bugs.webkit.org/show_bug.cgi?id=161093
3178
3179         Reviewed by Dan Bernstein.
3180
3181         Create a text-based stub library that looks enough like WebKitLegacy that we can trick the linker
3182         into creating a LC_REEXPORT_DYLIB load command in WebCore.
3183
3184         * Configurations/WebCore.xcconfig:
3185         Link against this WebKitLegacyStub tbd file on iOS 9.0, 9.3 and 10.0.
3186
3187         * Configurations/WebKitLegacyStub.iOS.tbd:
3188         Add new tbd file.
3189
3190         * WebCore.xcodeproj/project.pbxproj:
3191         Add new files.
3192
3193 2016-08-23  Chris Dumez  <cdumez@apple.com>
3194
3195         CanvasRenderingContext2D should not have a CanvasRenderingContext parent interface
3196         https://bugs.webkit.org/show_bug.cgi?id=161054
3197
3198         Reviewed by Ryosuke Niwa.
3199
3200         CanvasRenderingContext2D should not have a CanvasRenderingContext parent interface
3201         as per:
3202         - https://html.spec.whatwg.org/multipage/scripting.html#canvasrenderingcontext2d
3203
3204         Firefox and Chrome agree with the specification.
3205
3206         No new tests, rebaselined existing test.
3207
3208         * CMakeLists.txt:
3209         * DerivedSources.cpp:
3210         * DerivedSources.make:
3211         * WebCore.xcodeproj/project.pbxproj:
3212         * bindings/js/JSBindingsAllInOne.cpp:
3213         * bindings/js/JSCanvasRenderingContext.h: Renamed from Source/WebCore/bindings/js/JSCanvasRenderingContextCustom.cpp.
3214         (WebCore::toJS):
3215         * bindings/js/JSCanvasRenderingContext2DCustom.cpp:
3216         (WebCore::JSCanvasRenderingContext2DOwner::isReachableFromOpaqueRoots):
3217         (WebCore::JSCanvasRenderingContext2D::visitAdditionalChildren):
3218         * bindings/js/JSDocumentCustom.cpp:
3219         (WebCore::JSDocument::getCSSCanvasContext):
3220         (WebCore::JSDocument::createTouchList): Deleted.
3221         * bindings/js/JSHTMLCanvasElementCustom.cpp:
3222         * bindings/scripts/CodeGeneratorJS.pm:
3223         (GenerateImplementation):
3224         * dom/Document.idl:
3225         * html/canvas/CanvasRenderingContext.idl: Removed.
3226         * html/canvas/CanvasRenderingContext2D.idl:
3227         * html/canvas/WebGL2RenderingContext.idl:
3228         * html/canvas/WebGLRenderingContext.idl:
3229         * html/canvas/WebGLRenderingContextBase.idl:
3230
3231 2016-08-03  Frederic Wang  <fwang@igalia.com>
3232
3233         Share and improve extraction of character for operator and token elements
3234         https://bugs.webkit.org/show_bug.cgi?id=160462
3235
3236         Reviewed by Darin Adler.
3237
3238         No new tests, already covered by existing tests.
3239
3240         * mathml/MathMLElement.cpp:
3241         (WebCore::MathMLElement::stripLeadingAndTrailingWhitespace): Make this a protected member of
3242         MathMLElement so that it can be used in MathMLTokenElement.
3243         (WebCore::skipLeadingAndTrailingWhitespace): Deleted.
3244         * mathml/MathMLElement.h: Declare stripLeadingAndTrailingWhitespace.
3245         * mathml/MathMLOperatorElement.cpp:
3246         (WebCore::MathMLOperatorElement::parseOperatorChar): Use convertToSingleCodePoint to extract
3247         a code point more efficiently. For now, we continue to only handle BMP characters.
3248         * mathml/MathMLTokenElement.cpp:
3249         (WebCore::MathMLTokenElement::convertToSingleCodePoint): Helper function to try and convert a
3250         string to a single code point after having removed leading and trailing space.
3251         * mathml/MathMLTokenElement.h: Declare convertToSingleCodePoint.
3252         * rendering/mathml/RenderMathMLToken.cpp:
3253         (WebCore::RenderMathMLToken::updateMathVariantGlyph): Use convertToSingleCodePoint to extract
3254         a code point more efficiently.
3255
3256 2016-08-23  Frederic Wang  <fwang@igalia.com>
3257
3258         Rename MathMLInlineContainerElement to MathMLPresentationElement
3259         https://bugs.webkit.org/show_bug.cgi?id=161053
3260
3261         Reviewed by Manuel Rego Casasnovas.
3262
3263         MathMLInlineContainerElement sounds a bad name for something that is now going to produce
3264         RenderMathMLBlocks. MathML has two kinds of markup (presentation MathML and content MathML).
3265         We only implement presentation MathML and most of the MathML elements are currently
3266         implemented as MathMLInlineContainerElement. Hence we rename MathMLInlineContainerElement
3267         to MathMLPresentationElement and will move more code from MathMLElement into that new class
3268         in follow-up bugs. Also, other elements in the MathML namespace could be handled by a
3269         separate MathMLUnknownElement class for consistency with SVG and HTML classes.
3270
3271         No new tests, behavior is unchanged.
3272
3273         * CMakeLists.txt: Rename MathMLInlineContainerElement to MathMLPresentationElement.
3274         * WebCore.xcodeproj/project.pbxproj: Ditto.
3275         * mathml/MathMLAllInOne.cpp: Ditto.
3276         * mathml/MathMLFractionElement.cpp: Ditto.
3277         * mathml/MathMLFractionElement.h: Ditto.
3278         * mathml/MathMLPresentationElement.cpp: Ditto.
3279         * mathml/MathMLPresentationElement.h: Ditto.
3280         * mathml/MathMLRowElement.cpp: Ditto.
3281         * mathml/MathMLRowElement.h: Ditto.
3282         * mathml/MathMLScriptsElement.cpp: Ditto.
3283         * mathml/MathMLScriptsElement.h: Ditto.
3284         * mathml/mathtags.in: Ditto.
3285         * rendering/mathml/RenderMathMLFraction.h: Remove useless include.
3286
3287 2016-08-23  Youenn Fablet  <youenn@apple.com>
3288
3289         Implement redirect support post CORS-preflight
3290         https://bugs.webkit.org/show_bug.cgi?id=159056
3291
3292         Reviewed by Alex Christensen.
3293
3294         Tests: imported/w3c/web-platform-tests/fetch/api/cors/cors-redirect-preflight-worker.html
3295                imported/w3c/web-platform-tests/fetch/api/cors/cors-redirect-preflight.html
3296         Covered also by rebased tests.
3297
3298         Enabling to follow cross-origin redirections for not-simple requests, through preflight checks.
3299         Making sure that same-origin redirections to cross-origin resources use preflight if they are not simple.
3300
3301         * loader/DocumentThreadableLoader.cpp:
3302         (WebCore::DocumentThreadableLoader::redirectReceived):
3303
3304 2016-08-23  Frederic Wang  <fred.wang@free.fr>
3305
3306         Introduce a MathMLRowElement class for mrow-like elements
3307         https://bugs.webkit.org/show_bug.cgi?id=161050
3308
3309         Reviewed by Darin Adler.
3310
3311         We introduce a MathMLRowElement class for elements creating RenderMathMLRow renderers.
3312         We also force constructors of the corresponding renderer classes to accept MathMLRowElement.
3313         It's not clear whether semantics-xml really needs to create RenderMathMLRow but for now
3314         we make MathMLAnnotationElement inherits from MathMLRowElement to preserve that behavior.
3315
3316         No new tests, behavior is unchanged.
3317
3318         * CMakeLists.txt: Add MathMLRowElement files.
3319         * WebCore.xcodeproj/project.pbxproj: Ditto.
3320         * mathml/MathMLAllInOne.cpp: Ditto.
3321         * mathml/MathMLInlineContainerElement.cpp: Remove unused headers.
3322         (WebCore::MathMLInlineContainerElement::createElementRenderer): Handle some mrow-like
3323         elements in the MathMLRowElement class.
3324         (WebCore::MathMLInlineContainerElement::acceptsDisplayStyleAttribute): Ditto.
3325         (WebCore::MathMLInlineContainerElement::childrenChanged): Deleted. We only need to calculate
3326         the form for operators inside a MathMLRowElement.
3327         (WebCore::MathMLInlineContainerElement::acceptsMathVariantAttribute): Deleted. mstyle is
3328         handled in the MathMLRowElement class.
3329         * mathml/MathMLInlineContainerElement.h: Update function declarations.
3330         * mathml/MathMLMathElement.cpp: Make this class inherits from MathMLRowElement.
3331         * mathml/MathMLMathElement.h: Ditto.
3332         * mathml/MathMLPaddedElement.cpp: Ditto.
3333         * mathml/MathMLPaddedElement.h: Ditto.
3334         * mathml/MathMLSelectElement.cpp: Ditto.
3335         * mathml/MathMLSelectElement.h: Ditto.
3336         * mathml/MathMLAnnotationElement.cpp: Ditto.
3337         * mathml/MathMLAnnotationElement.h: Ditto.
3338         * mathml/MathMLRowElement.cpp: New class for mrow-like element.
3339         (WebCore::MathMLRowElement::MathMLRowElement):
3340         (WebCore::MathMLRowElement::create):
3341         (WebCore::MathMLRowElement::childrenChanged): Move code from MathMLInlineContainerElement.
3342         (WebCore::MathMLRowElement::createElementRenderer): Ditto.
3343         (WebCore::MathMLRowElement::acceptsDisplayStyleAttribute): Ditto.
3344         (WebCore::MathMLRowElement::acceptsMathVariantAttribute): Ditto.
3345         * mathml/MathMLRowElement.h:
3346         * mathml/mathtags.in: Map tags creating RenderMathMLRow renderers to MathMLRowElement.
3347         * rendering/mathml/RenderMathMLFenced.cpp: Force the constructor to take MathMLRowElement.
3348         * rendering/mathml/RenderMathMLFenced.h: Ditto.
3349         * rendering/mathml/RenderMathMLMath.cpp: Ditto.
3350         * rendering/mathml/RenderMathMLMath.h: Ditto.
3351         * rendering/mathml/RenderMathMLMenclose.cpp: Force the constructor to take MathMLMencloseElement.
3352         * rendering/mathml/RenderMathMLMenclose.h: Ditto.
3353         * rendering/mathml/RenderMathMLRoot.cpp: Force the constructor to take MathMLRowElement.
3354         * rendering/mathml/RenderMathMLRoot.h: Ditto.
3355         * rendering/mathml/RenderMathMLRow.cpp: Ditto and add an helper function element() to
3356         retrieve the MathMLRowElement.
3357         * rendering/mathml/RenderMathMLRow.h: Ditto.
3358
3359 2016-08-22  Chris Dumez  <cdumez@apple.com>
3360
3361         Drop TextTrackCue's constructor as per the latest specification
3362         https://bugs.webkit.org/show_bug.cgi?id=161061
3363
3364         Reviewed by Alex Christensen.
3365
3366         Drop TextTrackCue's constructor as per the latest specification:
3367         - https://html.spec.whatwg.org/#texttrackcue
3368
3369         Firefox and Chrome do not have this constructor. Web Authors
3370         are supposed to use the VTTCue constructor instead.
3371
3372         No new tests, rebaselined existing tests.
3373
3374         * html/track/TextTrackCue.cpp:
3375         (WebCore::TextTrackCue::TextTrackCue): Deleted.
3376         * html/track/TextTrackCue.h:
3377         (WebCore::TextTrackCue::cueShadowPseudoId): Deleted.
3378         * html/track/TextTrackCue.idl:
3379
3380 2016-08-22  Chris Dumez  <cdumez@apple.com>
3381
3382         Unreviewed, rolling out r204745.
3383
3384         Broke the Windows build
3385
3386         Reverted changeset:
3387
3388         "CanvasRenderingContext2D should not have a
3389         CanvasRenderingContext parent interface"
3390         https://bugs.webkit.org/show_bug.cgi?id=161054
3391         http://trac.webkit.org/changeset/204745
3392
3393 2016-08-22  Chris Dumez  <cdumez@apple.com>
3394
3395         CanvasRenderingContext2D should not have a CanvasRenderingContext parent interface
3396         https://bugs.webkit.org/show_bug.cgi?id=161054
3397
3398         Reviewed by Ryosuke Niwa.
3399
3400         CanvasRenderingContext2D should not have a CanvasRenderingContext parent interface
3401         as per:
3402         - https://html.spec.whatwg.org/multipage/scripting.html#canvasrenderingcontext2d
3403
3404         Firefox and Chrome agree with the specification.
3405
3406         No new tests, rebaselined existing test.
3407
3408         * CMakeLists.txt:
3409         * DerivedSources.cpp:
3410         * DerivedSources.make:
3411         * WebCore.xcodeproj/project.pbxproj:
3412         * bindings/js/JSBindingsAllInOne.cpp:
3413         * bindings/js/JSCanvasRenderingContext.h: Renamed from Source/WebCore/bindings/js/JSCanvasRenderingContextCustom.cpp.
3414         (WebCore::toJS):
3415         * bindings/js/JSCanvasRenderingContext2DCustom.cpp:
3416         (WebCore::JSCanvasRenderingContext2DOwner::isReachableFromOpaqueRoots):
3417         (WebCore::JSCanvasRenderingContext2D::visitAdditionalChildren):
3418         * bindings/js/JSDocumentCustom.cpp:
3419         (WebCore::JSDocument::getCSSCanvasContext):
3420         (WebCore::JSDocument::createTouchList): Deleted.
3421         * bindings/js/JSHTMLCanvasElementCustom.cpp:
3422         * bindings/scripts/CodeGeneratorJS.pm:
3423         (GenerateImplementation):
3424         * dom/Document.idl:
3425         * html/canvas/CanvasRenderingContext.idl: Removed.
3426         * html/canvas/CanvasRenderingContext2D.idl:
3427         * html/canvas/WebGL2RenderingContext.idl:
3428         * html/canvas/WebGLRenderingContext.idl:
3429         * html/canvas/WebGLRenderingContextBase.idl:
3430
3431 2016-08-22  Johan K. Jensen  <johan_jensen@apple.com>
3432
3433         Make NetworkLoadTiming use double for higher precision in Resource Timing
3434         https://bugs.webkit.org/show_bug.cgi?id=161051
3435
3436         Reviewed by Alex Christensen.
3437
3438         Test: http/tests/misc/resource-timing-resolution.html
3439
3440         * page/Performance.h:
3441         * page/Performance.cpp:
3442         (WebCore::Performance::now):
3443         (WebCore::Performance::reduceTimeResolution):
3444         Add new function to reduce time resolution.
3445
3446         * page/PerformanceResourceTiming.cpp:
3447         (WebCore::monotonicTimeToDocumentMilliseconds):
3448         (WebCore::PerformanceResourceTiming::resourceTimeToDocumentMilliseconds):
3449         Only use the reduced timing resolution for full timestamps and deltas.
3450
3451         (WebCore::PerformanceResourceTiming::connectStart): Use doubles.
3452         * page/PerformanceResourceTiming.h: Use doubles.
3453         * page/PerformanceTiming.cpp: Use doubles.
3454         (WebCore::toIntegerMilliseconds): Use doubles.
3455         (WebCore::PerformanceTiming::connectStart): Use doubles.
3456         (WebCore::PerformanceTiming::resourceLoadTimeRelativeToFetchStart): Use doubles.
3457         * page/PerformanceTiming.h: Use doubles.
3458         * platform/network/NetworkLoadTiming.h: Use doubles.
3459         * platform/network/curl/ResourceHandleManager.cpp: Use doubles.
3460         (WebCore::milisecondsSinceRequest): Use doubles.
3461         (WebCore::calculateWebTimingInformations): Use doubles.
3462         * platform/network/soup/ResourceHandleSoup.cpp: Use doubles.
3463         (WebCore::milisecondsSinceRequest): Use doubles.
3464         (WebCore::networkEventCallback): Use doubles.
3465
3466 2016-08-22  Alex Christensen  <achristensen@webkit.org>
3467
3468         Fix Mac CMake build after r204717.
3469
3470         * PlatformMac.cmake:
3471
3472 2016-08-22  Javier Fernandez  <jfernandez@igalia.com>
3473
3474         [css-grid] Stretch alignment doesn't work for orthogonal flows
3475         https://bugs.webkit.org/show_bug.cgi?id=160076
3476
3477         Reviewed by Darin Adler.
3478
3479         After implementing orthogonal flow support for track sizing and basic
3480         alignment logic, we can now implement stretching logic in orthogonal
3481         scenarios, which was not allowed so far.
3482
3483         Thanks to the recent changes which made the grid layout code more
3484         independent to the grid container's and its children's flow, the
3485         implementation of the stretching logic can be done in a clearer way.
3486
3487         This patch implements the missing logic and performs some refactoring
3488         so it became flow direction independent.
3489
3490         Test: fast/css-grid-layout/grid-align-justify-stretch-with-orthogonal-flows.html
3491
3492         * rendering/RenderGrid.cpp:
3493         (WebCore::RenderGrid::applyStretchAlignmentToChildIfNeeded):
3494
3495
3496 2016-08-19  Brent Fulgham  <bfulgham@apple.com>
3497
3498         Invalid resource load statistics iterator when redirecting
3499         https://bugs.webkit.org/show_bug.cgi?id=161021
3500         <rdar://problem/27856875>
3501
3502         Reviewed by Dean Jackson.
3503
3504         If a load is the result of a redirect, an additional entry is added to the HashSet
3505         containing the visited domains. This invalidates any existing iterators, so we
3506         need to get a new iterator for further updates.
3507
3508         No change in functionality.
3509
3510         * loader/ResourceLoadObserver.cpp:
3511         (WebCore::ResourceLoadObserver::logSubresourceLoading):
3512
3513 2016-08-22  Ryosuke Niwa  <rniwa@webkit.org>
3514
3515         Rename CustomElementsRegistry to CustomElementRegistry
3516         https://bugs.webkit.org/show_bug.cgi?id=161028
3517
3518         Reviewed by Darin Adler.
3519
3520         Renamed CustomElementsRegistry to CustomElementRegistry per https://github.com/w3c/webcomponents/issues/548.
3521
3522         Also hide window.customElements and CustomElementRegistry interface behind a runtime enabled.
3523
3524         * CMakeLists.txt:
3525         * DerivedSources.cpp:
3526         * DerivedSources.make:
3527         * WebCore.xcodeproj/project.pbxproj:
3528         * bindings/js/JSCustomElementRegistryCustom.cpp: Renamed from JSCustomElementsRegistryCustom.cpp.
3529         (WebCore::getCustomElementCallback):
3530         (WebCore::JSCustomElementRegistry::define):
3531         * bindings/js/JSHTMLElementCustom.cpp:
3532         (WebCore::constructJSHTMLElement):
3533         * dom/CustomElementReactionQueue.cpp:
3534         (WebCore::findInterfaceForCustomElement):
3535         * dom/CustomElementRegistry.cpp: Renamed from CustomElementsRegistry.cpp.
3536         (WebCore::CustomElementRegistry::create):
3537         (WebCore::CustomElementRegistry::CustomElementRegistry):
3538         (WebCore::CustomElementRegistry::~CustomElementRegistry):
3539         (WebCore::CustomElementRegistry::addElementDefinition):
3540         (WebCore::CustomElementRegistry::addUpgradeCandidate):
3541         (WebCore::CustomElementRegistry::findInterface):
3542         (WebCore::CustomElementRegistry::containsConstructor):
3543         * dom/CustomElementRegistry.h: Renamed from CustomElementsRegistry.h.
3544         * dom/CustomElementRegistry.idl: Renamed from CustomElementsRegistry.idl.
3545         * dom/Document.cpp:
3546         (WebCore::createUpgradeCandidateElement):
3547         (WebCore::createHTMLElementWithNameValidation):
3548         (WebCore::createFallbackHTMLElement):
3549         * dom/Element.cpp:
3550         * html/parser/HTMLConstructionSite.cpp:
3551         (WebCore::HTMLConstructionSite::createHTMLElementOrFindCustomElementInterface):
3552         * page/DOMWindow.cpp:
3553         (WebCore::DOMWindow::ensureCustomElementRegistry):
3554         * page/DOMWindow.h:
3555         * page/DOMWindow.idl:
3556
3557 2016-08-22  Chris Dumez  <cdumez@apple.com>
3558
3559         Add support for GlobalEventHandlers.oncuechange attribute
3560         https://bugs.webkit.org/show_bug.cgi?id=161046
3561
3562         Reviewed by Alex Christensen.
3563
3564         Add support for GlobalEventHandlers.oncuechange attribute:
3565         - https://html.spec.whatwg.org/#handler-oncuechange
3566
3567         Test: fast/media/window-oncuechange.html
3568
3569         * dom/GlobalEventHandlers.idl:
3570
3571 2016-08-22  Alex Christensen  <achristensen@webkit.org>
3572
3573         Fix bindings tests after r204717.
3574
3575         * bindings/scripts/CodeGeneratorJS.pm:
3576         (GenerateHeader):
3577         There was an extra space.
3578
3579 2016-08-22  Alex Christensen  <achristensen@webkit.org>
3580
3581         Mostly fix Mac CMake build after r204717.
3582
3583         * PlatformMac.cmake:
3584
3585 2016-08-22  Antti Koivisto  <antti@apple.com>
3586
3587         Can't style descendants in shadow tree using the :host pseudo class
3588         https://bugs.webkit.org/show_bug.cgi?id=160754
3589
3590         Reviewed by Darin Adler.
3591
3592         "The :host pseudo-class, when evaluated in the context of a shadow tree, matches the shadow tree’s shadow host."
3593
3594         Currently :host() works for styling the host element itself (:host(.foo) { ... }). It should also be usable
3595         for styling elements in the shadow tree:
3596
3597             :host(.foo) div { ... }
3598
3599         Test: fast/shadow-dom/css-scoping-host-descendant.html
3600
3601         * css/SelectorChecker.cpp:
3602         (WebCore::SelectorChecker::matchHostPseudoClass):
3603         (WebCore::localContextForParent):
3604
3605             Move to shadow host if we are matching :host and are at the root of the shadow tree.
3606             Set didMoveToShadowHost bit in the context.
3607
3608         (WebCore::SelectorChecker::matchRecursively):
3609         (WebCore::SelectorChecker::checkOne):
3610
3611             Call the existing matchHostPseudoClass to do :host matching if didMoveToShadowHost bit has been set.
3612
3613         * cssjit/SelectorCompiler.cpp:
3614         (WebCore::SelectorCompiler::addPseudoClassType):
3615
3616             Disallow :host in the compiler (cases where it would match didn't reach the compiler before).
3617
3618 2016-08-22  Frederic Wang  <fwang@igalia.com>
3619
3620         Use memoize pattern for the menclose notation attribute
3621         https://bugs.webkit.org/show_bug.cgi?id=160461
3622
3623         Reviewed by Darin Adler.
3624
3625         Currently, MathMLMencloseElement::parseAttribute parse the "notation" attribute each time it
3626         is changed. We change this to use the memoize pattern as done for other MathML attributes:
3627         We store m_notationFlags in an Optional<uint16_t> where Optnull means that the
3628         attribute is dirty and must be parsed again.
3629
3630         No new tests, already covered by existing tests.
3631
3632         * mathml/MathMLMencloseElement.cpp:
3633         (WebCore::MathMLMencloseElement::parseNotationAttribute): Move parsing of the "notation"
3634         attribute from parseAttribute into this separate helper function.
3635         (WebCore::MathMLMencloseElement::hasNotation): This now check whether the attribute and
3636         dirty and parse it if necessary.
3637         (WebCore::MathMLMencloseElement::parseAttribute): Just make the attribute dirty rather than
3638         parsing it immediately.
3639         * mathml/MathMLMencloseElement.h: hasNotation is no longer const as it may update the
3640         m_notationsFlags. We declare parseNotationAttribute(). Finally, we wrap m_notationFlags
3641         in an Optional<uint16_t> and make addNotation extract the value.
3642
3643 2016-08-22  Daniel Bates  <dabates@apple.com>
3644
3645         [iOS] <a ping> and <area ping> tests time out
3646         https://bugs.webkit.org/show_bug.cgi?id=156857
3647
3648         Reviewed by Simon Fraser.
3649
3650         Export HTMLAreaElement::imageElement() so that we can make use of it in WebKit2.
3651
3652         * html/HTMLAreaElement.h:
3653
3654 2016-08-22  Darin Adler  <darin@apple.com>
3655
3656         [Cocoa] Move Objective-C DOM bindings from WebCore to legacy WebKit
3657         https://bugs.webkit.org/show_bug.cgi?id=160654
3658
3659         Reviewed by Alex Christensen.
3660
3661         * DerivedSources.cpp: Removed ExceptionCodeDescription.h from the list here.
3662         It will be included by the .cpp files as appropriate and should not be included
3663         without including config.h first.
3664
3665         * WebCore.xcodeproj/project.pbxproj: Removed the Objective-C DOM source files.
3666         Added private exports of various headers that are now used directly or indirectly
3667         by legacy WebKit to implement the bindings. Moved WebScriptObject.* files from
3668         bindings/objc to bridge/objc. Moved WebKitAvailability.h into platform/cocoa; it
3669         can be moved to WebKit of we move the Objective-C bridge there too. Also ran
3670         sort-Xcode-project-file.
3671
3672         * bindings/js/JSDOMBinding.cpp:
3673         (WebCore::valueToUSVString): Fixed a comment typo.
3674
3675         * bindings/js/JSDOMWindowShell.cpp:
3676         (WebCore::JSDOMWindowShell::toWrapped): Added.
3677         * bindings/js/JSDOMWindowShell.h: Added a toWrapped function for use by the
3678         Objective-C bindings.
3679
3680         * bindings/js/JSMainThreadExecState.h: Exported symbols needed by the Objective-C bindings.
3681         * bindings/js/JSNamedNodeMapCustom.cpp: Updated includes since NamedNodeMap.h no longer
3682         includes Attr.h.
3683
3684         * bindings/js/ScriptController.h: Exported symbols needed by the Objective-C bindings.
3685
3686         * bindings/js/ScriptControllerMac.mm:
3687         (WebCore::ScriptController::windowScriptObject): Removed code that asserted the type of the
3688         object; this assertion can't be done in WebCore any more and is not critical to keep.
3689         (WebCore::ScriptController::disconnectPlatformScriptObjects): Use the new
3690         disconnectWindowWrapper function to call up to the Objective-C bindings code in WebKit.
3691
3692         * bindings/objc/*: Moved all these files to WebKit/mac/DOM, except for a few that were moved
3693         to bridge/objc.
3694
3695         * bindings/scripts/CodeGeneratorJS.pm:
3696         (GenerateHeader): Added support for the new ExportToWrappedFunction attribute so
3697         classes that need to can export what is needed by WebKit.
3698
3699         * bindings/scripts/IDLAttributes.txt: Added ExportToWrappedFunction.
3700
3701         * bridge/objc/WebScriptObject.h: Moved from bindings/objc.
3702         * bridge/objc/WebScriptObject.mm: Moved from bindings/objc.
3703         (WebCore::initializeDOMWrapperHooks): Added. Used by WebKit to add the hooks needed so that
3704         WebScriptObject can integrate with the DOM bindings.
3705         (WebCore::disconnectWindowWrapper): Added.
3706         (+[WebScriptObject scriptObjectForJSObject:originRootObject:rootObject:]): Added code that
3707         uses createDOMWrapperFunction to set up wrappers that are found or created by WebKit.
3708         * bridge/objc/WebScriptObjectPrivate.h: Moved from bindings/objc.
3709
3710         * css/CSSFontFaceRule.h: Exported symbols needed by the Objective-C bindings.
3711         * css/CSSGroupingRule.h: Ditto.
3712         * css/CSSImportRule.h: Ditto.
3713         * css/CSSMediaRule.h: Ditto.
3714         * css/CSSPageRule.h: Ditto.
3715         * css/CSSPrimitiveValue.h: Ditto.
3716         * css/CSSRule.h: Ditto.
3717         * css/CSSRule.idl: Ditto.
3718         * css/CSSRuleList.idl: Ditto.
3719         * css/CSSStyleRule.h: Ditto.
3720         * css/CSSStyleSheet.h: Ditto.
3721         * css/CSSValue.h: Ditto.
3722         * css/CSSValue.idl: Ditto.
3723         * css/Counter.idl: Ditto.
3724         * css/MediaList.h: Ditto.
3725         * css/MediaList.idl: Ditto.
3726         * css/MediaQueryEvaluator.h: Ditto.
3727         * css/RGBColor.h: Ditto.
3728         * css/RGBColor.idl: Ditto.
3729         * css/Rect.idl: Ditto.
3730         * css/StyleSheet.idl: Ditto.
3731         * css/StyleSheetList.h: Ditto.
3732         * css/StyleSheetList.idl: Ditto.
3733         * dom/Attr.h: Ditto.
3734         * dom/CharacterData.h: Ditto.
3735         * dom/CollectionIndexCache.h: Ditto.
3736         * dom/ContainerNode.h: Ditto.
3737         * dom/DOMImplementation.cpp: Ditto.
3738         * dom/DOMImplementation.h: Ditto.
3739         * dom/DOMImplementation.idl: Ditto.
3740         * dom/Document.h: Ditto.
3741         * dom/DocumentFragment.h: Ditto.
3742         * dom/Element.h: Ditto.
3743         * dom/Event.h: Ditto.
3744         * dom/Event.idl: Ditto.
3745         * dom/EventTarget.h: Ditto.
3746         * dom/KeyboardEvent.h: Ditto.
3747         * dom/LifecycleCallbackQueue.h: Ditto.
3748         * dom/MouseEvent.h: Ditto.
3749         * dom/MouseRelatedEvent.h: Ditto.
3750         * dom/MutationEvent.h: Ditto.
3751         * dom/NamedNodeMap.h: Ditto.
3752         * dom/NamedNodeMap.idl: Ditto.
3753         * dom/NativeNodeFilter.h: Ditto.
3754         * dom/Node.h: Ditto.
3755         * dom/NodeIterator.h: Ditto.
3756         * dom/NodeIterator.idl: Ditto.
3757         * dom/NodeList.idl: Ditto.
3758         * dom/NodeTraversal.h: Ditto.
3759         * dom/OverflowEvent.h: Ditto.
3760         * dom/QualifiedName.h: Ditto.
3761         * dom/Range.h: Ditto.
3762         * dom/ScriptElement.h: Ditto.
3763         * dom/Text.h: Ditto.
3764         * dom/TextEvent.h: Ditto.
3765         * dom/TreeScope.h: Ditto.
3766         * dom/TreeWalker.h: Ditto.
3767         * dom/TreeWalker.idl: Ditto.
3768         * dom/UIEvent.h: Ditto.
3769         * dom/WheelEvent.h: Ditto.
3770         * dom/make_dom_exceptions.pl: Ditto.
3771         * editing/EditingStyle.h: Ditto.
3772         * editing/FrameSelection.h: Ditto.
3773
3774         * editing/ios/EditorIOS.mm: Removed unneeded include of Objective-C DOM header.
3775         * editing/mac/EditorMac.mm: Ditto.
3776
3777         * fileapi/Blob.h: Exported symbols needed by the Objective-C bindings.
3778         * fileapi/File.h: Ditto.
3779         * fileapi/FileList.h: Ditto.
3780         * html/DOMTokenList.h: Ditto.
3781         * html/HTMLAnchorElement.h: Ditto.
3782         * html/HTMLAreaElement.h: Ditto.
3783         * html/HTMLBaseElement.h: Ditto.
3784         * html/HTMLButtonElement.h: Ditto.
3785         * html/HTMLCanvasElement.h: Ditto.
3786         * html/HTMLCollection.h: Ditto.
3787         * html/HTMLCollection.idl: Ditto.
3788         * html/HTMLDocument.h: Ditto.
3789         * html/HTMLElement.h: Ditto.
3790         * html/HTMLFormControlElement.h: Ditto.
3791         * html/HTMLFormElement.h: Ditto.
3792         * html/HTMLFrameElementBase.h: Ditto.
3793         * html/HTMLFrameOwnerElement.h: Ditto.
3794         * html/HTMLImageElement.h: Ditto.
3795         * html/HTMLInputElement.h: Ditto.
3796
3797         * html/HTMLLabelElement.cpp:
3798         (WebCore::HTMLLabelElement::setActive): Tweaked types a bit.
3799         (WebCore::HTMLLabelElement::setHovered): Ditto.
3800         (WebCore::HTMLLabelElement::defaultEventHandler): Ditto.
3801         (WebCore::HTMLLabelElement::willRespondToMouseClickEvents): Ditto.
3802         (WebCore::HTMLLabelElement::focus): Ditto.
3803         (WebCore::HTMLLabelElement::accessKeyAction): Ditto.
3804
3805         * html/HTMLLabelElement.h: Exported symbols needed by the Objective-C bindings.
3806         * html/HTMLLinkElement.h: Ditto.
3807         * html/HTMLMapElement.h: Ditto.
3808         * html/HTMLMarqueeElement.h: Ditto.
3809         * html/HTMLMediaElement.h: Ditto.
3810         * html/HTMLOListElement.h: Ditto.
3811         * html/HTMLOptionElement.h: Ditto.
3812         * html/HTMLOptionsCollection.h: Ditto.
3813         * html/HTMLOptionsCollection.idl: Ditto.
3814         * html/HTMLScriptElement.h: Ditto.
3815         * html/HTMLSelectElement.h: Ditto.
3816         * html/HTMLStyleElement.h: Ditto.
3817         * html/HTMLTableCellElement.h: Ditto.
3818         * html/HTMLTableColElement.h: Ditto.
3819         * html/HTMLTableElement.h: Ditto.
3820         * html/HTMLTableRowElement.h: Ditto.
3821         * html/HTMLTableSectionElement.h: Ditto.
3822         * html/HTMLTextAreaElement.h: Ditto.
3823         * html/HTMLTextFormControlElement.h: Ditto.
3824         * html/HTMLTitleElement.h: Ditto.
3825         * html/HTMLVideoElement.h: Ditto.
3826         * html/LabelableElement.h: Ditto.
3827
3828         * loader/EmptyClients.h: Updated documentFragmentFromDelegate, which was
3829         returning a newly created document fragment with a raw pointer. This works
3830         because the implementation internally uses Objective-C and autorelease, but
3831         is too fragile to rely on for the future.
3832
3833         * page/DOMWindow.h: Exported symbols needed by the Objective-C bindings.
3834
3835         * page/EditorClient.h: Updated document fragment functions.
3836
3837         * page/Frame.h: Removed indexCountOfWordPrecedingSelection, already unused.
3838         Removed innerLineHeight and styleAtSelectionStart, formerly used by legacy WebKit,
3839         which used Objective-C DOM objects in their interfaces.
3840
3841         * page/ios/FrameIOS.mm:
3842         (WebCore::Frame::indexCountOfWordPrecedingSelection): Deleted.
3843         (WebCore::Frame::innerLineHeight): Deleted.
3844         (WebCore::Frame::styleAtSelectionStart): Deleted.
3845
3846         * platform/DragImage.h: Exported symbols needed by the Objective-C bindings.
3847         * platform/ScrollView.h: Ditto.
3848         * platform/URL.h: Ditto.
3849
3850         * platform/cocoa/WebKitAvailability.h: Moved from bindings/objc.
3851
3852         * platform/cocoa/WebPlaybackSessionModelMediaElement.mm: Removed unneeded includes
3853         of Objective-C DOM headers.
3854         * platform/cocoa/WebVideoFullscreenModelVideoElement.mm: Ditto.
3855         * platform/ios/PasteboardIOS.mm: Ditto.
3856
3857         * platform/ios/wak/WebCoreThread.mm:
3858         (StartWebThread): Took out the call to WebCoreObjCDeallocOnWebThread for DOMObject.
3859         This class is now defined in legacy WebKit, so we do the code there there along
3860         with the other WebKit classes.
3861
3862         * platform/ios/wak/WebCoreThreadSafe.h: Removed the unwise additional definition of
3863         WebScriptObject and DOMObject in this file. Really this entire file needs to go.
3864
3865         * platform/text/TextEncoding.h: Exported symbols needed by the Objective-C bindings.
3866         * rendering/HitTestResult.h: Ditto.
3867         * rendering/RenderLayer.h: Ditto.
3868         * rendering/RenderObject.h: Ditto.
3869
3870         * rendering/RenderThemeGtk.cpp: Rewrote code that was unnecessarily using
3871         NamedNodeMap and Attr nodes just to get the value of an attribute.
3872
3873         * rendering/style/RenderStyle.h: Exported symbols needed by the Objective-C bindings.
3874
3875         * xml/XMLHttpRequest.cpp: Added include needed now that XMLDocument.h is not
3876         included by DOMImplementation.h.
3877
3878         * xml/XPathExpression.h: Exported symbols needed by the Objective-C bindings.
3879         * xml/XPathExpression.idl: Ditto.
3880         * xml/XPathNSResolver.h: Ditto.
3881
3882         * xml/XPathResult.cpp:
3883         (WebCore::XPathResult::snapshotLength): Use unsigned instead of unsigned long.
3884         (WebCore::XPathResult::snapshotItem): Ditto.
3885         * xml/XPathResult.h: Exported symbols needed by the Objective-C bindings. Also
3886         updated types as above.
3887         * xml/XPathResult.idl: Ditto.
3888
3889 2016-08-22  Frederic Wang  <fwang@igalia.com>
3890
3891         Rename MathMLTextElement to MathMLTokenElement
3892         https://bugs.webkit.org/show_bug.cgi?id=160542
3893
3894         Reviewed by Darin Adler.
3895
3896         No new tests, behavior is unchanged.
3897
3898         * CMakeLists.txt: Rename MathMLTextElement to MathMLTokenElement.
3899         * WebCore.xcodeproj/project.pbxproj: Ditto.
3900         * mathml/MathMLAllInOne.cpp: Ditto.
3901         * mathml/MathMLOperatorElement.cpp: Ditto.
3902         * mathml/MathMLOperatorElement.h: Ditto.
3903         * mathml/MathMLTokenElement.cpp: Ditto. Also remove dead code in childShouldCreateRenderer
3904         to handle the case of mspace since that element uses its own class and forbids child creation
3905         in RenderMathMLSpace::isChildAllowed.
3906         * mathml/MathMLTokenElement.h: Rename MathMLTextElement to MathMLTokenElement.
3907         * mathml/mathtags.in: Ditto.
3908         * rendering/mathml/RenderMathMLToken.cpp: Move inclusion of MathMLTokenElement.h and
3909         implementation of element() here.
3910         * rendering/mathml/RenderMathMLToken.h: Do not implement element() in the header so that
3911         we only need need to predeclare MathMLTokenElement instead of including its header.
3912
3913 2016-08-21  Alex Christensen  <achristensen@webkit.org>
3914
3915         Use Document& instead of Document* when getting cookies
3916         https://bugs.webkit.org/show_bug.cgi?id=161011
3917
3918         Reviewed by Darin Adler.
3919
3920         No change in behavior.
3921
3922         * Modules/websockets/WebSocketChannel.cpp:
3923         (WebCore::WebSocketChannel::processBuffer):
3924         * Modules/websockets/WebSocketHandshake.cpp:
3925         (WebCore::WebSocketHandshake::clientHandshakeMessage):
3926         (WebCore::WebSocketHandshake::clientHandshakeRequest):
3927         * dom/Document.cpp:
3928         (WebCore::Document::cookie):
3929         (WebCore::Document::setCookie):
3930         (WebCore::Document::referrer):
3931         * inspector/InspectorPageAgent.cpp:
3932         (WebCore::InspectorPageAgent::getCookies):
3933         (WebCore::InspectorPageAgent::deleteCookie):
3934         (WebCore::InspectorPageAgent::getResourceTree):
3935         * loader/CookieJar.cpp:
3936         (WebCore::networkingContext):
3937         (WebCore::storageSession):
3938         (WebCore::cookies):
3939         (WebCore::setCookies):
3940         (WebCore::cookiesEnabled):
3941         (WebCore::cookieRequestHeaderFieldValue):
3942         (WebCore::getRawCookies):
3943         (WebCore::deleteCookie):
3944         (WebCore::addCookie):
3945         * loader/CookieJar.h:
3946         * page/Navigator.cpp:
3947         (WebCore::Navigator::cookieEnabled):
3948         (WebCore::Navigator::javaEnabled):
3949
3950 2016-08-21  Alex Christensen  <achristensen@webkit.org>
3951
3952         URLParser should parse IPv4 addresses
3953         https://bugs.webkit.org/show_bug.cgi?id=161023
3954
3955         Reviewed by Darin Adler.
3956
3957         Covered by new API tests because URLParser isn't used anywhere in WebCore yet.
3958
3959         * platform/URLParser.cpp:
3960         (WebCore::URLParser::authorityEndReached):
3961         (WebCore::serializeIPv4):
3962         (WebCore::parseIPv4Number):
3963         (WebCore::pow256):
3964         (WebCore::parseIPv4Host):
3965         (WebCore::parseIPv6Host):
3966         (WebCore::URLParser::hostEndReached):
3967
3968 2016-08-21  Sam Weinig  <sam@webkit.org>
3969
3970         Remove a few custom bindings
3971         https://bugs.webkit.org/show_bug.cgi?id=161039
3972
3973         Reviewed by Darin Adler.
3974
3975         Remove custom bindings for CanvasRenderingContext2D's webkitLineDash attribute and commit function.
3976
3977         * WebCore.xcodeproj/project.pbxproj:
3978         Sort files.
3979
3980         * bindings/js/JSCanvasRenderingContext2DCustom.cpp:
3981         (WebCore::JSCanvasRenderingContext2D::commit): Deleted.
3982         (WebCore::JSCanvasRenderingContext2D::webkitLineDash): Deleted.
3983         (WebCore::JSCanvasRenderingContext2D::setWebkitLineDash): Deleted.
3984         * html/canvas/CanvasRenderingContext2D.cpp:
3985         (WebCore::CanvasRenderingContext2D::webkitLineDashOffset): Deleted.
3986         (WebCore::CanvasRenderingContext2D::setWebkitLineDashOffset): Deleted.
3987         * html/canvas/CanvasRenderingContext2D.h:
3988         * html/canvas/CanvasRenderingContext2D.idl:
3989
3990 2016-08-21  Youenn Fablet  <youenn@apple.com>
3991
3992         cross-origin requests redirected fail or drop author requested headers
3993         https://bugs.webkit.org/show_bug.cgi?id=112471
3994
3995         Reviewed by Alex Christensen.
3996
3997         Test: http/tests/xmlhttprequest/redirections-and-user-headers.html
3998
3999         Storing original headers in DocumentThreadableLoader.
4000         In case of cross-origin redirection in CORS mode, set the new request headers to the original headers.
4001         Add a special handling to Authorization header that should not be used when it is already removed by the network layer.
4002
4003         * loader/DocumentThreadableLoader.cpp:
4004         (WebCore::DocumentThreadableLoader::redirectReceived):
4005         (WebCore::DocumentThreadableLoader::loadRequest):
4006         * loader/DocumentThreadableLoader.h:
4007
4008 2016-08-21  Frederic Wang  <fwang@igalia.com>
4009
4010         Introduce a MathMLAnnotationElement class for the annotation/annotation-xml elements
4011         https://bugs.webkit.org/show_bug.cgi?id=160540
4012
4013         Reviewed by Darin Adler.
4014
4015         The <annotation> element can only contain text whereas the <annotation-xml> element can
4016         contain some elements as described in the HTML5 RelaxNG schema. For this reason, they have
4017         been implemented in the separate MathMLTextElement and MathMLInlineContainerElement
4018         respectively. However, they are actually closer to each other than to token elements or
4019         presentation containers. In particular they support very different attributes and are
4020         considered by the <semantics> tag. Hence we move their implementations in a new
4021         MathMLAnnotation class.
4022
4023         No new tests, already covered by existing tests.
4024
4025         * CMakeLists.txt: Add MathMLAnnotationElement.
4026         * mathml/MathMLAllInOne.cpp: Ditto.
4027         * WebCore.xcodeproj/project.pbxproj: Ditto.
4028         * mathml/MathMLAnnotationElement.cpp: Added.
4029         (WebCore::MathMLAnnotationElement::MathMLAnnotationElement): ASSERT that this class is only
4030         for annotation and annotation-xml.
4031         (WebCore::MathMLAnnotationElement::create):
4032         (WebCore::MathMLAnnotationElement::createElementRenderer): Move implementation from
4033         MathMLTextElement and MathMLInlineContainerElement.
4034         (WebCore::MathMLAnnotationElement::childShouldCreateRenderer): Move implementation from
4035         MathMLTextElement and MathMLElement.
4036         (WebCore::MathMLAnnotationElement::attributeChanged): Move implementation from MathMLElement.
4037         * mathml/MathMLAnnotationElement.h: Override isSemanticAnnotation and isPresentationMathML
4038         to return true.
4039         * mathml/MathMLElement.cpp:
4040         (WebCore::MathMLElement::childShouldCreateRenderer): Move the annotation-xml case into
4041         MathMLAnnotationElement.
4042         (WebCore::MathMLElement