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