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