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