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