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