f44f9e8b9412ccbae01236d4084b8e2ead928892
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-08-08  Brent Fulgham  <bfulgham@apple.com>
2
3         Unreviewed build fix after r220376.
4
5         Don't attempt to use isPublicSuffix when building without that
6         feature enabled.
7
8         * dom/Document.cpp:
9         (WebCore::Document::domainIsRegisterable const):
10
11 2017-08-08  Michael Catanzaro  <mcatanzaro@igalia.com>
12
13         [CMake] Properly test if compiler supports compiler flags
14         https://bugs.webkit.org/show_bug.cgi?id=174490
15
16         Reviewed by Konstantin Tokarev.
17
18         * CMakeLists.txt:
19         * PlatformGTK.cmake:
20         * PlatformWPE.cmake:
21
22 2017-08-08  Zan Dobersek  <zdobersek@igalia.com>
23
24         [GStreamer] Don't use GraphicsContext3D in VideoTextureCoperGStreamer
25         https://bugs.webkit.org/show_bug.cgi?id=174774
26
27         Reviewed by Carlos Garcia Campos.
28
29         VideoTextureCoperGStreamer class creates a new GraphicsContext3D internally
30         that's used to render to whichever OpenGL context is current. Such usage
31         doesn't add anything to the user since there's no underlying offscreen-based
32         OpenGL context created, and instead all GraphicsContext3D calls are directly
33         translated to usual OpenGL API calls. We should avoid using GraphicsContext3D
34         in such cases and instead use direct OpenGL API calls.
35
36         This patch achieves that for the VideoTextureCoperGStreamer class. A
37         GraphicsContext3D object is still created because it's needed to construct an
38         instance of the TextureMapperShaderProgram class, but this will be removed as
39         soon as TextureMapperShaderProgram drops the GraphicsContext3D dependence.
40
41         No new tests -- no change in behavior.
42
43         * platform/graphics/gstreamer/VideoTextureCopierGStreamer.cpp:
44         (WebCore::VideoTextureCopierGStreamer::VideoTextureCopierGStreamer):
45         (WebCore::VideoTextureCopierGStreamer::~VideoTextureCopierGStreamer):
46         (WebCore::VideoTextureCopierGStreamer::copyVideoTextureToPlatformTexture):
47         * platform/graphics/gstreamer/VideoTextureCopierGStreamer.h:
48         (WebCore::VideoTextureCopierGStreamer::resultTexture):
49
50 2017-08-08  Zan Dobersek  <zdobersek@igalia.com>
51
52         [TexMap] Drop GC3D* type usage from TextureMapperPlatformLayer{Buffer,Proxy}
53         https://bugs.webkit.org/show_bug.cgi?id=175314
54
55         Reviewed by Carlos Garcia Campos.
56
57         Switch to using OpenGL types in the TextureMapperPlatformLayerBuffer and
58         TextureMapperPlatformLayerProxy classes, instead of the equivalent GC3D*
59         types provided in the GraphicsTypes3D.h header.
60
61         No new tests -- no change in behavior.
62
63         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
64         (WebCore::TextureMapperPlatformLayerBuffer::TextureMapperPlatformLayerBuffer):
65         (WebCore::TextureMapperPlatformLayerBuffer::canReuseWithoutReset):
66         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h:
67         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
68         (WebCore::TextureMapperPlatformLayerProxy::getAvailableBuffer):
69         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.h:
70
71 2017-08-08  Zan Dobersek  <zdobersek@igalia.com>
72
73         [TexMap] Don't use GraphicsContext3D in ClipStack
74         https://bugs.webkit.org/show_bug.cgi?id=174776
75
76         Reviewed by Carlos Garcia Campos.
77
78         Any GraphicsContext3D object that's passed to ClipStack methods is of the
79         render-to-current-context nature, meaning there's no internally owned GL
80         context that has to be properly handled and all calls are simply passed to
81         OpenGL APIs. We should drop such (non-)usage of GraphicsContext3D in favor
82         of direct OpenGL API invocations.
83
84         This patch covers TextureMapper's ClipStack. Call sites to the apply() and
85         applyIfNeeded() are modified to not pass a reference to any
86         GraphicsContext3D object. Internally, OpenGL API entrypoints and constants
87         are used instead of GraphicsContext3D invocations.
88
89         No new tests -- no change in behavior.
90
91         * platform/graphics/texmap/BitmapTextureGL.cpp:
92         (WebCore::BitmapTextureGL::clearIfNeeded):
93         (WebCore::BitmapTextureGL::bindAsSurface):
94         * platform/graphics/texmap/ClipStack.cpp:
95         (WebCore::ClipStack::apply):
96         (WebCore::ClipStack::applyIfNeeded):
97         * platform/graphics/texmap/ClipStack.h:
98         * platform/graphics/texmap/TextureMapperGL.cpp:
99         (WebCore::TextureMapperGL::bindDefaultSurface):
100         (WebCore::TextureMapperGL::beginScissorClip):
101         (WebCore::TextureMapperGL::beginClip):
102         (WebCore::TextureMapperGL::endClip):
103
104 2017-08-08  Javier Fernandez  <jfernandez@igalia.com>
105
106         Not possible to remove the 'li' element inside the table cell
107         https://bugs.webkit.org/show_bug.cgi?id=173148
108
109         Reviewed by Ryosuke Niwa.
110
111         We need to add a new case for breaking out empty list items when they are
112         at the start of an editable area. Since list items can be also inside
113         table cells, we need to consider this kind of elements as well.
114
115         Tests: editing/deleting/delete-list-items-in-table-cell-1.html
116                editing/deleting/delete-list-items-in-table-cell-2.html
117                editing/deleting/delete-list-items-in-table-cell-3.html
118                editing/deleting/delete-list-items-in-table-cell-4.html
119                editing/deleting/delete-list-items-in-table-cell-5.html
120                editing/deleting/delete-list-items-in-table-cell-6.html
121                editing/deleting/delete-list-items-in-table-cell-7.html
122                editing/deleting/delete-list-items-in-table-cell-8.html
123
124         * editing/TypingCommand.cpp:
125         (WebCore::TypingCommand::deleteKeyPressed):
126
127 2017-08-08  Zan Dobersek  <zdobersek@igalia.com>
128
129         [TexMap] Isolate the TextureMapperPlatformLayerProxyProvider class
130         https://bugs.webkit.org/show_bug.cgi?id=175316
131
132         Reviewed by Carlos Garcia Campos.
133
134         Move the TextureMapperPlatformLayerProxyProvider class (which is the type
135         aliased to PlatformLayer for threaded CoordGraphics) into its own header
136         file. This prevents including the TextureMapperPlatformLayerProxy.h header
137         file in MediaPlayerPrivateGStreamerBase.h, avoiding spilling OpenGL types
138         and function declarations before the GStreamer GL headers include them
139         later in the MediaPlayerPrivateGStreamerBase implementation file.
140
141         In the MediaPlayerPrivateGStreamerBase.h header file, only the new header
142         is included, and a forward declaration of the TextureMapperPlatformLayerProxy
143         class is used. proxy() and swapBuffersIfNeeded() methods are moved into
144         the implementation file to avoid requiring the full definition of the
145         TextureMapperPlatformLayerProxy class.
146
147         Similar is done for the TextureMapperGC3DPlatformLayer class and the
148         Cairo-specific implementation of the ImageBufferData class. The
149         CoordinatedGraphicsLayer implementation file also gains an include of the
150         TextureMapperPlatformLayerProxyProvider.h header since it requires the full
151         definition of that class.
152
153         No new tests -- no change in behavior.
154
155         * platform/graphics/cairo/ImageBufferCairo.cpp:
156         (WebCore::ImageBufferData::proxy const):
157         * platform/graphics/cairo/ImageBufferDataCairo.h:
158         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
159         (WebCore::MediaPlayerPrivateGStreamerBase::updateTexture):
160         (WebCore::MediaPlayerPrivateGStreamerBase::proxy const):
161         (WebCore::MediaPlayerPrivateGStreamerBase::swapBuffersIfNeeded):
162         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
163         * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.cpp:
164         * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.h:
165         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.h:
166         * platform/graphics/texmap/TextureMapperPlatformLayerProxyProvider.h: Added.
167         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
168
169 2017-08-08  Zan Dobersek  <zdobersek@igalia.com>
170
171         Unreviewed. Follow-up to r220392 that fixes build on configurations
172         that disable USE(GSTREAMER_GL).
173
174         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
175         (WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor):
176         When creating the BitmapTextureGL object, also provide an initialized
177         TextureMapperContextAttributes object.
178
179 2017-08-08  Zan Dobersek  <zdobersek@igalia.com>
180
181         [TexMap] Group GL header file inclusions in a single header file
182         https://bugs.webkit.org/show_bug.cgi?id=175313
183
184         Reviewed by Carlos Garcia Campos.
185
186         Add a helper header file to the TextureMapper subsystem that includes
187         the OpenGL headers, properly addressing the build configuration to
188         include headers as provided by either libepoxy, the OpenGL ES library,
189         or the OpenGL library.
190
191         TextureMapperContextAttributes implementation file is the only one
192         that can leverage the header at the moment, but more will follow.
193
194         * platform/graphics/texmap/TextureMapperContextAttributes.cpp:
195         * platform/graphics/texmap/TextureMapperGLHeaders.h: Copied from Source/WebCore/platform/graphics/texmap/TextureMapperContextAttributes.cpp.
196
197 2017-08-08  Wenson Hsieh  <wenson_hsieh@apple.com>
198
199         [iOS WK2] WKWebView schedules nonstop layout after pressing cmb+b,i,u inside a contenteditable div
200         https://bugs.webkit.org/show_bug.cgi?id=175116
201         <rdar://problem/28279301>
202
203         Reviewed by Darin Adler and Ryosuke Niwa.
204
205         WebCore support for WebPage::editorState refactoring. See WebKit ChangeLogs for more detail.
206
207         Tests: EditorStateTests.TypingAttributesBold
208                EditorStateTests.TypingAttributesItalic
209                EditorStateTests.TypingAttributesUnderline
210                EditorStateTests.TypingAttributesTextAlignmentAbsoluteAlignmentOptions
211                EditorStateTests.TypingAttributesTextAlignmentStartEnd
212                EditorStateTests.TypingAttributesTextAlignmentDirectionalText
213                EditorStateTests.TypingAttributesTextColor
214                EditorStateTests.TypingAttributesMixedStyles
215                EditorStateTests.TypingAttributesLinkColor
216
217         * css/StyleProperties.cpp:
218         (WebCore::StyleProperties::propertyAsColor const):
219         (WebCore::StyleProperties::propertyAsValueID const):
220
221         Introduces some helper functions in StyleProperties to convert CSS property values to Color or a CSSValueID.
222
223         * css/StyleProperties.h:
224         * editing/EditingStyle.cpp:
225         (WebCore::EditingStyle::hasStyle):
226
227         Pull out logic in selectionStartHasStyle that asks for a style TriState into EditingStyle::hasStyle. This is
228         because WebPage::editorState will now query for multiple styles at the selection start, but
229         selectionStartHasStyle currently recomputes styleAtSelectionStart every time it is called. To prevent extra work
230         from being done, we can just call selectionStartHasStyle once and use ask for EditingStyle::hasStyle on the
231         computed EditingStyle at selection start.
232
233         * editing/EditingStyle.h:
234         * editing/Editor.cpp:
235         (WebCore::Editor::selectionStartHasStyle const):
236
237 2017-08-08  Zan Dobersek  <zdobersek@igalia.com>
238
239         [TexMap] Add TextureMapperContextAttributes
240         https://bugs.webkit.org/show_bug.cgi?id=175311
241
242         Reviewed by Carlos Garcia Campos.
243
244         Add and use TextureMapperContextAttributes, a slim struct that holds
245         information about the type and extensions supported by the OpenGL
246         context that's being used for one specific TextureMapperGL instance.
247
248         This struct is initialized in the TextureMapperGL constructor for the
249         OpenGL context that's been made current on that thread, and that will
250         be used for that TextureMapperGL instance through its lifetime. The
251         struct is then also copied into any BitmapTextureGL objects that have
252         been created through this TextureMapperGL (or its texture pool).
253
254         The struct is initialized with information about GLES2 support (which
255         is at this point done through the USE_OPENGL_ES_2 macro) and about
256         specific OpenGL extensions that are supported. These are then used in
257         TextureMapperGL (NPOT textures) and BitmapTextureGL (BGRA support,
258         sub-image unpacking) to deploy specific optimizations or workarounds.
259
260         This ultimately serves as a replacement for clunky static functions
261         that need to operate on GraphicsContext3D objects to retrieve this
262         information.
263
264         No new tests -- no change in behavior.
265
266         * platform/TextureMapper.cmake:
267         * platform/graphics/texmap/BitmapTextureGL.cpp:
268         (WebCore::BitmapTextureGL::BitmapTextureGL):
269         (WebCore::BitmapTextureGL::updateContentsNoSwizzle):
270         (WebCore::BitmapTextureGL::updateContents):
271         (WebCore::driverSupportsSubImage): Deleted.
272         * platform/graphics/texmap/BitmapTextureGL.h:
273         (WebCore::BitmapTextureGL::create):
274         * platform/graphics/texmap/BitmapTexturePool.cpp:
275         (WebCore::BitmapTexturePool::BitmapTexturePool):
276         (WebCore::BitmapTexturePool::createTexture):
277         * platform/graphics/texmap/BitmapTexturePool.h:
278         * platform/graphics/texmap/TextureMapperContextAttributes.cpp: Added.
279         (WebCore::TextureMapperContextAttributes::initialize):
280         * platform/graphics/texmap/TextureMapperContextAttributes.h: Added.
281         * platform/graphics/texmap/TextureMapperGL.cpp:
282         (WebCore::TextureMapperGL::TextureMapperGL):
283         (WebCore::TextureMapperGL::drawTexture):
284         (WebCore::TextureMapperGL::drawTexturedQuadWithProgram):
285         (WebCore::TextureMapperGL::createTexture):
286         (WebCore::driverSupportsNPOTTextures): Deleted.
287         * platform/graphics/texmap/TextureMapperGL.h:
288
289 2017-08-08  Zan Dobersek  <zdobersek@igalia.com>
290
291         [TexMap] Don't expose GraphicsContext3D object
292         https://bugs.webkit.org/show_bug.cgi?id=175310
293
294         Reviewed by Carlos Garcia Campos.
295
296         Remove the GraphicsContext3D getter from the TextureMapperGL class. Instead,
297         the clearColor() method is added that's to be used by the CoordinatedGraphicsScene
298         class which was accessing the GraphicsContext3D object for this purpose.
299
300         * platform/graphics/texmap/TextureMapper.h:
301         * platform/graphics/texmap/TextureMapperGL.cpp:
302         (WebCore::TextureMapperGL::clearColor):
303         * platform/graphics/texmap/TextureMapperGL.h:
304         (WebCore::TextureMapperGL::graphicsContext3D const): Deleted.
305
306 2017-08-07  Simon Fraser  <simon.fraser@apple.com>
307
308         RenderStyle:diff() was inadvertently doing deep compares of StyleRareNonInheritedData etc
309         https://bugs.webkit.org/show_bug.cgi?id=175304
310
311         Reviewed by Tim Horton.
312
313         r210758 changed DataRef::get() from returning a pointer to a reference. This caused all the places
314         in RenderStyle::diff() and related functions, where we intended to do a quick pointer comparison,
315         to doing deep compares via operator!=. This made the code slightly slower.
316
317         Fix by exposing ptr() on DataRef and using it wherever we wish to do pointer comparison.
318
319         * rendering/style/DataRef.h:
320         (WebCore::DataRef::ptr const):
321         * rendering/style/RenderStyle.cpp:
322         (WebCore::RenderStyle::inheritedDataShared const):
323         (WebCore::RenderStyle::changeAffectsVisualOverflow const):
324         (WebCore::RenderStyle::changeRequiresLayout const):
325         (WebCore::RenderStyle::changeRequiresRecompositeLayer const):
326         (WebCore::RenderStyle::listStyleImage const): Expand the function onto multiple lines.
327
328 2017-08-07  Simon Fraser  <simon.fraser@apple.com>
329
330         Add a fast path for rotate() and rotateZ() transform parsing
331         https://bugs.webkit.org/show_bug.cgi?id=175308
332
333         Reviewed by Zalan Bujtas.
334
335         Fast paths only existed for translate-related functions, matrix3d() and scale3d(). Add
336         rotate() and rotateX(), which gives a small boost to one of the MotionMark tests.
337
338         * css/parser/CSSParserFastPaths.cpp:
339         (WebCore::parseSimpleAngle):
340         (WebCore::parseTransformAngleArgument):
341         (WebCore::parseSimpleTransformValue):
342         (WebCore::transformCanLikelyUseFastPath):
343
344 2017-08-07  Simon Fraser  <simon.fraser@apple.com>
345
346         Re-order the tests in RenderLayerCompositor::requiresCompositingLayer() for performance
347         https://bugs.webkit.org/show_bug.cgi?id=175306
348
349         Reviewed by Tim Horton.
350
351         Re-order the tests for compositing reasons so that reasons more likely to happen are higher in the list.
352
353         * rendering/RenderLayerCompositor.cpp:
354         (WebCore::RenderLayerCompositor::requiresCompositingLayer const):
355         (WebCore::RenderLayerCompositor::requiresOwnBackingStore const):
356
357 2017-08-07  Simon Fraser  <simon.fraser@apple.com>
358
359         Avoid a hash lookup in FilterInfo::remove()
360         https://bugs.webkit.org/show_bug.cgi?id=175301
361
362         Reviewed by Sam Weinig.
363
364         FilterInfo::remove() always called map().remove(&layer)), even when layer.m_hasFilterInfo
365         was false (and even asserted that layer.m_hasFilterInfo == map().contains(&layer)).
366
367         So we can early return if layer.m_hasFilterInfo is false.
368
369         * rendering/RenderLayerFilterInfo.cpp:
370         (WebCore::RenderLayer::FilterInfo::getIfExists):
371         (WebCore::RenderLayer::FilterInfo::remove):
372
373 2017-08-07  Simon Fraser  <simon.fraser@apple.com>
374
375         Make TransformOperation::type() non-virtual
376         https://bugs.webkit.org/show_bug.cgi?id=175297
377
378         Reviewed by Sam Weinig.
379
380         Store the OperationType in the base class so that type() and isSameType() can
381         be non-virtual.
382
383         Small perf win on some benchmarks.
384
385         * platform/graphics/transforms/IdentityTransformOperation.h:
386         * platform/graphics/transforms/Matrix3DTransformOperation.h:
387         * platform/graphics/transforms/MatrixTransformOperation.h:
388         * platform/graphics/transforms/PerspectiveTransformOperation.h:
389         * platform/graphics/transforms/RotateTransformOperation.cpp:
390         (WebCore::RotateTransformOperation::blend):
391         * platform/graphics/transforms/RotateTransformOperation.h:
392         * platform/graphics/transforms/ScaleTransformOperation.cpp:
393         (WebCore::ScaleTransformOperation::blend):
394         * platform/graphics/transforms/ScaleTransformOperation.h:
395         * platform/graphics/transforms/SkewTransformOperation.cpp:
396         (WebCore::SkewTransformOperation::blend):
397         * platform/graphics/transforms/SkewTransformOperation.h:
398         * platform/graphics/transforms/TransformOperation.h:
399         (WebCore::TransformOperation::TransformOperation):
400         (WebCore::TransformOperation::type const):
401         (WebCore::TransformOperation::isSameType const):
402         * platform/graphics/transforms/TranslateTransformOperation.cpp:
403         (WebCore::TranslateTransformOperation::blend):
404         * platform/graphics/transforms/TranslateTransformOperation.h:
405
406 2017-08-07  Simon Fraser  <simon.fraser@apple.com>
407
408         Inline ~Color and Color::isExtended()
409         https://bugs.webkit.org/show_bug.cgi?id=175293
410
411         Reviewed by Zalan Bujtas.
412
413         The Color destructor and Color::isExtended() show up on profiles, so inline them.
414         Before r207265 the destructor was inlined.
415         
416         Also make sure that LengthSize::operator== is inlined, which it was not (according
417         to profiles).
418
419         * platform/LengthSize.h:
420         (WebCore::operator==):
421         * platform/graphics/Color.cpp:
422         (WebCore::Color::~Color): Deleted.
423         (WebCore::Color::isExtended const): Deleted.
424         * platform/graphics/Color.h:
425         (WebCore::Color::~Color):
426         (WebCore::Color::isExtended const):
427
428 2017-08-04  Brent Fulgham  <bfulgham@apple.com>
429
430         Implement the HTML5 same-origin restriction specification
431         https://bugs.webkit.org/show_bug.cgi?id=175226
432         <rdar://problem/11079948>
433
434         Reviewed by Chris Dumez.
435
436         Follow the algorithms defined in the HTML5 specification for relaxing
437         the same-origin restriction. We were missing a few steps related to
438         checking for public suffix and presence of a browsing context.
439
440         Tested by new TestWebKitAPI tests.
441
442         * dom/Document.cpp:
443         (WebCore::Document::domainIsRegisterable): Added helper function.
444         (WebCore::Document::setDomain):
445
446 2017-08-07  Devin Rousso  <drousso@apple.com>
447
448         Web Inspector: Preview Canvas path when viewing a recording
449         https://bugs.webkit.org/show_bug.cgi?id=174967
450
451         Reviewed by Brian Burg.
452
453         Tests: fast/canvas/2d.currentPoint.html
454                fast/canvas/2d.getPath.modification.html
455                fast/canvas/2d.getPath.newobject.html
456                fast/canvas/2d.setPath.html
457
458         * html/canvas/CanvasPath.idl:
459         * html/canvas/CanvasPath.h:
460         * html/canvas/CanvasPath.cpp:
461         (WebCore::CanvasPath::currentX const):
462         (WebCore::CanvasPath::currentY const):
463
464         * html/canvas/CanvasRenderingContext2D.idl:
465         * html/canvas/CanvasRenderingContext2D.h:
466         * html/canvas/CanvasRenderingContext2D.cpp:
467         (WebCore::CanvasRenderingContext2D::setPath):
468         (WebCore::CanvasRenderingContext2D::getPath const):
469
470         * page/RuntimeEnabledFeatures.h:
471         (WebCore::RuntimeEnabledFeatures::setInspectorAdditionsEnabled):
472         (WebCore::RuntimeEnabledFeatures::inspectorAdditionsEnabled const):
473         Add runtime flag for added IDL items above so that they are only usable within the inspector
474         process. The runtime flag is not enabled from anywhere else as of now.
475
476         * inspector/InspectorCanvas.cpp:
477         (WebCore::InspectorCanvas::buildInitialState):
478         Send current path as part of the InitialState.
479         Drive-by: deduplicate more string values.
480
481 2017-08-07  Chris Dumez  <cdumez@apple.com>
482
483         Update sendBeacon() to rely on FetchBody instead of the whole FetchRequest
484         https://bugs.webkit.org/show_bug.cgi?id=175280
485
486         Reviewed by Youenn Fablet.
487
488         Update sendBeacon() to rely on FetchBody instead of the whole FetchRequest. FetchBody
489         for data extraction is really the only thing we need at the moment.
490         The new code also properly sets the CORS mode, which will be needed for Bug 175264.
491
492         * Modules/beacon/NavigatorBeacon.cpp:
493         (WebCore::NavigatorBeacon::sendBeacon):
494
495 2017-08-07  Michael Catanzaro  <mcatanzaro@igalia.com>
496
497         -Wimplicit-fallthrough warning in ComputedStyleExtractor::propertyValue
498         https://bugs.webkit.org/show_bug.cgi?id=174469
499         <rdar://problem/33311638>
500
501         Reviewed by Simon Fraser.
502
503         Add a RELEASE_ASSERT_NOT_REACHED to silence this warning.
504
505         * css/CSSComputedStyleDeclaration.cpp:
506         (WebCore::ComputedStyleExtractor::propertyValue):
507
508 2017-08-06  Filip Pizlo  <fpizlo@apple.com>
509
510         Primitive auxiliaries and JSValue auxiliaries should have separate gigacages
511         https://bugs.webkit.org/show_bug.cgi?id=174919
512
513         Reviewed by Keith Miller.
514
515         No new tests because no change in behavior.
516         
517         Adapting to API changes - we now specify the AlignedMemoryAllocator differently and we need to be
518         specific about which Gigacage we're using.
519
520         * bindings/js/WebCoreJSClientData.cpp:
521         (WebCore::JSVMClientData::JSVMClientData):
522         * platform/graphics/cocoa/GPUBufferMetal.mm:
523         (WebCore::GPUBuffer::GPUBuffer):
524
525 2017-08-07  Basuke Suzuki  <Basuke.Suzuki@sony.com>
526
527         [Curl] Add abstraction layer of cookie jar implementation for Curl port
528         https://bugs.webkit.org/show_bug.cgi?id=174943
529
530         Reviewed by Brent Fulgham.
531
532         * platform/network/curl/CookieJarCurl.cpp:
533         (WebCore::CookieJarCurlFileSystem::setCookiesFromDOM):
534         (WebCore::CookieJarCurlFileSystem::cookiesForDOM):
535         (WebCore::CookieJarCurlFileSystem::cookieRequestHeaderFieldValue):
536         (WebCore::CookieJarCurlFileSystem::cookiesEnabled):
537         (WebCore::CookieJarCurlFileSystem::getRawCookies):
538         (WebCore::CookieJarCurlFileSystem::deleteCookie):
539         (WebCore::CookieJarCurlFileSystem::getHostnamesWithCookies):
540         (WebCore::CookieJarCurlFileSystem::deleteCookiesForHostnames):
541         (WebCore::CookieJarCurlFileSystem::deleteAllCookies):
542         (WebCore::CookieJarCurlFileSystem::deleteAllCookiesModifiedSince):
543         (WebCore::cookiesForDOM):
544         (WebCore::setCookiesFromDOM):
545         (WebCore::cookieRequestHeaderFieldValue):
546         (WebCore::cookiesEnabled):
547         (WebCore::getRawCookies):
548         (WebCore::deleteCookie):
549         (WebCore::getHostnamesWithCookies):
550         (WebCore::deleteCookiesForHostnames):
551         (WebCore::deleteAllCookies):
552         (WebCore::deleteAllCookiesModifiedSince):
553         * platform/network/curl/CookieJarCurl.h: Added.
554         * platform/network/curl/CurlContext.cpp:
555         * platform/network/curl/CurlContext.h:
556         (WebCore::CurlContext::cookieJar):
557
558 2017-08-07  Brady Eidson  <beidson@apple.com>
559
560         Implement most of ServiceWorkerContainer::addRegistration.
561         https://bugs.webkit.org/show_bug.cgi?id=175237
562
563         Reviewed by Andy Estes.
564
565         No new tests (Covered by changes to existing tests).
566
567         There's still so much supporting infrastructure to add with these early patches
568         that I'm still moving them in baby steps for now, hence not implementing
569         register() all in one shot.
570         
571         Things will start moving very quickly once we no longer need to add lots of new
572         primitives in each change.
573         
574         * CMakeLists.txt:
575         * DerivedSources.make:
576         * WebCore.xcodeproj/project.pbxproj:
577         
578         * page/DOMWindow.cpp:
579         (WebCore::DOMWindow::navigator const):
580         
581         * page/Navigator.cpp:
582         (WebCore::Navigator::Navigator): Make the constructor take a ScriptExecutionContext for 
583           creation of objects where its import (e.g. ServiceWorkerContainer).
584         * page/Navigator.h:
585
586         * page/WorkerNavigator.cpp:
587         (WebCore::WorkerNavigator::WorkerNavigator): Ditto.
588         * page/WorkerNavigator.h:
589
590         * page/NavigatorBase.cpp:
591         (WebCore::NavigatorBase::NavigatorBase): Create the ServiceWorkerContainer upfront with
592           the passed-in ScriptExecutionContext.
593         (WebCore::NavigatorBase::serviceWorker):
594         * page/NavigatorBase.h:
595         
596         Make ServiceWorkerContainer into an ActiveDOMObject. This will eventually be necessary for
597         Document suspension reasons, but is also necessary because it also needs to be a
598         ContextDestructionObserver (which ActiveDOMObject is):
599         * workers/ServiceWorkerContainer.cpp:
600         (WebCore::ServiceWorkerContainer::ServiceWorkerContainer):
601         (WebCore::ServiceWorkerContainer::ready):
602         (WebCore::ServiceWorkerContainer::addRegistration):
603         (WebCore::ServiceWorkerContainer::getRegistration):
604         (WebCore::ServiceWorkerContainer::getRegistrations):
605         (WebCore::ServiceWorkerContainer::activeDOMObjectName const):
606         (WebCore::ServiceWorkerContainer::canSuspendForDocumentSuspension const):
607         (WebCore::rejectLater): Deleted.
608         (WebCore::ServiceWorkerContainer::eventTargetInterface const): Deleted.
609         (WebCore::ServiceWorkerContainer::scriptExecutionContext const): Deleted.
610         * workers/ServiceWorkerContainer.h:
611         * workers/ServiceWorkerContainer.idl:
612
613         Add updateViaCache, etc:
614         * workers/ServiceWorkerRegistration.cpp:
615         (WebCore::ServiceWorkerRegistration::updateViaCache const):
616         (WebCore::ServiceWorkerRegistration::update):
617         (WebCore::ServiceWorkerRegistration::unregister):
618         * workers/ServiceWorkerRegistration.h:
619         * workers/ServiceWorkerRegistration.idl:
620
621         * workers/ServiceWorkerUpdateViaCache.h: Copied from Source/WebCore/workers/ServiceWorkerRegistration.idl.
622         * workers/ServiceWorkerUpdateViaCache.idl: Copied from Source/WebCore/workers/ServiceWorkerRegistration.idl.
623
624         * workers/WorkerGlobalScope.cpp:
625         (WebCore::WorkerGlobalScope::navigator):
626         (WebCore::WorkerGlobalScope::navigator const): Deleted.
627         * workers/WorkerGlobalScope.h:
628
629         * workers/WorkerType.h: Copied from Source/WebCore/workers/ServiceWorkerRegistration.idl.
630         * workers/WorkerType.idl: Copied from Source/WebCore/workers/ServiceWorkerRegistration.idl.
631
632 2017-08-07  Ryan Haddad  <ryanhaddad@apple.com>
633
634         Unreviewed, rolling out r220299.
635
636         This change caused LayoutTest inspector/dom-debugger/dom-
637         breakpoints.html to fail.
638
639         Reverted changeset:
640
641         "Web Inspector: capture async stack trace when workers/main
642         context posts a message"
643         https://bugs.webkit.org/show_bug.cgi?id=167084
644         http://trac.webkit.org/changeset/220299
645
646 2017-08-07  Brian Burg  <bburg@apple.com>
647
648         Cleanup: simplify WebSockets code for RuntimeEnabledFeatures
649         https://bugs.webkit.org/show_bug.cgi?id=175190
650
651         Reviewed by Sam Weinig.
652
653         This runtime enabled flag is not used by anything. It was added
654         for V8 in <https://bugs.webkit.org/show_bug.cgi?id=29896>.
655
656         * Modules/websockets/WebSocket.cpp:
657         (WebCore::WebSocket::setIsAvailable): Deleted.
658         (WebCore::WebSocket::isAvailable): Deleted.
659         * Modules/websockets/WebSocket.h:
660         * Modules/websockets/WebSocket.idl:
661         * page/RuntimeEnabledFeatures.cpp:
662         (WebCore::RuntimeEnabledFeatures::webSocketEnabled const): Deleted.
663         * page/RuntimeEnabledFeatures.h:
664
665 2017-08-07  Brian Burg  <bburg@apple.com>
666
667         Remove CANVAS_PATH compilation guard
668         https://bugs.webkit.org/show_bug.cgi?id=175207
669
670         Reviewed by Sam Weinig.
671
672         * Configurations/FeatureDefines.xcconfig:
673         * html/canvas/DOMPath.h:
674         * html/canvas/DOMPath.idl:
675
676 2017-08-07  Carlos Alberto Lopez Perez  <clopez@igalia.com>
677
678         [WPE][CMake] Only pass pkg-config CFLAGS from (E)GL when not using libepoxy.
679         https://bugs.webkit.org/show_bug.cgi?id=175125
680
681         Reviewed by Michael Catanzaro.
682
683         No change of behavior, covered by existing tests.
684
685         * CMakeLists.txt: Instead of negating 3 times the use of libepoxy
686         move the logic for (E)GL detection inside an else() block.
687
688 2017-08-07  Antti Koivisto  <antti@apple.com>
689
690         REGRESSION (r219121): Airmail 3 prints header part only.
691         https://bugs.webkit.org/show_bug.cgi?id=175258
692         <rdar://problem/33601173>
693
694         Reviewed by Andreas Kling.
695
696         When a WK1 WebViw is printed via AppKit view hierarchy it won't explictly set the page width
697         but uses the existing width. r219121 assumes that all printing code paths set the page width.
698
699         No test, there appears to be no good way to test AppKit printing behaviors without adding complicated
700         new testing infrastructure.
701
702         * rendering/RenderView.cpp:
703         (WebCore::RenderView::layout):
704
705             If we are in printing layout and don't have page width set yet then use the current view width.
706             This matches the behavior prior r219121.
707
708 2017-08-05  Youenn Fablet  <youenn@apple.com>
709
710         [Fetch API] Response should keep all ResourceResponse information
711         https://bugs.webkit.org/show_bug.cgi?id=175099
712
713         Reviewed by Sam Weinig.
714
715         No change of behavior, covered by existing tests.
716
717         Disabling filtering of resource response at DocumentThreadableLoader for fetch API and doing the filtering at FetchResponse level.
718         This requires passing the tainting parameter to FetchResponse. For that purpose, we store the tainting on the ResourceResponse itself.
719         This allows mimicking the concept of internal response from the fetch spec.
720         This might be useful for future developments related to caching the responses.
721
722         The body is now also stored in FetchResponse so a flag is added to ensure we only expose the body if allowed.
723
724         Changing storage of opaque redirect information to keep the redirection information in the response.
725
726         * Modules/fetch/FetchBodyOwner.cpp:
727         (WebCore::FetchBodyOwner::blob):
728         (WebCore::FetchBodyOwner::consumeNullBody):
729         * Modules/fetch/FetchBodyOwner.h:
730         * Modules/fetch/FetchLoader.cpp:
731         (WebCore::FetchLoader::start):
732         * Modules/fetch/FetchResponse.cpp:
733         (WebCore::FetchResponse::BodyLoader::didReceiveResponse):
734         (WebCore::FetchResponse::consume):
735         (WebCore::FetchResponse::consumeBodyAsStream):
736         (WebCore::FetchResponse::createReadableStreamSource):
737         * Modules/fetch/FetchResponse.h:
738         * loader/DocumentThreadableLoader.cpp:
739         (WebCore::DocumentThreadableLoader::responseReceived):
740         (WebCore::DocumentThreadableLoader::didReceiveResponse):
741         (WebCore::DocumentThreadableLoader::didFinishLoading):
742         (WebCore::DocumentThreadableLoader::loadRequest):
743         * loader/DocumentThreadableLoader.h:
744         * loader/SubresourceLoader.cpp:
745         (WebCore::SubresourceLoader::willSendRequestInternal):
746         * loader/cache/CachedResource.cpp:
747         (WebCore::CachedResource::setBodyDataFrom):
748         (WebCore::CachedResource::setResponse):
749         * platform/network/ResourceResponseBase.cpp:
750         (WebCore::ResourceResponseBase::crossThreadData const):
751         (WebCore::ResourceResponseBase::fromCrossThreadData):
752         (WebCore::ResourceResponseBase::filter):
753         * platform/network/ResourceResponseBase.h:
754         (WebCore::ResourceResponseBase::setTainting):
755         (WebCore::ResourceResponseBase::tainting const):
756         (WebCore::ResourceResponseBase::encode const):
757         (WebCore::ResourceResponseBase::decode):
758
759 2017-08-05  Carlos Garcia Campos  <cgarcia@igalia.com>
760
761         WebDriver: use in-view center point for clicks instead of bounding box center point
762         https://bugs.webkit.org/show_bug.cgi?id=174863
763
764         Reviewed by Simon Fraser.
765
766         Make DOMRect, and FloatPoint::narrowPrecision() available to WebKit layer. Also add
767         FrameView::clientToDocumentPoint().
768
769         * WebCore.xcodeproj/project.pbxproj:
770         * dom/Element.h:
771         * page/FrameView.h:
772         * platform/graphics/FloatPoint.h:
773
774 2017-08-05  Carlos Garcia Campos  <cgarcia@igalia.com>
775
776         getClientRects doesn't work with list box option elements
777         https://bugs.webkit.org/show_bug.cgi?id=175016
778
779         Reviewed by Darin Adler.
780
781         Since HTMLOptionElement and HTMLOptGroupElement don't have a renderer, we are always returning an empty list
782         from getClientRects. This is working fine in both chromium and firefox, option elements return its own bounding
783         box and group elements return the bounding box of the group label and all its children items.
784
785         Test: fast/dom/HTMLSelectElement/listbox-items-client-rects.html
786
787         * dom/Element.cpp:
788         (WebCore::listBoxElementBoundingBox): Helper function to return the bounding box of a HTMLOptionElement or
789         HTMLOptGroupElement element.
790         (WebCore::Element::getClientRects): Use listBoxElementBoundingBox() in case of HTMLOptionElement or
791         HTMLOptGroupElement.
792         (WebCore::Element::boundingClientRect): Ditto.
793
794 2017-08-04  Youenn Fablet  <youenn@apple.com>
795
796         [Cache API] Add Cache and CacheStorage IDL definitions
797         https://bugs.webkit.org/show_bug.cgi?id=175201
798
799         Reviewed by Brady Eidson.
800
801         Covered by activated tests.
802         Adding IDLs as per https://www.w3.org/TR/service-workers-1/#idl-index.
803         Implementation is guarded by a runtime flag which is off by default.
804         It is off for DRT but on for WTR.
805
806         * CMakeLists.txt:
807         * DerivedSources.make:
808         * Modules/cache/Cache.cpp: Added.
809         (WebCore::Cache::match):
810         (WebCore::Cache::matchAll):
811         (WebCore::Cache::add):
812         (WebCore::Cache::addAll):
813         (WebCore::Cache::put):
814         (WebCore::Cache::remove):
815         (WebCore::Cache::keys):
816         * Modules/cache/Cache.h: Added.
817         (WebCore::Cache::create):
818         (WebCore::Cache::Cache):
819         * Modules/cache/Cache.idl: Added.
820         * Modules/cache/CacheQueryOptions.h: Added.
821         * Modules/cache/CacheQueryOptions.idl: Added.
822         * Modules/cache/CacheStorage.cpp: Added.
823         (WebCore::CacheStorage::match):
824         (WebCore::CacheStorage::has):
825         (WebCore::CacheStorage::open):
826         (WebCore::CacheStorage::remove):
827         (WebCore::CacheStorage::keys):
828         * Modules/cache/CacheStorage.h: Added.
829         (WebCore::CacheStorage::create):
830         * Modules/cache/CacheStorage.idl: Added.
831         * Modules/cache/DOMWindowCaches.cpp: Added.
832         (WebCore::DOMWindowCaches::DOMWindowCaches):
833         (WebCore::DOMWindowCaches::supplementName):
834         (WebCore::DOMWindowCaches::from):
835         (WebCore::DOMWindowCaches::caches):
836         (WebCore::DOMWindowCaches::caches const):
837         * Modules/cache/DOMWindowCaches.h: Added.
838         * Modules/cache/DOMWindowCaches.idl: Added.
839         * Modules/cache/WorkerGlobalScopeCaches.cpp: Added.
840         (WebCore::WorkerGlobalScopeCaches::supplementName):
841         (WebCore::WorkerGlobalScopeCaches::from):
842         (WebCore::WorkerGlobalScopeCaches::caches):
843         (WebCore::WorkerGlobalScopeCaches::caches const):
844         * Modules/cache/WorkerGlobalScopeCaches.h: Added.
845         * Modules/cache/WorkerGlobalScopeCaches.idl: Added.
846         * WebCore.xcodeproj/project.pbxproj:
847         * page/RuntimeEnabledFeatures.h:
848         (WebCore::RuntimeEnabledFeatures::setCacheAPIEnabled):
849         (WebCore::RuntimeEnabledFeatures::cacheAPIEnabled const):
850
851 2017-08-04  Brady Eidson  <beidson@apple.com>
852
853         Have navigator.serviceWorker() actually return a ServiceWorkerContainer object.
854         https://bugs.webkit.org/show_bug.cgi?id=175215
855
856         Reviewed by Youenn Fablet.
857
858         * page/NavigatorBase.cpp:
859         (WebCore::NavigatorBase::serviceWorker): Actually create and remember an object.
860         * page/NavigatorBase.h:
861
862         * workers/ServiceWorkerContainer.cpp:
863         (WebCore::rejectLater): Asynchronously reject the given promise with an error message.
864         (WebCore::ServiceWorkerContainer::ServiceWorkerContainer):
865         (WebCore::ServiceWorkerContainer::refEventTarget): Ref the underlying Navigator.
866         (WebCore::ServiceWorkerContainer::derefEventTarget): Deref the underlying Navigator.
867         (WebCore::ServiceWorkerContainer::ready): rejectLater the promise.
868         (WebCore::ServiceWorkerContainer::addRegistration): Ditto.
869         (WebCore::ServiceWorkerContainer::getRegistration): Ditto.
870         (WebCore::ServiceWorkerContainer::getRegistrations): Ditto.
871         * workers/ServiceWorkerContainer.h:
872
873 2017-08-04  Chris Dumez  <cdumez@apple.com>
874
875         [Beacon] Update sendBeacon to use the CachedResourceLoader
876         https://bugs.webkit.org/show_bug.cgi?id=175192
877         <rdar://problem/33725923>
878
879         Reviewed by Youenn Fablet.
880
881         Update sendBeacon to use the FetchRequest / CachedResourceLoader instead of
882         the PingLoader. This gets us closer to the specification which is based on
883         Fetch and reduces code duplication. This also fixes an issue where our
884         Origin header was not properly set on Beacon resquests.
885
886         In a follow-up, we will implement in CachedResourceLoader Fetch's quota for
887         inflight keepalive requests which is needed to fully support sendBeacon().
888
889         * Modules/beacon/NavigatorBeacon.cpp:
890         (WebCore::NavigatorBeacon::sendBeacon):
891         * Modules/beacon/NavigatorBeacon.h:
892         * loader/LinkLoader.cpp:
893         (WebCore::createLinkPreloadResourceClient):
894         * loader/PingLoader.cpp:
895         * loader/PingLoader.h:
896         * loader/ResourceLoadInfo.cpp:
897         (WebCore::toResourceType):
898         * loader/SubresourceLoader.cpp:
899         (WebCore::logResourceLoaded):
900         * loader/cache/CachedResource.cpp:
901         (WebCore::CachedResource::defaultPriorityForResourceType):
902         (WebCore::CachedResource::load):
903         * loader/cache/CachedResource.h:
904         * loader/cache/CachedResourceLoader.cpp:
905         (WebCore::createResource):
906         (WebCore::CachedResourceLoader::requestBeaconResource):
907         (WebCore::contentTypeFromResourceType):
908         (WebCore::CachedResourceLoader::checkInsecureContent const):
909         (WebCore::CachedResourceLoader::allowedByContentSecurityPolicy const):
910         (WebCore::isResourceSuitableForDirectReuse):
911         * loader/cache/CachedResourceLoader.h:
912
913 2017-08-04  John Wilander  <wilander@apple.com>
914
915         Resource Load Statistics: Report user interaction immediately, but only when needed
916         https://bugs.webkit.org/show_bug.cgi?id=175090
917         <rdar://problem/33685546>
918
919         Reviewed by Chris Dumez.
920
921         Test: http/tests/loading/resourceLoadStatistics/user-interaction-only-reported-once-within-short-period-of-time.html
922
923         * loader/ResourceLoadObserver.cpp:
924         (WebCore::ResourceLoadObserver::ResourceLoadObserver):
925         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
926             Now tells the UI process immediately but also records that it has
927             done so to avoid doing it when not needed.
928         (WebCore::ResourceLoadObserver::scheduleNotificationIfNeeded):
929             Conditional throttling gone, now always throttles.
930         (WebCore::ResourceLoadObserver::notifyObserver):
931             Renamed from ResourceLoadObserver::notificationTimerFired().
932         (WebCore::ResourceLoadObserver::clearState):
933             New function to allow the test runner to reset the web process'
934             statistics state now that we keep track of whether or not we've
935             reported user interaction to the UI process.
936         (WebCore::ResourceLoadObserver::setShouldThrottleObserverNotifications): Deleted.
937         (WebCore::ResourceLoadObserver::notificationTimerFired): Deleted.
938         * loader/ResourceLoadObserver.h:
939         (): Deleted.
940         * testing/Internals.cpp:
941         (WebCore::Internals::resetToConsistentState):
942         (WebCore::Internals::setResourceLoadStatisticsShouldThrottleObserverNotifications): Deleted.
943             No longer needed since user interaction is always communicated
944             immediately.
945         * testing/Internals.h:
946         * testing/Internals.idl:
947
948 2017-08-04  Matt Baker  <mattbaker@apple.com>
949
950         Web Inspector: capture async stack trace when workers/main context posts a message
951         https://bugs.webkit.org/show_bug.cgi?id=167084
952         <rdar://problem/30033673>
953
954         Reviewed by Brian Burg.
955
956         Add instrumentation to DOMWindow to support showing asynchronous
957         stack traces when the debugger pauses in a MessageEvent handler.
958
959         Test: inspector/debugger/async-stack-trace.html
960
961         * inspector/InspectorInstrumentation.cpp:
962         (WebCore::InspectorInstrumentation::didPostMessageImpl):
963         (WebCore::InspectorInstrumentation::didFailPostMessageImpl):
964         (WebCore::InspectorInstrumentation::willDispatchPostMessageImpl):
965         (WebCore::InspectorInstrumentation::didDispatchPostMessageImpl):
966
967         * inspector/InspectorInstrumentation.h:
968         (WebCore::InspectorInstrumentation::didPostMessage):
969         (WebCore::InspectorInstrumentation::didFailPostMessage):
970         (WebCore::InspectorInstrumentation::willDispatchPostMessage):
971         (WebCore::InspectorInstrumentation::didDispatchPostMessage):
972
973         * inspector/PageDebuggerAgent.cpp:
974         (WebCore::PageDebuggerAgent::didClearAsyncStackTraceData):
975         (WebCore::PageDebuggerAgent::didPostMessage):
976         (WebCore::PageDebuggerAgent::didFailPostMessage):
977         (WebCore::PageDebuggerAgent::willDispatchPostMessage):
978         (WebCore::PageDebuggerAgent::didDispatchPostMessage):
979         * inspector/PageDebuggerAgent.h:
980
981         * page/DOMWindow.cpp:
982         (WebCore::DOMWindow::postMessage):
983         (WebCore::DOMWindow::postMessageTimerFired):
984
985 2017-08-04  Devin Rousso  <drousso@apple.com>
986
987         Web Inspector: add source view for WebGL shader programs
988         https://bugs.webkit.org/show_bug.cgi?id=138593
989         <rdar://problem/18936194>
990
991         Reviewed by Matt Baker.
992
993         Test: inspector/canvas/requestShaderSource.html
994
995         * inspector/InspectorCanvasAgent.h:
996         * inspector/InspectorCanvasAgent.cpp:
997         (WebCore::InspectorCanvasAgent::requestShaderSource):
998
999         * inspector/InspectorShaderProgram.h:
1000         * inspector/InspectorShaderProgram.cpp:
1001         (WebCore::InspectorShaderProgram::shaderForType):
1002
1003 2017-08-04  Matt Lewis  <jlewis3@apple.com>
1004
1005         Unreviewed, rolling out r220288.
1006
1007         This broke multiple builds.
1008
1009         Reverted changeset:
1010
1011         "Use MPAVRoutingController instead of deprecated versions."
1012         https://bugs.webkit.org/show_bug.cgi?id=175063
1013         http://trac.webkit.org/changeset/220288
1014
1015 2017-08-03  Filip Pizlo  <fpizlo@apple.com>
1016
1017         The allocator used to allocate memory for MarkedBlocks and LargeAllocations should not be the Subspace itself
1018         https://bugs.webkit.org/show_bug.cgi?id=175141
1019
1020         Reviewed by Mark Lam.
1021
1022         No new tests because no new behavior.
1023         
1024         Just adapting to an API change.
1025
1026         * ForwardingHeaders/heap/FastMallocAlignedMemoryAllocator.h: Added.
1027         * bindings/js/WebCoreJSClientData.cpp:
1028         (WebCore::JSVMClientData::JSVMClientData):
1029
1030 2017-08-04  Chris Dumez  <cdumez@apple.com>
1031
1032         Match newly-clarified spec on textarea defaultValue/value/child text content
1033         https://bugs.webkit.org/show_bug.cgi?id=173878
1034
1035         Reviewed by Darin Adler.
1036
1037         Update HTMLTextArea.defaultValue to match align with other browsers and match the
1038         latest HTML specification:
1039         - https://html.spec.whatwg.org/#dom-textarea-defaultvalue
1040
1041         The defaultValue getter should return the child text content:
1042         - https://dom.spec.whatwg.org/#concept-child-text-content
1043         Our code was traversing all Text descendants, not just the children.
1044
1045         The defaultValue setter should act as the setter of the Element's textContent
1046         IDL attribute. Previously, we had a custom logic that was only removing the
1047         text children.
1048
1049         Test: imported/w3c/web-platform-tests/html/semantics/forms/the-textarea-element/value-defaultValue-textContent.html
1050
1051         * dom/ScriptElement.cpp:
1052         (WebCore::ScriptElement::scriptContent const):
1053         * dom/TextNodeTraversal.cpp:
1054         (WebCore::TextNodeTraversal::childTextContent):
1055         * dom/TextNodeTraversal.h:
1056         * html/HTMLTextAreaElement.cpp:
1057         (WebCore::HTMLTextAreaElement::defaultValue const):
1058         (WebCore::HTMLTextAreaElement::setDefaultValue):
1059         * html/HTMLTitleElement.cpp:
1060         (WebCore::HTMLTitleElement::text const):
1061
1062 2017-08-04  Said Abou-Hallawa  <sabouhallawa@apple.com>
1063
1064         RenderImageResourceStyleImage::image() should return the nullImage() if the image is not available
1065         https://bugs.webkit.org/show_bug.cgi?id=174874
1066         <rdar://problem/33530130>
1067
1068         Reviewed by Simon Fraser.
1069
1070         If an <img> element has a non-CachedImage content data, e.g. -webkit-named-image,
1071         RenderImageResourceStyleImage will be created and  attached to the RenderImage.
1072         RenderImageResourceStyleImage::m_cachedImage will be set to null at the 
1073         beginning because the m_styleImage->isCachedImage() is false in this case.
1074         When ImageLoader finishes loading the url of the src attribute,
1075         RenderImageResource::setCachedImage() will be called to set m_cachedImage.
1076
1077         A crash will happen when the RenderImage is destroyed. Destroying the 
1078         RenderImage calls RenderImageResourceStyleImage::shutdown() which checks
1079         m_cachedImage and finds it not null, so it calls RenderImageResourceStyleImage::image()
1080         which ends up calling CSSNamedImageValue::image() which returns a null pointer
1081         because the size is empty. RenderImageResourceStyleImage::shutdown() calls
1082         image()->stopAnimation() without checking the return value of image().
1083
1084         Another crash will happen later when deleting the CachedImage from the memory
1085         cache if CachedImage::canDestroyDecodedData() is called because the client
1086         it gets from m_clients is a freed pointer. This happens because RenderImageResourceStyleImage
1087         has m_styleImage of type StyleGeneratedImage but its m_cachedImage is set
1088         by RenderImageResource::setCachedImage(). When RenderImageResourceStyleImage::shutdown()
1089         is called, it calls  StyleGeneratedImage::removeClient() which does not 
1090         know anything about RenderImageResourceStyleImage::m_cachedImage. So we 
1091         end up having a freed pointer in the m_clients of the CachedImage.
1092
1093         Test: fast/images/image-element-image-content-data.html
1094
1095         * rendering/RenderImageResourceStyleImage.cpp:
1096         (WebCore::RenderImageResourceStyleImage::shutdown):  Revert back the changes
1097         of r208511 in this function. Add a call to image()->stopAnimation() without
1098         checking the return of image() since it will return the nullImage() if
1099         the image not available. There is no need to check m_cachedImage before 
1100         calling image() because image() does not check or access m_cachedImage.
1101
1102         If m_styleImage is not a CachedStyleImage but m_cachedImage is not null,
1103         we need to remove m_renderer from the set of the clients of this m_cachedImage.
1104
1105         (WebCore::RenderImageResourceStyleImage::image const): The base class method
1106         RenderImageResource::image() returns the nullImage() if the image not
1107         available. This is because CachedImage::imageForRenderer() returns
1108         the nullImage() if the image is not available; see CachedImage.h. We should
1109         do the same for the derived class for consistency.
1110
1111 2017-08-04  Jeremy Jones  <jeremyj@apple.com>
1112
1113         Use MPAVRoutingController instead of deprecated versions.
1114         https://bugs.webkit.org/show_bug.cgi?id=175063
1115
1116         Reviewed by Tim Horton.
1117
1118         No new tests because no behavior change. This uses a different platform class to present
1119         an interface.
1120
1121         Remove deprecated MPAudioVideoRoutingPopoverController and MPAVRoutingSheet
1122         Add MPMediaControlsViewController.
1123
1124         * platform/spi/ios/MediaPlayerSPI.h:
1125
1126 2017-08-04  Matt Baker  <mattbaker@apple.com>
1127
1128         Web Inspector: REGRESSION (r220233): Check for null pointer passed to WebGLRenderingContextBase::deleteProgram
1129         https://bugs.webkit.org/show_bug.cgi?id=175196
1130         <rdar://problem/33727603>
1131
1132         Reviewed by Devin Rousso.
1133
1134         * html/canvas/WebGLRenderingContextBase.cpp:
1135         (WebCore::WebGLRenderingContextBase::deleteProgram):
1136
1137 2017-08-04  Matt Lewis  <jlewis3@apple.com>
1138
1139         Unreviewed, rolling out r220271.
1140
1141         Rolling out due to Layout Test failing on iOS Simulator.
1142
1143         Reverted changeset:
1144
1145         "Remove STREAMS_API compilation guard"
1146         https://bugs.webkit.org/show_bug.cgi?id=175165
1147         http://trac.webkit.org/changeset/220271
1148
1149 2017-08-03  Sam Weinig  <sam@webkit.org>
1150
1151         [Cleanup] Remove ScriptGlobalObject
1152         https://bugs.webkit.org/show_bug.cgi?id=175173
1153
1154         Reviewed by Darin Adler.
1155
1156         ScriptGlobalObject's two functions were only being used in
1157         four places. Three of those uses (ScriptGlobalObject::set in 
1158         InspectorFrontendClientLocal, WebInspectorUI, and RemoteWebInspectorUI)
1159         were merged into the new function addSelfToGlobalObjectInWorld on
1160         InspectorFrontendHost. The remaining function (ScriptGlobalObject::get
1161         in InspectorFrontendHost) was easily inlined.
1162
1163         * CMakeLists.txt:
1164         * WebCore.xcodeproj/project.pbxproj:
1165         * bindings/js/JSBindingsAllInOne.cpp:
1166         * bindings/js/ScriptGlobalObject.cpp: Removed.
1167         * bindings/js/ScriptGlobalObject.h: Removed.
1168         Removed ScriptGlobalObject.
1169
1170         * inspector/InspectorFrontendClientLocal.cpp:
1171         (WebCore::InspectorFrontendClientLocal::windowObjectCleared):
1172         Remove call to ScriptGlobalObject::set and use addSelfToGlobalObjectInWorld instead.
1173
1174         * inspector/InspectorFrontendHost.h:
1175         * inspector/InspectorFrontendHost.cpp:
1176         (WebCore::InspectorFrontendHost::showContextMenu):
1177         Inline ScriptGlobalObject::get.
1178
1179         (WebCore::InspectorFrontendHost::addSelfToGlobalObjectInWorld):
1180         Add helper which inlines ScriptGlobalObject::set and works
1181         as a helper for the three inspector frontends.
1182
1183 2017-08-04  Ryan Haddad  <ryanhaddad@apple.com>
1184
1185         Unreviewed, rolling out r220268.
1186
1187         This change caused assertion failures on macOS and iOS Debug
1188         WK2.
1189
1190         Reverted changeset:
1191
1192         "Resource Load Statistics: Report user interaction
1193         immediately, but only when needed"
1194         https://bugs.webkit.org/show_bug.cgi?id=175090
1195         http://trac.webkit.org/changeset/220268
1196
1197 2017-08-04  Youenn Fablet  <youenn@apple.com>
1198
1199         Remove STREAMS_API compilation guard
1200         https://bugs.webkit.org/show_bug.cgi?id=175165
1201
1202         Reviewed by Darin Adler.
1203
1204         No change of behavior.
1205
1206         * Configurations/FeatureDefines.xcconfig:
1207         * Modules/fetch/FetchBody.cpp:
1208         (WebCore::FetchBody::consumeAsStream):
1209         * Modules/fetch/FetchBody.h:
1210         * Modules/fetch/FetchBodyOwner.cpp:
1211         (WebCore::FetchBodyOwner::isDisturbedOrLocked const):
1212         (WebCore::FetchBodyOwner::blobLoadingSucceeded):
1213         (WebCore::FetchBodyOwner::blobLoadingFailed):
1214         (WebCore::FetchBodyOwner::blobChunk):
1215         * Modules/fetch/FetchBodyOwner.h:
1216         * Modules/fetch/FetchResponse.cpp:
1217         (WebCore::FetchResponse::BodyLoader::didSucceed):
1218         (WebCore::FetchResponse::BodyLoader::didFail):
1219         (WebCore::FetchResponse::BodyLoader::didReceiveData):
1220         * Modules/fetch/FetchResponse.h:
1221         * Modules/fetch/FetchResponse.idl:
1222         * Modules/fetch/FetchResponse.js:
1223         (initializeFetchResponse):
1224         * Modules/fetch/FetchResponseSource.cpp:
1225         * Modules/fetch/FetchResponseSource.h:
1226         * Modules/streams/ByteLengthQueuingStrategy.idl:
1227         * Modules/streams/ByteLengthQueuingStrategy.js:
1228         * Modules/streams/CountQueuingStrategy.idl:
1229         * Modules/streams/CountQueuingStrategy.js:
1230         * Modules/streams/ReadableByteStreamController.idl:
1231         * Modules/streams/ReadableByteStreamController.js:
1232         * Modules/streams/ReadableByteStreamInternals.js:
1233         * Modules/streams/ReadableStream.idl:
1234         * Modules/streams/ReadableStream.js:
1235         * Modules/streams/ReadableStreamBYOBReader.idl:
1236         * Modules/streams/ReadableStreamBYOBReader.js:
1237         * Modules/streams/ReadableStreamBYOBRequest.idl:
1238         * Modules/streams/ReadableStreamBYOBRequest.js:
1239         * Modules/streams/ReadableStreamDefaultController.idl:
1240         * Modules/streams/ReadableStreamDefaultController.js:
1241         * Modules/streams/ReadableStreamDefaultReader.idl:
1242         * Modules/streams/ReadableStreamDefaultReader.js:
1243         * Modules/streams/ReadableStreamInternals.js:
1244         * Modules/streams/ReadableStreamSource.h:
1245         * Modules/streams/ReadableStreamSource.idl:
1246         * Modules/streams/StreamInternals.js:
1247         * Modules/streams/WritableStream.idl:
1248         * Modules/streams/WritableStream.js:
1249         * Modules/streams/WritableStreamInternals.js:
1250         * bindings/js/JSDOMGlobalObject.cpp:
1251         (WebCore::isReadableByteStreamAPIEnabled):
1252         (WebCore::JSDOMGlobalObject::addBuiltinGlobals):
1253         * bindings/js/JSReadableStreamPrivateConstructors.cpp:
1254         * bindings/js/JSReadableStreamPrivateConstructors.h:
1255         * bindings/js/JSReadableStreamSourceCustom.cpp:
1256         * bindings/js/ReadableStreamDefaultController.cpp:
1257         * bindings/js/ReadableStreamDefaultController.h:
1258         * page/RuntimeEnabledFeatures.h:
1259         * testing/Internals.cpp:
1260         * testing/Internals.h:
1261         * testing/Internals.idl:
1262
1263 2017-08-04  Zan Dobersek  <zdobersek@igalia.com>
1264
1265         [EME][GStreamer] Register ClearKey CDMFactory
1266         https://bugs.webkit.org/show_bug.cgi?id=175136
1267
1268         Reviewed by Xabier Rodriguez-Calvar.
1269
1270         Register the ClearKey CDM factory in CDMFactoryGStreamer. A CDMFactoryClearKey
1271         singleton object is introduced and used for that registration.
1272
1273         The basic CDMFactoryClearKey and CDMPrivateClearKey methods are implemented,
1274         marking `org.w3.clearkey` as the supported key system and `keyids` as the
1275         supported init data type. Additional logic around key system configurations,
1276         distinctive identifiers, persistent state and related restrictions and
1277         requirements is implemented.
1278
1279         This improves the ClearKey EME tests a bit, now progressing to the point of
1280         failing with a NotAllowedError exception due to the CDMInstance object failing
1281         to properly initialize because of missing implementation.
1282
1283         No new tests -- relevant tests have underlying baselines updated to reflect
1284         changes in behavior.
1285
1286         * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
1287         (WebCore::CDMFactoryClearKey::singleton):
1288         (WebCore::CDMFactoryClearKey::supportsKeySystem):
1289         (WebCore::CDMPrivateClearKey::supportsInitDataType const):
1290         (WebCore::CDMPrivateClearKey::supportsConfiguration const):
1291         (WebCore::CDMPrivateClearKey::supportsConfigurationWithRestrictions const):
1292         (WebCore::CDMPrivateClearKey::supportsSessionTypeWithConfiguration const):
1293         (WebCore::CDMPrivateClearKey::supportsRobustness const):
1294         (WebCore::CDMPrivateClearKey::distinctiveIdentifiersRequirement const):
1295         (WebCore::CDMPrivateClearKey::persistentStateRequirement const):
1296         * platform/encryptedmedia/clearkey/CDMClearKey.h:
1297         * platform/graphics/gstreamer/eme/CDMFactoryGStreamer.cpp:
1298         (WebCore::CDMFactory::platformRegisterFactories):
1299
1300 2017-08-04  John Wilander  <wilander@apple.com>
1301
1302         Resource Load Statistics: Report user interaction immediately, but only when needed
1303         https://bugs.webkit.org/show_bug.cgi?id=175090
1304         <rdar://problem/33685546>
1305
1306         Reviewed by Chris Dumez.
1307
1308         Test: http/tests/loading/resourceLoadStatistics/user-interaction-only-reported-once-within-short-period-of-time.html
1309
1310         * loader/ResourceLoadObserver.cpp:
1311         (WebCore::ResourceLoadObserver::ResourceLoadObserver):
1312         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
1313             Now tells the UI process immediately but also records that it has
1314             done so to avoid doing it when not needed.
1315         (WebCore::ResourceLoadObserver::scheduleNotificationIfNeeded):
1316             Conditional throttling gone, now always throttles.
1317         (WebCore::ResourceLoadObserver::notifyObserver):
1318             Renamed from ResourceLoadObserver::notificationTimerFired().
1319         (WebCore::ResourceLoadObserver::clearState):
1320             New function to allow the test runner to reset the web process'
1321             statistics state now that we keep track of whether or not we've
1322             reported user interaction to the UI process.
1323         (WebCore::ResourceLoadObserver::setShouldThrottleObserverNotifications): Deleted.
1324         (WebCore::ResourceLoadObserver::notificationTimerFired): Deleted.
1325         * loader/ResourceLoadObserver.h:
1326         (): Deleted.
1327         * testing/Internals.cpp:
1328         (WebCore::Internals::resetToConsistentState):
1329         (WebCore::Internals::setResourceLoadStatisticsShouldThrottleObserverNotifications): Deleted.
1330             No longer needed since user interaction is always communicated
1331             immediately.
1332         * testing/Internals.h:
1333         * testing/Internals.idl:
1334
1335 2017-08-04  Zan Dobersek  <zdobersek@igalia.com>
1336
1337         [EME] Push CDMFactory into the platform layer
1338         https://bugs.webkit.org/show_bug.cgi?id=175129
1339
1340         Reviewed by Xabier Rodriguez-Calvar.
1341
1342         This is a follow-up to r219678 that moved the majority of CDM abstraction
1343         classes into the platform layer, but missed the CDMFactory class.
1344
1345         The CDMFactory abstraction is now also placed in the platform layer. Only
1346         change to the interface is that the createCDM() method can't accept a CDM
1347         object reference anymore since that class is cemented into the WebCore
1348         layer, and no current implementation used it anyway.
1349
1350         Additionally, the static Vector object of registered factories is moved
1351         under the CDMFactory class, along with the register and unregister
1352         functions. The platformRegisterFactories() function is added to allow for
1353         platform-specific factory registrations to occur when the registered
1354         factories are queried for the first time. Empty implementation for this
1355         function is provided for non-GStreamer platforms, while for GStreamer
1356         the implementation is kept in CDMFactoryGStreamer.cpp. It's still empty
1357         for now, but it will register the ClearKey factory there in the near
1358         future.
1359
1360         No new tests -- none affected, only refactoring.
1361
1362         * CMakeLists.txt:
1363         * Modules/encryptedmedia/CDM.cpp:
1364         (WebCore::createCDMPrivateForKeySystem):
1365         (WebCore::CDM::supportsKeySystem):
1366         (WebCore::CDM::CDM):
1367         (): Deleted.
1368         (WebCore::CDM::registerCDMFactory): Deleted.
1369         (WebCore::CDM::unregisterCDMFactory): Deleted.
1370         * Modules/encryptedmedia/CDM.h:
1371         (WebCore::CDMFactory::~CDMFactory): Deleted.
1372         * PlatformWPE.cmake:
1373         * platform/GStreamer.cmake:
1374         * platform/encryptedmedia/CDMFactory.cpp: Added.
1375         (WebCore::CDMFactory::registerFactory):
1376         (WebCore::CDMFactory::unregisterFactory):
1377         (WebCore::CDMFactory::platformRegisterFactories):
1378         * platform/encryptedmedia/CDMFactory.h: Added.
1379         (WebCore::CDMFactory::~CDMFactory):
1380         * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
1381         (WebCore::CDMFactoryClearKey::createCDM):
1382         * platform/encryptedmedia/clearkey/CDMClearKey.h:
1383         * platform/encryptedmedia/gstreamer/CDMFactoryGStreamer.cpp: Added.
1384         (WebCore::CDMFactory::platformRegisterFactories):
1385         * testing/MockCDMFactory.cpp:
1386         (WebCore::m_weakPtrFactory):
1387         (WebCore::MockCDMFactory::unregister):
1388         (WebCore::MockCDMFactory::createCDM):
1389         * testing/MockCDMFactory.h:
1390
1391 2017-08-04  Frederic Wang  <fwang@igalia.com>
1392
1393         ScrollingTreeOverflowScrollingNodeIOS uses the wrong fixed position rectangle
1394         https://bugs.webkit.org/show_bug.cgi?id=175135
1395
1396         Reviewed by Simon Fraser.
1397
1398         This patch modifies ScrollingTreeOverflowScrollingNodeIOS::updateChildNodesAfterScroll so
1399         that it uses the fixed position rectangle relative of the first frame ancestor instead of
1400         the one of the main frame. This makes it consistent with ScrollingTreeFrameScrollingNodeIOS
1401         and RenderLayerCompositor. This fixes some flickering issues on iOS.
1402
1403         Test: fast/scrolling/ios/fixed-inside-overflow-inside-iframe.html
1404
1405         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
1406         (WebCore::ScrollingTreeFrameScrollingNode::fixedPositionRect): Helper function to get the
1407         fixed position rect to use for that frame.
1408         * page/scrolling/ScrollingTreeNode.cpp:
1409         (WebCore::ScrollingTreeNode::enclosingFrameNode const): Helper function to get the enclosing
1410         frame for this scrolling node or null if there is none.
1411         * page/scrolling/ScrollingTreeNode.h: Declare enclosingFrameNode.
1412
1413 2017-08-04  Zan Dobersek  <zdobersek@igalia.com>
1414
1415         Unreviewed. Removing redundant NotImplemented.h header inclusions
1416         and cleaning up whitespace issues in libgcrypt-specific CryptoKeyEC
1417         and CryptoKeyRSA implementation files.
1418
1419         * crypto/gcrypt/CryptoKeyECGCrypt.cpp:
1420         * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
1421
1422 2017-08-04  Jeremy Jones  <jeremyj@apple.com>
1423
1424         Remove unnecesary call to status bar SPI.
1425         https://bugs.webkit.org/show_bug.cgi?id=175176
1426         rdar://problem/20887306
1427
1428         Reviewed by Darin Adler.
1429
1430         No new tests because no behavior change.
1431
1432         This removes an obsolete call to SPI.
1433
1434         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
1435         (VideoFullscreenInterfaceAVKit::cleanupFullscreen):
1436
1437 2017-08-03  Zan Dobersek  <zdobersek@igalia.com>
1438
1439         [GCrypt] Implement CryptoKeyEC PKCS#8 imports
1440         https://bugs.webkit.org/show_bug.cgi?id=173647
1441
1442         Reviewed by Jiewen Tan.
1443
1444         No new tests -- affected tests are now passing and are unskipped.
1445
1446         Implement libgcrypt-based support for PKCS#8 imports of EC keys.
1447
1448         Existing libtasn1 utilities are used to achieve this. First, the provided key data
1449         is decoded against the PrivateKeyInfo ASN.1 definition. First, the version member
1450         of that structure is validated, followed by the algorithm member. The latter is
1451         also properly tested depending on this being an import of an ECDSA or ECDH key.
1452
1453         Data of the parameters member is decoded against the ECParameters ASN.1 definition,
1454         and the namedCurve object identifier is validated, making sure it represents a
1455         valid EC curve and that this curve maches the one specified for the import
1456         operation.
1457
1458         Data of the privateKey member is decoded against the ECPrivateKey ASN.1 definition.
1459         The version member of that structure is properly validated. The optional parameters
1460         member of that structure is already decoded against the ECParameters ASN.1
1461         definition. If present, it is checked to contain a valid EC curve identifier that
1462         matches the specified curve.
1463
1464         The optional publicKey member of the ECPrivateKey structure is validated, testing
1465         that its data matches in size an uncompressed EC point, and that the first byte
1466         of this data is 0x04, as expected for an uncompressed EC point.
1467
1468         What's left is the private key data on the initial ECPrivateKey structure. That
1469         data is retrieved and validated, making sure its size matches the size of the
1470         specified curve. The `private-key` s-expression is then constructed, embedding
1471         the curve name and the validated private key data. This s-expression is then used
1472         to construct an EC context.
1473
1474         If the optional publicKey data was provided, it's used to set the `q` parameter
1475         for this EC context. Otherwise, the value for `q` is computed on-the-fly for the
1476         specified EC and the provided private key. The `q` point is then tested through
1477         the gcry_mpi_ec_curve_point() function, making sure that the derived point is
1478         indeed located on the given EC.
1479
1480         Finally, with the private key properly validated, a new CryptoKeyEC object is
1481         constructed, using the `private-key` s-expression and the parameters that were
1482         specified for this import operation.
1483
1484         * crypto/gcrypt/CryptoKeyECGCrypt.cpp:
1485         (WebCore::CryptoKeyEC::platformImportPkcs8):
1486         * crypto/gcrypt/GCryptUtilities.h:
1487
1488 2017-08-03  Chris Dumez  <cdumez@apple.com>
1489
1490         Fix parsing of <meta http-equiv=refresh> to allow time starting with a '.' without a leading 0
1491         https://bugs.webkit.org/show_bug.cgi?id=175132
1492
1493         Reviewed by Darin Adler.
1494
1495         Fix parsing of <meta http-equiv=refresh> to allow time starting with a '.', without
1496         a leading 0. This is as per https://github.com/whatwg/html/pull/2852.
1497
1498         The latest spec is at:
1499         - https://html.spec.whatwg.org/multipage/semantics.html#attr-meta-http-equiv-refresh
1500
1501         Test: imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/parsing.html
1502
1503         * html/parser/HTMLParserIdioms.cpp:
1504         (WebCore::parseHTTPRefreshInternal):
1505
1506 2017-08-03  Brian Burg  <bburg@apple.com>
1507
1508         Remove ENABLE(WEB_SOCKET) guards
1509         https://bugs.webkit.org/show_bug.cgi?id=167044
1510
1511         Reviewed by Joseph Pecoraro.
1512
1513         * Configurations/FeatureDefines.xcconfig:
1514         * Modules/websockets/ThreadableWebSocketChannel.cpp:
1515         * Modules/websockets/ThreadableWebSocketChannel.h:
1516         * Modules/websockets/ThreadableWebSocketChannelClientWrapper.cpp:
1517         * Modules/websockets/ThreadableWebSocketChannelClientWrapper.h:
1518         * Modules/websockets/WebSocket.cpp:
1519         * Modules/websockets/WebSocket.h:
1520         * Modules/websockets/WebSocket.idl:
1521         * Modules/websockets/WebSocketChannel.cpp:
1522         * Modules/websockets/WebSocketChannel.h:
1523         * Modules/websockets/WebSocketChannelClient.h:
1524         * Modules/websockets/WebSocketDeflateFramer.cpp:
1525         * Modules/websockets/WebSocketDeflateFramer.h:
1526         * Modules/websockets/WebSocketDeflater.cpp:
1527         * Modules/websockets/WebSocketDeflater.h:
1528         * Modules/websockets/WebSocketExtensionDispatcher.cpp:
1529         * Modules/websockets/WebSocketExtensionDispatcher.h:
1530         * Modules/websockets/WebSocketExtensionParser.cpp:
1531         * Modules/websockets/WebSocketExtensionParser.h:
1532         * Modules/websockets/WebSocketExtensionProcessor.h:
1533         * Modules/websockets/WebSocketFrame.cpp:
1534         * Modules/websockets/WebSocketFrame.h:
1535         * Modules/websockets/WebSocketHandshake.cpp:
1536         * Modules/websockets/WebSocketHandshake.h:
1537         * Modules/websockets/WorkerThreadableWebSocketChannel.cpp:
1538         * Modules/websockets/WorkerThreadableWebSocketChannel.h:
1539         * dom/Document.cpp:
1540         (WebCore::Document::Document):
1541         (WebCore::Document::idbConnectionProxy):
1542         (WebCore::Document::socketProvider):
1543         * dom/Document.h:
1544         * dom/ScriptExecutionContext.h:
1545         * inspector/InspectorInstrumentation.cpp:
1546         (WebCore::InspectorInstrumentation::didSendWebSocketFrameImpl):
1547         * inspector/InspectorInstrumentation.h:
1548         (WebCore::InspectorInstrumentation::didSendWebSocketFrame):
1549         * inspector/InspectorNetworkAgent.cpp:
1550         * inspector/InspectorNetworkAgent.h:
1551         * page/RuntimeEnabledFeatures.cpp:
1552         (WebCore::RuntimeEnabledFeatures::webSocketEnabled const):
1553         * page/RuntimeEnabledFeatures.h:
1554         * page/SocketProvider.cpp:
1555         * page/SocketProvider.h:
1556         * workers/WorkerGlobalScope.cpp:
1557         (WebCore::WorkerGlobalScope::WorkerGlobalScope):
1558         * workers/WorkerGlobalScope.h:
1559         * workers/WorkerMessagingProxy.cpp:
1560         (WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
1561         * workers/WorkerThread.cpp:
1562         (WebCore::WorkerThread::WorkerThread):
1563         (WebCore::WorkerThread::socketProvider):
1564         * workers/WorkerThread.h:
1565
1566 2017-08-03  Don Olmstead  <don.olmstead@sony.com>
1567
1568         Remove LayoutUnit dependency in TextStream
1569         https://bugs.webkit.org/show_bug.cgi?id=175110
1570
1571         Reviewed by Zalan Bujtas.
1572
1573         No new tests. No change in behavior.
1574
1575         * CMakeLists.txt:
1576         * WebCore.xcodeproj/project.pbxproj:
1577         * platform/LayoutUnit.cpp: Added.
1578         (WebCore::operator<<):
1579         * platform/LayoutUnit.h:
1580         * platform/text/TextStream.cpp:
1581         * platform/text/TextStream.h:
1582
1583 2017-08-03  Jeremy Jones  <jeremyj@apple.com>
1584
1585         Improve WebKitLegacy video fullscreen animation begin and end rects.
1586         https://bugs.webkit.org/show_bug.cgi?id=175152
1587         rdar://problem/32840576
1588
1589         Reviewed by Eric Carlson.
1590
1591         No new tests, becuase this change has no effect on the DOM.
1592
1593         This change uses different rects for fullscreen animation to prevent the animation
1594         from failing, and to improve the aesthetics of the animation.
1595
1596         * platform/mac/WebVideoFullscreenController.mm:
1597         (frameExpandedToRatioOfFrame):
1598         (-[WebVideoFullscreenController enterFullscreen:]):
1599         (-[WebVideoFullscreenController exitFullscreen]):
1600         (-[WebVideoFullscreenWindow animateFromRect:toRect:withSubAnimation:controllerAction:]):
1601         (constrainFrameToRatioOfFrame): Deleted.
1602
1603 2017-08-03  Jer Noble  <jer.noble@apple.com>
1604
1605         [EME][Mac] SecureStop left on disk in Private Browsing mode.
1606         https://bugs.webkit.org/show_bug.cgi?id=175162
1607
1608         Reviewed by Eric Carlson.
1609
1610         Return an empty string from mediaKeysStorageDirectory() when the page indicates that storage should
1611         be ephemeral(). Previously, an empty string in this case would be treated as an error. Instead, treat
1612         an empty string as valid, and do not try to store or retrieve session information to disk in that case.
1613
1614         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
1615         (WebCore::WebKitMediaKeySession::mediaKeysStorageDirectory const):
1616         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
1617         (WebCore::CDMSessionAVContentKeySession::releaseKeys):
1618         (WebCore::CDMSessionAVContentKeySession::update):
1619         (WebCore::CDMSessionAVContentKeySession::generateKeyReleaseMessage):
1620         (WebCore::CDMSessionAVContentKeySession::contentKeySession):
1621         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:
1622         (WebCore::CDMSessionMediaSourceAVFObjC::storagePath const):
1623
1624 2017-08-03  Youenn Fablet  <youenn@apple.com>
1625
1626         [Fetch API] Add support for Request keepalive getter
1627         https://bugs.webkit.org/show_bug.cgi?id=175151
1628
1629         Reviewed by Chris Dumez.
1630
1631         Test: imported/w3c/web-platform-tests/fetch/api/request/request-keepalive.html
1632
1633         Adding keepalive as a fetch option.
1634         Adding initialization and getter of keepalive into FetchRequest.
1635
1636         * Modules/fetch/FetchRequest.cpp:
1637         (WebCore::buildOptions):
1638         * Modules/fetch/FetchRequest.h:
1639         * Modules/fetch/FetchRequest.idl:
1640         * loader/FetchOptions.h:
1641
1642 2017-08-03  Yoshiaki Jitsukawa  <jitsu@rd.scei.sony.co.jp>
1643
1644         [PAL] Move spi/cf directory into PAL
1645         https://bugs.webkit.org/show_bug.cgi?id=175057
1646
1647         Reviewed by Antti Koivisto.
1648
1649         * WebCore.xcodeproj/project.pbxproj:
1650         * loader/cocoa/DiskCacheMonitorCocoa.mm:
1651         * loader/cocoa/SubresourceLoaderCocoa.mm:
1652         * loader/mac/ResourceLoaderMac.mm:
1653         * platform/cf/CoreMediaSoftLink.cpp:
1654         * platform/cf/CoreMediaSoftLink.h:
1655         * platform/mac/PluginBlacklist.mm:
1656         * platform/mac/WebCoreNSStringExtras.mm:
1657         * platform/mac/WebGLBlacklist.mm:
1658         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
1659         * platform/network/NetworkStorageSession.h:
1660         * platform/network/cf/CookieJarCFNet.cpp:
1661         * platform/network/cf/CredentialStorageCFNet.cpp:
1662         * platform/network/cf/ResourceHandleCFNet.cpp:
1663         * platform/network/cf/ResourceHandleCFURLConnectionDelegate.cpp:
1664         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
1665         * platform/network/cf/ResourceRequestCFNet.cpp:
1666         * platform/network/cf/ResourceRequestCFNet.h:
1667         * platform/network/cf/ResourceResponse.h:
1668         * platform/network/cf/ResourceResponseCFNet.cpp:
1669         * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
1670         * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
1671         * platform/network/cocoa/CookieStorageObserver.h:
1672         * platform/network/cocoa/CredentialCocoa.h:
1673         * platform/network/cocoa/NetworkStorageSessionCocoa.mm:
1674         * platform/network/cocoa/ResourceRequestCocoa.mm:
1675         * platform/network/cocoa/ResourceResponseCocoa.mm:
1676         * platform/network/ios/ResourceRequestIOS.mm:
1677         * platform/network/mac/CookieJarMac.mm:
1678         * platform/network/mac/FormDataStreamMac.mm:
1679         * platform/network/mac/ResourceHandleMac.mm:
1680         * platform/network/mac/ResourceRequestMac.mm:
1681         * platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
1682         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
1683         * platform/network/mac/WebCoreURLResponse.h:
1684         * testing/cocoa/WebArchiveDumpSupport.mm:
1685
1686 2017-08-03  Youenn Fablet  <youenn@apple.com>
1687
1688         Remove FETCH_API compilation guard
1689         https://bugs.webkit.org/show_bug.cgi?id=175154
1690
1691         Reviewed by Chris Dumez.
1692
1693         No change of behavior.
1694
1695         * Configurations/FeatureDefines.xcconfig:
1696         * Modules/fetch/DOMWindowFetch.cpp:
1697         * Modules/fetch/DOMWindowFetch.h:
1698         * Modules/fetch/DOMWindowFetch.idl:
1699         * Modules/fetch/FetchBody.cpp:
1700         * Modules/fetch/FetchBody.h:
1701         * Modules/fetch/FetchBody.idl:
1702         * Modules/fetch/FetchBodyConsumer.cpp:
1703         * Modules/fetch/FetchBodyConsumer.h:
1704         * Modules/fetch/FetchBodyOwner.cpp:
1705         * Modules/fetch/FetchBodyOwner.h:
1706         * Modules/fetch/FetchHeaders.cpp:
1707         * Modules/fetch/FetchHeaders.h:
1708         * Modules/fetch/FetchHeaders.idl:
1709         * Modules/fetch/FetchInternals.js:
1710         * Modules/fetch/FetchLoader.cpp:
1711         * Modules/fetch/FetchLoader.h:
1712         * Modules/fetch/FetchLoaderClient.h:
1713         * Modules/fetch/FetchRequest.cpp:
1714         * Modules/fetch/FetchRequest.h:
1715         * Modules/fetch/FetchRequest.idl:
1716         * Modules/fetch/FetchResponse.cpp:
1717         * Modules/fetch/FetchResponse.h:
1718         * Modules/fetch/FetchResponse.idl:
1719         * Modules/fetch/FetchResponse.js:
1720         * Modules/fetch/FetchResponseSource.cpp:
1721         * Modules/fetch/FetchResponseSource.h:
1722         * Modules/fetch/WorkerGlobalScopeFetch.cpp:
1723         * Modules/fetch/WorkerGlobalScopeFetch.h:
1724         * Modules/fetch/WorkerGlobalScopeFetch.idl:
1725         * page/RuntimeEnabledFeatures.h:
1726         (WebCore::RuntimeEnabledFeatures::fetchAPIEnabled const):
1727
1728 2017-08-03  Devin Rousso  <drousso@apple.com>
1729
1730         Web Inspector: add button to open Inspector^2
1731         https://bugs.webkit.org/show_bug.cgi?id=175108
1732
1733         Reviewed by Brian Burg.
1734
1735         This patch just exposes a function to the inspector page. No new functionality was added.
1736
1737         * inspector/InspectorFrontendHost.idl:
1738         * inspector/InspectorFrontendHost.h:
1739         * inspector/InspectorFrontendHost.cpp:
1740         (WebCore::InspectorFrontendHost::inspectInspector):
1741
1742 2017-08-03  Matt Baker  <mattbaker@apple.com>
1743
1744         Web Inspector: Instrument WebGLProgram created/deleted
1745         https://bugs.webkit.org/show_bug.cgi?id=175059
1746
1747         Reviewed by Devin Rousso.
1748
1749         Tests: inspector/canvas/shaderProgram-add-remove-webgl.html
1750                inspector/canvas/shaderProgram-add-remove-webgl2.html
1751
1752         This patch adds instrumentation to WebGLRenderingContextBase for tracking
1753         WebGLPrograms. A new helper class, InspectorShaderProgram, is used by
1754         the CanvasAgent to hold related data.
1755
1756         * CMakeLists.txt:
1757         * WebCore.xcodeproj/project.pbxproj:
1758
1759         * html/canvas/WebGLRenderingContextBase.cpp:
1760         (WebCore::WebGLRenderingContextBase::createProgram):
1761         (WebCore::WebGLRenderingContextBase::deleteProgram):
1762
1763         * inspector/InspectorCanvasAgent.cpp:
1764         (WebCore::InspectorCanvasAgent::enable):
1765         (WebCore::InspectorCanvasAgent::frameNavigated):
1766         (WebCore::InspectorCanvasAgent::didCreateProgram):
1767         (WebCore::InspectorCanvasAgent::willDeleteProgram):
1768         (WebCore::InspectorCanvasAgent::clearCanvasData):
1769         (WebCore::InspectorCanvasAgent::unbindCanvas):
1770         (WebCore::InspectorCanvasAgent::unbindProgram):
1771         (WebCore::InspectorCanvasAgent::assertInspectorProgram):
1772         (WebCore::InspectorCanvasAgent::findInspectorProgram):
1773         * inspector/InspectorCanvasAgent.h:
1774
1775         * inspector/InspectorInstrumentation.cpp:
1776         (WebCore::InspectorInstrumentation::didCreateCSSCanvasImpl):
1777         (WebCore::InspectorInstrumentation::didChangeCSSCanvasClientNodesImpl):
1778         (WebCore::InspectorInstrumentation::didCreateCanvasRenderingContextImpl):
1779         (WebCore::InspectorInstrumentation::didChangeCanvasMemoryImpl):
1780         (WebCore::InspectorInstrumentation::recordCanvasActionImpl):
1781         (WebCore::InspectorInstrumentation::didFinishRecordingCanvasFrameImpl):
1782         (WebCore::InspectorInstrumentation::didCreateProgramImpl):
1783         (WebCore::InspectorInstrumentation::willDeleteProgramImpl):
1784
1785         * inspector/InspectorInstrumentation.h:
1786         (WebCore::InspectorInstrumentation::recordCanvasActionImpl):
1787         (WebCore::InspectorInstrumentation::didCreateCSSCanvas):
1788         (WebCore::InspectorInstrumentation::didChangeCSSCanvasClientNodes):
1789         (WebCore::InspectorInstrumentation::didCreateCanvasRenderingContext):
1790         (WebCore::InspectorInstrumentation::didChangeCanvasMemory):
1791         (WebCore::InspectorInstrumentation::recordCanvasAction):
1792         (WebCore::InspectorInstrumentation::didFinishRecordingCanvasFrame):
1793         (WebCore::InspectorInstrumentation::didCreateProgram):
1794         (WebCore::InspectorInstrumentation::willDeleteProgram):
1795
1796         * inspector/InspectorShaderProgram.cpp: Added.
1797         (WebCore::InspectorShaderProgram::create):
1798         (WebCore::InspectorShaderProgram::InspectorShaderProgram):
1799         (WebCore::InspectorShaderProgram::context const):
1800         * inspector/InspectorShaderProgram.h: Added.
1801
1802 2017-08-03  Matt Lewis  <jlewis3@apple.com>
1803
1804         Unreviewed, rolling out r220209.
1805
1806         This caused internal build failures.
1807
1808         Reverted changeset:
1809
1810         "Use MPAVRoutingController instead of deprecated versions."
1811         https://bugs.webkit.org/show_bug.cgi?id=175063
1812         http://trac.webkit.org/changeset/220209
1813
1814 2017-08-03  Brady Eidson  <beidson@apple.com>
1815
1816         Add SW IDLs and stub out basic functionality.
1817         https://bugs.webkit.org/show_bug.cgi?id=175115
1818
1819         Reviewed by Chris Dumez.
1820
1821         No new tests (Currently no behavior change).
1822
1823         Overall note: This feature is EnabledAtRuntime as opposed to EnabledBySetting because
1824         the Settings-based code generation is completely broken for non-Document contexts,
1825         whereas the RuntimeEnabledFeatures-based generation is not.
1826     
1827         * CMakeLists.txt:
1828         * Configurations/FeatureDefines.xcconfig:
1829         * DerivedSources.make:
1830         * WebCore.xcodeproj/project.pbxproj:
1831
1832         * bindings/scripts/preprocess-idls.pl: Handle the new global scope c'tor file.
1833
1834         * bindings/js/JSServiceWorkerContainerCustom.cpp: Added.
1835         (WebCore::JSServiceWorkerContainer::ready const):
1836
1837         * bindings/js/JSWorkerGlobalScopeBase.cpp:
1838         (WebCore::toJSWorkerGlobalScope): Refactor to handle both types of derived workers.
1839         (WebCore::toJSServiceWorkerGlobalScope):
1840         * bindings/js/JSWorkerGlobalScopeBase.h:
1841
1842         * dom/EventNames.h:
1843         * dom/EventTargetFactory.in:
1844
1845         * features.json: Change status of feature.
1846
1847         * page/Navigator.idl:
1848         * page/NavigatorBase.cpp:
1849         (WebCore::NavigatorBase::serviceWorker):
1850         * page/NavigatorBase.h:
1851         * page/NavigatorServiceWorker.idl: Added.
1852
1853         * page/RuntimeEnabledFeatures.h:
1854         (WebCore::RuntimeEnabledFeatures::serviceWorkerEnabled const):
1855         (WebCore::RuntimeEnabledFeatures::setServiceWorkerEnabled):
1856
1857         * workers/ServiceWorker.cpp: Added.
1858         (WebCore::ServiceWorker::postMessage):
1859         (WebCore::ServiceWorker::~ServiceWorker):
1860         (WebCore::ServiceWorker::scriptURL const):
1861         (WebCore::ServiceWorker::state const):
1862         (WebCore::ServiceWorker::eventTargetInterface const):
1863         (WebCore::ServiceWorker::scriptExecutionContext const):
1864         * workers/ServiceWorker.h: Added.
1865         * workers/ServiceWorker.idl: Added.
1866
1867         * workers/ServiceWorkerContainer.cpp: Added.
1868         (WebCore::ServiceWorkerContainer::~ServiceWorkerContainer):
1869         (WebCore::ServiceWorkerContainer::controller const):
1870         (WebCore::ServiceWorkerContainer::ready):
1871         (WebCore::ServiceWorkerContainer::addRegistration):
1872         (WebCore::ServiceWorkerContainer::getRegistration):
1873         (WebCore::ServiceWorkerContainer::getRegistrations):
1874         (WebCore::ServiceWorkerContainer::startMessages):
1875         (WebCore::ServiceWorkerContainer::eventTargetInterface const):
1876         (WebCore::ServiceWorkerContainer::scriptExecutionContext const):
1877         * workers/ServiceWorkerContainer.h: Added.
1878         * workers/ServiceWorkerContainer.idl: Added.
1879
1880         * workers/ServiceWorkerGlobalScope.cpp: Added.
1881         (WebCore::ServiceWorkerGlobalScope::registration):
1882         (WebCore::ServiceWorkerGlobalScope::skipWaiting):
1883         * workers/ServiceWorkerGlobalScope.h: Added.
1884         * workers/ServiceWorkerGlobalScope.idl: Added.
1885
1886         * workers/ServiceWorkerRegistration.cpp: Added.
1887         (WebCore::ServiceWorkerRegistration::~ServiceWorkerRegistration):
1888         (WebCore::ServiceWorkerRegistration::installing):
1889         (WebCore::ServiceWorkerRegistration::waiting):
1890         (WebCore::ServiceWorkerRegistration::active):
1891         (WebCore::ServiceWorkerRegistration::scope const):
1892         (WebCore::ServiceWorkerRegistration::update):
1893         (WebCore::ServiceWorkerRegistration::unregister):
1894         (WebCore::ServiceWorkerRegistration::eventTargetInterface const):
1895         (WebCore::ServiceWorkerRegistration::scriptExecutionContext const):
1896         * workers/ServiceWorkerRegistration.h: Added.
1897         * workers/ServiceWorkerRegistration.idl: Added.
1898
1899 2017-08-03  Yoshiaki Jitsukawa  <jitsu@rd.scei.sony.co.jp>
1900
1901         [WebCore] Sort Xcode project files
1902         https://bugs.webkit.org/show_bug.cgi?id=175121
1903
1904         Reviewed by Antti Koivisto.
1905
1906         * WebCore.xcodeproj/project.pbxproj:
1907
1908 2017-08-02  Sam Weinig  <sam@webkit.org>
1909
1910         [WebIDL] Convert MutationCallback to be a normal generated callback
1911         https://bugs.webkit.org/show_bug.cgi?id=174140
1912
1913         Reviewed by Darin Adler.
1914
1915         To make this work more nicely, I:
1916         - Added the ability to for non-nullable interfaces in sequences to be passed
1917           via a Ref<> rather than a RefPtr<> as a parameter to a callback function.
1918           (e.g. callback MyCallback = void (sequence<Foo> foos) will now have the 
1919           signature, CallbackResult<void> handleEvent(const Vector<Ref<Foo>>&) rather
1920           than CallbackResult<void> handleEvent(const Vector<RefPtr<Foo>>&).
1921         - Added a new extended attribute for callback functions called [CallbackThisObject=Type]
1922           which allows you to specify that the callback needs a this object in addition
1923           to its arguments. When specified, the first argument of the C++ implementation
1924           function will now correspond to the this object, with the remaining arguments
1925           shifted over one.
1926         - Converted callback objects to all inherit directly from ActiveDOMCallback rather
1927           than having the generated JS callback derived class inherit from it. This allows
1928           us to have access to a callback's canInvokeCallback() function anywhere (needed
1929           for MutationCallback) as well as giving a place to put an optional virtual 
1930           visitJSFunction to allow marking weak callbacks (while not an ideal layering, 
1931           this matches what we do in EventListener). This change requires each callback to
1932           have a bit more code to import the ActiveDOMCallback's constructor and requires
1933           non-JS derived callbacks to pass a ScriptExecutionContext (e.g. the Document).
1934
1935         * CMakeLists.txt:
1936         * DerivedSources.make:
1937         * WebCore.xcodeproj/project.pbxproj:
1938         * bindings/js/JSMutationCallback.cpp: Removed.
1939         * bindings/js/JSMutationCallback.h: Removed.
1940         Remove custom JSMutationCallback.h/cpp
1941
1942         * Modules/geolocation/PositionCallback.h:
1943         * Modules/geolocation/PositionErrorCallback.h:
1944         * Modules/notifications/NotificationPermissionCallback.h:
1945         * Modules/webaudio/AudioBufferCallback.h:
1946         * Modules/webdatabase/DatabaseCallback.h:
1947         * Modules/webdatabase/SQLStatementCallback.h:
1948         * Modules/webdatabase/SQLStatementErrorCallback.h:
1949         * Modules/webdatabase/SQLTransactionCallback.h:
1950         * Modules/webdatabase/SQLTransactionErrorCallback.h:
1951         * css/MediaQueryListListener.h:
1952         * dom/NodeFilter.h:
1953         * dom/RequestAnimationFrameCallback.h:
1954         * dom/StringCallback.h:
1955         * fileapi/BlobCallback.h:
1956         * html/VoidCallback.h:
1957         * page/IntersectionObserverCallback.h:
1958         * page/PerformanceObserverCallback.h:
1959         Add ActiveDOMCallback as a base class. Import the ActiveDOMCallback constructor.
1960
1961         * Modules/mediastream/MediaDevicesRequest.cpp:
1962         (WebCore::MediaDevicesRequest::filterDeviceList):
1963         (WebCore::MediaDevicesRequest::start):
1964         * Modules/mediastream/MediaDevicesRequest.h:
1965         Change filterDeviceList to take a Vector of Refs.
1966
1967         * bindings/IDLTypes.h:
1968         Add InnerParameterType and NullableInnerParameterType type hooks
1969         and specialize wrappers to use Ref for InnerParameterType, and RefPtr
1970         for NullableInnerParameterType.
1971
1972         * bindings/js/JSCallbackData.cpp:
1973         * bindings/js/JSCallbackData.h:
1974         Add support for passing a this object and give JSCallbackDataWeak a visitJSFunction
1975         to allow marking the underlying function.
1976
1977         * bindings/js/JSMutationObserverCustom.cpp:
1978         (WebCore::JSMutationObserver::visitAdditionalChildren):
1979         (WebCore::constructJSMutationObserver): Deleted.
1980         Remove the custom constructor and replace it with a custom visitAdditionalChildren
1981         that calls the new ActiveDOMObject's visitJSFunction.
1982
1983         * bindings/scripts/CodeGenerator.pm:
1984         (ParseType):
1985         Add helper to parse a type and cache the result.
1986
1987         * bindings/scripts/CodeGeneratorJS.pm:
1988         (GenerateCallbackHeaderContent):
1989         (GenerateCallbackImplementationContent):
1990         (GetJSCallbackDataType): Deleted.
1991         - Add support for [CallbackThisObject]. When [CallbackThisObject] is not specified, use jsUndefined() 
1992           as the this object as specified by WebIDL.
1993         - Stop inheriting from ActiveDOMCallback now that callbacks need to do this themselves.
1994         - Add a visitJSFunction override for weak callback functions which calls into the callback data.
1995
1996         * bindings/scripts/IDLAttributes.json:
1997         Add [CallbackThisObject].
1998
1999         * bindings/scripts/IDLParser.pm:
2000         (ParseType):
2001         Add entry point to parse a single type.
2002
2003         * css/FontFaceSet.h:
2004         Use Ref rather than RefPtr for the faces sequence.
2005
2006         * dom/ActiveDOMCallback.h:
2007         (WebCore::ActiveDOMCallback::visitJSFunction):
2008         Add an optional visitJSFunction virtual function so that derived classes
2009         have a way of marking underlying function objects.
2010
2011         * dom/MutationCallback.h:
2012         Convert to support generation (return a CallbackResult, inherit from ActiveDOMObject).
2013
2014         * dom/MutationCallback.idl: Added.
2015         Added to generate the callback. Uses the new [CallbackThisObject].
2016
2017         * dom/MutationObserver.cpp:
2018         (WebCore::MutationObserver::deliver):
2019         Switch to call idiomatic handleEvent, and pass *this as the first parameter
2020         which will be translated into the this object.
2021
2022         * dom/MutationObserver.h:
2023         (WebCore::MutationObserver::callback):
2024         Expose the callback so it can marked during GC.
2025
2026         * dom/MutationObserver.idl:
2027         Remove CustomConstructor and replace it with a custom mark function.
2028
2029         * dom/NativeNodeFilter.cpp:
2030         * dom/NativeNodeFilter.h:
2031         * inspector/InspectorDatabaseAgent.cpp:
2032         Pass now needed ScriptExecutionContext to non-js based callbacks.
2033
2034         * bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
2035         * bindings/scripts/test/JS/JSTestCallbackFunctionRethrow.cpp:
2036         * bindings/scripts/test/JS/JSTestCallbackFunctionWithThisObject.cpp: Added.
2037         * bindings/scripts/test/JS/JSTestCallbackFunctionWithThisObject.h: Added.
2038         * bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.cpp:
2039         * bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
2040         * bindings/scripts/test/JS/JSTestCallbackInterface.h:
2041         * bindings/scripts/test/JS/JSTestVoidCallbackFunction.cpp:
2042         * bindings/scripts/test/TestCallbackFunctionWithThisObject.idl: Added.
2043         * bindings/scripts/test/TestCallbackInterface.idl:
2044         Add/update tests.
2045
2046 2017-08-03  Jeremy Jones  <jeremyj@apple.com>
2047
2048         Use MPAVRoutingController instead of deprecated versions.
2049         https://bugs.webkit.org/show_bug.cgi?id=175063
2050
2051         Reviewed by Tim Horton.
2052
2053         No new tests because no behavior change. This uses a different platform class to present
2054         an interface.
2055
2056         Remove deprecated MPAudioVideoRoutingPopoverController and MPAVRoutingSheet
2057         Add MPMediaControlsViewController.
2058
2059         * platform/spi/ios/MediaPlayerSPI.h:
2060
2061 2017-08-03  Chris Dumez  <cdumez@apple.com>
2062
2063         Improve our support for referrer policies
2064         https://bugs.webkit.org/show_bug.cgi?id=175069
2065         <rdar://problem/33677313>
2066
2067         Reviewed by Darin Adler.
2068
2069         Improve our support for referrer policies. In particular, we now support the
2070         additional following ones: "same-origin", "origin-when-cross-origin" and
2071         "strict-origin-when-cross-origin".
2072
2073         This is as per the following specification:
2074         - https://www.w3.org/TR/referrer-policy/#referrer-policies
2075
2076         Also refactor the code a bit for clarity: I merged the ReferrerPolicy enum and the
2077         FetchOptions::ReferrerPolicy one.
2078
2079         Tests: http/tests/referrer-policy/origin-when-cross-origin/cross-origin-http-http.html
2080                http/tests/referrer-policy/origin-when-cross-origin/cross-origin-http.https.html
2081                http/tests/referrer-policy/origin-when-cross-origin/same-origin.html
2082                http/tests/referrer-policy/same-origin/cross-origin-http-http.html
2083                http/tests/referrer-policy/same-origin/cross-origin-http.https.html
2084                http/tests/referrer-policy/same-origin/same-origin.html
2085                http/tests/referrer-policy/strict-origin-when-cross-origin/cross-origin-http-http.html
2086                http/tests/referrer-policy/strict-origin-when-cross-origin/cross-origin-http.https.html
2087                http/tests/referrer-policy/strict-origin-when-cross-origin/same-origin.html
2088                http/tests/referrer-policy/strict-origin/cross-origin-http-http.html
2089                http/tests/referrer-policy/strict-origin/cross-origin-http.https.html
2090                http/tests/referrer-policy/strict-origin/same-origin.html
2091
2092         * Modules/fetch/FetchLoader.cpp:
2093         (WebCore::FetchLoader::start):
2094         * Modules/fetch/FetchReferrerPolicy.h:
2095         * Modules/fetch/FetchReferrerPolicy.idl:
2096         * Modules/fetch/FetchRequest.h:
2097         * Modules/fetch/FetchRequestInit.h:
2098         * dom/Document.cpp:
2099         (WebCore::Document::processReferrerPolicy):
2100         (WebCore::Document::applyQuickLookSandbox):
2101         (WebCore::Document::applyContentDispositionAttachmentSandbox):
2102         * dom/Document.h:
2103         * loader/FetchOptions.h:
2104         * loader/FrameNetworkingContext.h:
2105         * loader/PingLoader.cpp:
2106         (WebCore::PingLoader::sendBeacon):
2107         Drop explicit call to SecurityPolicy::shouldHideReferrer(). This is already called inside
2108         SecurityPolicy::generateReferrerHeader() and used only when needed, depending on the
2109         actual referrer policy.
2110
2111         * loader/cache/CachedResourceLoader.cpp:
2112         (WebCore::CachedResourceLoader::updateHTTPRequestHeaders):
2113         * loader/cache/CachedResourceRequest.cpp:
2114         (WebCore::CachedResourceRequest::updateReferrerOriginAndUserAgentHeaders):
2115         * page/SecurityPolicy.cpp:
2116         (WebCore::referrerToOriginString):
2117         (WebCore::SecurityPolicy::generateReferrerHeader):
2118         * page/SecurityPolicy.h:
2119         * platform/ReferrerPolicy.h:
2120
2121 2017-08-03  Daniel Bates  <dabates@apple.com>
2122
2123         Support ::marker pseudo-element
2124         https://bugs.webkit.org/show_bug.cgi?id=141477
2125
2126         Reviewed by David Hyatt.
2127
2128         Implements the ::marker pseudo element as per the CSS Pseudo-Element Module Level 4
2129         spec., <https://drafts.csswg.org/css-pseudo-4> (Editor's Draft, 24 July 2017).
2130
2131         The ::marker pseudo element is a convenience pseudo element that allows a person to
2132         style the appearance of a list item marker. For example, to render all list item
2133         markers in bolded, blue text you would define a stylesheet with the following content:
2134
2135         li::marker {
2136             color: blue;
2137             font-weight: bold;
2138         }
2139
2140         and this could be applied to a page that contains markup of the form:
2141
2142         <ol>
2143             <li>Item 1</li>
2144             <li>Item 2</li>
2145             ...
2146             <li>Item N-1</li>
2147             <li>Item N</li>
2148         </ol>
2149
2150         Formerly to the achieve the same effect you would need to use a stylesheet of the form:
2151
2152         li {
2153             color: blue;
2154             font-weight: bold;
2155         }
2156
2157         .list-item-content {
2158             all: initial;
2159         }
2160
2161         and then write your markup to have the form:
2162
2163         <ol>
2164             <li><span class="list-item-content">Item 1</span></li>
2165             <li><span class="list-item-content">Item 2</span></li>
2166             ...
2167             <li><span class="list-item-content">Item N-1</span></li>
2168             <li><span class="list-item-content">Item N</span></li>
2169         </ol>
2170
2171         The ::marker pseudo element only supports stylizing all font properties and the color property
2172         of a list item marker.
2173
2174         Tests: fast/lists/list-marker-with-display.html
2175                http/wpt/css/css-pseudo-4/marker-and-other-pseudo-elements.html
2176                http/wpt/css/css-pseudo-4/marker-color.html
2177                http/wpt/css/css-pseudo-4/marker-font-properties.html
2178                http/wpt/css/css-pseudo-4/marker-inherit-values.html
2179
2180         * css/CSSSelector.cpp:
2181         (WebCore::CSSSelector::pseudoId): Return the pseudo id for the ::marker pseudo element.
2182         * css/CSSSelector.h: Add enumerator PseudoElementMarker to the pseudo element enum.
2183         * css/RuleSet.cpp:
2184         (WebCore::determinePropertyWhitelistType): Return whitelist type PropertyWhitelistMarker for ::marker
2185         so that we match rules against the acceptable rules for ::marker.
2186         * css/RuleSet.h: Add enumerator PropertyWhitelistMarker to the property whitelist type enum.
2187         * css/SelectorPseudoElementTypeMap.in: Add "marker" to the list of pseudo element types.
2188         * css/StyleResolver.cpp:
2189         (WebCore::isValidMarkerStyleProperty): Determines if the specified CSS property is valid inside ::marker.
2190         (WebCore::StyleResolver::CascadedProperties::addMatch): Only recognize CSS properties in the content block
2191         of ::marker that match the ::marker whitelist policy.
2192         * rendering/RenderListItem.cpp:
2193         (WebCore::RenderListItem::computeMarkerStyle): Computes the style object for the list item marker. We
2194         apply the user-agent style to the marker here as opposed to defining ::marker in the UA sheet as per
2195         the spec. as an optimization to avoid having the style resolver apply the pseudo element to all elements.
2196         For now, we always inherit style from the originating element (list item). Added FIXME to selectively
2197         inherit styles.
2198         (WebCore::RenderListItem::styleDidChange): Always apply the list marker style to the list marker renderer.
2199         * rendering/RenderListItem.h:
2200         * rendering/style/RenderStyleConstants.h: Add pseudo ID for the ::marker pseudo element.
2201
2202 2017-08-03  Antti Koivisto  <antti@apple.com>
2203
2204         Factor common code in Style::*ChangeInvalidation into helper functions
2205         https://bugs.webkit.org/show_bug.cgi?id=174312
2206
2207         Reviewed by Andreas Kling.
2208
2209         There is a lot of copy code here.
2210
2211         * Style/StyleInvalidationFunctions.h: Added.
2212         (WebCore::Style::traverseRuleFeaturesInShadowTree):
2213         (WebCore::Style::traverseRuleFeaturesForSlotted):
2214         (WebCore::Style::traverseRuleFeatures):
2215
2216             Add functions for traversing rule features that may affect style of an element.
2217             Use lambdas to implement client-specific behavior.
2218
2219         * WebCore.xcodeproj/project.pbxproj:
2220         * style/AttributeChangeInvalidation.cpp:
2221         (WebCore::Style::mayBeAffectedByAttributeChange):
2222         (WebCore::Style::AttributeChangeInvalidation::invalidateStyle):
2223         (WebCore::Style::mayBeAffectedByHostRules): Deleted.
2224         (WebCore::Style::mayBeAffectedBySlottedRules): Deleted.
2225         * style/ClassChangeInvalidation.cpp:
2226         (WebCore::Style::ClassChangeInvalidation::invalidateStyle):
2227         (WebCore::Style::mayBeAffectedByHostRules): Deleted.
2228         (WebCore::Style::mayBeAffectedBySlottedRules): Deleted.
2229         * style/IdChangeInvalidation.cpp:
2230         (WebCore::Style::IdChangeInvalidation::invalidateStyle):
2231         (WebCore::Style::mayBeAffectedByHostRules): Deleted.
2232         (WebCore::Style::mayBeAffectedBySlottedRules): Deleted.
2233
2234 2017-08-03  Zan Dobersek  <zdobersek@igalia.com>
2235
2236         [EME] CDM constructor assigns CDMPrivate member multiple times
2237         https://bugs.webkit.org/show_bug.cgi?id=175128
2238
2239         Reviewed by Xabier Rodriguez-Calvar.
2240
2241         In the CDM class constructor, iterate over the registered CDM
2242         factories, finding one that supports the specified key system.
2243         A CDMPrivate object is created through that factory, and the
2244         iteration is now stopped at that point, while previously it
2245         contined to potentially create CDMPrivate objects through
2246         other factories.
2247
2248         Helper createCDMPrivateForKeySystem() function is removed.
2249
2250         * Modules/encryptedmedia/CDM.cpp:
2251         (WebCore::CDM::CDM):
2252         (WebCore::createCDMPrivateForKeySystem): Deleted.
2253
2254 2017-08-03  Emilio Cobos Álvarez  <ecobos@igalia.com>
2255
2256         Don't always recalc the style of display: contents elements.
2257         https://bugs.webkit.org/show_bug.cgi?id=172753
2258
2259         Reviewed by Antti Koivisto.
2260
2261         No new tests (no functionality change). This only removes an
2262         inefficiency.
2263
2264         * dom/Element.cpp:
2265         (WebCore::Element::existingComputedStyle):
2266         * dom/Element.h:
2267         * style/RenderTreeUpdater.cpp:
2268         (WebCore::RenderTreeUpdater::updateRenderTree):
2269         (WebCore::RenderTreeUpdater::updateElementRenderer):
2270         * style/StyleTreeResolver.cpp:
2271         (WebCore::Style::renderOrDisplayContentsStyle):
2272         (WebCore::Style::TreeResolver::resolveElement):
2273         (WebCore::Style::TreeResolver::createAnimatedElementUpdate):
2274         (WebCore::Style::shouldResolveElement):
2275         (WebCore::Style::TreeResolver::resolveComposedTree):
2276
2277 2017-08-02  Devin Rousso  <drousso@apple.com>
2278
2279         Web Inspector: add stack trace information for each RecordingAction
2280         https://bugs.webkit.org/show_bug.cgi?id=174663
2281
2282         Reviewed by Joseph Pecoraro.
2283
2284         Tests: inspector/canvas/recording-2d.html
2285                inspector/model/recording.html
2286
2287         * inspector/InspectorCanvas.h:
2288         * inspector/InspectorCanvas.cpp:
2289         (WebCore::InspectorCanvas::indexForData):
2290         (WebCore::InspectorCanvas::buildAction):
2291
2292 2017-08-02  Yusuke Suzuki  <utatane.tea@gmail.com>
2293
2294         Merge WTFThreadData to Thread::current
2295         https://bugs.webkit.org/show_bug.cgi?id=174716
2296
2297         Reviewed by Mark Lam.
2298
2299         Use Thread::current() instead.
2300
2301         * fileapi/AsyncFileStream.cpp:
2302         * platform/ThreadGlobalData.cpp:
2303         (WebCore::ThreadGlobalData::ThreadGlobalData):
2304         * platform/graphics/cocoa/WebCoreDecompressionSession.h:
2305         * platform/ios/wak/WebCoreThread.mm:
2306         (StartWebThread):
2307         * workers/WorkerThread.cpp:
2308         (WebCore::WorkerThread::workerThread):
2309
2310 2017-08-02  Sam Weinig  <sam@webkit.org>
2311
2312         Fix crashes in GC creating a document fragment on a background thread
2313         https://bugs.webkit.org/show_bug.cgi?id=175111
2314
2315         Reviewed by Chris Dumez.
2316
2317         r220095 (https://webkit.org/b/175006) change JSHTMLTemplateElement from using a
2318         private name + property to manager the lifetime of the reference DocumentFragment
2319         to using the idiomatic visitAdditionalChildren. Unfortunately, the function to access
2320         the DocumentFragment lazily creates it. If this lazy creation happens on a GC thread,
2321         badness ensues. This introduces an accessor that returns the DocumentFragment if it
2322         has been created or null if it has not.
2323
2324         * bindings/js/JSHTMLTemplateElementCustom.cpp:
2325         (WebCore::JSHTMLTemplateElement::visitAdditionalChildren):
2326         * html/HTMLTemplateElement.cpp:
2327         (WebCore::HTMLTemplateElement::contentIfAvailable):
2328         * html/HTMLTemplateElement.h:
2329
2330 2017-08-02  Sam Weinig  <sam@webkit.org>
2331
2332         [WebIDL] Simplify [EnabledBySettings] extended attribute code to not require passing a global object to finishCreation
2333         https://bugs.webkit.org/show_bug.cgi?id=175087
2334
2335         Reviewed by Chris Dumez.
2336
2337         * bindings/scripts/CodeGeneratorJS.pm:
2338         (GenerateImplementation):
2339         (GeneratePrototypeDeclaration):
2340         Remove unnecessary passing of the global object to finishCreation for [EnabledBySettings].
2341
2342         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
2343         * bindings/scripts/test/JS/JSTestNode.cpp:
2344         * bindings/scripts/test/JS/JSTestObj.cpp:
2345         Update tests.
2346
2347 2017-08-02  Andy Estes  <aestes@apple.com>
2348
2349         REGRESSION (r207155): Unable to switch sheets when previewing Numbers '09 spreadsheets
2350         https://bugs.webkit.org/show_bug.cgi?id=175098
2351         <rdar://problem/31416763>
2352
2353         Reviewed by Daniel Bates.
2354
2355         r207155 enabled sandboxing on the frame displaying a QuickLook preview. This restricted
2356         frames within the sandbox from navigating their sandboxed siblings or ancestors, which
2357         breaks the functionality of multi-sheet Numbers '09 spreadsheet previews. These previews
2358         contain a frameset with a table of contents frame and a content frame, and the table of
2359         contents frame needs to be able to navigate the content frame when the sheet selection
2360         changes.
2361
2362         Fix this by disabling the SandboxNavigation flag in the QuickLook sandbox. Frames within the
2363         sandbox will be able to navigate each other, but will not be able to navigate the top frame
2364         (due to SandboxTopNavigation still being enabled), nor will they be able to navigate any
2365         other ancestor frame outside the sandbox (due to QuickLook previews being in a different
2366         origin than the hosting frame). These two cases are covered by existing tests.
2367
2368         Test: quicklook/multi-sheet-numbers-09.html
2369
2370         * dom/Document.cpp:
2371         (WebCore::Document::applyQuickLookSandbox): Added a call to
2372         disableSandboxFlags(SandboxNavigation) after applying the content security policy.
2373         * dom/SecurityContext.h:
2374         (WebCore::SecurityContext::disableSandboxFlags): Defined disableSandboxFlags().
2375
2376 2017-08-02  Jer Noble  <jer.noble@apple.com>
2377
2378         [MSE] Removing samples when presentation order does not match decode order can cause bad behavior.
2379         https://bugs.webkit.org/show_bug.cgi?id=175091
2380
2381         Reviewed by Eric Carlson.
2382
2383         Address follow-up comments to r219519.
2384
2385         * Modules/mediasource/SourceBuffer.cpp:
2386         (WebCore::SourceBuffer::removeCodedFrames):
2387
2388 2017-08-02  Jeremy Jones  <jeremyj@apple.com>
2389
2390         Remove unused and obsolete setting mediaDocumentEntersFullscreenAutomatically
2391         https://bugs.webkit.org/show_bug.cgi?id=175080
2392
2393         Reviewed by Jon Lee.
2394
2395         No new tests because this only removes unused code.
2396
2397         This is obsolete because of the alternate solution in
2398         https://bugs.webkit.org/show_bug.cgi?id=174850
2399
2400         * page/Settings.in:
2401
2402 2017-08-02  Filip Pizlo  <fpizlo@apple.com>
2403
2404         GPUBuffer::length() should return the size of the array buffer backing the GPU buffer, not the rounded-up GPU buffer length
2405         https://bugs.webkit.org/show_bug.cgi?id=175079
2406
2407         Reviewed by Simon Fraser.
2408
2409         This fixes a failure in the GPU.BufferCreate unit test.
2410         
2411         The problem is that in order to have a Metal buffer wrap memory we allocated, we have to tell Metal
2412         that the memory is page-aligned. This means that the Metal buffer reports back a page-aligned size,
2413         which is different than what the test expected.
2414         
2415         It seems that it's most convenient for our GPUBuffer class to return the unaligned length, rather
2416         than the aligned length. This is just a simple matter of returning the length from the ArrayBuffer
2417         rather than the Metal buffer.
2418         
2419         This fixes the unit test and is probably more sensible for actual users of this class, since the page
2420         alignment of the length is a goofy implementation detail.
2421
2422         * platform/graphics/cocoa/GPUBufferMetal.mm:
2423         (WebCore::GPUBuffer::length const):
2424
2425 2017-08-01  Brian Burg  <bburg@apple.com>
2426
2427         HTML file input elements do not support file extensions in the "accept" attribute
2428         https://bugs.webkit.org/show_bug.cgi?id=95698
2429         <rdar://problem/12231850>
2430
2431         Reviewed by Darin Adler.
2432
2433         Serialize the accepted file extensions so they can be accessed in the UI process.
2434
2435         * platform/FileChooser.h:
2436         * platform/FileChooser.cpp:
2437         (WebCore::FileChooser::invalidate): Modernize.
2438         (WebCore::FileChooserSettings::acceptTypes const): Deleted.
2439         This is dead code, it was only used by Chromium.
2440
2441 2017-08-02  Fujii Hironori  <Hironori.Fujii@sony.com>
2442
2443         Use LazyNeverDestroyed instead of DEFINE_GLOBAL for QualifiedName
2444         https://bugs.webkit.org/show_bug.cgi?id=175010
2445         <rdar://problem/33647818>
2446
2447         Reviewed by Alex Christensen.
2448
2449         No new tests because no behavior change.
2450
2451         Stop using DEFINE_GLOBAL hack in favor of LazyNeverDestroyed.
2452
2453         * contentextensions/ContentExtensionParser.cpp:
2454         (WebCore::ContentExtensions::isValidCSSSelector):
2455         Call QualifiedName::init().
2456         * dom/DOMAllInOne.cpp: Remove the warning. Include QualifiedName.cpp.
2457         * dom/QualifiedName.cpp:
2458         (WebCore::QualifiedName::init): Call LazyNeverDestroyed::construct
2459         instead of placement new.
2460         * dom/QualifiedName.h: Use LazyNeverDestroyed.
2461
2462 2017-08-01  Joseph Pecoraro  <pecoraro@apple.com>
2463
2464         CFString leak dragging an image - allocation under PlatformPasteboard::writeObjectRepresentations
2465         https://bugs.webkit.org/show_bug.cgi?id=175064
2466
2467         Reviewed by Tim Horton.
2468
2469         * platform/ios/PlatformPasteboardIOS.mm:
2470         (WebCore::PlatformPasteboard::writeObjectRepresentations):
2471         Adopt a created string into the RetainPtr.
2472
2473         * platform/ios/WebItemProviderPasteboard.h:
2474         * platform/ios/WebItemProviderPasteboard.mm:
2475         (-[WebItemProviderRegistrationInfoList dealloc]):
2476         Release suggestedName and switch from -strong to -copy.
2477
2478 2017-08-01  Chris Dumez  <cdumez@apple.com>
2479
2480         Unreviewed, update Beacon API status to "In Development".
2481
2482         * features.json:
2483
2484 2017-08-01  Chris Dumez  <cdumez@apple.com>
2485
2486         Add initial support for navigator.sendBeacon
2487         https://bugs.webkit.org/show_bug.cgi?id=175007
2488         <rdar://problem/33547728>
2489
2490         Reviewed by Sam Weinig.
2491
2492         Add initial support for navigator.sendBeacon behind an experimental
2493         feature runtime flag. The specification is available at:
2494         - https://w3c.github.io/beacon/
2495
2496         The current implementation supports sending beacons with all types of
2497         payloads except for ReadableStream. Some functionality is incomplete
2498         and will be taken care of in follow-up patches:
2499         - Support for CORS preflight for the cases where it is required. We currently
2500           return false and do not send the beacon in such cases.
2501         - Better support for redirects.
2502         - Use a more power-friendly network priority for beacon requests.
2503
2504         Tests: http/tests/blink/sendbeacon/*
2505                http/tests/security/mixedContent/beacon/insecure-beacon-in-iframe.html
2506                http/wpt/beacon/*
2507                imported/blink/fast/beacon/*
2508                imported/w3c/web-platform-tests/beacon/*
2509
2510         * CMakeLists.txt:
2511         * DerivedSources.make:
2512         * Modules/beacon/NavigatorBeacon.cpp: Added.
2513         (WebCore::NavigatorBeacon::sendBeacon):
2514         * Modules/beacon/NavigatorBeacon.h: Added.
2515         * Modules/beacon/NavigatorBeacon.idl: Added.
2516         * WebCore.xcodeproj/project.pbxproj:
2517         * loader/PingLoader.cpp:
2518         (WebCore::PingLoader::sendBeacon):
2519         * loader/PingLoader.h:
2520
2521 2017-08-01  Filip Pizlo  <fpizlo@apple.com>
2522
2523         Bmalloc and GC should put auxiliaries (butterflies, typed array backing stores) in a gigacage (separate multi-GB VM region)
2524         https://bugs.webkit.org/show_bug.cgi?id=174727
2525
2526         Reviewed by Mark Lam.
2527
2528         No new tests because no change in behavior.
2529         
2530         Needed to teach Metal how to allocate in the Gigacage.
2531
2532         * platform/graphics/cocoa/GPUBufferMetal.mm:
2533         (WebCore::GPUBuffer::GPUBuffer):
2534         (WebCore::GPUBuffer::contents):
2535
2536 2017-08-01  Fujii Hironori  <Hironori.Fujii@sony.com>
2537
2538         [WinCairo] Implement Font::platformBoundsForGlyph
2539         https://bugs.webkit.org/show_bug.cgi?id=174813
2540
2541         Reviewed by Alex Christensen.
2542
2543         Test: fast/text/emphasis.html
2544
2545         * platform/graphics/win/SimpleFontDataCairoWin.cpp:
2546         (WebCore::Font::platformBoundsForGlyph): Implemented by copying
2547         the code from Font::boundsForGDIGlyph().
2548
2549 2017-08-01  Zalan Bujtas  <zalan@apple.com>
2550
2551         REGRESSION (r217197): New Yorker website hangs for a long time on load, lots of blank tiles
2552         https://bugs.webkit.org/show_bug.cgi?id=175009
2553         <rdar://problem/33505791>
2554
2555         Reviewed by Simon Fraser.
2556
2557         This patch ensures that we report the desktop, non-frame-flattened frame size for media queries in subframes.
2558         Some websites don't expect the iframes to be expanded to the size of the content and when the media query
2559         callback mutates the content (triggering frame resize), they might end up getting into a never ending layout.
2560
2561         Test: fast/frames/flattening/media-query-growing-content.html
2562
2563         * css/MediaQueryEvaluator.cpp:
2564         (WebCore::orientationEvaluate):
2565         (WebCore::aspectRatioEvaluate):
2566         (WebCore::heightEvaluate):
2567         (WebCore::widthEvaluate):
2568         * page/FrameView.cpp:
2569         (WebCore::FrameView::layout):
2570         (WebCore::FrameView::layoutSizeForMediaQuery const):
2571         (WebCore::FrameView::evaluateMediaQueryList):
2572         * page/FrameView.h:
2573
2574 2017-07-26  Jiewen Tan  <jiewen_tan@apple.com>
2575
2576         Add tests to detect mistakes in backward compatibility when the structured clone algorithm is changed in the future
2577         https://bugs.webkit.org/show_bug.cgi?id=173998
2578
2579         Reviewed by Darin Adler.
2580
2581         * bindings/js/SerializedScriptValue.cpp:
2582         Add a comment.
2583
2584 2017-08-01  Matt Lewis  <jlewis3@apple.com>
2585
2586         Unreviewed, rolling out r220089.
2587
2588         This caused multiple crashes on macOS Debug testers.
2589
2590         Reverted changeset:
2591
2592         "Use LazyNeverDestroyed instead of DEFINE_GLOBAL for
2593         QualifiedName"
2594         https://bugs.webkit.org/show_bug.cgi?id=175010
2595         http://trac.webkit.org/changeset/220089
2596
2597 2017-08-01  Sam Weinig  <sam@webkit.org>
2598
2599         [WebIDL] Swap a custom attribute for a custom mark function for HTMLTemplateElement
2600         https://bugs.webkit.org/show_bug.cgi?id=175006
2601
2602         Reviewed by Chris Dumez.
2603
2604         Use the standard way of augmenting GC, visitAdditionalChildren, rather
2605         than using a private name to create ownership.
2606
2607         * bindings/js/JSHTMLTemplateElementCustom.cpp:
2608         (WebCore::JSHTMLTemplateElement::visitAdditionalChildren):
2609         (WebCore::JSHTMLTemplateElement::content const): Deleted.
2610         * html/HTMLTemplateElement.idl:
2611
2612 2017-08-01  Zan Dobersek  <zdobersek@igalia.com>
2613
2614         [GCrypt] Gather crypto constants in a single location
2615         https://bugs.webkit.org/show_bug.cgi?id=174091
2616
2617         Reviewed by Jiewen Tan.
2618
2619         Gather common constants used across the libgcrypt-specific Web Crypto
2620         implementations in a single place -- in the GCryptUtilities.h header,
2621         inside the CryptoConstants namespace. The various ASN.1 object identifiers
2622         and other helper values are placed inside, in the std::array<uint8_t, N>
2623         container.
2624
2625         Additionally, CryptoConstants::matches() helper function is provided. It
2626         compares the provided data-and-size pair with the given std::array
2627         container and returns true if the std::memcmp() call returns 0.
2628
2629         Changes in CryptoKeyEC and CryptoKeyRSA consist mostly of switching to the
2630         use of CryptoConstants::matches() and the CryptoConstants data arrays, as
2631         well as some whitespace cleanup.
2632
2633         Additionallity in CryptoKeyEC, the helper functions covering various curve
2634         attributes are reordered, renamed and reorganized for simplicity.
2635
2636         No new tests -- no changes in behavior.
2637
2638         * crypto/gcrypt/CryptoKeyECGCrypt.cpp:
2639         (WebCore::curveIdentifier):
2640         (WebCore::curveSize):
2641         (WebCore::curveUncompressedFieldElementSize):
2642         (WebCore::curveUncompressedPointSize):
2643         (WebCore::CryptoKeyEC::platformImportRaw):
2644         (WebCore::CryptoKeyEC::platformImportJWKPublic):
2645         (WebCore::CryptoKeyEC::platformImportJWKPrivate):
2646         (WebCore::supportedAlgorithmIdentifier):
2647         (WebCore::curveForIdentifier):
2648         (WebCore::CryptoKeyEC::platformImportSpki):
2649         (WebCore::CryptoKeyEC::platformExportRaw):
2650         (WebCore::CryptoKeyEC::platformAddFieldElements):
2651         (WebCore::CryptoKeyEC::platformExportSpki):
2652         (WebCore::CryptoKeyEC::platformExportPkcs8):
2653         (WebCore::uncompressedPointSizeForCurve): Deleted.
2654         (WebCore::uncompressedFieldElementSizeForCurve): Deleted.
2655         * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
2656         (WebCore::supportedAlgorithmIdentifier):
2657         (WebCore::CryptoKeyRSA::importPkcs8):
2658         (WebCore::CryptoKeyRSA::exportSpki):
2659         (WebCore::CryptoKeyRSA::exportPkcs8):
2660         * crypto/gcrypt/GCryptUtilities.h:
2661         (WebCore::CryptoConstants::matches):
2662
2663 2017-07-31  Fujii Hironori  <Hironori.Fujii@sony.com>
2664
2665         Use LazyNeverDestroyed instead of DEFINE_GLOBAL for MediaFeatureNames
2666         https://bugs.webkit.org/show_bug.cgi?id=175008
2667
2668         Reviewed by Alex Christensen.
2669
2670         No new tests because no behavior change.
2671
2672         Stop using DEFINE_GLOBAL hack in favor of LazyNeverDestroyed.
2673
2674         * css/MediaFeatureNames.cpp:
2675         (WebCore::MediaFeatureNames::init): Do not include
2676         <wtf/StaticConstructors.h>. Use LazyNeverDestroyed instead of
2677         DEFINE_GLOBAL. Call LazyNeverDestroyed::construct instead of
2678         placement new.
2679         * css/MediaFeatureNames.h: Use LazyNeverDestroyed.
2680         * css/MediaQueryEvaluator.cpp:
2681         (WebCore::MediaQueryEvaluator::evaluate const): Dereference with ->.
2682
2683 2017-07-31  Fujii Hironori  <Hironori.Fujii@sony.com>
2684
2685         Use LazyNeverDestroyed instead of DEFINE_GLOBAL for QualifiedName
2686         https://bugs.webkit.org/show_bug.cgi?id=175010
2687
2688         Reviewed by Alex Christensen.
2689
2690         No new tests because no behavior change.
2691
2692         Stop using DEFINE_GLOBAL hack in favor of LazyNeverDestroyed.
2693
2694         * dom/DOMAllInOne.cpp: Remove the warning. Include QualifiedName.cpp.
2695         * dom/QualifiedName.cpp:
2696         (WebCore::QualifiedName::init): Call LazyNeverDestroyed::construct
2697         instead of placement new.
2698         * dom/QualifiedName.h: Use LazyNeverDestroyed.
2699
2700 2017-07-31  Matt Rajca  <mrajca@apple.com>
2701
2702         Support quirk for letting media autoplay if the user interacted with at least one media element.
2703         https://bugs.webkit.org/show_bug.cgi?id=175005
2704         <rdar://problem/33476038>
2705
2706         Reviewed by Eric Carlson.
2707
2708         If the user has interacted with at least one media element, let other media elements auto-play
2709         as a quirk.
2710
2711         * dom/Document.cpp:
2712         (WebCore::Document::updateIsPlayingMedia):
2713         * dom/Document.h:
2714         (WebCore::Document::noteUserInteractionWithMediaElement):
2715         * html/HTMLMediaElement.cpp:
2716         (WebCore::HTMLMediaElement::removeBehaviorsRestrictionsAfterFirstUserGesture):
2717         * html/MediaElementSession.cpp:
2718         (WebCore::needsDocumentLevelMediaUserGestureQuirk):
2719         (WebCore::MediaElementSession::playbackPermitted const):
2720         * page/MediaProducer.h:
2721
2722 2017-07-31  Nan Wang  <n_wang@apple.com>
2723
2724         AX: CFEqual is failing on text markers with exact same data
2725         https://bugs.webkit.org/show_bug.cgi?id=175002
2726         <rdar://problem/33636985>
2727
2728         Reviewed by Chris Fleizach.
2729
2730         We should zero the memory of the TextMarkerData instance so that it
2731         can be tested for byte-equivalence.
2732
2733         Made sure this change won't break any of the existing tests.
2734
2735         * accessibility/AXObjectCache.cpp:
2736         (WebCore::AXObjectCache::textMarkerDataForVisiblePosition):
2737         (WebCore::AXObjectCache::textMarkerDataForFirstPositionInTextControl):
2738
2739 2017-07-28  Matt Rajca  <mrajca@apple.com>
2740
2741         Propagate user gesture tokens when script elements are loaded.
2742         https://bugs.webkit.org/show_bug.cgi?id=174959
2743
2744         Reviewed by Eric Carlson.
2745
2746         Propagate user gesture tokens when script elements are loaded (i.e. between the time an
2747         element is created and its onload handler is invoked).
2748
2749         * dom/ScriptElement.cpp:
2750         (WebCore::ScriptElement::ScriptElement):
2751         (WebCore::ScriptElement::dispatchLoadEventRespectingUserGestureIndicator):
2752         (WebCore::ScriptElement::executeScriptAndDispatchEvent):
2753         (WebCore::ScriptElement::executePendingScript):
2754         * dom/ScriptElement.h:
2755
2756 2017-07-31  Matt Lewis  <jlewis3@apple.com>
2757
2758         Unreviewed, rolling out r220048.
2759
2760         This revision caused multiple crashes in fast/images. See
2761         webkit.org/b/174990
2762
2763         Reverted changeset:
2764
2765         "RenderImageResourceStyleImage::image() should return the
2766         nullImage() if the image is not available"
2767         https://bugs.webkit.org/show_bug.cgi?id=174874
2768         http://trac.webkit.org/changeset/220048
2769
2770 2017-07-31  Sam Weinig  <sam@webkit.org>
2771
2772         Remove unnecessary exceptions from storage code
2773         https://bugs.webkit.org/show_bug.cgi?id=174572
2774
2775         Reviewed by Chris Dumez.
2776
2777         Remove checks for canAccessStorage() and the exceptions they would cause.
2778         These were used for Storage in ephemeral sessions, but they are now supported.
2779         Add checks for a null frame to functions that can mutate the storage, as the
2780         frame is needed for that, and it retains our existing behavior for disconnected
2781         frames. By removing these checks / exceptions, we can fully generate Storage.idl.
2782
2783         * CMakeLists.txt:
2784         * WebCore.xcodeproj/project.pbxproj:
2785         * bindings/js/JSBindingsAllInOne.cpp:
2786         * bindings/js/JSStorageCustom.cpp: Removed.
2787         Remove JSStorageCustom.cpp
2788
2789         * loader/EmptyClients.cpp:
2790         * page/DOMWindow.cpp:
2791         (WebCore::DOMWindow::sessionStorage):
2792         (WebCore::DOMWindow::localStorage):
2793         * storage/StorageArea.h:
2794         Remove canAccessStorage.
2795
2796         * storage/Storage.cpp:
2797         (WebCore::Storage::length):
2798         (WebCore::Storage::key):
2799         (WebCore::Storage::getItem):
2800         (WebCore::Storage::setItem):
2801         (WebCore::Storage::removeItem):
2802         (WebCore::Storage::clear):
2803         (WebCore::Storage::contains):
2804         (WebCore::Storage::isSupportedPropertyName):
2805         (WebCore::Storage::supportedPropertyNames):
2806         * storage/Storage.h:
2807         * storage/Storage.idl:
2808         Remove canAccessStorage checks and corresponding exceptions. Add supportedPropertyNames
2809         to allow the removal of the [CustomGetOwnPropertyNames].
2810
2811 2017-07-31  Matt Lewis  <jlewis3@apple.com>
2812
2813         Unreviewed, rolling out r220060.
2814
2815         This broke our internal builds. Contact reviewer of patch for
2816         more information.
2817
2818         Reverted changeset:
2819
2820         "Merge WTFThreadData to Thread::current"
2821         https://bugs.webkit.org/show_bug.cgi?id=174716
2822         http://trac.webkit.org/changeset/220060
2823
2824 2017-07-31  Yusuke Suzuki  <utatane.tea@gmail.com>
2825
2826         Merge WTFThreadData to Thread::current
2827         https://bugs.webkit.org/show_bug.cgi?id=174716
2828
2829         Reviewed by Sam Weinig.
2830
2831         Use Thread::current() instead.
2832
2833         * fileapi/AsyncFileStream.cpp:
2834         * platform/ThreadGlobalData.cpp:
2835         (WebCore::ThreadGlobalData::ThreadGlobalData):
2836         * platform/graphics/cocoa/WebCoreDecompressionSession.h:
2837         * platform/ios/wak/WebCoreThread.mm:
2838         (StartWebThread):
2839         * workers/WorkerThread.cpp:
2840         (WebCore::WorkerThread::workerThread):
2841
2842 2017-07-31  Xabier Rodriguez Calvar  <calvaris@igalia.com>
2843
2844         Created a bool pretty printer at WTF for debugging purposes
2845         https://bugs.webkit.org/show_bug.cgi?id=174893
2846
2847         Reviewed by Darin Adler.
2848
2849         Use WTF::boolPrettyPrinter in debugging messages.
2850
2851         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2852         (WebCore::MediaPlayerPrivateGStreamerBase::supportsKeySystem):
2853         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
2854         (WebCore::MediaPlayerPrivateGStreamerMSE::seek):
2855
2856 2017-07-30  Zan Dobersek  <zdobersek@igalia.com>
2857
2858         Unreviewed. Suppress the -Wextra compiler warning when building with GCC 6.3.0,
2859         explicitly initializing the RefCounted<> base class in the
2860         FetchHeaders(const FetchHeaders&) constructor.
2861
2862         Note that while that's the signature of the copy constructor for the FetchHeaders
2863         class, the base RefCounted<> class is not copyable, so the default RefCounted<>
2864         constructor is used, but the FetchHeaders resources are normally copied into the
2865         new object from the one that's passed in.
2866
2867         * Modules/fetch/FetchHeaders.h:
2868         (WebCore::FetchHeaders::FetchHeaders):
2869
2870 2017-07-30  Darin Adler  <darin@apple.com>
2871
2872         Remove code in HTMLObjectElement attribute parsing that forces style resolution and layout
2873         https://bugs.webkit.org/show_bug.cgi?id=130653
2874
2875         Reviewed by Antti Koivisto.
2876
2877         Also fixes a bug where load events are delivered prematurely in some cases
2878         when an object, embed, frame, or iframe element is still loading.
2879
2880         * dom/Document.cpp:
2881         (WebCore::Document::loadEventDelayTimerFired): Added a call to
2882         FrameLoader::checkLoadComplete. Goes along with the change to
2883         FrameLoader::checkLoadCompleteForThisFrame, which now respects the
2884         isDelayingLoadEvent flag.
2885
2886         * html/HTMLAppletElement.cpp:
2887         (WebCore::HTMLAppletElement::HTMLAppletElement): Removed the createdByParser argument,
2888         no longer needed by the base class.
2889         (WebCore::HTMLAppletElement::create): Added call to finishCreating, which is now part of
2890         the process of creating any object in a class derived from HTMLPlugInImageElement.
2891         (WebCore::HTMLAppletElement::updateWidget): Rearranged logic so setNeedsWidgetUpdate
2892         is only called when it's becoming false; avoids a false/true/false round trip that can
2893         cause trouble.
2894         * html/HTMLAppletElement.h: Updated for the above.
2895
2896         * html/HTMLEmbedElement.cpp:
2897         (WebCore::HTMLEmbedElement::HTMLEmbedElement): Removed the createdByParser argument,
2898         no longer needed by the base class.
2899         (WebCore::HTMLEmbedElement::create): Added call to finishCreating, which is now part of
2900         the process of creating any object in a class derived from HTMLPlugInImageElement.
2901         (WebCore::HTMLEmbedElement::parseAttribute): Changed srcAttr to call
2902         updateImageLoaderWithNewURLSoon to do the image loading logic.
2903         (WebCore::HTMLEmbedElement::updateWidget): Rearranged logic so setNeedsWidgetUpdate
2904         is only called when it's becoming false; avoids a false/true/false round trip that can
2905         cause trouble.
2906         * html/HTMLEmbedElement.h: Updated for the above.
2907
2908         * html/HTMLMediaElement.cpp:
2909         (WebCore::HTMLMediaElement::setReadyState): Call setShouldDelayLoadEvent(false) when
2910         transitioning to HAVE_CURRENT_DATA (or beyond), even if we have already fired a loadeddata
2911         event in the past. This matches what the HTML specification calls for, but only if you
2912         read it carefully. Without this change, and with the more complete implementation of
2913         load event delay below, one of the regression tests hangs because are permanently stuck
2914         dealying load events. Also added a FIXME about other code that likely has a similar
2915         problem; the symptom is likely to be subtle and minor, though.
2916
2917         * html/HTMLObjectElement.cpp:
2918         (WebCore::HTMLObjectElement::HTMLObjectElement): Removed the createdByParser argument,
2919         no longer needed by the base class.
2920         (WebCore::HTMLObjectElement::create): Added call to finishCreating, which is now part of
2921         the process of creating any object in a class derived from HTMLPlugInImageElement.
2922         (WebCore::HTMLObjectElement::parseAttribute): Changed dataAttr to use
2923         updateImageLoaderWithNewURLSoon. Explicitly call scheduleUpdateForAfterStyleResolution
2924         since just calling invalidateStyleAndRenderersForSubtree alone is no longer sufficient.
2925         (WebCore::HTMLObjectElement::updateWidget): Rearranged logic so setNeedsWidgetUpdate
2926         is only called when it's becoming false; avoids a false/true/false round trip that can
2927         cause trouble.
2928         (WebCore::HTMLObjectElement::childrenChanged): Added calls to the new
2929         scheduleUpdateForAfterStyleResolution since invalidating style is no longer sufficient.
2930         (WebCore::HTMLObjectElement::renderFallbackContent): Remove the call to
2931         updateStyleIfNeeded. This is the main change that the title of this bug refers to.
2932         * html/HTMLObjectElement.h: Updated for the above. Also removed the
2933         clearUseFallbackContent function because it's clearer to set the data member in
2934         line at the single call site in HTMLObjectElement::parseAttribute.
2935
2936         * html/HTMLPlugInImageElement.cpp:
2937         (WebCore::HTMLPlugInImageElement::HTMLPlugInImageElement): Removed the createdByParser
2938         argument; no need to set an m_needsWidgetUpdate flag differently for parser cases now.
2939         (WebCore::HTMLPlugInImageElement::finshCreating): Added. To be called after creating
2940         an element to do work that can't be done in a constructor.
2941         (WebCore::HTMLPlugInImageElement::didRecalcStyle): Added. Calls the new
2942         scheduleUpdateForAfterStyleResolution function.
2943         (WebCore::HTMLPlugInImageElement::didAttachRenderers): Moved all the logic from this
2944         function into scheduleUpdateForAfterStyleResolution. Also added a call through to the base
2945         class; cleans things up, even though it's just an assertion.
2946         (WebCore::HTMLPlugInImageElement::willDetachRenderers): Removed the call to
2947         setNeedsWidgetUpdate(true) here; no longer needed because the new logic already
2948         does the right thing in this case.
2949         (WebCore::HTMLPlugInImageElement::updateWidgetIfNecessary): Deleted. Now handled by
2950         updateAfterStyleResolution instead.
2951         (WebCore::HTMLPlugInImageElement::finishParsingChildren): Deleted. Handling updates
2952         after parsing all the children now comes naturally out of the new implementation.
2953         (WebCore::HTMLPlugInImageElement::scheduleUpdateForAfterStyleResolution): Added.
2954         Schedules a call to updateAfterStyleResolution when needed, and equally importantly,
2955         increments the load event delay count to make sure that loads that are part of that
2956         update can participate in decision about whether it's time for the load event.
2957         (WebCore::HTMLPlugInImageElement::updateAfterStyleResolution): Added.
2958         Combines updateWidgetIfNecessary and startLoadingImage, and also deals with the new
2959         m_needsImageReload boolean in cases where no actual loading is done.
2960         (WebCore::HTMLPlugInImageElement::didMoveToNewDocument): Update load event delay
2961         count when moving an element that is in the middle of loading. This lets the
2962         updateAfterStyleResolution function do the right thing even when the element is
2963         moved without leaving anything stuck in a strange state.
2964         (WebCore::HTMLPlugInImageElement::prepareForDocumentSuspension): Call the new
2965         scheduleUpdateForAfterStyleResolution since invalidating style is no longer sufficient.
2966         (WebCore::HTMLPlugInImageElement::startLoadingImage): Deleted. Now handled by
2967         updateAfterStyleResolution instead.
2968         (WebCore::HTMLPlugInImageElement::updateImageLoaderWithNewURLSoon): Added. Does all
2969         the right things for when an image URL is changed; for use by the concrete derived classes.
2970         * html/HTMLPlugInImageElement.h: Updated for above changes. Also made m_imageLoader
2971         private rather than protected, and added the two new boolean data members.
2972
2973         * html/HTMLTagNames.in: Removed unneeded constructorNeedsCreatedByParser flags for
2974         applet, embed, and object.
2975
2976         * loader/DocumentLoader.cpp:
2977         (WebCore::DocumentLoader::isLoadingInAPISense): Return true if the document is
2978         delaying a load event.
2979
2980         * loader/FrameLoader.cpp:
2981         (WebCore::FrameLoader::checkLoadCompleteForThisFrame): Don't do any work if
2982         isDelayingLoadEvent is true; otherwise this function can have a side effect of
2983         triggering the load event.
2984         (WebCore::FrameLoader::detachFromParent): Schedule a checkLoadComplete here, too, not
2985         just a checkCompleted. This is relevant if the frame we are detaching was delaying
2986         a load event because it no longer will be and so the load might be complete.
2987
2988 2017-07-30  Sam Weinig  <sam@webkit.org>
2989
2990         [WebIDL] Remove JS builtin bindings for FetchRequest, DOMWindowFetch and WorkerGlobalScopeFetch
2991         https://bugs.webkit.org/show_bug.cgi?id=174974
2992
2993         Reviewed by Darin Adler.
2994
2995         * CMakeLists.txt:
2996         * DerivedSources.make:
2997         * WebCore.xcodeproj/project.pbxproj:
2998         * Modules/fetch/DOMWindowFetch.js: Removed.
2999         * Modules/fetch/FetchRequest.js: Removed.
3000         * Modules/fetch/WorkerGlobalScopeFetch.js: Removed.
3001         Remove builtin files.
3002
3003         * Modules/fetch/DOMWindowFetch.cpp:
3004         (WebCore::DOMWindowFetch::fetch):
3005         * Modules/fetch/DOMWindowFetch.h:
3006         * Modules/fetch/DOMWindowFetch.idl:
3007         * Modules/fetch/WorkerGlobalScopeFetch.cpp:
3008         (WebCore::WorkerGlobalScopeFetch::fetch):
3009         * Modules/fetch/WorkerGlobalScopeFetch.h:
3010         * Modules/fetch/WorkerGlobalScopeFetch.idl:
3011         Remove builtin and instead create FetchRequest in the implementation.
3012
3013         * Modules/fetch/FetchBody.cpp:
3014         (WebCore::FetchBody::extract):
3015         * Modules/fetch/FetchBody.h:
3016         * Modules/fetch/FetchBodyOwner.cpp:
3017         (WebCore::FetchBodyOwner::extractBody):
3018         * Modules/fetch/FetchBodyOwner.h:
3019         * Modules/fetch/FetchResponse.cpp:
3020         * Modules/fetch/FetchResponse.h:
3021         Rename FetchBody::BindingDataType to FetchBody::Init to match its IDL naming.
3022
3023         * Modules/fetch/FetchHeaders.cpp:
3024         (WebCore::appendToHeaderMap):
3025         (WebCore::fillHeaderMap):
3026         (WebCore::FetchHeaders::create):
3027         (WebCore::FetchHeaders::fill):
3028         * Modules/fetch/FetchHeaders.h:
3029         Add helpers to implement the fill algorithm for various input types.
3030         Leave the existing fill for now, as it is still used by the FetchResponse
3031         builtin, but will eventually be removed.
3032
3033         * Modules/fetch/FetchRequest.cpp:
3034         (WebCore::FetchRequest::initializeOptions):
3035         (WebCore::FetchRequest::initializeWith):
3036         (WebCore::FetchRequest::setBody):
3037         (WebCore::FetchRequest::create):
3038         (WebCore::FetchRequest::setBodyFromInputRequest): Deleted.
3039         * Modules/fetch/FetchRequest.h:
3040         Migrate builtin code to the implementation. This is 1-to-1 re-implementation,
3041         so I did not attempt to fix any conformance issues. That will come in follow up.
3042
3043         * Modules/fetch/FetchRequest.idl:
3044         Replace builtins with an IDL constructor.
3045
3046         * Modules/fetch/FetchRequestInit.h:
3047         * Modules/fetch/FetchRequestInit.idl:
3048         Add missing headers and body to FetchRequestInit.
3049
3050 2017-07-30  Said Abou-Hallawa  <sabouhallawa@apple.com>
3051
3052         RenderImageResourceStyleImage::image() should return the nullImage() if the image is not available
3053         https://bugs.webkit.org/show_bug.cgi?id=174874
3054         <rdar://problem/33530130>
3055
3056         Reviewed by Darin Adler.
3057
3058         If an <img> element has image content data for a none cached image, e.g.
3059         -webkit-named-image, RenderImageResourceStyleImage will be created and 
3060         attached to the RenderImage. RenderImageResourceStyleImage::m_cachedImage
3061         will be set to null because the m_styleImage->isCachedImage() is false in
3062         this case. When ImageLoader finishes loading the url of the src attribute, 
3063         RenderImageResource::setCachedImage() will be called to set m_cachedImage.
3064
3065         A crash will happen when the RenderImage is destroyed. Destroying the 
3066         RenderImage calls RenderImageResourceStyleImage::shutdown() which checks
3067         m_cachedImage and finds it not null, so it calls RenderImageResourceStyleImage::image()
3068         which ends up calling CSSNamedImageValue::image() which returns a null pointer
3069         because the size is empty. RenderImageResourceStyleImage::shutdown() calls
3070         image()->stopAnimation() without checking the return value of image().
3071
3072         Like the base class virtual method RenderImageResource::image(), 
3073         RenderImageResourceStyleImage::image() should return the nullImage() if
3074         the image is not available.
3075
3076         Test: fast/images/image-element-image-content-data.html
3077
3078         * css/CSSCrossfadeValue.cpp:
3079         * css/CSSFilterImageValue.cpp:
3080         * page/EventHandler.cpp:
3081         * page/PageSerializer.cpp:
3082         * rendering/RenderElement.cpp:
3083         * rendering/RenderImageResource.cpp:
3084         * rendering/RenderImageResourceStyleImage.cpp:
3085         (WebCore::RenderImageResourceStyleImage::initialize):
3086
3087         (WebCore::RenderImageResourceStyleImage::shutdown): Revert back the changes
3088         of r208511 in this function. Add a call to image()->stopAnimation() without
3089         checking the return of image() since it will return the nullImage() if
3090         the image not available. There is no need to check m_cachedImage before 
3091         calling image() because image() does not check or access m_cachedImage.
3092
3093         (WebCore::RenderImageResourceStyleImage::image): The base class method
3094         RenderImageResource::image() returns the nullImage() if the image not
3095         available. This is because CachedImage::imageForRenderer() returns
3096         the nullImage() if the image is not available; see CachedImage.h. We should
3097         do the same for the derived class for consistency.
3098
3099         * rendering/style/ContentData.cpp:
3100         * rendering/style/StyleCachedImage.cpp:
3101         * style/StylePendingResources.cpp:
3102
3103 2017-07-29  Filip Pizlo  <fpizlo@apple.com>
3104
3105         Unreviewed, rollout r220044 because it set the bots on fire.
3106         
3107         It seems that the "-Wunguarded-availability-new" pragma is not widely supported. So, a bunch of the
3108         Mac bots are now unable to build and that includes EWS.
3109         
3110         Fixing by rolling it out.
3111
3112         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
3113         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
3114         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
3115         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setHasAvailableAudioSample):
3116         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::addAudioRenderer):
3117         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::removeAudioRenderer):
3118         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
3119         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
3120         (-[WebAVSampleBufferErrorListener beginObservingRenderer:]):
3121         (-[WebAVSampleBufferErrorListener stopObservingRenderer:]):
3122         (-[WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]):
3123         (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
3124         (WebCore::SourceBufferPrivateAVFObjC::rendererDidReceiveError):
3125         (WebCore::SourceBufferPrivateAVFObjC::flush):
3126
3127 2017-07-29  Dan Bernstein  <mitz@apple.com>
3128
3129         Fixed building for macOS 10.12 with the macOS 10.13 SDK.
3130
3131         Suppressed the unguarded-availability-new warning around uses of AVSampleBufferAudioRenderer
3132         and AVSampleBufferRenderSynchronizer. Even though the 10.13 SDK declares them as available
3133         starting in that release, they have been available as SPI earlier.
3134
3135         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
3136         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
3137         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
3138         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setHasAvailableAudioSample):
3139         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::addAudioRenderer):
3140         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::removeAudioRenderer):
3141         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
3142         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
3143         (-[WebAVSampleBufferErrorListener beginObservingRenderer:]):
3144         (-[WebAVSampleBufferErrorListener stopObservingRenderer:]):
3145         (-[WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]):
3146         (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
3147         (WebCore::SourceBufferPrivateAVFObjC::rendererDidReceiveError):
3148         (WebCore::SourceBufferPrivateAVFObjC::flush):
3149
3150 2017-07-29  Nan Wang  <n_wang@apple.com>
3151
3152         AX: findMatchingObjects doesn't work when the startObject is ignored
3153         https://bugs.webkit.org/show_bug.cgi?id=174965
3154
3155         Reviewed by Chris Fleizach.
3156
3157         findMatchingObjects would return a wrong element if we pass in an ignored
3158         start object. To fix this, we should use the closest accessible sibling as 
3159         the start object.
3160
3161         Test: accessibility/mac/search-predicate-from-ignored-element.html
3162
3163         * accessibility/AccessibilityObject.cpp:
3164         (WebCore::appendChildrenToArray):
3165
3166 2017-07-29  Aaron Chu  <aaron_chu@apple.com>
3167
3168         AX: FKA: Buttons need a visible focus indicator
3169         https://bugs.webkit.org/show_bug.cgi?id=171040
3170         <rdar://problem/30922548>
3171
3172         Reviewed by Antoine Quint.
3173
3174         Added a background color for the focus state of the icon buttons in modern media controls.
3175
3176         Test: media/modern-media-controls/button/button-focus-state.html
3177
3178         * Modules/modern-media-controls/controls/button.css:
3179         (button:focus):
3180         (button:focus > picture):
3181         * Modules/modern-media-controls/controls/slider.css:
3182         (.slider > input):
3183
3184 2017-07-28  Sam Weinig  <sam@webkit.org>
3185
3186         [WebIDL] Remove JS builtin bindings for FetchHeaders
3187         https://bugs.webkit.org/show_bug.cgi?id=174905
3188
3189         Reviewed by Alex Christensen.
3190
3191         * CMakeLists.txt:
3192         * DerivedSources.make:
3193         * WebCore.xcodeproj/project.pbxproj:
3194         * Modules/fetch/FetchHeaders.js: Removed.
3195         Remove FetchHeaders.js
3196
3197         * Modules/fetch/FetchHeaders.cpp:
3198         (WebCore::appendToHeaderMap):
3199         (WebCore::FetchHeaders::create):
3200         (WebCore::FetchHeaders::append):
3201         * Modules/fetch/FetchHeaders.h:
3202         (WebCore::FetchHeaders::FetchHeaders):
3203         Add create function for generated constructor.
3204         Add appendToHeaderMap static function which takes the functionality
3205         from the existing append function, and makes it useable in create.
3206
3207         * Modules/fetch/FetchHeaders.idl:
3208         Replace [JSBuiltinConstructor] with real constructor. Keep other builtin
3209         attributes as they are still used by other Fetch code.
3210
3211         * bindings/js/JSDOMConvertRecord.h:
3212         Fix record conversion to work with proxies by changing to use the method table
3213         for getOwnPropertyNames, and undefined values by not excluding undefined values. 
3214
3215 2017-07-28  Matt Baker  <mattbaker@apple.com>
3216
3217         Web Inspector: capture an async stack trace when web content calls addEventListener
3218         https://bugs.webkit.org/show_bug.cgi?id=174739
3219         <rdar://problem/33468197>
3220
3221         Reviewed by Brian Burg.
3222
3223         Test: inspector/debugger/async-stack-trace.html
3224
3225         Add instrumentation to EventTarget to support showing asynchronous
3226         stack traces when the debugger breaks in a script event listener.
3227
3228         * dom/EventTarget.cpp:
3229         (WebCore::EventTarget::addEventListener):
3230         (WebCore::EventTarget::removeEventListener):
3231         (WebCore::EventTarget::fireEventListeners):
3232         * inspector/InspectorInstrumentation.cpp:
3233         (WebCore::InspectorInstrumentation::didAddEventListenerImpl):
3234         (WebCore::InspectorInstrumentation::willRemoveEventListenerImpl):
3235         (WebCore::InspectorInstrumentation::willHandleEventImpl):
3236         (WebCore::InspectorInstrumentation::didHandleEventImpl):
3237         * inspector/InspectorInstrumentation.h:
3238         (WebCore::InspectorInstrumentation::didAddEventListener):
3239         (WebCore::InspectorInstrumentation::willRemoveEventListener):
3240         (WebCore::InspectorInstrumentation::willHandleEvent):
3241         (WebCore::InspectorInstrumentation::didHandleEvent):
3242         * inspector/PageDebuggerAgent.cpp:
3243         (WebCore::PageDebuggerAgent::didClearAsyncStackTraceData):
3244         (WebCore::PageDebuggerAgent::didAddEventListener):
3245         (WebCore::PageDebuggerAgent::willRemoveEventListener):
3246         (WebCore::PageDebuggerAgent::willHandleEvent):
3247         * inspector/PageDebuggerAgent.h:
3248
3249 2017-07-28  Matt Rajca  <mrajca@apple.com>
3250
3251         Don't add autoplay restrictions to media elements created in response to user gestures.
3252         https://bugs.webkit.org/show_bug.cgi?id=174947
3253
3254         Reviewed by Eric Carlson.
3255
3256         Test: media/video-create-with-user-gesture.html
3257
3258         * html/HTMLMediaElement.cpp:
3259         (WebCore::HTMLMediaElement::HTMLMediaElement):
3260
3261 2017-07-28  Jeremy Jones  <jeremyj@apple.com>
3262
3263         WebMediaSessionHelper calls -[UIApplication beginReceivingRemoteControlEvents] from WebThread
3264         https://bugs.webkit.org/show_bug.cgi?id=174934
3265         rdar://problem/33586772
3266
3267         Reviewed by Eric Carlson.
3268
3269         No new tests because no effect on DOM.
3270
3271         This dispatches a UIKit call to the main thread since it might happen on WebThread in WK1.
3272
3273         * platform/audio/ios/MediaSessionManagerIOS.mm:
3274         (-[WebMediaSessionHelper initWithCallback:]):
3275
3276 2017-07-28  Myles C. Maxfield  <mmaxfield@apple.com>
3277
3278         [macOS] Reeder's defaults font is Times instead of San Francisco
3279         https://bugs.webkit.org/show_bug.cgi?id=174885
3280         <rdar://problem/33462483>
3281
3282         Reviewed by Simon Fraser.
3283
3284         Reeder uses explicit dot-prefixed names in its source code. Within Core Text,
3285         dot-prefixed names cannot be matched case insensitively. The solution is to
3286         not case-fold these family names, and to make our caches case sensitive for
3287         these special names.
3288
3289         Tests: fast/text/font-lookup-dot-prefix-case-sensitive-2.html
3290                fast/text/font-lookup-dot-prefix-case-sensitive.html
3291
3292         * platform/graphics/FontCache.cpp:
3293         (WebCore::FontPlatformDataCacheKey::operator==):
3294         (WebCore::FontPlatformDataCacheKeyHash::hash):
3295         * platform/graphics/FontCascade.cpp:
3296         (WebCore::keysMatch):
3297         (WebCore::computeFontCascadeCacheHash):
3298         * platform/graphics/FontDescription.cpp:
3299         (WebCore::FontCascadeDescription::familyNamesAreEqual):
3300         (WebCore::FontCascadeDescription::familyNameHash):
3301         (WebCore::FontCascadeDescription::foldedFamilyName):
3302         * platform/graphics/FontDescription.h:
3303         * platform/graphics/cocoa/FontCacheCoreText.cpp:
3304         (WebCore::FontDatabase::fontForPostScriptName):
3305
3306 2017-07-28  Devin Rousso  <drousso@apple.com>
3307
3308         Web Inspector: Record actions performed on CanvasRenderingContext2D
3309         https://bugs.webkit.org/show_bug.cgi?id=174482
3310
3311         Reviewed by Joseph Pecoraro.
3312
3313         Tests: inspector/canvas/recording-2d.html
3314                inspector/canvas/recording.html
3315
3316         * html/canvas/CanvasRenderingContext2D.idl:
3317         Add CallTracingCallback to interface to record all API calls.
3318
3319         * html/HTMLCanvasElement.cpp:
3320         (WebCore::HTMLCanvasElement::paint):
3321         If a recording is active, mark the current frame as completed.
3322
3323         * bindings/scripts/CodeGeneratorJS.pm:
3324         (GenerateAttributeGetterBodyDefinition):
3325         (GenerateAttributeSetterBodyDefinition):
3326         (GenerateImplementationFunctionCall):
3327         (GenerateCallTracerParameter):
3328         (GenerateCallTracer):
3329         * bindings/scripts/test/TestCallTracer.idl:
3330         * bindings/scripts/test/JS/JSTestCallTracer.cpp:
3331         (WebCore::setJSTestCallTracerTestAttributeInterfaceSetter):
3332         (WebCore::setJSTestCallTracerTestAttributeSpecifiedSetter):
3333         (WebCore::jsTestCallTracerTestAttributeWithVariantGetter):
3334         (WebCore::jsTestCallTracerTestAttributeWithVariant):
3335         (WebCore::setJSTestCallTracerTestAttributeWithVariantSetter):
3336         (WebCore::setJSTestCallTracerTestAttributeWithVariant):
3337         (WebCore::jsTestCallTracerPrototypeFunctionTestOperationInterfaceBody):
3338         (WebCore::jsTestCallTracerPrototypeFunctionTestOperationSpecifiedBody):
3339         (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithArgumentsBody):
3340         (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithNullableArgumentBody):
3341         (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithVariantArgumentBody):
3342         (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithVariantArgument):
3343         * inspector/InspectorCanvas.h:
3344         * inspector/InspectorCanvas.cpp:
3345         (WebCore::InspectorCanvas::recordAction):
3346         (WebCore::InspectorCanvas::buildAction):
3347         Change CallTracer IDL generation to flatten any variants so that all types for the
3348         parameters of an action are able to be listed in a single variant. This prevents possible
3349         ambiguity when constructing the variant, as they require that exactly one type be
3350         constructible and a sub-variant might not satisfy that condition. This was only an issue for
3351         older mac SDKs.
3352
3353         * bindings/js/CallTracer.h:
3354         * bindings/js/CallTracer.cpp:
3355         (WebCore::CallTracer::recordCanvasAction):
3356         * bindings/js/CallTracerTypes.h:
3357         * inspector/InspectorCanvasAgent.h:
3358         * inspector/InspectorCanvasAgent.cpp:
3359         (WebCore::InspectorCanvasAgent::recordCanvasAction):
3360         * inspector/InspectorInstrumentation.h:
3361         * inspector/InspectorInstrumentation.cpp:
3362         (WebCore::InspectorInstrumentation::recordCanvasAction):
3363         (WebCore::InspectorInstrumentation::recordCanvasActionImpl):
3364         Rename CanvasActionParameterVariant to RecordCanvasActionVariant to match what is expected by
3365         the IDL generator. Also remove unnecessary includes now that they are in CallTracerTypes.h.
3366
3367         * CMakeLists.txt:
3368         * bindings/js/JSBindingsAllInOne.cpp:
3369         Add CallTracer for CMake builds.
3370
3371 2017-07-28  Sam Weinig  <sam@webkit.org>
3372
3373         [WebIDL] Split-up and cleanup Fetch IDL files in preparation for removing unnecessary js builtins
3374         https://bugs.webkit.org/show_bug.cgi?id=174915
3375
3376         Reviewed by Alex Christensen.
3377
3378         - Split FetchRequest enums and Init dictionary out of FetchRequest so they
3379           can be used from other files like WorkerGlobalScopeFetch and DOMWindowFetch.
3380         - Add missing FetchResponseInit. Currently unused but will be in a subsequent patch.
3381         - Add and update comments about missing properties and functions.
3382
3383         * CMakeLists.txt:
3384         * DerivedSources.make:
3385         * WebCore.xcodeproj/project.pbxproj:
3386         * Modules/fetch/DOMWindowFetch.idl:
3387         * Modules/fetch/FetchBody.idl:
3388         * Modules/fetch/FetchBodyOwner.h:
3389         * Modules/fetch/FetchHeaders.h:
3390         * Modules/fetch/FetchHeaders.idl:
3391         * Modules/fetch/FetchReferrerPolicy.h: Added.
3392         * Modules/fetch/FetchReferrerPolicy.idl: Added.
3393         * Modules/fetch/FetchRequest.h:
3394         * Modules/fetch/FetchRequest.idl:
3395         * Modules/fetch/FetchRequestCache.h: Added.
3396         * Modules/fetch/FetchRequestCache.idl: Added.
3397         * Modules/fetch/FetchRequestCredentials.h: Added.
3398         * Modules/fetch/FetchRequestCredentials.idl: Added.
3399         * Modules/fetch/FetchRequestInit.h: Added.
3400         * Modules/fetch/FetchRequestInit.idl: Added.
3401         * Modules/fetch/FetchRequestMode.h: Added.
3402         * Modules/fetch/FetchRequestMode.idl: Added.
3403         * Modules/fetch/FetchRequestRedirect.h: Added.
3404         * Modules/fetch/FetchRequestRedirect.idl: Added.
3405         * Modules/fetch/FetchResponse.h:
3406         * Modules/fetch/FetchResponse.idl:
3407         * Modules/fetch/WorkerGlobalScopeFetch.idl:
3408
3409 2017-07-28  Myles C. Maxfield  <mmaxfield@apple.com>
3410
3411         REGRESSION(r216944): Fallback fonts erroneously visible when the primary font is loading
3412         https://bugs.webkit.org/show_bug.cgi?id=174772
3413         <rdar://problem/33267643>
3414
3415         Reviewed by Simon Fraser.
3416
3417         During a font load, we try pretty hard to find a font to use that isn't the
3418         last resort font (which happens to be Times). We do this by iterating through
3419         all the fonts in the font-family list, as well as through all the relevant
3420         @font-face blocks which share the requested font family name. 
3421
3422         Unfortunately, if we find one of these fallback fonts, we were simply using it
3423         directly, which means that it was being drawn as visible (because the
3424         visibility setting lives inside the Font object). Instead, we should carry the
3425         invisibility setting from the interstitial font to this used fallback font.
3426
3427         This patch is an extension of r219221, which fixed the problem only for system
3428         fallback fonts. This patch adopts the same methodology to all fallback fonts.
3429
3430         Test: http/tests/webfont/font-loading-system-fallback-visibility-FontRanges.html
3431
3432         * platform/graphics/FontCascadeFonts.cpp:
3433         (WebCore::FontCascadeFonts::glyphDataForVariant):
3434         (WebCore::glyphPageFromFontRanges):
3435         * platform/graphics/FontRanges.cpp:
3436         (WebCore::FontRanges::glyphDataForCharacter):
3437
3438 2017-07-28  Frederic Wang  <fwang@igalia.cpm>
3439
3440         Fix typo in scrollPositionChangedViaDelegatedScrolling
3441         https://bugs.webkit.org/show_bug.cgi?id=174937
3442
3443         Reviewed by Wenson Hsieh.
3444
3445         No new tests, fix typo in the inUserInteraction parameter.
3446
3447         * page/scrolling/ScrollingTree.cpp:
3448         (WebCore::ScrollingTree::scrollPositionChangedViaDelegatedScrolling):
3449         * page/scrolling/ScrollingTree.h:
3450
3451 2017-07-28  Wenson Hsieh  <wenson_hsieh@apple.com>
3452
3453         [iOS DnD] [WK1] Snapshots generated using -[DOMRange renderImageForcingBlackText:] are upside down
3454         https://bugs.webkit.org/show_bug.cgi?id=174928
3455         <rdar://problem/33584280>
3456
3457         Reviewed by Tim Horton.
3458
3459         Pulls the implementation of createDragImageForRange out into DragImageIOS, and use TextIndicator to generate a
3460         snapshot instead of FrameSelection's snapshotting utilities. This makes snapshotting a DOMRange behave the same
3461         way as snapshotting a dragged selection.
3462
3463         No way of testing TextIndicator-based snapshotting yet.
3464
3465         * platform/DragImage.cpp:
3466
3467         Guard createDragImageForRange for !PLATFORM(IOS).
3468
3469         * platform/ios/DragImageIOS.mm:
3470         (WebCore::createDragImageForSelection):
3471
3472         Add a FIXME to point out that having an additional context flip inside the UIGraphicsImageRenderer block results
3473         in an upside-down drag image being returned from createDragImageFromImage. This image is being flipped elsewhere
3474         in drag initiation code, which eventually results in the correct orientation; we'll need further investigation
3475         to remove this extraneous flip.
3476
3477         (WebCore::createDragImageForRange):
3478
3479 2017-07-28  Jeremy Jones  <jeremyj@apple.com>
3480
3481         Remove Web prefix from WebVideoFullscreen and WebPlaybackSession classes.
3482         https://bugs.webkit.org/show_bug.cgi?id=174437
3483
3484         Reviewed by Darin Adler.
3485
3486         No new tests because no behavior change.
3487
3488         Remove redundant Web- prefix from classes in WebCore namespace.
3489
3490         * WebCore.xcodeproj/project.pbxproj:
3491         * html/HTMLMediaElement.cpp:
3492         * html/HTMLVideoElement.cpp:
3493         * platform/cocoa/PlaybackSessionInterface.h: Renamed from Source/WebCore/platform/cocoa/WebPlaybackSessionInterface.h.
3494         (WebCore::PlaybackSessionInterface::~PlaybackSessionInterface):
3495         * platform/cocoa/PlaybackSessionModel.h: Renamed from Source/WebCore/platform/cocoa/WebPlaybackSessionModel.h.
3496         (WebCore::PlaybackSessionModel::~PlaybackSessionModel):
3497         (WebCore::PlaybackSessionModelClient::~PlaybackSessionModelClient):
3498         (WebCore::PlaybackSessionModelClient::externalPlaybackChanged):
3499         * platform/cocoa/PlaybackSessionModelMediaElement.h: Renamed from Source/WebCore/platform/cocoa/WebPlaybackSessionModelMediaElement.h.
3500         * platform/cocoa/PlaybackSessionModelMediaElement.mm: Renamed from Source/WebCore/platform/cocoa/WebPlaybackSessionModelMediaElement.mm.
3501         * platform/cocoa/VideoFullscreenChangeObserver.h: Renamed from Source/WebCore/platform/cocoa/WebVideoFullscreenChangeObserver.h.
3502         (WebCore::VideoFullscreenChangeObserver::~VideoFullscreenChangeObserver):
3503         * platform/cocoa/VideoFullscreenModel.h: Renamed from Source/WebCore/platform/cocoa/WebVideoFullscreenModel.h.
3504         (WebCore::VideoFullscreenModel::~VideoFullscreenModel):
3505         (WebCore::VideoFullscreenModelClient::~VideoFullscreenModelClient):
3506         * platform/cocoa/VideoFullscreenModelVideoElement.h: Renamed from Source/WebCore/platform/cocoa/WebVideoFullscreenModelVideoElement.h.
3507         (WebCore::VideoFullscreenModelVideoElement::create):
3508         * platform/cocoa/VideoFullscreenModelVideoElement.mm: Renamed from Source/WebCore/platform/cocoa/WebVideoFullscreenModelVideoElement.mm.
3509         * platform/ios/PlaybackSessionInterfaceAVKit.h: Renamed from Source/WebCore/platform/ios/WebPlaybackSessionInterfaceAVKit.h.
3510         * platform/ios/PlaybackSessionInterfaceAVKit.mm: Renamed from Source/WebCore/platform/ios/WebPlaybackSessionInterfaceAVKit.mm.
3511         * platform/ios/VideoFullscreenInterfaceAVKit.h: Renamed from Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.h.
3512         * platform/ios/VideoFullscreenInterfaceAVKit.mm: Renamed from Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm.
3513         * platform/ios/WebAVPlayerController.h:
3514         * platform/ios/WebAVPlayerController.mm:
3515         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
3516         * platform/mac/PlaybackSessionInterfaceMac.h: Renamed from Source/WebCore/platform/mac/WebPlaybackSessionInterfaceMac.h.
3517         * platform/mac/PlaybackSessionInterfaceMac.mm: Renamed from Source/WebCore/platform/mac/WebPlaybackSessionInterfaceMac.mm.
3518         * platform/mac/VideoFullscreenInterfaceMac.h: Renamed from Source/WebCore/platform/mac/WebVideoFullscreenInterfaceMac.h.
3519         * platform/mac/VideoFullscreenInterfaceMac.mm: Renamed from Source/WebCore/platform/mac/WebVideoFullscreenInterfaceMac.mm.
3520         * platform/mac/WebPlaybackControlsManager.h:
3521         * platform/mac/WebPlaybackControlsManager.mm:
3522
3523 2017-07-27  Jeremy Jones  <jeremyj@apple.com>
3524
3525         Don't override _allowsMediaDocumentInlinePlayback in MediaDocument with playsinlineAttr.
3526         https://bugs.webkit.org/show_bug.cgi?id=174850
3527         rdar://problem/33449903
3528
3529         Reviewed by Jon Lee.
3530
3531         This change removes playsinlineAttr from MediaDocument so that it doesn't override the setting
3532         from _allowsMediaDocumentInlinePlayback. In its place is an update to requiresFullscreenForVideoPlayback
3533         that implements the details of exactly which media documents are still allowed to play inlne.
3534
3535         Media documents always use a video element; but when there are no video tracks, it has behavior like 
3536         an audio element. See media-controller.js isAudio().
3537
3538         This change preserves this behavior with respect to fullscreen requirements for media document by
3539         mirroring the isAudio() check in requiresFullscreenForVideoPlayback.
3540
3541         * html/MediaDocument.cpp:
3542         (WebCore::MediaDocumentParser::createDocumentStructure):
3543         * html/MediaElementSession.cpp:
3544         (WebCore::MediaElementSession::requiresFullscreenForVideoPlayback):
3545
3546 2017-07-27  Jeremy Jones  <jeremyj@apple.com>
3547
3548         MediaDocument fullscreen pinch gesture should trigger navigate back.
3549         https://bugs.webkit.org/show_bug.cgi?id=174914
3550
3551         Reviewed by Jon Lee.
3552
3553         No new tests because only effect is from interaction with platform.
3554
3555         For media documents, pressing the "done" button on fullscreen video navigates back
3556         to the previous page. The same should happen for other gestures that pause playback
3557         when returning to inline. This allows the gesture to have the same behavior as the
3558         button.
3559
3560         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
3561         (WebVideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):
3562
3563 2017-07-27  Aaron Chu  <aaron_chu@apple.com>
3564
3565         AX: VoiceOver silent or skipping over time values on media player.
3566         https://bugs.webkit.org/show_bug.cgi?id=174324
3567         <rdar://problem/32021784>
3568
3569         Reviewed by Antoine Quint.
3570
3571         Added role attribute to modern media controls time lable class so that VoiceOver can access the time label when the media is playing.
3572
3573         Test Updated: media/modern-media-controls/time-label/time-label.html
3574         Test Added: media/modern-media-controls/time-label/ios-time-label.html
3575         
3576         * Modules/modern-media-controls/controls/time-label.js:
3577
3578 2017-07-27  Yusuke Suzuki  <utatane.tea@gmail.com>
3579
3580         Hoist DOM binding attribute getter prologue into JavaScriptCore taking advantage of DOMJIT / CheckSubClass
3581         https://bugs.webkit.org/show_bug.cgi?id=171637
3582
3583         Reviewed by Darin Adler.
3584
3585         We use DOMAttribute. When DOMAttribute is specified, ClassInfo check is performed by JSC side.
3586         So, we can drop ClassInfo check from the actual function.
3587
3588         We also simplify DOMJIT::GetterSetter to make it smaller size.
3589
3590         WebCore size comparison
3591             Before: 48443292
3592             After:  48087800 (0.7% reduction)
3593
3594         Speedometer Scores show 0.8% improvement.
3595             Before: 158.9 +- 0.46
3596             After:  160.2 +- 0.36
3597
3598         Dromaeo DOM core Scores show 5.8% improvement.
3599                                         Before                   After
3600             Total Score:         8424.12runs/s ±1.38%     8911.60runs/s ±1.47%
3601               DOM Attributes    12627.27runs/s ±1.87%    14023.17runs/s ±1.87%
3602               DOM Modification   1207.82runs/s ±2.48%     1204.21runs/s ±3.05%
3603               DOM Query         68068.82runs/s ±0.63%    74273.38runs/s ±0.69%
3604               DOM Traversal      1240.07runs/s ±1.96%     1256.64runs/s ±1.77%
3605
3606         Performance improvement can be explained by the following optimizations.
3607
3608         1. Type checks are typically eliminated in all the JIT tiers. IC / DFG / FTL can
3609            drop type checks since get_by_id operation already performs a structure check
3610            which subsumes this type check.
3611         2. Direct getter call by CallDOMGetter without creating IC in DFG and FTL.
3612
3613         * bindings/js/JSDOMAttribute.h:
3614         (WebCore::IDLAttribute::get):
3615         Add CastedThisErrorBehavior::Assert case. When this is specified, we perform casting without using jsDynamicCast.
3616
3617         * bindings/scripts/CodeGeneratorJS.pm:
3618         (IsAcceleratedDOMAttribute):
3619         (GetJSCAttributesForAttribute):
3620         (GenerateHeader):
3621         (GeneratePropertiesHashTable):
3622         (GenerateImplementation):
3623         (GenerateAttributeGetterTrampolineDefinition):
3624         (GenerateAttributeGetterDefinition):
3625         (GenerateCallbackImplementationContent):
3626         (GenerateHashTableValueArray):
3627         (GenerateHashTable):
3628         (GenerateConstructorHelperMethods):
3629         Update CodeGeneratorJS to emit DOMAttribute. And DOMJIT::GetterSetter becomes changed to be smaller size.
3630
3631         * bindings/scripts/test/JS/JSInterfaceName.cpp:
3632         (WebCore::JSInterfaceNamePrototype::finishCreation):
3633         * bindings/scripts/test/JS/JSMapLike.cpp:
3634         (WebCore::JSMapLikePrototype::finishCreation):
3635         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
3636         (WebCore::JSReadOnlyMapLikePrototype::finishCreation):
3637         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
3638         (WebCore::JSTestActiveDOMObjectPrototype::finishCreation):
3639         (WebCore::jsTestActiveDOMObjectExcitingAttr):
3640         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
3641         (WebCore::JSTestCEReactionsPrototype::finishCreation):
3642         (WebCore::jsTestCEReactionsAttributeWithCEReactions):
3643         (WebCore::jsTestCEReactionsReflectAttributeWithCEReactions):
3644         (WebCore::jsTestCEReactionsStringifierAttribute):
3645         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
3646         (WebCore::JSTestCEReactionsStringifierPrototype::finishCreation):
3647         (WebCore::jsTestCEReactionsStringifierValue):
3648         * bindings/scripts/test/JS/JSTestCallTracer.cpp:
3649         (WebCore::JSTestCallTracerPrototype::finishCreation):
3650         (WebCore::jsTestCallTracerTestAttributeInterface):
3651         (WebCore::jsTestCallTracerTestAttributeSpecified):
3652         * bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
3653         (WebCore::JSTestCallbackInterfaceConstructor::initializeProperties):
3654         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
3655         (WebCore::JSTestClassWithJSBuiltinConstructorPrototype::finishCreation):
3656         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
3657         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectPrototype::finishCreation):
3658         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
3659         (WebCore::JSTestDOMJITPrototype::finishCreation):
3660         (WebCore::TestDOMJITAnyAttrDOMJIT::TestDOMJITAnyAttrDOMJIT): Deleted.
3661         (WebCore::domJITGetterSetterForTestDOMJITAnyAttr): Deleted.
3662         (WebCore::TestDOMJITBooleanAttrDOMJIT::TestDOMJITBooleanAttrDOMJIT): Deleted.
3663         (WebCore::domJITGetterSetterForTestDOMJITBooleanAttr): Deleted.
3664         (WebCore::TestDOMJITByteAttrDOMJIT::TestDOMJITByteAttrDOMJIT): Deleted.
3665         (WebCore::domJITGetterSetterForTestDOMJITByteAttr): Deleted.
3666         (WebCore::TestDOMJITOctetAttrDOMJIT::TestDOMJITOctetAttrDOMJIT): Deleted.
3667         (WebCore::domJITGetterSetterForTestDOMJITOctetAttr): Deleted.
3668         (WebCore::TestDOMJITShortAttrDOMJIT::TestDOMJITShortAttrDOMJIT): Deleted.
3669         (WebCore::domJITGetterSetterForTestDOMJITShortAttr): Deleted.
3670         (WebCore::TestDOMJITUnsignedShortAttrDOMJIT::TestDOMJITUnsignedShortAttrDOMJIT): Deleted.
3671         (WebCore::domJITGetterSetterForTestDOMJITUnsignedShortAttr): Deleted.
3672         (WebCore::TestDOMJITLongAttrDOMJIT::TestDOMJITLongAttrDOMJIT): Deleted.
3673         (WebCore::domJITGetterSetterForTestDOMJITLongAttr): Deleted.
3674         (WebCore::TestDOMJITUnsignedLongAttrDOMJIT::TestDOMJITUnsignedLongAttrDOMJIT): Deleted.
3675         (WebCore::domJITGetterSetterForTestDOMJITUnsignedLongAttr): Deleted.
3676         (WebCore::TestDOMJITLongLongAttrDOMJIT::TestDOMJITLongLongAttrDOMJIT): Deleted.
3677         (WebCore::domJITGetterSetterForTestDOMJITLongLongAttr): Deleted.
3678         (WebCore::TestDOMJITUnsignedLongLongAttrDOMJIT::TestDOMJITUnsignedLongLongAttrDOMJIT): Deleted.
3679         (WebCore::domJITGetterSetterForTestDOMJITUnsignedLongLongAttr): Deleted.
3680         (WebCore::TestDOMJITFloatAttrDOMJIT::TestDOMJITFloatAttrDOMJIT): Deleted.
3681         (WebCore::domJITGetterSetterForTestDOMJITFloatAttr): Deleted.
3682         (WebCore::TestDOMJITUnrestrictedFloatAttrDOMJIT::TestDOMJITUnrestrictedFloatAttrDOMJIT): Deleted.
3683         (WebCore::domJITGetterSetterForTestDOMJITUnrestrictedFloatAttr): Deleted.
3684         (WebCore::TestDOMJITDoubleAttrDOMJIT::TestDOMJITDoubleAttrDOMJIT): Deleted.
3685         (WebCore::domJITGetterSetterForTestDOMJITDoubleAttr): Deleted.
3686         (WebCore::TestDOMJITUnrestrictedDoubleAttrDOMJIT::TestDOMJITUnrestrictedDoubleAttrDOMJIT): Deleted.
3687         (WebCore::domJITGetterSetterForTestDOMJITUnrestrictedDoubleAttr): Deleted.
3688         (WebCore::TestDOMJITDomStringAttrDOMJIT::TestDOMJITDomStringAttrDOMJIT): Deleted.
3689         (WebCore::domJITGetterSetterForTestDOMJITDomStringAttr): Deleted.
3690         (WebCore::TestDOMJITByteStringAttrDOMJIT::TestDOMJITByteStringAttrDOMJIT): Deleted.
3691         (WebCore::domJITGetterSetterForTestDOMJITByteStringAttr): Deleted.
3692         (WebCore::TestDOMJITUsvStringAttrDOMJIT::TestDOMJITUsvStringAttrDOMJIT): Deleted.
3693         (WebCore::domJITGetterSetterForTestDOMJITUsvStringAttr): Deleted.
3694         (WebCore::TestDOMJITNodeAttrDOMJIT::TestDOMJITNodeAttrDOMJIT): Deleted.
3695         (WebCore::domJITGetterSetterForTestDOMJITNodeAttr): Deleted.
3696         (WebCore::TestDOMJITBooleanNullableAttrDOMJIT::TestDOMJITBooleanNullableAttrDOMJIT): Deleted.
3697         (WebCore::domJITGetterSetterForTestDOMJITBooleanNullableAttr): Deleted.
3698         (WebCore::TestDOMJITByteNullableAttrDOMJIT::TestDOMJITByteNullableAttrDOMJIT): Deleted.
3699         (WebCore::domJITGetterSetterForTestDOMJITByteNullableAttr): Deleted.
3700         (WebCore::TestDOMJITOctetNullableAttrDOMJIT::TestDOMJITOctetNullableAttrDOMJIT): Deleted.
3701         (WebCore::domJITGetterSetterForTestDOMJITOctetNullableAttr): Deleted.
3702         (WebCore::TestDOMJITShortNullableAttrDOMJIT::TestDOMJITShortNullableAttrDOMJIT): Deleted.
3703         (WebCore::domJITGetterSetterForTestDOMJITShortNullableAttr): Deleted.
3704         (WebCore::TestDOMJITUnsignedShortNullableAttrDOMJIT::TestDOMJITUnsignedShortNullableAttrDOMJIT): Deleted.
3705         (WebCore::domJITGetterSetterForTestDOMJITUnsignedShortNullableAttr): Deleted.
3706         (WebCore::TestDOMJITLongNullableAttrDOMJIT::TestDOMJITLongNullableAttrDOMJIT): Deleted.
3707         (WebCore::domJITGetterSetterForTestDOMJITLongNullableAttr): Deleted.
3708         (WebCore::TestDOMJITUnsignedLongNullableAttrDOMJIT::TestDOMJITUnsignedLongNullableAttrDOMJIT): Deleted.
3709         (WebCore::domJITGetterSetterForTestDOMJITUnsignedLongNullableAttr): Deleted.
3710         (WebCore::TestDOMJITLongLongNullableAttrDOMJIT::TestDOMJITLongLongNullableAttrDOMJIT): Deleted.
3711         (WebCore::domJITGetterSetterForTestDOMJITLongLongNullableAttr): Deleted.
3712         (WebCore::TestDOMJITUnsignedLongLongNullableAttrDOMJIT::TestDOMJITUnsignedLongLongNullableAttrDOMJIT): Deleted.
3713         (WebCore::domJITGetterSetterForTestDOMJITUnsignedLongLongNullableAttr): Deleted.
3714         (WebCore::TestDOMJITFloatNullableAttrDOMJIT::TestDOMJITFloatNullableAttrDOMJIT): Deleted.
3715         (WebCore::domJITGetterSetterForTestDOMJITFloatNullableAttr): Deleted.
3716         (WebCore::TestDOMJITUnrestrictedFloatNullableAttrDOMJIT::TestDOMJITUnrestrictedFloatNullableAttrDOMJIT): Deleted.
3717         (WebCore::domJITGetterSetterForTestDOMJITUnrestrictedFloatNullableAttr): Deleted.
3718         (WebCore::TestDOMJITDoubleNullableAttrDOMJIT::TestDOMJITDoubleNullableAttrDOMJIT): Deleted.
3719         (WebCore::domJITGetterSetterForTestDOMJITDoubleNullableAttr): Deleted.
3720         (WebCore::TestDOMJITUnrestrictedDoubleNullableAttrDOMJIT::TestDOMJITUnrestrictedDoubleNullableAttrDOMJIT): Deleted.
3721         (WebCore::domJITGetterSetterForTestDOMJITUnrestrictedDoubleNullableAttr): Deleted.
3722         (WebCore::TestDOMJITDomStringNullableAttrDOMJIT::TestDOMJITDomStringNullableAttrDOMJIT): Deleted.
3723         (WebCore::domJITGetterSetterForTestDOMJITDomStringNullableAttr): Deleted.
3724         (WebCore::TestDOMJITByteStringNullableAttrDOMJIT::TestDOMJITByteStringNullableAttrDOMJIT): Deleted.
3725         (WebCore::domJITGetterSetterForTestDOMJITByteStringNullableAttr): Deleted.
3726         (WebCore::TestDOMJITUsvStringNullableAttrDOMJIT::TestDOMJITUsvStringNullableAttrDOMJIT): Deleted.
3727         (WebCore::domJITGetterSetterForTestDOMJITUsvStringNullableAttr): Deleted.
3728         (WebCore::TestDOMJITNodeNullableAttrDOMJIT::TestDOMJITNodeNullableAttrDOMJIT): Deleted.
3729         (WebCore::domJITGetterSetterForTestDOMJITNodeNullableAttr): Deleted.
3730         * bindings/scripts/test/JS/JSTestDOMJIT.h:
3731         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
3732         (WebCore::JSTestEventConstructorPrototype::finishCreation):
3733         (WebCore::jsTestEventConstructorAttr1):
3734         (WebCore::jsTestEventConstructorAttr2):
3735         (WebCore::jsTestEventConstructorAttr3):
3736         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
3737         (WebCore::JSTestEventTargetPrototype::finishCreation):
3738         * bindings/scripts/test/JS/JSTestException.cpp:
3739         (WebCore::JSTestExceptionPrototype::finishCreation):
3740         (WebCore::jsTestExceptionName):
3741         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
3742         (WebCore::JSTestGenerateIsReachablePrototype::finishCreation):
3743         (WebCore::jsTestGenerateIsReachableASecretAttribute):
3744         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
3745         (WebCore::jsTestGlobalObjectRegularAttribute):
3746         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
3747         (WebCore::JSTestIndexedSetterNoIdentifierPrototype::finishCreation):
3748         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
3749         (WebCore::JSTestIndexedSetterThrowingExceptionPrototype::finishCreation):
3750         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
3751         (WebCore::JSTestIndexedSetterWithIdentifierPrototype::finishCreation):
3752         * bindings/scripts/test/JS/JSTestInterface.cpp:
3753         (WebCore::JSTestInterfaceConstructor::initializeProperties):
3754         (WebCore::JSTestInterfacePrototype::finishCreation):
3755         (WebCore::jsTestInterfaceImplementsStr1):
3756         (WebCore::jsTestInterfaceImplementsStr2):
3757         (WebCore::jsTestInterfaceImplementsStr3):
3758         (WebCore::jsTestInterfaceImplementsNode):
3759         (WebCore::jsTestInterfaceSupplementalStr1):
3760         (WebCore::jsTestInterfaceSupplementalStr2):
3761         (WebCore::jsTestInterfaceSupplementalStr3):
3762         (WebCore::jsTestInterfaceSupplementalNode):
3763         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
3764         (WebCore::JSTestInterfaceLeadingUnderscorePrototype::finishCreation):
3765         (WebCore::jsTestInterfaceLeadingUnderscoreReadonly):
3766         * bindings/scripts/test/JS/JSTestIterable.cpp:
3767         (WebCore::JSTestIterablePrototype::finishCreation):
3768         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
3769         (WebCore::JSTestJSBuiltinConstructorPrototype::finishCreation):
3770         (WebCore::jsTestJSBuiltinConstructorTestAttributeCustom):
3771         (WebCore::jsTestJSBuiltinConstructorTestAttributeRWCustom):
3772         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
3773         (WebCore::JSTestMediaQueryListListenerPrototype::finishCreation):
3774         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
3775         (WebCore::JSTestNamedAndIndexedSetterNoIdentifierPrototype::finishCreation):
3776         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
3777         (WebCore::JSTestNamedAndIndexedSetterThrowingExceptionPrototype::finishCreation):
3778         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
3779         (WebCore::JSTestNamedAndIndexedSetterWithIdentifierPrototype::finishCreation):
3780         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
3781         (WebCore::JSTestNamedConstructorPrototype::finishCreation):
3782         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
3783         (WebCore::JSTestNamedDeleterNoIdentifierPrototype::finishCreation):
3784         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
3785         (WebCore::JSTestNamedDeleterThrowingExceptionPrototype::finishCreation):
3786         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
3787         (WebCore::JSTestNamedDeleterWithIdentifierPrototype::finishCreation):
3788         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
3789         (WebCore::JSTestNamedDeleterWithIndexedGetterPrototype::finishCreation):
3790         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
3791         (WebCore::JSTestNamedGetterCallWithPrototype::finishCreation):
3792         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
3793         (WebCore::JSTestNamedGetterNoIdentifierPrototype::finishCreation):
3794         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
3795         (WebCore::JSTestNamedGetterWithIdentifierPrototype::finishCreation):
3796         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
3797         (WebCore::JSTestNamedSetterNoIdentifierPrototype::finishCreation):
3798         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
3799         (WebCore::JSTestNamedSetterThrowingExceptionPrototype::finishCreation):
3800         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
3801         (WebCore::JSTestNamedSetterWithIdentifierPrototype::finishCreation):
3802         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
3803         (WebCore::JSTestNamedSetterWithIndexedGetterPrototype::finishCreation):
3804         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
3805         (WebCore::JSTestNamedSetterWithIndexedGetterAndSetterPrototype::finishCreation):
3806         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
3807         (WebCore::JSTestNamedSetterWithOverrideBuiltinsPrototype::finishCreation):
3808         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
3809         (WebCore::JSTestNamedSetterWithUnforgablePropertiesPrototype::finishCreation):
3810         (WebCore::jsTestNamedSetterWithUnforgablePropertiesUnforgeableAttribute):
3811         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
3812         (WebCore::JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsPrototype::finishCreation):
3813         (WebCore::jsTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsUnforgeableAttribute):
3814         * bindings/scripts/test/JS/JSTestNode.cpp:
3815         (WebCore::JSTestNodePrototype::finishCreation):
3816         (WebCore::jsTestNodeName):
3817         * bindings/scripts/test/JS/JSTestObj.cpp:
3818         (WebCore::JSTestObjConstructor::initializeProperties):
3819         (WebCore::JSTestObjPrototype::finishCreation):
3820         (WebCore::jsTestObjReadOnlyLongAttr):
3821         (WebCore::jsTestObjReadOnlyStringAttr):
3822         (WebCore::jsTestObjReadOnlyTestObjAttr):
3823         (WebCore::jsTestObjEnumAttr):
3824         (WebCore::jsTestObjByteAttr):
3825         (WebCore::jsTestObjOctetAttr):
3826         (WebCore::jsTestObjShortAttr):
3827         (WebCore::jsTestObjClampedShortAttr):
3828         (WebCore::jsTestObjEnforceRangeShortAttr):
3829         (WebCore::jsTestObjUnsignedShortAttr):
3830         (WebCore::jsTestObjLongAttr):
3831         (WebCore::jsTestObjLongLongAttr):
3832         (WebCore::jsTestObjUnsignedLongLongAttr):
3833         (WebCore::jsTestObjStringAttr):
3834         (WebCore::jsTestObjUsvstringAttr):
3835         (WebCore::jsTestObjTestObjAttr):
3836         (WebCore::jsTestObjTestNullableObjAttr):
3837         (WebCore::jsTestObjUnforgeableAttr):
3838         (WebCore::jsTestObjStringAttrTreatingNullAsEmptyString):
3839         (WebCore::jsTestObjUsvstringAttrTreatingNullAsEmptyString):
3840         (WebCore::jsTestObjByteStringAttrTreatingNullAsEmptyString):
3841         (WebCore::jsTestObjStringLongRecordAttr):
3842         (WebCore::jsTestObjUsvstringLongRecordAttr):
3843         (WebCore::jsTestObjStringObjRecordAttr):
3844         (WebCore::jsTestObjStringNullableObjRecordAttr):
3845         (WebCore::jsTestObjDictionaryAttr):
3846         (WebCore::jsTestObjNullableDictionaryAttr):
3847         (WebCore::jsTestObjAnnotatedTypeInUnionAttr):
3848         (WebCore::jsTestObjAnnotatedTypeInSequenceAttr):
3849         (WebCore::jsTestObjImplementationEnumAttr):
3850         (WebCore::jsTestObjXMLObjAttr):
3851         (WebCore::jsTestObjCreate):
3852         (WebCore::jsTestObjReflectedStringAttr):
3853         (WebCore::jsTestObjReflectedUSVStringAttr):
3854         (WebCore::jsTestObjReflectedIntegralAttr):
3855         (WebCore::jsTestObjReflectedUnsignedIntegralAttr):
3856         (WebCore::jsTestObjReflectedBooleanAttr):
3857         (WebCore::jsTestObjReflectedURLAttr):
3858         (WebCore::jsTestObjReflectedUSVURLAttr):
3859         (WebCore::jsTestObjReflectedCustomIntegralAttr):
3860         (WebCore::jsTestObjReflectedCustomBooleanAttr):
3861         (WebCore::jsTestObjReflectedCustomURLAttr):
3862         (WebCore::jsTestObjEnabledAtRuntimeAttribute):
3863         (WebCore::jsTestObjEnabledBySettingAttribute):
3864         (WebCore::jsTestObjTypedArrayAttr):
3865         (WebCore::jsTestObjAttributeWithGetterException):
3866         (WebCore::jsTestObjAttributeWithSetterException):
3867         (WebCore::jsTestObjStringAttrWithGetterException):
3868         (WebCore::jsTestObjStringAttrWithSetterException):
3869         (WebCore::jsTestObjCustomAttr):
3870         (WebCore::jsTestObjOnfoo):
3871         (WebCore::jsTestObjOnwebkitfoo):
3872         (WebCore::jsTestObjWithScriptStateAttribute):
3873         (WebCore::jsTestObjWithCallWithAndSetterCallWithAttribute):
3874         (WebCore::jsTestObjWithScriptExecutionContextAttribute):
3875         (WebCore::jsTestObjWithScriptStateAttributeRaises):
3876         (WebCore::jsTestObjWithScriptExecutionContextAttributeRaises):
3877         (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttribute):
3878         (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttributeRaises):
3879         (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute):
3880         (WebCore::jsTestObjConditionalAttr1):
3881         (WebCore::jsTestObjConditionalAttr2):
3882         (WebCore::jsTestObjConditionalAttr3):
3883         (WebCore::jsTestObjCachedAttribute1):
3884         (WebCore::jsTestObjCachedAttribute2):
3885         (WebCore::jsTestObjAnyAttribute):
3886         (WebCore::jsTestObjObjectAttribute):
3887         (WebCore::jsTestObjContentDocument):
3888         (WebCore::jsTestObjMutablePoint):
3889         (WebCore::jsTestObjStrawberry):
3890         (WebCore::jsTestObjDescription):
3891         (WebCore::jsTestObjId):
3892         (WebCore::jsTestObjHash):
3893         (WebCore::jsTestObjReplaceableAttribute):
3894         (WebCore::jsTestObjNullableDoubleAttribute):
3895         (WebCore::jsTestObjNullableLongAttribute):
3896         (WebCore::jsTestObjNullableBooleanAttribute):
3897         (WebCore::jsTestObjNullableStringAttribute):
3898         (WebCore::jsTestObjNullableLongSettableAttribute):
3899         (WebCore::jsTestObjNullableStringSettableAttribute):
3900         (WebCore::jsTestObjNullableUSVStringSettableAttribute):
3901         (WebCore::jsTestObjNullableByteStringSettableAttribute):
3902         (WebCore::jsTestObjNullableStringValue):
3903         (WebCore::jsTestObjAttribute):
3904         (WebCore::jsTestObjAttributeWithReservedEnumType):
3905         (WebCore::jsTestObjPutForwardsAttribute):
3906         (WebCore::jsTestObjPutForwardsNullableAttribute):
3907         (WebCore::jsTestObjStringifierAttribute):
3908         (WebCore::jsTestObjConditionallyReadWriteAttribute):
3909         (WebCore::jsTestObjConditionalAndConditionallyReadWriteAttribute):
3910         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
3911         (WebCore::JSTestOverloadedConstructorsPrototype::finishCreation):
3912         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
3913         (WebCore::JSTestOverloadedConstructorsWithSequencePrototype::finishCreation):
3914         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
3915         (WebCore::JSTestOverrideBuiltinsPrototype::finishCreation):
3916         * bindings/scripts/test/JS/JSTestPluginInterface.cpp:
3917         (WebCore::JSTestPluginInterfacePrototype::finishCreation):
3918         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
3919         (WebCore::JSTestPromiseRejectionEventPrototype::finishCreation):
3920         (WebCore::jsTestPromiseRejectionEventReason):
3921         * bindings/scripts/test/JS/JSTestSerialization.cpp:
3922         (WebCore::JSTestSerializationPrototype::finishCreation):
3923         (WebCore::jsTestSerializationFirstStringAttribute):
3924         (WebCore::jsTestSerializationSecondLongAttribute):
3925         (WebCore::jsTestSerializationThirdUnserializableAttribute):
3926         (WebCore::jsTestSerializationFourthUnrestrictedDoubleAttribute):
3927         (WebCore::jsTestSerializationFifthLongAttribute):
3928         (WebCore::jsTestSerializationSixthTypedefAttribute):
3929         (WebCore::jsTestSerializationSeventhDirectlySerializableAttribute):
3930         (WebCore::jsTestSerializationEighthIndirectlyAttribute):
3931         * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp:
3932         (WebCore::JSTestSerializationIndirectInheritancePrototype::finishCreation):
3933         * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
3934         (WebCore::JSTestSerializationInheritPrototype::finishCreation):
3935         (WebCore::jsTestSerializationInheritInheritLongAttribute):
3936         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
3937         (WebCore::JSTestSerializationInheritFinalPrototype::finishCreation):
3938         (WebCore::jsTestSerializationInheritFinalFinalLongAttributeFoo):
3939         (WebCore::jsTestSerializationInheritFinalFinalLongAttributeBar):
3940         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
3941         (WebCore::JSTestSerializedScriptValueInterfacePrototype::finishCreation):
3942         (WebCore::jsTestSerializedScriptValueInterfaceValue):
3943         (WebCore::jsTestSerializedScriptValueInterfaceReadonlyValue):
3944         (WebCore::jsTestSerializedScriptValueInterfaceCachedValue):
3945         (WebCore::jsTestSerializedScriptValueInterfacePorts):
3946         (WebCore::jsTestSerializedScriptValueInterfaceCachedReadonlyValue):
3947         * bindings/scripts/test/JS/JSTestStringifier.cpp:
3948         (WebCore::JSTestStringifierPrototype::finishCreation):
3949         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
3950         (WebCore::JSTestStringifierAnonymousOperationPrototype::finishCreation):
3951         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
3952         (WebCore::JSTestStringifierNamedOperationPrototype::finishCreation):
3953         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
3954         (WebCore::JSTestStringifierOperationImplementedAsPrototype::finishCreation):
3955         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
3956         (WebCore::JSTestStringifierOperationNamedToStringPrototype::finishCreation):
3957         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
3958         (WebCore::JSTestStringifierReadOnlyAttributePrototype::finishCreation):
3959         (WebCore::jsTestStringifierReadOnlyAttributeIdentifier):
3960         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
3961         (WebCore::JSTestStringifierReadWriteAttributePrototype::finishCreation):
3962         (WebCore::jsTestStringifierReadWriteAttributeIdentifier):
3963         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
3964         (WebCore::JSTestTypedefsConstructor::initializeProperties):
3965         (WebCore::JSTestTypedefsPrototype::finishCreation):
3966         (WebCore::jsTestTypedefsUnsignedLongLongAttr):
3967         (WebCore::jsTestTypedefsSerializedScriptValue):
3968         (WebCore::jsTestTypedefsAttributeWithClamp):
3969         (WebCore::jsTestTypedefsAttributeWithClampInTypedef):
3970         (WebCore::jsTestTypedefsAttrWithGetterException):
3971         (WebCore::jsTestTypedefsAttrWithSetterException):
3972         (WebCore::jsTestTypedefsStringAttrWithGetterException):
3973         (WebCore::jsTestTypedefsStringAttrWithSetterException):
3974         (WebCore::jsTestTypedefsBufferSourceAttr):
3975         (WebCore::jsTestTypedefsDomTimeStampAttr):
3976         They are binding test rebaselines.