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