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