38c96cd8d352c4b51be5e10c3aca41e649266033
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-10-05  Dean Jackson  <dino@apple.com>
2
3         Lots of missing frames in YouTube360 when fullscreen on MacBook
4         https://bugs.webkit.org/show_bug.cgi?id=177903
5         <rdar://problem/33273300>
6
7         Reviewed by Sam Weinig.
8
9         Our compositing path for WebGL on macOS was too slow, requiring a copy
10         of the framebuffer into another GL context. Replace this by having
11         WebGL render into a texture that is backed by an IOSurface, and then
12         set the WebGLLayer to use the IOSurface as contents.
13
14         Covered by the existing WebGL tests.
15
16         * platform/graphics/GraphicsContext3D.h:
17         (WebCore::GraphicsContext3D::platformTexture const): We no longer use the
18         framebuffer object outside the class, so change this to return the GL texture
19         that the framebuffer is rendering in to. It was kind-of strange that it was
20         named this way originally.
21         Also make endPaint available on macOS, and add the definitions for
22         createIOSurfaceBackingStore and updateFramebufferTextureBackingStoreFromLayer.
23
24         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
25         (WebCore::GraphicsContext3D::GraphicsContext3D): Now that we're using an IOSurface,
26         we're binding to a new attachment point, GL_TEXTURE_RECTANGLE.
27         (WebCore::GraphicsContext3D::endPaint): This is now being called on macOS and iOS,
28         so add a comment that explains the extra work that iOS needs to do. At some future
29         point it would be nice to make this slightly cleaner, so that iOS and macOS are
30         more similar.
31         (WebCore::GraphicsContext3D::allocateIOSurfaceBackingStore): New function that calls
32         into the corresponding WebGLLayer function.
33         (WebCore::GraphicsContext3D::updateFramebufferTextureBackingStoreFromLayer): Ditto.
34
35         * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
36         (WebCore::wipeAlphaChannelFromPixels): Both readPixels and drawing a WebGL context
37         into another buffer need to fill out the alpha channel if this context was
38         created without one, otherwise the IOSurface backing store will happily provide
39         what might be non-zero values.
40         (WebCore::GraphicsContext3D::readPixelsAndConvertToBGRAIfNecessary): Call the helper above.
41         (WebCore::GraphicsContext3D::reshapeFBOs): Add more code to call into the macOS-specific
42         function to use an IOSurface as the framebuffer texture.
43         (WebCore::GraphicsContext3D::readPixels): Call the helper above.
44
45         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
46         (PlatformCALayerCocoa::copyContentsFromLayer): Replace the use of the
47         deprecated setContentsChanged with reloadValueForKeyPath.
48
49         * platform/graphics/cocoa/WebGLLayer.h: The macOS implementation now
50         inherits from CALayer directly rather than CAOpenGLLayer. It also adds
51         a few member variables to handle the IOSurfaces used for triple buffering.
52
53         * platform/graphics/cocoa/WebGLLayer.mm:
54         (-[WebGLLayer initWithGraphicsContext3D:]): If we were created without an
55         alpha channel, tell CA that we're an opaque layer. Also set the layer's transform
56         to identity, so that it calls into the code below to flip the contents.
57         (-[WebGLLayer setTransform:]): Because an IOSurface is used for the layer contents,
58         we don't get a chance to flip the drawing the way we do via the drawInContext delegate.
59         Instead we have to apply a scale(1, -1) transform on top of the layer transform to
60         make sure the layer is rendered right-way up.
61         (-[WebGLLayer setAnchorPoint:]): Ditto, except we have to assume the anchor point is
62         at the bottom of the layer, so flip the Y value.
63         (-[WebGLLayer display]): Swap between the drawing buffer and the contents buffer, and
64         then get a new buffer ready for display.
65         (createAppropriateIOSurface): Helper.
66         (-[WebGLLayer allocateIOSurfaceBackingStoreWithSize:usingAlpha:]): Initializes the
67         IOSurfaces used for drawing buffers.
68         (-[WebGLLayer bindFramebufferToNextAvailableSurface]): Take the next available IOSurface and
69         make it the drawing buffer (binding in to WebGL at the same time).
70         (-[WebGLLayer copyCGLPixelFormatForDisplayMask:]): Deleted.
71         (-[WebGLLayer copyCGLContextForPixelFormat:]): Deleted.
72         (-[WebGLLayer drawInCGLContext:pixelFormat:forLayerTime:displayTime:]): Deleted.
73
74         * platform/graphics/mac/WebLayer.mm: Remove the definition of reloadValueForKeyPath.
75
76 2017-10-05  Frederic Wang  <fwang@igalia.com>
77
78         Update Source/ThirdParty/woff2 to 22c256bc457777744ba14b7325a6e8e0e7dec91c
79         https://bugs.webkit.org/show_bug.cgi?id=177994
80
81         Reviewed by Michael Catanzaro.
82
83         No new tests, already covered by existing tests.
84
85         * CMakeLists.txt: Include the directory for public headers instead.
86         * platform/graphics/WOFFFileFormat.cpp: Use the public header
87         woff2/decode.h and do not use the "wOF2" constant from private headers.
88         (WebCore::isWOFF):
89         (WebCore::convertWOFFToSfnt):
90
91 2017-10-05  Commit Queue  <commit-queue@webkit.org>
92
93         Unreviewed, rolling out r222951 and r222952.
94         https://bugs.webkit.org/show_bug.cgi?id=177992
95
96         "Broke the iOS build and introduced a webgl LayoutTest
97         failure." (Requested by ryanhaddad on #webkit).
98
99         Reverted changesets:
100
101         "Lots of missing frames in YouTube360 when fullscreen on
102         MacBook"
103         https://bugs.webkit.org/show_bug.cgi?id=177903
104         http://trac.webkit.org/changeset/222951
105
106         "Lots of missing frames in YouTube360 when fullscreen on
107         MacBook"
108         https://bugs.webkit.org/show_bug.cgi?id=177903
109         http://trac.webkit.org/changeset/222952
110
111 2017-10-05  Ryosuke Niwa  <rniwa@webkit.org>
112
113         DataTransfer shouldn't contain text/html when performing Paste and Match Style
114         https://bugs.webkit.org/show_bug.cgi?id=174165
115         <rdar://problem/33138027>
116
117         Reviewed by Wenson Hsieh.
118
119         When performing Paste and Match Style, only expose the plain text by creating a StaticPasteboard with plain text content.
120
121         This patch introduces ClipboardEventKind enum class to differentiate regular paste and paste and match style (internally
122         called as pasteAsPlainText) since both operations use "paste" event.
123
124         Tests: editing/pasteboard/data-transfer-get-data-on-paste-as-plain-text-when-custom-pasteboard-data-disabled.html
125                editing/pasteboard/data-transfer-get-data-on-paste-as-plain-text.html
126
127         * dom/DataTransfer.cpp:
128         (WebCore::DataTransfer::createForCopyAndPaste): Made this function take Pasteboard as an argument.
129         * dom/DataTransfer.h:
130         * editing/Editor.cpp:
131         (WebCore::ClipboardEventKind): Added.
132         (WebCore::eventNameForClipboardEvent): Added.
133         (WebCore::createDataTransferForClipboardEvent): Added.
134         (WebCore::dispatchClipboardEvent):
135         (WebCore::Editor::canDHTMLCut):
136         (WebCore::Editor::canDHTMLCopy):
137         (WebCore::Editor::canDHTMLPaste):
138         (WebCore::Editor::tryDHTMLCopy):
139         (WebCore::Editor::tryDHTMLCut):
140         (WebCore::Editor::tryDHTMLPaste): Deleted.
141         (WebCore::Editor::paste):
142         (WebCore::Editor::pasteAsPlainText):
143         * platform/ios/PasteboardIOS.mm:
144         (WebCore::Pasteboard::addHTMLClipboardTypesForCocoaType): Add "text/html" when public.html UTI is in the pasteboard
145         even when the custom pasteboard data is disabled. We continue to add public.html in the case some app dependent on
146         seeing "public.html" in dataTransfer.types.
147
148 2017-10-05  Zalan Bujtas  <zalan@apple.com>
149
150         RenderTable should not hold section raw pointers
151         https://bugs.webkit.org/show_bug.cgi?id=177977
152         <rdar://problem/34846034>
153
154         Reviewed by Simon Fraser.
155
156         This enables us to remove forced recalcSections calls.
157
158         Covered by existing tests.
159
160         * rendering/RenderTable.cpp:
161         (WebCore::RenderTable::RenderTable):
162         (WebCore::resetSectionPointerIfNotBefore):
163         (WebCore::RenderTable::addChild):
164         (WebCore::RenderTable::recalcSections const):
165         (WebCore::RenderTable::sectionAbove const):
166         * rendering/RenderTable.h:
167         (WebCore::RenderTable::header const):
168         (WebCore::RenderTable::footer const):
169         (WebCore::RenderTable::firstBody const):
170         (WebCore::RenderTable::topSection const):
171
172 2017-10-05  Dean Jackson  <dino@apple.com>
173
174         Lots of missing frames in YouTube360 when fullscreen on MacBook
175         https://bugs.webkit.org/show_bug.cgi?id=177903
176         <rdar://problem/33273300>
177
178         iOS build fix.
179
180         * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
181
182 2017-10-05  Dean Jackson  <dino@apple.com>
183
184         Lots of missing frames in YouTube360 when fullscreen on MacBook
185         https://bugs.webkit.org/show_bug.cgi?id=177903
186         <rdar://problem/33273300>
187
188         Reviewed by Sam Weinig.
189
190         Our compositing path for WebGL on macOS was too slow, requiring a copy
191         of the framebuffer into another GL context. Replace this by having
192         WebGL render into a texture that is backed by an IOSurface, and then
193         set the WebGLLayer to use the IOSurface as contents.
194
195         Covered by the existing WebGL tests.
196
197         * platform/graphics/GraphicsContext3D.h:
198         (WebCore::GraphicsContext3D::platformTexture const): We no longer use the
199         framebuffer object outside the class, so change this to return the GL texture
200         that the framebuffer is rendering in to. It was kind-of strange that it was
201         named this way originally.
202         Also make endPaint available on macOS, and add the definitions for
203         createIOSurfaceBackingStore and updateFramebufferTextureBackingStoreFromLayer.
204
205         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
206         (WebCore::GraphicsContext3D::GraphicsContext3D): Now that we're using an IOSurface,
207         we're binding to a new attachment point, GL_TEXTURE_RECTANGLE.
208         (WebCore::GraphicsContext3D::endPaint): This is now being called on macOS and iOS,
209         so add a comment that explains the extra work that iOS needs to do. At some future
210         point it would be nice to make this slightly cleaner, so that iOS and macOS are
211         more similar.
212         (WebCore::GraphicsContext3D::allocateIOSurfaceBackingStore): New function that calls
213         into the corresponding WebGLLayer function.
214         (WebCore::GraphicsContext3D::updateFramebufferTextureBackingStoreFromLayer): Ditto.
215
216         * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
217         (WebCore::wipeAlphaChannelFromPixels): Both readPixels and drawing a WebGL context
218         into another buffer need to fill out the alpha channel if this context was
219         created without one, otherwise the IOSurface backing store will happily provide
220         what might be non-zero values.
221         (WebCore::GraphicsContext3D::readPixelsAndConvertToBGRAIfNecessary): Call the helper above.
222         (WebCore::GraphicsContext3D::reshapeFBOs): Add more code to call into the macOS-specific
223         function to use an IOSurface as the framebuffer texture.
224         (WebCore::GraphicsContext3D::readPixels): Call the helper above.
225
226         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
227         (PlatformCALayerCocoa::copyContentsFromLayer): Replace the use of the
228         deprecated setContentsChanged with reloadValueForKeyPath.
229
230         * platform/graphics/cocoa/WebGLLayer.h: The macOS implementation now
231         inherits from CALayer directly rather than CAOpenGLLayer. It also adds
232         a few member variables to handle the IOSurfaces used for triple buffering.
233
234         * platform/graphics/cocoa/WebGLLayer.mm:
235         (-[WebGLLayer initWithGraphicsContext3D:]): If we were created without an
236         alpha channel, tell CA that we're an opaque layer. Also set the layer's transform
237         to identity, so that it calls into the code below to flip the contents.
238         (-[WebGLLayer setTransform:]): Because an IOSurface is used for the layer contents,
239         we don't get a chance to flip the drawing the way we do via the drawInContext delegate.
240         Instead we have to apply a scale(1, -1) transform on top of the layer transform to
241         make sure the layer is rendered right-way up.
242         (-[WebGLLayer setAnchorPoint:]): Ditto, except we have to assume the anchor point is
243         at the bottom of the layer, so flip the Y value.
244         (-[WebGLLayer display]): Swap between the drawing buffer and the contents buffer, and
245         then get a new buffer ready for display.
246         (createAppropriateIOSurface): Helper.
247         (-[WebGLLayer allocateIOSurfaceBackingStoreWithSize:usingAlpha:]): Initializes the
248         IOSurfaces used for drawing buffers.
249         (-[WebGLLayer bindFramebufferToNextAvailableSurface]): Take the next available IOSurface and
250         make it the drawing buffer (binding in to WebGL at the same time).
251         (-[WebGLLayer copyCGLPixelFormatForDisplayMask:]): Deleted.
252         (-[WebGLLayer copyCGLContextForPixelFormat:]): Deleted.
253         (-[WebGLLayer drawInCGLContext:pixelFormat:forLayerTime:displayTime:]): Deleted.
254
255         * platform/graphics/mac/WebLayer.mm: Remove the definition of reloadValueForKeyPath.
256
257 2017-10-05  Myles C. Maxfield  <mmaxfield@apple.com>
258
259         Add "display" to FontFace Javascript object
260         https://bugs.webkit.org/show_bug.cgi?id=175383
261         <rdar://problem/33813239>
262
263         Reviewed by Simon Fraser.
264
265         We already have all the necessary infrastructure. Just hook it up to the .idl file!
266
267         Test: fast/text/font-loading-font-display.html
268
269         * css/CSSFontFace.h:
270         * css/CSSPrimitiveValueMappings.h:
271         * css/FontFace.cpp:
272         (WebCore::FontFace::create):
273         (WebCore::FontFace::setDisplay):
274         (WebCore::FontFace::display const):
275         * css/FontFace.h:
276         * css/FontFace.idl:
277
278 2017-10-05  Jer Noble  <jer.noble@apple.com>
279
280         [Cocoa] Enable ENABLE_ENCRYPTED_MEDIA build-time setting
281         https://bugs.webkit.org/show_bug.cgi?id=177261
282
283         Reviewed by Eric Carlson.
284
285         Enable ENCRYPTED_MEDIA, and make the changes required for ENABLED_MEDIA and LEGACY_ENABLED_MEDIA
286         to co-exist while both enabled simultaneously.
287
288         * Configurations/FeatureDefines.xcconfig:
289         * Modules/encryptedmedia/legacy/LegacyCDM.cpp:
290         (WebCore::LegacyCDM::registerCDMFactory):
291         (WebCore::LegacyCDM::supportsKeySystem):
292         (WebCore::LegacyCDM::keySystemSupportsMimeType):
293         (WebCore::LegacyCDM::create):
294         (WebCore::LegacyCDM::LegacyCDM):
295         (WebCore::LegacyCDM::~LegacyCDM):
296         (WebCore::LegacyCDM::supportsMIMEType const):
297         (WebCore::LegacyCDM::createSession):
298         (WebCore::LegacyCDM::mediaPlayer const):
299         (WebCore::CDM::registerCDMFactory): Deleted.
300         (WebCore::CDM::supportsKeySystem): Deleted.
301         (WebCore::CDM::keySystemSupportsMimeType): Deleted.
302         (WebCore::CDM::create): Deleted.
303         (WebCore::CDM::CDM): Deleted.
304         (WebCore::CDM::~CDM): Deleted.
305         (WebCore::CDM::supportsMIMEType const): Deleted.
306         (WebCore::CDM::createSession): Deleted.
307         (WebCore::CDM::mediaPlayer const): Deleted.
308         * Modules/encryptedmedia/legacy/LegacyCDM.h:
309         (WebCore::LegacyCDMClient::~LegacyCDMClient):
310         (WebCore::LegacyCDM::client const):
311         (WebCore::LegacyCDM::setClient):
312         (WebCore::CDMClient::~CDMClient): Deleted.
313         (WebCore::CDM::keySystem const): Deleted.
314         (WebCore::CDM::client const): Deleted.
315         (WebCore::CDM::setClient): Deleted.
316         * Modules/encryptedmedia/legacy/LegacyCDMPrivate.h:
317         * Modules/encryptedmedia/legacy/LegacyCDMPrivateClearKey.cpp:
318         (WebCore::LegacyCDMPrivateClearKey::supportsKeySystem):
319         (WebCore::LegacyCDMPrivateClearKey::supportsKeySystemAndMimeType):
320         (WebCore::LegacyCDMPrivateClearKey::supportsMIMEType):
321         (WebCore::LegacyCDMPrivateClearKey::createSession):
322         (WebCore::CDMPrivateClearKey::supportsKeySystem): Deleted.
323         (WebCore::CDMPrivateClearKey::supportsKeySystemAndMimeType): Deleted.
324         (WebCore::CDMPrivateClearKey::supportsMIMEType): Deleted.
325         (WebCore::CDMPrivateClearKey::createSession): Deleted.
326         * Modules/encryptedmedia/legacy/LegacyCDMPrivateClearKey.h:
327         (WebCore::LegacyCDMPrivateClearKey::LegacyCDMPrivateClearKey):
328         (WebCore::LegacyCDMPrivateClearKey::~LegacyCDMPrivateClearKey):
329         (WebCore::CDMPrivateClearKey::CDMPrivateClearKey): Deleted.
330         (WebCore::CDMPrivateClearKey::~CDMPrivateClearKey): Deleted.
331         * Modules/encryptedmedia/legacy/LegacyCDMPrivateMediaPlayer.cpp:
332         (WebCore::CDMPrivateMediaPlayer::createSession):
333         * Modules/encryptedmedia/legacy/LegacyCDMPrivateMediaPlayer.h:
334         (WebCore::CDMPrivateMediaPlayer::CDMPrivateMediaPlayer):
335         (WebCore::CDMPrivateMediaPlayer::cdm const):
336         * Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp:
337         (WebCore::CDMSessionClearKey::CDMSessionClearKey):
338         * Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.h:
339         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.h:
340         * Modules/encryptedmedia/legacy/WebKitMediaKeys.cpp:
341         (WebCore::WebKitMediaKeys::create):
342         (WebCore::WebKitMediaKeys::WebKitMediaKeys):
343         (WebCore::WebKitMediaKeys::isTypeSupported):
344         (WebCore::WebKitMediaKeys::cdmMediaPlayer const):
345         * Modules/encryptedmedia/legacy/WebKitMediaKeys.h:
346         * WebCore.xcodeproj/project.pbxproj:
347         * platform/encryptedmedia/CDMFactory.cpp:
348         (WebCore::CDMFactory::platformRegisterFactories):
349         * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
350         (WebCore::ClearKeyState::singleton):
351         (WebCore::parseJSONObject):
352         (WebCore::parseLicenseFormat):
353         (WebCore::parseLicenseReleaseAcknowledgementFormat):
354         (WebCore::CDMFactoryClearKey::singleton):
355         (WebCore::containsPersistentLicenseType):
356         (WebCore::CDMInstanceClearKey::keySystem const):
357         * platform/encryptedmedia/clearkey/CDMClearKey.h:
358         * platform/graphics/LegacyCDMSession.h:
359         (WebCore::LegacyCDMSessionClient::~LegacyCDMSessionClient):
360         (WebCore::CDMSession::type):
361         (WebCore::CDMSessionClient::~CDMSessionClient): Deleted.
362         * platform/graphics/MediaPlayer.cpp:
363         (WebCore::MediaPlayer::createSession):
364         * platform/graphics/MediaPlayer.h:
365         * platform/graphics/MediaPlayerPrivate.h:
366         (WebCore::MediaPlayerPrivateInterface::createSession):
367         * platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.h:
368         (WebCore::CDMPrivateMediaSourceAVFObjC::CDMPrivateMediaSourceAVFObjC):
369         (WebCore::CDMPrivateMediaSourceAVFObjC::cdm const):
370         * platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm:
371         (WebCore::CDMPrivateMediaSourceAVFObjC::createSession):
372         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
373         (WebCore::MediaPlayerPrivateAVFoundationCF::createSession):
374         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h:
375         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.h:
376         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
377         (WebCore::CDMSessionAVContentKeySession::CDMSessionAVContentKeySession):
378         (WebCore::CDMSessionAVContentKeySession::update):
379         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h:
380         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
381         (WebCore::CDMSessionAVFoundationObjC::CDMSessionAVFoundationObjC):
382         (WebCore::CDMSessionAVFoundationObjC::generateKeyRequest):
383         (WebCore::CDMSessionAVFoundationObjC::playerDidReceiveError):
384         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.h:
385         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
386         (WebCore::CDMSessionAVStreamSession::CDMSessionAVStreamSession):
387         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
388         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:
389         (WebCore::CDMSessionMediaSourceAVFObjC::CDMSessionMediaSourceAVFObjC):
390         (WebCore::CDMSessionMediaSourceAVFObjC::layerDidReceiveError):
391         (WebCore::CDMSessionMediaSourceAVFObjC::rendererDidReceiveError):
392         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
393         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
394         (WebCore::MediaPlayerPrivateAVFoundationObjC::nativeImageForCurrentTime):
395         (WebCore::MediaPlayerPrivateAVFoundationObjC::createSession):
396         * testing/Internals.cpp:
397         (WebCore::Internals::initializeMockCDM):
398         * testing/LegacyMockCDM.cpp:
399         (WebCore::LegacyMockCDM::supportsKeySystem):
400         (WebCore::LegacyMockCDM::supportsKeySystemAndMimeType):
401         (WebCore::LegacyMockCDM::supportsMIMEType):
402         (WebCore::LegacyMockCDM::createSession):
403         (WebCore::MockCDMSession::MockCDMSession):
404         (WebCore::MockCDM::supportsKeySystem): Deleted.
405         (WebCore::MockCDM::supportsKeySystemAndMimeType): Deleted.
406         (WebCore::MockCDM::supportsMIMEType): Deleted.
407         (WebCore::MockCDM::createSession): Deleted.
408         * testing/LegacyMockCDM.h:
409         (WebCore::LegacyMockCDM::LegacyMockCDM):
410         (WebCore::LegacyMockCDM::~LegacyMockCDM):
411         (WebCore::MockCDM::MockCDM): Deleted.
412         (WebCore::MockCDM::~MockCDM): Deleted.
413         * testing/MockCDMFactory.cpp:
414         (WebCore::MockCDMInstance::keySystem const):
415
416 2017-10-05  John Wilander  <wilander@apple.com>
417
418         Storage Access API: Web process should ask UI process for grant/deny
419         https://bugs.webkit.org/show_bug.cgi?id=176941
420         <rdar://problem/34440036>
421
422         Reviewed by Chris Dumez and Sam Weinig.
423
424         Tests: http/tests/storageAccess/request-and-grant-storage-access-cross-origin-non-sandboxed-iframe.html
425                http/tests/storageAccess/request-and-grant-storage-access-cross-origin-sandboxed-iframe-from-prevalent-domain-with-user-interaction.html
426                http/tests/storageAccess/request-and-grant-storage-access-cross-origin-sandboxed-iframe-from-prevalent-domain-without-user-interaction.html
427
428         This patch changes Document::requestStorageAccess() so that it
429         calls the ChromeClient instead of the ResourceLoadObserver to
430         request storage access on behalf of the iframe.
431         The patch also changes how the promise is used, from returning
432         a boolean to either resolving or rejecting to signal grant/deny
433         access respectively.
434
435         * dom/Document.cpp:
436         (WebCore::Document::requestStorageAccess):
437         * dom/Document.idl:
438         * loader/ResourceLoadObserver.cpp:
439         (WebCore::ResourceLoadObserver::registerStorageAccess): Deleted.
440         * loader/ResourceLoadObserver.h:
441         * page/ChromeClient.h:
442
443 2017-10-05  Brian Burg  <bburg@apple.com>
444
445         Web Inspector: EventLoop::cycle() should not send nil NSEvents
446         https://bugs.webkit.org/show_bug.cgi?id=177971
447         <rdar://problem/20387399>
448
449         Reviewed by Joseph Pecoraro.
450
451         It is possible for the next matching event to be nil.
452         WebKit clients don't expect to be sent a nil NSEvent, so add a null check here.
453
454         * platform/mac/EventLoopMac.mm:
455         (WebCore::EventLoop::cycle):
456
457 2017-10-05  Chris Dumez  <cdumez@apple.com>
458
459         Drop unused parameters for CookiesStrategy::cookiesEnabled()
460         https://bugs.webkit.org/show_bug.cgi?id=177957
461
462         Reviewed by Alex Christensen.
463
464         * loader/CookieJar.cpp:
465         (WebCore::cookiesEnabled):
466         * platform/CookiesStrategy.h:
467         * platform/network/PlatformCookieJar.h:
468         * platform/network/cf/CookieJarCFNet.cpp:
469         (WebCore::cookiesEnabled):
470         * platform/network/curl/CookieJarCurl.cpp:
471         (WebCore::CookieJarCurlFileSystem::cookiesEnabled):
472         (WebCore::cookiesEnabled):
473         * platform/network/curl/CookieJarCurl.h:
474         * platform/network/mac/CookieJarMac.mm:
475         (WebCore::cookiesEnabled):
476         * platform/network/soup/CookieJarSoup.cpp:
477         (WebCore::cookiesEnabled):
478
479 2017-10-05  Zalan Bujtas  <zalan@apple.com>
480
481         RenderListItem should not hold raw pointers to RenderListMarker.
482         https://bugs.webkit.org/show_bug.cgi?id=177968
483         <rdar://problem/34842943>
484
485         Reviewed by Antti Koivisto.
486
487         Now we don't need to unregister the marker from the list item explicitly.
488
489         Covered by existing tests.
490
491         * rendering/RenderListItem.cpp:
492         (WebCore::RenderListItem::RenderListItem):
493         (WebCore::RenderListItem::willBeDestroyed):
494         (WebCore::RenderListItem::positionListMarker):
495         * rendering/RenderListItem.h:
496         * rendering/RenderListMarker.cpp:
497         (WebCore::RenderListMarker::willBeDestroyed):
498         * style/RenderTreeUpdaterListItem.cpp:
499         (WebCore::RenderTreeUpdater::ListItem::updateMarker):
500
501 2017-10-05  Said Abou-Hallawa  <sabouhallawa@apple.com>
502
503         RenderSVGRoot should check the renderers inside its visualOverflowRect for hit testing if the overflow is visible
504         https://bugs.webkit.org/show_bug.cgi?id=177953
505         <rdar://problem/34788389>
506
507         Reviewed by Simon Fraser.
508
509         Test: svg/hittest/svg-visual-overflow-rect.html
510
511         If an SVGElement is positioned outside the rectangle of the root element,
512         it can still be drawn if the root element has "overflow: visible" applied.
513         But since SVGElement can be drawn in this case, it should be accessible
514         through nodeAtPoint() which is used for hit testing.
515
516         * rendering/svg/RenderSVGRoot.cpp:
517         (WebCore::RenderSVGRoot::nodeAtPoint):
518
519 2017-10-05  Zalan Bujtas  <zalan@apple.com>
520
521         RenderButton should not hold raw pointers to its direct children.
522         https://bugs.webkit.org/show_bug.cgi?id=177960
523         <rdar://problem/34840807>
524
525         Reviewed by Antti Koivisto.
526
527         The correct way of destroying a renderer is to call ::removeFromParentAndDestroy().
528
529         Covered by existing tests.
530
531         * rendering/RenderButton.cpp:
532         (WebCore::RenderButton::RenderButton):
533         (WebCore::RenderButton::addChild):
534         (WebCore::RenderButton::takeChild):
535         (WebCore::RenderButton::updateAnonymousChildStyle const):
536         (WebCore::RenderButton::setText):
537         (WebCore::RenderButton::text const):
538         * rendering/RenderButton.h:
539
540 2017-10-05  David Kilzer  <ddkilzer@apple.com>
541
542         Bug 177893: Disable -Wcast-qual for new clang compiler in Apple ports
543         <https://webkit.org/b/177893>
544         <rdar://problem/33667497>
545
546         Reviewed by Tim Horton.
547
548         * Configurations/Base.xcconfig:
549         (WARNING_CFLAGS): Remvoe -Wcast-qual until we can provide a safe
550         cast function that lets us re-enable the warning.
551
552 2017-10-05  Myles C. Maxfield  <mmaxfield@apple.com>
553
554         Implement font-display loading behaviors
555         https://bugs.webkit.org/show_bug.cgi?id=175384
556         <rdar://problem/33813243>
557
558         Reviewed by Darin Adler.
559
560         The font-display descriptors works off of the following model of font loading:
561
562         1. When a font loads, the @font-face enters the first phase, called the "block period." Here,
563         text using this @font-face is rendered as invisible using a fallback font for metrics. If the
564         file finishes loading during this period, it is swapped in (visibly).
565         2. When the first phase is over, the @font-face enters the second phase, called the "swap
566         period." Here, text using this @font-face is rendered visibly using a fallback font. If the
567         file finishes loading during this period, it is swapped in.
568         3. When the second phase is over, the @font-face enters the third phase, called the "failure
569         period." Here, text using this @font-face is rendered visibly using a fallback font. If the
570         file finishes loading during this period, it is not swapped in (but it does live in the
571         network cache for subsequent page loads). This phase lasts forever.
572
573         The font-display descriptor changes the duration of these phases. For example, our default
574         font loading behavior can be achieved by making the first phase 3 seconds long and making the
575         second phase infinitely long (so the third phase is never reached).
576
577         Luckily, our CSSFontFace class already has states which correspond to each phase listed above:
578         Loading, TimedOut, and Failure. This patch migrates our existing 3-second timer to have logic
579         to correctly set the timeout duration based on the value of the font-display descriptor and
580         the current status(). This occurs inside CSSFontFace::setStatus().
581
582         This has implications for testing. Previously, our tests for the font loading behavior had a
583         single boolean that describes whether or not font loads should immediately jump to the "swap
584         period". Clearly, this is insufficient for testing all aspects of the font-display descriptor.
585         Instead, this patch deletes this existing infrastructure and instead creates three more fake
586         values of font-display (achieved in tests by using window.internals). These fake values make
587         fonts immediately jump into a particular state and stay there forever (so the timeout values
588         are, for example, [0, infinity, infinity] to test the swap period). This works because
589         CSSFontFace is smart enough to synchronously move between states that have a 0 timeout, so
590         there is no race between these timers and font loads.
591
592         We also need to test the behavior when a file downloads and when a file hasn't been loaded
593         yet (and the @font-face is in a particular state). Therefore, this patch adds another bool
594         which indicates whether the font subsystem should totally ignore font load events. This means
595         that a font will successfully download (and DOMContentLoaded will be fired, because that
596         uses the loading subsystem), but the font subsystem will plug its ears and ignore the load.
597         This means we can test the invisibility of text during the "block period" because DRT will
598         see that the page load has completed, but the font subsystem will pretend like the font is
599         still loading and draw invisibly.
600
601         Therefore, there are 6 tests: a test to test each of the 3 states an @font-face block may be
602         in, times 2 for whether or not we are ignoring font loads. These are more comprehensive than
603         the existing font loading tests which used internals.settings.setWebFontsAlwaysFallBack(),
604         so I deleted those tests in favor of these new ones.
605
606         Tests: fast/text/loading-block-finish.html
607                fast/text/loading-block-nofinish.html
608                fast/text/loading-failure-finish.html
609                fast/text/loading-failure-nofinish.html
610                fast/text/loading-swap-finish.html
611                fast/text/loading-swap-nofinish.html
612
613         * css/CSSFontFace.cpp:
614         (WebCore::CSSFontFace::setLoadingBehavior):
615         (WebCore::CSSFontFace::fontLoadEventOccurred): Remove old testing infrastructure.
616         (WebCore::CSSFontFace::timeoutFired): Previously, the timer was only used for going
617         from Loading -> TimedOut. Now, we have to ask the status() to figure out which
618         state transition we should be performing.
619         (WebCore::CSSFontFace::allSourcesFailed const): A Failed state needs to return true
620         here, even if some of the sources successfully downloaded.
621         (WebCore::CSSFontFace::setStatus): The logic to figure out how long to set the timer
622         for. Also, if the timer value is 0, synchronously recurse to change the status instead
623         of setting a 0-delay timer.
624         (WebCore::CSSFontFace::fontLoaded): Remove old testing infrastructure.
625         (WebCore::CSSFontFace::fontTimeoutIndex const): Implement new testing infrastructure.
626         (WebCore::CSSFontFace::shouldIgnoreFontLoadCompletions const): Ditto.
627         (WebCore::CSSFontFace::pump): See comment. Also, we're allowed to be in the Failure
628         state in more scenarios now, so relax some of our ASSERT()s.
629         (WebCore::CSSFontFace::font): Ditto.
630         (WebCore::CSSFontFace::webFontsShouldAlwaysFallBack const): Deleted.
631         * css/CSSFontFace.h: Migrate to new testing infrastructure.
632         * css/CSSFontFaceSource.cpp:
633         (WebCore::CSSFontFaceSource::CSSFontFaceSource): Implement new testing infrastructure.
634         (WebCore::CSSFontFaceSource::shouldIgnoreFontLoadCompletions const): Ditto.
635         (WebCore::CSSFontFaceSource::fontLoaded): Ditto.
636         * css/CSSFontFaceSource.h:
637         * css/CSSFontSelector.cpp:
638         (WebCore::CSSFontSelector::beginLoadingFontSoon): Remove old testing infrastructure.
639         * css/CSSSegmentedFontFace.cpp: It's possible to get different values out of
640         CSSFontFace::font() in successive calls during the same runloop. FontRanges will 
641         include a raw pointer to one of the values, so all the values need to be kept alive.
642         * page/Settings.cpp: Migrate to new testing infrastructure.
643         (WebCore::Settings::Settings):
644         (WebCore::Settings::setFontTimeoutIndex):
645         (WebCore::Settings::setShouldIgnoreFontLoadCompletions):
646         (WebCore::Settings::setWebFontsAlwaysFallBack): Deleted.
647         * page/Settings.h: Ditto.
648         (WebCore::Settings::fontTimeoutIndex const):
649         (WebCore::Settings::shouldIgnoreFontLoadCompletions const):
650         (WebCore::Settings::webFontsAlwaysFallBack const): Deleted.
651         * testing/InternalSettings.cpp: Ditto.
652         (WebCore::InternalSettings::Backup::Backup):
653         (WebCore::InternalSettings::Backup::restoreTo):
654         (WebCore::InternalSettings::setFontTimeoutIndex):
655         (WebCore::InternalSettings::setShouldIgnoreFontLoadCompletions):
656         (WebCore::InternalSettings::setWebFontsAlwaysFallBack): Deleted.
657         * testing/InternalSettings.h: Ditto.
658         * testing/InternalSettings.idl: Ditto.
659
660 2017-10-05  Zalan Bujtas  <zalan@apple.com>
661
662         RenderMathMLFenced should not hold a raw pointer to RenderMathMLFencedOperator
663         https://bugs.webkit.org/show_bug.cgi?id=177950
664         <rdar://problem/34837002>
665
666         Reviewed by Antti Koivisto.
667
668         Even though RenderMathMLFencedOperator is a child renderer, it's lifetime is not explicitly managed by
669         RenderMathMLFenced.
670
671         Covered by existing test cases.
672
673         * rendering/mathml/RenderMathMLFenced.cpp:
674         (WebCore::RenderMathMLFenced::RenderMathMLFenced):
675         (WebCore::RenderMathMLFenced::makeFences):
676         (WebCore::RenderMathMLFenced::addChild):
677         * rendering/mathml/RenderMathMLFenced.h:
678
679 2017-10-05  Andy Estes  <aestes@apple.com>
680
681         [Payment Request] Add a payment method that supports Apple Pay
682         https://bugs.webkit.org/show_bug.cgi?id=177850
683
684         Reviewed by Youenn Fablet.
685
686         This patch implements a payment method dictionary and a payment handler for Apple Pay.
687
688         It reuses existing Apple Pay code by:
689         1. Moving shared properties from ApplePayPaymentRequest to ApplePayRequestBase and having
690            ApplePayPaymentRequest inherit from ApplePayRequestBase.
691         2. Creating an ApplePayRequest dictionary that inherits from ApplePayRequestBase and adds
692            PaymentRequest-specific properties (right now that's just the version property).
693         3. Moving validation logic from ApplePaySession into various places that can be reused by
694            PaymentRequest and ApplePayPaymentHandler.
695         4. Storing currency values for both ApplePaySession and PaymentRequest in Strings rather
696            than integers representing whole cents, since PaymentRequest supports high-precision
697            currency values.
698
699         This patch does not implement any event handling for merchant validation, payment method
700         changes, or shipping address/option changes. That will be handled in a follow-on.
701
702         Test: http/tests/ssl/applepay/PaymentRequest.html
703
704         * DerivedSources.make:
705         * Modules/applepay/ApplePayContactField.cpp: Added.
706         (WebCore::convertAndValidate): Moved from ApplePaySession.cpp.
707         * Modules/applepay/ApplePayContactField.h: Added.
708         * Modules/applepay/ApplePayContactField.idl: Added.
709         * Modules/applepay/ApplePayMerchantCapability.cpp: Added.
710         (WebCore::convertAndValidate): Moved from ApplePaySession.cpp.
711         * Modules/applepay/ApplePayMerchantCapability.h: Added.
712         * Modules/applepay/ApplePayMerchantCapability.idl: Added.
713         * Modules/applepay/ApplePayPaymentRequest.h: Moved fields shared with ApplePayRequest into ApplePayRequestBase.
714         * Modules/applepay/ApplePayPaymentRequest.idl: Ditto.
715         * Modules/applepay/ApplePayRequestBase.cpp: Added.
716         (WebCore::convertAndValidate): Moved from ApplePaySession.cpp.
717         * Modules/applepay/ApplePayRequestBase.h: Added.
718         * Modules/applepay/ApplePayRequestBase.idl: Added.
719         * Modules/applepay/ApplePaySession.cpp:
720         (WebCore::validateAmount): Renamed from parseAmount.
721         (WebCore::convertAndValidateTotal):
722         (WebCore::convertAndValidate):
723         (WebCore::parseDigit): Deleted.
724         (WebCore::parseAmount): Renamed to validateAmount.
725         * Modules/applepay/ApplePaySessionPaymentRequest.h: Changed amount from an int64_t to a String.
726         * Modules/applepay/ApplePayShippingMethodSelectedEvent.cpp:
727         (WebCore::convert):
728         * Modules/applepay/PaymentRequestValidator.mm: Renamed from Source/WebCore/Modules/applepay/PaymentRequestValidator.cpp.
729         (WebCore::PaymentRequestValidator::validateTotal): Used NSDecimalNumber to validate amounts.
730         (WebCore::validateShippingMethod): Ditto.
731         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp: Added.
732         (WebCore::ApplePayPaymentHandler::handlesIdentifier): Added. Returns true if identifier is a URL with host "apple.com" and path "/apple-pay".
733         (WebCore::ApplePayPaymentHandler::ApplePayPaymentHandler):
734         (WebCore::convert): Added. Converts PaymentRequest types to ApplePaySessionPaymentRequest types.
735         (WebCore::ApplePayPaymentHandler::convertData): Added. JSON-parses data into an ApplePayRequest,
736         then uses that along with the PaymentRequest to construct and validate an ApplePaySessionPaymentRequest.
737         (WebCore::ApplePayPaymentHandler::show): Added a FIXME.
738         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.h: Added.
739         * Modules/applepay/paymentrequest/ApplePayRequest.h: Added.
740         * Modules/applepay/paymentrequest/ApplePayRequest.idl: Added. Inherits from ApplePayRequestBase and adds a required version property.
741         * Modules/paymentrequest/PaymentHandler.cpp: Added.
742         (WebCore::PaymentHandler::create): Returns a PaymentHandler subclass based on the payment method identifier.
743         (WebCore::PaymentHandler::~PaymentHandler):
744         * Modules/paymentrequest/PaymentHandler.h: Added.
745         * Modules/paymentrequest/PaymentRequest.cpp:
746         (WebCore::convertAndValidatePaymentMethodIdentifier): Added.
747         (WebCore::PaymentRequest::show): Removed an unnecessary call to RunLoop::dispatch().
748         Created a PaymentHandler for each payment method and called show() on the first available PaymentHandler.
749         (WebCore::PaymentRequest::abort): Removed an unnecessary call to RunLoop::dispatch().
750         (WebCore::PaymentRequest::canMakePayment): Ditto.
751         (WebCore::PaymentRequest::finishShowing): Deleted.
752         * Modules/paymentrequest/PaymentRequest.h:
753         * WebCore.xcodeproj/project.pbxproj:
754
755 2017-10-05  Antti Koivisto  <antti@apple.com>
756
757         Move more multicolumn render tree mutation code to RenderTreeUpdater::MultiColumn
758         https://bugs.webkit.org/show_bug.cgi?id=177942
759
760         Reviewed by Zalan Bujtas.
761
762         * rendering/RenderMultiColumnFlow.cpp:
763         (WebCore::RenderMultiColumnFlow::RenderMultiColumnFlow):
764
765             Use std::unique_ptr for the spanner map for safe owenership transfer.
766
767         (WebCore::RenderMultiColumnFlow::fragmentedFlowDescendantInserted):
768         (WebCore::RenderMultiColumnFlow::handleSpannerRemoval):
769         (WebCore::RenderMultiColumnFlow::fragmentedFlowRelativeWillBeRemoved):
770         (WebCore::RenderMultiColumnFlow::populate): Deleted.
771         (WebCore::RenderMultiColumnFlow::evacuateAndDestroy): Deleted.
772
773             This code moves to RenderTreeUpdater::MultiColumn.
774
775         * rendering/RenderMultiColumnFlow.h:
776         * style/RenderTreeUpdaterMultiColumn.cpp:
777         (WebCore::RenderTreeUpdater::MultiColumn::update):
778         (WebCore::RenderTreeUpdater::MultiColumn::createFragmentedFlow):
779         (WebCore::RenderTreeUpdater::MultiColumn::destroyFragmentedFlow):
780
781             Use Hyatt's preferred 'fragmented flow' terminology.
782
783         * style/RenderTreeUpdaterMultiColumn.h:
784
785 2017-10-05  Darin Adler  <darin@apple.com>
786
787         Remove additional WebKitSystemInterface remnants
788         https://bugs.webkit.org/show_bug.cgi?id=177948
789
790         Reviewed by Andy Estes.
791
792         * PlatformMac.cmake: Remove logic to select and link an appropriate
793         WebKitSystemInterface library.
794
795         * html/shadow/MediaControlElementTypes.h: Remove comment about matching
796         WebKitSystemInterface.h, now obsolete.
797
798         * rendering/RenderMediaControls.cpp: Wrap whole file in a single conditional
799         to make it clear that it's only used at all in this one particular case.
800         (wkHitTestMediaUIPart): Deleted.
801         (wkMeasureMediaUIPart): Deleted.
802         (wkDrawMediaUIPart): Deleted.
803         (wkDrawMediaSliderTrack): Deleted.
804         (WebCore::determineState): Deleted.
805         (WebCore::getUnzoomedRectAndAdjustCurrentContext): Deleted.
806         (WebCore::RenderMediaControls::adjustMediaSliderThumbSize): Call the
807         WKMeasureMediaUIPart instead of through an inline function to rename it.
808         (WebCore::RenderMediaControls::paintMediaControlsPart): Deleted.
809
810         * rendering/RenderMediaControls.h: Wrap whole file in a single conditional
811         to make it clear that it's only used at all in this one particular case.
812         Removed unneeded includes, forward declarations, and function declaration.
813
814         * rendering/RenderThemeMac.mm: Removed include of RenderMediaControls.h.
815
816 2017-10-05  Zalan Bujtas  <zalan@apple.com>
817
818         Remove redundant LayoutStateDisabler from RenderTreeUpdaterFirstLetter
819         https://bugs.webkit.org/show_bug.cgi?id=177946
820
821         Reviewed by Simon Fraser.
822
823         First letter is updated prior to layout.
824
825         Covered by existing tests.
826
827         * style/RenderTreeUpdaterFirstLetter.cpp:
828         (WebCore::updateFirstLetterStyle):
829
830 2017-10-05  Andy Estes  <aestes@apple.com>
831
832         [Payment Request] Factor out ApplePaySession's interface to PaymentCoordinator into a base class
833         https://bugs.webkit.org/show_bug.cgi?id=177904
834
835         Reviewed by Daniel Bates.
836
837         In a follow-on patch, something other than ApplePaySession will need to be the
838         PaymentCoordinator's active session during PaymentRequest sessions.
839
840         To support this, this patch factors out the ApplePaySession functions called by
841         PaymentCoordinator into a new base class called PaymentSession.
842
843         * Modules/applepay/ApplePaySession.h:
844         * Modules/applepay/PaymentCoordinator.cpp:
845         (WebCore::PaymentCoordinator::beginPaymentSession):
846         * Modules/applepay/PaymentCoordinator.h:
847         * Modules/applepay/PaymentSession.h: Added.
848         (WebCore::PaymentSession::~PaymentSession):
849         * WebCore.xcodeproj/project.pbxproj:
850
851 2017-10-05  Zalan Bujtas  <zalan@apple.com>
852
853         Move multicolumn flow clear to RenderTreeUpdater
854         https://bugs.webkit.org/show_bug.cgi?id=177898
855         <rdar://problem/34820157>
856
857         Reviewed by Antti Koivisto.
858
859         There are 2 cases when we need to clear the the multicolumn flow from its container.
860
861         1. When the column renderer is not need anymore due to style change (evacuateAndDestroy).
862         During the subtree reparenting (moving back the descendants to the original position),
863         if we still had the multicolumn set on the RenderBlockFlow, RenderBlockFlow::addChild() would
864         put the children back under the column. -> Move the clear call to the RenderTreeUpdater.
865          
866         2. When the column is detached from the tree/destroyed (willBeRemoveFromTree).
867         Since it does not trigger reparenting, we don't need to clear the column immediately. 
868         We call clear to avoid accessing state column renderer. -> Use WeakPtr to
869         manage lifetime instead.
870
871         Covered by existing tests.
872
873         * rendering/RenderBlockFlow.cpp:
874         (WebCore::RenderBlockFlow::setMultiColumnFlow):
875         (WebCore::RenderBlockFlow::clearMultiColumnFlow):
876         * rendering/RenderBlockFlow.h:
877         * rendering/RenderMultiColumnFlow.cpp:
878         (WebCore::RenderMultiColumnFlow::evacuateAndDestroy):
879         (WebCore::RenderMultiColumnFlow::willBeRemovedFromTree):
880         * style/RenderTreeUpdaterMultiColumn.cpp:
881         (WebCore::RenderTreeUpdater::MultiColumn::update):
882         (WebCore::RenderTreeUpdater::MultiColumn::createFragmentedFlow):
883
884 2017-10-05  Miguel Gomez  <magomez@igalia.com>
885
886         [GTK][WPE] GIFImageDecoder never clears decoded frames even when told to do so
887         https://bugs.webkit.org/show_bug.cgi?id=177864
888
889         Reviewed by Carlos Garcia Campos.
890
891         Fix GIFImageDecoder::clearFrameBufferCache() so it really deletes decoded buffers, and modify
892         GIFImageDecoder to be able to decode frames that are not requested in the expected order.
893
894         Covered by existent tests.
895
896         * platform/image-decoders/gif/GIFImageDecoder.cpp:
897         (WebCore::GIFImageDecoder::findFirstRequiredFrameToDecode):
898         (WebCore::GIFImageDecoder::frameBufferAtIndex):
899         (WebCore::GIFImageDecoder::clearFrameBufferCache):
900         * platform/image-decoders/gif/GIFImageDecoder.h:
901         * platform/image-decoders/gif/GIFImageReader.cpp:
902         (GIFImageReader::decode):
903         * platform/image-decoders/gif/GIFImageReader.h:
904         (GIFImageReader::frameContext const):
905
906 2017-10-05  Fujii Hironori  <Hironori.Fujii@sony.com>
907
908         [WinCairo] Fix build after Bug 167956
909         https://bugs.webkit.org/show_bug.cgi?id=177921
910
911         Reviewed by Carlos Garcia Campos.
912
913         FontCascade::fontForCombiningCharacterSequence wasn't defined for
914         WinCairo port. It should be defined if !USE(HARFBUZZ).
915
916         No new tests because there is no behavior change.
917
918         * platform/graphics/FontCascade.cpp: Use !USE(HARFBUZZ) instead of !USE(CAIRO).
919
920 2017-10-05  Zan Dobersek  <zdobersek@igalia.com>
921
922         Align BitmapImage::LargeAnimationCutoff to a megabyte value
923         https://bugs.webkit.org/show_bug.cgi?id=177924
924
925         Reviewed by Carlos Garcia Campos.
926
927         * platform/graphics/BitmapImage.h: Fix the 1014 multiplier used to calculate
928         the LargeAnimationCutoff value. It was most likely a typo.
929
930 2017-10-05  Wenson Hsieh  <wenson_hsieh@apple.com>
931
932         Address post-review feedback following r222885
933         https://bugs.webkit.org/show_bug.cgi?id=177853
934         <rdar://problem/34807346>
935
936         Reviewed by Ryosuke Niwa and Dan Bates.
937
938         * dom/DataTransfer.cpp:
939         (WebCore::DataTransfer::updateFileList):
940         (WebCore::DataTransfer::types const):
941         (WebCore::DataTransfer::filesFromPasteboardAndItemList const):
942         * dom/DataTransferItem.h:
943         (WebCore::DataTransferItem::file):
944         (WebCore::DataTransferItem::file const): Deleted.
945         * dom/DataTransferItemList.cpp:
946         (WebCore::DataTransferItemList::add):
947         (WebCore::DataTransferItemList::remove):
948
949         When removing a data transfer item, capture it in a Ref for the scope of remove(), so that it won't be destroyed
950         immediately after removing from the item list.
951
952 2017-10-05  Youenn Fablet  <youenn@apple.com>
953
954         Make LibWebRTCProvider port agnostic
955         https://bugs.webkit.org/show_bug.cgi?id=177747
956
957         Reviewed by Alex Christensen & Alex Garcia.
958
959         No change of behavior.
960
961         LibWebRTCProvider had some Mac/iOS specific members that are now
962         moved to LibWebRTCProviderCocoa.
963         This consists in the codec factories that are VideoToolBox specific.
964         Introducing LibWebRTCProvider::create to allow different port implementations of LibWebRTCProvider.
965
966         * WebCore.xcodeproj/project.pbxproj:
967         * inspector/InspectorOverlay.cpp:
968         (WebCore::InspectorOverlay::overlayPage):
969         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
970         (WebCore::LibWebRTCProvider::create):
971         (WebCore::LibWebRTCProvider::factory):
972         (WebCore::LibWebRTCProvider::createPeerConnectionFactory):
973         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
974         * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
975         (WebCore::LibWebRTCProviderCocoa::createDecoderFactory):
976         (WebCore::LibWebRTCProviderCocoa::createEncoderFactory):
977         (WebCore::LibWebRTCProviderCocoa::setActive):
978         * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.h:
979         * svg/graphics/SVGImage.cpp:
980         (WebCore::SVGImage::dataChanged):
981
982 2017-10-04  Alex Christensen  <achristensen@webkit.org>
983
984         Remove WebCoreSystemInterface
985         https://bugs.webkit.org/show_bug.cgi?id=177916
986
987         Reviewed by Antti Koivisto.
988
989         * Configurations/WebCore.xcconfig:
990         * PlatformMac.cmake:
991         * WebCore.xcodeproj/project.pbxproj:
992         * accessibility/mac/AXObjectCacheMac.mm:
993         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
994         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
995         * dom/Document.cpp:
996         * editing/mac/DictionaryLookup.mm:
997         * page/ios/FrameIOS.mm:
998         * page/ios/UserAgentIOS.mm:
999         * page/mac/EventHandlerMac.mm:
1000         * platform/cocoa/LocalizedStringsCocoa.mm:
1001         * platform/cocoa/ScrollController.mm:
1002         * platform/graphics/Font.h:
1003         * platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm:
1004         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1005         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1006         * platform/graphics/ca/GraphicsLayerCA.cpp:
1007         * platform/graphics/cg/GraphicsContextCG.cpp:
1008         * platform/graphics/cg/ImageBufferCG.cpp:
1009         * platform/graphics/cg/PathCG.cpp:
1010         * platform/graphics/cg/PatternCG.cpp:
1011         * platform/graphics/cocoa/FontCascadeCocoa.mm:
1012         * platform/graphics/cocoa/FontCocoa.mm:
1013         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
1014         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
1015         * platform/graphics/mac/FontCacheMac.mm:
1016         * platform/graphics/mac/GlyphPageMac.cpp:
1017         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
1018         * platform/ios/LegacyTileCache.mm:
1019         * platform/ios/PlatformScreenIOS.mm:
1020         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
1021         * platform/ios/WebCoreSystemInterfaceIOS.mm: Removed.
1022         * platform/ios/wak/WAKWindow.mm:
1023         * platform/mac/CursorMac.mm:
1024         * platform/mac/FileSystemMac.mm:
1025         * platform/mac/PlatformEventFactoryMac.mm:
1026         * platform/mac/PlatformSpeechSynthesizerMac.mm:
1027         * platform/mac/ScrollAnimatorMac.mm:
1028         * platform/mac/ScrollbarThemeMac.mm:
1029         * platform/mac/ThemeMac.mm:
1030         * platform/mac/WebCoreNSURLExtras.mm:
1031         * platform/mac/WebCoreSystemInterface.h: Removed.
1032         * platform/mac/WebCoreSystemInterface.mm: Removed.
1033         * platform/mac/WebVideoFullscreenHUDWindowController.mm:
1034         * platform/mac/WebWindowAnimation.mm:
1035         * platform/network/cf/CookieStorageCFNet.cpp:
1036         * platform/network/cf/CredentialStorageCFNet.cpp:
1037         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
1038         * platform/network/cf/ResourceHandleCFNet.cpp:
1039         * platform/network/cf/ResourceHandleCFURLConnectionDelegate.cpp:
1040         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
1041         * platform/network/cf/ResourceRequestCFNet.cpp:
1042         * platform/network/cf/ResourceResponseCFNet.cpp:
1043         * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
1044         * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
1045         * platform/network/cocoa/ResourceRequestCocoa.mm:
1046         * platform/network/ios/WebCoreURLResponseIOS.mm:
1047         * platform/network/mac/CookieJarMac.mm:
1048         * platform/network/mac/ResourceHandleMac.mm:
1049         * platform/network/mac/WebCoreURLResponse.mm:
1050         * platform/text/TextEncodingRegistry.cpp:
1051         * rendering/RenderThemeMac.mm:
1052
1053 2017-10-04  Alex Christensen  <achristensen@webkit.org>
1054
1055         Remove unnecessary includes of WebKitSystemInterface on Cocoa platforms
1056         https://bugs.webkit.org/show_bug.cgi?id=177912
1057
1058         Reviewed by Saam Barati.
1059
1060         * WebCore.xcodeproj/project.pbxproj:
1061         Also stop compiling RenderMediaControls.cpp on Cocoa platforms.  It's not used.
1062
1063 2017-09-30  Yusuke Suzuki  <utatane.tea@gmail.com>
1064
1065         [JSC] Introduce import.meta
1066         https://bugs.webkit.org/show_bug.cgi?id=177703
1067
1068         Reviewed by Filip Pizlo.
1069
1070         * bindings/js/JSDOMWindowBase.cpp:
1071         * bindings/js/JSWorkerGlobalScopeBase.cpp:
1072
1073 2017-10-04  Tim Horton  <timothy_horton@apple.com>
1074
1075         Link WebCore against CFNetwork in the CMake build
1076         https://bugs.webkit.org/show_bug.cgi?id=177910
1077
1078         Reviewed by Ryosuke Niwa.
1079
1080         * PlatformMac.cmake:
1081         This is enough to get WebKit1 MiniBrowser running; otherwise, we
1082         crash trying to access the public suffix list.
1083
1084 2017-10-04  Daniel Bates  <dabates@apple.com>
1085
1086         Have TextDecorationPainter hold an OptionSet of decorations
1087         https://bugs.webkit.org/show_bug.cgi?id=177889
1088
1089         Reviewed by Simon Fraser.
1090
1091         Currently TextDecorationPainter implicitly maintains the set of one or more TextDecoration
1092         flags in a instance variable bitmask of type TextDecoration. Instead we should represent
1093         this set explicitly as an OptionSet to improve readability of the code.
1094
1095         For now we have the TextDecorationPainter constructor and TextDecorationPainter::stylesForRenderer()
1096         to take the set of decorations as an unsigned value to avoid the need to update callers.
1097         We will look to apply a similar change throughout the code in <https://bugs.webkit.org/show_bug.cgi?id=176844>.
1098
1099         No functionality changed. So, no new tests.
1100
1101         * rendering/TextDecorationPainter.cpp:
1102         (WebCore::TextDecorationPainter::TextDecorationPainter): For now, changed data type for passed
1103         decorations from TextDecoration to unsigned to convey that it is a bitmask.
1104         (WebCore::TextDecorationPainter::paintTextDecoration): Renamed linesAreOpaque to areLinesOpaque
1105         while I am here. Fixed some minor style issues.
1106         (WebCore::collectStylesForRenderer): Modified to take the remaining decorations as an OptionSet,
1107         and removed an unnecessary copy of these decorations by taking advantage of the fact that they
1108         are passed by value.
1109         (WebCore::TextDecorationPainter::stylesForRenderer): Convert the passed decorations to an OptionSet as needed to
1110         pass to collectStylesForRenderer().
1111         * rendering/TextDecorationPainter.h: Change m_decoration from TextDecoration to OptionSet<TextDecoration>
1112         and rename it to m_decorations to reflect that it is used as a set of one or more TextDecoration flags.
1113         Also remove unnecessary initializer for m_isPrinting while I am here and group it with the other boolean,
1114         m_isHorizontal. There is exactly one constructor for this class and it initializes m_isPrinting.
1115
1116 2017-10-04  Matt Baker  <mattbaker@apple.com>
1117
1118         Web Inspector: Improve CanvasManager recording events
1119         https://bugs.webkit.org/show_bug.cgi?id=177762
1120
1121         Reviewed by Devin Rousso.
1122
1123         Dispatch Canvas.recordingFinished regardless of whether any actions were
1124         recorded. Without this extra guarantee, the frontend has to keep track
1125         of additional state to determine whether a recording is in progress.
1126
1127         * inspector/InspectorCanvasAgent.cpp:
1128         (WebCore::InspectorCanvasAgent::startRecording):
1129         (WebCore::InspectorCanvasAgent::stopRecording):
1130         (WebCore::InspectorCanvasAgent::didFinishRecordingCanvasFrame):
1131         (WebCore::InspectorCanvasAgent::requestRecording): Deleted.
1132         (WebCore::InspectorCanvasAgent::cancelRecording): Deleted.
1133         * inspector/InspectorCanvasAgent.h:
1134
1135 2017-10-04  Nan Wang  <n_wang@apple.com>
1136
1137         AX: Make video objects accessible on iOS
1138         https://bugs.webkit.org/show_bug.cgi?id=177788
1139         <rdar://problem/34778028>
1140
1141         Reviewed by Chris Fleizach.
1142
1143         Exposed certain <video> elements on iOS:
1144         1. If they have no controls attribute set and have playsinline attribute set, that means
1145            normally there are custom controls provided. 
1146         2. Without autoplay attribute set. From iOS 10, with the motivation to improve performace by 
1147            replacing GIF with <video>, elements will now honor the autoplay attribute if they
1148            have no audio. So normally those <video> elements are not interactive.
1149
1150         Also provided functions to let iOS users interact with the video elements:
1151         - Play/Pause: accessibilityActivate
1152         - Fast forward: accessibilityIncrement
1153         - Rewind: accessibilityDecrement
1154
1155         Test: accessibility/ios-simulator/video-elements-ios.html
1156
1157         * WebCore.xcodeproj/project.pbxproj:
1158         * accessibility/AXObjectCache.cpp:
1159         (WebCore::createFromRenderer):
1160         * accessibility/AccessibilityMediaObject.cpp: Added.
1161         (WebCore::AccessibilityMediaObject::AccessibilityMediaObject):
1162         (WebCore::AccessibilityMediaObject::~AccessibilityMediaObject):
1163         (WebCore::AccessibilityMediaObject::create):
1164         (WebCore::AccessibilityMediaObject::computeAccessibilityIsIgnored const):
1165         (WebCore::AccessibilityMediaObject::mediaElement const):
1166         (WebCore::AccessibilityMediaObject::stringValue const):
1167         (WebCore::AccessibilityMediaObject::interactiveVideoDuration const):
1168         (WebCore::AccessibilityMediaObject::mediaSeek):
1169         (WebCore::AccessibilityMediaObject::toggleMute):
1170         (WebCore::AccessibilityMediaObject::increment):
1171         (WebCore::AccessibilityMediaObject::decrement):
1172         (WebCore::AccessibilityMediaObject::press):
1173         (WebCore::AccessibilityMediaObject::hasControlsAttributeSet const):
1174         (WebCore::AccessibilityMediaObject::isPlaying const):
1175         (WebCore::AccessibilityMediaObject::isMuted const):
1176         (WebCore::AccessibilityMediaObject::isAutoplayEnabled const):
1177         (WebCore::AccessibilityMediaObject::isPlayingInline const):
1178         (WebCore::AccessibilityMediaObject::enterFullscreen const):
1179         * accessibility/AccessibilityMediaObject.h: Added.
1180         * accessibility/AccessibilityObject.cpp:
1181         * accessibility/AccessibilityObject.h:
1182         (WebCore::AccessibilityObject::isMediaObject const):
1183         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1184         (-[WebAccessibilityObjectWrapper accessibilityIsWebInteractiveVideo]):
1185         (-[WebAccessibilityObjectWrapper interactiveVideoDescription]):
1186         (-[WebAccessibilityObjectWrapper accessibilityIsMediaPlaying]):
1187         (-[WebAccessibilityObjectWrapper accessibilityIsMediaMuted]):
1188         (-[WebAccessibilityObjectWrapper accessibilityToggleMuteForMedia]):
1189         (-[WebAccessibilityObjectWrapper accessibilityVideoEnterFullscreen]):
1190         (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
1191         (-[WebAccessibilityObjectWrapper stringValueShouldBeUsedInLabel]):
1192         (-[WebAccessibilityObjectWrapper accessibilityLabel]):
1193
1194 2017-10-04  Wenson Hsieh  <wenson_hsieh@apple.com>
1195
1196         Add basic support for the version of DataTransferItemList.add that takes a File
1197         https://bugs.webkit.org/show_bug.cgi?id=177853
1198         <rdar://problem/34807346>
1199
1200         Reviewed by Ryosuke Niwa.
1201
1202         Adds very basic support for DataTransferItemList.add(File). So far, a File added in this way can only be read
1203         back from the same DataTransfer, during dragstart or copy. This File isn't written to the platform pasteboard
1204         yet, so even dropping or pasting in the same page will not transfer the File, but this brings us closer to
1205         parity with other browsers. See per-method comments for details.
1206
1207         Tests: editing/pasteboard/data-transfer-item-list-add-file-multiple-times.html
1208                editing/pasteboard/data-transfer-item-list-add-file-on-copy.html
1209                editing/pasteboard/data-transfer-item-list-add-file-on-drag.html
1210
1211         * dom/DataTransfer.cpp:
1212         (WebCore::DataTransfer::updateFileList):
1213
1214         Recompute the DataTransfer's FileList. This behaves the same way as destroying the FileList altogether and
1215         building it from scratch, but we avoid that approach because the FileList object needs to maintain the same DOM
1216         wrapper after a File-backed item is removed.
1217
1218         (WebCore::DataTransfer::itemListDidAddFile):
1219
1220         Add the newly appended DataTransferItem's File to the DataTransfer's FileList.
1221
1222         (WebCore::DataTransfer::types const):
1223
1224         Return only the "Files" type if there are file-backed items in the DataTransfer's item list.
1225
1226         (WebCore::DataTransfer::updatedFilesForFileList const):
1227         (WebCore::DataTransfer::files const):
1228         * dom/DataTransfer.h:
1229         * dom/DataTransferItem.h:
1230         (WebCore::DataTransferItem::file const):
1231         * dom/DataTransferItemList.cpp:
1232         (WebCore::DataTransferItemList::add):
1233         (WebCore::DataTransferItemList::remove):
1234         (WebCore::DataTransferItemList::clear):
1235
1236         When removing a File, only clear from the DataTransfer's pasteboard if the removed item is not a File (otherwise,
1237         clearing a File that shares the same type as some other item in the pasteboard will erroneously clear that other
1238         item as well). Additionally, call out to the DataTransfer to update the FileList.
1239
1240         * dom/DataTransferItemList.h:
1241         (WebCore::DataTransferItemList::hasItems const):
1242         (WebCore::DataTransferItemList::items const):
1243
1244         Add helpers for directly accessing an item list's items. items() should be used in conjunction with hasItems().
1245         This route is taken to (1) avoid having to copy the vector of Files, and (2) to avoid generating m_items if it
1246         doesn't already exist.
1247
1248 2017-10-04  Zalan Bujtas  <zalan@apple.com>
1249
1250         RenderMultiColumnFlow populate/evacuate should not disable layout state.
1251         https://bugs.webkit.org/show_bug.cgi?id=177894
1252         <rdar://problem/34818696>
1253
1254         Reviewed by Antti Koivisto.
1255
1256         Populate/evacuate methods are not called at layout time.
1257
1258         Covered by existing tests.
1259
1260         * rendering/RenderMultiColumnFlow.cpp:
1261         (WebCore::RenderMultiColumnFlow::populate):
1262         (WebCore::RenderMultiColumnFlow::evacuateAndDestroy):
1263
1264 2017-10-04  Zalan Bujtas  <zalan@apple.com>
1265
1266         RenderMultiColumnFlow::m_beingEvacuated is redundant.
1267         https://bugs.webkit.org/show_bug.cgi?id=177886
1268         <rdar://problem/34815997>
1269
1270         Reviewed by Simon Fraser.
1271
1272         m_beingEvacuated was introduced to protect RenderMultiColumnFlow from triggering
1273         remove/insert code while the column is being destroyed and the descendants are getting reparented.
1274         However, 
1275         1. the setMultiColumnFlow(nullptr) call already protects from triggering the remove callback
1276         2. When adding the children back to their original position, we should not be able to find
1277         this column as the enclosing block anymore (simply because we are moving the children as siblings
1278         to the multicol renderer) 
1279
1280         Covered by existing tests.
1281
1282         * rendering/RenderMultiColumnFlow.cpp:
1283         (WebCore::RenderMultiColumnFlow::RenderMultiColumnFlow):
1284         (WebCore::RenderMultiColumnFlow::evacuateAndDestroy):
1285         (WebCore::RenderMultiColumnFlow::fragmentedFlowDescendantInserted):
1286         (WebCore::RenderMultiColumnFlow::fragmentedFlowRelativeWillBeRemoved):
1287         * rendering/RenderMultiColumnFlow.h:
1288
1289 2017-10-04  Antti Koivisto  <antti@apple.com>
1290
1291         Fix typo.
1292
1293         Unreviewed.
1294
1295         * rendering/RenderView.cpp:
1296         (WebCore::RenderView::willBeDestroyed):
1297
1298 2017-10-04  Daniel Bates  <dabates@apple.com>
1299
1300         Teach TextDecorationPainter about pseudo styles
1301         https://bugs.webkit.org/show_bug.cgi?id=177882
1302
1303         Reviewed by Simon Fraser.
1304
1305         As a step towards implementing support for CSS pseudo elements ::spelling-error and ::grammar-error
1306         (https://bugs.webkit.org/show_bug.cgi?id=175784) teach TextDecorationPainter about pseudo styles.
1307
1308         * rendering/TextDecorationPainter.cpp:
1309         (WebCore::TextDecorationPainter::TextDecorationPainter): Modified to take an optional
1310         pseudo style (defaults to NOPSEUDO - no pseudo style).
1311         (WebCore::collectStylesForRenderer): Modified to take a pseudo style. Note that getCachedPseudoStyle()
1312         is only defined on RenderText and RenderElement objects (i.e. it is not a virtual function on RenderObject).
1313         So, we must explicitly type check the renderer and cast appropriately before calling it. We may want
1314         to consider making it virtual in the future if we find there are more call sites that would benefit
1315         from polymorphism.
1316         (WebCore::TextDecorationPainter::stylesForRenderer): Modified to take an optional
1317         pseudo style (defaults to NOPSEUDO - no pseudo style).
1318         * rendering/TextDecorationPainter.h:
1319
1320 2017-10-04  Antti Koivisto  <antti@apple.com>
1321
1322         Add assert verifying all renderers get destroyed
1323         https://bugs.webkit.org/show_bug.cgi?id=177870
1324
1325         Reviewed by Zalan Bujtas.
1326
1327         * rendering/RenderView.cpp:
1328         (WebCore::RenderView::willBeDestroyed):
1329
1330             Add assert to verify all renderers for this tree have been destroyed before the RenderView is.
1331
1332         * rendering/RenderView.h:
1333
1334 2017-10-04  Daniel Bates  <dabates@apple.com>
1335
1336         TextDecorationPainter::m_wavyOffset should be a float
1337         https://bugs.webkit.org/show_bug.cgi?id=177883
1338
1339         Reviewed by Simon Fraser.
1340
1341         In r194447 we extracted the text decoration painting code from InlineTextBox into
1342         TextDecorationPainter and changed the data type of the wavy offset from float to int.
1343         We use floating point numbers throughout the painting code and should store the wavy
1344         offset as a float.
1345
1346         * rendering/TextDecorationPainter.cpp:
1347         (WebCore::TextDecorationPainter::TextDecorationPainter): Use C++ uniform initializer
1348         syntax to initialize member fields.
1349         (WebCore::TextDecorationPainter::paintTextDecoration): Change int to float.
1350         * rendering/TextDecorationPainter.h: Remove unnecessary equal initializer for m_wavyOffset
1351         as this class has exactly one constructor and it always initializes it.
1352
1353 2017-10-04  Youenn Fablet  <youenn@apple.com>
1354
1355         Remove OpenWebRTC backend
1356         https://bugs.webkit.org/show_bug.cgi?id=177868
1357
1358         Reviewed by Alejandro G. Castro.
1359
1360         * CMakeLists.txt:
1361         * DerivedSources.make:
1362         * Modules/mediastream/MediaEndpointPeerConnection.cpp: Removed.
1363         * Modules/mediastream/MediaEndpointPeerConnection.h: Removed.
1364         * Modules/mediastream/MediaEndpointSessionDescription.cpp: Removed.
1365         * Modules/mediastream/MediaEndpointSessionDescription.h: Removed.
1366         * Modules/mediastream/SDPProcessor.cpp: Removed.
1367         * Modules/mediastream/SDPProcessor.h: Removed.
1368         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1369         * WebCore.xcodeproj/project.pbxproj:
1370         * platform/GStreamer.cmake:
1371         * platform/graphics/MediaPlayer.cpp:
1372         (WebCore::buildMediaEnginesVector):
1373         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1374         (WebCore::MediaPlayerPrivateGStreamer::supportsType):
1375         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.cpp: Removed.
1376         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.h: Removed.
1377         * platform/mediastream/MediaEndpoint.cpp: Removed.
1378         * platform/mediastream/MediaEndpoint.h: Removed.
1379         * platform/mediastream/MediaEndpointSessionConfiguration.h: Removed.
1380         * platform/mediastream/SDPProcessorScriptResource.cpp: Removed.
1381         * platform/mediastream/SDPProcessorScriptResource.h: Removed.
1382         * platform/mediastream/openwebrtc/MediaEndpointOwr.cpp: Removed.
1383         * platform/mediastream/openwebrtc/MediaEndpointOwr.h: Removed.
1384         * platform/mediastream/openwebrtc/OpenWebRTCUtilities.cpp: Removed.
1385         * platform/mediastream/openwebrtc/OpenWebRTCUtilities.h: Removed.
1386         * platform/mediastream/openwebrtc/RealtimeAudioSourceOwr.h: Removed.
1387         * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp: Removed.
1388         * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.h: Removed.
1389         * platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.cpp: Removed.
1390         * platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.h: Removed.
1391         * platform/mediastream/openwebrtc/RealtimeVideoSourceOwr.h: Removed.
1392         * platform/mock/MockMediaEndpoint.cpp: Removed.
1393         * platform/mock/MockMediaEndpoint.h: Removed.
1394         * platform/mock/MockRealtimeMediaSource.cpp:
1395         (WebCore::MockRealtimeMediaSource::MockRealtimeMediaSource):
1396         * platform/mock/MockRealtimeMediaSource.h:
1397         * testing/Internals.cpp:
1398         (WebCore::Internals::Internals):
1399         (WebCore::Internals::enableMockMediaEndpoint): Deleted.
1400         * testing/Internals.h:
1401
1402 2017-10-04  Zalan Bujtas  <zalan@apple.com>
1403
1404         Remove RenderTreeInternalMutationScope
1405         https://bugs.webkit.org/show_bug.cgi?id=177875
1406         <rdar://problem/34813088>
1407
1408         Reviewed by Antti Koivisto.
1409
1410         RenderTree mutation is in the past now. -and we've got assertions in place.
1411
1412         Not testable.
1413
1414         * page/FrameView.cpp:
1415         (WebCore::FrameView::layout):
1416         * rendering/RenderMultiColumnFlow.cpp:
1417         (WebCore::RenderMultiColumnFlow::populate):
1418         (WebCore::RenderMultiColumnFlow::evacuateAndDestroy):
1419         * rendering/RenderQuote.cpp:
1420         (WebCore::RenderQuote::updateTextRenderer):
1421         (WebCore::RenderQuote::updateRenderer):
1422         * rendering/RenderView.h:
1423         (WebCore::RenderTreeInternalMutationScope::RenderTreeInternalMutationScope): Deleted.
1424         (WebCore::RenderTreeInternalMutationScope::~RenderTreeInternalMutationScope): Deleted.
1425
1426 2017-10-04  Miguel Gomez  <magomez@igalia.com>
1427
1428         Unreviewed: fix GTK debug build after r222841.
1429
1430         * platform/image-decoders/webp/WEBPImageDecoder.cpp:
1431         (WebCore::WEBPImageDecoder::initFrameBuffer):
1432
1433 2017-10-04  Zalan Bujtas  <zalan@apple.com>
1434
1435         RenderFragmentContainerRange should not hold raw pointers.
1436         https://bugs.webkit.org/show_bug.cgi?id=177854
1437         <rdar://problem/34805954>
1438
1439         Reviewed by Antti Koivisto.
1440
1441         m_startFragment and m_endFragment object's lifetimes are not tied to the lifetime of
1442         RenderFragmentContainerRange.
1443
1444         Covered by existing tests.
1445
1446         * rendering/RenderFragmentedFlow.cpp:
1447         (WebCore::RenderFragmentedFlow::setFragmentRangeForBox):
1448         * rendering/RenderFragmentedFlow.h:
1449
1450 2017-10-04  Zalan Bujtas  <zalan@apple.com>
1451
1452         RenderMultiColumnSpannerPlaceholder should not hold raw pointers.
1453         https://bugs.webkit.org/show_bug.cgi?id=177840
1454         <rdar://problem/34800109>
1455
1456         Reviewed by Sam Weinig.
1457
1458         Though we should always have a spanner as long as there's a RenderMultiColumnSpannerPlaceholder,
1459         the spanner inject/removal logic is complicated enough to protect them with WeakPtr.  
1460
1461         Covered by existing tests.
1462
1463         * rendering/RenderMultiColumnSpannerPlaceholder.cpp:
1464         (WebCore::RenderMultiColumnSpannerPlaceholder::RenderMultiColumnSpannerPlaceholder):
1465         * rendering/RenderMultiColumnSpannerPlaceholder.h:
1466
1467 2017-10-04  Michael Catanzaro  <mcatanzaro@igalia.com>
1468
1469         [GTK] GtkUtilities.h should not be included in libs not linked to GTK
1470         https://bugs.webkit.org/show_bug.cgi?id=177860
1471
1472         Reviewed by Carlos Garcia Campos.
1473
1474         * platform/FreeType.cmake:
1475         * platform/gtk/GtkUtilities.cpp:
1476         (WebCore::topLevelPath): Deleted.
1477         (WebCore::webkitBuildDirectory): Deleted.
1478         * platform/gtk/GtkUtilities.h:
1479         (WebCore::wallTimeForEvent):
1480         * platform/text/hyphen/HyphenationLibHyphen.cpp:
1481         (WebCore::topLevelPath):
1482         (WebCore::webkitBuildDirectory):
1483
1484 2017-10-04  Carlos Garcia Campos  <cgarcia@igalia.com>
1485
1486         [Harfbuzz] Implement ComplexTextController on top of HarfBuzz
1487         https://bugs.webkit.org/show_bug.cgi?id=167956
1488
1489         Reviewed by Myles C. Maxfield.
1490
1491         Implement ComplexTextController using HarfBuzz and remove HarfBuzzShaper.
1492
1493         Covered by existing tests, a rebaseline will be neeed.
1494
1495         * platform/FreeType.cmake:
1496         * platform/graphics/ComplexTextController.cpp:
1497         (WebCore::TextLayoutDeleter::operator() const): Enable TextLayout when using HarfBuzz.
1498         (WebCore::FontCascade::createLayout const): Ditto.
1499         (WebCore::FontCascade::width): Ditto.
1500         * platform/graphics/ComplexTextController.h:
1501         (WebCore::ComplexTextController::ComplexTextRun::create): Add constructor that receives an hb_buffer_t.
1502         * platform/graphics/Font.cpp:
1503         (WebCore::Font::variantCapsSupportsCharacterForSynthesis const): Simple implementation for non-cocoa ports.
1504         * platform/graphics/FontCascade.cpp:
1505         (WebCore::FontCascade::getGlyphsAndAdvancesForComplexText const): Moved from FontCascadeCocoa.mm.
1506         (WebCore::FontCascade::floatWidthForComplexText const): Ditto.
1507         (WebCore::FontCascade::adjustSelectionRectForComplexText const): Ditto.
1508         (WebCore::FontCascade::offsetForPositionForComplexText const): Ditto.
1509         * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
1510         (WebCore::FontCascade::fontForCombiningCharacterSequence const): Normalize the sequence and get the font of the
1511         base character.
1512         * platform/graphics/cocoa/FontCascadeCocoa.mm:
1513         * platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
1514         (WebCore::harfBuzzPositionToFloat):
1515         (WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun):
1516         (WebCore::fontFeatures):
1517         (WebCore::characterScript):
1518         (WebCore::scriptsAreCompatibleForCharacters):
1519         (WebCore::findNextRun):
1520         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
1521         * platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp:
1522         (WebCore::harfBuzzGetGlyph): Check here if the character is a white space and use the space or zeroWidthSpace
1523         to ensure we get a glyph.
1524         * platform/graphics/harfbuzz/HarfBuzzShaper.cpp: Removed.
1525         * platform/graphics/harfbuzz/HarfBuzzShaper.h: Removed.
1526         * platform/graphics/harfbuzz/HbUniquePtr.h: Added.
1527         (WebCore::HbPtrDeleter::operator() const):
1528         (WebCore::HbPtrDeleter<hb_font_t>::operator() const):
1529         (WebCore::HbPtrDeleter<hb_buffer_t>::operator() const):
1530         * platform/graphics/opentype/OpenTypeMathData.h: Use HbUniquePtr.
1531
1532 2017-10-04  Michael Catanzaro  <mcatanzaro@igalia.com>
1533
1534         Unreviewed, fix typo in function name scanDirectoryForDicionaries
1535         https://bugs.webkit.org/show_bug.cgi?id=177866
1536
1537         * platform/text/hyphen/HyphenationLibHyphen.cpp:
1538         (WebCore::scanDirectoryForDictionaries):
1539         (WebCore::scanTestDictionariesDirectoryIfNecessary):
1540         (WebCore::availableLocales):
1541         (WebCore::scanDirectoryForDicionaries): Deleted.
1542
1543 2017-10-04  Miguel Gomez  <magomez@igalia.com>
1544
1545         Add animation support for WebP images
1546         https://bugs.webkit.org/show_bug.cgi?id=113124
1547
1548         Reviewed by Žan Doberšek.
1549
1550         Implement decoding of WebP animations.
1551
1552         Test: fast/images/animated-webp.html
1553
1554         * platform/graphics/ImageBackingStore.h:
1555         (WebCore::ImageBackingStore::blendPixel):
1556         * platform/image-decoders/webp/WEBPImageDecoder.cpp:
1557         (WebCore::WEBPImageDecoder::WEBPImageDecoder):
1558         (WebCore::WEBPImageDecoder::~WEBPImageDecoder):
1559         (WebCore::WEBPImageDecoder::setData):
1560         (WebCore::WEBPImageDecoder::repetitionCount const):
1561         (WebCore::WEBPImageDecoder::frameBufferAtIndex):
1562         (WebCore::WEBPImageDecoder::findFirstRequiredFrameToDecode):
1563         (WebCore::WEBPImageDecoder::decode):
1564         (WebCore::WEBPImageDecoder::decodeFrame):
1565         (WebCore::WEBPImageDecoder::initFrameBuffer):
1566         (WebCore::WEBPImageDecoder::applyPostProcessing):
1567         (WebCore::WEBPImageDecoder::parseHeader):
1568         (WebCore::WEBPImageDecoder::clearFrameBufferCache):
1569         * platform/image-decoders/webp/WEBPImageDecoder.h:
1570
1571 2017-10-04  Ryosuke Niwa  <rniwa@webkit.org>
1572
1573         Use blob URL when pasting RTFD instead of overriding DocumentLoader
1574         https://bugs.webkit.org/show_bug.cgi?id=177801
1575         <rdar://problem/34542270>
1576
1577         Reviewed by Wenson Hsieh.
1578
1579         Before this patch, pasting RTFD resulted in images and other subresources in RTFD are being placed
1580         into the document using WebKit fake URL, and DocumentLoader was overridden to return the appropriate
1581         data upon resource requests. This is bad because there is no mechanism for websites to access its content.
1582
1583         Like r222119 and r208451, this patch fixes thie problem by using a blob URL instead of a WebKit fake URL.
1584         This patch also adds a Blob::create variant which takes a SharedBuffer.
1585
1586         API Tests: PasteRTFD
1587
1588         * editing/WebCorePasteboardFileReader.cpp:
1589         (WebCore::WebCorePasteboardFileReader::readBuffer):
1590         * editing/cocoa/WebContentReaderCocoa.mm:
1591         (WebCore::DeferredLoadingScope): Extracted out of createFragmentAndAddResources for clarity.
1592         (WebCore::DeferredLoadingScope::DeferredLoadingScope):
1593         (WebCore::DeferredLoadingScope::~DeferredLoadingScope):
1594         (WebCore::createFragmentAndAddResources): Instead of adding resources to document loader, replace each
1595         URL in the document by a blob URL.
1596         (WebCore::WebContentReader::readImage):
1597         * editing/markup.cpp:
1598         (WebCore::replaceSubresourceURLs): Added. A helper to replace each URL in the document fragment by a blob
1599         URL created for each subresource. This won't work for iframes or srcset but that's okay for now since DOM
1600         constructed from RTFD doesn't use either.
1601         * editing/markup.h:
1602         * fileapi/Blob.cpp:
1603         (WebCore::Blob::Blob): Added a variant which takes a SharedBuffer.
1604         * fileapi/Blob.h:
1605         (WebCore::Blob::create): Ditto.
1606
1607 2017-10-04  Michael Catanzaro  <mcatanzaro@igalia.com>
1608
1609         REGRESSION(r222392): [WPE][GTK] Many forms tests are failing due to broken event timestamps
1610         https://bugs.webkit.org/show_bug.cgi?id=177449
1611
1612         Reviewed by Chris Dumez.
1613
1614         * platform/gtk/GtkUtilities.cpp:
1615         (WebCore::wallTimeForEvent):
1616         * platform/gtk/GtkUtilities.h:
1617         (WebCore::wallTimeForEvent):
1618
1619 2017-10-04  Miguel Gomez  <magomez@igalia.com>
1620
1621         [GTK][WPE] Fix playback of GIFs
1622         https://bugs.webkit.org/show_bug.cgi?id=176089
1623
1624         Reviewed by Carlos Garcia Campos.
1625
1626         Allow GIFImageReader to decode again already decoded frames. Thanks to this, we don't
1627         need to delete the GIFImageReader when GIFImageDecoder::clearFrameBufferCache() is
1628         called, and the we don't need the lock to avoid crashes in that situation.
1629
1630         Covered by existent tests.
1631
1632         * platform/image-decoders/gif/GIFImageDecoder.cpp:
1633         (WebCore::GIFImageDecoder::clearFrameBufferCache):
1634         (WebCore::GIFImageDecoder::decode):
1635         * platform/image-decoders/gif/GIFImageDecoder.h:
1636         * platform/image-decoders/gif/GIFImageReader.cpp:
1637         (GIFImageReader::decode):
1638
1639 2017-10-04  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
1640
1641         Unreviewed build fix.
1642
1643         Use different enum value for the check. UP_DEVICE_LEVEL_NORMAL is only available on newer
1644         upower.
1645
1646         * platform/glib/LowPowerModeNotifierGLib.cpp:
1647         (WebCore::LowPowerModeNotifier::updateState):
1648
1649 2017-10-03  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
1650
1651         [GLib] Let WebCore know of low power situations
1652         https://bugs.webkit.org/show_bug.cgi?id=177810
1653
1654         Reviewed by Carlos Garcia Campos.
1655
1656         WebCore can use knowledge of low power situations to throttle timers and avoid expensive
1657         checks, lowering power usage. We can use upower's warning level to let WebCore know we are
1658         in such a situation.
1659
1660         No tests as there is no way to mock upower.
1661
1662         * PlatformGTK.cmake: add new file.
1663         * PlatformWPE.cmake: add new file.
1664         * platform/LowPowerModeNotifier.cpp: use upower-glib to know about low power situations.
1665         * platform/LowPowerModeNotifier.h: includes upower header as UpClient and UpDevice are not forward
1666         declaration-friendly.
1667         * platform/glib/LowPowerModeNotifierGLib.cpp: Added.
1668         (WebCore::LowPowerModeNotifier::LowPowerModeNotifier):
1669         (WebCore::LowPowerModeNotifier::updateState): update low power mode from warning-level.
1670         (WebCore::LowPowerModeNotifier::warningLevelCallback): track upower's warning-level to know when
1671         a low power situation occurs.
1672         (WebCore::LowPowerModeNotifier::~LowPowerModeNotifier): stop tracking the warning-level signal.
1673         (WebCore::LowPowerModeNotifier::isLowPowerModeEnabled const):
1674
1675 2017-10-04  Joanmarie Diggs  <jdiggs@igalia.com>
1676
1677         AX: [ATK] aria-pressed="mixed" should be exposed via ATK_STATE_INDETERMINATE
1678         https://bugs.webkit.org/show_bug.cgi?id=177807
1679
1680         Reviewed by Chris Fleizach.
1681
1682         Include toggle buttons in the element types for which the mixed state is checked
1683         and exposed via ATK_STATE_INDETERMINATE if found. Also only do the role checks when
1684         AccessibilityObject::isIndeterminate() has returned false.
1685
1686         Test: accessibility/gtk/aria-pressed-mixed-value.html
1687
1688         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
1689         (setAtkStateSetFromCoreObject):
1690
1691 2017-10-04  Joanmarie Diggs  <jdiggs@igalia.com>
1692
1693         AX: [ATK] ARIA tabpanel role should be exposed as ATK_ROLE_SCROLL_PANE
1694         https://bugs.webkit.org/show_bug.cgi?id=177815
1695
1696         Reviewed by Chris Fleizach.
1697
1698         Change the mapping of TabPanelRole from ATK_ROLE_PANEL to ATK_ROLE_SCROLL_PANE.
1699
1700         No new tests because this mapping is already covered by aria-tab-roles.html and
1701         roles-exposed.html. The platform expectations for each test have been updated.
1702
1703         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
1704         (atkRole):
1705
1706 2017-10-03  Antti Koivisto  <antti@apple.com>
1707
1708         Use WeakPtr in RenderFullScreen
1709         https://bugs.webkit.org/show_bug.cgi?id=177827
1710
1711         Reviewed by Zalan Bujtas.
1712
1713         Make Document::m_fullScreenRenderer RenderFullScreen::m_placeholder WeakPtrs
1714         and get rid of the custom nulling code.
1715
1716         * dom/Document.cpp:
1717         (WebCore::Document::destroyRenderTree):
1718         (WebCore::Document::webkitWillEnterFullScreenForElement):
1719         (WebCore::Document::webkitDidExitFullScreenForElement):
1720         (WebCore::Document::setFullScreenRenderer):
1721         (WebCore::Document::fullScreenRendererDestroyed): Deleted.
1722         * dom/Document.h:
1723         (WebCore::Document::fullScreenRenderer const):
1724         * rendering/RenderFullScreen.cpp:
1725         (WebCore::RenderFullScreen::RenderFullScreen):
1726         (WebCore::RenderFullScreen::willBeDestroyed):
1727         (WebCore::RenderFullScreen::createPlaceholder):
1728         (WebCore::RenderFullScreenPlaceholder::willBeDestroyed): Deleted.
1729         (WebCore::RenderFullScreen::setPlaceholder): Deleted.
1730         * rendering/RenderFullScreen.h:
1731
1732 2017-10-03  Ryosuke Niwa  <rniwa@webkit.org>
1733
1734         Enable pasteboard custom data in macOS 10.12 and earlier
1735         https://bugs.webkit.org/show_bug.cgi?id=177855
1736
1737         Reviewed by Wenson Hsieh.
1738
1739         Make customPasteboardDataEnabled return true on macOS 10.12 and earlier as long as the app is Safari.
1740
1741         * page/Settings.cpp:
1742         (WebCore::Settings::customPasteboardDataEnabled):
1743
1744 2017-10-03  Jon Davis  <jond@apple.com>
1745
1746         Update several features to "Supported"
1747         https://bugs.webkit.org/show_bug.cgi?id=177831
1748
1749         Reviewed by Alexey Proskuryakov.
1750
1751         Update Media Capture and Streams, Performance Observer, Resource Timing, User Timing, 
1752         Web Cryptography, and WebRTC.
1753
1754         * features.json:
1755
1756 2017-10-03  Basuke Suzuki  <Basuke.Suzuki@sony.com>
1757
1758         [Curl] Reimplement CurlDownload with CurlRequest
1759         https://bugs.webkit.org/show_bug.cgi?id=177779
1760
1761         Reviewed by Alex Christensen.
1762
1763         * platform/network/curl/CurlContext.cpp:
1764         (WebCore::CurlHandle::enableAllowedProtocols):
1765         (WebCore::CurlHandle::enableFollowLocation): Deleted.
1766         (WebCore::CurlHandle::getEffectiveURL): Deleted.
1767         * platform/network/curl/CurlContext.h:
1768         * platform/network/curl/CurlDownload.cpp:
1769         (WebCore::CurlDownload::~CurlDownload):
1770         (WebCore::CurlDownload::init):
1771         (WebCore::CurlDownload::start):
1772         (WebCore::CurlDownload::cancel):
1773         (WebCore::CurlDownload::createCurlRequest):
1774         (WebCore::CurlDownload::curlDidReceiveResponse):
1775         (WebCore::CurlDownload::curlDidReceiveBuffer):
1776         (WebCore::CurlDownload::curlDidComplete):
1777         (WebCore::CurlDownload::curlDidFailWithError):
1778         (WebCore::CurlDownload::shouldRedirectAsGET):
1779         (WebCore::CurlDownload::willSendRequest):
1780         (WebCore::CurlDownload::getResponse const): Deleted.
1781         (WebCore::CurlDownload::retain): Deleted.
1782         (WebCore::CurlDownload::release): Deleted.
1783         (WebCore::CurlDownload::setupTransfer): Deleted.
1784         (WebCore::CurlDownload::didCompleteTransfer): Deleted.
1785         (WebCore::CurlDownload::didCancelTransfer): Deleted.
1786         (WebCore::CurlDownload::closeFile): Deleted.
1787         (WebCore::CurlDownload::moveFileToDestination): Deleted.
1788         (WebCore::CurlDownload::writeDataToFile): Deleted.
1789         (WebCore::CurlDownload::didReceiveHeader): Deleted.
1790         (WebCore::CurlDownload::didReceiveData): Deleted.
1791         (WebCore::CurlDownload::didReceiveResponse): Deleted.
1792         (WebCore::CurlDownload::didReceiveDataOfLength): Deleted.
1793         (WebCore::CurlDownload::didFinish): Deleted.
1794         (WebCore::CurlDownload::didFail): Deleted.
1795         (WebCore::CurlDownload::writeCallback): Deleted.
1796         (WebCore::CurlDownload::headerCallback): Deleted.
1797         * platform/network/curl/CurlDownload.h:
1798         (WebCore::CurlDownloadListener::didReceiveResponse):
1799         * platform/network/curl/CurlRequest.cpp:
1800         (WebCore::CurlRequest::didReceiveData):
1801         (WebCore::CurlRequest::finalizeTransfer):
1802         (WebCore::CurlRequest::enableDownloadToFile):
1803         (WebCore::CurlRequest::getDownloadedFilePath):
1804         (WebCore::CurlRequest::writeDataToDownloadFileIfEnabled):
1805         (WebCore::CurlRequest::closeDownloadFile):
1806         * platform/network/curl/CurlRequest.h:
1807         (WebCore::CurlRequest::create):
1808         * platform/network/curl/ResourceHandleCurlDelegate.cpp:
1809         (WebCore::ResourceHandleCurlDelegate::createCurlRequest):
1810         * platform/network/curl/ResourceHandleCurlDelegate.h:
1811
1812 2017-10-03  Zalan Bujtas <zalan@apple.com>
1813
1814         Move scroll snap point unregistration from willBeRemovedFromTree to willBeDestroyed
1815         https://bugs.webkit.org/show_bug.cgi?id=177830
1816         <rdar://problem/34796065>
1817
1818         Reviewed by Antti Koivisto.
1819
1820         willBeRemovedFromTree is called conditionally, relying on unregistering objects in there is highly error prone.
1821
1822         Covered by existing tests.
1823
1824         * rendering/RenderBox.cpp:
1825         (WebCore::RenderBox::willBeDestroyed):
1826         (WebCore::RenderBox::willBeRemovedFromTree): Deleted.
1827         * rendering/RenderBox.h:
1828
1829 2017-10-03  Joanmarie Diggs  <jdiggs@igalia.com>
1830
1831         AX: [ATK] ARIA menuitems should be exposed with ATK_ROLE_MENU_ITEM even when it's the child of group role
1832         https://bugs.webkit.org/show_bug.cgi?id=177811
1833
1834         Reviewed by Chris Fleizach.
1835
1836         AccessibilityNodeObject::remapAriaRoleDueToParent() remaps ARIA menuitems to the
1837         MenuButtonRole AccessibilityRole when the menuitem's parent is an ARIA group, but
1838         the ATK code was not handling that remapped role value. As a result, the element
1839         was being exposed as ATK_ROLE_UNKNOWN. Add MenuButtonRole to the AccessibilityRole
1840         types exposed as ATK_ROLE_MENU_ITEM.
1841
1842         Test: accessibility/gtk/menu-with-group-child-tree.html
1843
1844         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
1845         (atkRole):
1846
1847 2017-10-03  Joanmarie Diggs  <jdiggs@igalia.com>
1848
1849         AX: [ATK] aria-rowindex set on row element is not being exposed
1850         https://bugs.webkit.org/show_bug.cgi?id=177821
1851
1852         Reviewed by Chris Fleizach.
1853
1854         Expose the value of aria-rowindex when set on a row as an object
1855         attribute, as we already do when it's set on a cell.
1856
1857         Test: accessibility/gtk/aria-rowindex-on-row.html
1858
1859         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
1860         (webkitAccessibleGetAttributes):
1861
1862 2017-10-03  Daniel Bates  <dabates@apple.com>
1863
1864         Share code to normalize an HTTP method
1865         https://bugs.webkit.org/show_bug.cgi?id=177837
1866
1867         Reviewed by Andy Estes.
1868
1869         Currently we duplicate code in XMLHttpRequest and FetchRequest to normalize an HTTP method.
1870         We should add a common helper function and update both classes to make use of it.
1871
1872         No functionality changed. So, no new tests.
1873
1874         * Modules/fetch/FetchRequest.cpp:
1875         (WebCore::setMethod): Modified to use WebCore::normalizeHTTPMethod().
1876         * platform/network/HTTPParsers.cpp:
1877         (WebCore::normalizeHTTPMethod): Moved from XMLHttpRequest.cpp.
1878         * platform/network/HTTPParsers.h:
1879         * xml/XMLHttpRequest.cpp:
1880         (WebCore::XMLHttpRequest::open): Modified to use WebCore::normalizeHTTPMethod().
1881         (WebCore::XMLHttpRequest::uppercaseKnownHTTPMethod): Deleted; moved to HTTPParsers.cpp.
1882         * xml/XMLHttpRequest.h:
1883
1884 2017-10-03  Daniel Bates  <dabates@apple.com>
1885
1886         Share code to determine a forbidden method
1887         https://bugs.webkit.org/show_bug.cgi?id=177833
1888
1889         Reviewed by Andy Estes.
1890
1891         Currently we duplicate code in XMLHttpRequest and FetchRequest to determine if a method is
1892         forbidden. We should add a common helper function and update both classes to make use of it.
1893
1894         No functionality changed. So, no new tests.
1895
1896         * Modules/fetch/FetchRequest.cpp:
1897         (WebCore::setMethod): Modified to use WebCore::isForbiddenMethod().
1898         * platform/network/HTTPParsers.cpp:
1899         (WebCore::isForbiddenMethod): Added.
1900         * platform/network/HTTPParsers.h:
1901         * xml/XMLHttpRequest.cpp:
1902         (WebCore::XMLHttpRequest::open): Modified to use WebCore::isForbiddenMethod().
1903         (WebCore::XMLHttpRequest::isAllowedHTTPMethod): Deleted.
1904         * xml/XMLHttpRequest.h:
1905
1906 2017-10-03  Zalan Bujtas  <zalan@apple.com>
1907
1908         RenderMenuList should not hold raw pointers
1909         https://bugs.webkit.org/show_bug.cgi?id=177836
1910
1911         Reviewed by Antti Koivisto.
1912
1913         While both m_buttonText and m_innerBlock are child renderers of
1914         the RenderMenuList, so the their lifecycles are supposed to tied
1915         to the parent object, this patch removes some manual raw pointer managing.
1916
1917         Covered by existing tests.
1918
1919         * rendering/RenderMenuList.cpp:
1920         (WebCore::RenderMenuList::RenderMenuList):
1921         (WebCore::RenderMenuList::createInnerBlock):
1922         (RenderMenuList::takeChild):
1923         (RenderMenuList::setText):
1924         * rendering/RenderMenuList.h:
1925
1926 2017-10-03  Timothy Horton  <timothy_horton@apple.com>
1927
1928         Include a few widespread WTF headers in WebCorePrefix.h
1929         https://bugs.webkit.org/show_bug.cgi?id=173481
1930
1931         * WebCorePrefix.h:
1932         Turn this off on Windows because it doesn't work; needs further investigation.
1933
1934 2017-10-03  Tim Horton  <timothy_horton@apple.com>
1935
1936         Include a few widespread WTF headers in WebCorePrefix.h
1937         https://bugs.webkit.org/show_bug.cgi?id=173481
1938
1939         Reviewed by Alex Christensen.
1940
1941         * WebCorePrefix.h:
1942         These are four of the headers that contribute the most pre-processed
1943         source to the WebCore build. They (and their dependents) change infrequently
1944         enough that a world rebuild of WebCore when they change seems like an
1945         acceptable tradeoff for the ~9% reduction in WebCore build time that I
1946         measure from this change.
1947
1948         We can't do this on macOS 10.12 because of https://bugs.llvm.org/show_bug.cgi?id=33520.
1949
1950 2017-10-03  Daniel Bates  <dabates@apple.com>
1951
1952         XMLHttpRequest.setRequestHeader() should allow Content-Transfer-Encoding header; remove
1953         duplicate logic to check for a forbidden XHR header field
1954         https://bugs.webkit.org/show_bug.cgi?id=177829
1955
1956         Reviewed by Alexey Proskuryakov.
1957
1958         Use isForbiddenHeaderName() (defined in HTTPParsers.h) to check if the header field specified
1959         to XMLHttpRequest.setRequestHeader() is allowed. Among other benefits this makes the behavior
1960         of XMLHttpRequest.setRequestHeader() more closely aligned with the behavior of this method in
1961         the XHR standard, <https://xhr.spec.whatwg.org> (8 September 2017). In particular, XMLHttpRequest.setRequestHeader()
1962         no longer forbids setting the header Content-Transfer-Encoding. This header has not been
1963         considered a forbidden header since <https://www.w3.org/TR/2012/WD-XMLHttpRequest-20121206/>.
1964
1965         * xml/XMLHttpRequest.cpp:
1966         (WebCore::XMLHttpRequest::setRequestHeader):
1967         (WebCore::isForbiddenRequestHeader): Deleted.
1968         (WebCore::XMLHttpRequest::isAllowedHTTPHeader): Deleted.
1969         * xml/XMLHttpRequest.h:
1970
1971 2017-10-03  Commit Queue  <commit-queue@webkit.org>
1972
1973         Unreviewed, rolling out r222686, r222695, and r222698.
1974         https://bugs.webkit.org/show_bug.cgi?id=177835
1975
1976         Caused LayoutTests to crash in
1977         WebCore::TimerBase::setNextFireTime (Requested by ryanhaddad
1978         on #webkit).
1979
1980         Reverted changesets:
1981
1982         "[Settings] Replace SettingsMacros.h with a generated base
1983         class for Settings"
1984         https://bugs.webkit.org/show_bug.cgi?id=177681
1985         http://trac.webkit.org/changeset/222686
1986
1987         "[Settings] Enums should not be passed by const reference"
1988         https://bugs.webkit.org/show_bug.cgi?id=177727
1989         http://trac.webkit.org/changeset/222695
1990
1991         "[Settings] Move remaining simple settings to Settings.in"
1992         https://bugs.webkit.org/show_bug.cgi?id=177730
1993         http://trac.webkit.org/changeset/222698
1994
1995 2017-10-03  Jer Noble  <jer.noble@apple.com>
1996
1997         Implement quality-of-service tiers in WebCoreDecompressionSession
1998         https://bugs.webkit.org/show_bug.cgi?id=177769
1999
2000         Reviewed by Dean Jackson.
2001
2002         VTDecompressionSession will suggest quality-of-service tiers to be used when decompression
2003         can't keep up with playback speed. Use a simple exponential-moving-average heuristic to
2004         determine when to move up and down the tiers.
2005
2006         Drive-by fix: When frames are so late that they miss the display deadline, mark them as
2007         dropped rather than just delayed.
2008
2009         * platform/graphics/cocoa/WebCoreDecompressionSession.h:
2010         * platform/graphics/cocoa/WebCoreDecompressionSession.mm:
2011         (WebCore::WebCoreDecompressionSession::ensureDecompressionSessionForSample):
2012         (WebCore::WebCoreDecompressionSession::decodeSample):
2013         (WebCore::WebCoreDecompressionSession::handleDecompressionOutput):
2014         (WebCore::WebCoreDecompressionSession::automaticDequeue):
2015         (WebCore::WebCoreDecompressionSession::enqueueDecodedSample):
2016         (WebCore::WebCoreDecompressionSession::resetQosTier):
2017         (WebCore::WebCoreDecompressionSession::increaseQosTier):
2018         (WebCore::WebCoreDecompressionSession::decreaseQosTier):
2019         (WebCore::WebCoreDecompressionSession::updateQosWithDecodeTimeStatistics):
2020         * platform/cocoa/VideoToolboxSoftLink.cpp:
2021         * platform/cocoa/VideoToolboxSoftLink.h:
2022
2023 2017-10-03  Adrian Perez de Castro  <aperez@igalia.com>
2024
2025         [GTK] Support the "system" CSS font family
2026         https://bugs.webkit.org/show_bug.cgi?id=177755
2027
2028         Reviewed by Carlos Garcia Campos.
2029
2030         Obtain the system UI font from the GtkSettings::gtk-font-name property
2031
2032         Test: platform/gtk/fonts/systemFont.html
2033
2034         * platform/graphics/freetype/FontCacheFreeType.cpp:
2035         (WebCore::getFamilyNameStringFromFamily): Use defaultGtkSystemFont()
2036         to handle -webkit-system-font and -webkit-system-ui.
2037         (WebCore::isCommonlyUsedGenericFamily): Handle -webkit-system-font and
2038         -webkit-system-ui as generic family names.
2039         * platform/graphics/gtk/GtkUtilities.cpp:
2040         (WebCore::defaultGtkSystemFont): Added.
2041         * platform/graphics/gtk/GtkUtilities.h: Add prototype for defaultGtkSystemFont().
2042
2043 2017-10-03  Daniel Bates  <dabates@apple.com>
2044
2045         [XHR] Only exempt Dashboard widgets from XHR header restrictions
2046         https://bugs.webkit.org/show_bug.cgi?id=177824
2047         <rdar://problem/34384301>
2048
2049         Reviewed by Alexey Proskuryakov.
2050
2051         Currently we allow file URLs to set arbitrary XHR headers. In contrast, non-file URLs are
2052         restricted from setting some XHR headers (e.g. COOKIE). Historically the relaxation for file
2053         URL was for backwards compatibility to allow Dashboard widgets to work. Instead we should
2054         apply the non-file URL policy to all URLs and only relax the policy for Dashboard widgets.
2055
2056         Tests: fast/xmlhttprequest/set-dangerous-headers-in-dashboard.html
2057                fast/xmlhttprequest/set-dangerous-headers.html
2058
2059         * xml/XMLHttpRequest.cpp:
2060         (WebCore::XMLHttpRequest::setRequestHeader):
2061
2062 2017-10-03  Fujii Hironori  <Hironori.Fujii@sony.com>
2063
2064         REGRESSION(r221909): Failing fast/text/international/iso-8859-8.html
2065         https://bugs.webkit.org/show_bug.cgi?id=177364
2066
2067         Reviewed by Carlos Garcia Campos.
2068
2069         Range.getClientRects returned an incorrect rect for a last
2070         collapsed space of RenderText in HarfBuzz port.
2071
2072         HarfBuzzShaper::selectionRect needs to return a valid value even
2073         if the arguments 'from' and 'to' point to the just after the end
2074         of the text run.
2075
2076         Tests: fast/text/international/iso-8859-8.html
2077
2078         * platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
2079         (WebCore::HarfBuzzShaper::shape): Do not check the return value of
2080         fillGlyphBuffer.
2081         (WebCore::HarfBuzzShaper::fillGlyphBuffer): Change the return
2082         value type from bool to void.
2083         (WebCore::HarfBuzzShaper::selectionRect): Set the rightmost
2084         position to fromX if foundFromX is false.
2085         * platform/graphics/harfbuzz/HarfBuzzShaper.h: Change the return
2086         value type of fillGlyphBuffer from bool to void.
2087
2088 2017-10-03  JF Bastien  <jfbastien@apple.com>
2089
2090         WebAssembly: no VM / JS version of everything but Instance
2091         https://bugs.webkit.org/show_bug.cgi?id=177473
2092
2093         Reviewed by Filip Pizlo.
2094
2095         * ForwardingHeaders/wasm/WasmModule.h: Added. This used to be
2096         included in JSWebAssemblyModule.h.
2097         * bindings/js/SerializedScriptValue.cpp: Update postMessage code
2098         according to C++ API changes.
2099
2100 2017-10-03  Zalan Bujtas  <zalan@apple.com>
2101
2102         [AX] Do not trigger redundant layout on tables.
2103         https://bugs.webkit.org/show_bug.cgi?id=177781
2104         <rdar://problem/34777030>
2105
2106         Reviewed by Antti Koivisto.
2107
2108         RenderTable::forceSectionsRecalc() marks the RenderTable dirty and schedules a layout.
2109         Every time AccessibilityTable asks for the table element (including during construction),
2110         we end up triggering a layout. This call was added (r191357) to ensure RenderTable's m_firstBody is always
2111         up-to-date (in case of anonymous wrapper table renderer). Instead of relying on the m_firstBody,
2112         let's just use the first child to find the table element. The first child always points to a valid
2113         renderer (or nullptr), while m_firstBody is the result of section computation.
2114
2115         Covered by existing tests.
2116
2117         * accessibility/AccessibilityTable.cpp:
2118         (WebCore::AccessibilityTable::tableElement const):
2119
2120 2017-10-03  Daniel Bates  <dabates@apple.com>
2121
2122         [CSP] Check policy before opening a new window to a JavaScript URL
2123         https://bugs.webkit.org/show_bug.cgi?id=176815
2124         <rdar://problem/34400057>
2125
2126         Reviewed by Brent Fulgham.
2127
2128         Ensure that the Content Security Policy of the page allows navigation to a JavaScript URL
2129         before opening a new window to it.
2130
2131         Test: http/tests/security/contentSecurityPolicy/window-open-javascript-url-blocked.html
2132
2133         * loader/FrameLoader.cpp:
2134         (WebCore::createWindow):
2135
2136 2017-10-03  Joanmarie Diggs  <jdiggs@igalia.com>
2137
2138         AX: [ATK] ARIA drag-and-drop attribute values should be exposed via AtkObject attributes
2139         https://bugs.webkit.org/show_bug.cgi?id=177763
2140
2141         Reviewed by Chris Fleizach.
2142
2143         Expose the values of aria-grabbed and aria-dropeffect via the "grabbed" and "dropeffect"
2144         AtkObject attributes.
2145
2146         Test: accessibility/gtk/aria-drag-and-drop.html
2147
2148         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
2149         (webkitAccessibleGetAttributes):
2150
2151 2017-10-03  Brent Fulgham  <bfulgham@apple.com>
2152
2153         Unreviewed test fix after r222779.
2154
2155         * testing/cocoa/WebArchiveDumpSupport.mm:
2156         (WebCoreTestSupport::createCFURLResponseFromResponseData): Setting NSSecureCoding in this test code should be
2157         done based on build system, just like it is in the actual WebArchive handling code.
2158
2159 2017-10-03  Youenn Fablet  <youenn@apple.com>
2160
2161         Clean-up RealtimeIncomingVideoSource
2162         https://bugs.webkit.org/show_bug.cgi?id=177782
2163
2164         Reviewed by Alejandro G. Castro.
2165
2166         No change of behavior.
2167         Removing code that is no longer needed.
2168
2169         * platform/mediastream/mac/RealtimeIncomingVideoSource.cpp:
2170         (WebCore::RealtimeIncomingVideoSource::create):
2171         (WebCore::RealtimeIncomingVideoSource::RealtimeIncomingVideoSource):
2172         * platform/mediastream/mac/RealtimeIncomingVideoSource.h:
2173
2174 2017-10-03  Brent Fulgham  <bfulgham@apple.com>
2175
2176         [Mac] Use safer decoding practices for NSKeyedUnarchiver
2177         https://bugs.webkit.org/show_bug.cgi?id=175887
2178         <rdar://problem/33435281>
2179
2180         Reviewed by Daniel Bates.
2181
2182         * loader/archive/cf/LegacyWebArchiveMac.mm:
2183         (WebCore::LegacyWebArchive::createResourceResponseFromMacArchivedData): Use NSSecureCoding to unarchive.
2184         (WebCore::LegacyWebArchive::createPropertyListRepresentation): Ditto for archiving.
2185         * testing/cocoa/WebArchiveDumpSupport.mm:
2186         (WebCoreTestSupport::createCFURLResponseFromResponseData): Update to use NSSecureCoding if possible.
2187
2188 2017-10-03  Ryan Haddad  <ryanhaddad@apple.com>
2189
2190         Unreviewed, rolling out r222760.
2191
2192         This change caused LayoutTest crashes.
2193
2194         Reverted changeset:
2195
2196         "[Mac] Use safer decoding practices for NSKeyedUnarchiver"
2197         https://bugs.webkit.org/show_bug.cgi?id=175887
2198         http://trac.webkit.org/changeset/222760
2199
2200 2017-10-03  Michael Catanzaro  <mcatanzaro@igalia.com>
2201
2202         REGRESSION(r222392): [WPE][GTK] Many forms tests are failing due to broken event timestamps
2203         https://bugs.webkit.org/show_bug.cgi?id=177449
2204
2205         Reviewed by Chris Dumez.
2206
2207         * platform/gtk/GtkUtilities.cpp:
2208         (WebCore::wallTimeForEvent):
2209         * platform/gtk/GtkUtilities.h:
2210         (WebCore::wallTimeForEvent):
2211         * platform/gtk/PlatformKeyboardEventGtk.cpp:
2212         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
2213         * platform/gtk/PlatformMouseEventGtk.cpp:
2214         (WebCore::PlatformMouseEvent::PlatformMouseEvent):
2215         * platform/gtk/PlatformWheelEventGtk.cpp:
2216         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
2217
2218 2017-10-03  Youenn Fablet  <youenn@apple.com>
2219
2220         Use vector map routine in WebCore CacheStorage implementation
2221         https://bugs.webkit.org/show_bug.cgi?id=177002
2222
2223         Reviewed by Darin Adler.
2224
2225         No change of behavior.
2226         Replacing use of reserveInitialCapacity/uncheckedAppend by use of map.
2227
2228         * Modules/cache/CacheStorage.cpp:
2229         (WebCore::copyCache):
2230         (WebCore::CacheStorage::match):
2231         (WebCore::CacheStorage::retrieveCaches):
2232         (WebCore::CacheStorage::keys):
2233         (WebCore::copyCaches): Deleted.
2234         * Modules/cache/DOMCache.cpp:
2235         (WebCore::DOMCache::matchAll):
2236         (WebCore::copyRequestRef):
2237         (WebCore::DOMCache::keys):
2238         * Modules/cache/DOMCacheEngine.cpp:
2239         (WebCore::DOMCacheEngine::isolateCacheInfo):
2240         (WebCore::DOMCacheEngine::CacheInfos::isolatedCopy):
2241         * Modules/cache/WorkerCacheStorageConnection.cpp:
2242         (WebCore::recordsDataFromRecords):
2243         (WebCore::recordsFromRecordsData):
2244
2245 2017-10-02  Myles C. Maxfield  <mmaxfield@apple.com>
2246
2247         Move LineEnding.{h,cpp} from WebCore/platform/text to wtf/text
2248         https://bugs.webkit.org/show_bug.cgi?id=176575
2249
2250         Reviewed by Alex Christensen.
2251
2252         No new tests because there is no behavior change.
2253
2254         * WebCore.xcodeproj/project.pbxproj:
2255         * fileapi/BlobBuilder.cpp:
2256         * html/FormDataList.cpp:
2257
2258 2017-10-02  Joseph Pecoraro  <pecoraro@apple.com>
2259
2260         Web Inspector: Rename methods ending in *Json() as *JSON()
2261         https://bugs.webkit.org/show_bug.cgi?id=177793
2262
2263         Reviewed by Matt Baker.
2264
2265         * inspector/InspectorNetworkAgent.cpp:
2266         (WebCore::InspectorNetworkAgent::buildObjectForCachedResource):
2267         (WebCore::InspectorNetworkAgent::willSendRequest):
2268         (WebCore::InspectorNetworkAgent::didReceiveResponse):
2269         * inspector/InspectorPageAgent.cpp:
2270         (WebCore::InspectorPageAgent::resourceTypeJSON):
2271         (WebCore::InspectorPageAgent::cachedResourceTypeJSON):
2272         (WebCore::InspectorPageAgent::buildObjectForFrameTree):
2273         (WebCore::InspectorPageAgent::resourceTypeJson): Deleted.
2274         (WebCore::InspectorPageAgent::cachedResourceTypeJson): Deleted.
2275         * inspector/InspectorPageAgent.h:
2276
2277 2017-10-02  Wenson Hsieh  <wenson_hsieh@apple.com>
2278
2279         REGRESSION(r222595): Intermittent crash while accessing DataTransferItemList
2280         https://bugs.webkit.org/show_bug.cgi?id=177791
2281         <rdar://problem/34781456>
2282
2283         Reviewed by Ryosuke Niwa.
2284
2285         DataTransfer::moveDragState() currently attempts to move the other DataTransfer's DataTransferItemList and
2286         DragImageLoader as members of its own. This is incorrect, since both of these entities hold raw references of
2287         some form to the other DataTransfer, yet they are held as unique_ptrs in the new DataTransfer. To fix this, we
2288         (1) remove the line of code that moves the item list, since item lists will be lazily generated on the new
2289         DataTransfer anyways, and (2) update the DataTransfer pointer on the old DataTransfer's DragImageLoader after
2290         moving it to the new DataTransfer.
2291
2292         Test: editing/pasteboard/drag-end-crash-accessing-item-list.html
2293
2294         * dom/DataTransfer.cpp:
2295         (WebCore::DragImageLoader::moveToDataTransfer):
2296         (WebCore::DataTransfer::moveDragState):
2297
2298 2017-10-02  Chris Dumez  <cdumez@apple.com>
2299
2300         Rename computeSharedStringHash() overload taking a URL to computedVisitedLinkHash()
2301         https://bugs.webkit.org/show_bug.cgi?id=177776
2302
2303         Reviewed by Alex Christensen.
2304
2305         * dom/VisitedLinkState.cpp:
2306         (WebCore::linkHashForElement):
2307         (WebCore::VisitedLinkState::determineLinkStateSlowCase):
2308         * html/HTMLAnchorElement.h:
2309         (WebCore::HTMLAnchorElement::visitedLinkHash const):
2310         * platform/SharedStringHash.cpp:
2311         (WebCore::computeVisitedLinkHash):
2312         * platform/SharedStringHash.h:
2313
2314 2017-10-02  Joanmarie Diggs  <jdiggs@igalia.com>
2315
2316         AX: [ATK] The value of aria-level is not exposed on non-heading roles
2317         https://bugs.webkit.org/show_bug.cgi?id=177775
2318
2319         Reviewed by Chris Fleizach.
2320
2321         Expose the value of aria-level via the "level" AtkObject attribute, as is currently
2322         done for headings.
2323
2324         Test: accessibility/gtk/aria-level.html
2325
2326         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
2327         (webkitAccessibleGetAttributes):
2328
2329 2017-10-02  Andy Estes  <aestes@apple.com>
2330
2331         [Payment Request] Validate payment method identifiers
2332         https://bugs.webkit.org/show_bug.cgi?id=177794
2333
2334         Reviewed by Sam Weinig.
2335
2336         * Modules/paymentrequest/PaymentRequest.cpp:
2337         (WebCore::isValidStandardizedPaymentMethodIdentifier):
2338         (WebCore::isValidURLBasedPaymentMethodIdentifier):
2339         (WebCore::convertAndValidatePaymentMethodIdentifier):
2340         (WebCore::PaymentRequest::create):
2341         * Modules/paymentrequest/PaymentRequest.h:
2342
2343 2017-10-02  Ryosuke Niwa  <rniwa@webkit.org>
2344
2345         Move more code into PasteboardCustomData
2346         https://bugs.webkit.org/show_bug.cgi?id=177795
2347
2348         Reviewed by Wenson Hsieh.
2349
2350         Moved sharedBufferFromCustomData, customDataFromSharedBuffer, and customWebKitPasteboardDataType into
2351         PasteboardCustomData as createSharedBuffer, fromSharedBuffer, and cocoaType respectively.
2352
2353         * platform/Pasteboard.cpp:
2354         (WebCore::PasteboardCustomData::createSharedBuffer const): Renamed from sharedBufferFromCustomData.
2355         (WebCore::PasteboardCustomData::fromSharedBuffer): Renamed from customDataFromSharedBuffer.
2356         * platform/Pasteboard.h:
2357         * platform/StaticPasteboard.cpp:
2358         (WebCore::StaticPasteboard::commitToPasteboard): Now initializes with an empty origin string.
2359         * platform/cocoa/PasteboardCocoa.mm:
2360         (WebCore::PasteboardCustomData::cocoaType): Moved here from Pasteboard.h
2361         (WebCore::Pasteboard::readStringInCustomData):
2362         * platform/ios/PlatformPasteboardIOS.mm:
2363         (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const):
2364         (WebCore::PlatformPasteboard::write):
2365         * platform/ios/WebItemProviderPasteboard.mm:
2366         (-[WebItemProviderPasteboard typeIdentifiersToLoadForRegisteredTypeIdentfiers:]):
2367         * platform/mac/PlatformPasteboardMac.mm:
2368         (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const):
2369         (WebCore::PlatformPasteboard::write):
2370
2371 2017-10-02  Brent Fulgham  <bfulgham@apple.com>
2372
2373         [Mac] Use safer decoding practices for NSKeyedUnarchiver
2374         https://bugs.webkit.org/show_bug.cgi?id=175887
2375         <rdar://problem/33435281>
2376
2377         Reviewed by Daniel Bates.
2378
2379         * loader/archive/cf/LegacyWebArchiveMac.mm:
2380         (WebCore::LegacyWebArchive::createResourceResponseFromMacArchivedData): Use NSSecureCoding to unarchive.
2381         (WebCore::LegacyWebArchive::createPropertyListRepresentation): Ditto for archiving.
2382         * testing/cocoa/WebArchiveDumpSupport.mm:
2383         (WebCoreTestSupport::createCFURLResponseFromResponseData): Update to use NSSecureCoding if possible.
2384
2385 2017-10-02  Daniel Bates  <dabates@apple.com>
2386
2387         Use InlineTextBox::lineFont() in more places
2388         https://bugs.webkit.org/show_bug.cgi?id=177749
2389
2390         Reviewed by Zalan Bujtas.
2391
2392         Currently InlineTextBox::paint() calls InlineTextBox::lineFont() to compute the font for the
2393         line and then passes this value to various paint helper functions. The computation is not
2394         expensive and it is sufficient to have the individual paint helper functions compute it
2395         directly. We should have the individual paint helper functions compute it directly. This
2396         will help towards sharing more code throughout InlineTextBox by reducing the noise of
2397         passing the font for the line.
2398
2399         No functionality changed. So, no new tests.
2400
2401         * rendering/InlineTextBox.cpp:
2402         (WebCore::InlineTextBox::paint):
2403         (WebCore::InlineTextBox::paintSelection):
2404         (WebCore::InlineTextBox::paintTextSubrangeBackground):
2405         (WebCore::InlineTextBox::paintCompositionBackground):
2406         (WebCore::InlineTextBox::paintTextMatchMarker):
2407         (WebCore::InlineTextBox::paintDecoration):
2408         (WebCore::InlineTextBox::paintDocumentMarker):
2409         (WebCore::InlineTextBox::paintDocumentMarkers):
2410         * rendering/InlineTextBox.h:
2411
2412 2017-10-02  Basuke Suzuki  <Basuke.Suzuki@sony.com>
2413
2414         [Curl] Implement missing async method in RecourceHandle and make it actually async
2415         https://bugs.webkit.org/show_bug.cgi?id=173964
2416
2417         Reviewed by Alex Christensen.
2418
2419         * platform/network/ResourceHandle.cpp:
2420         (WebCore::ResourceHandle::continueWillSendRequest): Deleted.
2421         (WebCore::ResourceHandle::continueDidReceiveResponse): Deleted.
2422         (WebCore::ResourceHandle::continueCanAuthenticateAgainstProtectionSpace): Deleted.
2423         * platform/network/curl/CurlRequest.cpp:
2424         (WebCore::CurlRequest::start):
2425         (WebCore::CurlRequest::cancel):
2426         (WebCore::CurlRequest::suspend):
2427         (WebCore::CurlRequest::resume):
2428         (WebCore::CurlRequest::didReceiveHeader):
2429         (WebCore::CurlRequest::didReceiveData):
2430         (WebCore::CurlRequest::didCompleteTransfer):
2431         (WebCore::CurlRequest::didCancelTransfer):
2432         (WebCore::CurlRequest::finalizeTransfer):
2433         (WebCore::CurlRequest::invokeDidReceiveResponseForFile):
2434         (WebCore::CurlRequest::invokeDidReceiveResponse):
2435         (WebCore::CurlRequest::completeDidReceiveResponse):
2436         (WebCore::CurlRequest::setRequestPaused):
2437         (WebCore::CurlRequest::setCallbackPaused):
2438         (WebCore::CurlRequest::pausedStatusChanged):
2439         (WebCore::CurlRequest::setPaused): Deleted.
2440         * platform/network/curl/CurlRequest.h:
2441         (WebCore::CurlRequest::needToInvokeDidReceiveResponse const):
2442         (WebCore::CurlRequest::isPaused const):
2443         * platform/network/curl/ResourceHandleCurl.cpp:
2444         (WebCore::ResourceHandle::receivedRequestToContinueWithoutCredential):
2445         (WebCore::ResourceHandle::continueDidReceiveResponse):
2446         (WebCore::ResourceHandle::platformContinueSynchronousDidReceiveResponse):
2447         * platform/network/curl/ResourceHandleCurlDelegate.cpp:
2448         (WebCore::ResourceHandleCurlDelegate::curlDidReceiveResponse):
2449         (WebCore::ResourceHandleCurlDelegate::continueDidReceiveResponse):
2450         (WebCore::ResourceHandleCurlDelegate::platformContinueSynchronousDidReceiveResponse):
2451         (WebCore::ResourceHandleCurlDelegate::continueAfterDidReceiveResponse):
2452         (WebCore::ResourceHandleCurlDelegate::shouldRedirectAsGET):
2453         * platform/network/curl/ResourceHandleCurlDelegate.h:
2454         * platform/network/curl/ResourceResponseCurl.cpp:
2455         (WebCore::ResourceResponse::shouldRedirect):
2456         (WebCore::ResourceResponse::isMovedPermanently const):
2457         (WebCore::ResourceResponse::isFound const):
2458         (WebCore::ResourceResponse::isSeeOther const):
2459         (WebCore::ResourceResponse::isNotModified const):
2460         (WebCore::ResourceResponse::isUnauthorized const):
2461
2462 2017-10-02  Ryosuke Niwa  <rniwa@webkit.org>
2463
2464         PasteImage tests are failing on debug builds
2465         https://bugs.webkit.org/show_bug.cgi?id=177778
2466
2467         Reviewed by Wenson Hsieh.
2468
2469         After r222702, PlatformPasteboard is no longer responsible for adding "Files" as a type"
2470         as DataTransfer takes care of it now. Removed the code to do this from PlatformPasteboardIOS.mm
2471         and PlatformPasteboardMac.mm so that we don't fail assertions in debug builds.
2472
2473         * platform/ios/PlatformPasteboardIOS.mm:
2474         (WebCore::safeTypeForDOMToReadAndWriteForPlatformType):
2475         * platform/mac/PlatformPasteboardMac.mm:
2476         (WebCore::safeTypeForDOMToReadAndWriteForPlatformType):
2477         (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const):
2478
2479 2017-10-02  Daniel Bates  <dabates@apple.com>
2480
2481         No need to truncate text after calling InlineTextBox::text()
2482         https://bugs.webkit.org/show_bug.cgi?id=177748
2483
2484         Reviewed by Zalan Bujtas.
2485
2486         Following r222670 it is no longer necessary to explicitly truncate the text run length
2487         as InlineTextBox::text() returns a text run with respect to the truncation of the text box.
2488
2489         No functionality changed. So, no new tests.
2490
2491         * rendering/InlineTextBox.cpp:
2492         (WebCore::InlineTextBox::paint):
2493
2494 2017-10-02  Antti Koivisto  <antti@apple.com>
2495
2496         Add makeWeakPtr variant that takes pointer
2497         https://bugs.webkit.org/show_bug.cgi?id=177767
2498
2499         Reviewed by Zalan Bujtas.
2500
2501         Use it.
2502
2503         * rendering/SelectionRangeData.h:
2504         (WebCore::SelectionRangeData::Context::Context):
2505
2506 2017-10-02  Antti Koivisto  <antti@apple.com>
2507
2508         Make RenderPtr a type alias of std::unique_ptr
2509         https://bugs.webkit.org/show_bug.cgi?id=177739
2510
2511         Reviewed by Sam Weinig.
2512
2513         It just needs a custom deleter.
2514
2515         * page/FrameView.h:
2516         * rendering/RenderElement.cpp:
2517         (WebCore::RenderElement::insertChildInternal):
2518         * rendering/RenderMultiColumnFlow.cpp:
2519         (WebCore::RenderMultiColumnFlow::fragmentedFlowDescendantInserted):
2520         (WebCore::RenderMultiColumnFlow::handleSpannerRemoval):
2521         * rendering/RenderObject.cpp:
2522         (WebCore::RenderObjectDeleter::operator() const):
2523         (WebCore::RenderObject::willBeDestroyed):
2524         * rendering/RenderPtr.h:
2525         (WebCore::createRenderer):
2526         (WebCore::static_pointer_cast):
2527
2528             Make this safer with downcast.
2529
2530         (WebCore::RenderPtr::RenderPtr): Deleted.
2531         (WebCore::RenderPtr::~RenderPtr): Deleted.
2532         (WebCore::RenderPtr::get const): Deleted.
2533         (WebCore::RenderPtr::operator* const): Deleted.
2534         (WebCore::RenderPtr::operator-> const): Deleted.
2535         (WebCore::RenderPtr::operator! const): Deleted.
2536         (WebCore::RenderPtr::operator UnspecifiedBoolType const): Deleted.
2537         (WebCore::RenderPtr::operator=): Deleted.
2538         (WebCore::RenderPtr::swap): Deleted.
2539         (WebCore::RenderPtr::operator==): Deleted.
2540         (WebCore::RenderPtr::operator!=): Deleted.
2541         (WebCore::RenderPtr<T>::clear): Deleted.
2542         (WebCore::RenderPtr<T>::leakPtr): Deleted.
2543         (WebCore::RenderPtr<T>::RenderPtr): Deleted.
2544         (WebCore::=): Deleted.
2545         (WebCore::swap): Deleted.
2546         (WebCore::operator==): Deleted.
2547         (WebCore::operator!=): Deleted.
2548         (WebCore::getPtr): Deleted.
2549         (WTF::HashTraits<WebCore::RenderPtr<T>>::emptyValue): Deleted.
2550         (WTF::HashTraits<WebCore::RenderPtr<T>>::peek): Deleted.
2551
2552             We already have hash traits for std::unique_ptr.
2553
2554 2017-10-02  Joseph Pecoraro  <pecoraro@apple.com>
2555
2556         Web Inspector: Include Beacon and Ping requests in Network tab
2557         https://bugs.webkit.org/show_bug.cgi?id=177641
2558         <rdar://problem/33086839>
2559
2560         Reviewed by Chris Dumez.
2561
2562         Tests: http/tests/inspector/network/beacon-type.html
2563                http/tests/inspector/network/ping-type.html
2564
2565         * Modules/beacon/NavigatorBeacon.cpp:
2566         (WebCore::NavigatorBeacon::sendBeacon):
2567         Fix a typo.
2568
2569         * loader/PingLoader.cpp:
2570         (WebCore::PingLoader::startPingLoad):
2571         * loader/cache/CachedResource.cpp:
2572         (WebCore::CachedResource::load):
2573         Include InspectorInstrumentation hooks for ping network loads.
2574
2575         * loader/LoaderStrategy.h:
2576         * platform/network/PingHandle.h:
2577         Include an optional ResourceResponse in the ping load completion callback.
2578         If available this will be enough for Web Inspector to include details such
2579         as the response statusCode.
2580
2581         * inspector/InspectorInstrumentation.cpp:
2582         (WebCore::InspectorInstrumentation::willSendRequestOfTypeImpl):
2583         (WebCore::InspectorInstrumentation::continueAfterPingLoaderImpl): Deleted.
2584         * inspector/InspectorInstrumentation.h:
2585         (WebCore::InspectorInstrumentation::willSendRequestOfType):
2586         (WebCore::InspectorInstrumentation::continueAfterPingLoader): Deleted.
2587         * inspector/InspectorNetworkAgent.cpp:
2588         (WebCore::resourceTypeForCachedResource):
2589         (WebCore::resourceTypeForLoadType):
2590         (WebCore::InspectorNetworkAgent::willSendRequest):
2591         (WebCore::InspectorNetworkAgent::willSendRequestOfType):
2592         * inspector/InspectorNetworkAgent.h:
2593         Make a general willSendRequestOfType hook when sending a request that does
2594         not go through normal CachedResource loading. The Ping and Beacon requests
2595         go through this process, we may also use this path for Preflight requests.
2596
2597         * inspector/InspectorPageAgent.cpp:
2598         (WebCore::InspectorPageAgent::resourceTypeJson):
2599         (WebCore::InspectorPageAgent::cachedResourceType):
2600         * inspector/InspectorPageAgent.h:
2601         Small refactoring.
2602
2603 2017-10-02  Zalan Bujtas  <zalan@apple.com>
2604
2605         SelectionRangeData should not hold raw RenderObject pointers
2606         https://bugs.webkit.org/show_bug.cgi?id=177677
2607         <rdar://problem/34763060>
2608
2609         Reviewed by Sam Weinig.
2610
2611         SelectionRangeData::Context start and end renderers' lifetime is not strictly tied
2612         to the lifetime of SelectionRangeData.
2613
2614         Covered by existing tests.
2615
2616         * editing/FrameSelection.cpp:
2617         (WebCore::FrameSelection::updateAppearance):
2618         * platform/DragImage.cpp:
2619         (WebCore::createDragImageForRange):
2620         * rendering/SelectionRangeData.cpp:
2621         (WebCore::isValidRendererForSelection):
2622         (WebCore::collect):
2623         (WebCore::SelectionRangeData::set):
2624         (WebCore::SelectionRangeData::clear):
2625         (WebCore::SelectionRangeData::repaint const):
2626         (WebCore::SelectionRangeData::collectBounds const):
2627         (WebCore::SelectionRangeData::apply):
2628         * rendering/SelectionRangeData.h:
2629         (WebCore::SelectionRangeData::Context::Context):
2630         (WebCore::SelectionRangeData::Context::start const):
2631         (WebCore::SelectionRangeData::Context::end const):
2632         (WebCore::SelectionRangeData::Context::startPosition const):
2633         (WebCore::SelectionRangeData::Context::endPosition const):
2634         (WebCore::SelectionRangeData::Context::operator== const):
2635         (WebCore::SelectionRangeData::start const):
2636         (WebCore::SelectionRangeData::end const):
2637         (WebCore::SelectionRangeData::startPosition const):
2638         (WebCore::SelectionRangeData::endPosition const):
2639
2640 2017-10-02  Olivier Blin  <olivier.blin@softathome.com>
2641
2642         [WPE] Remove GnuTLS dependency
2643         https://bugs.webkit.org/show_bug.cgi?id=177750
2644
2645         Reviewed by Michael Catanzaro.
2646
2647         libgcrypt is used by default instead of GnuTLS.
2648         See bug 163125
2649
2650         * PlatformWPE.cmake:
2651
2652 2017-10-02  Zalan Bujtas  <zalan@apple.com>
2653
2654         Addressing post-review comments after r222621
2655         https://bugs.webkit.org/show_bug.cgi?id=177610
2656
2657         Reviewed by Darin Adler.
2658
2659         * rendering/RenderMenuList.cpp:
2660         (RenderMenuList::didUpdateActiveOption):
2661
2662 2017-10-02  Daniel Bates  <dabates@apple.com>
2663
2664         Remove length argument from TextPainter::paint()
2665         https://bugs.webkit.org/show_bug.cgi?id=177758
2666
2667         Reviewed by Alex Christensen.
2668
2669         Have TextPainter.paint() use the length of the specified TextRun as opposed to
2670         taking an explicit argument for the length of the TextRun.
2671
2672         Following r222670 InlineTextBox creates a TextRun with respect to the truncated
2673         line. Prior to r222670 InlineTextBox did not do this and hence it had to pass both
2674         the TextRun and truncated length to TextPainter.paint() to have the line painted.
2675         Code that needs to paint a substring of a TextRun can still do so by using TextPainter.paintRange().
2676
2677         No functionality changed. So, no new tests.
2678
2679         * rendering/InlineTextBox.cpp:
2680         (WebCore::InlineTextBox::paint):
2681         * rendering/SimpleLineLayoutFunctions.cpp:
2682         (WebCore::SimpleLineLayout::paintFlow):
2683         * rendering/TextPainter.cpp:
2684         (WebCore::TextPainter::paint):
2685         * rendering/TextPainter.h:
2686
2687 2017-10-02  Fujii Hironori  <Hironori.Fujii@sony.com>
2688
2689         [curl] Crashes in CurlRequest::setupPUT()
2690         https://bugs.webkit.org/show_bug.cgi?id=177733
2691
2692         Reviewed by Alex Christensen.
2693
2694         Tests: http/tests/xmlhttprequest/xmlhttprequest-open-method-allowed.html
2695
2696         * platform/network/curl/CurlRequest.cpp:
2697         (WebCore::CurlRequest::setupPUT): Null-check the result of request.httpBody().
2698
2699 2017-10-02  Basuke Suzuki  <Basuke.Suzuki@sony.com>
2700
2701         [CURL] Should handle redirects in WebCore
2702         https://bugs.webkit.org/show_bug.cgi?id=21242
2703
2704         Reviewed by Alex Christensen.
2705
2706         * platform/network/ResourceHandle.cpp:
2707         * platform/network/curl/CurlContext.cpp:
2708         (WebCore::CurlHandle::enableAutoReferer): Deleted.
2709         * platform/network/curl/CurlContext.h:
2710         * platform/network/curl/CurlRequest.cpp:
2711         (WebCore::CurlRequest::setupTransfer):
2712         (WebCore::CurlRequest::didReceiveHeader):
2713         (WebCore::CurlRequest::didReceiveData):
2714         * platform/network/curl/ResourceHandleCurl.cpp:
2715         (WebCore::ResourceHandle::start):
2716         (WebCore::ResourceHandle::continueDidReceiveResponse):
2717         (WebCore::ResourceHandle::continueWillSendRequest):
2718         * platform/network/curl/ResourceHandleCurlDelegate.cpp:
2719         (WebCore::ResourceHandleCurlDelegate::curlDidReceiveResponse):
2720         (WebCore::ResourceHandleCurlDelegate::shouldRedirectAsGET):
2721         (WebCore::ResourceHandleCurlDelegate::willSendRequest):
2722         (WebCore::ResourceHandleCurlDelegate::continueWillSendRequest):
2723         (WebCore::ResourceHandleCurlDelegate::continueAfterWillSendRequest):
2724         * platform/network/curl/ResourceHandleCurlDelegate.h:
2725         * platform/network/curl/ResourceResponse.h:
2726         * platform/network/curl/ResourceResponseCurl.cpp:
2727         (WebCore::ResourceResponse::shouldRedirect):
2728         (WebCore::ResourceResponse::isMovedPermanently const):
2729         (WebCore::ResourceResponse::isFound const):
2730         (WebCore::ResourceResponse::isSeeOther const):
2731         (WebCore::ResourceResponse::isRedirection const): Deleted.
2732
2733 2017-10-02  Antti Koivisto  <antti@apple.com>
2734
2735         Crashes with guard malloc under RenderFullScreen::unwrapRenderer
2736         https://bugs.webkit.org/show_bug.cgi?id=177760
2737
2738         Unreviewed.
2739
2740         * rendering/RenderFullScreen.cpp:
2741         (WebCore::RenderFullScreen::unwrapRenderer):
2742
2743         The assert accesses 'this' after it has been deleted. It is not very valuable so remove the assert.
2744
2745 2017-10-02  Zan Dobersek  <zdobersek@igalia.com>
2746
2747         GraphicsContext: remove unused ENABLE(3D_TRANSFORMS) && USE(TEXTURE_MAPPER)
2748         https://bugs.webkit.org/show_bug.cgi?id=177757
2749
2750         Reviewed by Michael Catanzaro.
2751
2752         Remove three methods from the GraphicsContext class that were conditioned
2753         with the ENABLE(3D_TRANSFORMS) and USE(TEXTURE_MAPPER) guards. These aren't
2754         used anywhere at this point, but apparently used to be in the TextureMapper
2755         implementation.
2756
2757         * platform/graphics/GraphicsContext.h:
2758         * platform/graphics/cairo/GraphicsContextCairo.cpp:
2759         (WebCore::GraphicsContext::get3DTransform const): Deleted.
2760         (WebCore::GraphicsContext::concat3DTransform): Deleted.
2761         (WebCore::GraphicsContext::set3DTransform): Deleted.
2762
2763 2017-10-02  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
2764
2765         [GLib] NetworkStateNotifier implementation missing
2766         https://bugs.webkit.org/show_bug.cgi?id=177741
2767
2768         Reviewed by Carlos Garcia Campos.
2769
2770         No new tests. The DOM support is already being tested, but we would need a way
2771         of simulating a network outage to test GNetworkMonitor.
2772
2773         * PlatformGTK.cmake: add new file.
2774         * PlatformWPE.cmake: add new file.
2775         * platform/network/NetworkStateNotifier.cpp: no longer need the empty implementations, all platforms covered.
2776         * platform/network/NetworkStateNotifier.h:
2777         * platform/network/glib/NetworkStateNotifierGLib.cpp: Added.
2778         (WebCore::NetworkStateNotifier::updateStateWithoutNotifying): update the network state using GNetworkMonitor's availability.
2779         (WebCore::NetworkStateNotifier::networkChangedCallback): when network-changed is emitted, trigger a state update.
2780         (WebCore::NetworkStateNotifier::startObserving): watch GNetworkMonitor's network-changed signal.
2781
2782 2017-10-02  Olivier Blin  <olivier.blin@softathome.com>
2783
2784         Fix build with MathML disabled
2785         https://bugs.webkit.org/show_bug.cgi?id=177744
2786
2787         Reviewed by Michael Catanzaro.
2788
2789         These are regressions from r217549 (StyleResolver) and r221379 (RenderBlockFlow), which do not guard MathML usage.
2790
2791         * css/StyleResolver.cpp:
2792         (WebCore::hasEffectiveDisplayNoneForDisplayContents):
2793         * rendering/RenderBlockFlow.cpp:
2794         (WebCore::RenderBlockFlow::willCreateColumns const):
2795
2796 2017-10-02  Yusuke Suzuki  <utatane.tea@gmail.com>
2797
2798         Use ThreadIdentifier instead of thread::this_thread::get_id
2799         https://bugs.webkit.org/show_bug.cgi?id=177729
2800
2801         Reviewed by Sam Weinig.
2802
2803         We can use WTF::ThreadIdentifier instead of thread::this_thread::get_id
2804         to make use of ThreadIdentifier consistent in WebKit. In the other places,
2805         we use ThreadIdentifier for this debugging purpose. And this is the only
2806         place using thread::this_thread::get_id for the exact same purpose.
2807         Furthermore, thread::this_thread::get_id in Windows platform. So we prefer
2808         using ThreadIdentifier than thread::this_thread::get_id.
2809
2810         * Modules/webdatabase/DatabaseDetails.h:
2811         (WebCore::DatabaseDetails::DatabaseDetails):
2812         (WebCore::DatabaseDetails::threadID const):
2813         * Modules/webdatabase/DatabaseManager.cpp:
2814         (WebCore::DatabaseManager::detailsForNameAndOrigin):
2815
2816 2017-10-02  Antti Koivisto  <antti@apple.com>
2817
2818         Fix memory leaks in RenderMultiColumnFlow
2819         https://bugs.webkit.org/show_bug.cgi?id=177735
2820
2821         Reviewed by Zalan Bujtas.
2822
2823         * rendering/RenderMultiColumnFlow.cpp:
2824         (WebCore::RenderMultiColumnFlow::evacuateAndDestroy):
2825
2826             Switch from destroy() to removeFromParentAndDestroy() (they are currently equivalent in practice).
2827
2828         (WebCore::RenderMultiColumnFlow::fragmentedFlowDescendantInserted):
2829
2830             Destroy the placeholders instead of leaking them.
2831
2832         (WebCore::RenderMultiColumnFlow::handleSpannerRemoval):
2833
2834             Destroy the placeholder instead of leaking it.
2835
2836 2017-10-02  Charles Turner  <cturner@igalia.com>
2837
2838         Try to play AVC codec even if H.264 decoder only advertises byte-stream profile.
2839         https://bugs.webkit.org/show_bug.cgi?id=177550
2840
2841         GStreamer's element factory filters will claim they can't play videos with AVC
2842         codec strings, but the elements really are capable of playing them when filters
2843         like videoconvert are inserted by playbin. Videos of this variety are in the YouTube
2844         2018 EME conformance tests.
2845
2846         Also replace std::array with a stack array, this saves having to count
2847         the number of elements (the compiler does that now) and reduces braces.
2848
2849         Reviewed by Carlos Alberto Lopez Perez.
2850
2851         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
2852         (WebCore::codecSet):
2853
2854 2017-10-02  Tomas Popela  <tpopela@redhat.com>
2855
2856         [SOUP] Default kerberos authentication credentials are used in ephemeral (private) mode
2857         https://bugs.webkit.org/show_bug.cgi?id=177738
2858
2859         Reviewed by Carlos Garcia Campos.
2860
2861         If the session is ephemeral then don't enable the Negotiate support in
2862         our SoupSession.
2863
2864         * platform/network/soup/NetworkStorageSessionSoup.cpp: Pass the
2865         session ID if it's known to the SoupNetworkSession.
2866         (WebCore::NetworkStorageSession::ensurePrivateBrowsingSession):
2867         (WebCore::NetworkStorageSession::getOrCreateSoupNetworkSession const):
2868         * platform/network/soup/SoupNetworkSession.cpp:
2869         (WebCore::SoupNetworkSession::SoupNetworkSession): If the session is
2870         ephemeral (based on given session ID) then don't activate the
2871         Negotiate support in SoupSession.
2872         * platform/network/soup/SoupNetworkSession.h:
2873         Change the constructor to accept the PAL::SessionID with the default
2874         value set to PAL::SessionID::emptySessionID.
2875
2876 2017-10-02  Joanmarie Diggs  <jdiggs@igalia.com>
2877
2878         REGRESSION(r222640) [GTK] Build broken with ATK 2.14
2879         https://bugs.webkit.org/show_bug.cgi?id=177634
2880
2881         Reviewed by Michael Catanzaro.
2882
2883         Use ATK_CHECK_VERSION to prevent the build failure.
2884
2885         No new tests. This fixes a downstream build failure.
2886
2887         * accessibility/atk/AXObjectCacheAtk.cpp:
2888         (WebCore::AXObjectCache::postPlatformNotification):
2889
2890 2017-10-01  Ryosuke Niwa  <rniwa@webkit.org>
2891
2892         Pasteboard shouldn't add "Files" as a type
2893         https://bugs.webkit.org/show_bug.cgi?id=177731
2894
2895         Reviewed by Wenson Hsieh.
2896
2897         Removed the platform specific code to add "Files" when there is a file present in platform's pasteboard.
2898         DataTransfer::types now adds "Files" automatically when Pasteboard::containsFiles returns true.
2899
2900         No new tests since there should be no behavioral change.
2901
2902         * dom/DataTransfer.cpp:
2903         (WebCore::DataTransfer::types const):
2904         * platform/gtk/PasteboardGtk.cpp:
2905         (WebCore::Pasteboard::typesForLegacyUnsafeBindings):
2906         * platform/ios/PasteboardIOS.mm:
2907         (WebCore::Pasteboard::addHTMLClipboardTypesForCocoaType):
2908         * platform/mac/PasteboardMac.mm:
2909         (WebCore::Pasteboard::addHTMLClipboardTypesForCocoaType):
2910         * platform/win/PasteboardWin.cpp:
2911         (WebCore::addMimeTypesForFormat): Removed the code to add "Text" and "URL" as separate types since
2912         this is not what the rest of ports do, and this type normalization is now taken care of by DataTransfer
2913         since r221063.
2914
2915 2017-10-02  Ryosuke Niwa  <rniwa@webkit.org>
2916
2917         Another attempt to fix Windows build after r222697.
2918
2919         * editing/FrameSelection.cpp:
2920         (WebCore::FrameSelection::updateAppearance):
2921         * platform/DragImage.cpp:
2922         (WebCore::createDragImageForRange):
2923         * rendering/SelectionRangeData.cpp:
2924         (WebCore::SelectionRangeData::clear):
2925         * rendering/SelectionRangeData.h:
2926         (WebCore::SelectionRangeData::Context::Context):
2927
2928 2017-10-02  Ryosuke Niwa  <rniwa@webkit.org>
2929
2930         Windows build fix attempt after r222697.
2931
2932         * platform/DragImage.cpp:
2933         (WebCore::createDragImageForRange):
2934
2935 2017-10-02  Ryosuke Niwa  <rniwa@webkit.org>
2936
2937         Merge readFilenames() and read(PasteboardFileReader)
2938         https://bugs.webkit.org/show_bug.cgi?id=177728
2939         <rdar://problem/34761725>
2940
2941         Reviewed by Sam Weinig.
2942
2943         Generalized PasteboardFileReader to return multiple files instead of just one file, and replaced the use
2944         of Pasteboard::readFilenames() with it. Because eliminates the need for finding the list of types to read
2945         as files in addition to file names, this patch also removes Pasteboard::typesTreatedAsFiles().
2946
2947         Note that Pasteboard::readFilenames() continues to exist in macOS and iOS as it's internally used by
2948         Pasteboard::read(PasteboardFileReader) in PasteboardCocoa.mm.
2949
2950         No new tests since there should be no behavioral change.
2951
2952         * dom/DataTransfer.cpp:
2953         (WebCore::DataTransfer::files const): Now makes a single call to Pasteboard::read(PasteboardFileReader)
2954         instead of reading filenames and then falling back to it. Also got rid of if-def for drag drop checks
2955         since forDrag() and forFileDrag() are always defined since r222688.
2956         (WebCore::PasteboardFileTypeReader): Added. Gets the list of all file types.
2957         (WebCore::PasteboardFileTypeReader::readFilename): Added. Gets the list of all file types.
2958         (WebCore::PasteboardFileTypeReader::readBuffer): Added. Gets the list of all file types.
2959         (WebCore::DataTransfer::hasFileOfType): Reimplemented using PasteboardFileTypeReader.
2960         * editing/WebCorePasteboardFileReader.cpp:
2961         (WebCore::WebCorePasteboardFileReader::readFilename): Added.
2962         (WebCore::WebCorePasteboardFileReader::readBuffer): Renamed from read.
2963         * editing/WebCorePasteboardFileReader.h:
2964         * platform/Pasteboard.h:
2965         (WebCore::PasteboardFileReader): Removed the constructor since we no longer specify a specific type to
2966         read off of pasteboard, and renamed the existing read function to readBuffer, and added a new variant
2967         which takes a filename.
2968         * platform/StaticPasteboard.h:
2969         * platform/cocoa/PasteboardCocoa.mm:
2970         (WebCore::imageTypeToFakeFilename): Return "image/png" for ImageType::TIFF (to do TIFF-to-PNG conversion;
2971         see r222656 for why this is needed) now that this function is used to convert directly from image type
2972         converted from cocoa type instead of the one reverse-converted from MIME type.
2973         (WebCore::mimeTypeToImageType): Deleted.
2974         (WebCore::Pasteboard::typesTreatedAsFiles): Deleted.
2975         (WebCore::Pasteboard::typesForLegacyUnsafeBindings): Use newly added readTypesWithSecurityCheck.
2976         (WebCore::convertTIFFToPNG): Extracted out of read(PasteboardFileReader).
2977         (WebCore::Pasteboard::read): Generalized to add filenames as well as image buffers as files. Because now
2978         we're concerting Cocoa types to ImageType, we no longer have to detect when TIFF-as-PNG conversion is
2979         happening here. We just treat ImageType::TIFF as PNG and do the conversion.
2980         (WebCore::Pasteboard::readStringInCustomData): Use newly added readBufferForTypeWithSecurityCheck.
2981         (WebCore::Pasteboard::readTypesWithSecurityCheck): Added.
2982         (WebCore::Pasteboard::readBufferForTypeWithSecurityCheck): Added.
2983         * platform/gtk/PasteboardGtk.cpp:
2984         (WebCore::Pasteboard::read): Implemented.
2985         (WebCore::Pasteboard::typesTreatedAsFiles): Deleted.
2986         (WebCore::Pasteboard::containsFiles): Implemented without calling readFilenames, which has been deleted.
2987         (WebCore::Pasteboard::readFilenames): Deleted.
2988         * platform/win/PasteboardWin.cpp:
2989         (WebCore::Pasteboard::typesTreatedAsFiles): Deleted.
2990         (WebCore::PasteboardFileCounter): Added. Used to counts the number of files in the pasteboard.
2991         (WebCore::PasteboardFileCounter::readFilename):
2992         (WebCore::PasteboardFileCounter::readBuffer):
2993         (WebCore::Pasteboard::containsFiles):
2994         (WebCore::Pasteboard::read): Moved the code to extract filenames out of readFilenames.
2995         (WebCore::Pasteboard::readFilenames): Deleted.
2996         * platform/wpe/PasteboardWPE.cpp:
2997         (WebCore::Pasteboard::typesTreatedAsFiles): Deleted.
2998         (WebCore::Pasteboard::readFilenames): Deleted.
2999
3000 2017-10-01  Sam Weinig  <sam@webkit.org>
3001
3002         [Settings] Move remaining simple settings to Settings.in
3003         https://bugs.webkit.org/show_bug.cgi?id=177730
3004
3005         Reviewed by Darin Adler.
3006
3007         - Adds new option type for Settings.in, 'getter', which allows you to specify
3008           a custom name for the setting's getter. For instance, the setting javaEnabled
3009           has a custom getter name, 'isJavaEnabled'.
3010         - Adds support for WTF::Seconds as a type of setting. Used by only 
3011           timeWithoutMouseMovementBeforeHidingControls at the moment.
3012         - Moves non-generated settings from Settings.h/cpp that don't require custom
3013           action when set, to Settings.in
3014
3015         * Scripts/GenerateSettings/GenerateInternalSettingsImplementationFile.py:
3016         * Scripts/GenerateSettings/GenerateSettingsHeaderFile.py:
3017         * Scripts/GenerateSettings/Settings.py:
3018
3019             Add support for 'getter' and the Seconds type.
3020
3021         * WebCore.xcodeproj/project.pbxproj:
3022         * platform/text/FontRenderingMode.h: Copied from Source/WebCore/platform/text/TextFlags.h.
3023         * platform/text/TextFlags.h:
3024         
3025             Add FontRenderingMode.h. Moved out of TextFlags.h to be accessible by
3026             the settings generator.
3027         
3028         * page/Settings.cpp:
3029         (WebCore::Settings::Settings):
3030         (WebCore::Settings::setJavaEnabled): Deleted.
3031         (WebCore::Settings::setJavaEnabledForLocalFiles): Deleted.
3032         (WebCore::Settings::setPreferMIMETypeForImages): Deleted.
3033         (WebCore::Settings::setForcePendingWebGLPolicy): Deleted.
3034         (WebCore::Settings::setNeedsAdobeFrameReloadingQuirk): Deleted.
3035         (WebCore::Settings::setFontRenderingMode): Deleted.
3036         (WebCore::Settings::fontRenderingMode const): Deleted.
3037         (WebCore::Settings::setShowTiledScrollingIndicator): Deleted.
3038         (WebCore::Settings::setFontFallbackPrefersPictographs): Deleted.
3039         (WebCore::Settings::setWebFontsAlwaysFallBack): Deleted.
3040         * page/Settings.h:
3041         (WebCore::Settings::isJavaEnabled const): Deleted.
3042         (WebCore::Settings::isJavaEnabledForLocalFiles const): Deleted.
3043         (WebCore::Settings::preferMIMETypeForImages const): Deleted.
3044         (WebCore::Settings::needsAcrobatFrameReloadingQuirk const): Deleted.
3045         (WebCore::Settings::showTiledScrollingIndicator const): Deleted.
3046         (WebCore::Settings::setTouchEventEmulationEnabled): Deleted.
3047         (WebCore::Settings::isTouchEventEmulationEnabled const): Deleted.
3048         (WebCore::Settings::setTimeWithoutMouseMovementBeforeHidingControls): Deleted.
3049         (WebCore::Settings::timeWithoutMouseMovementBeforeHidingControls const): Deleted.
3050         (WebCore::Settings::fontFallbackPrefersPictographs const): Deleted.
3051         (WebCore::Settings::webFontsAlwaysFallBack const): Deleted.
3052         (WebCore::Settings::setMediaKeysStorageDirectory): Deleted.
3053         (WebCore::Settings::mediaKeysStorageDirectory const): Deleted.
3054         (WebCore::Settings::setMediaDeviceIdentifierStorageDirectory): Deleted.
3055         (WebCore::Settings::mediaDeviceIdentifierStorageDirectory const): Deleted.
3056         (WebCore::Settings::applePayEnabled const): Deleted.
3057         (WebCore::Settings::setApplePayEnabled): Deleted.
3058         (WebCore::Settings::applePayCapabilityDisclosureAllowed const): Deleted.
3059         (WebCore::Settings::setApplePayCapabilityDisclosureAllowed): Deleted.
3060         (WebCore::Settings::isForcePendingWebGLPolicy const): Deleted.
3061         * page/Settings.in:
3062
3063             Moved hand-written settings to be Settings.in based.
3064
3065 2017-10-01  Zalan Bujtas  <zalan@apple.com>
3066
3067         RenderView does not need to be a SelectionSubtreeRoot
3068         https://bugs.webkit.org/show_bug.cgi?id=177713
3069
3070         Reviewed by Darin Adler and Antti Koivisto.
3071
3072         1. SelectionSubtreeRoot -> SelectionRangeData 
3073         2. Move all selection logic from RenderView to SelectionRangeData
3074         3. class RenderView : public SelectionSubtreeRoot -> SelectionRangeData m_selection;
3075         4. Remove redundant code
3076         5. General modernization
3077  
3078         No change in functionality.
3079
3080         * editing/FrameSelection.cpp:
3081         (WebCore::FrameSelection::setNeedsSelectionUpdate):
3082         (WebCore::DragCaretController::nodeWillBeRemoved):
3083         (WebCore::FrameSelection::respondToNodeModification):
3084         (WebCore::FrameSelection::prepareForDestruction):
3085         (WebCore::FrameSelection::focusedOrActiveStateChanged):
3086         (WebCore::FrameSelection::updateAppearance):
3087         (WebCore::FrameSelection::selectionBounds const):
3088         * page/FrameView.cpp:
3089         (WebCore::FrameView::paintContentsForSnapshot):
3090         * platform/DragImage.cpp:
3091         (WebCore::ScopedFrameSelectionState::ScopedFrameSelectionState):
3092         (WebCore::ScopedFrameSelectionState::~ScopedFrameSelectionState):
3093         (WebCore::createDragImageForRange):
3094         * rendering/InlineTextBox.cpp:
3095         (WebCore::InlineTextBox::selectionState):
3096         (WebCore::InlineTextBox::selectionStartEnd const):
3097         * rendering/RenderBlock.cpp:
3098         (WebCore::RenderBlock::isSelectionRoot const):
3099         * rendering/RenderObject.cpp:
3100         (WebCore::RenderObject::isSelectionBorder const):
3101         * rendering/RenderObject.h:
3102         * rendering/RenderReplaced.cpp:
3103         (WebCore::RenderReplaced::isSelected const):
3104         * rendering/RenderText.cpp:
3105         (WebCore::RenderText::collectSelectionRectsForLineBoxes):
3106         * rendering/RenderTextLineBoxes.cpp:
3107         (WebCore::RenderTextLineBoxes::setSelectionState):
3108         * rendering/RenderView.cpp:
3109         (WebCore::RenderView::RenderView):
3110         (WebCore::SelectionIterator::SelectionIterator): Deleted.
3111         (WebCore::SelectionIterator::current const): Deleted.
3112         (WebCore::SelectionIterator::next): Deleted.
3113         (WebCore::SelectionIterator::checkForSpanner): Deleted.
3114         (WebCore::rendererAfterPosition): Deleted.
3115         (WebCore::RenderView::selectionBounds const): Deleted.
3116         (WebCore::RenderView::subtreeSelectionBounds const): Deleted.
3117         (WebCore::RenderView::repaintSelection const): Deleted.
3118         (WebCore::RenderView::repaintSubtreeSelection const): Deleted.
3119         (WebCore::RenderView::setSelection): Deleted.
3120         (WebCore::isValidObjectForNewSelection): Deleted.
3121         (WebCore::RenderView::clearSubtreeSelection const): Deleted.
3122         (WebCore::RenderView::applySubtreeSelection): Deleted.
3123         (WebCore::RenderView::getSelection const): Deleted.
3124         (WebCore::RenderView::clearSelection): Deleted.
3125         * rendering/RenderView.h:
3126         * rendering/SelectionSubtreeRoot.cpp:
3127         (WebCore::rendererAfterPosition):
3128         (WebCore::SelectionIterator::SelectionIterator):
3129         (WebCore::SelectionIterator::current const):
3130         (WebCore::SelectionIterator::next):
3131         (WebCore::SelectionIterator::checkForSpanner):
3132         (WebCore::SelectionRangeData::SelectionRangeData):
3133         (WebCore::SelectionRangeData::set):
3134         (WebCore::SelectionRangeData::clear):
3135         (WebCore::SelectionRangeData::repaint const):
3136         (WebCore::SelectionRangeData::bounds const):
3137         (WebCore::SelectionRangeData::collectAndClear const):
3138         (WebCore::SelectionRangeData::apply):
3139         (WebCore::SelectionRangeData::isValidRendererForNewSelection const):
3140         (WebCore::SelectionSubtreeRoot::SelectionSubtreeRoot): Deleted.
3141         * rendering/SelectionSubtreeRoot.h:
3142         (WebCore::SelectionRangeData::Context::operator== const):
3143         (WebCore::SelectionRangeData::get const):
3144         (WebCore::SelectionRangeData::start const):
3145         (WebCore::SelectionRangeData::end const):
3146         (WebCore::SelectionRangeData::startPosition const):
3147         (WebCore::SelectionRangeData::endPosition const):
3148         (WebCore::SelectionSubtreeRoot::OldSelectionData::OldSelectionData): Deleted.
3149         (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::SelectionSubtreeData): Deleted.
3150         (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::selectionStart const): Deleted.
3151         (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::selectionStartPos const): Deleted.
3152         (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::selectionEnd const): Deleted.
3153         (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::selectionEndPos const): Deleted.
3154         (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::selectionStartEndPositions const): Deleted.
3155         (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::clearSelection): Deleted.
3156         (WebCore::SelectionSubtreeRoot::selectionData): Deleted.
3157         (WebCore::SelectionSubtreeRoot::selectionData const): Deleted.
3158         (WebCore::SelectionSubtreeRoot::setSelectionData): Deleted.
3159
3160 2017-10-01  Sam Weinig  <sam@webkit.org>
3161
3162         [Settings] Enums should not be passed by const reference
3163         https://bugs.webkit.org/show_bug.cgi?id=177727
3164
3165         Reviewed by Darin Adler.
3166
3167         * Scripts/GenerateSettings/GenerateSettingsImplementationFile.py:
3168         * Scripts/GenerateSettings/GenerateSettingsHeaderFile.py:
3169         (printGetterAndSetter):
3170         
3171             Use the new typeIsAggregate predicate to determine whether to
3172             use const reference or not.
3173         
3174         (includeForSetting): Deleted.
3175
3176             Move includeForSetting to Settings.py with the rest of the Setting
3177             helpers.
3178
3179         * Scripts/GenerateSettings/Settings.py:
3180         (mapToIDLType):
3181         (typeIsPrimitive):
3182         (typeIsAggregate):
3183         
3184             Add predicate to determine if a setting's type is an aggregate (struct or class)
3185             or a primitive. Remove references to size_t, which is not used.
3186
3187 2017-10-01  Sam Weinig  <sam@webkit.org>
3188
3189         Add support for DOM aborting (https://dom.spec.whatwg.org/#aborting-ongoing-activities)
3190         https://bugs.webkit.org/show_bug.cgi?id=177718
3191
3192         Reviewed by Darin Adler.
3193
3194         Adds standalone support for AbortController and AbortSignal. No integration
3195         with other specs yet.
3196
3197         * CMakeLists.txt:
3198         * DerivedSources.make:
3199         * WebCore.xcodeproj/project.pbxproj:
3200         
3201             Add new files.
3202         
3203         * dom/AbortController.cpp: Added.
3204         * dom/AbortController.h: Added.
3205         * dom/AbortController.idl: Added.
3206         * dom/AbortSignal.cpp: Added.
3207         * dom/AbortSignal.h: Added.
3208         * dom/AbortSignal.idl: Added.
3209         
3210             Add basic support AbortController and AbortSignal.
3211         
3212         * dom/EventTargetFactory.in:
3213         
3214             Add AbortSignal to the list of EventTargets.
3215
3216 2017-10-01  Antti Koivisto  <antti@apple.com>
3217
3218         Use WeakPtr for first-letter memory management
3219         https://bugs.webkit.org/show_bug.cgi?id=177716
3220
3221         Reviewed by Darin Adler.
3222
3223         * rendering/RenderElement.cpp:
3224         (WebCore::RenderElement::destroyLeftoverChildren):
3225
3226             Remove first-letter special case.
3227             Use removeAndDestroyChild instead of calling destroy() directly. The latter should
3228             eventually stop calling takeChild and assert that the renderer is not in the tree.
3229
3230         * rendering/RenderTextFragment.cpp:
3231         (WebCore::RenderTextFragment::willBeDestroyed):
3232         (WebCore::RenderTextFragment::setText):
3233         * rendering/RenderTextFragment.h:
3234
3235             Use WeakPtr.
3236
3237 2017-10-01  Sam Weinig  <sam@webkit.org>
3238
3239         XMLHttpRequest's responseXML should be annotated with [Exposed=Window]
3240         https://bugs.webkit.org/show_bug.cgi?id=177714
3241
3242         Reviewed by Darin Adler.
3243
3244         Tests: imported/w3c/web-platform-tests/XMLHttpRequest/responseType-document-in-worker.html
3245                imported/w3c/web-platform-tests/XMLHttpRequest/responseXML-unavailable-in-worker.html
3246
3247         * xml/XMLHttpRequest.cpp:
3248         (WebCore::XMLHttpRequest::responseXML):
3249         
3250             Replace returning null for non-document contexts with an assertion now
3251             that the bindings layer ensures this doesn't get called.
3252         
3253         (WebCore::XMLHttpRequest::setResponseType):
3254         
3255             Match the spec and turn attempts to set a responseType of 'document' in
3256             non-documents contexts as a no-op.
3257         
3258         * xml/XMLHttpRequest.idl:
3259         
3260             Address FIXME and annotate responseXML with [Exposed=Window] now that it
3261             is supported.
3262
3263 2017-09-30  Ryosuke Niwa  <rniwa@webkit.org>
3264
3265         Don't reveal file URL when pasting an image
3266         https://bugs.webkit.org/show_bug.cgi?id=177710
3267         <rdar://problem/34757924>
3268
3269         Reviewed by Wenson Hsieh.
3270
3271         Fixed the bug by generalizing the code we had for drag & drop to hide string types when there is a file.
3272
3273         We don't hide string types when customPasteboardDataEnabled() is false to preserve the backwards compatiblity
3274         with apps that are relying on being able to read files URLs in the pasteboard.
3275
3276         Test: editing/pasteboard/paste-image-does-not-reveal-file-url.html
3277
3278         * dom/DataTransfer.cpp:
3279         (WebCore::DataTransfer::getData const): Pretend there is no string data when there is a file in the pasteboard
3280         custom pasteboard data is enabled.
3281         (WebCore::DataTransfer::setData): Ditto.
3282         (WebCore::DataTransfer::types const): Ditto.
3283         * dom/DataTransfer.h:
3284         (WebCore::DataTransfer::forDrag const): Added for when drag & drop support is disabled at compilation time.
3285         (WebCore::DataTransfer::forFileDrag const): Ditto.
3286         * platform/Pasteboard.h:
3287         * platform/StaticPasteboard.h:
3288         * platform/cocoa/PasteboardCocoa.mm:
3289         (WebCore::Pasteboard::containsFiles): Added.
3290         * platform/gtk/PasteboardGtk.cpp:
3291         (WebCore::Pasteboard::containsFiles): Added.
3292         * platform/win/PasteboardWin.cpp:
3293         (WebCore::Pasteboard::containsFiles): Added.
3294         * platform/wpe/PasteboardWPE.cpp:
3295         (WebCore::Pasteboard::containsFiles): Added.
3296         (WebCore::Pasteboard::readFilenames): Annotated this function with notImplemented().
3297
3298 2017-09-30  Sam Weinig  <sam@webkit.org>
3299
3300         [Settings] Replace SettingsMacros.h with a generated base class for Settings
3301         https://bugs.webkit.org/show_bug.cgi?id=177681
3302
3303         Reviewed by Darin Adler.
3304
3305         - Adds a SettingsGenerated class that Settings inherits from. The new class
3306           has the members and getters/setters for all the generated bindings.
3307         - Some default values for settings are literals in Settings.in, but rather
3308           constants or functions defined externally. These have all been moved to
3309           SettingsDefaultValues.h to allow for the script to include them all for
3310           SettingsGenerated.
3311         - Previously, a few enums were declared in Settings.h for use by Settings.
3312           Now that SettingsGenerated needs access, we standarize the same way that
3313           exists for the IDL generator; expecting the enum to be in a header of the
3314           same name.
3315
3316         * CMakeLists.txt:
3317         * DerivedSources.make:
3318         * WebCore.xcodeproj/project.pbxproj:
3319         * WebCoreMacros.cmake:
3320
3321             Add new files / generation steps.
3322         
3323         * Scripts/GenerateSettings.py:
3324         * Scripts/GenerateSettings/GenerateSettings.py:
3325         * Scripts/GenerateSettings/GenerateSettingsHeaderFile.py: Added.
3326         * Scripts/GenerateSettings/GenerateSettingsImplementationFile.py: Added.
3327         * Scripts/GenerateSettings/GenerateSettingsMacrosHeader.py: Removed.
3328         * Scripts/GenerateSettings/Settings.py:
3329         
3330             Replace script to generate SettingsMacros.h with scripts to generate a SettingsGenerated.{h,cpp}.
3331         
3332         * accessibility/ForcedAccessibilityValue.h: Added.
3333         * editing/EditableLinkBehavior.h: Added.
3334         * editing/EditingBehavior.h:
3335         * editing/EditingBehaviorType.h: Copied from editing/EditingBehaviorTypes.h.
3336         * editing/EditingBehaviorTypes.h: Removed.
3337         * editing/cocoa/DataDetection.h:
3338         * editing/cocoa/DataDetectorTypes.h: Added.
3339         * page/DebugOverlayRegions.h: Added.
3340         * page/FrameFlattening.h: Added.
3341         * page/PDFImageCachingPolicy.h: Added.
3342         * page/TextDirectionSubmenuInclusionBehavior.h: Added.
3343         * page/UserInterfaceDirectionPolicy.h: Added.
3344         * platform/text/TextDirection.h: Added.
3345         * platform/text/WritingMode.h:
3346
3347             Split out enums from Settings.h
3348
3349         * css/MediaQueryEvaluator.cpp:
3350
3351             Update for new name of ForcedAccessibilityValue.
3352
3353         * html/parser/HTMLParserOptions.cpp:
3354
3355             Update for new name of defaultMaximumHTMLParserDOMTreeDepth.
3356
3357         * page/Settings.cpp:
3358         * page/Settings.h:
3359         
3360             - Move defaults to SettingsDefaultValues.h (and SettingsDefaultValuesCocoa.mm for defaultTextAutosizingEnabled).
3361             - Move enums to their own files.
3362             - Inherit from SettingsGenerated.h
3363         
3364         * page/Settings.in:
3365         
3366             - Use new 'include' option for javaScriptRuntimeFlags setting to include <runtime/RuntimeFlags.h>,
3367               as it doesn't fit the normal idiomatic model.
3368             - Replace call to defaultMinimumZoomFontSize() with direct constant access.
3369
3370         * page/SettingsDefaultValues.h: Added.
3371         * page/cocoa/SettingsDefaultValuesCocoa.mm: Added.
3372
3373             Move default values from Settings to this new file.
3374
3375         * page/cocoa/SettingsCocoa.mm:
3376         
3377             Move defaultTextAutosizingEnabled() out of here and into SettingsDefaultValuesCocoa.mm.
3378         
3379         * style/StyleTreeResolver.cpp:
3380
3381             - Update for new scoping of defaultMaximumRenderTreeDepth.
3382             - Move defaultMaximumRenderTreeDepth from Settings here. This is the only use.
3383
3384         * testing/InternalSettings.cpp:
3385         (WebCore::InternalSettings::forcedColorsAreInvertedAccessibilityValue const):
3386         (WebCore::InternalSettings::setForcedColorsAreInvertedAccessibilityValue):
3387         (WebCore::InternalSettings::forcedDisplayIsMonochromeAccessibilityValue const):
3388         (WebCore::InternalSettings::setForcedDisplayIsMonochromeAccessibilityValue):
3389         (WebCore::InternalSettings::forcedPrefersReducedMotionAccessibilityValue const):
3390         (WebCore::InternalSettings::setForcedPrefersReducedMotionAccessibilityValue):
3391         (WebCore::settingsToInternalSettingsValue): Deleted.
3392         (WebCore::internalSettingsToSettingsValue): Deleted.
3393         * testing/InternalSettings.h:
3394         
3395             Replace duplicate definition of ForcedAccessibilityValue with a using declaration
3396             and simplify code now that it doesn't need to map between the two enums.
3397
3398 2017-09-30  Wenson Hsieh  <wenson_hsieh@apple.com>
3399
3400         [iOS WK2] API test EditorStateTests.ContentViewHasTextInContentEditableElement is a flaky failure
3401         https://bugs.webkit.org/show_bug.cgi?id=177698
3402
3403         Reviewed by Ryosuke Niwa.
3404
3405         The WebKit2 API test EditorStateTests.ContentViewHasTextInContentEditableElement is currently hitting
3406         intermittent failures on test runners. After inserting just an image in the editable element, we would expect
3407         that -hasText should return NO because the text content is an empty string, but we find that -hasText is YES.
3408         This is because we're bailing on an early return in computeEditableRootHasContentAndPlainText because the
3409         EditorState's PostLayoutData contains non-zero characters near the selection, which is incorrect.
3410
3411         However, upon closer inspection, this is due to a latent bug in the charactersAroundPosition helper function.
3412         This function attempts to compute characters before and after the current selection by initializing a Vector
3413         of size 3 with the relevant character data, and then sets oneAfter, oneBefore and twoBefore to the UChar32
3414         values in the vector. However, in the case where there are less than three characters, we end up assigning
3415         the uninitialized values in the vector to one or more of oneAfter, oneBefore and twoBefore, which causes the
3416         helper added in r222654 to bail early when it should not.
3417
3418         To fix this, we initialize the values in `characters` to 0 (which is the initial value for the 3 corresponding
3419         members in the PostLayoutData struct). We also turn `characters` into a UChar32 array on the stack, to avoid the
3420         heap allocations using a Vector<UChar32>.
3421
3422         No new tests; fixes a flaky API test.
3423
3424         * editing/VisibleUnits.cpp:
3425         (WebCore::charactersAroundPosition):
3426
3427 2017-09-30  Antti Koivisto  <antti@apple.com>
3428
3429         Add makeWeakPtr for easier WeakPtr construction
3430         https://bugs.webkit.org/show_bug.cgi?id=177706
3431
3432         Reviewed by Sam Weinig.
3433
3434         Use it in render tree.
3435
3436         * loader/SubframeLoader.cpp:
3437         (WebCore::SubframeLoader::loadPlugin):
3438         * page/FrameView.cpp:
3439         (WebCore::FrameView::updateEmbeddedObject):
3440         * rendering/RenderMultiColumnFlow.cpp:
3441         (WebCore::RenderMultiColumnFlow::fragmentedFlowDescendantInserted):
3442         * rendering/RenderObject.h:
3443         (WebCore::RenderObject::weakFactory const):
3444         (WebCore::RenderObject::createWeakPtr): Deleted.
3445         * rendering/RenderView.cpp:
3446         (WebCore::RenderView::RepaintRegionAccumulator::RepaintRegionAccumulator):
3447         * rendering/RenderWidget.cpp:
3448         (WebCore::RenderWidget::setWidgetGeometry):
3449         (WebCore::RenderWidget::setWidget):
3450         (WebCore::RenderWidget::updateWidgetPosition):
3451
3452 2017-09-30  Ryosuke Niwa  <rniwa@webkit.org>
3453
3454         Share more pasteboard code between iOS and macOS and remove dependency on Settings
3455         https://bugs.webkit.org/show_bug.cgi?id=177700
3456
3457         Reviewed by Wenson Hsieh.
3458
3459         Moved more code from PasteboardIOS.mm and PasteboardMac.mm into PasteboardCocoa.mm to share code.
3460
3461         This patch also removes the layering violation inadvertently introduced in r222595 whereby which
3462         Pasteboard code depends on Settings. To do this, this patch splits readStringForBindings is into
3463         readString and readStringInCustomData and typesForBindings into typesSafeForBindings and
3464         typesForLegacyUnsafeBindings, and moves the logic to decide whether a given type or string is read
3465         off of the native pasteboard entry or our custom data entry is moved to DataTransfer.
3466
3467         No new tests since there should be no behavioral change.
3468
3469         * dom/DataTransfer.cpp:
3470         (WebCore::DataTransfer::getData const): Moved the code to decide whether string is
3471         read off of custom data or native pasteboard from readStringForBindings.
3472         (WebCore::DataTransfer::types const): Ditto from typesForBindings.
3473         * platform/Pasteboard.cpp:
3474         (WebCore::Pasteboard::isSafeTypeForDOMToReadAndWrite): Moved into Pasteboard.
3475         * platform/Pasteboard.h:
3476         * platform/StaticPasteboard.cpp:
3477         (WebCore::StaticPasteboard::readString): Renamed from readStringForBindings.
3478         (WebCore::StaticPasteboard::readStringInCustomData): Added.
3479         (WebCore::StaticPasteboard::writeString):
3480         * platform/StaticPasteboard.h:
3481         * platform/cocoa/PasteboardCocoa.mm:
3482         (WebCore::Pasteboard::typesSafeForBindings): Extracted out of typesForBindings in PasteboardIOS.mm
3483         and PasteboardMac.mm.
3484         (WebCore::Pasteboard::typesForLegacyUnsafeBindings): Ditto.
3485         (WebCore::Pasteboard::readString): Ditto.
3486         (WebCore::Pasteboard::readStringInCustomData): Ditto.
3487         (WebCore::Pasteboard::writeCustomData): Moved here from PasteboardIOS.mm and PasteboardCocoa.mm.
3488         (WebCore::Pasteboard::changeCount const): Ditto.
3489         * platform/gtk/PasteboardGtk.cpp:
3490         (WebCore::Pasteboard::typesSafeForBindings): Added.
3491         (WebCore::Pasteboard::typesForLegacyUnsafeBindings): Renamed from readStringForBindings.
3492         (WebCore::Pasteboard::readString):
3493         (WebCore::Pasteboard::readStringInCustomData): Added.
3494         * platform/ios/PasteboardIOS.mm:
3495         (WebCore::Pasteboard::writeCustomData): Moved to PasteboardCocoa.mm.
3496         (WebCore::Pasteboard::changeCount const): Ditto.
3497         (WebCore::Pasteboard::readPlatformValueAsString): Moved into Pasteboard.
3498         (WebCore::Pasteboard::addHTMLClipboardTypesForCocoaType): Ditto.
3499         (WebCore::Pasteboard::readStringForBindings): Moved to PasteboardCocoa.mm.
3500         (WebCore::Pasteboard::typesForBindings): Ditto.
3501         * platform/ios/PlatformPasteboardIOS.mm:
3502         (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const):
3503         * platform/mac/PasteboardMac.mm:
3504         (WebCore::Pasteboard::changeCount const): Moved to PasteboardCocoa.mm.
3505         (WebCore::Pasteboard::writeCustomData): Ditto.
3506         (WebCore::Pasteboard::readPlatformValueAsString): Moved into Pasteboard.
3507         (WebCore::Pasteboard::readStringForBindings): Moved to PasteboardCocoa.mm.
3508         (WebCore::Pasteboard::addHTMLClipboardTypesForCocoaType): Moved into Pasteboard.
3509         (WebCore::Pasteboard::typesForBindings): Moved to PasteboardCocoa.mm.
3510         * platform/mac/PlatformPasteboardMac.mm:
3511         (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const):
3512         * platform/win/PasteboardWin.cpp:
3513         (WebCore::Pasteboard::typesSafeForBindings): Added.
3514         (WebCore::Pasteboard::typesForLegacyUnsafeBindings): Renamed from readStringForBindings.
3515         (WebCore::Pasteboard::readString): Renamed from readStringForBindings.
3516         (WebCore::Pasteboard::readStringInCustomData): Added.
3517         * platform/wpe/PasteboardWPE.cpp:
3518         (WebCore::Pasteboard::typesSafeForBindings): Added.
3519         (WebCore::PasteboardtypesForLegacyUnsafeBindings): Renamed from readStringForBindings.
3520         (WebCore::Pasteboard::readString): Renamed from readStringForBindings.
3521         (WebCore::Pasteboard::readStringInCustomData): Added.
3522
3523 2017-09-29  Antti Koivisto  <antti@apple.com>
3524
3525         Use smart pointers for creating, adding and removing renderers
3526         https://bugs.webkit.org/show_bug.cgi?id=177603
3527
3528         Reviewed by Zalan Bujtas.
3529
3530         With this patch RenderObject ownership is consistently managed using RenderPtrs. It also
3531         clarifies that in-tree renderers are always owned by the parent renderer.
3532
3533         - renderers are constructed with createRenderer<> which returns RenderPtr
3534         - addChild and related functions take RenderPtrs
3535         - removeChild is replaced with takeChild that returns a RenderPtr
3536         - only addChildInternal/takeChildInternal deal with raw ownder renderer pointers.
3537
3538         There are still a few exception left, noted below, to be fixed later.
3539
3540         * dom/Document.cpp:
3541         (WebCore::Document::webkitWillEnterFullScreenForElement):
3542         * rendering/RenderBlock.cpp:
3543         (WebCore::RenderBlock::addChildToContinuation):
3544         (WebCore::RenderBlock::addChild):
3545         (WebCore::RenderBlock::addChildIgnoringContinuation):
3546         (WebCore::RenderBlock::makeChildrenNonInline):
3547         (WebCore::RenderBlock::dropAnonymousBoxChild):
3548         (WebCore::RenderBlock::takeChild):
3549         (WebCore::RenderBlock::createAnonymousBlockWithStyleAndDisplay):
3550         (WebCore::RenderBlock::removeChild): Deleted.
3551         * rendering/RenderBlock.h:
3552         (WebCore::RenderBlock::createAnonymousWithParentRendererAndDisplay):
3553         (WebCore::RenderBlock::createAnonymousBoxWithSameTypeAs const):
3554         (WebCore::RenderBlock::createAnonymousBlock const):
3555         * rendering/RenderBlockFlow.cpp:
3556         (WebCore::RenderBlockFlow::addChild):
3557         (WebCore::RenderBlockFlow::takeChild):
3558         (WebCore::RenderBlockFlow::removeChild): Deleted.
3559         * rendering/RenderBlockFlow.h:
3560         * rendering/RenderBox.cpp:
3561         (WebCore::RenderBox::splitAnonymousBoxesAroundChild):
3562         * rendering/RenderBox.h:
3563         (WebCore::RenderBox::createAnonymousBoxWithSameTypeAs const):
3564         * rendering/RenderBoxModelObject.cpp:
3565         (WebCore::RenderBoxModelObject::moveChildTo):
3566         * rendering/RenderButton.cpp:
3567         (WebCore::RenderButton::addChild):
3568         (WebCore::RenderButton::takeChild):
3569         (WebCore::RenderButton::setText):
3570         (WebCore::RenderButton::removeChild): Deleted.
3571         * rendering/RenderButton.h:
3572         * rendering/RenderElement.cpp:
3573         (WebCore::RenderElement::addChild):
3574         (WebCore::RenderElement::takeChild):
3575         (WebCore::RenderElement::removeAndDestroyChild):
3576         (WebCore::RenderElement::destroyLeftoverChildren):
3577
3578             Keep the existing behavior and leak the firstLetter renderer. The comment claims they get destroyed by RenderTextFragment.
3579             To be cleaned up later.
3580
3581         (WebCore::RenderElement::insertChildInternal):
3582         (WebCore::RenderElement::takeChildInternal):
3583         (WebCore::RenderElement::handleDynamicFloatPositionChange):
3584         (WebCore::RenderElement::removeChild): Deleted.
3585         (WebCore::RenderElement::removeChildInternal): Deleted.
3586         * rendering/RenderElement.h:
3587         (WebCore::RenderElement::addChildIgnoringContinuation):
3588         * rendering/RenderFullScreen.cpp:
3589         (WebCore::RenderFullScreen::willBeDestroyed):
3590         (WebCore::RenderFullScreen::wrapNewRenderer):
3591         (WebCore::RenderFullScreen::wrapExistingRenderer):
3592
3593             Split wrapRenderer() into two functions, wrapNewRenderer() and wrapExistingRenderer().
3594             The first one deals with adding new renderers to the tree while the latter mutates
3595             existing render tree in-place.
3596
3597         (WebCore::RenderFullScreen::unwrapRenderer):
3598         (WebCore::RenderFullScreen::createPlaceholder):
3599         (WebCore::RenderFullScreen::wrapRenderer): Deleted.
3600         * rendering/RenderFullScreen.h:
3601         * rendering/RenderGrid.cpp:
3602         (WebCore::RenderGrid::addChild):
3603         (WebCore::RenderGrid::takeChild):
3604         (WebCore::RenderGrid::removeChild): Deleted.
3605         * rendering/RenderGrid.h:
3606         * rendering/RenderInline.cpp:
3607         (WebCore::RenderInline::addChild):
3608         (WebCore::RenderInline::addChildIgnoringContinuation):
3609         (WebCore::RenderInline::splitInlines):
3610         (WebCore::RenderInline::splitFlow):
3611         (WebCore::RenderInline::addChildToContinuation):
3612         (WebCore::RenderInline::childBecameNonInline):
3613         * rendering/RenderInline.h:
3614         * rendering/RenderMenuList.cpp:
3615         (WebCore::RenderMenuList::createInnerBlock):
3616         (RenderMenuList::addChild):
3617         (RenderMenuList::takeChild):
3618         (RenderMenuList::setText):
3619         (RenderMenuList::removeChild): Deleted.
3620         * rendering/RenderMenuList.h:
3621         * rendering/RenderMultiColumnFlow.cpp:
3622         (WebCore::RenderMultiColumnFlow::evacuateAndDestroy):
3623         (WebCore::RenderMultiColumnFlow::processPossibleSpannerDescendant):
3624         (WebCore::RenderMultiColumnFlow::fragmentedFlowDescendantInserted):
3625
3626             Keep the existing behavior and leak the placeholder renderer.
3627             To be cleaned up later.
3628
3629         (WebCore::RenderMultiColumnFlow::handleSpannerRemoval):
3630
3631             Keep the existing behavior and leak the placeholder renderer.
3632             To be cleaned up later.
3633
3634         * rendering/RenderMultiColumnSpannerPlaceholder.cpp:
3635         (WebCore::RenderMultiColumnSpannerPlaceholder::createAnonymous):
3636         * rendering/RenderMultiColumnSpannerPlaceholder.h:
3637         * rendering/RenderObject.cpp:
3638         (WebCore::RenderObject::removeFromParentAndDestroy):
3639         (WebCore::RenderObject::willBeDestroyed):
3640         (WebCore::RenderObject::destroy):
3641         (WebCore::RenderObject::removeFromParent): Deleted.
3642         * rendering/RenderObject.h:
3643         * rendering/RenderQuote.cpp:
3644         (WebCore::RenderQuote::updateTextRenderer):
3645         * rendering/RenderRuby.cpp:
3646         (WebCore::createAnonymousRubyInlineBlock):
3647         (WebCore::RenderRubyAsInline::addChild):
3648         (WebCore::RenderRubyAsInline::takeChild):
3649         (WebCore::RenderRubyAsBlock::addChild):
3650         (WebCore::RenderRubyAsBlock::takeChild):
3651         (WebCore::RenderRubyAsInline::removeChild): Deleted.
3652         (WebCore::RenderRubyAsBlock::removeChild): Deleted.
3653         * rendering/RenderRuby.h:
3654         * rendering/RenderRubyBase.cpp:
3655         (WebCore::RenderRubyBase::moveInlineChildren):
3656         * rendering/RenderRubyRun.cpp:
3657         (WebCore::RenderRubyRun::rubyBaseSafe):
3658         (WebCore::RenderRubyRun::addChild):
3659         (WebCore::RenderRubyRun::takeChild):
3660         (WebCore::RenderRubyRun::createRubyBase const):
3661         (WebCore::RenderRubyRun::staticCreateRubyRun):
3662         (WebCore::RenderRubyRun::removeChild): Deleted.
3663         * rendering/RenderRubyRun.h:
3664         * rendering/RenderTable.cpp:
3665         (WebCore::RenderTable::addChild):
3666         (WebCore::RenderTable::createTableWithStyle):
3667         (WebCore::RenderTable::createAnonymousWithParentRenderer):
3668         * rendering/RenderTable.h:
3669         (WebCore::RenderTable::createAnonymousBoxWithSameTypeAs const):
3670         * rendering/RenderTableCell.cpp:
3671         (WebCore::RenderTableCell::createTableCellWithStyle):
3672         (WebCore::RenderTableCell::createAnonymousWithParentRenderer):
3673         * rendering/RenderTableCell.h:
3674         (WebCore::RenderTableCell::createAnonymousBoxWithSameTypeAs const):
3675         * rendering/RenderTableRow.cpp:
3676         (WebCore::RenderTableRow::addChild):
3677         (WebCore::RenderTableRow::createTableRowWithStyle):
3678         (WebCore::RenderTableRow::createAnonymousWithParentRenderer):
3679         * rendering/RenderTableRow.h:
3680         (WebCore::RenderTableRow::createAnonymousBoxWithSameTypeAs const):
3681         * rendering/RenderTableSection.cpp:
3682         (WebCore::RenderTableSection::addChild):
3683         (WebCore::RenderTableSection::createTableSectionWithStyle):
3684         (WebCore::RenderTableSection::createAnonymousWithParentRenderer):
3685         * rendering/RenderTableSection.h:
3686         (WebCore::RenderTableSection::createAnonymousBoxWithSameTypeAs const):
3687         * rendering/mathml/RenderMathMLFenced.cpp:
3688         (WebCore::RenderMathMLFenced::makeFences):
3689         (WebCore::RenderMathMLFenced::addChild):
3690         * rendering/mathml/RenderMathMLFenced.h:
3691         * rendering/svg/RenderSVGContainer.cpp:
3692         (WebCore::RenderSVGContainer::addChild):
3693         (WebCore::RenderSVGContainer::takeChild):
3694         (WebCore::RenderSVGContainer::removeChild): Deleted.
3695         * rendering/svg/RenderSVGContainer.h:
3696         * rendering/svg/RenderSVGInline.cpp:
3697         (WebCore::RenderSVGInline::addChild):
3698         (WebCore::RenderSVGInline::takeChild):
3699         (WebCore::RenderSVGInline::removeChild): Deleted.
3700         * rendering/svg/RenderSVGInline.h:
3701         * rendering/svg/RenderSVGRoot.cpp:
3702         (WebCore::RenderSVGRoot::addChild):
3703         (WebCore::RenderSVGRoot::takeChild):
3704         (WebCore::RenderSVGRoot::removeChild): Deleted.
3705         * rendering/svg/RenderSVGRoot.h:
3706         * rendering/svg/RenderSVGText.cpp:
3707         (WebCore::RenderSVGText::addChild):
3708         (WebCore::RenderSVGText::takeChild):
3709         (WebCore::RenderSVGText::removeChild): Deleted.
3710         * rendering/svg/RenderSVGText.h:
3711         * style/RenderTreePosition.h:
3712         (WebCore::RenderTreePosition::insert):
3713         * style/RenderTreeUpdater.cpp:
3714         (WebCore::RenderTreeUpdater::createRenderer):
3715         (WebCore::createTextRenderer):
3716         * style/RenderTreeUpdaterFirstLetter.cpp:
3717         (WebCore::updateFirstLetterStyle):
3718         (WebCore::createFirstLetterRenderer):
3719         * style/RenderTreeUpdaterGeneratedContent.cpp:
3720         (WebCore::createContentRenderers):
3721         * style/RenderTreeUpdaterListItem.cpp:
3722         (WebCore::RenderTreeUpdater::ListItem::updateMarker):
3723         * style/RenderTreeUpdaterMultiColumn.cpp:
3724         (WebCore::RenderTreeUpdater::MultiColumn::createFragmentedFlow):
3725
3726 2017-09-29  Zalan Bujtas  <zalan@apple.com>
3727
3728         Remove redundant RenderObject::selectionRoot and dependencies
3729         https://bugs.webkit.org/show_bug.cgi?id=177696
3730
3731         Reviewed by Ryosuke Niwa.
3732
3733         There's only one selection root (RenderView).
3734
3735         * rendering/InlineTextBox.cpp:
3736         (WebCore::InlineTextBox::selectionState):
3737         (WebCore::InlineTextBox::selectionStartEnd const):
3738         * rendering/RenderObject.cpp:
3739         (WebCore::RenderObject::selectionRoot const): Deleted.
3740         (WebCore::RenderObject::selectionStartEnd const): Deleted.
3741         * rendering/RenderObject.h:
3742         * rendering/RenderReplaced.cpp:
3743         (WebCore::RenderReplaced::isSelected const):
3744         * rendering/RenderText.cpp:
3745         (WebCore::RenderText::collectSelectionRectsForLineBoxes):
3746         * rendering/RenderTextLineBoxes.cpp:
3747         (WebCore::RenderTextLineBoxes::setSelectionState):
3748         * rendering/RenderView.h:
3749         * rendering/SelectionSubtreeRoot.h:
3750
3751 2017-09-29  Chris Dumez  <cdumez@apple.com>
3752
3753         http/tests/preconnect/link-rel-preconnect-https.html is flaky
3754         https://bugs.webkit.org/show_bug.cgi?id=177673
3755
3756         Reviewed by Alex Christensen.
3757
3758         No new tests, unskipped test that is now passing consistently.
3759
3760         * loader/LinkLoader.cpp:
3761         (WebCore::LinkLoader::loadLink):
3762         * loader/LoaderStrategy.h:
3763
3764 2017-09-29  Daniel Bates  <dabates@apple.com>
3765
3766         Extract logic to compute text to render into common function
3767         https://bugs.webkit.org/show_bug.cgi?id=177607
3768
3769         Reviewed by Zalan Bujtas.
3770
3771         Currently we duplicate the logic to compute the text to render
3772         throughout InlineTextBox. Instead we should move this common
3773         code into a member function. This will allow us to audit the
3774         the code paths that render text and ensure such code paths
3775         account for hyphenation and combined text, if applicable.
3776
3777         Note that a TextRun does not own the text. The caller owns it.
3778
3779         No functionality changed. So, no new tests.
3780
3781         * rendering/InlineTextBox.cpp:
3782         (WebCore::InlineTextBox::localSelectionRect const): Modified to
3783         use text() and createTextRun() to compute the text to render
3784         and the text run for it.
3785         (WebCore::InlineTextBox::paint): Ditto.
3786         (WebCore::InlineTextBox::paintSelection): Ditto. Additionally query
3787         lineStyle() for the style of the line instead of requiring it to be
3788         passed as an argument.
3789         (WebCore::InlineTextBox::paintTextSubrangeBackground): Modified
3790         to use text() and createTextRun() to compute the text to render
3791         and the text run for it.
3792         (WebCore::InlineTextBox::paintDocumentMarker): Ditto.
3793         (WebCore::InlineTextBox::offsetForPosition const): Ditto.
3794         (WebCore::InlineTextBox::positionForOffset const): Ditto.
3795         (WebCore::InlineTextBox::createTextRun const): Added; formerly named constructTextRun.
3796         (WebCore::InlineTextBox::text const): Added.
3797         (WebCore::InlineTextBox::substringToRender const): Deleted.
3798         (WebCore::InlineTextBox::hyphenatedStringForTextRun const): Deleted.
3799         (WebCore::InlineTextBox::constructTextRun const): Deleted.
3800         * rendering/InlineTextBox.h:
3801         (WebCore::InlineTextBox::substringToRender): Deleted.
3802         (WebCore::InlineTextBox::hyphenatedStringForTextRun): Deleted.
3803         (WebCore::InlineTextBox::constructTextRun): Deleted; renamed to createTextRun.
3804
3805 2017-09-29  Zalan Bujtas  <zalan@apple.com>
3806
3807         Remove SelectionSubtreeRoot::RenderSubtreesMap
3808         https://bugs.webkit.org/show_bug.cgi?id=177685
3809
3810         Reviewed by Andy Estes.
3811
3812         This is in preparation of removing redundant SelectionSubtreeRoot.
3813         (Now that we removed regions, RenderView is the only selection root) 
3814
3815         No change in functionality.
3816
3817         * rendering/RenderView.cpp:
3818         (WebCore::RenderView::selectionBounds const):
3819         (WebCore::RenderView::subtreeSelectionBounds const):
3820         (WebCore::RenderView::repaintSelection const):
3821         (WebCore::RenderView::repaintSubtreeSelection const):
3822         (WebCore::RenderView::setSelection):
3823         (WebCore::isValidObjectForNewSelection):
3824         (WebCore::RenderView::clearSubtreeSelection const):
3825         (WebCore::RenderView::applySubtreeSelection):
3826         (WebCore::RenderView::updateSelectionForSubtrees): Deleted.
3827         * rendering/RenderView.h:
3828         * rendering/SelectionSubtreeRoot.h:
3829
3830 2017-09-29  Basuke Suzuki  <Basuke.Suzuki@sony.com>
3831
3832         [Curl] Extract a features to manage HTTP communication from ResourceHandle
3833         https://bugs.webkit.org/show_bug.cgi?id=175148
3834
3835         Reviewed by Alex Christensen.
3836
3837         * platform/Curl.cmake:
3838         * platform/network/curl/CurlRequest.cpp: Added.
3839         (WebCore::CurlRequest::CurlRequest):
3840         (WebCore::CurlRequest::setUserPass):
3841         (WebCore::CurlRequest::start):
3842         (WebCore::CurlRequest::startWithJobManager):
3843         (WebCore::CurlRequest::cancel):
3844         (WebCore::CurlRequest::suspend):
3845         (WebCore::CurlRequest::resume):
3846         (WebCore::CurlRequest::callDelegate):
3847         (WebCore::CurlRequest::setupTransfer):
3848         (WebCore::CurlRequest::willSetupSslCtx):
3849         (WebCore::CurlRequest::willSendData):
3850         (WebCore::CurlRequest::didReceiveHeader):
3851         (WebCore::CurlRequest::didReceiveData):
3852         (WebCore::CurlRequest::didCompleteTransfer):
3853         (WebCore::CurlRequest::didCancelTransfer):
3854         (WebCore::CurlRequest::resolveBlobReferences):
3855         (WebCore::CurlRequest::setupPUT):
3856         (WebCore::CurlRequest::setupPOST):
3857         (WebCore::CurlRequest::setupFormData):
3858         (WebCore::CurlRequest::invokeDidReceiveResponseForFile):
3859         (WebCore::CurlRequest::invokeDidReceiveResponse):
3860         (WebCore::CurlRequest::setPaused):
3861         (WebCore::CurlRequest::willSetupSslCtxCallback):
3862         (WebCore::CurlRequest::willSendDataCallback):
3863         (WebCore::CurlRequest::didReceiveHeaderCallback):
3864         (WebCore::CurlRequest::didReceiveDataCallback):
3865         * platform/network/curl/CurlRequest.h: Added.
3866         (WebCore::CurlRequest::~CurlRequest):
3867         (WebCore::CurlRequest::setDelegate):
3868         (WebCore::CurlRequest::isSyncRequest):
3869         (WebCore::CurlRequest::getNetworkLoadMetrics):
3870         * platform/network/curl/CurlRequestDelegate.h: Added.
3871         * platform/network/curl/ResourceHandleCurl.cpp:
3872         (WebCore::ResourceHandle::cancel):
3873         (WebCore::ResourceHandle::platformSetDefersLoading):
3874         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
3875         (WebCore::ResourceHandle::receivedCredential):
3876         (WebCore::ResourceHandle::receivedRequestToContinueWithoutCredential):
3877         (WebCore::ResourceHandle::receivedCancellation):
3878         * platform/network/curl/ResourceHandleCurlDelegate.cpp:
3879         (WebCore::ResourceHandleCurlDelegate::ResourceHandleCurlDelegate):
3880         (WebCore::ResourceHandleCurlDelegate::~ResourceHandleCurlDelegate):
3881         (WebCore::ResourceHandleCurlDelegate::start):
3882         (WebCore::ResourceHandleCurlDelegate::cancel):
3883         (WebCore::ResourceHandleCurlDelegate::setDefersLoading):
3884         (WebCore::ResourceHandleCurlDelegate::setAuthentication):
3885         (WebCore::ResourceHandleCurlDelegate::dispatchSynchronousJob):
3886         (WebCore::ResourceHandleCurlDelegate::createCurlRequest):
3887         (WebCore::ResourceHandleCurlDelegate::cancelledOrClientless):
3888         (WebCore::ResourceHandleCurlDelegate::curlDidReceiveResponse):
3889         (WebCore::ResourceHandleCurlDelegate::curlDidReceiveBuffer):
3890         (WebCore::ResourceHandleCurlDelegate::curlDidComplete):
3891         (WebCore::ResourceHandleCurlDelegate::curlDidFailWithError):
3892         (WebCore::ResourceHandleCurlDelegate::response):
3893         (WebCore::ResourceHandleCurlDelegate::getCredential):
3894         (WebCore::ResourceHandleCurlDelegate::retain): Deleted.
3895         (WebCore::ResourceHandleCurlDelegate::release): Deleted.
3896         (WebCore::ResourceHandleCurlDelegate::setupTransfer): Deleted.
3897         (WebCore::ResourceHandleCurlDelegate::didCompleteTransfer): Deleted.
3898         (WebCore::ResourceHandleCurlDelegate::didCancelTransfer): Deleted.
3899         (WebCore::ResourceHandleCurlDelegate::setupAuthentication): Deleted.
3900         (WebCore::ResourceHandleCurlDelegate::didReceiveAllHeaders): Deleted.
3901         (WebCore::ResourceHandleCurlDelegate::didReceiveContentData): Deleted.
3902         (WebCore::ResourceHandleCurlDelegate::handleLocalReceiveResponse): Deleted.
3903         (WebCore::ResourceHandleCurlDelegate::prepareSendData): Deleted.
3904         (WebCore::ResourceHandleCurlDelegate::didFinish): Deleted.
3905         (WebCore::ResourceHandleCurlDelegate::didFail): Deleted.
3906         (WebCore::ResourceHandleCurlDelegate::setupPOST): Deleted.
3907         (WebCore::ResourceHandleCurlDelegate::setupPUT): Deleted.
3908         (WebCore::ResourceHandleCurlDelegate::getFormElementsCount): Deleted.
3909         (WebCore::ResourceHandleCurlDelegate::setupFormData): Deleted.
3910         (WebCore::ResourceHandleCurlDelegate::applyAuthentication): Deleted.
3911         (WebCore::ResourceHandleCurlDelegate::getNetworkLoadMetrics): Deleted.
3912         (WebCore::ResourceHandleCurlDelegate::willSetupSslCtx): Deleted.
3913         (WebCore::ResourceHandleCurlDelegate::didReceiveHeader): Deleted.
3914         (WebCore::ResourceHandleCurlDelegate::didReceiveData): Deleted.
3915         (WebCore::ResourceHandleCurlDelegate::willSendData): Deleted.
3916         (WebCore::ResourceHandleCurlDelegate::willSetupSslCtxCallback): Deleted.
3917         (WebCore::ResourceHandleCurlDelegate::didReceiveHeaderCallback): Deleted.
3918         (WebCore::ResourceHandleCurlDelegate::didReceiveDataCallback): Deleted.
3919         (WebCore::ResourceHandleCurlDelegate::willSendDataCallback): Deleted.
3920         * platform/network/curl/ResourceHandleCurlDelegate.h:
3921
3922 2017-09-29  Chris Dumez  <cdumez@apple.com>
3923
3924         Split some logic out of VisitedLinkStore and make it reusable
3925         https://bugs.webkit.org/show_bug.cgi?id=177575
3926
3927         Reviewed by Alex Christensen.
3928
3929         Rename LinkHash to SharedStringHash to make it more reusable.
3930
3931         * CMakeLists.txt:
3932         * WebCore.xcodeproj/project.pbxproj:
3933         * css/StyleResolver.cpp:
3934         * dom/VisitedLinkState.cpp:
3935         (WebCore::linkHashForElement):
3936         (WebCore::VisitedLinkState::invalidateStyleForLink):
3937         (WebCore::VisitedLinkState::determineLinkStateSlowCase):
3938         * dom/VisitedLinkState.h:
3939         * html/HTMLAnchorElement.h:
3940         (WebCore::HTMLAnchorElement::visitedLinkHash const):
3941         * loader/EmptyClients.cpp:
3942         * loader/HistoryController.cpp:
3943         (WebCore::addVisitedLink):
3944         * page/Page.cpp:
3945         (WebCore::Page::invalidateStylesForLink):
3946         * page/Page.h:
3947         * page/VisitedLinkStore.cpp:
3948         (WebCore::VisitedLinkStore::invalidateStylesForLink):
3949         * page/VisitedLinkStore.h:
3950         * platform/SharedStringHash.cpp: Renamed from Source/WebCore/platform/LinkHash.cpp.
3951         (WebCore::needsTrailingSlash):
3952         (WebCore::computeSharedStringHashInline):
3953         (WebCore::computeSharedStringHash):
3954         * platform/SharedStringHash.h: Renamed from Source/WebCore/platform/LinkHash.h.
3955         (WebCore::SharedStringHashHash::hash):
3956         (WebCore::SharedStringHashHash::equal):
3957         (WebCore::SharedStringHashHash::avoidDeletedValue):
3958
3959 2017-09-29  Don Olmstead  <don.olmstead@sony.com>
3960
3961         [WinCairo] Fix build after rev 222610
3962         https://bugs.webkit.org/show_bug.cgi?id=177674
3963
3964         Reviewed by Per Arne Vollan.
3965
3966         No new tests. No change in behavior.
3967
3968         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
3969
3970 2017-09-29  Wenson Hsieh  <wenson_hsieh@apple.com>
3971
3972         [iOS] Remove unused pre-iOS 11 codepaths for writing to the pasteboard
3973         https://bugs.webkit.org/show_bug.cgi?id=177669
3974
3975         Reviewed by Tim Horton.
3976
3977         Now that PlatformPasteboardIOS codepaths for writing data on drag and copy have been unified to both use
3978         NSItemProviders, we can remove the legacy codepath that called -setItems on UIPasteboard, since nothing uses it
3979         any more.