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