2022dd267c21de9143270cadba973d89de144d5e
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-07-12  Matt Lewis  <jlewis3@apple.com>
2
3         Unreviewed, rolling out r219401.
4
5         This revision rolled out the previous patch, but after talking
6         with reviewer, a rebaseline is what was needed.Rolling back in
7         before rebaseline.
8
9         Reverted changeset:
10
11         "Unreviewed, rolling out r219379."
12         https://bugs.webkit.org/show_bug.cgi?id=174400
13         http://trac.webkit.org/changeset/219401
14
15 2017-07-12  Matt Lewis  <jlewis3@apple.com>
16
17         Unreviewed, rolling out r219379.
18
19         This revision caused a consistent failure in the test
20         fast/dom/Window/property-access-on-cached-window-after-frame-
21         removed.html.
22
23         Reverted changeset:
24
25         "Remove NAVIGATOR_HWCONCURRENCY"
26         https://bugs.webkit.org/show_bug.cgi?id=174400
27         http://trac.webkit.org/changeset/219379
28
29 2017-07-12  Zalan Bujtas  <zalan@apple.com>
30
31         Paginated mode: Infinite recursion in RenderTable::layout
32         https://bugs.webkit.org/show_bug.cgi?id=174413
33
34         Reviewed by Simon Fraser.
35
36         This patch is a workaround for avoiding infinite recursion when the table layout does not stabilize.
37         Apparently we leak some context (computed padding in this case) from the current to the subsequent layout.
38         The subsequent layouts always end up producing different line heights for some of the cells in the <thead>.
39         In paginated mode, when the section moves (<thead>, <tbody> etc) we call layout again recursively.
40         This could lead to infinite recursion for unstable table layout.
41
42         Unable to come up with a reduction yet.
43
44         * rendering/RenderTable.cpp:
45         (WebCore::RenderTable::layout):
46         * rendering/RenderTable.h:
47
48 2017-07-12  Youenn Fablet  <youenn@apple.com>
49
50         WebRTC: Incorrect sdpMLineIndex for video breaks Firefox interop
51         https://bugs.webkit.org/show_bug.cgi?id=173530
52
53         Reviewed by Alex Christensen.
54
55         Test: webrtc/ice-candidate-sdpMLineIndex.html
56
57         Reading missing parameter from libwebrtc backend and setting it when firing the RTCIceCandidate event.
58
59         * Modules/mediastream/PeerConnectionBackend.cpp:
60         (WebCore::PeerConnectionBackend::disableICECandidateFiltering):
61         (WebCore::PeerConnectionBackend::newICECandidate):
62         * Modules/mediastream/PeerConnectionBackend.h:
63         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
64         (WebCore::LibWebRTCMediaEndpoint::OnIceCandidate):
65
66 2017-07-12  Zan Dobersek  <zdobersek@igalia.com>
67
68         [GCrypt] Implement CryptoKeyEC PKCS#8 exports
69         https://bugs.webkit.org/show_bug.cgi?id=173648
70
71         Reviewed by Jiewen Tan.
72
73         Implement the PKCS#8 export operation for EC keys for platforms that use
74         libgcrypt.
75
76         First, the `ECParameters` and the `ECPrivateKey` ASN.1 structures are created
77         and filled out accordingly. For the former, the appropriate object identifier
78         is written under the `namedCurve` element of the structure. For the latter, we
79         write out '1' under `version`, and eliminate the optional `parameters` element.
80         An libgcrypt EC context is then used to retrieve the private and public key
81         MPIs that are then written out under the `privateKey` and `publicKey` elements,
82         respectively.
83
84         After that, we can proceed to create and fill out the `PrivateKeyInfo` structure.
85         0 is written out under the `version` element, and the id-ecPublicKey object
86         identifier is written out under the `privateKeyAlgorithm.algorithm` element. This
87         doesn't strictly follow the specification, since the id-ecDH identifier should be
88         used for ECDH keys, but no test in WebKit or the web-platform-tests suite covers
89         this, so this specific detail should be revisited later.
90
91         Data of the previously-constructed `ECParameters` structure is retrieved and
92         written out under the `privateKeyAlgorithm.parameters` element. Similarly is done
93         for the `ECPrivateKey` structure, writing out its data under the `privateKey`
94         element. Finally, the optional `attributes` element of the `PrivateKeyInfo`
95         structure is eliminated, and the encoded data of this structure is retrieved and
96         returned.
97
98         No new tests -- relevant tests are now passing and are unskipped.
99
100         * crypto/gcrypt/CryptoKeyECGCrypt.cpp:
101         (WebCore::CryptoKeyEC::platformExportPkcs8):
102
103 2017-07-12  Zan Dobersek  <zdobersek@igalia.com>
104
105         [WPE] Use libepoxy
106         https://bugs.webkit.org/show_bug.cgi?id=172104
107
108         Reviewed by Michael Catanzaro.
109
110         No new tests -- no changes in behavior.
111
112         Implement the proper libepoxy header inclusion for ports that enable it.
113
114         The library acts as a loading facility working on top of the system-provided
115         OpenGL and EGL libraries, with the headers providing a complete collection of
116         specification-defined OpenGL and EGL types, constants and entrypoints.
117
118         Support is added through the USE(LIBEPOXY) build guard. Note that this guard
119         isn't exclusive with USE(OPENGL), USE(OPENGL_ES_2) or USE(EGL), so the
120         USE(LIBEPOXY) condition is tested before those.
121
122         In case of OpenGL headers, the <epoxy/gl.h> header is included, and in
123         case of EGL headers, the <epoxy/egl.h> header. <epoxy/egl.h> includes
124         <epoxy/gl.h> on its own, so in some cases the inclusion of the latter is
125         omitted.
126
127         EpoxyShims.h header is added, doing a job similar to OpenGLESShims.h. The
128         EXT-suffixed GL entrypoints are redefined to the non-suffixed versions.
129         No suffixed constants are defined because those are defined by the libepoxy
130         headers to the well-known values.
131
132         * CMakeLists.txt:
133         * PlatformWPE.cmake:
134         * platform/graphics/ANGLEWebKitBridge.h:
135         * platform/graphics/EpoxyShims.h: Added.
136         * platform/graphics/GLContext.cpp:
137         (WebCore::initializeOpenGLShimsIfNeeded):
138         * platform/graphics/GraphicsContext3DPrivate.cpp:
139         * platform/graphics/PlatformDisplay.cpp:
140         * platform/graphics/cairo/CairoUtilities.cpp:
141         * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
142         (WebCore::GraphicsContext3D::create):
143         * platform/graphics/cairo/ImageBufferCairo.cpp:
144         * platform/graphics/egl/GLContextEGL.cpp:
145         * platform/graphics/egl/GLContextEGLWPE.cpp:
146         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
147         * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
148         * platform/graphics/opengl/Extensions3DOpenGLES.cpp:
149         * platform/graphics/opengl/Extensions3DOpenGLES.h:
150         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
151         * platform/graphics/opengl/TemporaryOpenGLSetting.cpp:
152         * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.cpp:
153         * platform/graphics/wpe/PlatformDisplayWPE.cpp:
154
155 2017-07-12  Carlos Garcia Campos  <cgarcia@igalia.com>
156
157         ImageDecoder: Gifs with infinite animation only play once very often
158         https://bugs.webkit.org/show_bug.cgi?id=173403
159
160         Reviewed by Michael Catanzaro.
161
162         It doesn't always happen, it's easier to reproduce when loading big files from the network, but it also depends
163         on every file. The problem is that ImageFrameCache is caching the repetition count value always when the size is
164         already available. In the case of gif files, the loop count value can be at any point of the image stream, so
165         having the size available doesn't mean we also have the loop count. So, if the value is queried before it's
166         available, the default value is cached (repeat once) and then always used. We should clear the cached value when
167         new data is added to the decoder, like we do with other cached values that can change when more data is decoded.
168
169         * platform/graphics/ImageFrameCache.cpp:
170         (WebCore::ImageFrameCache::clearMetadata): Clear m_repetitionCount.
171
172 2017-07-12  Adrian Perez de Castro  <aperez@igalia.com>
173
174         [SOUP] Do not use C linkage for functions using C++ features
175         https://bugs.webkit.org/show_bug.cgi?id=174392
176
177         Reviewed by Michael Catanzaro.
178
179         No new tests because there is no behavior change.
180
181         * platform/network/soup/WebKitSoupRequestGeneric.h: Move G_END_DECLS
182         to leave functions which use C++ features outside of the block it
183         delimits.
184
185 2017-07-12  Carlos Garcia Campos  <cgarcia@igalia.com>
186
187         [GTK] Crashes in WebCore::PasteboardHelper::fillSelectionData when source file of drag is unavailable
188         https://bugs.webkit.org/show_bug.cgi?id=174161
189
190         Reviewed by Michael Catanzaro.
191
192         It seems selection data could contain an empty string, in which case gtk_selection_data_get_data() returns a
193         valid pointer, but gtk_selection_data_get_length() returns 0. When this happens we end up trying to split an
194         empty string resulting in an empty vector, but we unconditionally access the first element of the vector.
195
196         * platform/gtk/PasteboardHelper.cpp:
197         (WebCore::selectionDataToUTF8String): Return a null string in case selection data length is 0.
198         (WebCore::PasteboardHelper::fillSelectionData): Return early if selection data length is 0, instead of checking
199         the selection data pointer.
200
201 2017-07-11  Carlos Garcia Campos  <cgarcia@igalia.com>
202
203         [GTK][WPE] Enable FILE_LOCK and implement lockFile and unlockFile
204         https://bugs.webkit.org/show_bug.cgi?id=174357
205
206         Reviewed by Michael Catanzaro.
207
208         Implement lockFile and unlockFile using flock().
209
210         * PlatformWPE.cmake:
211         * platform/glib/FileSystemGlib.cpp:
212         (WebCore::lockFile):
213         (WebCore::unlockFile):
214
215 2017-07-11  Yusuke Suzuki  <utatane.tea@gmail.com>
216
217         Use FastAllocator in STL containers
218         https://bugs.webkit.org/show_bug.cgi?id=174366
219
220         Rubber stamped by Sam Weinig.
221
222         This patch uses FastAllocator for STL containers including std::set and std::map.
223         STL can take a template parameter to be used as allocator for containers.
224         We prepare FastAllocator, which uses fastMalloc for allocation.
225         This allows us to use bmalloc (if supported) for STL containers which offers
226         functionalities that is not supported in WTF containers.
227
228         * Modules/indexeddb/IDBKeyData.h:
229         * Modules/indexeddb/server/IndexValueEntry.cpp:
230         (WebCore::IDBServer::IndexValueEntry::IndexValueEntry):
231         (WebCore::IDBServer::IndexValueEntry::Iterator::Iterator):
232         (WebCore::IDBServer::IndexValueEntry::reverseFind):
233         * Modules/indexeddb/server/IndexValueEntry.h:
234         * Modules/indexeddb/server/IndexValueStore.cpp:
235         (WebCore::IDBServer::IndexValueStore::lowestIteratorInRange):
236         (WebCore::IDBServer::IndexValueStore::highestReverseIteratorInRange):
237         (WebCore::IDBServer::IndexValueStore::Iterator::Iterator):
238         * Modules/indexeddb/server/IndexValueStore.h:
239         * Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
240         (WebCore::IDBServer::MemoryBackingStoreTransaction::objectStoreCleared):
241         * Modules/indexeddb/server/MemoryBackingStoreTransaction.h:
242         * Modules/indexeddb/server/MemoryObjectStore.cpp:
243         (WebCore::IDBServer::MemoryObjectStore::replaceKeyValueStore):
244         (WebCore::IDBServer::MemoryObjectStore::addRecord):
245         (WebCore::IDBServer::MemoryObjectStore::updateCursorsForPutRecord):
246         * Modules/indexeddb/server/MemoryObjectStore.h:
247         (WebCore::IDBServer::MemoryObjectStore::orderedKeys):
248         * Modules/indexeddb/server/MemoryObjectStoreCursor.cpp:
249         (WebCore::IDBServer::MemoryObjectStoreCursor::keyAdded):
250         (WebCore::IDBServer::MemoryObjectStoreCursor::setFirstInRemainingRange):
251         (WebCore::IDBServer::MemoryObjectStoreCursor::setForwardIteratorFromRemainingRange):
252         (WebCore::IDBServer::MemoryObjectStoreCursor::setReverseIteratorFromRemainingRange):
253         (WebCore::IDBServer::MemoryObjectStoreCursor::incrementForwardIterator):
254         (WebCore::IDBServer::MemoryObjectStoreCursor::incrementReverseIterator):
255         * Modules/indexeddb/server/MemoryObjectStoreCursor.h:
256         * Modules/mediasource/SampleMap.h:
257         * page/WheelEventTestTrigger.cpp:
258         (WebCore::WheelEventTestTrigger::deferTestsForReason):
259         (WebCore::dumpState):
260         * page/WheelEventTestTrigger.h:
261         * platform/graphics/cv/VideoTextureCopierCV.cpp:
262         (WebCore::enumToStringMap):
263         * rendering/OrderIterator.h:
264
265 2017-07-11  Per Arne Vollan  <pvollan@apple.com>
266
267         [Win] Build error when building WebKit.dll from WebKit.proj project file.
268         https://bugs.webkit.org/show_bug.cgi?id=174410
269
270         Reviewed by Brent Fulgham.
271
272         Copy required header files to forwarding headers folder.
273
274         * PlatformWin.cmake:
275
276 2017-07-11  Dean Jackson  <dino@apple.com>
277
278         Remove NAVIGATOR_HWCONCURRENCY
279         https://bugs.webkit.org/show_bug.cgi?id=174400
280
281         Reviewed by Sam Weinig.
282
283         * Configurations/FeatureDefines.xcconfig:
284         * WebCore.xcodeproj/project.pbxproj:
285         * page/NavigatorBase.cpp:
286         (WebCore::NavigatorBase::hardwareConcurrency): Deleted.
287         * page/NavigatorBase.h:
288         * page/NavigatorConcurrentHardware.idl: Removed.
289
290 2017-07-11  Youenn Fablet  <youenn@apple.com>
291
292         RealtimeOutgoingAudioSource should not push more audio data if the WebRTC thread is not able to process it
293         https://bugs.webkit.org/show_bug.cgi?id=174383
294
295         Reviewed by Eric Carlson.
296
297         This patch adds support to check for pending-processing audio data.
298         If the amount of audio data is bigger than a high water mark of 0.5 seconds,
299         we stop pushing new audio data until buffered audio data is lower than a low water mark of 0.1 seconds.
300         Patch is tested by adding breakpoints to trigger the high water mark, verifying that low water mark is triggered
301         and receiving audio is fine on the other connection endpoint.
302
303         * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
304         (WebCore::RealtimeOutgoingAudioSource::isReachingBufferedAudioDataHighLimit):
305         (WebCore::RealtimeOutgoingAudioSource::isReachingBufferedAudioDataLowLimit):
306         (WebCore::RealtimeOutgoingAudioSource::audioSamplesAvailable):
307         * platform/mediastream/mac/RealtimeOutgoingAudioSource.h:
308
309 2017-07-11  Dean Jackson  <dino@apple.com>
310
311         Rolling out r219372.
312
313         * Configurations/FeatureDefines.xcconfig:
314         * WebCore.xcodeproj/project.pbxproj:
315         * page/NavigatorBase.cpp:
316         (WebCore::NavigatorBase::hardwareConcurrency):
317         * page/NavigatorBase.h:
318         * page/NavigatorConcurrentHardware.idl: Added.
319
320 2017-07-11  Dean Jackson  <dino@apple.com>
321
322         Remove NAVIGATOR_HWCONCURRENCY
323         https://bugs.webkit.org/show_bug.cgi?id=174400
324
325         Reviewed by Sam Weinig.
326
327         * Configurations/FeatureDefines.xcconfig:
328         * WebCore.xcodeproj/project.pbxproj:
329         * page/NavigatorBase.cpp:
330         (WebCore::NavigatorBase::hardwareConcurrency): Deleted.
331         * page/NavigatorBase.h:
332         * page/NavigatorConcurrentHardware.idl: Removed.
333
334 2017-07-11  Jiewen Tan  <jiewen_tan@apple.com>
335
336         [WebCrypto] CryptoKeyECMac::Custom OpenSSL tag is actually tagged type [1]
337         https://bugs.webkit.org/show_bug.cgi?id=174382
338         <rdar://problem/33244871>
339
340         Reviewed by Brent Fulgham.
341
342         No change of behaviour.
343
344         * crypto/mac/CryptoKeyECMac.cpp:
345         (WebCore::CryptoKeyEC::platformImportPkcs8):
346         (WebCore::CryptoKeyEC::platformExportPkcs8):
347         Replace CustomECParameters with TaggedType1 according to X.690(08/2015) section 8.14:
348         https://www.itu.int/rec/T-REC-X.690-201508-I/en
349         and RFC 5915 Appendix A:
350         http://www.ietf.org/rfc/rfc5915.txt.
351
352 2017-07-11  Said Abou-Hallawa  <sabouhallawa@apple.com>
353
354         REGRESSION(r219045): The <body> element does not get repainted when its background image finishes decoding
355         https://bugs.webkit.org/show_bug.cgi?id=174376
356
357         Reviewed by Simon Fraser.
358
359         When adding a CachedImageClient to CachedImage::m_pendingImageDrawingClients
360         and the CachedImageClient is not one of the CachedImage::m_clients, we
361         should cancel the repaint optimization in CachedImage::imageFrameAvailable().
362         This can be done by adding all the CachedImage::m_clients to CachedImage::
363         m_pendingImageDrawingClients.
364
365         Test: fast/images/async-image-body-background-image.html
366
367         * loader/cache/CachedImage.cpp:
368         (WebCore::CachedImage::addPendingImageDrawingClient):
369
370 2017-07-11  Chris Dumez  <cdumez@apple.com>
371
372         Unreviewed, fix Windows build after r219355.
373
374         * bindings/js/JSDOMWindowCustom.cpp:
375         (WebCore::addCrossOriginWindowPropertyNames):
376         (WebCore::addCrossOriginWindowOwnPropertyNames):
377         (WebCore::JSDOMWindow::getOwnPropertyNames):
378         (WebCore::addCrossOriginPropertyNames): Deleted.
379         (WebCore::addCrossOriginOwnPropertyNames): Deleted.
380         * bindings/js/JSLocationCustom.cpp:
381         (WebCore::addCrossOriginLocationPropertyNames):
382         (WebCore::addCrossOriginLocationOwnPropertyNames):
383         (WebCore::JSLocation::getOwnPropertyNames):
384         (WebCore::addCrossOriginPropertyNames): Deleted.
385         (WebCore::addCrossOriginOwnPropertyNames): Deleted.
386
387 2017-07-10  Sam Weinig  <sam@webkit.org>
388
389         [WebIDL] Convert MutationCallback to be a normal generate callback
390         https://bugs.webkit.org/show_bug.cgi?id=174140
391
392         Reviewed by Chris Dumez.
393
394         To make this work more nicely, I:
395         - Added the ability to for non-nullable interfaces in sequences to be passed
396           via a Ref<> rather than a RefPtr<> as a parameter to a callback function.
397           (e.g. callback MyCallback = void (sequence<Foo> foos) will now have the 
398           signature, CallbackResult<void> handleEvent(const Vector<Ref<Foo>>&) rather
399           than CallbackResult<void> handleEvent(const Vector<RefPtr<Foo>>&).
400         - Added a new extended attribute for callback functions called [CallbackNeedsCanInvoke]
401           that adds a virtual function called canInvoke() to the generated callback.
402           All it does is forward to ActiveDOMCallback's canInvokeCallback, but it
403           allows the implementation to get to it. We may one day want to move the 
404           inheritance of ActiveDOMCallback from the generated source to the base class.
405         - Added a new extended attribute for callback functions called [CallbackThisObject=Type]
406           which allows you to specify that the callback needs a this object in addition
407           to its arguments. When specified, the first argument of the C++ implementation
408           function will now correspond to the this object, with the remaining arguments
409           shifted over one.
410
411         * DerivedSources.make:
412         Add MutationCallback.
413
414         * WebCore.xcodeproj/project.pbxproj:
415         Remove non-generated JSMutationCallback.cpp, and add generated JSMutationCallback.cpp.
416
417         * Modules/mediastream/MediaDevicesRequest.cpp:
418         (WebCore::MediaDevicesRequest::filterDeviceList):
419         (WebCore::MediaDevicesRequest::start):
420         * Modules/mediastream/MediaDevicesRequest.h:
421         Switch to using Ref.
422
423         * bindings/IDLTypes.h:
424         Add InnerParameterType and NullableInnerParameterType type hooks
425         and specialize wrappers to use Ref for InnerParameterType, and RefPtr
426         for NullableInnerParameterType.
427
428         * bindings/js/JSCallbackData.cpp:
429         * bindings/js/JSCallbackData.h:
430         Add support for passing a this object.
431
432         * bindings/js/JSMutationCallback.cpp: Removed.
433         * bindings/js/JSMutationCallback.h: Removed.
434         Remove custom callback code.
435
436         * bindings/js/JSMutationObserverCustom.cpp:
437         (WebCore::constructJSMutationObserver): Deleted.
438         Remove no longer needed custom constructor.
439
440         * bindings/scripts/CodeGenerator.pm:
441         (ParseType):
442         Add helper to parse a type and cache the result.
443
444         * bindings/scripts/CodeGeneratorJS.pm:
445         (GenerateCallbackHeaderContent):
446         (GenerateCallbackImplementationContent):
447         Add support for [CallbackNeedsCanInvoke] and [CallbackThisObject]. When [CallbackThisObject]
448         is not specified, use jsUndefined() as the this object as specified by WebIDL.
449
450         * bindings/scripts/IDLAttributes.json:
451         Add [CallbackNeedsCanInvoke] and [CallbackThisObject].
452
453         * bindings/scripts/IDLParser.pm:
454         (ParseType):
455         Add entry point to parse a single type.
456
457         * css/FontFaceSet.h:
458         Switch to using Ref.
459
460         * dom/MutationCallback.h:
461         Update signatures.
462
463         * dom/MutationCallback.idl: Added.
464     
465         * dom/MutationObserver.cpp:
466         (WebCore::MutationObserver::canDeliver):
467         (WebCore::MutationObserver::deliver):
468         Switch to new signatures.
469
470         * dom/MutationObserver.idl:
471         Remove CustomConstructor.
472
473         * page/IntersectionObserverCallback.h:
474         Switch to using Ref.
475
476         * bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
477         * bindings/scripts/test/JS/JSTestCallbackFunctionRethrow.cpp:
478         * bindings/scripts/test/JS/JSTestCallbackFunctionWithThisObject.cpp: Added.
479         * bindings/scripts/test/JS/JSTestCallbackFunctionWithThisObject.h: Added.
480         * bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.cpp:
481         * bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
482         * bindings/scripts/test/JS/JSTestCallbackInterface.h:
483         * bindings/scripts/test/JS/JSTestVoidCallbackFunction.cpp:
484         Add / update bindings tests.
485
486 2017-07-11  Said Abou-Hallawa  <sabouhallawa@apple.com>
487
488         RenderImage should not add itself as a RelevantRepaintedObject if its image frame is being decoded
489         https://bugs.webkit.org/show_bug.cgi?id=174336
490
491         Reviewed by Simon Fraser.
492
493         Since nothing will be drawn till the image frame finishes decoding we should
494         treat returning ImageDrawResult::DidRequestDecoding from BitmapImage::draw
495         the same as we do when the image is still loading.
496
497         * rendering/RenderImage.cpp:
498         (WebCore::RenderImage::paintReplaced):
499         (WebCore::RenderImage::paintIntoRect):
500         * rendering/RenderImage.h:
501
502 2017-07-11  Youenn Fablet  <youenn@apple.com>
503
504         [WebRTC] Hanging under LibWebRTCMediaEndpoint::getStats
505         https://bugs.webkit.org/show_bug.cgi?id=174377
506
507         Reviewed by Eric Carlson.
508
509         No change of behavior.
510         Moving calls to libwebrtc getStats in the signalling thread since doing it in the main thread
511         would block the main thread until the signalling thread is ready to handle getStats.
512         Reducing stat logging since this may be too much for some devices.
513
514         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
515         (WebCore::LibWebRTCMediaEndpoint::getStats):
516         (WebCore::LibWebRTCMediaEndpoint::gatherStatsForLogging):
517         (WebCore::LibWebRTCMediaEndpoint::OnStatsDelivered):
518         (WebCore::LibWebRTCMediaEndpoint::startLoggingStats):
519
520 2017-07-11  Michael Catanzaro  <mcatanzaro@igalia.com>
521
522         Remove unused OpenGL files
523         https://bugs.webkit.org/show_bug.cgi?id=174371
524
525         Reviewed by Timothy Hatcher.
526
527         * platform/graphics/opengl/GLPlatformContext.cpp: Removed.
528         * platform/graphics/opengl/GLPlatformContext.h: Removed.
529         * platform/graphics/opengl/GLPlatformSurface.h: Removed.
530
531 2017-07-11  Chris Dumez  <cdumez@apple.com>
532
533         Window's [[OwnPropertyKeys]] is wrong for cross origin windows
534         https://bugs.webkit.org/show_bug.cgi?id=174364
535         <rdar://problem/33238056>
536
537         Reviewed by Brent Fulgham.
538
539         Window's [[OwnPropertyKeys]] should not list descendant frame names
540         when the window is cross-origin:
541         - https://github.com/whatwg/html/pull/2777
542
543         This aligns our behavior with Firefox and Chrome.
544
545         No new tests, updated existing test.
546
547         * bindings/js/JSDOMWindowCustom.cpp:
548         (WebCore::addCrossOriginPropertyNames):
549         (WebCore::addCrossOriginOwnPropertyNames):
550         (WebCore::JSDOMWindow::getOwnPropertyNames):
551
552 2017-07-11  Timothy Hatcher  <timothy@hatcher.name>
553
554         Fix broken build when ENABLE_VIDEO is disabled.
555         https://bugs.webkit.org/show_bug.cgi?id=174368
556
557         Reviewed by Alex Christensen.
558
559         * dom/Document.cpp:
560         * html/canvas/WebGLRenderingContextBase.cpp:
561         (WebCore::WebGLRenderingContextBase::texSubImage2D):
562         (WebCore::WebGLRenderingContextBase::texImage2D):
563         * html/canvas/WebGLRenderingContextBase.h:
564         * html/canvas/WebGLRenderingContextBase.idl:
565         * testing/Internals.cpp:
566         (WebCore::Internals::mediaResponseSources):
567         (WebCore::Internals::mediaResponseContentRanges):
568         * testing/Internals.h:
569         * testing/Internals.idl:
570
571 2017-07-11  Ali Juma  <ajuma@chromium.org>
572
573         elementFromPoint() should consider x and y to be in client (layout viewport) coordinates
574         https://bugs.webkit.org/show_bug.cgi?id=172019
575
576         Reviewed by Simon Fraser.
577
578         When visual viewports are enabled, this makes TreeScope::nodeFromPoint consider its
579         input to be in client coordinates, and clips this input to the layout viewport. This change
580         affects the behavior of document.elementFromPoint() and document.caretRangeFromPoint.
581
582         No new tests. Modified an existing test, and made a previously-failing test pass on ios.
583
584         * dom/TreeScope.cpp:
585         (WebCore::TreeScope::nodeFromPoint):
586         * page/FrameView.cpp:
587         (WebCore::FrameView::layoutViewportToAbsoluteRect):
588         (WebCore::FrameView::layoutViewportToAbsolutePoint):
589         (WebCore::FrameView::clientToLayoutViewportPoint):
590         * page/FrameView.h:
591         * rendering/RenderLayer.cpp:
592         (WebCore::RenderLayer::hitTest):
593
594 2017-07-11  Timothy Hatcher  <timothy@hatcher.name>
595
596         Broken build when !USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
597         https://bugs.webkit.org/show_bug.cgi?id=174369
598
599         Reviewed by Alex Christensen.
600
601         * dom/ScriptedAnimationController.h: Include PlatformScreen.h.
602
603 2017-07-11  Wenson Hsieh  <wenson_hsieh@apple.com>
604
605         Address post-review feedback after http://trac.webkit.org/r219310
606         https://bugs.webkit.org/show_bug.cgi?id=174300
607         <rdar://problem/33030639>
608
609         Reviewed by Simon Fraser.
610
611         Removes pan-gesture-related plumbing introduced in r219310 that is no longer necessary.
612
613         * page/scrolling/ScrollingTree.h:
614         (WebCore::ScrollingTree::scrollingTreeNodeWillStartPanGesture):
615         (WebCore::ScrollingTree::scrollingTreeNodeDidEndPanGesture): Deleted.
616
617 2017-07-11  Alex Christensen  <achristensen@webkit.org>
618
619         Reduce URL size
620         https://bugs.webkit.org/show_bug.cgi?id=174319
621
622         Reviewed by Andreas Kling.
623
624         m_fragmentEnd is redundant information. If a URL is valid, then it is always m_string.length().
625         If a URL is not valid, then it is always 0. Rather than storing additional information,
626         deduce the fragment end from the validity of the URL and the String's length.
627
628         No change in behavior.  This reduces sizeof(URL) from 56 to 48 and reduces operations when parsing.
629
630         * platform/URL.cpp:
631         (WebCore::URL::invalidate):
632         (WebCore::URL::fragmentIdentifier):
633         (WebCore::URL::hasFragmentIdentifier):
634         (WebCore::URL::removeFragmentIdentifier):
635         * platform/URL.h:
636         (WebCore::URL::encode):
637         (WebCore::URL::decode):
638         (WebCore::URL::hasFragment):
639         * platform/URLParser.cpp:
640         (WebCore::URLParser::urlLengthUntilPart):
641         (WebCore::URLParser::copyURLPartsUntil):
642         (WebCore::URLParser::parse):
643         (WebCore::URLParser::allValuesEqual):
644         (WebCore::URLParser::internalValuesConsistent):
645
646 2017-07-11  Alex Christensen  <achristensen@webkit.org>
647
648         SharedBuffer::size should return a size_t
649         https://bugs.webkit.org/show_bug.cgi?id=174328
650
651         Reviewed by Andreas Kling.
652
653         No change in behaviour.
654
655         * html/FTPDirectoryDocument.cpp:
656         (WebCore::createTemplateDocumentData):
657         * loader/ContentFilter.cpp:
658         (WebCore::ContentFilter::handleProvisionalLoadFailure):
659         * loader/ResourceLoader.cpp:
660         (WebCore::ResourceLoader::loadDataURL):
661         * loader/ResourceLoader.h:
662         * loader/appcache/ApplicationCacheStorage.cpp:
663         (WebCore::ApplicationCacheStorage::store):
664         * loader/cache/CachedScript.cpp:
665         (WebCore::CachedScript::script):
666         * platform/SharedBuffer.cpp:
667         (WebCore::SharedBuffer::tryCreateArrayBuffer):
668         * platform/SharedBuffer.h:
669
670 2017-07-11  Per Arne Vollan  <pvollan@apple.com>
671
672         [Win] Build error when building WebCore from WebCore.proj project file.
673         https://bugs.webkit.org/show_bug.cgi?id=174330
674
675         Reviewed by Brent Fulgham.
676
677         The CMake variable PAL_DIR should be set in the project file.
678
679         * WebCore.vcxproj/WebCore.proj:
680
681 2017-05-24  Sergio Villar Senin  <svillar@igalia.com>
682
683         [SVG] Leak in SVGAnimatedListPropertyTearOff
684         https://bugs.webkit.org/show_bug.cgi?id=172545
685
686         Reviewed by Said Abou-Hallawa.
687
688         SVGAnimatedListPropertyTearOff maintains a vector m_wrappers with references to
689         SVGPropertyTraits<PropertyType>::ListItemTearOff. Apart from that SVGPropertyTearOff has a
690         reference to SVGAnimatedProperty.
691
692         When SVGListProperty::getItemValuesAndWrappers() is called, it creates a
693         SVGPropertyTraits<PropertyType>::ListItemTearOff pointing to the same SVGAnimatedProperty (a
694         SVGAnimatedListPropertyTearOff) which stores the m_wrappers vector where the ListItemTearOff
695         is going to be added to. This effectively creates a reference cycle between the
696         SVGAnimatedListPropertyTearOff and all the ListItemTearOff it stores in m_wrappers.
697
698         We should detach those wrappers in propertyWillBeDeleted() in order to break the cycle.
699
700         * svg/properties/SVGAnimatedListPropertyTearOff.h:
701
702 2017-07-11  Carlos Alberto Lopez Perez  <clopez@igalia.com>
703
704         [GTK] Spin buttons on input type number appear over the value itself for small widths
705         https://bugs.webkit.org/show_bug.cgi?id=173572
706
707         Reviewed by Carlos Garcia Campos.
708
709         When drawing the spin buttons, override the width of the input
710         element to increment it with the width of the spin button.
711         This ensures that we don't end up covering the input values with
712         the spin buttons.
713
714         Do this also for user controlled styles, because most web authors
715         won't test how their site renders on WebKitGTK+, and they will
716         assume spin buttons in the order of 13 pixels wide (that is what
717         most browsers use), but the GTK+ spin button is much wider (66 pixels).
718
719         Test: platform/gtk/fast/forms/number/number-size-spinbutton-nocover.html
720
721         * rendering/RenderTheme.cpp:
722         (WebCore::RenderTheme::adjustStyle):
723         * rendering/RenderThemeGtk.cpp:
724         (WebCore::RenderThemeGtk::adjustTextFieldStyle): Call the theme's adjustTextFieldStyle() also for user controlled styles.
725         (WebCore::RenderThemeGtk::adjustInnerSpinButtonStyle):
726
727 2017-07-11  Youenn Fablet  <youenn@apple.com>
728
729         We should do ICE candidate filtering at the Document level
730         https://bugs.webkit.org/show_bug.cgi?id=173861
731         <rdar://problem/33122058>
732
733         Reviewed by Eric Carlson.
734
735         Tests: http/tests/webrtc/filtering-ice-candidate-cross-origin-frame.html
736                http/tests/webrtc/filtering-ice-candidate-same-origin-frame.html
737                http/tests/webrtc/filtering-ice-candidate-same-origin-frame2.html
738                webrtc/filtering-ice-candidate-after-reload.html
739
740         Making UserMediaRequest disable the ICE candidate filtering for the page RTCController.
741         All RTCPeerConnection of the page that are created on a document that are same-origin as the top document
742         are now registered to the RTCController.
743         This allows disabling filtering to only these RTCPeerConnection.
744
745         The page keeps the default ICE candidate filtering policy.
746         This policy allows disabling ICE candidate filtering for all RTCPeerConnection.
747
748         When the top document is changing, the RTCController filtering policy is reset
749         and its list of RTCPeerConnection is emptied.
750
751         Internals no longer disables ICE candidate filtering by default.
752         This allows finer grained testing.
753         ICE candidate filtering is disabled for tests including testharnessreport.js
754         to enable web-platform-tests to run without modifications.
755
756         * Modules/mediastream/RTCController.cpp:
757         (WebCore::RTCController::reset):
758         * Modules/mediastream/RTCController.h:
759         * Modules/mediastream/UserMediaRequest.cpp:
760         (WebCore::UserMediaRequest::allow):
761         * page/Frame.cpp:
762         (WebCore::Frame::setDocument):
763         * page/Page.cpp:
764         (WebCore::Page::disableICECandidateFiltering):
765         * page/Page.h:
766         (WebCore::Page::shouldEnableICECandidateFilteringByDefault):
767         (WebCore::Page::disableICECandidateFiltering): Deleted.
768         (WebCore::Page::enableICECandidateFiltering): Deleted.
769         (WebCore::Page::isICECandidateFilteringEnabled): Deleted.
770         * testing/Internals.cpp:
771         (WebCore::Internals::Internals):
772         (WebCore::Internals::setICECandidateFiltering):
773         (WebCore::Internals::setEnumeratingAllNetworkInterfacesEnabled):
774         (WebCore::Internals::isICECandidateFilteringEnabled): Deleted.
775         * testing/Internals.h:
776         * testing/Internals.idl:
777
778 2017-07-11  Sergio Villar Senin  <svillar@igalia.com>
779
780         Unreviewed, rolling out r219325.
781
782         The test is still flaky
783
784         Reverted changeset:
785
786         "[SVG] Leak in SVGAnimatedListPropertyTearOff"
787         https://bugs.webkit.org/show_bug.cgi?id=172545
788         http://trac.webkit.org/changeset/219325
789
790 2017-05-24  Sergio Villar Senin  <svillar@igalia.com>
791
792         [SVG] Leak in SVGAnimatedListPropertyTearOff
793         https://bugs.webkit.org/show_bug.cgi?id=172545
794
795         Reviewed by Said Abou-Hallawa.
796
797         SVGAnimatedListPropertyTearOff maintains a vector m_wrappers with references to
798         SVGPropertyTraits<PropertyType>::ListItemTearOff. Apart from that SVGPropertyTearOff has a
799         reference to SVGAnimatedProperty.
800
801         When SVGListProperty::getItemValuesAndWrappers() is called, it creates a
802         SVGPropertyTraits<PropertyType>::ListItemTearOff pointing to the same SVGAnimatedProperty (a
803         SVGAnimatedListPropertyTearOff) which stores the m_wrappers vector where the ListItemTearOff
804         is going to be added to. This effectively creates a reference cycle between the
805         SVGAnimatedListPropertyTearOff and all the ListItemTearOff it stores in m_wrappers.
806
807         We should detach those wrappers in propertyWillBeDeleted() in order to break the cycle.
808
809         * svg/properties/SVGAnimatedListPropertyTearOff.h:
810
811 2017-07-10  Simon Fraser  <simon.fraser@apple.com>
812
813         [WK2 iOS] REGRESSION (r216803) During momentum scroll, getBoundingClientRect returns wrong coordinates (missing images on pinterest, elle.com and many other sites)
814         https://bugs.webkit.org/show_bug.cgi?id=174286
815         rdar://problem/32864180
816
817         Reviewed by Dean Jackson.
818
819         r216803 made getBoundingClientRects relative to the layout viewport, but when scrolling we
820         only update that on stable viewport updates (at the end of the scroll). This meant that during
821         unstable updates, getBoundingClientRects() used a "frozen" viewport origin so things on-screen
822         would appear to be off-screen, causing sites to fail to dynamically load images etc. when
823         scrolling.
824
825         Fix by pushing an optional "unstable" layout viewport rect onto FrameView, which gets used by
826         FrameView::documentToClientOffset(). This is cleared when we do a stable update.
827
828         This is a short-term solution. Longer term, I would prefer to always call setLayoutViewportOverrideRect(),
829         but fix the scrolling tree logic to work correctly in this case.
830
831         Add a bit more scrolling logging.
832
833         Test: fast/visual-viewport/ios/get-bounding-client-rect-unstable.html
834
835         * page/FrameView.cpp:
836         (WebCore::FrameView::setUnstableLayoutViewportRect):
837         (WebCore::FrameView::documentToClientOffset):
838         * page/FrameView.h:
839         * page/scrolling/AsyncScrollingCoordinator.cpp:
840         (WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
841         * page/scrolling/ScrollingStateFixedNode.cpp:
842         (WebCore::ScrollingStateFixedNode::updateConstraints):
843         (WebCore::ScrollingStateFixedNode::reconcileLayerPositionForViewportRect):
844
845 2017-07-10  John Wilander  <wilander@apple.com>
846
847         Resource Load Statistics: Prune statistics in orders of importance
848         https://bugs.webkit.org/show_bug.cgi?id=174215
849         <rdar://problem/33164403>
850
851         Reviewed by Chris Dumez.
852
853         Test: http/tests/loading/resourceLoadStatistics/prune-statistics.html
854
855         * loader/ResourceLoadObserver.cpp:
856         (WebCore::reduceTimeResolution):
857         (WebCore::ResourceLoadObserver::logFrameNavigation):
858         (WebCore::ResourceLoadObserver::logSubresourceLoading):
859         (WebCore::ResourceLoadObserver::logWebSocketLoading):
860         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
861             Now all set the new statistics field lastSeen.
862         * loader/ResourceLoadStatistics.cpp:
863         (WebCore::ResourceLoadStatistics::encode):
864         (WebCore::ResourceLoadStatistics::decode):
865         (WebCore::ResourceLoadStatistics::toString):
866         (WebCore::ResourceLoadStatistics::merge):
867             Handling of the new statistics field lastSeen.
868         * loader/ResourceLoadStatistics.h:
869
870 2017-07-10  Devin Rousso  <drousso@apple.com>
871
872         Web Inspector: Highlight matching CSS canvas clients when hovering contexts in the Resources tab
873         https://bugs.webkit.org/show_bug.cgi?id=174279
874
875         Reviewed by Matt Baker.
876
877         Test: inspector/dom/highlightNodeList.html
878
879         * inspector/InspectorDOMAgent.h:
880         * inspector/InspectorDOMAgent.cpp:
881         (WebCore::InspectorDOMAgent::highlightNodeList):
882
883 2017-07-10  Javier Fernandez  <jfernandez@igalia.com>
884
885         [css-align][css-flex][css-grid] 'auto' values of align-self and justify-self must not be resolved
886         https://bugs.webkit.org/show_bug.cgi?id=172707
887
888         Reviewed by Antti Koivisto.
889
890         The CSS Box Alignment specification has been changed recently so that
891         now all the propeties have the specificed value as computed value. The
892         rationale of this change are at the associated W3C github issue [1].
893
894         This change implies that we don't need to execute the StyleAdjuter
895         logic we implemented specifically for supporting 'auto' values
896         resolution for computed style. We can live now with resolution at
897         layout time only.
898
899         [1] https://github.com/w3c/csswg-drafts/issues/440
900
901         No new tests, just updating the already defined tests.
902
903         * css/CSSComputedStyleDeclaration.cpp:
904         (WebCore::ComputedStyleExtractor::propertyValue):
905         * css/StyleResolver.cpp:
906         (WebCore::StyleResolver::adjustRenderStyle): Removed
907         * css/StyleResolver.h:
908         * html/shadow/TextControlInnerElements.cpp:
909         (WebCore::TextControlInnerElement::resolveCustomStyle):
910         * rendering/RenderBox.cpp:
911         (WebCore::RenderBox::columnFlexItemHasStretchAlignment):
912         (WebCore::RenderBox::hasStretchedLogicalWidth):
913         * rendering/RenderFlexibleBox.cpp:
914         (WebCore::RenderFlexibleBox::styleDidChange): Added
915         (WebCore::RenderFlexibleBox::alignmentForChild):
916         * rendering/RenderFlexibleBox.h:
917
918 2017-07-10  Wenson Hsieh  <wenson_hsieh@apple.com>
919
920         [WK2] Ignore touch events that interrupt platform-driven momentum scrolling
921         https://bugs.webkit.org/show_bug.cgi?id=174300
922         <rdar://problem/33030639>
923
924         Reviewed by Simon Fraser.
925
926         See Source/WebKit2/ChangeLog for more detail.
927
928         Tests: fast/events/ios/no-touch-events-when-stopping-momentum-scroll-in-mainframe.html
929                fast/events/ios/no-touch-events-when-stopping-momentum-scroll-in-overflow.html
930                fast/events/ios/touch-events-during-scroll-deceleration-in-overflow.html
931
932         * page/scrolling/ScrollingTree.h:
933         (WebCore::ScrollingTree::scrollingTreeNodeDidEndPanGesture):
934
935 2017-07-10  Jeremy Jones  <jeremyj@apple.com>
936
937         Captions and subtitles not showing up in picture-in-picture for MSE content
938         https://bugs.webkit.org/show_bug.cgi?id=174317
939         rdar://problem/33188591
940
941         Reviewed by Eric Carlson.
942
943         Reverts a regression created by r218403.
944
945         * html/shadow/MediaControlElements.cpp:
946         (WebCore::MediaControlTextTrackContainerElement::updateTextTrackRepresentation):
947
948 2017-07-10  Per Arne Vollan  <pvollan@apple.com>
949
950         [Win] Link error when building WTF from WTF.proj project file.
951         https://bugs.webkit.org/show_bug.cgi?id=174316
952         <rdar://problem/33178200>
953
954         Reviewed by Brent Fulgham.
955
956         WTF_CPU_X86 cmake variable needs to be set for link libraries directories to be correct.
957
958         * WebCore.vcxproj/WebCore.proj:
959
960 2017-07-10  Jeremy Jones  <jeremyj@apple.com>
961
962         media element handle adding source immediately before src.
963         https://bugs.webkit.org/show_bug.cgi?id=174284
964         rdar://problem/33115439
965
966         Reviewed by David Kilzer.
967
968         Test: media/video-source-before-src.html
969
970         Adding a source causes a selectMediaResource block to be enqueued.
971         If dataLoadingPermitted prevents creating the m_player but sets the srcAttr, then
972         the enqueued selectMediaResource will be in a bad state, with a srcAttr but no m_player.
973
974         This fix prevents selectMediaResource from being called, if data loading is not permitted
975         when adding a source element, to match how it prevents player creation when setting srcAttr.
976
977         This fix also adds a debug assert to catch the problem earlier and adds an early return to
978         prevent the crash in release builds.
979
980         * html/HTMLMediaElement.cpp:
981         (WebCore::HTMLMediaElement::selectMediaResource):
982         (WebCore::HTMLMediaElement::sourceWasAdded):
983
984 2017-07-10  Megan Gardner  <megan_gardner@apple.com>
985
986         Add location to NavigationActionData
987         https://bugs.webkit.org/show_bug.cgi?id=174233
988         <rdar://problem/29165518>
989
990         Reviewed by Simon Fraser.
991         
992         Add the root view location of a tap to a NavigationAction to vend to Safari.
993
994         Test: small enough change to not be tested alone.
995
996         * dom/MouseRelatedEvent.cpp:
997         (WebCore::MouseRelatedEvent::absoluteLocationConvertedToRootView):
998         * dom/MouseRelatedEvent.h:
999
1000 2017-07-10  Sam Weinig  <sam@webkit.org>
1001
1002         [WebIDL] Move plugin object customization into the generator
1003         https://bugs.webkit.org/show_bug.cgi?id=174238
1004
1005         Reviewed by Chris Dumez.
1006
1007         - Added [Plugin] extended attribute to forward the necessary hooks
1008           for get/set/delete to the plugin code.
1009         - Removed [CustomNamedSetter] and replaced it's remaining uses
1010           [CustomPut] (formally called [CustomPutFunction]).
1011         - Renamed [CustomNamedGetterOnPrototype] to [CustomPutOnPrototype]
1012           because that is actually what it does.
1013         - Removed [CustomGetOwnPropertySlotByIndex] and made 
1014           [CustomGetOwnPropertySlot] imply it, as the other custom hooks
1015           do.
1016         - Renamed [CustomEnumerateProperty] to [CustomGetOwnPropertyNames]
1017           to conform with other attribute names.
1018         - Renamed [CustomCall] to [CustomGetCallData] to conform with other 
1019           attribute names.
1020
1021         * CMakeLists.txt:
1022         * WebCore.xcodeproj/project.pbxproj:
1023         * bindings/js/JSBindingsAllInOne.cpp:
1024         * bindings/js/JSHTMLAppletElementCustom.cpp: Removed.
1025         * bindings/js/JSHTMLEmbedElementCustom.cpp: Removed.
1026         * bindings/js/JSHTMLObjectElementCustom.cpp: Removed.
1027         Remove custom bindings.
1028
1029         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
1030         (WebCore::putCommon):
1031         (WebCore::JSCSSStyleDeclaration::put):
1032         (WebCore::JSCSSStyleDeclaration::putByIndex):
1033         (WebCore::JSCSSStyleDeclaration::putDelegate): Deleted.
1034         Use [CustomPut] rather than [CustomNamedSetter] to allow us
1035         to get rid of [CustomNamedSetter]. Reuse put delegate as
1036         common code to share between put and putByIndex.
1037
1038         * bindings/js/JSLocationCustom.cpp:
1039         (WebCore::getOwnPropertySlotCommon):
1040         (WebCore::JSLocation::getOwnPropertySlot):
1041         (WebCore::JSLocation::getOwnPropertySlotByIndex):
1042         Replace [CustomGetOwnPropertySlotAndDescriptor] with [CustomGetOwnPropertySlot]
1043         which is more clear and reduces the number of variants of this hook override
1044         we need.
1045
1046         (WebCore::putCommon):
1047         (WebCore::JSLocation::put):
1048         (WebCore::JSLocation::putByIndex):
1049         Use [CustomPut] rather than [CustomNamedSetter] to allow us
1050         to get rid of [CustomNamedSetter]. Reuse put delegate as
1051         common code to share between put and putByIndex.
1052
1053         (WebCore::JSLocationPrototype::put):
1054         [CustomPutOnPrototype] (which weirdly used incorrectly be called 
1055         [CustomNamedGetterOnPrototype]) now works like [CustomPut] meaning
1056         you need to call Base.
1057
1058         * bindings/js/JSPluginElementFunctions.cpp:
1059         (WebCore::pluginElementPropertyGetter):
1060         (WebCore::pluginElementCustomGetOwnPropertySlot):
1061         (WebCore::pluginElementCustomPut):
1062         * bindings/js/JSPluginElementFunctions.h:
1063         (WebCore::pluginElementCustomGetOwnPropertySlot): Deleted.
1064         Remove templatized pluginElementCustomGetOwnPropertySlot, which was 
1065         completely unnecessary and merge its functionality into the out of
1066         line overload. Remove pluginElementPropertyGetter from the header,
1067         since it is only used in implementation, and unify the naming and
1068         argument position (JSHTMLElement* comes first) of the hooks.
1069
1070         * bindings/scripts/CodeGeneratorJS.pm:
1071         (GenerateIndexedGetter):
1072         (GenerateNamedGetter):
1073         (GenerateGetOwnPropertySlot):
1074         (GenerateGetOwnPropertySlotByIndex):
1075         (GenerateGetOwnPropertyNames):
1076         (GeneratePut):
1077         (GeneratePutByIndex):
1078         (GenerateDeleteProperty):
1079         (GenerateDeletePropertyByIndex):
1080         (GenerateNamedDeleterDefinition):
1081         (InstanceOverridesGetOwnPropertySlot):
1082         (InstanceOverridesGetOwnPropertyNames):
1083         (InstanceOverridesPut):
1084         (InstanceOverridesDeleteProperty):
1085         (GenerateHeader):
1086         (GenerateImplementation):
1087         (GenerateGetCallData):
1088         (GeneratePluginCall):
1089         (GenerateLegacyCallerDefinitions):
1090         (GenerateLegacyCallerDefinition):
1091         (GeneratePrototypeDeclaration):
1092         (InstanceOverridesGetCallData):
1093         (HeaderNeedsPrototypeDeclaration):
1094         - Add support for [Plugin]
1095         - Remove support for [CustomNamedSetter]
1096         - Replace [CustomGetOwnPropertySlotByIndex] with [CustomGetOwnPropertySlot]
1097         - Replace [CustomEnumerateProperty] with [CustomGetOwnPropertyNames]
1098         - Replace [CustomPutFunction] with [CustomPut].
1099         - Make subroutine names more consistent (remove a few Definition suffixes)
1100
1101         * bindings/scripts/IDLAttributes.json:
1102         Update for new / removed attributes.
1103
1104         * bindings/scripts/test/JS/JSTestInterface.cpp:
1105         * bindings/scripts/test/JS/JSTestInterface.h:
1106         * bindings/scripts/test/JS/JSTestPluginInterface.cpp: Added.
1107         * bindings/scripts/test/JS/JSTestPluginInterface.h: Added.
1108         * bindings/scripts/test/TestInterface.idl:
1109         * bindings/scripts/test/TestPluginInterface.idl: Added.
1110         Update / add tests.
1111
1112         * css/CSSStyleDeclaration.idl:
1113         * html/HTMLAppletElement.idl:
1114         * html/HTMLEmbedElement.idl:
1115         * html/HTMLObjectElement.idl:
1116         * page/DOMWindow.idl:
1117         * page/Location.idl:
1118         * storage/Storage.idl:
1119         Update for new / renamed attributes.
1120
1121 2017-07-03  Brian Burg  <bburg@apple.com>
1122
1123         Web Replay: remove some unused code
1124         https://bugs.webkit.org/show_bug.cgi?id=173903
1125
1126         Rubber-stamped by Joseph Pecoraro.
1127
1128         * CMakeLists.txt:
1129         * Configurations/FeatureDefines.xcconfig:
1130         * DerivedSources.make:
1131         * PlatformMac.cmake:
1132         * WebCore.xcodeproj/project.pbxproj:
1133         * dom/Document.cpp:
1134         (WebCore::Document::Document):
1135         (WebCore::Document::lastModified):
1136         (WebCore::Document::inputCursor): Deleted.
1137         (WebCore::Document::setInputCursor): Deleted.
1138         * dom/Document.h:
1139         * inspector/InspectorController.cpp:
1140         (WebCore::InspectorController::InspectorController):
1141         * inspector/InspectorInstrumentation.cpp:
1142         (WebCore::InspectorInstrumentation::willDispatchEventImpl):
1143         (WebCore::InspectorInstrumentation::willDispatchEventOnWindowImpl):
1144         (WebCore::InspectorInstrumentation::frameDetachedFromParentImpl):
1145         (WebCore::InspectorInstrumentation::didCommitLoadImpl):
1146         (WebCore::InspectorInstrumentation::sessionCreatedImpl): Deleted.
1147         (WebCore::InspectorInstrumentation::sessionLoadedImpl): Deleted.
1148         (WebCore::InspectorInstrumentation::sessionModifiedImpl): Deleted.
1149         (WebCore::InspectorInstrumentation::segmentCreatedImpl): Deleted.
1150         (WebCore::InspectorInstrumentation::segmentCompletedImpl): Deleted.
1151         (WebCore::InspectorInstrumentation::segmentLoadedImpl): Deleted.
1152         (WebCore::InspectorInstrumentation::segmentUnloadedImpl): Deleted.
1153         (WebCore::InspectorInstrumentation::captureStartedImpl): Deleted.
1154         (WebCore::InspectorInstrumentation::captureStoppedImpl): Deleted.
1155         (WebCore::InspectorInstrumentation::playbackStartedImpl): Deleted.
1156         (WebCore::InspectorInstrumentation::playbackPausedImpl): Deleted.
1157         (WebCore::InspectorInstrumentation::playbackHitPositionImpl): Deleted.
1158         (WebCore::InspectorInstrumentation::playbackFinishedImpl): Deleted.
1159         (WebCore::InspectorInstrumentation::replayAgentEnabled): Deleted.
1160         * inspector/InspectorInstrumentation.h:
1161         (WebCore::InspectorInstrumentation::sessionCreated): Deleted.
1162         (WebCore::InspectorInstrumentation::sessionLoaded): Deleted.
1163         (WebCore::InspectorInstrumentation::sessionModified): Deleted.
1164         (WebCore::InspectorInstrumentation::segmentCreated): Deleted.
1165         (WebCore::InspectorInstrumentation::segmentCompleted): Deleted.
1166         (WebCore::InspectorInstrumentation::segmentLoaded): Deleted.
1167         (WebCore::InspectorInstrumentation::segmentUnloaded): Deleted.
1168         (WebCore::InspectorInstrumentation::captureStarted): Deleted.
1169         (WebCore::InspectorInstrumentation::captureStopped): Deleted.
1170         (WebCore::InspectorInstrumentation::playbackStarted): Deleted.
1171         (WebCore::InspectorInstrumentation::playbackPaused): Deleted.
1172         (WebCore::InspectorInstrumentation::playbackFinished): Deleted.
1173         (WebCore::InspectorInstrumentation::playbackHitPosition): Deleted.
1174         * inspector/InspectorReplayAgent.cpp: Removed.
1175         * inspector/InspectorReplayAgent.h: Removed.
1176         * inspector/InstrumentingAgents.cpp:
1177         (WebCore::InstrumentingAgents::reset):
1178         * inspector/InstrumentingAgents.h:
1179         (WebCore::InstrumentingAgents::inspectorReplayAgent): Deleted.
1180         (WebCore::InstrumentingAgents::setInspectorReplayAgent): Deleted.
1181         * page/EventHandler.h:
1182         * page/Page.cpp:
1183         (WebCore::Page::Page):
1184         * page/Page.h:
1185         (WebCore::Page::replayController): Deleted.
1186         * page/scrolling/ScrollingCoordinator.cpp:
1187         (WebCore::ScrollingCoordinator::synchronousScrollingReasons):
1188         (WebCore::ScrollingCoordinator::replaySessionStateDidChange): Deleted.
1189         * page/scrolling/ScrollingCoordinator.h:
1190         * platform/Logging.h:
1191         * plugins/DOMMimeTypeArray.cpp:
1192         (WebCore::DOMMimeTypeArray::getPluginData):
1193         * plugins/DOMPluginArray.cpp:
1194         (WebCore::DOMPluginArray::pluginData):
1195         * replay/AllReplayInputs.h: Removed.
1196         * replay/CapturingInputCursor.cpp: Removed.
1197         * replay/CapturingInputCursor.h: Removed.
1198         * replay/EventLoopInput.cpp: Removed.
1199         * replay/EventLoopInput.h: Removed.
1200         * replay/EventLoopInputDispatcher.cpp: Removed.
1201         * replay/EventLoopInputDispatcher.h: Removed.
1202         * replay/FunctorInputCursor.h: Removed.
1203         * replay/MemoizedDOMResult.cpp: Removed.
1204         * replay/MemoizedDOMResult.h: Removed.
1205         * replay/ReplayController.cpp: Removed.
1206         * replay/ReplayController.h: Removed.
1207         * replay/ReplayInputCreationMethods.cpp: Removed.
1208         * replay/ReplayInputDispatchMethods.cpp: Removed.
1209         * replay/ReplaySession.cpp: Removed.
1210         * replay/ReplaySession.h: Removed.
1211         * replay/ReplaySessionSegment.cpp: Removed.
1212         * replay/ReplaySessionSegment.h: Removed.
1213         * replay/ReplayingInputCursor.cpp: Removed.
1214         * replay/ReplayingInputCursor.h: Removed.
1215         * replay/SegmentedInputStorage.cpp: Removed.
1216         * replay/SegmentedInputStorage.h: Removed.
1217         * replay/SerializationMethods.cpp: Removed.
1218         * replay/SerializationMethods.h: Removed.
1219         * replay/WebInputs.json: Removed.
1220
1221 2017-07-10  Brady Eidson  <beidson@apple.com>
1222
1223         Cleanup lifetime issues of UniqueIDBDatabase and IDBBackingStore.
1224         <rdar://problem/32908525> and https://bugs.webkit.org/show_bug.cgi?id=174244
1225
1226         Reviewed by David Kilzer and Alex Christensen. 
1227
1228         No targeted test possible, implicitly covered by all IDB tests.
1229
1230         The original idea behind UniqueIDBDatabase lifetime was that they are ThreadSafeRefCounted and
1231         we take protector Refs when any operation that needs it alive is in flight.
1232         
1233         This added variability to their lifetime which made it difficult to enforce a few different 
1234         design invariants, namely:
1235             - UniqueIBDDatabase objects are always created and destroyed only on the main thread.
1236             - IDBBackingStore objects are always created and destroyed only on the database thread.
1237         
1238         This patch removes the ref counting and instead ties UniqueIDBDatabase lifetime to a
1239         std::unique_ptr that is owned by the IDBServer.
1240         
1241         Whenever any operations on the UniqueIDBDatabase are in flight it is kept alive by virtue
1242         of that unique_ptr in the IDBServer. Once a UniqueIDBDatabase is completely done with all of
1243         its work, the following happens:
1244             - On the main thread the IDBServer removes the unique_ptr owning the UniqueIDBDatabase
1245               from its map.
1246             - It hands the unique_ptr to the UniqueIDBDatabase itself, which schedules one final 
1247               database thread task.
1248             - That database thread task is to destroy the IDBBackingStore, kill its message queues,
1249               and then message back to the main thread for one final task.
1250             - That main thread task is to release the unique_ptr, resulting in destruction of the
1251               UniqueIDBDatabase object.
1252         
1253         This is safe, predictable, solves the lifetime issues that r218516 originally tried to solve,
1254         and solves the lifetime issues that r218516 introduced.
1255
1256         (This patch also adds many more assertions to cover various design invariants throughout the
1257         lifecycle of a particular UniqueIDBDatabase)
1258
1259         ASSERT that IDBBackingStores are only ever created and destroyed on the background thread:
1260         * Modules/indexeddb/server/IDBBackingStore.h:
1261         (WebCore::IDBServer::IDBBackingStore::~IDBBackingStore):
1262         (WebCore::IDBServer::IDBBackingStore::IDBBackingStore):
1263         
1264         Transition UniqueIDBDatabase ownership from a RefPtr to a std::unique_ptr:
1265         * Modules/indexeddb/server/IDBServer.cpp:
1266         (WebCore::IDBServer::IDBServer::getOrCreateUniqueIDBDatabase):
1267         (WebCore::IDBServer::IDBServer::closeAndTakeUniqueIDBDatabase):
1268         (WebCore::IDBServer::IDBServer::closeAndDeleteDatabasesModifiedSince):
1269         (WebCore::IDBServer::IDBServer::closeAndDeleteDatabasesForOrigins):
1270         (WebCore::IDBServer::IDBServer::closeUniqueIDBDatabase): Deleted.
1271         * Modules/indexeddb/server/IDBServer.h:
1272         
1273         Make all the other changes mentioned above:
1274         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1275         (WebCore::IDBServer::UniqueIDBDatabase::~UniqueIDBDatabase): Bulk up on ASSERTs
1276         (WebCore::IDBServer::UniqueIDBDatabase::openDatabaseConnection): 
1277         (WebCore::IDBServer::UniqueIDBDatabase::performUnconditionalDeleteBackingStore):
1278         (WebCore::IDBServer::UniqueIDBDatabase::scheduleShutdownForClose):
1279         (WebCore::IDBServer::UniqueIDBDatabase::shutdownForClose):
1280         (WebCore::IDBServer::UniqueIDBDatabase::didShutdownForClose):
1281         (WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore):
1282         (WebCore::IDBServer::UniqueIDBDatabase::handleCurrentOperation):
1283         (WebCore::IDBServer::UniqueIDBDatabase::performIterateCursor):
1284         (WebCore::IDBServer::UniqueIDBDatabase::performPrefetchCursor):
1285         (WebCore::IDBServer::UniqueIDBDatabase::operationAndTransactionTimerFired):
1286         (WebCore::IDBServer::UniqueIDBDatabase::activateTransactionInBackingStore):
1287         (WebCore::IDBServer::UniqueIDBDatabase::transactionCompleted):
1288         (WebCore::IDBServer::UniqueIDBDatabase::postDatabaseTask):
1289         (WebCore::IDBServer::UniqueIDBDatabase::postDatabaseTaskReply):
1290         (WebCore::IDBServer::UniqueIDBDatabase::executeNextDatabaseTask):
1291         (WebCore::IDBServer::UniqueIDBDatabase::executeNextDatabaseTaskReply):
1292         (WebCore::IDBServer::UniqueIDBDatabase::maybeFinishHardClose):
1293         (WebCore::IDBServer::UniqueIDBDatabase::isDoneWithHardClose):
1294         (WebCore::IDBServer::UniqueIDBDatabase::immediateCloseForUserDelete):
1295         (WebCore::IDBServer::UniqueIDBDatabase::didPerformUnconditionalDeleteBackingStore): Deleted.
1296         * Modules/indexeddb/server/UniqueIDBDatabase.h:
1297         (WebCore::IDBServer::UniqueIDBDatabase::create): Deleted.
1298
1299 2017-07-10  Chris Dumez  <cdumez@apple.com>
1300
1301         Further WebResourceLoadStatisticsStore / ResourceLoadStatisticsStore clean up
1302         https://bugs.webkit.org/show_bug.cgi?id=174301
1303
1304         Reviewed by Brent Fulgham.
1305
1306         Moved some generic file system utility functions down to platform's FileSystem.h.
1307
1308         * platform/FileSystem.cpp:
1309         (WebCore::openAndLockFile):
1310         (WebCore::unlockAndCloseFile):
1311         * platform/FileSystem.h:
1312
1313 2017-07-10  Andreas Kling  <akling@apple.com>
1314
1315         REGRESSION(r210226): Keyboard-focused element not preserved when navigating back through page cache, causing multiple elements to have focus
1316         https://bugs.webkit.org/show_bug.cgi?id=174302
1317         <rdar://problem/33204273>
1318
1319         Reviewed by Antti Koivisto.
1320
1321         Don't clear the active/hovered/focused elements when destroying the render tree,
1322         since we might need to reconstruct it later, and would like to remember which
1323         elements those were.
1324
1325         Only the focused state actually stuck when going in and out of the page cache,
1326         but this patch removes all the element pointer clearing for consistency.
1327
1328         Test: fast/history/page-cache-element-state-focused.html
1329
1330         * dom/Document.cpp:
1331         (WebCore::Document::destroyRenderTree):
1332
1333 2017-07-10  Daniel Bates  <dabates@apple.com>
1334
1335         REGRESSION (r218616): Cannot build WebCore for macOS 10.12 with macOS 10.13 SDK
1336         https://bugs.webkit.org/show_bug.cgi?id=173939
1337
1338         Reviewed by Dan Bernstein.
1339
1340         (The code in this change was either suggested or written by Dan Bernstein with a very
1341         minor adjustment to get it to build).
1342
1343         Allow WebCore to link even though CTFontCreatePhysicalFontForCharactersWithLanguage() is
1344         undefined when building against the macOS 10.13 SDK targeting macOS 10.12. Let the dynamic
1345         linker resolve the undefined symbol.
1346
1347         For completeness the SPI CTFontCreatePhysicalFontForCharactersWithLanguage() was removed
1348         from the macOS 10.13 SDK.
1349
1350         * Configurations/WebCore.xcconfig: Tell the linker that CTFontCreatePhysicalFontForCharactersWithLanguage()
1351         can be undefined when building against macOS 10.13 or later SDK.
1352         * platform/spi/cocoa/CoreTextSPI.h: Annotate CTFontCreatePhysicalFontForCharactersWithLanguage()
1353         with its availability information.
1354
1355 2017-07-10  Zalan Bujtas  <zalan@apple.com>
1356
1357         Block of text is missing in iBooks sample books.
1358         https://bugs.webkit.org/show_bug.cgi?id=174295
1359         <rdar://problem/32955620>
1360
1361         Reviewed by Antti Koivisto.
1362
1363         In the simple line layout context, translating y coordinate to a line index is
1364         normally just a (y / line height) operation. However in case of strut offsets (pagination)
1365         we need to take these extra paddings into account while resolving the line index.
1366         This patch fixes the boundary checking for a given line by using the font size only
1367         when the font is taller than the line.
1368
1369         * rendering/SimpleLineLayoutResolver.cpp:
1370         (WebCore::SimpleLineLayout::RunResolver::adjustLineIndexForStruts):
1371
1372 2017-07-10  Carlos Garcia Campos  <cgarcia@igalia.com>
1373
1374         [SOUP] SoupCookieJar is never released (resulting in sqlite temp files lying around)
1375         https://bugs.webkit.org/show_bug.cgi?id=166029
1376
1377         Reviewed by Michael Catanzaro.
1378
1379         Add clearSoupNetworkSessionAndCookieStorage() to clear the SoupNetworkSession and cookie storage of the main
1380         network session, ensuring the cookies database is properly closed.
1381
1382         * platform/network/NetworkStorageSession.h:
1383         * platform/network/soup/NetworkStorageSessionSoup.cpp:
1384         (WebCore::NetworkStorageSession::clearSoupNetworkSessionAndCookieStorage):
1385
1386 2017-07-10  Carlos Garcia Campos  <cgarcia@igalia.com>
1387
1388         Move make-js-file-arrays.py from WebCore to JavaScriptCore
1389         https://bugs.webkit.org/show_bug.cgi?id=174024
1390
1391         Reviewed by Michael Catanzaro.
1392
1393         * CMakeLists.txt: Explicitly add files generated by MAKE_JS_FILE_ARRAYS to the build, since the macro no longer
1394         does it.
1395         * DerivedSources.make: Updated to use make-js-file-arrays.py from JavaScriptCore. It's no longer needed to set
1396         PYTHON_PATH to find jsmin.py.
1397
1398 2017-07-10  Charlie Turner  <cturner@igalia.com>
1399
1400         [GTK] http/tests/media/video-redirect.html is failing
1401         https://bugs.webkit.org/show_bug.cgi?id=174260
1402
1403         Reviewed by Carlos Garcia Campos.
1404
1405         Make sure we're testing new URLs within the same security origin.
1406
1407         Covered by existing tests.
1408
1409         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1410         (WebCore::convertToInternalProtocol): Factor out setting our
1411         internal URL schema.
1412         (WebCore::MediaPlayerPrivateGStreamer::setPlaybinURL): Use the
1413         refactored helper.
1414         (WebCore::MediaPlayerPrivateGStreamer::loadNextLocation): Use
1415         refactored helper to ensure both URLs have the same origin.
1416
1417 2017-07-08  John Wilander  <wilander@apple.com>
1418
1419         Resource Load Statistics: User interaction should always go to top document
1420         https://bugs.webkit.org/show_bug.cgi?id=174120
1421         <rdar://problem/33117899>
1422
1423         Reviewed by Chris Dumez.
1424
1425         Test: http/tests/loading/resourceLoadStatistics/user-interaction-in-cross-origin-sub-frame.html
1426
1427         * dom/UserGestureIndicator.cpp:
1428         (WebCore::UserGestureIndicator::UserGestureIndicator):
1429             Now logs user interaction for the top document.
1430         * loader/ResourceLoadObserver.cpp:
1431         (WebCore::ResourceLoadObserver::setThrottledObserverNotifications):
1432             Test infrastructure.
1433         (WebCore::ResourceLoadObserver::setNotificationCallback):
1434             Callback now takes a ResourceLoadObserver::NotificationType.
1435         (WebCore::ResourceLoadObserver::logFrameNavigation):
1436             Submits the configured ResourceLoadObserver::NotificationType.
1437         (WebCore::ResourceLoadObserver::logSubresourceLoading):
1438             Submits the configured ResourceLoadObserver::NotificationType.
1439         (WebCore::ResourceLoadObserver::logWebSocketLoading):
1440             Submits the configured ResourceLoadObserver::NotificationType.
1441         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
1442             Submits the configured ResourceLoadObserver::NotificationType.
1443         * loader/ResourceLoadObserver.h:
1444         * testing/Internals.cpp:
1445         (WebCore::Internals::resetToConsistentState):
1446             Resets to throttled notifications.
1447         (WebCore::Internals::setResourceLoadStatisticsThrottledObserverNotifications):
1448             Test infrastructure.
1449         * testing/Internals.h:
1450         * testing/Internals.idl:
1451             Added internals.setResourceLoadStatisticsThrottledObserverNotifications().
1452
1453 2017-07-09  Brady Eidson  <beidson@apple.com>
1454
1455         Remove some obsolete WebKitVersionChecks.
1456         https://bugs.webkit.org/show_bug.cgi?id=174294
1457
1458         Reviewed by Dan Bernstein.
1459
1460         No new tests (No change to testable behavior)
1461
1462         * dom/ScriptExecutionContext.cpp:
1463         (WebCore::ScriptExecutionContext::dispatchErrorEvent):
1464         
1465         * page/Settings.in:
1466         
1467         * platform/RuntimeApplicationChecks.h:
1468         * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
1469         (WebCore::IOSApplication::isOkCupid): Deleted.
1470         (WebCore::IOSApplication::isFacebook): Deleted.
1471         
1472         * rendering/RenderBox.cpp:
1473         (WebCore::RenderBox::layoutOverflowRectForPropagation):
1474
1475 2017-07-08  Brady Eidson  <beidson@apple.com>
1476
1477         Remove some obsolete RuntimeApplicationChecks.
1478         https://bugs.webkit.org/show_bug.cgi?id=174293
1479
1480         Reviewed by Dan Bernstein.
1481
1482         No new tests (No change to testable behavior)
1483
1484         * html/HTMLObjectElement.cpp:
1485         (WebCore::HTMLObjectElement::parametersForPlugin):
1486         (WebCore::shouldNotPerformURLAdjustment): Deleted.
1487
1488         * platform/RuntimeApplicationChecks.h:
1489         * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
1490         (WebCore::IOSApplication::isDaijisenDictionary): Deleted.
1491         (WebCore::IOSApplication::isNASAHD): Deleted.
1492         (WebCore::IOSApplication::isTheEconomistOnIphone): Deleted.
1493
1494         * platform/ios/wak/WebCoreThread.h:
1495         * platform/ios/wak/WebCoreThread.mm:
1496         (StartWebThread):
1497         (WebThreadSetDelegateSourceRunLoopMode): Deleted.
1498
1499 2017-07-08  Basuke Suzuki  <Basuke.Suzuki@sony.com>
1500
1501         [Curl] Safe access and life cycle management of bare Curl handle
1502         by wrapping with C++ class
1503         https://bugs.webkit.org/show_bug.cgi?id=174002
1504
1505         Reviewed by Alex Christensen.
1506
1507         * platform/network/ResourceHandle.h:
1508         * platform/network/ResourceHandleInternal.h:
1509         * platform/network/curl/CookieJarCurl.cpp:
1510         (WebCore::setCookiesFromDOM):
1511         (WebCore::cookiesForSession):
1512         * platform/network/curl/CurlContext.cpp:
1513         (WebCore::CurlContext::CurlContext):
1514         (WebCore::CurlContext::~CurlContext):
1515         (WebCore::CurlContext::initCookieSession):
1516         (WebCore::CurlShareHandle::CurlShareHandle):
1517         (WebCore::CurlShareHandle::~CurlShareHandle):
1518         (WebCore::CurlShareHandle::lockCallback):
1519         (WebCore::CurlShareHandle::unlockCallback):
1520         (WebCore::CurlShareHandle::mutexFor):
1521         (WebCore::CurlMultiHandle::CurlMultiHandle):
1522         (WebCore::CurlMultiHandle::~CurlMultiHandle):
1523         (WebCore::CurlMultiHandle::addHandle):
1524         (WebCore::CurlMultiHandle::removeHandle):
1525         (WebCore::CurlMultiHandle::getFdSet):
1526         (WebCore::CurlMultiHandle::perform):
1527         (WebCore::CurlMultiHandle::readInfo):
1528         (WebCore::CurlHandle::CurlHandle):
1529         (WebCore::CurlHandle::~CurlHandle):
1530         (WebCore::CurlHandle::perform):
1531         (WebCore::CurlHandle::pause):
1532         (WebCore::CurlHandle::enableShareHandle):
1533         (WebCore::CurlHandle::setPrivateData):
1534         (WebCore::CurlHandle::setUrl):
1535         (WebCore::CurlHandle::clearUrl):
1536         (WebCore::CurlHandle::clearRequestHeaders):
1537         (WebCore::CurlHandle::appendRequestHeader):
1538         (WebCore::CurlHandle::enableRequestHeaders):
1539         (WebCore::CurlHandle::enableHttpGetRequest):
1540         (WebCore::CurlHandle::enableHttpHeadRequest):
1541         (WebCore::CurlHandle::enableHttpPostRequest):
1542         (WebCore::CurlHandle::setPostFields):
1543         (WebCore::CurlHandle::setPostFieldLarge):
1544         (WebCore::CurlHandle::enableHttpPutRequest):
1545         (WebCore::CurlHandle::setInFileSizeLarge):
1546         (WebCore::CurlHandle::setHttpCustomRequest):
1547         (WebCore::CurlHandle::enableAcceptEncoding):
1548         (WebCore::CurlHandle::enableAllowedProtocols):
1549         (WebCore::CurlHandle::enableFollowLocation):
1550         (WebCore::CurlHandle::enableAutoReferer):
1551         (WebCore::CurlHandle::enableHttpAuthentication):
1552         (WebCore::CurlHandle::setHttpAuthUserPass):
1553         (WebCore::CurlHandle::enableCAInfoIfExists):
1554         (WebCore::CurlHandle::setSslVerifyPeer):
1555         (WebCore::CurlHandle::setSslVerifyHost):
1556         (WebCore::CurlHandle::setSslCert):
1557         (WebCore::CurlHandle::setSslCertType):
1558         (WebCore::CurlHandle::setSslKeyPassword):
1559         (WebCore::CurlHandle::enableCookieJarIfExists):
1560         (WebCore::CurlHandle::setCookieList):
1561         (WebCore::CurlHandle::getCookieList):
1562         (WebCore::CurlHandle::clearCookieList):
1563         (WebCore::CurlHandle::enableProxyIfExists):
1564         (WebCore::CurlHandle::enableTimeout):
1565         (WebCore::CurlHandle::setHeaderCallbackFunction):
1566         (WebCore::CurlHandle::setWriteCallbackFunction):
1567         (WebCore::CurlHandle::setReadCallbackFunction):
1568         (WebCore::CurlHandle::setSslCtxCallbackFunction):
1569         (WebCore::CurlHandle::getEffectiveURL):
1570         (WebCore::CurlHandle::getPrimaryPort):
1571         (WebCore::CurlHandle::getResponseCode):
1572         (WebCore::CurlHandle::getContentLenghtDownload):
1573         (WebCore::CurlHandle::getHttpAuthAvail):
1574         (WebCore::CurlHandle::getTimes):
1575         (WebCore::CurlHandle::maxCurlOffT):
1576         (WebCore::CurlHandle::expectedSizeOfCurlOffT):
1577         (WebCore::CurlHandle::enableVerboseIfUsed):
1578         (WebCore::CurlHandle::enableStdErrIfUsed):
1579         (WebCore::CurlContext::getEffectiveURL): Deleted.
1580         (WebCore::CurlContext::createMultiHandle): Deleted.
1581         (WebCore::CurlContext::mutexFor): Deleted.
1582         (WebCore::CurlContext::lock): Deleted.
1583         (WebCore::CurlContext::unlock): Deleted.
1584         * platform/network/curl/CurlContext.h:
1585         (WebCore::CurlGlobal::CurlGlobal):
1586         (WebCore::CurlGlobal::~CurlGlobal):
1587         (WebCore::CurlShareHandle::handle):
1588         (WebCore::CurlContext::shareHandle):
1589         (WebCore::CurlHandle::handle):
1590         (WebCore::CurlHandle::url):
1591         (WebCore::CurlContext::curlShareHandle): Deleted.
1592         * platform/network/curl/CurlDownload.cpp:
1593         (WebCore::CurlDownload::~CurlDownload):
1594         (WebCore::CurlDownload::init):
1595         (WebCore::CurlDownload::start):
1596         (WebCore::CurlDownload::cancel):
1597         (WebCore::CurlDownload::getUrl):
1598         (WebCore::CurlDownload::addHeaders):
1599         (WebCore::CurlDownload::didReceiveHeader):
1600         (WebCore::CurlDownload::writeCallback):
1601         * platform/network/curl/CurlDownload.h:
1602         * platform/network/curl/CurlJobManager.cpp:
1603         (WebCore::CurlJobManager::CurlJobManager):
1604         (WebCore::CurlJobManager::~CurlJobManager):
1605         (WebCore::CurlJobManager::addToCurl):
1606         (WebCore::CurlJobManager::removeFromCurl):
1607         (WebCore::CurlJobManager::workerThread):
1608         * platform/network/curl/CurlJobManager.h:
1609         (WebCore::CurlJobManager::getMultiHandle): Deleted.
1610         * platform/network/curl/ResourceHandleCurl.cpp:
1611         (WebCore::ResourceHandleInternal::~ResourceHandleInternal):
1612         (WebCore::ResourceHandle::platformSetDefersLoading):
1613         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
1614         (WebCore::ResourceHandle::receivedCredential):
1615         (WebCore::ResourceHandle::receivedRequestToContinueWithoutCredential):
1616         (WebCore::calculateWebTimingInformations):
1617         (WebCore::handleLocalReceiveResponse):
1618         (WebCore::writeCallback):
1619         (WebCore::getProtectionSpace):
1620         (WebCore::headerCallback):
1621         (WebCore::readCallback):
1622         (WebCore::setupFormData):
1623         (WebCore::ResourceHandle::setupPUT):
1624         (WebCore::ResourceHandle::setupPOST):
1625         (WebCore::ResourceHandle::dispatchSynchronousJob):
1626         (WebCore::ResourceHandle::applyAuthentication):
1627         (WebCore::ResourceHandle::initialize):
1628         (WebCore::ResourceHandle::handleCurlMsg):
1629         * platform/network/curl/ResourceHandleManager.cpp:
1630         (WebCore::ResourceHandleManager::ResourceHandleManager):
1631         (WebCore::ResourceHandleManager::~ResourceHandleManager):
1632         (WebCore::ResourceHandleManager::downloadTimerCallback):
1633         (WebCore::ResourceHandleManager::removeFromCurl):
1634         (WebCore::ResourceHandleManager::startJob):
1635         * platform/network/curl/ResourceHandleManager.h:
1636         * platform/network/curl/SSLHandle.cpp:
1637         (WebCore::setSSLClientCertificate):
1638         (WebCore::certVerifyCallback):
1639         (WebCore::setSSLVerifyOptions):
1640
1641 2017-07-08  Antoine Quint  <graouts@apple.com>
1642
1643         REGRESSION: "visibility:hidden" does not hide play button for video elements
1644         https://bugs.webkit.org/show_bug.cgi?id=174258
1645         <rdar://problem/33181452>
1646
1647         Reviewed by Dean Jackson.
1648
1649         In order to not have most styles from the page affect the shadow root, we set "all: initial" on the
1650         media controls container. However, we need to still make the "visibility" property inherit from its
1651         host such that "visibility: hidden" on the host won't be overridden by setting the property back to
1652         its initial value, which is "visible".
1653
1654         Test: media/modern-media-controls/css/visibility-hidden.html
1655
1656         * Modules/modern-media-controls/controls/media-controls.css:
1657         (.media-controls-container):
1658
1659 2017-07-08  Yusuke Suzuki  <utatane.tea@gmail.com>
1660
1661         Drop NOSNIFF compile flag
1662         https://bugs.webkit.org/show_bug.cgi?id=174289
1663
1664         Reviewed by Michael Catanzaro.
1665
1666         * Configurations/FeatureDefines.xcconfig:
1667         * css/StyleSheetContents.cpp:
1668         (WebCore::StyleSheetContents::parseAuthorStyleSheet):
1669         (WebCore::StyleSheetContents::notifyLoadedSheet):
1670         * dom/LoadableClassicScript.cpp:
1671         (WebCore::LoadableClassicScript::notifyFinished):
1672         * loader/cache/CachedCSSStyleSheet.cpp:
1673         (WebCore::CachedCSSStyleSheet::mimeTypeAllowedByNosniff):
1674         (WebCore::CachedCSSStyleSheet::canUseSheet):
1675         * loader/cache/CachedCSSStyleSheet.h:
1676         * platform/network/HTTPParsers.cpp:
1677         (WebCore::parseContentTypeOptionsHeader):
1678         * platform/network/HTTPParsers.h:
1679         * platform/network/ResourceResponseBase.cpp:
1680         (WebCore::isScriptAllowedByNosniff):
1681         * platform/network/ResourceResponseBase.h:
1682         * workers/WorkerScriptLoader.cpp:
1683         (WebCore::WorkerScriptLoader::didReceiveResponse):
1684
1685 2017-07-07  Brent Fulgham  <bfulgham@apple.com>
1686
1687         [WK2] Use a rolling 30-day uptime for processing statistics
1688         https://bugs.webkit.org/show_bug.cgi?id=174235
1689         <rdar://problem/33164381>
1690
1691         Reviewed by Chris Dumez.
1692
1693         Add a KeyedDecoder specialization for Deque.
1694
1695         * platform/KeyedCoding.h:
1696         (WebCore::KeyedDecoder::decodeObjects):
1697
1698 2017-07-07  Daniel Bates  <dabates@apple.com>
1699
1700         [AppCache] Ignore fallback entries whose namespace is not prefixed with manifest path
1701         https://bugs.webkit.org/show_bug.cgi?id=174273
1702         <rdar://problem/33011682>
1703
1704         Reviewed by Brent Fulgham.
1705
1706         As per <https://html.spec.whatwg.org/multipage/offline.html#parsing-cache-manifests> (07/06/2017)
1707         we should ignore fallback entires whose fallback namespace URL is not prefixed with
1708         the manifest path. For now we only apply this policy when the manifest is served with
1709         a non-standard Content-Type to minimize web compatibility risk.
1710
1711         Test: http/tests/appcache/fallback-namespace-outside-manifest-path.html
1712
1713         * loader/appcache/ApplicationCacheGroup.cpp:
1714         (WebCore::ApplicationCacheGroup::didFinishLoadingManifest): Pass the MIME type of the manifest.
1715         * loader/appcache/ManifestParser.cpp:
1716         (WebCore::manifestPath): Computes the manifest path from a manifest URL.
1717         (WebCore::parseManifest): Modified to take the MIME type of the manifest. If the MIME type is
1718         non-standard (i.e. not text/cached-manifest) then skip fallback entries whose namespace is not
1719         prefixed with the manifest path. Otherwise, process fallback entries as we do now. Also cleaned
1720         up the code a bit while I was here, including renaming a local variable to be more descriptive
1721         and using a const character array for the manifest signature to avoid the need to document the
1722         length of the manifest signature in a comment.
1723         * loader/appcache/ManifestParser.h:
1724
1725 2017-07-07  Wenson Hsieh  <wenson_hsieh@apple.com>
1726
1727         [iOS DnD] For cross-app drags, 'drop' event handlers are never invoked if dataTransfer.dropEffect is not set while dragging
1728         https://bugs.webkit.org/show_bug.cgi?id=174219
1729         <rdar://problem/32083177>
1730
1731         Reviewed by Ryosuke Niwa.
1732
1733         Currently, in DragController.cpp, defaultOperationForDrag maps a drag source operation mask of
1734         DragOperationGeneric to DragOperationMove across all platforms. However, on iOS, where cross-app drag moves do
1735         not trigger a drop, this means drop handlers won't fire unless the dropEffect is explicitly set to copy.
1736
1737         To fix this, we introduce DragController::platformGenericDragOperation(), which returns DragOperationCopy on iOS
1738         and DragOperationMove (the existing behavior) elsewhere. defaultOperationForDrag then maps a drag source
1739         operation mask of DragOperationGeneric to platformGenericDragOperation().
1740
1741         Tests:  DataInteractionTests.ExternalSourceHTMLToUploadArea
1742                 DataInteractionTests.ExternalSourceImageAndHTMLToUploadArea
1743                 DataInteractionTests.ExternalSourceMoveOperationNotAllowed
1744
1745         * page/DragController.cpp:
1746         (WebCore::DragController::platformGenericDragOperation):
1747         (WebCore::defaultOperationForDrag):
1748         * page/DragController.h:
1749         * page/mac/DragControllerMac.mm:
1750         (WebCore::DragController::platformGenericDragOperation):
1751
1752 2017-07-07  Devin Rousso  <drousso@apple.com>
1753
1754         Web Inspector: Show all elements currently using a given CSS Canvas
1755         https://bugs.webkit.org/show_bug.cgi?id=173965
1756
1757         Reviewed by Joseph Pecoraro.
1758
1759         Test: inspector/canvas/css-canvas-clients.html
1760
1761         * css/CSSImageGeneratorValue.cpp:
1762         (WebCore::CSSImageGeneratorValue::addClient):
1763         (WebCore::CSSImageGeneratorValue::removeClient):
1764         * css/CSSImageGeneratorValue.h:
1765         (WebCore::CSSImageGeneratorValue::clients):
1766         * html/HTMLCanvasElement.cpp:
1767         (WebCore::HTMLCanvasElement::addObserver):
1768         (WebCore::HTMLCanvasElement::removeObserver):
1769         (WebCore::HTMLCanvasElement::cssCanvasClients):
1770         Each time an observer is added/removed for a given HTMLCanvasElement, send an event to the
1771         inspector frontend that the CSS canvas client nodes have changed. Additionally, anytime a
1772         client/use is added/removed from one of the observing CSSCanvasValue, fire the same event.
1773
1774         * css/CSSCanvasValue.h:
1775         (isType):
1776         * html/HTMLCanvasElement.h:
1777         (WebCore::CanvasObserver::isCSSCanvasValueObserver):
1778         Allows type traits to distinguish CanvasObserver from CSSCanvasValue::CanvasObserverProxy.
1779
1780         * inspector/InspectorCanvasAgent.h:
1781         * inspector/InspectorCanvasAgent.cpp:
1782         (WebCore::InspectorCanvasAgent::requestCSSCanvasClientNodes):
1783         (WebCore::InspectorCanvasAgent::didChangeCSSCanvasClientNodes):
1784         * inspector/InspectorInstrumentation.h:
1785         (WebCore::InspectorInstrumentation::didChangeCSSCanvasClientNodes):
1786         * inspector/InspectorInstrumentation.cpp:
1787         (WebCore::InspectorInstrumentation::didChangeCSSCanvasClientNodesImpl):
1788         Notify the frontend that the list of client nodes has changed for the given canvas. Let the
1789         frontend request the actual list of node IDs when it needs, possibly at a later time.
1790
1791 2017-07-07  Jer Noble  <jer.noble@apple.com>
1792
1793         AVPlayer can continue to be active after released by MediaPlayerPrivateAVFoundationObjC.
1794         https://bugs.webkit.org/show_bug.cgi?id=174264
1795
1796         Reviewed by Eric Carlson.
1797
1798         If the AVPlayer is retained (by an autorelease pool, or internally by other objects in
1799         AVFoundation), releasing the AVPlayer is not enough to cancel loading or playback. So before
1800         releasing the AVPlayer, make sure to disassociate the current AVPlayerItem, which should
1801         cancel all activity in the AVPlayer.
1802
1803         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1804         (WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad):
1805
1806 2017-07-07  Basuke Suzuki  <Basuke.Suzuki@sony.com>
1807
1808         [Curl] Remove data url handler for async load
1809         https://bugs.webkit.org/show_bug.cgi?id=174263
1810
1811         data url is handled by ResourceLoader. No need for specific handling
1812         in platform dependent layer.
1813
1814         Reviewed by Alex Christensen.
1815
1816         * platform/network/curl/ResourceHandleManager.cpp:
1817         (WebCore::ResourceHandleManager::startJob):
1818
1819 2017-07-07  Matt Lewis  <jlewis3@apple.com>
1820
1821         Unreviewed, rolling out r219257.
1822
1823         The test added in the revision was still extreamly flaky on
1824         all testers.
1825
1826         Reverted changeset:
1827
1828         "[SVG] Leak in SVGAnimatedListPropertyTearOff"
1829         https://bugs.webkit.org/show_bug.cgi?id=172545
1830         http://trac.webkit.org/changeset/219257
1831
1832 2017-07-07  Commit Queue  <commit-queue@webkit.org>
1833
1834         Unreviewed, rolling out r219238, r219239, and r219241.
1835         https://bugs.webkit.org/show_bug.cgi?id=174265
1836
1837         "fast/workers/dedicated-worker-lifecycle.html is flaky"
1838         (Requested by yusukesuzuki on #webkit).
1839
1840         Reverted changesets:
1841
1842         "[WTF] Implement WTF::ThreadGroup"
1843         https://bugs.webkit.org/show_bug.cgi?id=174081
1844         http://trac.webkit.org/changeset/219238
1845
1846         "Unreviewed, build fix after r219238"
1847         https://bugs.webkit.org/show_bug.cgi?id=174081
1848         http://trac.webkit.org/changeset/219239
1849
1850         "Unreviewed, CLoop build fix after r219238"
1851         https://bugs.webkit.org/show_bug.cgi?id=174081
1852         http://trac.webkit.org/changeset/219241
1853
1854 2017-05-24  Sergio Villar Senin  <svillar@igalia.com>
1855
1856         [SVG] Leak in SVGAnimatedListPropertyTearOff
1857         https://bugs.webkit.org/show_bug.cgi?id=172545
1858
1859         Reviewed by Said Abou-Hallawa.
1860
1861         SVGAnimatedListPropertyTearOff maintains a vector m_wrappers with references to
1862         SVGPropertyTraits<PropertyType>::ListItemTearOff. Apart from that SVGPropertyTearOff has a
1863         reference to SVGAnimatedProperty.
1864
1865         When SVGListProperty::getItemValuesAndWrappers() is called, it creates a
1866         SVGPropertyTraits<PropertyType>::ListItemTearOff pointing to the same SVGAnimatedProperty (a
1867         SVGAnimatedListPropertyTearOff) which stores the m_wrappers vector where the ListItemTearOff
1868         is going to be added to. This effectively creates a reference cycle between the
1869         SVGAnimatedListPropertyTearOff and all the ListItemTearOff it stores in m_wrappers.
1870
1871         We should detach those wrappers in propertyWillBeDeleted() in order to break the cycle.
1872
1873         * svg/properties/SVGAnimatedListPropertyTearOff.h:
1874
1875 2017-07-07  Charlie Turner  <cturner@igalia.com>
1876
1877         [GStreamer] vid.me videos do not play
1878         https://bugs.webkit.org/show_bug.cgi?id=172240
1879
1880         Reviewed by Xabier Rodriguez-Calvar.
1881
1882         In r142251, code to hide the WK HTTP source elements from elsewhere in
1883         the pipeline was removed. This has the nasty side-effect of
1884         auto-plugging the WK HTTP source into things it really should not be
1885         used in, especially the adaptive streaming demuxers. The reasons this
1886         is bad are documented in several places on Bugzilla, see the parent
1887         bug report for more details. The high-level issue is that the WK HTTP
1888         source and its use of WebCore is not thread-safe. Although work has
1889         been recently done to improve this situation, it's still not perfect.
1890
1891         Another issue is the interface hlsdemux expects its HTTP source to
1892         implement, specifically seeking in READY.
1893
1894         This does rely on HTTP context sharing being available in GStreamer,
1895         upstream bug is here:
1896         https://bugzilla.gnome.org/show_bug.cgi?id=761099. The failing case
1897         can be demonstrated with
1898         https://github.com/thiagoss/adaptive-test-server but manual testing on
1899         popular video hosting sites, including vid.me, shows that this doesn't
1900         bite us at the moment, just something else to fix in the future.
1901
1902         There are some QoS issues with the adaptive streaming code in
1903         GStreamer, but it seems much better to offer a below par QoS in lieu
1904         of crashing/livelocking when playing certain streams, and issues can be
1905         raised upstream when they arise.
1906
1907         This patch does take us further away from the future goal of having all
1908         networking operations go through the network process, but in return it
1909         solves some nasty crashes and livelocks that have been irritating
1910         users for some time. With the pressure off on this issue, work can be
1911         planned to consider how to make the WK HTTP source a better citizen
1912         inside the GStreamer pipeline when we migrate the netcode to go
1913         through the network process.
1914
1915         A new test is added to check that the single file HLS playlists
1916         (new in version 4) can be played, which was the primary cause of
1917         this bug report.
1918
1919         Test: http/tests/media/hls/range-request.html
1920
1921         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1922         (WebCore::MediaPlayerPrivateGStreamer::setPlaybinURL): Perform
1923         some trickery to make sure that we only ever fetch URLs handed to
1924         us by WebCore. Any further URLs discovered inside the pipeline
1925         will not get WKWS auto-plugged, since they'll be plain https?
1926         schemas.
1927         (WebCore::MediaPlayerPrivateGStreamer::load): Refactor to use the
1928         setPlaybinURL helper method.
1929         (WebCore::MediaPlayerPrivateGStreamer::loadNextLocation): Ditto.
1930         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: Add
1931         the setPlaybinURL helper method.
1932         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
1933         (webKitWebSrcGetProtocols): Only advertise webkit+https?, this
1934         ensures we won't get auto-plugged by pipeline elements asking for
1935         an element to fetch https? resources (like adaptive demuxers).
1936         (convertPlaybinURI): Undo the trick when another element asks us
1937         for our URI.
1938
1939 2017-07-05  Yusuke Suzuki  <utatane.tea@gmail.com>
1940
1941         [WTF] Implement WTF::ThreadGroup
1942         https://bugs.webkit.org/show_bug.cgi?id=174081
1943
1944         Reviewed by Mark Lam.
1945
1946         * page/ResourceUsageThread.h:
1947
1948 2017-07-06  Yusuke Suzuki  <utatane.tea@gmail.com>
1949
1950         [WTF] Clean up StringStatics.cpp by using LazyNeverDestroyed<> for Atoms
1951         https://bugs.webkit.org/show_bug.cgi?id=174150
1952
1953         Reviewed by Mark Lam.
1954
1955         * Modules/mediacontrols/MediaControlsHost.cpp:
1956         (WebCore::MediaControlsHost::captionDisplayMode):
1957         * Modules/mediastream/RTCDataChannel.cpp:
1958         (WebCore::RTCDataChannel::binaryType):
1959         * accessibility/AXObjectCache.cpp:
1960         (WebCore::createFromRenderer):
1961         * accessibility/AccessibilityMediaControls.cpp:
1962         (WebCore::AccessibilityMediaControl::controlTypeName):
1963         * accessibility/AccessibilityObject.cpp:
1964         (WebCore::AccessibilityObject::language):
1965         (WebCore::AccessibilityObject::defaultLiveRegionStatusForRole):
1966         (WebCore::AccessibilityObject::actionVerb):
1967         (WebCore::AccessibilityObject::getAttribute):
1968         (WebCore::AccessibilityObject::placeholderValue):
1969         * accessibility/AccessibilityObject.h:
1970         (WebCore::AccessibilityObject::accessKey):
1971         (WebCore::AccessibilityObject::ariaLiveRegionRelevant):
1972         * accessibility/AccessibilityRenderObject.cpp:
1973         (WebCore::AccessibilityRenderObject::accessKey):
1974         (WebCore::AccessibilityRenderObject::actionVerb):
1975         * bindings/js/JSCustomElementInterface.cpp:
1976         (WebCore::JSCustomElementInterface::constructElementWithFallback):
1977         * bindings/js/JSCustomElementRegistryCustom.cpp:
1978         (WebCore::JSCustomElementRegistry::define):
1979         * bindings/scripts/CodeGeneratorJS.pm:
1980         (GenerateDefaultValue):
1981         * bindings/scripts/test/JS/JSTestObj.cpp:
1982         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringBody):
1983         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringIsNullBody):
1984         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringIsEmptyStringBody):
1985         * css/CSSPageRule.cpp:
1986         (WebCore::CSSPageRule::selectorText):
1987         * css/CSSPrimitiveValue.cpp:
1988         (WebCore::valueName):
1989         * css/CSSSelector.cpp:
1990         (WebCore::simpleSelectorSpecificityInternal):
1991         (WebCore::CSSSelector::specificityForPage):
1992         (WebCore::CSSSelector::RareData::RareData):
1993         * css/CSSSelector.h:
1994         (WebCore::CSSSelector::argument):
1995         * css/CSSSelectorList.cpp:
1996         (WebCore::SelectorNeedsNamespaceResolutionFunctor::operator()):
1997         * css/PageRuleCollector.cpp:
1998         (WebCore::checkPageSelectorComponents):
1999         * css/RuleSet.cpp:
2000         (WebCore::computeMatchBasedOnRuleHash):
2001         (WebCore::RuleSet::addRule):
2002         * css/SelectorChecker.cpp:
2003         (WebCore::tagMatches):
2004         * css/SelectorFilter.cpp:
2005         (WebCore::collectDescendantSelectorIdentifierHashes):
2006         * css/StyleBuilderConverter.h:
2007         (WebCore::StyleBuilderConverter::convertStringOrAuto):
2008         (WebCore::StyleBuilderConverter::convertStringOrNone):
2009         * css/StyleBuilderCustom.h:
2010         (WebCore::StyleBuilderCustom::applyValueWebkitLocale):
2011         (WebCore::StyleBuilderCustom::applyValueWebkitTextEmphasisStyle):
2012         (WebCore::StyleBuilderCustom::applyValueContent):
2013         (WebCore::StyleBuilderCustom::applyValueAlt):
2014         * css/StyleSheetContents.cpp:
2015         (WebCore::StyleSheetContents::StyleSheetContents):
2016         (WebCore::StyleSheetContents::namespaceURIFromPrefix):
2017         * css/makeprop.pl:
2018         * css/parser/CSSParserImpl.cpp:
2019         (WebCore::CSSParserImpl::parsePageSelector):
2020         * css/parser/CSSSelectorParser.cpp:
2021         (WebCore::CSSSelectorParser::consumeCompoundSelector):
2022         (WebCore::CSSSelectorParser::consumeName):
2023         (WebCore::CSSSelectorParser::consumeAttribute):
2024         (WebCore::CSSSelectorParser::defaultNamespace):
2025         (WebCore::CSSSelectorParser::determineNamespace):
2026         (WebCore::CSSSelectorParser::prependTypeSelectorIfNeeded):
2027         * cssjit/SelectorCompiler.cpp:
2028         (WebCore::SelectorCompiler::attributeNameTestingRequiresNamespaceRegister):
2029         (WebCore::SelectorCompiler::equalTagNames):
2030         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeMatching):
2031         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementHasTagName):
2032         * dom/Attr.cpp:
2033         (WebCore::Attr::setPrefix):
2034         (WebCore::Attr::attachToElement):
2035         * dom/Attribute.h:
2036         (WebCore::Attribute::nameMatchesFilter):
2037         * dom/ConstantPropertyMap.cpp:
2038         (WebCore::ConstantPropertyMap::nameForProperty):
2039         * dom/ContainerNode.cpp:
2040         (WebCore::ContainerNode::getElementsByTagName):
2041         (WebCore::ContainerNode::getElementsByTagNameNS):
2042         * dom/CustomElementReactionQueue.cpp:
2043         (WebCore::CustomElementReactionQueue::enqueuePostUpgradeReactions):
2044         * dom/DatasetDOMStringMap.cpp:
2045         (WebCore::convertPropertyNameToAttributeName):
2046         * dom/Document.cpp:
2047         (WebCore::createUpgradeCandidateElement):
2048         (WebCore::Document::createElementForBindings):
2049         (WebCore::Document::importNode):
2050         (WebCore::Document::hasValidNamespaceForElements):
2051         (WebCore::Document::processBaseElement):
2052         (WebCore::Document::dir):
2053         (WebCore::Document::bgColor):
2054         (WebCore::Document::fgColor):
2055         (WebCore::Document::alinkColor):
2056         (WebCore::Document::linkColorForBindings):
2057         (WebCore::Document::vlinkColor):
2058         * dom/Document.h:
2059         * dom/Element.cpp:
2060         (WebCore::Element::setBooleanAttribute):
2061         (WebCore::Element::synchronizeAttribute):
2062         (WebCore::Element::getAttribute):
2063         (WebCore::Element::getAttributeNS):
2064         (WebCore::Element::setAttribute):
2065         (WebCore::Element::parserSetAttributes):
2066         (WebCore::Element::didMoveToNewDocument):
2067         (WebCore::Element::setPrefix):
2068         (WebCore::Element::insertedInto):
2069         (WebCore::Element::removedFrom):
2070         (WebCore::Element::removeAttributeInternal):
2071         (WebCore::Element::addAttributeInternal):
2072         (WebCore::Element::removeAttributeNS):
2073         (WebCore::Element::getAttributeNodeNS):
2074         (WebCore::Element::hasAttributeNS):
2075         (WebCore::Element::computeInheritedLanguage):
2076         (WebCore::Element::updateNameForDocument):
2077         (WebCore::Element::updateIdForDocument):
2078         (WebCore::Element::didAddAttribute):
2079         (WebCore::Element::didRemoveAttribute):
2080         (WebCore::Element::cloneAttributesFromElement):
2081         * dom/Element.h:
2082         (WebCore::Element::attributeWithoutSynchronization):
2083         (WebCore::Element::idForStyleResolution):
2084         (WebCore::Element::getIdAttribute):
2085         (WebCore::Element::getNameAttribute):
2086         * dom/EventTarget.cpp:
2087         (WebCore::legacyType):
2088         * dom/MutationRecord.h:
2089         (WebCore::MutationRecord::attributeName):
2090         (WebCore::MutationRecord::attributeNamespace):
2091         * dom/NamedNodeMap.cpp:
2092         (WebCore::NamedNodeMap::removeNamedItemNS):
2093         * dom/Node.cpp:
2094         (WebCore::Node::prefix):
2095         (WebCore::Node::localName):
2096         (WebCore::Node::namespaceURI):
2097         (WebCore::Node::checkSetPrefix):
2098         (WebCore::locateDefaultNamespace):
2099         (WebCore::Node::isDefaultNamespace):
2100         (WebCore::Node::lookupNamespaceURI):
2101         (WebCore::locateNamespacePrefix):
2102         (WebCore::Node::lookupPrefix):
2103         * dom/NodeRareData.h:
2104         (WebCore::NodeListsNodeData::addCachedTagCollectionNS):
2105         (WebCore::NodeListsNodeData::addCachedCollection):
2106         (WebCore::NodeListsNodeData::cachedCollection):
2107         (WebCore::NodeListsNodeData::removeCacheWithAtomicName):
2108         (WebCore::NodeListsNodeData::removeCachedTagCollectionNS):
2109         (WebCore::NodeListsNodeData::removeCachedCollection):
2110         * dom/PseudoElement.cpp:
2111         (WebCore::pseudoElementTagName):
2112         * dom/QualifiedName.cpp:
2113         (WebCore::QualifiedName::init):
2114         (WebCore::nullQName):
2115         (WebCore::createQualifiedName):
2116         * dom/QualifiedName.h:
2117         (WebCore::QualifiedName::hasPrefix):
2118         * dom/SelectorQuery.cpp:
2119         (WebCore::SelectorDataList::executeSingleTagNameSelectorData):
2120         * dom/SlotAssignment.cpp:
2121         (WebCore::slotNameFromAttributeValue):
2122         * dom/SlotAssignment.h:
2123         (WebCore::SlotAssignment::defaultSlotName):
2124         (WebCore::ShadowRoot::didRemoveAllChildrenOfShadowHost):
2125         (WebCore::ShadowRoot::didChangeDefaultSlot):
2126         * dom/TagCollection.cpp:
2127         (WebCore::TagCollection::TagCollection):
2128         (WebCore::HTMLTagCollection::HTMLTagCollection):
2129         * dom/TagCollection.h:
2130         (WebCore::TagCollectionNS::elementMatches):
2131         * dom/make_names.pl:
2132         (printNamesCppFile):
2133         (printDefinitions):
2134         (printFactoryCppFile):
2135         * editing/CompositeEditCommand.cpp:
2136         (WebCore::CompositeEditCommand::removeNodeAttribute):
2137         * editing/Editing.cpp:
2138         (WebCore::createHTMLElement):
2139         * editing/MarkupAccumulator.cpp:
2140         (WebCore::MarkupAccumulator::serializeNodesWithNamespaces):
2141         (WebCore::MarkupAccumulator::shouldAddNamespaceElement):
2142         (WebCore::MarkupAccumulator::shouldAddNamespaceAttribute):
2143         (WebCore::MarkupAccumulator::appendNamespace):
2144         (WebCore::MarkupAccumulator::appendOpenTag):
2145         (WebCore::MarkupAccumulator::appendAttribute):
2146         * editing/gtk/EditorGtk.cpp:
2147         (WebCore::elementURL):
2148         * editing/markup.cpp:
2149         (WebCore::AttributeChange::AttributeChange):
2150         * html/Autocapitalize.cpp:
2151         (WebCore::stringForAutocapitalizeType):
2152         * html/Autofill.cpp:
2153         (WebCore::AutofillData::createFromHTMLFormControlElement):
2154         * html/DOMTokenList.h:
2155         (WebCore::DOMTokenList::item):
2156         * html/FormAssociatedElement.cpp:
2157         (WebCore::FormAssociatedElement::name):
2158         * html/HTMLButtonElement.cpp:
2159         (WebCore::HTMLButtonElement::formControlType):
2160         * html/HTMLDetailsElement.cpp:
2161         (WebCore::HTMLDetailsElement::toggleOpen):
2162         * html/HTMLDocument.cpp:
2163         (WebCore::HTMLDocument::isCaseSensitiveAttribute):
2164         * html/HTMLElement.cpp:
2165         (WebCore::HTMLElement::eventNameForEventHandlerAttribute):
2166         (WebCore::toValidDirValue):
2167         * html/HTMLImageElement.cpp:
2168         (WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
2169         * html/HTMLInputElement.cpp:
2170         (WebCore::HTMLInputElement::name):
2171         (WebCore::HTMLInputElement::updateType):
2172         * html/HTMLMediaElement.cpp:
2173         (WebCore::HTMLMediaElement::doesHaveAttribute):
2174         * html/HTMLOptionElement.cpp:
2175         (WebCore::HTMLOptionElement::createForJSConstructor):
2176         * html/HTMLParamElement.cpp:
2177         (WebCore::HTMLParamElement::name):
2178         * html/HTMLSelectElement.cpp:
2179         (WebCore::HTMLSelectElement::setMultiple):
2180         * html/HTMLTableCellElement.cpp:
2181         (WebCore::HTMLTableCellElement::scope):
2182         * html/HTMLTrackElement.cpp:
2183         (WebCore::HTMLTrackElement::mediaElementCrossOriginAttribute):
2184         * html/LabelableElement.cpp:
2185         (WebCore::LabelableElement::labels):
2186         * html/LabelsNodeList.cpp:
2187         (WebCore::LabelsNodeList::~LabelsNodeList):
2188         * html/MediaController.cpp:
2189         (MediaController::playbackState):
2190         (eventNameForReadyState):
2191         * html/MediaDocument.cpp:
2192         (WebCore::MediaDocumentParser::createDocumentStructure):
2193         * html/parser/AtomicHTMLToken.h:
2194         (WebCore::AtomicHTMLToken::initializeAttributes):
2195         * html/parser/HTMLConstructionSite.cpp:
2196         (WebCore::HTMLConstructionSite::createElement):
2197         (WebCore::HTMLConstructionSite::createHTMLElementOrFindCustomElementInterface):
2198         * html/parser/HTMLParserIdioms.cpp:
2199         (WebCore::stripLeadingAndTrailingHTMLSpaces):
2200         (WebCore::parseHTMLHashNameReference):
2201         * html/parser/HTMLTreeBuilder.cpp:
2202         (WebCore::createForeignAttributesMap):
2203         * html/track/InbandTextTrack.cpp:
2204         (WebCore::InbandTextTrack::InbandTextTrack):
2205         * html/track/LoadableTextTrack.cpp:
2206         (WebCore::LoadableTextTrack::id):
2207         * html/track/TextTrack.cpp:
2208         (WebCore::TextTrack::captionMenuOffItem):
2209         (WebCore::TextTrack::captionMenuAutomaticItem):
2210         * html/track/TrackBase.cpp:
2211         (WebCore::MediaTrackBase::setKindInternal):
2212         * html/track/VTTRegion.cpp:
2213         (WebCore::VTTRegion::scroll):
2214         * html/track/WebVTTElement.cpp:
2215         (WebCore::nodeTypeToTagName):
2216         * html/track/WebVTTElement.h:
2217         * html/track/WebVTTToken.h:
2218         (WebCore::WebVTTToken::StartTag):
2219         * loader/FrameLoader.cpp:
2220         (WebCore::FrameLoader::clear):
2221         * loader/FrameLoader.h:
2222         * loader/ImageLoader.cpp:
2223         (WebCore::ImageLoader::clearFailedLoadURL):
2224         * loader/NavigationAction.h:
2225         * loader/PolicyChecker.cpp:
2226         (WebCore::PolicyChecker::checkNavigationPolicy):
2227         * page/DOMWindow.cpp:
2228         (WebCore::DOMWindow::showModalDialog):
2229         * page/EventHandler.cpp:
2230         (WebCore::eventNameForTouchPointState):
2231         * page/FrameTree.cpp:
2232         (WebCore::FrameTree::setName):
2233         (WebCore::FrameTree::clearName):
2234         * page/Page.cpp:
2235         (WebCore::Page::groupName):
2236         * platform/graphics/ComplexTextController.cpp:
2237         (WebCore::ComplexTextController::offsetForPosition):
2238         * platform/graphics/FontCache.cpp:
2239         (WebCore::FontCache::alternateFamilyName):
2240         * platform/graphics/FontDescription.h:
2241         (WebCore::FontCascadeDescription::initialLocale):
2242         * platform/graphics/FontGenericFamilies.cpp:
2243         (WebCore::genericFontFamilyForScript):
2244         * platform/graphics/InbandTextTrackPrivate.h:
2245         (WebCore::InbandTextTrackPrivate::inBandMetadataTrackDispatchType):
2246         * platform/graphics/TrackPrivateBase.h:
2247         (WebCore::TrackPrivateBase::id):
2248         (WebCore::TrackPrivateBase::label):
2249         (WebCore::TrackPrivateBase::language):
2250         * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
2251         (WebCore::AVTrackPrivateAVFObjCImpl::id):
2252         (WebCore::AVTrackPrivateAVFObjCImpl::label):
2253         (WebCore::AVTrackPrivateAVFObjCImpl::language):
2254         * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.h:
2255         * platform/graphics/avfoundation/cf/InbandTextTrackPrivateAVCF.cpp:
2256         (WebCore::InbandTextTrackPrivateAVCF::label):
2257         (WebCore::InbandTextTrackPrivateAVCF::language):
2258         * platform/graphics/avfoundation/cf/InbandTextTrackPrivateLegacyAVCF.cpp:
2259         (WebCore::InbandTextTrackPrivateLegacyAVCF::label):
2260         (WebCore::InbandTextTrackPrivateLegacyAVCF::language):
2261         * platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.mm:
2262         (WebCore::InbandTextTrackPrivateAVFObjC::label):
2263         (WebCore::InbandTextTrackPrivateAVFObjC::language):
2264         * platform/graphics/avfoundation/objc/InbandTextTrackPrivateLegacyAVFObjC.mm:
2265         (WebCore::InbandTextTrackPrivateLegacyAVFObjC::label):
2266         (WebCore::InbandTextTrackPrivateLegacyAVFObjC::language):
2267         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2268         (WebCore::metadataType):
2269         (WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive):
2270         * platform/graphics/cocoa/FontCacheCoreText.cpp:
2271         (WebCore::FontCache::platformAlternateFamilyName):
2272         * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
2273         (WebCore::FontCascadeDescription::effectiveFamilyAt):
2274         * platform/graphics/freetype/FontCacheFreeType.cpp:
2275         (WebCore::FontCache::platformAlternateFamilyName):
2276         * platform/graphics/gstreamer/InbandMetadataTextTrackPrivateGStreamer.h:
2277         (WebCore::InbandMetadataTextTrackPrivateGStreamer::create):
2278         * platform/graphics/win/FontCacheWin.cpp:
2279         (WebCore::FontCache::platformAlternateFamilyName):
2280         * platform/mediastream/AudioTrackPrivateMediaStream.h:
2281         * platform/mediastream/RealtimeMediaSourceSettings.cpp:
2282         (WebCore::RealtimeMediaSourceSettings::facingMode):
2283         * platform/mediastream/VideoTrackPrivateMediaStream.h:
2284         * rendering/HitTestResult.cpp:
2285         (WebCore::HitTestResult::linkSuggestedFilename):
2286         * rendering/InlineTextBox.cpp:
2287         (WebCore::InlineTextBox::paint):
2288         * rendering/RenderListItem.cpp:
2289         (WebCore::RenderListItem::markerText):
2290         * rendering/RenderText.cpp:
2291         (WebCore::RenderText::previousOffset):
2292         (WebCore::RenderText::nextOffset):
2293         * rendering/RenderTreeAsText.cpp:
2294         (WebCore::RenderTreeAsText::writeRenderObject):
2295         * rendering/TextPainter.cpp:
2296         (WebCore::TextPainter::paintTextAndEmphasisMarksIfNeeded):
2297         * rendering/style/RenderStyle.cpp:
2298         (WebCore::RenderStyle::textEmphasisMarkString):
2299         * rendering/style/RenderStyle.h:
2300         (WebCore::RenderStyle::initialHyphenationString):
2301         (WebCore::RenderStyle::initialTextEmphasisCustomMark):
2302         (WebCore::RenderStyle::initialContentAltText):
2303         (WebCore::RenderStyle::initialLineGrid):
2304         (WebCore::RenderStyle::initialFlowThread):
2305         (WebCore::RenderStyle::initialRegionThread):
2306         * style/StyleScope.cpp:
2307         (WebCore::Style::Scope::collectActiveStyleSheets):
2308         * svg/SVGElement.cpp:
2309         (WebCore::SVGElement::getPresentationAttribute):
2310         * svg/SVGElement.h:
2311         (WebCore::SVGAttributeHashTranslator::hash):
2312         * svg/SVGUseElement.cpp:
2313         (WebCore::SVGUseElement::transferSizeAttributesToTargetClone):
2314         * svg/animation/SVGSMILElement.cpp:
2315         (WebCore::SVGSMILElement::constructAttributeName):
2316         * testing/MockCDMFactory.cpp:
2317         (WebCore::MockCDMInstance::requestLicense):
2318         * xml/XMLErrors.cpp:
2319         (WebCore::createXHTMLParserErrorHeader):
2320         * xml/XPathStep.cpp:
2321         (WebCore::XPath::nodeMatchesBasicTest):
2322         (WebCore::XPath::Step::nodesInAxis):
2323         * xml/parser/XMLDocumentParserLibxml2.cpp:
2324         (WebCore::XMLDocumentParser::XMLDocumentParser):
2325         (WebCore::handleNamespaceAttributes):
2326         (WebCore::handleElementAttributes):
2327
2328 2017-07-06  Chris Dumez  <cdumez@apple.com>
2329
2330         Drop unnecessary uses of targetStatistics.dataRecordsRemoved in ResourceLoadObserver
2331         https://bugs.webkit.org/show_bug.cgi?id=174234
2332
2333         Reviewed by Brent Fulgham.
2334
2335         Drop unnecessary uses of targetStatistics.dataRecordsRemoved in ResourceLoadObserver. It is
2336         always 0 since this member is only initialized later on, in the UIProcess.
2337
2338         * loader/ResourceLoadObserver.cpp:
2339         (WebCore::ResourceLoadObserver::logFrameNavigation):
2340         (WebCore::ResourceLoadObserver::logSubresourceLoading):
2341         (WebCore::ResourceLoadObserver::logWebSocketLoading):
2342
2343 2017-07-06  Yoav Weiss  <yoav@yoav.ws>
2344
2345         [preload] Avoid reflecting "video" and "audio" when they are not supported `as` value
2346         https://bugs.webkit.org/show_bug.cgi?id=174199
2347
2348         Reviewed by Youenn Fablet.
2349
2350         No new tests as video/audio is supported in tests. I tested this manually.
2351
2352         * html/HTMLLinkElement.cpp:
2353         (WebCore::HTMLLinkElement::as): Make sure "video" and "audio" will not be reflected when they are not supported.
2354
2355 2017-07-06  Chris Dumez  <cdumez@apple.com>
2356
2357         Drop unused ResourceLoadStatistics members
2358         https://bugs.webkit.org/show_bug.cgi?id=174226
2359
2360         Reviewed by Brent Fulgham.
2361
2362         * loader/ResourceLoadObserver.cpp:
2363         (WebCore::ResourceLoadObserver::logFrameNavigation):
2364         (WebCore::ResourceLoadObserver::logSubresourceLoading):
2365         (WebCore::ResourceLoadObserver::logWebSocketLoading):
2366         (WebCore::ResourceLoadObserver::isPrevalentResource): Deleted.
2367         * loader/ResourceLoadObserver.h:
2368         * loader/ResourceLoadStatistics.cpp:
2369         (WebCore::ResourceLoadStatistics::encode):
2370         (WebCore::ResourceLoadStatistics::decode):
2371         (WebCore::ResourceLoadStatistics::toString):
2372         (WebCore::ResourceLoadStatistics::merge):
2373         * loader/ResourceLoadStatistics.h:
2374
2375 2017-07-06  Youenn Fablet  <youenn@apple.com>
2376
2377         Rendering of WebRTC audio in AudioSampleDataSource may trigger crackles
2378         https://bugs.webkit.org/show_bug.cgi?id=174223
2379
2380         Reviewed by Eric Carlson.
2381
2382         We try reading too quickly and need to back off a little bit if we do not enough data.
2383         This only affects real audio and not web audio, hence validated through manual testing only.
2384
2385         * platform/audio/mac/AudioSampleDataSource.mm:
2386         (WebCore::AudioSampleDataSource::pullSamplesInternal):
2387
2388 2017-07-06  Sam Weinig  <sam@webkit.org>
2389
2390         [WebIDL] Remove custom bindings for WebGL code dealing with WebGL extensions
2391         https://bugs.webkit.org/show_bug.cgi?id=174186
2392
2393         Reviewed by Alex Christensen.
2394
2395         * CMakeLists.txt:
2396         * WebCore.xcodeproj/project.pbxproj:
2397         Update files. Categorize some of the remaining custom bindings into groups.
2398
2399         * bindings/IDLTypes.h:
2400         Add a IDLWebGLExtension type, to model the special WebGLExtension type. In
2401         the future, WebGLExtension can probably be replaced by a Variant.
2402         
2403         * bindings/js/JSDOMConvertWebGL.cpp: Added.
2404         Move WebGLAny's convertToJSValue and add a convertToJSValue for WebGLExtension.
2405
2406         * bindings/js/JSDOMConvertWebGL.h:
2407         (WebCore::convertToJSValue):
2408         Since WebGLExtension is a wrapper type, we need both a pointer and reference variant
2409         of the conversion.
2410
2411         (WebCore::JSConverter<IDLWebGLExtension>::convert):
2412         Added.
2413
2414         * bindings/js/JSWebGL2RenderingContextCustom.cpp:
2415         (WebCore::toJS): Deleted.
2416         (WebCore::JSWebGL2RenderingContext::getExtension): Deleted.
2417         Remove custom operation and converter.
2418
2419         * bindings/js/JSWebGLRenderingContextCustom.cpp:
2420         (WebCore::toJS): Deleted.
2421         (WebCore::JSWebGLRenderingContext::getExtension): Deleted.
2422         Remove custom operation and converter.
2423
2424         * bindings/scripts/CodeGeneratorJS.pm:
2425         (AddToIncludesForIDLType):
2426         (NativeToJSValueDOMConvertNeedsState):
2427         (NativeToJSValueDOMConvertNeedsGlobalObject):
2428         Add support for IDLWebGLExtension.
2429
2430         * html/canvas/WebGLAny.cpp: Removed.
2431         * html/canvas/WebGLAny.h:
2432         Moved convertToJSValue to the bindings where it belongs.
2433
2434         * html/canvas/WebGLRenderingContextBase.idl:
2435         Annotate getExtension with [OverrideIDLType=IDLWebGLExtension].
2436
2437 2017-07-06  Joseph Pecoraro  <pecoraro@apple.com>
2438
2439         [Cocoa] CTParagraphStyle leak under WebCore::LinkImageLayout::LinkImageLayout
2440         https://bugs.webkit.org/show_bug.cgi?id=174228
2441
2442         Reviewed by Andreas Kling.
2443
2444         * platform/mac/DragImageMac.mm:
2445         (WebCore::LinkImageLayout::LinkImageLayout):
2446
2447 2017-07-06  Myles C. Maxfield  <mmaxfield@apple.com>
2448
2449         [Cocoa] Improve performance of font lookups
2450         https://bugs.webkit.org/show_bug.cgi?id=173960
2451         <rdar://problem/31996891>
2452
2453         Reviewed by Darin Adler.
2454
2455         Looking up kCTFontPostScriptNameAttribute is faster than kCTFontNameAttribute.
2456
2457         No new tests because there is no behavior change.
2458
2459         * platform/spi/cocoa/CoreTextSPI.h:
2460         * platform/graphics/cocoa/FontCacheCoreText.cpp:
2461         (WebCore::FontDatabase::fontForPostScriptName):
2462
2463 2017-07-06  Myles C. Maxfield  <mmaxfield@apple.com>
2464
2465         REGRESSION(r216944): Font loads can cause Chinese characters to draw as .notdef
2466         https://bugs.webkit.org/show_bug.cgi?id=173962
2467         <rdar://problem/32925318>
2468
2469         Reviewed by Simon Fraser.
2470
2471         Previously, there was no signalling between our font loading code
2472         which determined whether or not a font should be invisible (because
2473         its in the middle of loading) and our system fallback code which
2474         created fonts when we fall off the end of the fallback list. Because
2475         of this, we were doing two things wrong:
2476
2477         1. When we started downloading a font, we would try to use a fallback
2478         font. However, if the fallback font didn't suppor the character we're
2479         trying to render, we would just bail and draw .notdef
2480         2. Even if we continued down the fallback list, and fell of the end,
2481         we wouldn't realize that the system fallback font should also be drawn
2482         as invisible.
2483
2484         This patch solves these two problems by:
2485         1. Performing a search to find the best (local) fallback font with
2486         which to fall systemFallbackFontForCharacter(). This way, if you say
2487         "font-family: 'RemoteFont', 'Helvetica'" we will use Helvetica as
2488         the lookup to ask the system to search for.
2489         2. Give the Font class an accessor which can create a duplicate, but
2490         invisible font. Give FontCascadeFonts::glyphDataForVariant() the
2491         correct tracking to know when to use this invisible duplicate.
2492
2493         Tests: fast/text/font-loading-system-fallback.html
2494                http/tests/webfont/font-loading-system-fallback-visibility.html
2495
2496         * platform/graphics/Font.cpp:
2497         (WebCore::Font::invisibleFont):
2498         * platform/graphics/Font.h:
2499         * platform/graphics/FontCascadeFonts.cpp:
2500         (WebCore::findBestFallbackFont):
2501         (WebCore::FontCascadeFonts::glyphDataForSystemFallback):
2502         (WebCore::FontCascadeFonts::glyphDataForVariant):
2503         * platform/graphics/FontCascadeFonts.h:
2504
2505 2017-07-06  Chris Dumez  <cdumez@apple.com>
2506
2507         FileMonitor should not be ref counted
2508         https://bugs.webkit.org/show_bug.cgi?id=174166
2509
2510         Reviewed by Brent Fulgham.
2511
2512         Update FileMonitor to no longer be refcounted. It was previously easy to leak it
2513         because the object would ref itself in various lambdas. The client would have to
2514         explicitely call FileMonitor::stopMonitoring() which was fragile.
2515
2516         This patch also simplifies the code and API a bit since no longer actually
2517         requires startMonitoring() / stopMonitoring() API.
2518
2519         No new tests, covered by API tests.
2520
2521         * platform/FileMonitor.cpp:
2522         (WebCore::FileMonitor::FileMonitor):
2523         (WebCore::FileMonitor::~FileMonitor):
2524         (WebCore::FileMonitor::create): Deleted.
2525         (WebCore::FileMonitor::startMonitoring): Deleted.
2526         (WebCore::FileMonitor::stopMonitoring): Deleted.
2527         * platform/FileMonitor.h:
2528         * platform/cocoa/FileMonitorCocoa.mm:
2529         (WebCore::FileMonitor::FileMonitor):
2530         (WebCore::FileMonitor::~FileMonitor):
2531         (WebCore::FileMonitor::startMonitoring): Deleted.
2532         (WebCore::FileMonitor::stopMonitoring): Deleted.
2533
2534 2017-07-06  Matt Rajca  <mrajca@apple.com>
2535
2536         Fix build with VIDEO support disabled.
2537         https://bugs.webkit.org/show_bug.cgi?id=174217
2538
2539         Unreviewed build fix.
2540
2541         * page/Page.cpp:
2542
2543 2017-07-06  Matt Lewis  <jlewis3@apple.com>
2544
2545         Unreviewed, rolling out r219193.
2546
2547         The tests added with this revision were extreamly flaky on all
2548         platforms.
2549
2550         Reverted changeset:
2551
2552         "[SVG] Leak in SVGAnimatedListPropertyTearOff"
2553         https://bugs.webkit.org/show_bug.cgi?id=172545
2554         http://trac.webkit.org/changeset/219193
2555
2556 2017-07-06  Zalan Bujtas  <zalan@apple.com>
2557
2558         Use WTFLogAlways for debug logging so that it shows up in device system logs
2559         https://bugs.webkit.org/show_bug.cgi?id=173450
2560
2561         Reviewed by Simon Fraser.
2562
2563         If you want to showRenderTree() on-device, the result doesn't show in system log so you can't see it.
2564         Switch to WTFLogAlways to fix this, for showRenderTree and its dependencies.
2565         
2566         * platform/text/TextStream.cpp:
2567         (WebCore::writeIndent):
2568         * rendering/InlineBox.cpp:
2569         (WebCore::InlineBox::showLineTreeAndMark):
2570         (WebCore::InlineBox::showLineBox):
2571         * rendering/InlineBox.h:
2572         * rendering/InlineFlowBox.cpp:
2573         (WebCore::InlineFlowBox::showLineTreeAndMark):
2574         * rendering/InlineFlowBox.h:
2575         * rendering/InlineTextBox.cpp:
2576         (WebCore::InlineTextBox::showLineBox):
2577         * rendering/InlineTextBox.h:
2578         * rendering/RenderBlockFlow.cpp:
2579         (WebCore::RenderBlockFlow::showLineTreeAndMark):
2580         * rendering/RenderBlockFlow.h:
2581         * rendering/RenderObject.cpp:
2582         (WebCore::showRenderTreeLegend):
2583         (WebCore::RenderObject::showRenderTreeForThis):
2584         (WebCore::RenderObject::showLineTreeForThis):
2585         (WebCore::RenderObject::showRegionsInformation):
2586         (WebCore::RenderObject::showRenderObject):
2587         (WebCore::RenderObject::showRenderSubTreeAndMark):
2588         * rendering/RenderObject.h:
2589         * rendering/SimpleLineLayoutFunctions.cpp:
2590         (WebCore::SimpleLineLayout::printPrefix):
2591         (WebCore::SimpleLineLayout::showLineLayoutForFlow):
2592         * rendering/SimpleLineLayoutFunctions.h:
2593
2594 2017-07-06  Myles C. Maxfield  <mmaxfield@apple.com>
2595
2596         Unify FontCascadeFonts::glyphDataForVariant() and FontCascadeFonts::glyphDataForNormalVariant()
2597         https://bugs.webkit.org/show_bug.cgi?id=174213
2598
2599         Reviewed by Zalan Bujtas.
2600
2601         They have almost identical code. This is in preparation for https://bugs.webkit.org/show_bug.cgi?id=173962
2602
2603         No new tests because there is no behavior change.
2604
2605         * platform/graphics/FontCascadeFonts.cpp:
2606         (WebCore::FontCascadeFonts::glyphDataForVariant):
2607         (WebCore::FontCascadeFonts::glyphDataForCharacter):
2608         (WebCore::FontCascadeFonts::glyphDataForNormalVariant): Deleted.
2609         * platform/graphics/FontCascadeFonts.h:
2610
2611 2017-07-06  Don Olmstead  <don.olmstead@sony.com>
2612
2613         [PAL] Move KillRing into PAL
2614         https://bugs.webkit.org/show_bug.cgi?id=173900
2615
2616         Reviewed by Myles C. Maxfield.
2617
2618         No new tests. No change in functionality.
2619
2620         * Configurations/WebCore.xcconfig:
2621         * PlatformGTK.cmake:
2622         * PlatformMac.cmake:
2623         * PlatformWPE.cmake:
2624         * PlatformWin.cmake:
2625         * WebCore.xcodeproj/project.pbxproj:
2626         * editing/Editor.cpp:
2627         (WebCore::Editor::Editor):
2628         * editing/Editor.h:
2629         (WebCore::Editor::killRing):
2630         * editing/EditorCommand.cpp:
2631
2632 2017-07-06  Devin Rousso  <drousso@apple.com>
2633
2634         Web Inspector: Support getting the content of WebGL/WebGL2 contexts
2635         https://bugs.webkit.org/show_bug.cgi?id=173569
2636         <rdar://problem/33112420>
2637
2638         Reviewed by Joseph Pecoraro.
2639
2640         Tests: inspector/canvas/requestContent-2d.html
2641                inspector/canvas/requestContent-webgl.html
2642                inspector/canvas/requestContent-webgl2.html
2643
2644         * html/canvas/WebGLRenderingContextBase.cpp:
2645         (WebCore::WebGLRenderingContextBase::clearIfComposited):
2646         * html/canvas/WebGLRenderingContextBase.h:
2647         (WebCore::WebGLRenderingContextBase::preventBufferClearForInspector):
2648         (WebCore::WebGLRenderingContextBase::setPreventBufferClearForInspector):
2649         Add a flag that will prevent the context buffer from being cleared, allowing it to be copied
2650         within a toDataURL call. This is currently only used by InspectorCanvasAgent::requestContent.
2651
2652         * inspector/InspectorCanvasAgent.cpp:
2653         (WebCore::InspectorCanvasAgent::requestContent):
2654         Since toDataURL attempts to force the canvas to redraw, we can preserve the buffer after it
2655         finishes drawing so that it can be copied, instead of it normally being swapped out.
2656
2657 2017-07-06  Chris Dumez  <cdumez@apple.com>
2658
2659         Move ResourceLoadObserver notification throttling logic from WebProcess class to ResourceLoadObserver
2660         https://bugs.webkit.org/show_bug.cgi?id=174194
2661
2662         Reviewed by Brent Fulgham.
2663
2664         Move ResourceLoadObserver notification throttling logic from WebProcess class to
2665         ResourceLoadObserver. This makes more sense and decreases the complexity of the
2666         WebProcess class.
2667
2668         * loader/ResourceLoadObserver.cpp:
2669         (WebCore::ResourceLoadObserver::setNotificationCallback):
2670         (WebCore::ResourceLoadObserver::ResourceLoadObserver):
2671         (WebCore::ResourceLoadObserver::logFrameNavigation):
2672         (WebCore::ResourceLoadObserver::logSubresourceLoading):
2673         (WebCore::ResourceLoadObserver::logWebSocketLoading):
2674         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
2675         (WebCore::ResourceLoadObserver::scheduleNotificationIfNeeded):
2676         (WebCore::ResourceLoadObserver::notificationTimerFired):
2677         * loader/ResourceLoadObserver.h:
2678
2679 2017-07-06  Said Abou-Hallawa  <sabouhallawa@apple.com>
2680
2681         REGRESSION(r208511): RenderImageResourceStyleImage should not assume image() won't return null if its m_cachedImage is valid
2682         https://bugs.webkit.org/show_bug.cgi?id=174168
2683
2684         Reviewed by Simon Fraser.
2685
2686         RenderImageResourceStyleImage::image() may return a null pointer even if
2687         its m_cachedImage is not null. The revision r208511, changed the function
2688         RenderImageResourceStyleImage::shutdown() so it calls Image::stopAnimation().
2689         But this change assumes that if m_cachedImage is not null then image() will
2690         return a valid pointer. This is not true because StyleCachedImage::isPending()
2691         can return true and hence, RenderImageResourceStyleImage::image() will return
2692         a null pointer.
2693
2694         * rendering/RenderImageResourceStyleImage.cpp:
2695         (WebCore::RenderImageResourceStyleImage::image): Like what RenderImageResource
2696         does, return Image::nullImage() if m_styleImage->isPending().
2697
2698 2017-07-06  Commit Queue  <commit-queue@webkit.org>
2699
2700         Unreviewed, rolling out r219201.
2701         https://bugs.webkit.org/show_bug.cgi?id=174211
2702
2703         "Causes crashes on Release builds and API tests" (Requested by
2704         ddkilzer on #webkit).
2705
2706         Reverted changeset:
2707
2708         "Add release assert to explore crash for
2709         <rdar://problem/32908525>"
2710         http://trac.webkit.org/changeset/219201
2711
2712 2017-07-06  Commit Queue  <commit-queue@webkit.org>
2713
2714         Unreviewed, rolling out r219194.
2715         https://bugs.webkit.org/show_bug.cgi?id=174207
2716
2717         it broke some layout tests (Requested by clopez on #webkit).
2718
2719         Reverted changeset:
2720
2721         "[GStreamer] vid.me videos do not play"
2722         https://bugs.webkit.org/show_bug.cgi?id=172240
2723         http://trac.webkit.org/changeset/219194
2724
2725 2017-07-06  David Kilzer  <ddkilzer@apple.com>
2726
2727         Add release assert to explore crash for <rdar://problem/32908525>
2728
2729         Reviewed by Brady Eidson.
2730
2731         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2732         (WebCore::IDBServer::UniqueIDBDatabase::~UniqueIDBDatabase): Add
2733         release assert to catch cases when the IDBBackingStore is not
2734         deleted before the UniqueIDBDatabase is destroyed.  The
2735         IDBBackingStore should always be released on the database
2736         thread.
2737
2738 2017-07-06  Matt Lewis  <jlewis3@apple.com>
2739
2740         Unreviewed, rolling out r219178.
2741
2742         This caused a consistent failure with the API test
2743         StringBuilderTest.ToAtomicStringOnEmpty on all Debug testers.
2744
2745         Reverted changeset:
2746
2747         "[WTF] Clean up StringStatics.cpp by using
2748         LazyNeverDestroyed<> for Atoms"
2749         https://bugs.webkit.org/show_bug.cgi?id=174150
2750         http://trac.webkit.org/changeset/219178
2751
2752 2017-07-06  Charlie Turner  <cturner@igalia.com>
2753
2754         [GStreamer] vid.me videos do not play
2755         https://bugs.webkit.org/show_bug.cgi?id=172240
2756
2757         Reviewed by Xabier Rodriguez-Calvar.
2758
2759         In r142251, code to hide the WK HTTP source elements from elsewhere in
2760         the pipeline was removed. This has the nasty side-effect of
2761         auto-plugging the WK HTTP source into things it really should not be
2762         used in, especially the adaptive streaming demuxers. The reasons this
2763         is bad are documented in several places on Bugzilla, see the parent
2764         bug report for more details. The high-level issue is that the WK HTTP
2765         source and its use of WebCore is not thread-safe. Although work has
2766         been recently done to improve this situation, it's still not perfect.
2767
2768         Another issue is the interface hlsdemux expects its HTTP source to
2769         implement, specifically seeking in READY.
2770
2771         This does rely on HTTP context sharing being available in GStreamer,
2772         upstream bug is here:
2773         https://bugzilla.gnome.org/show_bug.cgi?id=761099. The failing case
2774         can be demonstrated with
2775         https://github.com/thiagoss/adaptive-test-server but manual testing on
2776         popular video hosting sites, including vid.me, shows that this doesn't
2777         bite us at the moment, just something else to fix in the future.
2778
2779         There are some QoS issues with the adaptive streaming code in
2780         GStreamer, but it seems much better to offer a below par QoS in lieu
2781         of crashing/livelocking when playing certain streams, and issues can be
2782         raised upstream when they arise.
2783
2784         This patch does take us further away from the future goal of having all
2785         networking operations go through the network process, but in return it
2786         solves some nasty crashes and livelocks that have been irritating
2787         users for some time. With the pressure off on this issue, work can be
2788         planned to consider how to make the WK HTTP source a better citizen
2789         inside the GStreamer pipeline when we migrate the netcode to go
2790         through the network process.
2791
2792         A new test is added to check that the single file HLS playlists
2793         (new in version 4) can be played, which was the primary cause of
2794         this bug report.
2795
2796         Test: http/tests/media/hls/range-request.html
2797
2798         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2799         (WebCore::MediaPlayerPrivateGStreamer::setPlaybinURL): Perform
2800         some trickery to make sure that we only ever fetch URLs handed to
2801         us by WebCore. Any further URLs discovered inside the pipeline
2802         will not get WKWS auto-plugged, since they'll be plain https?
2803         schemas.
2804         (WebCore::MediaPlayerPrivateGStreamer::load): Refactor to use the
2805         setPlaybinURL helper method.
2806         (WebCore::MediaPlayerPrivateGStreamer::loadNextLocation): Ditto.
2807         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: Add
2808         the setPlaybinURL helper method.
2809         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
2810         (webKitWebSrcGetProtocols): Only advertise webkit+https?, this
2811         ensures we won't get auto-plugged by pipeline elements asking for
2812         an element to fetch https? resources (like adaptive demuxers).
2813         (convertPlaybinURI): Undo the trick when another element asks us
2814         for our URI.
2815
2816 2017-05-24  Sergio Villar Senin  <svillar@igalia.com>
2817
2818         [SVG] Leak in SVGAnimatedListPropertyTearOff
2819         https://bugs.webkit.org/show_bug.cgi?id=172545
2820
2821         Reviewed by Said Abou-Hallawa.
2822
2823         SVGAnimatedListPropertyTearOff maintains a vector m_wrappers with references to
2824         SVGPropertyTraits<PropertyType>::ListItemTearOff. Apart from that SVGPropertyTearOff has a
2825         reference to SVGAnimatedProperty.
2826
2827         When SVGListProperty::getItemValuesAndWrappers() is called, it creates a
2828         SVGPropertyTraits<PropertyType>::ListItemTearOff pointing to the same SVGAnimatedProperty (a
2829         SVGAnimatedListPropertyTearOff) which stores the m_wrappers vector where the ListItemTearOff
2830         is going to be added to. This effectively creates a reference cycle between the
2831         SVGAnimatedListPropertyTearOff and all the ListItemTearOff it stores in m_wrappers.
2832
2833         We should detach those wrappers in propertyWillBeDeleted() in order to break the cycle.
2834
2835         * svg/properties/SVGAnimatedListPropertyTearOff.h:
2836
2837 2017-07-05  Don Olmstead  <don.olmstead@sony.com>
2838
2839         [WTF] Move SoftLinking.h into WTF
2840         https://bugs.webkit.org/show_bug.cgi?id=174000
2841
2842         Reviewed by Alex Christensen.
2843
2844         No new tests. No change in functionality
2845
2846         * Modules/applepay/PaymentRequest.cpp:
2847         * Modules/applepay/cocoa/PaymentContactCocoa.mm:
2848         * Modules/applepay/cocoa/PaymentMerchantSessionCocoa.mm:
2849         * Modules/encryptedmedia/legacy/LegacyCDMPrivateMediaPlayer.cpp:
2850         * WebCore.xcodeproj/project.pbxproj:
2851         * editing/cocoa/EditorCocoa.mm:
2852         * editing/cocoa/HTMLConverter.mm:
2853         * editing/ios/EditorIOS.mm:
2854         * page/CaptionUserPreferencesMediaAF.cpp:
2855         * page/cocoa/SettingsCocoa.mm:
2856         * page/ios/UserAgentIOS.mm:
2857         * page/mac/ServicesOverlayController.mm:
2858         * platform/audio/ios/AudioDestinationIOS.cpp:
2859         * platform/audio/ios/AudioFileReaderIOS.cpp:
2860         * platform/audio/ios/AudioSessionIOS.mm:
2861         * platform/audio/ios/MediaSessionManagerIOS.mm:
2862         * platform/cf/CoreMediaSoftLink.cpp:
2863         * platform/cf/CoreMediaSoftLink.h:
2864         * platform/cf/MediaAccessibilitySoftLink.cpp:
2865         * platform/cf/MediaAccessibilitySoftLink.h:
2866         * platform/cocoa/ContentFilterUnblockHandlerCocoa.mm:
2867         * platform/cocoa/CoreVideoSoftLink.cpp:
2868         * platform/cocoa/CoreVideoSoftLink.h:
2869         * platform/cocoa/DataDetectorsCoreSoftLink.h:
2870         * platform/cocoa/NetworkExtensionContentFilter.mm:
2871         * platform/cocoa/ParentalControlsContentFilter.mm:
2872         * platform/cocoa/TelephoneNumberDetectorCocoa.cpp:
2873         * platform/cocoa/VideoToolboxSoftLink.cpp:
2874         * platform/cocoa/VideoToolboxSoftLink.h:
2875         * platform/cocoa/WebPlaybackSessionModelMediaElement.mm:
2876         * platform/cocoa/WebVideoFullscreenModelVideoElement.mm:
2877         * platform/gamepad/cocoa/GameControllerGamepadProvider.mm:
2878         * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
2879         * platform/graphics/avfoundation/MediaPlaybackTargetMac.mm:
2880         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
2881         * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm:
2882         * platform/graphics/avfoundation/cf/AVFoundationCFSoftLinking.h:
2883         * platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp:
2884         * platform/graphics/avfoundation/cf/InbandTextTrackPrivateAVCF.cpp:
2885         * platform/graphics/avfoundation/cf/InbandTextTrackPrivateLegacyAVCF.cpp:
2886         * platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
2887         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
2888         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
2889         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
2890         * platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.mm:
2891         * platform/graphics/avfoundation/objc/InbandTextTrackPrivateLegacyAVFObjC.mm:
2892         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
2893         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
2894         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
2895         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
2896         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
2897         * platform/graphics/ca/win/WKCACFViewLayerTreeHost.cpp:
2898         * platform/graphics/cocoa/FontCascadeCocoa.mm:
2899         * platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp:
2900         * platform/graphics/cv/PixelBufferConformerCV.cpp:
2901         * platform/graphics/ios/FontCacheIOS.mm:
2902         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
2903         * platform/graphics/mac/FontCacheMac.mm:
2904         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
2905         * platform/graphics/mac/MediaTimeQTKit.mm:
2906         * platform/graphics/mac/PDFDocumentImageMac.mm:
2907         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
2908         * platform/ios/DragImageIOS.mm:
2909         * platform/ios/PlatformPasteboardIOS.mm:
2910         * platform/ios/PlatformScreenIOS.mm:
2911         * platform/ios/PlatformSpeechSynthesizerIOS.mm:
2912         * platform/ios/QuickLookSoftLink.h:
2913         * platform/ios/QuickLookSoftLink.mm:
2914         * platform/ios/RemoteCommandListenerIOS.mm:
2915         * platform/ios/ThemeIOS.mm:
2916         * platform/ios/ValidationBubbleIOS.mm:
2917         * platform/ios/WebCoreMotionManager.mm:
2918         * platform/ios/WebItemProviderPasteboard.mm:
2919         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
2920         * platform/mac/DragImageMac.mm:
2921         * platform/mac/MediaRemoteSoftLink.cpp:
2922         * platform/mac/MediaRemoteSoftLink.h:
2923         * platform/mac/SerializedPlatformRepresentationMac.mm:
2924         * platform/mac/WebPlaybackControlsManager.mm:
2925         * platform/mac/WebVideoFullscreenController.mm:
2926         * platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm:
2927         * platform/mediastream/ios/CoreAudioCaptureSourceIOS.mm:
2928         * platform/mediastream/libwebrtc/H264VideoToolBoxEncoder.mm:
2929         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
2930         * platform/network/cf/CookieJarCFNet.cpp:
2931         * platform/network/ios/NetworkStateNotifierIOS.mm:
2932         * platform/network/ios/PreviewConverter.mm:
2933         * platform/network/mac/BlobDataFileReferenceMac.mm:
2934         * platform/spi/cocoa/AVKitSPI.h:
2935         (-[AVTouchBarPlaybackControlsControlling NS_ENUM]): Deleted.
2936         * platform/spi/cocoa/NSAttributedStringSPI.h:
2937         * platform/spi/ios/DataDetectorsUISPI.h:
2938         * platform/spi/mac/AVFoundationSPI.h:
2939         * platform/spi/mac/DataDetectorsSPI.h:
2940         * platform/spi/mac/LookupSPI.h:
2941         * platform/spi/mac/TUCallSPI.h:
2942         * platform/win/ScrollbarThemeWin.cpp:
2943         * rendering/RenderThemeCocoa.mm:
2944         * rendering/RenderThemeIOS.mm:
2945         * rendering/RenderThemeWin.cpp:
2946         * testing/Internals.mm:
2947         * xml/XSLStyleSheetLibxslt.cpp:
2948         * xml/XSLTExtensions.cpp:
2949         * xml/XSLTProcessorLibxslt.cpp:
2950         * xml/XSLTUnicodeSort.cpp:
2951
2952 2017-07-05  Zalan Bujtas  <zalan@apple.com>
2953
2954         REGRESSION: Stack overflow in RenderBlockFlow::layoutBlock after increasing the font size to max in some RTL vertical books.
2955         https://bugs.webkit.org/show_bug.cgi?id=174144
2956         <rdar://problem/32781038>
2957
2958         Reviewed by Simon Fraser.
2959
2960         We set the start/end margin on the ruby renderer to support overhanging content. The margins ensure that
2961         adjacent boxes on the line are placed properly respecting the overhanging content.
2962         The line breaking algorithm also takes this value into account as it affects the line's available width.
2963         We need to reset this value before laying out the lines, otherwise we might end up using this value on the line twice;
2964         first as the renderer's margins (as the result of the previous layout) and second as the renderer's overhanging value.
2965         Since this is not strictly part of the renderer's layout context (i.e. we set them during the line layout and not at
2966         RenderRubyRun::layout) we can't rely on the ruby's layout logic to reset them.
2967
2968         Test: fast/ruby/ruby-overhang-margin-crash.html
2969
2970         * rendering/RenderBlockLineLayout.cpp:
2971         (WebCore::RenderBlockFlow::layoutLineBoxes):
2972
2973 2017-07-05  Yusuke Suzuki  <utatane.tea@gmail.com>
2974
2975         Upgrade GCC baseline
2976         https://bugs.webkit.org/show_bug.cgi?id=174155
2977
2978         Reviewed by Michael Catanzaro.
2979
2980         Remove workaround for old GCC.
2981
2982         * CMakeLists.txt:
2983
2984 2017-07-05  Chris Dumez  <cdumez@apple.com>
2985
2986         Unreviewed attempt to fix iOS build after r219177.
2987
2988         * page/ios/UserAgentIOS.mm:
2989         * platform/spi/ios/UIKitSPI.h:
2990
2991 2017-07-05  Chris Dumez  <cdumez@apple.com>
2992
2993         Unreviewed attempt to fix iOS build after r219177.
2994
2995         * page/ios/UserAgentIOS.mm:
2996         * platform/spi/ios/UIKitSPI.h:
2997
2998 2017-07-05  Yusuke Suzuki  <utatane.tea@gmail.com>
2999
3000         Use std::lock_guard instead of std::unique_lock if move semantics and try_lock is not necessary
3001         https://bugs.webkit.org/show_bug.cgi?id=174148
3002
3003         Reviewed by Mark Lam.
3004
3005         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
3006         (WebCore::AudioSourceProviderAVFObjC::~AudioSourceProviderAVFObjC):
3007
3008 2017-07-05  Yusuke Suzuki  <utatane.tea@gmail.com>
3009
3010         [WTF] Clean up StringStatics.cpp by using LazyNeverDestroyed<> for Atoms
3011         https://bugs.webkit.org/show_bug.cgi?id=174150
3012
3013         Reviewed by Mark Lam.
3014
3015         * Modules/mediacontrols/MediaControlsHost.cpp:
3016         (WebCore::MediaControlsHost::captionDisplayMode):
3017         * Modules/mediastream/RTCDataChannel.cpp:
3018         (WebCore::RTCDataChannel::binaryType):
3019         * accessibility/AXObjectCache.cpp:
3020         (WebCore::createFromRenderer):
3021         * accessibility/AccessibilityMediaControls.cpp:
3022         (WebCore::AccessibilityMediaControl::controlTypeName):
3023         * accessibility/AccessibilityObject.cpp:
3024         (WebCore::AccessibilityObject::language):
3025         (WebCore::AccessibilityObject::defaultLiveRegionStatusForRole):
3026         (WebCore::AccessibilityObject::actionVerb):
3027         (WebCore::AccessibilityObject::getAttribute):
3028         (WebCore::AccessibilityObject::placeholderValue):
3029         * accessibility/AccessibilityObject.h:
3030         (WebCore::AccessibilityObject::accessKey):
3031         (WebCore::AccessibilityObject::ariaLiveRegionRelevant):
3032         * accessibility/AccessibilityRenderObject.cpp:
3033         (WebCore::AccessibilityRenderObject::accessKey):
3034         (WebCore::AccessibilityRenderObject::actionVerb):
3035         * bindings/js/JSCustomElementInterface.cpp:
3036         (WebCore::JSCustomElementInterface::constructElementWithFallback):
3037         * bindings/js/JSCustomElementRegistryCustom.cpp:
3038         (WebCore::JSCustomElementRegistry::define):
3039         * bindings/scripts/CodeGeneratorJS.pm:
3040         (GenerateDefaultValue):
3041         * bindings/scripts/test/JS/JSTestObj.cpp:
3042         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringBody):
3043         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringIsNullBody):
3044         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringIsEmptyStringBody):
3045         * css/CSSPageRule.cpp:
3046         (WebCore::CSSPageRule::selectorText):
3047         * css/CSSPrimitiveValue.cpp:
3048         (WebCore::valueName):
3049         * css/CSSSelector.cpp:
3050         (WebCore::simpleSelectorSpecificityInternal):
3051         (WebCore::CSSSelector::specificityForPage):
3052         (WebCore::CSSSelector::RareData::RareData):
3053         * css/CSSSelector.h:
3054         (WebCore::CSSSelector::argument):
3055         * css/CSSSelectorList.cpp:
3056         (WebCore::SelectorNeedsNamespaceResolutionFunctor::operator()):
3057         * css/PageRuleCollector.cpp:
3058         (WebCore::checkPageSelectorComponents):
3059         * css/RuleSet.cpp:
3060         (WebCore::computeMatchBasedOnRuleHash):
3061         (WebCore::RuleSet::addRule):
3062         * css/SelectorChecker.cpp:
3063         (WebCore::tagMatches):
3064         * css/SelectorFilter.cpp:
3065         (WebCore::collectDescendantSelectorIdentifierHashes):
3066         * css/StyleBuilderConverter.h:
3067         (WebCore::StyleBuilderConverter::convertStringOrAuto):
3068         (WebCore::StyleBuilderConverter::convertStringOrNone):
3069         * css/StyleBuilderCustom.h:
3070         (WebCore::StyleBuilderCustom::applyValueWebkitLocale):
3071         (WebCore::StyleBuilderCustom::applyValueWebkitTextEmphasisStyle):
3072         (WebCore::StyleBuilderCustom::applyValueContent):
3073         (WebCore::StyleBuilderCustom::applyValueAlt):
3074         * css/StyleSheetContents.cpp:
3075         (WebCore::StyleSheetContents::StyleSheetContents):
3076         (WebCore::StyleSheetContents::namespaceURIFromPrefix):
3077         * css/makeprop.pl:
3078         * css/parser/CSSParserImpl.cpp:
3079         (WebCore::CSSParserImpl::parsePageSelector):
3080         * css/parser/CSSSelectorParser.cpp:
3081         (WebCore::CSSSelectorParser::consumeCompoundSelector):
3082         (WebCore::CSSSelectorParser::consumeName):
3083         (WebCore::CSSSelectorParser::consumeAttribute):
3084         (WebCore::CSSSelectorParser::defaultNamespace):
3085         (WebCore::CSSSelectorParser::determineNamespace):
3086         (WebCore::CSSSelectorParser::prependTypeSelectorIfNeeded):
3087         * cssjit/SelectorCompiler.cpp:
3088         (WebCore::SelectorCompiler::attributeNameTestingRequiresNamespaceRegister):
3089         (WebCore::SelectorCompiler::equalTagNames):
3090         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeMatching):
3091         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementHasTagName):
3092         * dom/Attr.cpp:
3093         (WebCore::Attr::setPrefix):
3094         (WebCore::Attr::attachToElement):
3095         * dom/Attribute.h:
3096         (WebCore::Attribute::nameMatchesFilter):
3097         * dom/ConstantPropertyMap.cpp:
3098         (WebCore::ConstantPropertyMap::nameForProperty):
3099         * dom/ContainerNode.cpp:
3100         (WebCore::ContainerNode::getElementsByTagName):
3101         (WebCore::ContainerNode::getElementsByTagNameNS):
3102         * dom/CustomElementReactionQueue.cpp:
3103         (WebCore::CustomElementReactionQueue::enqueuePostUpgradeReactions):
3104         * dom/DatasetDOMStringMap.cpp:
3105         (WebCore::convertPropertyNameToAttributeName):
3106         * dom/Document.cpp:
3107         (WebCore::createUpgradeCandidateElement):
3108         (WebCore::Document::createElementForBindings):
3109         (WebCore::Document::importNode):
3110         (WebCore::Document::hasValidNamespaceForElements):
3111         (WebCore::Document::processBaseElement):
3112         (WebCore::Document::dir):
3113         (WebCore::Document::bgColor):
3114         (WebCore::Document::fgColor):
3115         (WebCore::Document::alinkColor):
3116         (WebCore::Document::linkColorForBindings):
3117         (WebCore::Document::vlinkColor):
3118         * dom/Document.h:
3119         * dom/Element.cpp:
3120         (WebCore::Element::setBooleanAttribute):
3121         (WebCore::Element::synchronizeAttribute):
3122         (WebCore::Element::getAttribute):
3123         (WebCore::Element::getAttributeNS):
3124         (WebCore::Element::setAttribute):
3125         (WebCore::Element::parserSetAttributes):
3126         (WebCore::Element::didMoveToNewDocument):
3127         (WebCore::Element::setPrefix):
3128         (WebCore::Element::insertedInto):
3129         (WebCore::Element::removedFrom):
3130         (WebCore::Element::removeAttributeInternal):
3131         (WebCore::Element::addAttributeInternal):
3132         (WebCore::Element::removeAttributeNS):
3133         (WebCore::Element::getAttributeNodeNS):
3134         (WebCore::Element::hasAttributeNS):
3135         (WebCore::Element::computeInheritedLanguage):
3136         (WebCore::Element::updateNameForDocument):
3137         (WebCore::Element::updateIdForDocument):
3138         (WebCore::Element::didAddAttribute):
3139         (WebCore::Element::didRemoveAttribute):
3140         (WebCore::Element::cloneAttributesFromElement):
3141         * dom/Element.h:
3142         (WebCore::Element::attributeWithoutSynchronization):
3143         (WebCore::Element::idForStyleResolution):
3144         (WebCore::Element::getIdAttribute):
3145         (WebCore::Element::getNameAttribute):
3146         * dom/EventTarget.cpp:
3147         (WebCore::legacyType):
3148         * dom/MutationRecord.h:
3149         (WebCore::MutationRecord::attributeName):
3150         (WebCore::MutationRecord::attributeNamespace):
3151         * dom/NamedNodeMap.cpp:
3152         (WebCore::NamedNodeMap::removeNamedItemNS):
3153         * dom/Node.cpp:
3154         (WebCore::Node::prefix):
3155         (WebCore::Node::localName):
3156         (WebCore::Node::namespaceURI):
3157         (WebCore::Node::checkSetPrefix):
3158         (WebCore::locateDefaultNamespace):
3159         (WebCore::Node::isDefaultNamespace):
3160         (WebCore::Node::lookupNamespaceURI):
3161         (WebCore::locateNamespacePrefix):
3162         (WebCore::Node::lookupPrefix):
3163         * dom/NodeRareData.h:
3164         (WebCore::NodeListsNodeData::addCachedTagCollectionNS):
3165         (WebCore::NodeListsNodeData::addCachedCollection):
3166         (WebCore::NodeListsNodeData::cachedCollection):
3167         (WebCore::NodeListsNodeData::removeCacheWithAtomicName):
3168         (WebCore::NodeListsNodeData::removeCachedTagCollectionNS):
3169         (WebCore::NodeListsNodeData::removeCachedCollection):
3170         * dom/PseudoElement.cpp:
3171         (WebCore::pseudoElementTagName):
3172         * dom/QualifiedName.cpp:
3173         (WebCore::QualifiedName::init):
3174         (WebCore::nullQName):
3175         (WebCore::createQualifiedName):
3176         * dom/QualifiedName.h:
3177         (WebCore::QualifiedName::hasPrefix):
3178         * dom/SelectorQuery.cpp:
3179         (WebCore::SelectorDataList::executeSingleTagNameSelectorData):
3180         * dom/SlotAssignment.cpp:
3181         (WebCore::slotNameFromAttributeValue):
3182         * dom/SlotAssignment.h:
3183         (WebCore::SlotAssignment::defaultSlotName):
3184         (WebCore::ShadowRoot::didRemoveAllChildrenOfShadowHost):
3185         (WebCore::ShadowRoot::didChangeDefaultSlot):
3186         * dom/TagCollection.cpp:
3187         (WebCore::TagCollection::TagCollection):
3188         (WebCore::HTMLTagCollection::HTMLTagCollection):
3189         * dom/TagCollection.h:
3190         (WebCore::TagCollectionNS::elementMatches):
3191         * dom/make_names.pl:
3192         (printNamesCppFile):
3193         (printDefinitions):
3194         (printFactoryCppFile):
3195         * editing/CompositeEditCommand.cpp:
3196         (WebCore::CompositeEditCommand::removeNodeAttribute):
3197         * editing/Editing.cpp:
3198         (WebCore::createHTMLElement):
3199         * editing/MarkupAccumulator.cpp:
3200         (WebCore::MarkupAccumulator::serializeNodesWithNamespaces):
3201         (WebCore::MarkupAccumulator::shouldAddNamespaceElement):
3202         (WebCore::MarkupAccumulator::shouldAddNamespaceAttribute):
3203         (WebCore::MarkupAccumulator::appendNamespace):
3204         (WebCore::MarkupAccumulator::appendOpenTag):
3205         (WebCore::MarkupAccumulator::appendAttribute):
3206         * editing/gtk/EditorGtk.cpp:
3207         (WebCore::elementURL):
3208         * editing/markup.cpp:
3209         (WebCore::AttributeChange::AttributeChange):
3210         * html/Autocapitalize.cpp:
3211         (WebCore::stringForAutocapitalizeType):
3212         * html/Autofill.cpp:
3213         (WebCore::AutofillData::createFromHTMLFormControlElement):
3214         * html/DOMTokenList.h:
3215         (WebCore::DOMTokenList::item):
3216         * html/FormAssociatedElement.cpp:
3217         (WebCore::FormAssociatedElement::name):
3218         * html/HTMLButtonElement.cpp:
3219         (WebCore::HTMLButtonElement::formControlType):
3220         * html/HTMLDetailsElement.cpp:
3221         (WebCore::HTMLDetailsElement::toggleOpen):
3222         * html/HTMLDocument.cpp:
3223         (WebCore::HTMLDocument::isCaseSensitiveAttribute):
3224         * html/HTMLElement.cpp:
3225         (WebCore::HTMLElement::eventNameForEventHandlerAttribute):
3226         (WebCore::toValidDirValue):
3227         * html/HTMLImageElement.cpp:
3228         (WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
3229         * html/HTMLInputElement.cpp:
3230         (WebCore::HTMLInputElement::name):
3231         (WebCore::HTMLInputElement::updateType):
3232         * html/HTMLMediaElement.cpp:
3233         (WebCore::HTMLMediaElement::doesHaveAttribute):
3234         * html/HTMLOptionElement.cpp:
3235         (WebCore::HTMLOptionElement::createForJSConstructor):
3236         * html/HTMLParamElement.cpp:
3237         (WebCore::HTMLParamElement::name):
3238         * html/HTMLSelectElement.cpp:
3239         (WebCore::HTMLSelectElement::setMultiple):
3240         * html/HTMLTableCellElement.cpp:
3241         (WebCore::HTMLTableCellElement::scope):
3242         * html/HTMLTrackElement.cpp:
3243         (WebCore::HTMLTrackElement::mediaElementCrossOriginAttribute):
3244         * html/LabelableElement.cpp:
3245         (WebCore::LabelableElement::labels):
3246         * html/LabelsNodeList.cpp:
3247         (WebCore::LabelsNodeList::~LabelsNodeList):
3248         * html/MediaController.cpp:
3249         (MediaController::playbackState):
3250         (eventNameForReadyState):
3251         * html/MediaDocument.cpp:
3252         (WebCore::MediaDocumentParser::createDocumentStructure):
3253         * html/parser/AtomicHTMLToken.h:
3254         (WebCore::AtomicHTMLToken::initializeAttributes):
3255         * html/parser/HTMLConstructionSite.cpp:
3256         (WebCore::HTMLConstructionSite::createElement):
3257         (WebCore::HTMLConstructionSite::createHTMLElementOrFindCustomElementInterface):
3258         * html/parser/HTMLParserIdioms.cpp:
3259         (WebCore::stripLeadingAndTrailingHTMLSpaces):
3260         (WebCore::parseHTMLHashNameReference):
3261         * html/parser/HTMLTreeBuilder.cpp:
3262         (WebCore::createForeignAttributesMap):
3263         * html/track/InbandTextTrack.cpp:
3264         (WebCore::InbandTextTrack::InbandTextTrack):
3265         * html/track/LoadableTextTrack.cpp:
3266         (WebCore::LoadableTextTrack::id):
3267         * html/track/TextTrack.cpp:
3268         (WebCore::TextTrack::captionMenuOffItem):
3269         (WebCore::TextTrack::captionMenuAutomaticItem):
3270         * html/track/TrackBase.cpp:
3271         (WebCore::MediaTrackBase::setKindInternal):
3272         * html/track/VTTRegion.cpp:
3273         (WebCore::VTTRegion::scroll):
3274         * html/track/WebVTTElement.cpp:
3275         (WebCore::nodeTypeToTagName):
3276         * html/track/WebVTTElement.h:
3277         * html/track/WebVTTToken.h:
3278         (WebCore::WebVTTToken::StartTag):
3279         * loader/FrameLoader.cpp:
3280         (WebCore::FrameLoader::clear):
3281         * loader/FrameLoader.h:
3282         * loader/ImageLoader.cpp:
3283         (WebCore::ImageLoader::clearFailedLoadURL):
3284         * loader/NavigationAction.h:
3285         * loader/PolicyChecker.cpp:
3286         (WebCore::PolicyChecker::checkNavigationPolicy):
3287         * page/DOMWindow.cpp:
3288         (WebCore::DOMWindow::showModalDialog):
3289         * page/EventHandler.cpp:
3290         (WebCore::eventNameForTouchPointState):
3291         * page/FrameTree.cpp:
3292         (WebCore::FrameTree::setName):
3293         (WebCore::FrameTree::clearName):
3294         * page/Page.cpp:
3295         (WebCore::Page::groupName):
3296         * platform/graphics/ComplexTextController.cpp:
3297         (WebCore::ComplexTextController::offsetForPosition):
3298         * platform/graphics/FontCache.cpp:
3299         (WebCore::FontCache::alternateFamilyName):
3300         * platform/graphics/FontDescription.h:
3301         (WebCore::FontCascadeDescription::initialLocale):
3302         * platform/graphics/FontGenericFamilies.cpp:
3303         (WebCore::genericFontFamilyForScript):
3304         * platform/graphics/InbandTextTrackPrivate.h:
3305         (WebCore::InbandTextTrackPrivate::inBandMetadataTrackDispatchType):
3306         * platform/graphics/TrackPrivateBase.h:
3307         (WebCore::TrackPrivateBase::id):
3308         (WebCore::TrackPrivateBase::label):
3309         (WebCore::TrackPrivateBase::language):
3310         * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
3311         (WebCore::AVTrackPrivateAVFObjCImpl::id):
3312         (WebCore::AVTrackPrivateAVFObjCImpl::label):
3313         (WebCore::AVTrackPrivateAVFObjCImpl::language):
3314         * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.h:
3315         * platform/graphics/avfoundation/cf/InbandTextTrackPrivateAVCF.cpp:
3316         (WebCore::InbandTextTrackPrivateAVCF::label):
3317         (WebCore::InbandTextTrackPrivateAVCF::language):
3318         * platform/graphics/avfoundation/cf/InbandTextTrackPrivateLegacyAVCF.cpp:
3319         (WebCore::InbandTextTrackPrivateLegacyAVCF::label):
3320         (WebCore::InbandTextTrackPrivateLegacyAVCF::language):
3321         * platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.mm:
3322         (WebCore::InbandTextTrackPrivateAVFObjC::label):
3323         (WebCore::InbandTextTrackPrivateAVFObjC::language):
3324         * platform/graphics/avfoundation/objc/InbandTextTrackPrivateLegacyAVFObjC.mm:
3325         (WebCore::InbandTextTrackPrivateLegacyAVFObjC::label):
3326         (WebCore::InbandTextTrackPrivateLegacyAVFObjC::language):
3327         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3328         (WebCore::metadataType):
3329         (WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive):
3330         * platform/graphics/cocoa/FontCacheCoreText.cpp:
3331         (WebCore::FontCache::platformAlternateFamilyName):
3332         * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
3333         (WebCore::FontCascadeDescription::effectiveFamilyAt):
3334         * platform/graphics/freetype/FontCacheFreeType.cpp:
3335         (WebCore::FontCache::platformAlternateFamilyName):
3336         * platform/graphics/gstreamer/InbandMetadataTextTrackPrivateGStreamer.h:
3337         (WebCore::InbandMetadataTextTrackPrivateGStreamer::create):
3338         * platform/graphics/win/FontCacheWin.cpp:
3339         (WebCore::FontCache::platformAlternateFamilyName):
3340         * platform/mediastream/AudioTrackPrivateMediaStream.h:
3341         * platform/mediastream/RealtimeMediaSourceSettings.cpp:
3342         (WebCore::RealtimeMediaSourceSettings::facingMode):
3343         * platform/mediastream/VideoTrackPrivateMediaStream.h:
3344         * rendering/HitTestResult.cpp:
3345         (WebCore::HitTestResult::linkSuggestedFilename):
3346         * rendering/InlineTextBox.cpp:
3347         (WebCore::InlineTextBox::paint):
3348         * rendering/RenderListItem.cpp:
3349         (WebCore::RenderListItem::markerText):
3350         * rendering/RenderText.cpp:
3351         (WebCore::RenderText::previousOffset):
3352         (WebCore::RenderText::nextOffset):
3353         * rendering/RenderTreeAsText.cpp:
3354         (WebCore::RenderTreeAsText::writeRenderObject):
3355         * rendering/TextPainter.cpp:
3356         (WebCore::TextPainter::paintTextAndEmphasisMarksIfNeeded):
3357         * rendering/style/RenderStyle.cpp:
3358         (WebCore::RenderStyle::textEmphasisMarkString):
3359         * rendering/style/RenderStyle.h:
3360         (WebCore::RenderStyle::initialHyphenationString):
3361         (WebCore::RenderStyle::initialTextEmphasisCustomMark):
3362         (WebCore::RenderStyle::initialContentAltText):
3363         (WebCore::RenderStyle::initialLineGrid):
3364         (WebCore::RenderStyle::initialFlowThread):
3365         (WebCore::RenderStyle::initialRegionThread):
3366         * style/StyleScope.cpp:
3367         (WebCore::Style::Scope::collectActiveStyleSheets):
3368         * svg/SVGElement.cpp:
3369         (WebCore::SVGElement::getPresentationAttribute):
3370         * svg/SVGElement.h:
3371         (WebCore::SVGAttributeHashTranslator::hash):
3372         * svg/SVGUseElement.cpp:
3373         (WebCore::SVGUseElement::transferSizeAttributesToTargetClone):
3374         * svg/animation/SVGSMILElement.cpp:
3375         (WebCore::SVGSMILElement::constructAttributeName):
3376         * testing/MockCDMFactory.cpp:
3377         (WebCore::MockCDMInstance::requestLicense):
3378         * xml/XMLErrors.cpp:
3379         (WebCore::createXHTMLParserErrorHeader):
3380         * xml/XPathStep.cpp:
3381         (WebCore::XPath::nodeMatchesBasicTest):
3382         (WebCore::XPath::Step::nodesInAxis):
3383         * xml/parser/XMLDocumentParserLibxml2.cpp:
3384         (WebCore::XMLDocumentParser::XMLDocumentParser):
3385         (WebCore::handleNamespaceAttributes):
3386         (WebCore::handleElementAttributes):
3387
3388 2017-07-05  Chris Dumez  <cdumez@apple.com>
3389
3390         [iOS] User agent string incorrectly says "iPhone" instead of "iPad" on newer iPads
3391         https://bugs.webkit.org/show_bug.cgi?id=174182
3392         <rdar://problem/32868369>
3393
3394         Reviewed by Tim Horton.
3395
3396         In deviceNameForUserAgent() on iOS, we were forcefully returning "iPhone" if
3397         [UIApplication _isClassic] returns true. Update check to return "iPad" if
3398         [UIApplication _isClassic] returns true but [UIApplication _classMode] returns
3399         UIApplicationSceneClassicModeOriginalPad.
3400
3401         * page/ios/UserAgentIOS.mm:
3402         (WebCore::isClassicPad):
3403         (WebCore::isClassicPhone):
3404         (WebCore::osNameForUserAgent):
3405         (WebCore::deviceNameForUserAgent):
3406         * platform/spi/ios/UIKitSPI.h:
3407
3408 2017-07-05  Yusuke Suzuki  <utatane.tea@gmail.com>
3409
3410         WTF::Thread should have the threads stack bounds.
3411         https://bugs.webkit.org/show_bug.cgi?id=173975
3412
3413         Reviewed by Keith Miller.
3414
3415         When creating WebThread, we first allocate WebCore::ThreadGlobalData in UI thread
3416         and share it with WebThread.
3417         The problem is that WebCore::ThreadGlobalData has CachedResourceRequestInitiators.
3418         It allocates AtomicString, which requires WTFThreadData.
3419
3420         Before this patch, it was OK because WTFThreadData does not touch threading related
3421         things except for ThreadSpecific<>. However, after this patch, it touches
3422         WTF::Thread::current() which requires WTF::initializeThreading().
3423
3424         In this patch, we call WTF::initializeThreading() before allocating WebCore::ThreadGlobalData.
3425         And we also call AtomicString::init() before calling WebCore::ThreadGlobalData since
3426         WebCore::ThreadGlobalData allocates AtomicString.
3427
3428         This fixes crashes in the iOS web threading environment (UIWebView).
3429
3430         * platform/ios/wak/WebCoreThread.mm:
3431         (StartWebThread):
3432
3433 2017-07-05  Myles C. Maxfield  <mmaxfield@apple.com>
3434
3435         CSSFontStyleValue::isItalic seems a bit bogus.
3436         https://bugs.webkit.org/show_bug.cgi?id=174149
3437
3438         Reviewed by Tim Horton.
3439
3440         Simple typo.
3441
3442         Test: editing/execCommand/italicizeByCharacter-normal.html
3443
3444         * css/CSSFontStyleValue.h:
3445
3446 2017-07-05  Brady Eidson  <beidson@apple.com>
3447
3448         Allow navigations in subframes to get a ShouldOpenExternalURLsPolicy of "ShouldAllow".
3449         <rdar://problem/22485589> and https://bugs.webkit.org/show_bug.cgi?id=174178
3450
3451         Reviewed by Alex Christensen.
3452
3453         Test: loader/navigation-policy/should-open-external-urls/subframe-navigated-programatically-by-main-frame.html
3454
3455         This patch introduces a new flag to FrameLoadRequest to track when it is known with certainty that a 
3456         FrameLoadRequest originates from the main frame.
3457         
3458         Later, when calculating the final ShouldOpenExternalURLsPolicy, main frames navigating iframes get to propagate
3459         their permissions to the iframe.
3460         
3461         * bindings/js/CommonVM.cpp:
3462         (WebCore::lexicalFrameFromCommonVM): Helper to grab the current frame associated with the current JS callstack.
3463         * bindings/js/CommonVM.h:
3464
3465         * inspector/InspectorFrontendClientLocal.cpp:
3466         (WebCore::InspectorFrontendClientLocal::openInNewTab):
3467
3468         * inspector/InspectorPageAgent.cpp:
3469         (WebCore::InspectorPageAgent::navigate):
3470
3471         Add the new flag to FrameLoadRequest (and force almost everybody to explicitly include the flag):
3472         * loader/FrameLoadRequest.cpp:
3473         (WebCore::FrameLoadRequest::FrameLoadRequest):
3474         * loader/FrameLoadRequest.h:
3475         (WebCore::FrameLoadRequest::FrameLoadRequest):
3476         (WebCore::FrameLoadRequest::navigationInitiatedByMainFrame):
3477
3478         * loader/FrameLoader.cpp:
3479         (WebCore::FrameLoader::urlSelected):
3480         (WebCore::FrameLoader::loadURLIntoChildFrame):
3481         (WebCore::shouldOpenExternalURLsPolicyToApply): Helper that takes the new flag into account when deciding
3482           what the final ShouldOpenExternalURLsPolicy will be.
3483         (WebCore::applyShouldOpenExternalURLsPolicyToNewDocumentLoader):
3484         (WebCore::FrameLoader::loadURL):
3485         (WebCore::FrameLoader::load):
3486         (WebCore::FrameLoader::loadWithNavigationAction):
3487         (WebCore::FrameLoader::reloadWithOverrideEncoding):
3488         (WebCore::FrameLoader::reload):
3489         (WebCore::FrameLoader::loadPostRequest):
3490         (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):
3491         (WebCore::FrameLoader::loadDifferentDocumentItem):
3492         (WebCore::createWindow):
3493         (WebCore::FrameLoader::applyShouldOpenExternalURLsPolicyToNewDocumentLoader): Deleted.
3494         * loader/FrameLoader.h:
3495
3496         * loader/FrameLoaderTypes.h:
3497
3498         * loader/NavigationAction.h:
3499         (WebCore::NavigationAction::navigationInitiatedByMainFrame):
3500         * loader/NavigationScheduler.cpp:
3501         (WebCore::ScheduledNavigation::ScheduledNavigation): Grab the "initiating frame" at the time the 
3502           ScheduledNavigation is created, as it dictates the policy we decide later.
3503         (WebCore::ScheduledNavigation::navigationInitiatedByMainFrame):
3504         (WebCore::NavigationScheduler::scheduleLocationChange):
3505
3506         * page/ContextMenuController.cpp:
3507         (WebCore::openNewWindow):
3508         (WebCore::ContextMenuController::contextMenuItemSelected):
3509
3510         * page/DOMWindow.cpp:
3511         (WebCore::DOMWindow::createWindow):
3512
3513 2017-07-05  Simon Fraser  <simon.fraser@apple.com>
3514
3515         Another build fix, for Mac.
3516
3517         * platform/graphics/cocoa/IOSurface.mm:
3518         (WebCore::IOSurface::surfaceID):
3519
3520 2017-07-05  Simon Fraser  <simon.fraser@apple.com>
3521
3522         Further attempts to fix the iOS public SDK build.
3523
3524         * platform/graphics/cocoa/IOSurface.mm:
3525         (WebCore::IOSurface::surfaceID):
3526         * platform/spi/cocoa/IOSurfaceSPI.h:
3527
3528 2017-07-05  Don Olmstead  <don.olmstead@sony.com>
3529
3530         [WinCairo] Consolidate CMake code related to CURL
3531         https://bugs.webkit.org/show_bug.cgi?id=170860
3532
3533         Reviewed by Alex Christensen.
3534
3535         No new tests. No change in functionality.
3536
3537         * PlatformWinCairo.cmake:
3538         * platform/Curl.cmake: Added.
3539
3540 2017-07-03  Myles C. Maxfield  <mmaxfield@apple.com>
3541
3542         Remove copy of ICU headers from WebKit
3543         https://bugs.webkit.org/show_bug.cgi?id=116407
3544
3545         Reviewed by Alex Christensen.
3546
3547         Use WTF's copy of ICU headers.
3548
3549         No new tests because there is no behavior change.
3550
3551         * Configurations/WebCore.xcconfig:
3552         * icu/unicode/bytestream.h: Removed.
3553         * icu/unicode/localpointer.h: Removed.
3554         * icu/unicode/parseerr.h: Removed.
3555         * icu/unicode/platform.h: Removed.
3556         * icu/unicode/ptypes.h: Removed.
3557         * icu/unicode/putil.h: Removed.
3558         * icu/unicode/rep.h: Removed.
3559         * icu/unicode/std_string.h: Removed.
3560         * icu/unicode/strenum.h: Removed.
3561         * icu/unicode/stringpiece.h: Removed.
3562         * icu/unicode/ubrk.h: Removed.
3563         * icu/unicode/uchar.h: Removed.
3564         * icu/unicode/ucnv.h: Removed.
3565         * icu/unicode/ucnv_err.h: Removed.
3566         * icu/unicode/ucol.h: Removed.
3567         * icu/unicode/uconfig.h: Removed.
3568         * icu/unicode/ucurr.h: Removed.
3569         * icu/unicode/uenum.h: Removed.
3570         * icu/unicode/uiter.h: Removed.
3571         * icu/unicode/uloc.h: Removed.
3572         * icu/unicode/umachine.h: Removed.
3573         * icu/unicode/unistr.h: Removed.
3574         * icu/unicode/unorm.h: Removed.
3575         * icu/unicode/unorm2.h: Removed.
3576         * icu/unicode/uobject.h: Removed.
3577         * icu/unicode/urename.h: Removed.
3578         * icu/unicode/uscript.h: Removed.
3579         * icu/unicode/uset.h: Removed.
3580         * icu/unicode/ustring.h: Removed.
3581         * icu/unicode/utext.h: Removed.
3582         * icu/unicode/utf.h: Removed.
3583         * icu/unicode/utf16.h: Removed.
3584         * icu/unicode/utf8.h: Removed.
3585         * icu/unicode/utf_old.h: Removed.
3586         * icu/unicode/utypes.h: Removed.
3587         * icu/unicode/uvernum.h: Removed.
3588         * icu/unicode/uversion.h: Removed.
3589         * platform/graphics/FontCache.h:
3590         (WebCore::FontDescriptionKey::makeFlagsKey):
3591
3592 2017-07-05  Wenson Hsieh  <wenson_hsieh@apple.com>
3593
3594         When dragging a selection, clearing the selection in dragstart should not crash the web process
3595         https://bugs.webkit.org/show_bug.cgi?id=174142
3596         <rdar://problem/33067501>
3597
3598         Reviewed by Tim Horton.
3599
3600         Currenly, if the page clears the current selection after dragging starts on selected content, the web process
3601         will crash while attempting to write pasteboard data for a nonexistent selection. This patch adds a trivial
3602         check for this case, bailing if no DHTML dragging data was specified by the page during a selection drag and the
3603         selection has been cleared.
3604
3605         Also removes some unused code for estimating the bounds of the current selection. On iOS, dragging was actually
3606         crashing earlier, in this codepath. However, this information isn't even used anymore, since the drag anchor
3607         point is no longer necessary on iOS.
3608
3609         Test: DataInteractionTests.DoNotCrashWhenSelectionIsClearedInDragStart
3610
3611         * page/DragController.cpp:
3612         (WebCore::DragController::startDrag):
3613
3614 2017-07-05  Simon Fraser  <simon.fraser@apple.com>
3615
3616         Try to fix iOS 10.3 public SDK builds.
3617
3618         * platform/spi/cocoa/IOSurfaceSPI.h:
3619
3620 2017-07-05  Zalan Bujtas  <zalan@apple.com>
3621
3622         REGRESSION (r217522): "Show My Relationship" link in familysearch.org does not work.
3623         https://bugs.webkit.org/show_bug.cgi?id=174070
3624         <rdar://problem/32940653>
3625
3626         Reviewed by Simon Fraser.
3627
3628         Decouple in- and out-of-flow computed position values. Now we match blink's implementation on
3629         in-flow values.
3630         This also fixes the flickering content while scrolling on hbr.org.  
3631
3632         Covered by existing test cases.
3633
3634         * css/CSSComputedStyleDeclaration.cpp:
3635         (WebCore::positionOffsetValue):
3636
3637 2017-07-05  Devin Rousso  <drousso@apple.com>
3638
3639         Web Inspector: Allow users to log any tracked canvas context
3640         https://bugs.webkit.org/show_bug.cgi?id=173397
3641         <rdar://problem/33111581>
3642
3643         Reviewed by Joseph Pecoraro.
3644
3645         Tests: inspector/canvas/resolveCanvasContext-2d.html
3646                inspector/canvas/resolveCanvasContext-webgl.html
3647                inspector/canvas/resolveCanvasContext-webgl2.html
3648                inspector/canvas/resolveCanvasContext-webgpu.html
3649
3650         * inspector/InspectorCanvasAgent.h:
3651         * inspector/InspectorCanvasAgent.cpp:
3652         (WebCore::InspectorCanvasAgent::InspectorCanvasAgent):
3653         (WebCore::contextAsScriptValue):
3654         (WebCore::InspectorCanvasAgent::resolveCanvasContext):
3655
3656 2017-07-05  Emilio Cobos Álvarez  <ecobos@igalia.com>
3657
3658         Style sharing check for fullscreen element seems bogus.
3659         https://bugs.webkit.org/show_bug.cgi?id=160196
3660
3661         Reviewed by Antti Koivisto.
3662
3663         No new tests (no easy way to test this reliably).
3664
3665         * style/StyleSharingResolver.cpp:
3666         (WebCore::Style::SharingResolver::canShareStyleWithElement):
3667
3668 2017-07-05  Simon Fraser  <simon.fraser@apple.com>
3669
3670         Add a logging channel for IOSurface allocations
3671         https://bugs.webkit.org/show_bug.cgi?id=174167
3672
3673         Reviewed by Tim Horton.
3674
3675         Add an "IOSurface" log channel, make IOSurface TextStream-loggable, and log cached
3676         and new IOSurface allocations. Do some namespace-related cleanup.
3677
3678         * platform/Logging.h:
3679         * platform/graphics/cocoa/IOSurface.h:
3680         * platform/graphics/cocoa/IOSurface.mm:
3681         (WebCore::WebCore::IOSurface::create):
3682         (WebCore::WebCore::IOSurface::surfaceID):
3683         (WebCore::operator<<):
3684
3685 2017-07-05  Antti Koivisto  <antti@apple.com>
3686
3687         Low memory notification shouldn't cause style recalc
3688         https://bugs.webkit.org/show_bug.cgi?id=173574
3689         <rdar://problem/32616997>
3690
3691         Reviewed by Andreas Kling.
3692
3693         Patch mostly by Myles.
3694
3695         When we receive a low memory warning, we clear the style resolver. Previously, we were using
3696         this as an opportunity to also purge the CSSFontSelector. However, purging the font selector
3697         is wasteful, since the exact same set of CSSFontFace objects will be recreated as soon as the
3698         CSSFontSelector is recreated. It's also harmful because this purge operation causes fonts to
3699         be removed from the document's working set, and therefore triggers a relayout. Instead, this
3700         call should be softened to only delete any transitory caches the CSSFontSelector owns.
3701
3702         We can simply delay the rebuild of the CSSFontSelector to
3703         StyleResolver::appendAuthorStyleSheets(), when it's really needed. This way, we can sidestep
3704         this whole problem.
3705
3706         There's also an added benefit: Now, buildStarted() doesn't have to be idempotent, so we can
3707         enforce a stricter calling sequence with ASSERT()s.
3708
3709         * css/CSSFontFaceSet.cpp:
3710         (WebCore::CSSFontFaceSet::emptyCaches):
3711         * css/CSSFontFaceSet.h:
3712         * css/CSSFontSelector.cpp:
3713         (WebCore::CSSFontSelector::emptyCaches):
3714
3715             Add a separate function to clear font selector caches.
3716
3717         (WebCore::CSSFontSelector::buildStarted):
3718         (WebCore::CSSFontSelector::buildCompleted):
3719         (WebCore::CSSFontSelector::addFontFaceRule):
3720         (WebCore::CSSFontSelector::fontModified):
3721
3722             No need to invalidate while building.
3723
3724         (WebCore::CSSFontSelector::fontRangesForFamily):
3725         * css/CSSFontSelector.h:
3726         * css/StyleResolver.cpp:
3727         (WebCore::StyleResolver::StyleResolver):
3728         (WebCore::StyleResolver::addCurrentSVGFontFaceRules):
3729
3730             Factor into a function from the constructor.
3731
3732         (WebCore::StyleResolver::appendAuthorStyleSheets):
3733
3734             Font selector build is now started and finished by StyleScope.
3735
3736         * css/StyleResolver.h:
3737         * dom/Document.cpp:
3738         (WebCore::Document::resolveStyle):
3739
3740             Call FrameView::styleDidChange() to update any custom scrollbars.
3741             This bug was hidden by spurious style recalcs, tested by fast/css/scrollbar-dynamic-style-change.html
3742
3743         (WebCore::Document::userAgentShadowTreeStyleResolver):
3744         (WebCore::Document::didClearStyleResolver):
3745
3746             Don't start the font selector rebuild after clearing the resolver. It would cause style recalc trashing.
3747             Instead the build starts when the new resolver is constructed.
3748
3749         * page/MemoryRelease.cpp:
3750         (WebCore::releaseCriticalMemory):
3751
3752             Release font selector caches.
3753
3754         * style/StyleScope.cpp:
3755         (WebCore::Style::Scope::resolver):
3756
3757 2017-07-05  Brent Fulgham  <bfulgham@apple.com>
3758
3759         [WK2] Prevent ResourceLoadStatistics from triggering a cascade of read/write events
3760         https://bugs.webkit.org/show_bug.cgi?id=174062\
3761         <rdar://problem/33086744>
3762
3763         Reviewed by Chris Dumez.
3764
3765         Treat DISPATCH_VNODE_DELETE, DISPATCH_VNODE_RENAME, and DISPATCH_VNODE_REVOKE as equivalent
3766         "file is unavailable" events, and act as though the file was deleted. Don't listen for
3767         DISPATCH_VNODE_EXTEND, since we always get a DISPATCH_VNODE_WRITE as well, and we only
3768         want to read once.
3769
3770         Finally, add some logging to support future investigations.
3771
3772         * platform/FileMonitor.h:
3773         (WebCore::FileMonitor::platformMonitor): Expose dispatch_source_t for logging purposes.
3774         * platform/cocoa/FileMonitorCocoa.mm:
3775         (WebCore::FileMonitor::startMonitoring): Add logging.
3776         (WebCore::FileMonitor::stopMonitoring): Ditto.
3777
3778 2017-07-05  Jonathan Bedard  <jbedard@apple.com>
3779
3780         Add WebKitPrivateFrameworkStubs for iOS 11
3781         https://bugs.webkit.org/show_bug.cgi?id=173988
3782
3783         Reviewed by David Kilzer.
3784
3785         * Configurations/WebCore.xcconfig: iphoneos and iphonesimulator should use the
3786         same directory for private framework stubs.
3787
3788 2017-07-05  Emilio Cobos Álvarez  <ecobos@igalia.com>
3789
3790         Don't resolve an extra computed style for getComputedStyle in a display: none subtree.
3791         https://bugs.webkit.org/show_bug.cgi?id=174145
3792
3793         Before this, we were also resolving the first ancestor's style as
3794         inheriting from itself, which felt pretty wrong (though I think it's
3795         not observable).
3796
3797         Reviewed by Antti Koivisto.
3798
3799         No new tests (non-observable behavior).
3800
3801         * dom/Element.cpp:
3802         (WebCore::Element::resolveComputedStyle):
3803
3804 2017-07-05  Frederic Wang  <fwang@igalia.com>
3805
3806         Move ScrolledContentsLayer property to ScrollingStateScrollingNode
3807         https://bugs.webkit.org/show_bug.cgi?id=174134
3808
3809         Reviewed by Simon Fraser.
3810
3811         ScrollingStateFrameScrollingNode and ScrollingStateOverflowScrollingNode both use a
3812         ScrolledContentsLayer property for the same purpose. This commit moves that property into
3813         their parent class ScrollingStateScrollingNode, so that more code is shared between the two
3814         classes. This will also help the refactoring in bug 174130.
3815
3816         No new tests, only dumped tree may change a bit.
3817
3818         * page/scrolling/ScrollingStateFrameScrollingNode.cpp: Remove scrolled contents layer.
3819         (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
3820         (WebCore::ScrollingStateFrameScrollingNode::dumpProperties):
3821         (WebCore::ScrollingStateFrameScrollingNode::setScrolledContentsLayer): Deleted.
3822         * page/scrolling/ScrollingStateFrameScrollingNode.h: Ditto.
3823         * page/scrolling/ScrollingStateOverflowScrollingNode.cpp: Ditto.
3824         (WebCore::ScrollingStateOverflowScrollingNode::ScrollingStateOverflowScrollingNode):
3825         (WebCore::ScrollingStateOverflowScrollingNode::dumpProperties):
3826         (WebCore::ScrollingStateOverflowScrollingNode::setScrolledContentsLayer): Deleted.
3827         * page/scrolling/ScrollingStateOverflowScrollingNode.h: Ditto.
3828         (): Deleted.
3829         (WebCore::ScrollingStateOverflowScrollingNode::scrolledContentsLayer): Deleted.
3830         * page/scrolling/ScrollingStateScrollingNode.cpp: Add scrolled contents layer.
3831         (WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode):
3832         (WebCore::ScrollingStateScrollingNode::setScrolledContentsLayer):
3833         (WebCore::ScrollingStateScrollingNode::dumpProperties): Use the label from the overflow class
3834         which is different from the frame class. The dumping order may change a bit too.
3835         * page/scrolling/ScrollingStateScrollingNode.h: Add ScrolledContentsLayer to the enum and
3836         scrolled contents layer.
3837         (WebCore::ScrollingStateScrollingNode::scrolledContentsLayer):
3838         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
3839         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren): Adjust enum value
3840         to use ScrollingStateScrollingNode::ScrolledContentsLayer.
3841
3842 2017-07-05  Emilio Cobos Álvarez  <ecobos@igalia.com>
3843
3844         ProcessingInstruction::clearExistingCachedSheet doesn't really exist.
3845         https://bugs.webkit.org/show_bug.cgi?id=174146
3846
3847         Reviewed by Chris Dumez.
3848
3849         No new tests (no functionality change).
3850
3851         * dom/ProcessingInstruction.h: Remove dead declaration.
3852
3853 2017-07-05  Matt Lewis  <jlewis3@apple.com>
3854
3855         Unreviewed, rolling out r219128.
3856
3857         Spoke with engineer who originally submitted, Patch for APi
3858         test to follow.
3859
3860         Reverted changeset:
3861
3862         "Unreviewed, rolling out r219070."
3863         https://bugs.webkit.org/show_bug.cgi?id=174082
3864         http://trac.webkit.org/changeset/219128
3865
3866 2017-07-05  Matt Lewis  <jlewis3@apple.com>
3867
3868         Unreviewed, rolling out r219070.
3869
3870         This revision caused consistent failures of the API test
3871         UIPasteboardTests.DoNotPastePlainTextAsURL on iOS.
3872
3873         Reverted changeset:
3874
3875         "Pasting single words copied to UIPasteboard inserts URLs in
3876         editable areas"
3877         https://bugs.webkit.org/show_bug.cgi?id=174082
3878         http://trac.webkit.org/changeset/219070
3879
3880 2017-07-05  Youenn Fablet  <youenn@apple.com>
3881
3882         Receiving tracks should be ended when peer connection is being closed
3883         https://bugs.webkit.org/show_bug.cgi?id=174109
3884
3885         Reviewed by Eric Carlson.
3886
3887         Test: webrtc/peer-connection-track-end.html
3888
3889         As per https://www.w3.org/TR/webrtc/#dom-rtcpeerconnection-close, tracks should be ended when peer connection is closed.
3890         Also updating transceiver stopped state.
3891
3892         * Modules/mediastream/RTCPeerConnection.cpp:
3893         (WebCore::RTCPeerConnection::doClose):
3894         * Modules/mediastream/RTCRtpReceiver.cpp:
3895         (WebCore::RTCRtpReceiver::stop):
3896         * Modules/mediastream/RTCRtpReceiver.h:
3897
3898 2017-07-04  Said Abou-Hallawa  <sabouhallawa@apple.com>
3899
3900         Unreviewed, review follow-up after r218961
3901
3902         * platform/graphics/BitmapImage.cpp:
3903         (WebCore::BitmapImage::updateFromSettings):
3904
3905 2017-07-04  Antti Koivisto  <antti@apple.com>
3906
3907         RenderThemeCocoa::mediaControlsFormattedStringForDuration is leaking NSDateComponentsFormatters
3908         https://bugs.webkit.org/show_bug.cgi?id=174138
3909
3910         Reviewed by Ryosuke Niwa.
3911
3912         Saw a random spin here during media playback. Looks like we are leaking.
3913
3914         * rendering/RenderThemeCocoa.h:
3915         * rendering/RenderThemeCocoa.mm:
3916         (WebCore::RenderThemeCocoa::mediaControlsFormattedStringForDuration):
3917
3918             Reuse NSDateComponentsFormatter.
3919
3920 2017-07-04  Antti Koivisto  <antti@apple.com>
3921
3922         FrameView should not set RenderView::logicalWidth directly for printing
3923         https://bugs.webkit.org/show_bug.cgi?id=174135
3924
3925         Reviewed by Zalan Bujtas.
3926
3927         Renderer logicalWidth should be set by layout. Direct override by RenderView when printing means
3928         that we don't layout children in all cases when the width changes. This is currently mostly hidden
3929         by spurious layouts but causes problems when trying to fix other things that reduces those.
3930
3931         * page/FrameView.cpp:
3932         (WebCore::FrameView::forceLayoutForPagination):
3933
3934             Instead of calling setLogicalWidth directly call the new setPageLogicalSize that sets both the width
3935             and the height uniformly.
3936
3937         * rendering/RenderView.cpp:
3938         (WebCore::RenderView::updateLogicalWidth):
3939
3940             Use pageLogicalSize->width() in printing state instead of skipping the logical width update entirely.
3941             This ensures that the layout will progress to children when the page logical width changes.
3942
3943         (WebCore::RenderView::initializeLayoutState):
3944         (WebCore::RenderView::layout):
3945         (WebCore::RenderView::pageOrViewLogicalHeight):
3946         (WebCore::RenderView::setPageLogicalSize):
3947         * rendering/RenderView.h:
3948
3949             Replace the existing m_pageLogicalHeight with std::optional m_pageLogicalSize.
3950
3951 2017-07-04  Xabier Rodriguez Calvar  <calvaris@igalia.com>
3952
3953         [EME] Solve a couple of compiler warnings
3954         https://bugs.webkit.org/show_bug.cgi?id=174020
3955
3956         Reviewed by Michael Catanzaro.
3957
3958         * Modules/encryptedmedia/CDM.cpp:
3959         (WebCore::CDM::isPersistentType): Added default return and
3960         assertion.
3961         * Modules/encryptedmedia/MediaKeySession.cpp:
3962         (WebCore::MediaKeySession::updateKeyStatuses): This warning was
3963         already solved but I think adding an assertion for the default
3964         case can help catch errors in the future.
3965
3966 2017-07-04  Joseph Pecoraro  <pecoraro@apple.com>
3967
3968         Cleanup some StringBuilder use
3969         https://bugs.webkit.org/show_bug.cgi?id=174118
3970
3971         Reviewed by Andreas Kling.
3972
3973         * Modules/mediastream/PeerConnectionBackend.cpp:
3974         (WebCore::filterICECandidate):
3975         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
3976         * contentextensions/ContentExtension.cpp:
3977         (WebCore::ContentExtensions::ContentExtension::compileGlobalDisplayNoneStyleSheet):
3978         * css/CSSFontStyleRangeValue.cpp:
3979         (WebCore::CSSFontStyleRangeValue::customCSSText):
3980         * css/CSSFontStyleValue.cpp:
3981         (WebCore::CSSFontStyleValue::customCSSText):
3982         * css/CSSGridAutoRepeatValue.cpp:
3983         (WebCore::CSSGridAutoRepeatValue::customCSSText):
3984         * css/parser/CSSParser.cpp:
3985         (WebCore::CSSParser::parseFontFaceDescriptor):
3986         * dom/Attr.cpp:
3987         * html/canvas/WebGPURenderingContext.cpp:
3988         * html/parser/HTMLParserIdioms.cpp:
3989         * platform/network/ParsedContentType.cpp:
3990         * platform/network/cocoa/CookieCocoa.mm:
3991         * platform/text/mac/LocaleMac.mm:
3992         * xml/XMLHttpRequest.cpp:
3993         (WebCore::XMLHttpRequest::getAllResponseHeaders):
3994
3995 2017-07-03  Andreas Kling  <akling@apple.com>
3996
3997         Null RenderLayer* deref in FrameView::adjustTiledBackingCoverage()
3998         https://bugs.webkit.org/show_bug.cgi?id=174106
3999         <rdar://problem/33085838>
4000
4001         Reviewed by Tim Horton.
4002
4003         I haven't been able to reproduce this crash locally, but I have seen
4004         video of someone who can, so here's a null check for the RenderView::layer()
4005         which could be null if we're called between RenderView construction
4006         and the first callback to RenderLayerModelObject::styleDidChange().
4007
4008         * page/FrameView.cpp:
4009         (WebCore::FrameView::adjustTiledBackingCoverage):
4010
4011 2017-07-03  Matt Rajca  <mrajca@apple.com>
4012
4013         Add/remove appropriate media element behavior restrictions when updateWebsitePolicies is called
4014         https://bugs.webkit.org/show_bug.cgi?id=174103
4015
4016         Reviewed by Alex Christensen.
4017
4018         Test: Added API test.
4019
4020         Added support for updating rate change behavior restrictions on media elements that have already
4021         been created.
4022
4023         * html/HTMLMediaElement.cpp:
4024         (WebCore::HTMLMediaElement::updateRateChangeRestrictions):
4025         * html/HTMLMediaElement.h:
4026         * page/Page.cpp:
4027         (WebCore::Page::updateMediaElementRateChangeRestrictions):
4028         * page/Page.h:
4029
4030 2017-07-03  Matt Lewis  <jlewis3@apple.com>
4031
4032         Unreviewed, rolling out r219103.
4033
4034         Caused multiple build failures.
4035
4036         Reverted changeset:
4037
4038         "Remove copy of ICU headers from We