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