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