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