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