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