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