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