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