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