Resource Load Statistics: User interaction should always go to top document
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-07-08  John Wilander  <wilander@apple.com>
2
3         Resource Load Statistics: User interaction should always go to top document
4         https://bugs.webkit.org/show_bug.cgi?id=174120
5         <rdar://problem/33117899>
6
7         Reviewed by Chris Dumez.
8
9         Test: http/tests/loading/resourceLoadStatistics/user-interaction-in-cross-origin-sub-frame.html
10
11         * dom/UserGestureIndicator.cpp:
12         (WebCore::UserGestureIndicator::UserGestureIndicator):
13             Now logs user interaction for the top document.
14         * loader/ResourceLoadObserver.cpp:
15         (WebCore::ResourceLoadObserver::setThrottledObserverNotifications):
16             Test infrastructure.
17         (WebCore::ResourceLoadObserver::setNotificationCallback):
18             Callback now takes a ResourceLoadObserver::NotificationType.
19         (WebCore::ResourceLoadObserver::logFrameNavigation):
20             Submits the configured ResourceLoadObserver::NotificationType.
21         (WebCore::ResourceLoadObserver::logSubresourceLoading):
22             Submits the configured ResourceLoadObserver::NotificationType.
23         (WebCore::ResourceLoadObserver::logWebSocketLoading):
24             Submits the configured ResourceLoadObserver::NotificationType.
25         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
26             Submits the configured ResourceLoadObserver::NotificationType.
27         * loader/ResourceLoadObserver.h:
28         * testing/Internals.cpp:
29         (WebCore::Internals::resetToConsistentState):
30             Resets to throttled notifications.
31         (WebCore::Internals::setResourceLoadStatisticsThrottledObserverNotifications):
32             Test infrastructure.
33         * testing/Internals.h:
34         * testing/Internals.idl:
35             Added internals.setResourceLoadStatisticsThrottledObserverNotifications().
36
37 2017-07-09  Brady Eidson  <beidson@apple.com>
38
39         Remove some obsolete WebKitVersionChecks.
40         https://bugs.webkit.org/show_bug.cgi?id=174294
41
42         Reviewed by Dan Bernstein.
43
44         No new tests (No change to testable behavior)
45
46         * dom/ScriptExecutionContext.cpp:
47         (WebCore::ScriptExecutionContext::dispatchErrorEvent):
48         
49         * page/Settings.in:
50         
51         * platform/RuntimeApplicationChecks.h:
52         * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
53         (WebCore::IOSApplication::isOkCupid): Deleted.
54         (WebCore::IOSApplication::isFacebook): Deleted.
55         
56         * rendering/RenderBox.cpp:
57         (WebCore::RenderBox::layoutOverflowRectForPropagation):
58
59 2017-07-08  Brady Eidson  <beidson@apple.com>
60
61         Remove some obsolete RuntimeApplicationChecks.
62         https://bugs.webkit.org/show_bug.cgi?id=174293
63
64         Reviewed by Dan Bernstein.
65
66         No new tests (No change to testable behavior)
67
68         * html/HTMLObjectElement.cpp:
69         (WebCore::HTMLObjectElement::parametersForPlugin):
70         (WebCore::shouldNotPerformURLAdjustment): Deleted.
71
72         * platform/RuntimeApplicationChecks.h:
73         * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
74         (WebCore::IOSApplication::isDaijisenDictionary): Deleted.
75         (WebCore::IOSApplication::isNASAHD): Deleted.
76         (WebCore::IOSApplication::isTheEconomistOnIphone): Deleted.
77
78         * platform/ios/wak/WebCoreThread.h:
79         * platform/ios/wak/WebCoreThread.mm:
80         (StartWebThread):
81         (WebThreadSetDelegateSourceRunLoopMode): Deleted.
82
83 2017-07-08  Basuke Suzuki  <Basuke.Suzuki@sony.com>
84
85         [Curl] Safe access and life cycle management of bare Curl handle
86         by wrapping with C++ class
87         https://bugs.webkit.org/show_bug.cgi?id=174002
88
89         Reviewed by Alex Christensen.
90
91         * platform/network/ResourceHandle.h:
92         * platform/network/ResourceHandleInternal.h:
93         * platform/network/curl/CookieJarCurl.cpp:
94         (WebCore::setCookiesFromDOM):
95         (WebCore::cookiesForSession):
96         * platform/network/curl/CurlContext.cpp:
97         (WebCore::CurlContext::CurlContext):
98         (WebCore::CurlContext::~CurlContext):
99         (WebCore::CurlContext::initCookieSession):
100         (WebCore::CurlShareHandle::CurlShareHandle):
101         (WebCore::CurlShareHandle::~CurlShareHandle):
102         (WebCore::CurlShareHandle::lockCallback):
103         (WebCore::CurlShareHandle::unlockCallback):
104         (WebCore::CurlShareHandle::mutexFor):
105         (WebCore::CurlMultiHandle::CurlMultiHandle):
106         (WebCore::CurlMultiHandle::~CurlMultiHandle):
107         (WebCore::CurlMultiHandle::addHandle):
108         (WebCore::CurlMultiHandle::removeHandle):
109         (WebCore::CurlMultiHandle::getFdSet):
110         (WebCore::CurlMultiHandle::perform):
111         (WebCore::CurlMultiHandle::readInfo):
112         (WebCore::CurlHandle::CurlHandle):
113         (WebCore::CurlHandle::~CurlHandle):
114         (WebCore::CurlHandle::perform):
115         (WebCore::CurlHandle::pause):
116         (WebCore::CurlHandle::enableShareHandle):
117         (WebCore::CurlHandle::setPrivateData):
118         (WebCore::CurlHandle::setUrl):
119         (WebCore::CurlHandle::clearUrl):
120         (WebCore::CurlHandle::clearRequestHeaders):
121         (WebCore::CurlHandle::appendRequestHeader):
122         (WebCore::CurlHandle::enableRequestHeaders):
123         (WebCore::CurlHandle::enableHttpGetRequest):
124         (WebCore::CurlHandle::enableHttpHeadRequest):
125         (WebCore::CurlHandle::enableHttpPostRequest):
126         (WebCore::CurlHandle::setPostFields):
127         (WebCore::CurlHandle::setPostFieldLarge):
128         (WebCore::CurlHandle::enableHttpPutRequest):
129         (WebCore::CurlHandle::setInFileSizeLarge):
130         (WebCore::CurlHandle::setHttpCustomRequest):
131         (WebCore::CurlHandle::enableAcceptEncoding):
132         (WebCore::CurlHandle::enableAllowedProtocols):
133         (WebCore::CurlHandle::enableFollowLocation):
134         (WebCore::CurlHandle::enableAutoReferer):
135         (WebCore::CurlHandle::enableHttpAuthentication):
136         (WebCore::CurlHandle::setHttpAuthUserPass):
137         (WebCore::CurlHandle::enableCAInfoIfExists):
138         (WebCore::CurlHandle::setSslVerifyPeer):
139         (WebCore::CurlHandle::setSslVerifyHost):
140         (WebCore::CurlHandle::setSslCert):
141         (WebCore::CurlHandle::setSslCertType):
142         (WebCore::CurlHandle::setSslKeyPassword):
143         (WebCore::CurlHandle::enableCookieJarIfExists):
144         (WebCore::CurlHandle::setCookieList):
145         (WebCore::CurlHandle::getCookieList):
146         (WebCore::CurlHandle::clearCookieList):
147         (WebCore::CurlHandle::enableProxyIfExists):
148         (WebCore::CurlHandle::enableTimeout):
149         (WebCore::CurlHandle::setHeaderCallbackFunction):
150         (WebCore::CurlHandle::setWriteCallbackFunction):
151         (WebCore::CurlHandle::setReadCallbackFunction):
152         (WebCore::CurlHandle::setSslCtxCallbackFunction):
153         (WebCore::CurlHandle::getEffectiveURL):
154         (WebCore::CurlHandle::getPrimaryPort):
155         (WebCore::CurlHandle::getResponseCode):
156         (WebCore::CurlHandle::getContentLenghtDownload):
157         (WebCore::CurlHandle::getHttpAuthAvail):
158         (WebCore::CurlHandle::getTimes):
159         (WebCore::CurlHandle::maxCurlOffT):
160         (WebCore::CurlHandle::expectedSizeOfCurlOffT):
161         (WebCore::CurlHandle::enableVerboseIfUsed):
162         (WebCore::CurlHandle::enableStdErrIfUsed):
163         (WebCore::CurlContext::getEffectiveURL): Deleted.
164         (WebCore::CurlContext::createMultiHandle): Deleted.
165         (WebCore::CurlContext::mutexFor): Deleted.
166         (WebCore::CurlContext::lock): Deleted.
167         (WebCore::CurlContext::unlock): Deleted.
168         * platform/network/curl/CurlContext.h:
169         (WebCore::CurlGlobal::CurlGlobal):
170         (WebCore::CurlGlobal::~CurlGlobal):
171         (WebCore::CurlShareHandle::handle):
172         (WebCore::CurlContext::shareHandle):
173         (WebCore::CurlHandle::handle):
174         (WebCore::CurlHandle::url):
175         (WebCore::CurlContext::curlShareHandle): Deleted.
176         * platform/network/curl/CurlDownload.cpp:
177         (WebCore::CurlDownload::~CurlDownload):
178         (WebCore::CurlDownload::init):
179         (WebCore::CurlDownload::start):
180         (WebCore::CurlDownload::cancel):
181         (WebCore::CurlDownload::getUrl):
182         (WebCore::CurlDownload::addHeaders):
183         (WebCore::CurlDownload::didReceiveHeader):
184         (WebCore::CurlDownload::writeCallback):
185         * platform/network/curl/CurlDownload.h:
186         * platform/network/curl/CurlJobManager.cpp:
187         (WebCore::CurlJobManager::CurlJobManager):
188         (WebCore::CurlJobManager::~CurlJobManager):
189         (WebCore::CurlJobManager::addToCurl):
190         (WebCore::CurlJobManager::removeFromCurl):
191         (WebCore::CurlJobManager::workerThread):
192         * platform/network/curl/CurlJobManager.h:
193         (WebCore::CurlJobManager::getMultiHandle): Deleted.
194         * platform/network/curl/ResourceHandleCurl.cpp:
195         (WebCore::ResourceHandleInternal::~ResourceHandleInternal):
196         (WebCore::ResourceHandle::platformSetDefersLoading):
197         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
198         (WebCore::ResourceHandle::receivedCredential):
199         (WebCore::ResourceHandle::receivedRequestToContinueWithoutCredential):
200         (WebCore::calculateWebTimingInformations):
201         (WebCore::handleLocalReceiveResponse):
202         (WebCore::writeCallback):
203         (WebCore::getProtectionSpace):
204         (WebCore::headerCallback):
205         (WebCore::readCallback):
206         (WebCore::setupFormData):
207         (WebCore::ResourceHandle::setupPUT):
208         (WebCore::ResourceHandle::setupPOST):
209         (WebCore::ResourceHandle::dispatchSynchronousJob):
210         (WebCore::ResourceHandle::applyAuthentication):
211         (WebCore::ResourceHandle::initialize):
212         (WebCore::ResourceHandle::handleCurlMsg):
213         * platform/network/curl/ResourceHandleManager.cpp:
214         (WebCore::ResourceHandleManager::ResourceHandleManager):
215         (WebCore::ResourceHandleManager::~ResourceHandleManager):
216         (WebCore::ResourceHandleManager::downloadTimerCallback):
217         (WebCore::ResourceHandleManager::removeFromCurl):
218         (WebCore::ResourceHandleManager::startJob):
219         * platform/network/curl/ResourceHandleManager.h:
220         * platform/network/curl/SSLHandle.cpp:
221         (WebCore::setSSLClientCertificate):
222         (WebCore::certVerifyCallback):
223         (WebCore::setSSLVerifyOptions):
224
225 2017-07-08  Antoine Quint  <graouts@apple.com>
226
227         REGRESSION: "visibility:hidden" does not hide play button for video elements
228         https://bugs.webkit.org/show_bug.cgi?id=174258
229         <rdar://problem/33181452>
230
231         Reviewed by Dean Jackson.
232
233         In order to not have most styles from the page affect the shadow root, we set "all: initial" on the
234         media controls container. However, we need to still make the "visibility" property inherit from its
235         host such that "visibility: hidden" on the host won't be overridden by setting the property back to
236         its initial value, which is "visible".
237
238         Test: media/modern-media-controls/css/visibility-hidden.html
239
240         * Modules/modern-media-controls/controls/media-controls.css:
241         (.media-controls-container):
242
243 2017-07-08  Yusuke Suzuki  <utatane.tea@gmail.com>
244
245         Drop NOSNIFF compile flag
246         https://bugs.webkit.org/show_bug.cgi?id=174289
247
248         Reviewed by Michael Catanzaro.
249
250         * Configurations/FeatureDefines.xcconfig:
251         * css/StyleSheetContents.cpp:
252         (WebCore::StyleSheetContents::parseAuthorStyleSheet):
253         (WebCore::StyleSheetContents::notifyLoadedSheet):
254         * dom/LoadableClassicScript.cpp:
255         (WebCore::LoadableClassicScript::notifyFinished):
256         * loader/cache/CachedCSSStyleSheet.cpp:
257         (WebCore::CachedCSSStyleSheet::mimeTypeAllowedByNosniff):
258         (WebCore::CachedCSSStyleSheet::canUseSheet):
259         * loader/cache/CachedCSSStyleSheet.h:
260         * platform/network/HTTPParsers.cpp:
261         (WebCore::parseContentTypeOptionsHeader):
262         * platform/network/HTTPParsers.h:
263         * platform/network/ResourceResponseBase.cpp:
264         (WebCore::isScriptAllowedByNosniff):
265         * platform/network/ResourceResponseBase.h:
266         * workers/WorkerScriptLoader.cpp:
267         (WebCore::WorkerScriptLoader::didReceiveResponse):
268
269 2017-07-07  Brent Fulgham  <bfulgham@apple.com>
270
271         [WK2] Use a rolling 30-day uptime for processing statistics
272         https://bugs.webkit.org/show_bug.cgi?id=174235
273         <rdar://problem/33164381>
274
275         Reviewed by Chris Dumez.
276
277         Add a KeyedDecoder specialization for Deque.
278
279         * platform/KeyedCoding.h:
280         (WebCore::KeyedDecoder::decodeObjects):
281
282 2017-07-07  Daniel Bates  <dabates@apple.com>
283
284         [AppCache] Ignore fallback entries whose namespace is not prefixed with manifest path
285         https://bugs.webkit.org/show_bug.cgi?id=174273
286         <rdar://problem/33011682>
287
288         Reviewed by Brent Fulgham.
289
290         As per <https://html.spec.whatwg.org/multipage/offline.html#parsing-cache-manifests> (07/06/2017)
291         we should ignore fallback entires whose fallback namespace URL is not prefixed with
292         the manifest path. For now we only apply this policy when the manifest is served with
293         a non-standard Content-Type to minimize web compatibility risk.
294
295         Test: http/tests/appcache/fallback-namespace-outside-manifest-path.html
296
297         * loader/appcache/ApplicationCacheGroup.cpp:
298         (WebCore::ApplicationCacheGroup::didFinishLoadingManifest): Pass the MIME type of the manifest.
299         * loader/appcache/ManifestParser.cpp:
300         (WebCore::manifestPath): Computes the manifest path from a manifest URL.
301         (WebCore::parseManifest): Modified to take the MIME type of the manifest. If the MIME type is
302         non-standard (i.e. not text/cached-manifest) then skip fallback entries whose namespace is not
303         prefixed with the manifest path. Otherwise, process fallback entries as we do now. Also cleaned
304         up the code a bit while I was here, including renaming a local variable to be more descriptive
305         and using a const character array for the manifest signature to avoid the need to document the
306         length of the manifest signature in a comment.
307         * loader/appcache/ManifestParser.h:
308
309 2017-07-07  Wenson Hsieh  <wenson_hsieh@apple.com>
310
311         [iOS DnD] For cross-app drags, 'drop' event handlers are never invoked if dataTransfer.dropEffect is not set while dragging
312         https://bugs.webkit.org/show_bug.cgi?id=174219
313         <rdar://problem/32083177>
314
315         Reviewed by Ryosuke Niwa.
316
317         Currently, in DragController.cpp, defaultOperationForDrag maps a drag source operation mask of
318         DragOperationGeneric to DragOperationMove across all platforms. However, on iOS, where cross-app drag moves do
319         not trigger a drop, this means drop handlers won't fire unless the dropEffect is explicitly set to copy.
320
321         To fix this, we introduce DragController::platformGenericDragOperation(), which returns DragOperationCopy on iOS
322         and DragOperationMove (the existing behavior) elsewhere. defaultOperationForDrag then maps a drag source
323         operation mask of DragOperationGeneric to platformGenericDragOperation().
324
325         Tests:  DataInteractionTests.ExternalSourceHTMLToUploadArea
326                 DataInteractionTests.ExternalSourceImageAndHTMLToUploadArea
327                 DataInteractionTests.ExternalSourceMoveOperationNotAllowed
328
329         * page/DragController.cpp:
330         (WebCore::DragController::platformGenericDragOperation):
331         (WebCore::defaultOperationForDrag):
332         * page/DragController.h:
333         * page/mac/DragControllerMac.mm:
334         (WebCore::DragController::platformGenericDragOperation):
335
336 2017-07-07  Devin Rousso  <drousso@apple.com>
337
338         Web Inspector: Show all elements currently using a given CSS Canvas
339         https://bugs.webkit.org/show_bug.cgi?id=173965
340
341         Reviewed by Joseph Pecoraro.
342
343         Test: inspector/canvas/css-canvas-clients.html
344
345         * css/CSSImageGeneratorValue.cpp:
346         (WebCore::CSSImageGeneratorValue::addClient):
347         (WebCore::CSSImageGeneratorValue::removeClient):
348         * css/CSSImageGeneratorValue.h:
349         (WebCore::CSSImageGeneratorValue::clients):
350         * html/HTMLCanvasElement.cpp:
351         (WebCore::HTMLCanvasElement::addObserver):
352         (WebCore::HTMLCanvasElement::removeObserver):
353         (WebCore::HTMLCanvasElement::cssCanvasClients):
354         Each time an observer is added/removed for a given HTMLCanvasElement, send an event to the
355         inspector frontend that the CSS canvas client nodes have changed. Additionally, anytime a
356         client/use is added/removed from one of the observing CSSCanvasValue, fire the same event.
357
358         * css/CSSCanvasValue.h:
359         (isType):
360         * html/HTMLCanvasElement.h:
361         (WebCore::CanvasObserver::isCSSCanvasValueObserver):
362         Allows type traits to distinguish CanvasObserver from CSSCanvasValue::CanvasObserverProxy.
363
364         * inspector/InspectorCanvasAgent.h:
365         * inspector/InspectorCanvasAgent.cpp:
366         (WebCore::InspectorCanvasAgent::requestCSSCanvasClientNodes):
367         (WebCore::InspectorCanvasAgent::didChangeCSSCanvasClientNodes):
368         * inspector/InspectorInstrumentation.h:
369         (WebCore::InspectorInstrumentation::didChangeCSSCanvasClientNodes):
370         * inspector/InspectorInstrumentation.cpp:
371         (WebCore::InspectorInstrumentation::didChangeCSSCanvasClientNodesImpl):
372         Notify the frontend that the list of client nodes has changed for the given canvas. Let the
373         frontend request the actual list of node IDs when it needs, possibly at a later time.
374
375 2017-07-07  Jer Noble  <jer.noble@apple.com>
376
377         AVPlayer can continue to be active after released by MediaPlayerPrivateAVFoundationObjC.
378         https://bugs.webkit.org/show_bug.cgi?id=174264
379
380         Reviewed by Eric Carlson.
381
382         If the AVPlayer is retained (by an autorelease pool, or internally by other objects in
383         AVFoundation), releasing the AVPlayer is not enough to cancel loading or playback. So before
384         releasing the AVPlayer, make sure to disassociate the current AVPlayerItem, which should
385         cancel all activity in the AVPlayer.
386
387         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
388         (WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad):
389
390 2017-07-07  Basuke Suzuki  <Basuke.Suzuki@sony.com>
391
392         [Curl] Remove data url handler for async load
393         https://bugs.webkit.org/show_bug.cgi?id=174263
394
395         data url is handled by ResourceLoader. No need for specific handling
396         in platform dependent layer.
397
398         Reviewed by Alex Christensen.
399
400         * platform/network/curl/ResourceHandleManager.cpp:
401         (WebCore::ResourceHandleManager::startJob):
402
403 2017-07-07  Matt Lewis  <jlewis3@apple.com>
404
405         Unreviewed, rolling out r219257.
406
407         The test added in the revision was still extreamly flaky on
408         all testers.
409
410         Reverted changeset:
411
412         "[SVG] Leak in SVGAnimatedListPropertyTearOff"
413         https://bugs.webkit.org/show_bug.cgi?id=172545
414         http://trac.webkit.org/changeset/219257
415
416 2017-07-07  Commit Queue  <commit-queue@webkit.org>
417
418         Unreviewed, rolling out r219238, r219239, and r219241.
419         https://bugs.webkit.org/show_bug.cgi?id=174265
420
421         "fast/workers/dedicated-worker-lifecycle.html is flaky"
422         (Requested by yusukesuzuki on #webkit).
423
424         Reverted changesets:
425
426         "[WTF] Implement WTF::ThreadGroup"
427         https://bugs.webkit.org/show_bug.cgi?id=174081
428         http://trac.webkit.org/changeset/219238
429
430         "Unreviewed, build fix after r219238"
431         https://bugs.webkit.org/show_bug.cgi?id=174081
432         http://trac.webkit.org/changeset/219239
433
434         "Unreviewed, CLoop build fix after r219238"
435         https://bugs.webkit.org/show_bug.cgi?id=174081
436         http://trac.webkit.org/changeset/219241
437
438 2017-05-24  Sergio Villar Senin  <svillar@igalia.com>
439
440         [SVG] Leak in SVGAnimatedListPropertyTearOff
441         https://bugs.webkit.org/show_bug.cgi?id=172545
442
443         Reviewed by Said Abou-Hallawa.
444
445         SVGAnimatedListPropertyTearOff maintains a vector m_wrappers with references to
446         SVGPropertyTraits<PropertyType>::ListItemTearOff. Apart from that SVGPropertyTearOff has a
447         reference to SVGAnimatedProperty.
448
449         When SVGListProperty::getItemValuesAndWrappers() is called, it creates a
450         SVGPropertyTraits<PropertyType>::ListItemTearOff pointing to the same SVGAnimatedProperty (a
451         SVGAnimatedListPropertyTearOff) which stores the m_wrappers vector where the ListItemTearOff
452         is going to be added to. This effectively creates a reference cycle between the
453         SVGAnimatedListPropertyTearOff and all the ListItemTearOff it stores in m_wrappers.
454
455         We should detach those wrappers in propertyWillBeDeleted() in order to break the cycle.
456
457         * svg/properties/SVGAnimatedListPropertyTearOff.h:
458
459 2017-07-07  Charlie Turner  <cturner@igalia.com>
460
461         [GStreamer] vid.me videos do not play
462         https://bugs.webkit.org/show_bug.cgi?id=172240
463
464         Reviewed by Xabier Rodriguez-Calvar.
465
466         In r142251, code to hide the WK HTTP source elements from elsewhere in
467         the pipeline was removed. This has the nasty side-effect of
468         auto-plugging the WK HTTP source into things it really should not be
469         used in, especially the adaptive streaming demuxers. The reasons this
470         is bad are documented in several places on Bugzilla, see the parent
471         bug report for more details. The high-level issue is that the WK HTTP
472         source and its use of WebCore is not thread-safe. Although work has
473         been recently done to improve this situation, it's still not perfect.
474
475         Another issue is the interface hlsdemux expects its HTTP source to
476         implement, specifically seeking in READY.
477
478         This does rely on HTTP context sharing being available in GStreamer,
479         upstream bug is here:
480         https://bugzilla.gnome.org/show_bug.cgi?id=761099. The failing case
481         can be demonstrated with
482         https://github.com/thiagoss/adaptive-test-server but manual testing on
483         popular video hosting sites, including vid.me, shows that this doesn't
484         bite us at the moment, just something else to fix in the future.
485
486         There are some QoS issues with the adaptive streaming code in
487         GStreamer, but it seems much better to offer a below par QoS in lieu
488         of crashing/livelocking when playing certain streams, and issues can be
489         raised upstream when they arise.
490
491         This patch does take us further away from the future goal of having all
492         networking operations go through the network process, but in return it
493         solves some nasty crashes and livelocks that have been irritating
494         users for some time. With the pressure off on this issue, work can be
495         planned to consider how to make the WK HTTP source a better citizen
496         inside the GStreamer pipeline when we migrate the netcode to go
497         through the network process.
498
499         A new test is added to check that the single file HLS playlists
500         (new in version 4) can be played, which was the primary cause of
501         this bug report.
502
503         Test: http/tests/media/hls/range-request.html
504
505         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
506         (WebCore::MediaPlayerPrivateGStreamer::setPlaybinURL): Perform
507         some trickery to make sure that we only ever fetch URLs handed to
508         us by WebCore. Any further URLs discovered inside the pipeline
509         will not get WKWS auto-plugged, since they'll be plain https?
510         schemas.
511         (WebCore::MediaPlayerPrivateGStreamer::load): Refactor to use the
512         setPlaybinURL helper method.
513         (WebCore::MediaPlayerPrivateGStreamer::loadNextLocation): Ditto.
514         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: Add
515         the setPlaybinURL helper method.
516         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
517         (webKitWebSrcGetProtocols): Only advertise webkit+https?, this
518         ensures we won't get auto-plugged by pipeline elements asking for
519         an element to fetch https? resources (like adaptive demuxers).
520         (convertPlaybinURI): Undo the trick when another element asks us
521         for our URI.
522
523 2017-07-05  Yusuke Suzuki  <utatane.tea@gmail.com>
524
525         [WTF] Implement WTF::ThreadGroup
526         https://bugs.webkit.org/show_bug.cgi?id=174081
527
528         Reviewed by Mark Lam.
529
530         * page/ResourceUsageThread.h:
531
532 2017-07-06  Yusuke Suzuki  <utatane.tea@gmail.com>
533
534         [WTF] Clean up StringStatics.cpp by using LazyNeverDestroyed<> for Atoms
535         https://bugs.webkit.org/show_bug.cgi?id=174150
536
537         Reviewed by Mark Lam.
538
539         * Modules/mediacontrols/MediaControlsHost.cpp:
540         (WebCore::MediaControlsHost::captionDisplayMode):
541         * Modules/mediastream/RTCDataChannel.cpp:
542         (WebCore::RTCDataChannel::binaryType):
543         * accessibility/AXObjectCache.cpp:
544         (WebCore::createFromRenderer):
545         * accessibility/AccessibilityMediaControls.cpp:
546         (WebCore::AccessibilityMediaControl::controlTypeName):
547         * accessibility/AccessibilityObject.cpp:
548         (WebCore::AccessibilityObject::language):
549         (WebCore::AccessibilityObject::defaultLiveRegionStatusForRole):
550         (WebCore::AccessibilityObject::actionVerb):
551         (WebCore::AccessibilityObject::getAttribute):
552         (WebCore::AccessibilityObject::placeholderValue):
553         * accessibility/AccessibilityObject.h:
554         (WebCore::AccessibilityObject::accessKey):
555         (WebCore::AccessibilityObject::ariaLiveRegionRelevant):
556         * accessibility/AccessibilityRenderObject.cpp:
557         (WebCore::AccessibilityRenderObject::accessKey):
558         (WebCore::AccessibilityRenderObject::actionVerb):
559         * bindings/js/JSCustomElementInterface.cpp:
560         (WebCore::JSCustomElementInterface::constructElementWithFallback):
561         * bindings/js/JSCustomElementRegistryCustom.cpp:
562         (WebCore::JSCustomElementRegistry::define):
563         * bindings/scripts/CodeGeneratorJS.pm:
564         (GenerateDefaultValue):
565         * bindings/scripts/test/JS/JSTestObj.cpp:
566         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringBody):
567         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringIsNullBody):
568         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringIsEmptyStringBody):
569         * css/CSSPageRule.cpp:
570         (WebCore::CSSPageRule::selectorText):
571         * css/CSSPrimitiveValue.cpp:
572         (WebCore::valueName):
573         * css/CSSSelector.cpp:
574         (WebCore::simpleSelectorSpecificityInternal):
575         (WebCore::CSSSelector::specificityForPage):
576         (WebCore::CSSSelector::RareData::RareData):
577         * css/CSSSelector.h:
578         (WebCore::CSSSelector::argument):
579         * css/CSSSelectorList.cpp:
580         (WebCore::SelectorNeedsNamespaceResolutionFunctor::operator()):
581         * css/PageRuleCollector.cpp:
582         (WebCore::checkPageSelectorComponents):
583         * css/RuleSet.cpp:
584         (WebCore::computeMatchBasedOnRuleHash):
585         (WebCore::RuleSet::addRule):
586         * css/SelectorChecker.cpp:
587         (WebCore::tagMatches):
588         * css/SelectorFilter.cpp:
589         (WebCore::collectDescendantSelectorIdentifierHashes):
590         * css/StyleBuilderConverter.h:
591         (WebCore::StyleBuilderConverter::convertStringOrAuto):
592         (WebCore::StyleBuilderConverter::convertStringOrNone):
593         * css/StyleBuilderCustom.h:
594         (WebCore::StyleBuilderCustom::applyValueWebkitLocale):
595         (WebCore::StyleBuilderCustom::applyValueWebkitTextEmphasisStyle):
596         (WebCore::StyleBuilderCustom::applyValueContent):
597         (WebCore::StyleBuilderCustom::applyValueAlt):
598         * css/StyleSheetContents.cpp:
599         (WebCore::StyleSheetContents::StyleSheetContents):
600         (WebCore::StyleSheetContents::namespaceURIFromPrefix):
601         * css/makeprop.pl:
602         * css/parser/CSSParserImpl.cpp:
603         (WebCore::CSSParserImpl::parsePageSelector):
604         * css/parser/CSSSelectorParser.cpp:
605         (WebCore::CSSSelectorParser::consumeCompoundSelector):
606         (WebCore::CSSSelectorParser::consumeName):
607         (WebCore::CSSSelectorParser::consumeAttribute):
608         (WebCore::CSSSelectorParser::defaultNamespace):
609         (WebCore::CSSSelectorParser::determineNamespace):
610         (WebCore::CSSSelectorParser::prependTypeSelectorIfNeeded):
611         * cssjit/SelectorCompiler.cpp:
612         (WebCore::SelectorCompiler::attributeNameTestingRequiresNamespaceRegister):
613         (WebCore::SelectorCompiler::equalTagNames):
614         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeMatching):
615         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementHasTagName):
616         * dom/Attr.cpp:
617         (WebCore::Attr::setPrefix):
618         (WebCore::Attr::attachToElement):
619         * dom/Attribute.h:
620         (WebCore::Attribute::nameMatchesFilter):
621         * dom/ConstantPropertyMap.cpp:
622         (WebCore::ConstantPropertyMap::nameForProperty):
623         * dom/ContainerNode.cpp:
624         (WebCore::ContainerNode::getElementsByTagName):
625         (WebCore::ContainerNode::getElementsByTagNameNS):
626         * dom/CustomElementReactionQueue.cpp:
627         (WebCore::CustomElementReactionQueue::enqueuePostUpgradeReactions):
628         * dom/DatasetDOMStringMap.cpp:
629         (WebCore::convertPropertyNameToAttributeName):
630         * dom/Document.cpp:
631         (WebCore::createUpgradeCandidateElement):
632         (WebCore::Document::createElementForBindings):
633         (WebCore::Document::importNode):
634         (WebCore::Document::hasValidNamespaceForElements):
635         (WebCore::Document::processBaseElement):
636         (WebCore::Document::dir):
637         (WebCore::Document::bgColor):
638         (WebCore::Document::fgColor):
639         (WebCore::Document::alinkColor):
640         (WebCore::Document::linkColorForBindings):
641         (WebCore::Document::vlinkColor):
642         * dom/Document.h:
643         * dom/Element.cpp:
644         (WebCore::Element::setBooleanAttribute):
645         (WebCore::Element::synchronizeAttribute):
646         (WebCore::Element::getAttribute):
647         (WebCore::Element::getAttributeNS):
648         (WebCore::Element::setAttribute):
649         (WebCore::Element::parserSetAttributes):
650         (WebCore::Element::didMoveToNewDocument):
651         (WebCore::Element::setPrefix):
652         (WebCore::Element::insertedInto):
653         (WebCore::Element::removedFrom):
654         (WebCore::Element::removeAttributeInternal):
655         (WebCore::Element::addAttributeInternal):
656         (WebCore::Element::removeAttributeNS):
657         (WebCore::Element::getAttributeNodeNS):
658         (WebCore::Element::hasAttributeNS):
659         (WebCore::Element::computeInheritedLanguage):
660         (WebCore::Element::updateNameForDocument):
661         (WebCore::Element::updateIdForDocument):
662         (WebCore::Element::didAddAttribute):
663         (WebCore::Element::didRemoveAttribute):
664         (WebCore::Element::cloneAttributesFromElement):
665         * dom/Element.h:
666         (WebCore::Element::attributeWithoutSynchronization):
667         (WebCore::Element::idForStyleResolution):
668         (WebCore::Element::getIdAttribute):
669         (WebCore::Element::getNameAttribute):
670         * dom/EventTarget.cpp:
671         (WebCore::legacyType):
672         * dom/MutationRecord.h:
673         (WebCore::MutationRecord::attributeName):
674         (WebCore::MutationRecord::attributeNamespace):
675         * dom/NamedNodeMap.cpp:
676         (WebCore::NamedNodeMap::removeNamedItemNS):
677         * dom/Node.cpp:
678         (WebCore::Node::prefix):
679         (WebCore::Node::localName):
680         (WebCore::Node::namespaceURI):
681         (WebCore::Node::checkSetPrefix):
682         (WebCore::locateDefaultNamespace):
683         (WebCore::Node::isDefaultNamespace):
684         (WebCore::Node::lookupNamespaceURI):
685         (WebCore::locateNamespacePrefix):
686         (WebCore::Node::lookupPrefix):
687         * dom/NodeRareData.h:
688         (WebCore::NodeListsNodeData::addCachedTagCollectionNS):
689         (WebCore::NodeListsNodeData::addCachedCollection):
690         (WebCore::NodeListsNodeData::cachedCollection):
691         (WebCore::NodeListsNodeData::removeCacheWithAtomicName):
692         (WebCore::NodeListsNodeData::removeCachedTagCollectionNS):
693         (WebCore::NodeListsNodeData::removeCachedCollection):
694         * dom/PseudoElement.cpp:
695         (WebCore::pseudoElementTagName):
696         * dom/QualifiedName.cpp:
697         (WebCore::QualifiedName::init):
698         (WebCore::nullQName):
699         (WebCore::createQualifiedName):
700         * dom/QualifiedName.h:
701         (WebCore::QualifiedName::hasPrefix):
702         * dom/SelectorQuery.cpp:
703         (WebCore::SelectorDataList::executeSingleTagNameSelectorData):
704         * dom/SlotAssignment.cpp:
705         (WebCore::slotNameFromAttributeValue):
706         * dom/SlotAssignment.h:
707         (WebCore::SlotAssignment::defaultSlotName):
708         (WebCore::ShadowRoot::didRemoveAllChildrenOfShadowHost):
709         (WebCore::ShadowRoot::didChangeDefaultSlot):
710         * dom/TagCollection.cpp:
711         (WebCore::TagCollection::TagCollection):
712         (WebCore::HTMLTagCollection::HTMLTagCollection):
713         * dom/TagCollection.h:
714         (WebCore::TagCollectionNS::elementMatches):
715         * dom/make_names.pl:
716         (printNamesCppFile):
717         (printDefinitions):
718         (printFactoryCppFile):
719         * editing/CompositeEditCommand.cpp:
720         (WebCore::CompositeEditCommand::removeNodeAttribute):
721         * editing/Editing.cpp:
722         (WebCore::createHTMLElement):
723         * editing/MarkupAccumulator.cpp:
724         (WebCore::MarkupAccumulator::serializeNodesWithNamespaces):
725         (WebCore::MarkupAccumulator::shouldAddNamespaceElement):
726         (WebCore::MarkupAccumulator::shouldAddNamespaceAttribute):
727         (WebCore::MarkupAccumulator::appendNamespace):
728         (WebCore::MarkupAccumulator::appendOpenTag):
729         (WebCore::MarkupAccumulator::appendAttribute):
730         * editing/gtk/EditorGtk.cpp:
731         (WebCore::elementURL):
732         * editing/markup.cpp:
733         (WebCore::AttributeChange::AttributeChange):
734         * html/Autocapitalize.cpp:
735         (WebCore::stringForAutocapitalizeType):
736         * html/Autofill.cpp:
737         (WebCore::AutofillData::createFromHTMLFormControlElement):
738         * html/DOMTokenList.h:
739         (WebCore::DOMTokenList::item):
740         * html/FormAssociatedElement.cpp:
741         (WebCore::FormAssociatedElement::name):
742         * html/HTMLButtonElement.cpp:
743         (WebCore::HTMLButtonElement::formControlType):
744         * html/HTMLDetailsElement.cpp:
745         (WebCore::HTMLDetailsElement::toggleOpen):
746         * html/HTMLDocument.cpp:
747         (WebCore::HTMLDocument::isCaseSensitiveAttribute):
748         * html/HTMLElement.cpp:
749         (WebCore::HTMLElement::eventNameForEventHandlerAttribute):
750         (WebCore::toValidDirValue):
751         * html/HTMLImageElement.cpp:
752         (WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
753         * html/HTMLInputElement.cpp:
754         (WebCore::HTMLInputElement::name):
755         (WebCore::HTMLInputElement::updateType):
756         * html/HTMLMediaElement.cpp:
757         (WebCore::HTMLMediaElement::doesHaveAttribute):
758         * html/HTMLOptionElement.cpp:
759         (WebCore::HTMLOptionElement::createForJSConstructor):
760         * html/HTMLParamElement.cpp:
761         (WebCore::HTMLParamElement::name):
762         * html/HTMLSelectElement.cpp:
763         (WebCore::HTMLSelectElement::setMultiple):
764         * html/HTMLTableCellElement.cpp:
765         (WebCore::HTMLTableCellElement::scope):
766         * html/HTMLTrackElement.cpp:
767         (WebCore::HTMLTrackElement::mediaElementCrossOriginAttribute):
768         * html/LabelableElement.cpp:
769         (WebCore::LabelableElement::labels):
770         * html/LabelsNodeList.cpp:
771         (WebCore::LabelsNodeList::~LabelsNodeList):
772         * html/MediaController.cpp:
773         (MediaController::playbackState):
774         (eventNameForReadyState):
775         * html/MediaDocument.cpp:
776         (WebCore::MediaDocumentParser::createDocumentStructure):
777         * html/parser/AtomicHTMLToken.h:
778         (WebCore::AtomicHTMLToken::initializeAttributes):
779         * html/parser/HTMLConstructionSite.cpp:
780         (WebCore::HTMLConstructionSite::createElement):
781         (WebCore::HTMLConstructionSite::createHTMLElementOrFindCustomElementInterface):
782         * html/parser/HTMLParserIdioms.cpp:
783         (WebCore::stripLeadingAndTrailingHTMLSpaces):
784         (WebCore::parseHTMLHashNameReference):
785         * html/parser/HTMLTreeBuilder.cpp:
786         (WebCore::createForeignAttributesMap):
787         * html/track/InbandTextTrack.cpp:
788         (WebCore::InbandTextTrack::InbandTextTrack):
789         * html/track/LoadableTextTrack.cpp:
790         (WebCore::LoadableTextTrack::id):
791         * html/track/TextTrack.cpp:
792         (WebCore::TextTrack::captionMenuOffItem):
793         (WebCore::TextTrack::captionMenuAutomaticItem):
794         * html/track/TrackBase.cpp:
795         (WebCore::MediaTrackBase::setKindInternal):
796         * html/track/VTTRegion.cpp:
797         (WebCore::VTTRegion::scroll):
798         * html/track/WebVTTElement.cpp:
799         (WebCore::nodeTypeToTagName):
800         * html/track/WebVTTElement.h:
801         * html/track/WebVTTToken.h:
802         (WebCore::WebVTTToken::StartTag):
803         * loader/FrameLoader.cpp:
804         (WebCore::FrameLoader::clear):
805         * loader/FrameLoader.h:
806         * loader/ImageLoader.cpp:
807         (WebCore::ImageLoader::clearFailedLoadURL):
808         * loader/NavigationAction.h:
809         * loader/PolicyChecker.cpp:
810         (WebCore::PolicyChecker::checkNavigationPolicy):
811         * page/DOMWindow.cpp:
812         (WebCore::DOMWindow::showModalDialog):
813         * page/EventHandler.cpp:
814         (WebCore::eventNameForTouchPointState):
815         * page/FrameTree.cpp:
816         (WebCore::FrameTree::setName):
817         (WebCore::FrameTree::clearName):
818         * page/Page.cpp:
819         (WebCore::Page::groupName):
820         * platform/graphics/ComplexTextController.cpp:
821         (WebCore::ComplexTextController::offsetForPosition):
822         * platform/graphics/FontCache.cpp:
823         (WebCore::FontCache::alternateFamilyName):
824         * platform/graphics/FontDescription.h:
825         (WebCore::FontCascadeDescription::initialLocale):
826         * platform/graphics/FontGenericFamilies.cpp:
827         (WebCore::genericFontFamilyForScript):
828         * platform/graphics/InbandTextTrackPrivate.h:
829         (WebCore::InbandTextTrackPrivate::inBandMetadataTrackDispatchType):
830         * platform/graphics/TrackPrivateBase.h:
831         (WebCore::TrackPrivateBase::id):
832         (WebCore::TrackPrivateBase::label):
833         (WebCore::TrackPrivateBase::language):
834         * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
835         (WebCore::AVTrackPrivateAVFObjCImpl::id):
836         (WebCore::AVTrackPrivateAVFObjCImpl::label):
837         (WebCore::AVTrackPrivateAVFObjCImpl::language):
838         * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.h:
839         * platform/graphics/avfoundation/cf/InbandTextTrackPrivateAVCF.cpp:
840         (WebCore::InbandTextTrackPrivateAVCF::label):
841         (WebCore::InbandTextTrackPrivateAVCF::language):
842         * platform/graphics/avfoundation/cf/InbandTextTrackPrivateLegacyAVCF.cpp:
843         (WebCore::InbandTextTrackPrivateLegacyAVCF::label):
844         (WebCore::InbandTextTrackPrivateLegacyAVCF::language):
845         * platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.mm:
846         (WebCore::InbandTextTrackPrivateAVFObjC::label):
847         (WebCore::InbandTextTrackPrivateAVFObjC::language):
848         * platform/graphics/avfoundation/objc/InbandTextTrackPrivateLegacyAVFObjC.mm:
849         (WebCore::InbandTextTrackPrivateLegacyAVFObjC::label):
850         (WebCore::InbandTextTrackPrivateLegacyAVFObjC::language):
851         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
852         (WebCore::metadataType):
853         (WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive):
854         * platform/graphics/cocoa/FontCacheCoreText.cpp:
855         (WebCore::FontCache::platformAlternateFamilyName):
856         * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
857         (WebCore::FontCascadeDescription::effectiveFamilyAt):
858         * platform/graphics/freetype/FontCacheFreeType.cpp:
859         (WebCore::FontCache::platformAlternateFamilyName):
860         * platform/graphics/gstreamer/InbandMetadataTextTrackPrivateGStreamer.h:
861         (WebCore::InbandMetadataTextTrackPrivateGStreamer::create):
862         * platform/graphics/win/FontCacheWin.cpp:
863         (WebCore::FontCache::platformAlternateFamilyName):
864         * platform/mediastream/AudioTrackPrivateMediaStream.h:
865         * platform/mediastream/RealtimeMediaSourceSettings.cpp:
866         (WebCore::RealtimeMediaSourceSettings::facingMode):
867         * platform/mediastream/VideoTrackPrivateMediaStream.h:
868         * rendering/HitTestResult.cpp:
869         (WebCore::HitTestResult::linkSuggestedFilename):
870         * rendering/InlineTextBox.cpp:
871         (WebCore::InlineTextBox::paint):
872         * rendering/RenderListItem.cpp:
873         (WebCore::RenderListItem::markerText):
874         * rendering/RenderText.cpp:
875         (WebCore::RenderText::previousOffset):
876         (WebCore::RenderText::nextOffset):
877         * rendering/RenderTreeAsText.cpp:
878         (WebCore::RenderTreeAsText::writeRenderObject):
879         * rendering/TextPainter.cpp:
880         (WebCore::TextPainter::paintTextAndEmphasisMarksIfNeeded):
881         * rendering/style/RenderStyle.cpp:
882         (WebCore::RenderStyle::textEmphasisMarkString):
883         * rendering/style/RenderStyle.h:
884         (WebCore::RenderStyle::initialHyphenationString):
885         (WebCore::RenderStyle::initialTextEmphasisCustomMark):
886         (WebCore::RenderStyle::initialContentAltText):
887         (WebCore::RenderStyle::initialLineGrid):
888         (WebCore::RenderStyle::initialFlowThread):
889         (WebCore::RenderStyle::initialRegionThread):
890         * style/StyleScope.cpp:
891         (WebCore::Style::Scope::collectActiveStyleSheets):
892         * svg/SVGElement.cpp:
893         (WebCore::SVGElement::getPresentationAttribute):
894         * svg/SVGElement.h:
895         (WebCore::SVGAttributeHashTranslator::hash):
896         * svg/SVGUseElement.cpp:
897         (WebCore::SVGUseElement::transferSizeAttributesToTargetClone):
898         * svg/animation/SVGSMILElement.cpp:
899         (WebCore::SVGSMILElement::constructAttributeName):
900         * testing/MockCDMFactory.cpp:
901         (WebCore::MockCDMInstance::requestLicense):
902         * xml/XMLErrors.cpp:
903         (WebCore::createXHTMLParserErrorHeader):
904         * xml/XPathStep.cpp:
905         (WebCore::XPath::nodeMatchesBasicTest):
906         (WebCore::XPath::Step::nodesInAxis):
907         * xml/parser/XMLDocumentParserLibxml2.cpp:
908         (WebCore::XMLDocumentParser::XMLDocumentParser):
909         (WebCore::handleNamespaceAttributes):
910         (WebCore::handleElementAttributes):
911
912 2017-07-06  Chris Dumez  <cdumez@apple.com>
913
914         Drop unnecessary uses of targetStatistics.dataRecordsRemoved in ResourceLoadObserver
915         https://bugs.webkit.org/show_bug.cgi?id=174234
916
917         Reviewed by Brent Fulgham.
918
919         Drop unnecessary uses of targetStatistics.dataRecordsRemoved in ResourceLoadObserver. It is
920         always 0 since this member is only initialized later on, in the UIProcess.
921
922         * loader/ResourceLoadObserver.cpp:
923         (WebCore::ResourceLoadObserver::logFrameNavigation):
924         (WebCore::ResourceLoadObserver::logSubresourceLoading):
925         (WebCore::ResourceLoadObserver::logWebSocketLoading):
926
927 2017-07-06  Yoav Weiss  <yoav@yoav.ws>
928
929         [preload] Avoid reflecting "video" and "audio" when they are not supported `as` value
930         https://bugs.webkit.org/show_bug.cgi?id=174199
931
932         Reviewed by Youenn Fablet.
933
934         No new tests as video/audio is supported in tests. I tested this manually.
935
936         * html/HTMLLinkElement.cpp:
937         (WebCore::HTMLLinkElement::as): Make sure "video" and "audio" will not be reflected when they are not supported.
938
939 2017-07-06  Chris Dumez  <cdumez@apple.com>
940
941         Drop unused ResourceLoadStatistics members
942         https://bugs.webkit.org/show_bug.cgi?id=174226
943
944         Reviewed by Brent Fulgham.
945
946         * loader/ResourceLoadObserver.cpp:
947         (WebCore::ResourceLoadObserver::logFrameNavigation):
948         (WebCore::ResourceLoadObserver::logSubresourceLoading):
949         (WebCore::ResourceLoadObserver::logWebSocketLoading):
950         (WebCore::ResourceLoadObserver::isPrevalentResource): Deleted.
951         * loader/ResourceLoadObserver.h:
952         * loader/ResourceLoadStatistics.cpp:
953         (WebCore::ResourceLoadStatistics::encode):
954         (WebCore::ResourceLoadStatistics::decode):
955         (WebCore::ResourceLoadStatistics::toString):
956         (WebCore::ResourceLoadStatistics::merge):
957         * loader/ResourceLoadStatistics.h:
958
959 2017-07-06  Youenn Fablet  <youenn@apple.com>
960
961         Rendering of WebRTC audio in AudioSampleDataSource may trigger crackles
962         https://bugs.webkit.org/show_bug.cgi?id=174223
963
964         Reviewed by Eric Carlson.
965
966         We try reading too quickly and need to back off a little bit if we do not enough data.
967         This only affects real audio and not web audio, hence validated through manual testing only.
968
969         * platform/audio/mac/AudioSampleDataSource.mm:
970         (WebCore::AudioSampleDataSource::pullSamplesInternal):
971
972 2017-07-06  Sam Weinig  <sam@webkit.org>
973
974         [WebIDL] Remove custom bindings for WebGL code dealing with WebGL extensions
975         https://bugs.webkit.org/show_bug.cgi?id=174186
976
977         Reviewed by Alex Christensen.
978
979         * CMakeLists.txt:
980         * WebCore.xcodeproj/project.pbxproj:
981         Update files. Categorize some of the remaining custom bindings into groups.
982
983         * bindings/IDLTypes.h:
984         Add a IDLWebGLExtension type, to model the special WebGLExtension type. In
985         the future, WebGLExtension can probably be replaced by a Variant.
986         
987         * bindings/js/JSDOMConvertWebGL.cpp: Added.
988         Move WebGLAny's convertToJSValue and add a convertToJSValue for WebGLExtension.
989
990         * bindings/js/JSDOMConvertWebGL.h:
991         (WebCore::convertToJSValue):
992         Since WebGLExtension is a wrapper type, we need both a pointer and reference variant
993         of the conversion.
994
995         (WebCore::JSConverter<IDLWebGLExtension>::convert):
996         Added.
997
998         * bindings/js/JSWebGL2RenderingContextCustom.cpp:
999         (WebCore::toJS): Deleted.
1000         (WebCore::JSWebGL2RenderingContext::getExtension): Deleted.
1001         Remove custom operation and converter.
1002
1003         * bindings/js/JSWebGLRenderingContextCustom.cpp:
1004         (WebCore::toJS): Deleted.
1005         (WebCore::JSWebGLRenderingContext::getExtension): Deleted.
1006         Remove custom operation and converter.
1007
1008         * bindings/scripts/CodeGeneratorJS.pm:
1009         (AddToIncludesForIDLType):
1010         (NativeToJSValueDOMConvertNeedsState):
1011         (NativeToJSValueDOMConvertNeedsGlobalObject):
1012         Add support for IDLWebGLExtension.
1013
1014         * html/canvas/WebGLAny.cpp: Removed.
1015         * html/canvas/WebGLAny.h:
1016         Moved convertToJSValue to the bindings where it belongs.
1017
1018         * html/canvas/WebGLRenderingContextBase.idl:
1019         Annotate getExtension with [OverrideIDLType=IDLWebGLExtension].
1020
1021 2017-07-06  Joseph Pecoraro  <pecoraro@apple.com>
1022
1023         [Cocoa] CTParagraphStyle leak under WebCore::LinkImageLayout::LinkImageLayout
1024         https://bugs.webkit.org/show_bug.cgi?id=174228
1025
1026         Reviewed by Andreas Kling.
1027
1028         * platform/mac/DragImageMac.mm:
1029         (WebCore::LinkImageLayout::LinkImageLayout):
1030
1031 2017-07-06  Myles C. Maxfield  <mmaxfield@apple.com>
1032
1033         [Cocoa] Improve performance of font lookups
1034         https://bugs.webkit.org/show_bug.cgi?id=173960
1035         <rdar://problem/31996891>
1036
1037         Reviewed by Darin Adler.
1038
1039         Looking up kCTFontPostScriptNameAttribute is faster than kCTFontNameAttribute.
1040
1041         No new tests because there is no behavior change.
1042
1043         * platform/spi/cocoa/CoreTextSPI.h:
1044         * platform/graphics/cocoa/FontCacheCoreText.cpp:
1045         (WebCore::FontDatabase::fontForPostScriptName):
1046
1047 2017-07-06  Myles C. Maxfield  <mmaxfield@apple.com>
1048
1049         REGRESSION(r216944): Font loads can cause Chinese characters to draw as .notdef
1050         https://bugs.webkit.org/show_bug.cgi?id=173962
1051         <rdar://problem/32925318>
1052
1053         Reviewed by Simon Fraser.
1054
1055         Previously, there was no signalling between our font loading code
1056         which determined whether or not a font should be invisible (because
1057         its in the middle of loading) and our system fallback code which
1058         created fonts when we fall off the end of the fallback list. Because
1059         of this, we were doing two things wrong:
1060
1061         1. When we started downloading a font, we would try to use a fallback
1062         font. However, if the fallback font didn't suppor the character we're
1063         trying to render, we would just bail and draw .notdef
1064         2. Even if we continued down the fallback list, and fell of the end,
1065         we wouldn't realize that the system fallback font should also be drawn
1066         as invisible.
1067
1068         This patch solves these two problems by:
1069         1. Performing a search to find the best (local) fallback font with
1070         which to fall systemFallbackFontForCharacter(). This way, if you say
1071         "font-family: 'RemoteFont', 'Helvetica'" we will use Helvetica as
1072         the lookup to ask the system to search for.
1073         2. Give the Font class an accessor which can create a duplicate, but
1074         invisible font. Give FontCascadeFonts::glyphDataForVariant() the
1075         correct tracking to know when to use this invisible duplicate.
1076
1077         Tests: fast/text/font-loading-system-fallback.html
1078                http/tests/webfont/font-loading-system-fallback-visibility.html
1079
1080         * platform/graphics/Font.cpp:
1081         (WebCore::Font::invisibleFont):
1082         * platform/graphics/Font.h:
1083         * platform/graphics/FontCascadeFonts.cpp:
1084         (WebCore::findBestFallbackFont):
1085         (WebCore::FontCascadeFonts::glyphDataForSystemFallback):
1086         (WebCore::FontCascadeFonts::glyphDataForVariant):
1087         * platform/graphics/FontCascadeFonts.h:
1088
1089 2017-07-06  Chris Dumez  <cdumez@apple.com>
1090
1091         FileMonitor should not be ref counted
1092         https://bugs.webkit.org/show_bug.cgi?id=174166
1093
1094         Reviewed by Brent Fulgham.
1095
1096         Update FileMonitor to no longer be refcounted. It was previously easy to leak it
1097         because the object would ref itself in various lambdas. The client would have to
1098         explicitely call FileMonitor::stopMonitoring() which was fragile.
1099
1100         This patch also simplifies the code and API a bit since no longer actually
1101         requires startMonitoring() / stopMonitoring() API.
1102
1103         No new tests, covered by API tests.
1104
1105         * platform/FileMonitor.cpp:
1106         (WebCore::FileMonitor::FileMonitor):
1107         (WebCore::FileMonitor::~FileMonitor):
1108         (WebCore::FileMonitor::create): Deleted.
1109         (WebCore::FileMonitor::startMonitoring): Deleted.
1110         (WebCore::FileMonitor::stopMonitoring): Deleted.
1111         * platform/FileMonitor.h:
1112         * platform/cocoa/FileMonitorCocoa.mm:
1113         (WebCore::FileMonitor::FileMonitor):
1114         (WebCore::FileMonitor::~FileMonitor):
1115         (WebCore::FileMonitor::startMonitoring): Deleted.
1116         (WebCore::FileMonitor::stopMonitoring): Deleted.
1117
1118 2017-07-06  Matt Rajca  <mrajca@apple.com>
1119
1120         Fix build with VIDEO support disabled.
1121         https://bugs.webkit.org/show_bug.cgi?id=174217
1122
1123         Unreviewed build fix.
1124
1125         * page/Page.cpp:
1126
1127 2017-07-06  Matt Lewis  <jlewis3@apple.com>
1128
1129         Unreviewed, rolling out r219193.
1130
1131         The tests added with this revision were extreamly flaky on all
1132         platforms.
1133
1134         Reverted changeset:
1135
1136         "[SVG] Leak in SVGAnimatedListPropertyTearOff"
1137         https://bugs.webkit.org/show_bug.cgi?id=172545
1138         http://trac.webkit.org/changeset/219193
1139
1140 2017-07-06  Zalan Bujtas  <zalan@apple.com>
1141
1142         Use WTFLogAlways for debug logging so that it shows up in device system logs
1143         https://bugs.webkit.org/show_bug.cgi?id=173450
1144
1145         Reviewed by Simon Fraser.
1146
1147         If you want to showRenderTree() on-device, the result doesn't show in system log so you can't see it.
1148         Switch to WTFLogAlways to fix this, for showRenderTree and its dependencies.
1149         
1150         * platform/text/TextStream.cpp:
1151         (WebCore::writeIndent):
1152         * rendering/InlineBox.cpp:
1153         (WebCore::InlineBox::showLineTreeAndMark):
1154         (WebCore::InlineBox::showLineBox):
1155         * rendering/InlineBox.h:
1156         * rendering/InlineFlowBox.cpp:
1157         (WebCore::InlineFlowBox::showLineTreeAndMark):
1158         * rendering/InlineFlowBox.h:
1159         * rendering/InlineTextBox.cpp:
1160         (WebCore::InlineTextBox::showLineBox):
1161         * rendering/InlineTextBox.h:
1162         * rendering/RenderBlockFlow.cpp:
1163         (WebCore::RenderBlockFlow::showLineTreeAndMark):
1164         * rendering/RenderBlockFlow.h:
1165         * rendering/RenderObject.cpp:
1166         (WebCore::showRenderTreeLegend):
1167         (WebCore::RenderObject::showRenderTreeForThis):
1168         (WebCore::RenderObject::showLineTreeForThis):
1169         (WebCore::RenderObject::showRegionsInformation):
1170         (WebCore::RenderObject::showRenderObject):
1171         (WebCore::RenderObject::showRenderSubTreeAndMark):
1172         * rendering/RenderObject.h:
1173         * rendering/SimpleLineLayoutFunctions.cpp:
1174         (WebCore::SimpleLineLayout::printPrefix):
1175         (WebCore::SimpleLineLayout::showLineLayoutForFlow):
1176         * rendering/SimpleLineLayoutFunctions.h:
1177
1178 2017-07-06  Myles C. Maxfield  <mmaxfield@apple.com>
1179
1180         Unify FontCascadeFonts::glyphDataForVariant() and FontCascadeFonts::glyphDataForNormalVariant()
1181         https://bugs.webkit.org/show_bug.cgi?id=174213
1182
1183         Reviewed by Zalan Bujtas.
1184
1185         They have almost identical code. This is in preparation for https://bugs.webkit.org/show_bug.cgi?id=173962
1186
1187         No new tests because there is no behavior change.
1188
1189         * platform/graphics/FontCascadeFonts.cpp:
1190         (WebCore::FontCascadeFonts::glyphDataForVariant):
1191         (WebCore::FontCascadeFonts::glyphDataForCharacter):
1192         (WebCore::FontCascadeFonts::glyphDataForNormalVariant): Deleted.
1193         * platform/graphics/FontCascadeFonts.h:
1194
1195 2017-07-06  Don Olmstead  <don.olmstead@sony.com>
1196
1197         [PAL] Move KillRing into PAL
1198         https://bugs.webkit.org/show_bug.cgi?id=173900
1199
1200         Reviewed by Myles C. Maxfield.
1201
1202         No new tests. No change in functionality.
1203
1204         * Configurations/WebCore.xcconfig:
1205         * PlatformGTK.cmake:
1206         * PlatformMac.cmake:
1207         * PlatformWPE.cmake:
1208         * PlatformWin.cmake:
1209         * WebCore.xcodeproj/project.pbxproj:
1210         * editing/Editor.cpp:
1211         (WebCore::Editor::Editor):
1212         * editing/Editor.h:
1213         (WebCore::Editor::killRing):
1214         * editing/EditorCommand.cpp:
1215
1216 2017-07-06  Devin Rousso  <drousso@apple.com>
1217
1218         Web Inspector: Support getting the content of WebGL/WebGL2 contexts
1219         https://bugs.webkit.org/show_bug.cgi?id=173569
1220         <rdar://problem/33112420>
1221
1222         Reviewed by Joseph Pecoraro.
1223
1224         Tests: inspector/canvas/requestContent-2d.html
1225                inspector/canvas/requestContent-webgl.html
1226                inspector/canvas/requestContent-webgl2.html
1227
1228         * html/canvas/WebGLRenderingContextBase.cpp:
1229         (WebCore::WebGLRenderingContextBase::clearIfComposited):
1230         * html/canvas/WebGLRenderingContextBase.h:
1231         (WebCore::WebGLRenderingContextBase::preventBufferClearForInspector):
1232         (WebCore::WebGLRenderingContextBase::setPreventBufferClearForInspector):
1233         Add a flag that will prevent the context buffer from being cleared, allowing it to be copied
1234         within a toDataURL call. This is currently only used by InspectorCanvasAgent::requestContent.
1235
1236         * inspector/InspectorCanvasAgent.cpp:
1237         (WebCore::InspectorCanvasAgent::requestContent):
1238         Since toDataURL attempts to force the canvas to redraw, we can preserve the buffer after it
1239         finishes drawing so that it can be copied, instead of it normally being swapped out.
1240
1241 2017-07-06  Chris Dumez  <cdumez@apple.com>
1242
1243         Move ResourceLoadObserver notification throttling logic from WebProcess class to ResourceLoadObserver
1244         https://bugs.webkit.org/show_bug.cgi?id=174194
1245
1246         Reviewed by Brent Fulgham.
1247
1248         Move ResourceLoadObserver notification throttling logic from WebProcess class to
1249         ResourceLoadObserver. This makes more sense and decreases the complexity of the
1250         WebProcess class.
1251
1252         * loader/ResourceLoadObserver.cpp:
1253         (WebCore::ResourceLoadObserver::setNotificationCallback):
1254         (WebCore::ResourceLoadObserver::ResourceLoadObserver):
1255         (WebCore::ResourceLoadObserver::logFrameNavigation):
1256         (WebCore::ResourceLoadObserver::logSubresourceLoading):
1257         (WebCore::ResourceLoadObserver::logWebSocketLoading):
1258         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
1259         (WebCore::ResourceLoadObserver::scheduleNotificationIfNeeded):
1260         (WebCore::ResourceLoadObserver::notificationTimerFired):
1261         * loader/ResourceLoadObserver.h:
1262
1263 2017-07-06  Said Abou-Hallawa  <sabouhallawa@apple.com>
1264
1265         REGRESSION(r208511): RenderImageResourceStyleImage should not assume image() won't return null if its m_cachedImage is valid
1266         https://bugs.webkit.org/show_bug.cgi?id=174168
1267
1268         Reviewed by Simon Fraser.
1269
1270         RenderImageResourceStyleImage::image() may return a null pointer even if
1271         its m_cachedImage is not null. The revision r208511, changed the function
1272         RenderImageResourceStyleImage::shutdown() so it calls Image::stopAnimation().
1273         But this change assumes that if m_cachedImage is not null then image() will
1274         return a valid pointer. This is not true because StyleCachedImage::isPending()
1275         can return true and hence, RenderImageResourceStyleImage::image() will return
1276         a null pointer.
1277
1278         * rendering/RenderImageResourceStyleImage.cpp:
1279         (WebCore::RenderImageResourceStyleImage::image): Like what RenderImageResource
1280         does, return Image::nullImage() if m_styleImage->isPending().
1281
1282 2017-07-06  Commit Queue  <commit-queue@webkit.org>
1283
1284         Unreviewed, rolling out r219201.
1285         https://bugs.webkit.org/show_bug.cgi?id=174211
1286
1287         "Causes crashes on Release builds and API tests" (Requested by
1288         ddkilzer on #webkit).
1289
1290         Reverted changeset:
1291
1292         "Add release assert to explore crash for
1293         <rdar://problem/32908525>"
1294         http://trac.webkit.org/changeset/219201
1295
1296 2017-07-06  Commit Queue  <commit-queue@webkit.org>
1297
1298         Unreviewed, rolling out r219194.
1299         https://bugs.webkit.org/show_bug.cgi?id=174207
1300
1301         it broke some layout tests (Requested by clopez on #webkit).
1302
1303         Reverted changeset:
1304
1305         "[GStreamer] vid.me videos do not play"
1306         https://bugs.webkit.org/show_bug.cgi?id=172240
1307         http://trac.webkit.org/changeset/219194
1308
1309 2017-07-06  David Kilzer  <ddkilzer@apple.com>
1310
1311         Add release assert to explore crash for <rdar://problem/32908525>
1312
1313         Reviewed by Brady Eidson.
1314
1315         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1316         (WebCore::IDBServer::UniqueIDBDatabase::~UniqueIDBDatabase): Add
1317         release assert to catch cases when the IDBBackingStore is not
1318         deleted before the UniqueIDBDatabase is destroyed.  The
1319         IDBBackingStore should always be released on the database
1320         thread.
1321
1322 2017-07-06  Matt Lewis  <jlewis3@apple.com>
1323
1324         Unreviewed, rolling out r219178.
1325
1326         This caused a consistent failure with the API test
1327         StringBuilderTest.ToAtomicStringOnEmpty on all Debug testers.
1328
1329         Reverted changeset:
1330
1331         "[WTF] Clean up StringStatics.cpp by using
1332         LazyNeverDestroyed<> for Atoms"
1333         https://bugs.webkit.org/show_bug.cgi?id=174150
1334         http://trac.webkit.org/changeset/219178
1335
1336 2017-07-06  Charlie Turner  <cturner@igalia.com>
1337
1338         [GStreamer] vid.me videos do not play
1339         https://bugs.webkit.org/show_bug.cgi?id=172240
1340
1341         Reviewed by Xabier Rodriguez-Calvar.
1342
1343         In r142251, code to hide the WK HTTP source elements from elsewhere in
1344         the pipeline was removed. This has the nasty side-effect of
1345         auto-plugging the WK HTTP source into things it really should not be
1346         used in, especially the adaptive streaming demuxers. The reasons this
1347         is bad are documented in several places on Bugzilla, see the parent
1348         bug report for more details. The high-level issue is that the WK HTTP
1349         source and its use of WebCore is not thread-safe. Although work has
1350         been recently done to improve this situation, it's still not perfect.
1351
1352         Another issue is the interface hlsdemux expects its HTTP source to
1353         implement, specifically seeking in READY.
1354
1355         This does rely on HTTP context sharing being available in GStreamer,
1356         upstream bug is here:
1357         https://bugzilla.gnome.org/show_bug.cgi?id=761099. The failing case
1358         can be demonstrated with
1359         https://github.com/thiagoss/adaptive-test-server but manual testing on
1360         popular video hosting sites, including vid.me, shows that this doesn't
1361         bite us at the moment, just something else to fix in the future.
1362
1363         There are some QoS issues with the adaptive streaming code in
1364         GStreamer, but it seems much better to offer a below par QoS in lieu
1365         of crashing/livelocking when playing certain streams, and issues can be
1366         raised upstream when they arise.
1367
1368         This patch does take us further away from the future goal of having all
1369         networking operations go through the network process, but in return it
1370         solves some nasty crashes and livelocks that have been irritating
1371         users for some time. With the pressure off on this issue, work can be
1372         planned to consider how to make the WK HTTP source a better citizen
1373         inside the GStreamer pipeline when we migrate the netcode to go
1374         through the network process.
1375
1376         A new test is added to check that the single file HLS playlists
1377         (new in version 4) can be played, which was the primary cause of
1378         this bug report.
1379
1380         Test: http/tests/media/hls/range-request.html
1381
1382         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1383         (WebCore::MediaPlayerPrivateGStreamer::setPlaybinURL): Perform
1384         some trickery to make sure that we only ever fetch URLs handed to
1385         us by WebCore. Any further URLs discovered inside the pipeline
1386         will not get WKWS auto-plugged, since they'll be plain https?
1387         schemas.
1388         (WebCore::MediaPlayerPrivateGStreamer::load): Refactor to use the
1389         setPlaybinURL helper method.
1390         (WebCore::MediaPlayerPrivateGStreamer::loadNextLocation): Ditto.
1391         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: Add
1392         the setPlaybinURL helper method.
1393         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
1394         (webKitWebSrcGetProtocols): Only advertise webkit+https?, this
1395         ensures we won't get auto-plugged by pipeline elements asking for
1396         an element to fetch https? resources (like adaptive demuxers).
1397         (convertPlaybinURI): Undo the trick when another element asks us
1398         for our URI.
1399
1400 2017-05-24  Sergio Villar Senin  <svillar@igalia.com>
1401
1402         [SVG] Leak in SVGAnimatedListPropertyTearOff
1403         https://bugs.webkit.org/show_bug.cgi?id=172545
1404
1405         Reviewed by Said Abou-Hallawa.
1406
1407         SVGAnimatedListPropertyTearOff maintains a vector m_wrappers with references to
1408         SVGPropertyTraits<PropertyType>::ListItemTearOff. Apart from that SVGPropertyTearOff has a
1409         reference to SVGAnimatedProperty.
1410
1411         When SVGListProperty::getItemValuesAndWrappers() is called, it creates a
1412         SVGPropertyTraits<PropertyType>::ListItemTearOff pointing to the same SVGAnimatedProperty (a
1413         SVGAnimatedListPropertyTearOff) which stores the m_wrappers vector where the ListItemTearOff
1414         is going to be added to. This effectively creates a reference cycle between the
1415         SVGAnimatedListPropertyTearOff and all the ListItemTearOff it stores in m_wrappers.
1416
1417         We should detach those wrappers in propertyWillBeDeleted() in order to break the cycle.
1418
1419         * svg/properties/SVGAnimatedListPropertyTearOff.h:
1420
1421 2017-07-05  Don Olmstead  <don.olmstead@sony.com>
1422
1423         [WTF] Move SoftLinking.h into WTF
1424         https://bugs.webkit.org/show_bug.cgi?id=174000
1425
1426         Reviewed by Alex Christensen.
1427
1428         No new tests. No change in functionality
1429
1430         * Modules/applepay/PaymentRequest.cpp:
1431         * Modules/applepay/cocoa/PaymentContactCocoa.mm:
1432         * Modules/applepay/cocoa/PaymentMerchantSessionCocoa.mm:
1433         * Modules/encryptedmedia/legacy/LegacyCDMPrivateMediaPlayer.cpp:
1434         * WebCore.xcodeproj/project.pbxproj:
1435         * editing/cocoa/EditorCocoa.mm:
1436         * editing/cocoa/HTMLConverter.mm:
1437         * editing/ios/EditorIOS.mm:
1438         * page/CaptionUserPreferencesMediaAF.cpp:
1439         * page/cocoa/SettingsCocoa.mm:
1440         * page/ios/UserAgentIOS.mm:
1441         * page/mac/ServicesOverlayController.mm:
1442         * platform/audio/ios/AudioDestinationIOS.cpp:
1443         * platform/audio/ios/AudioFileReaderIOS.cpp:
1444         * platform/audio/ios/AudioSessionIOS.mm:
1445         * platform/audio/ios/MediaSessionManagerIOS.mm:
1446         * platform/cf/CoreMediaSoftLink.cpp:
1447         * platform/cf/CoreMediaSoftLink.h:
1448         * platform/cf/MediaAccessibilitySoftLink.cpp:
1449         * platform/cf/MediaAccessibilitySoftLink.h:
1450         * platform/cocoa/ContentFilterUnblockHandlerCocoa.mm:
1451         * platform/cocoa/CoreVideoSoftLink.cpp:
1452         * platform/cocoa/CoreVideoSoftLink.h:
1453         * platform/cocoa/DataDetectorsCoreSoftLink.h:
1454         * platform/cocoa/NetworkExtensionContentFilter.mm:
1455         * platform/cocoa/ParentalControlsContentFilter.mm:
1456         * platform/cocoa/TelephoneNumberDetectorCocoa.cpp:
1457         * platform/cocoa/VideoToolboxSoftLink.cpp:
1458         * platform/cocoa/VideoToolboxSoftLink.h:
1459         * platform/cocoa/WebPlaybackSessionModelMediaElement.mm:
1460         * platform/cocoa/WebVideoFullscreenModelVideoElement.mm:
1461         * platform/gamepad/cocoa/GameControllerGamepadProvider.mm:
1462         * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
1463         * platform/graphics/avfoundation/MediaPlaybackTargetMac.mm:
1464         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
1465         * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm:
1466         * platform/graphics/avfoundation/cf/AVFoundationCFSoftLinking.h:
1467         * platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp:
1468         * platform/graphics/avfoundation/cf/InbandTextTrackPrivateAVCF.cpp:
1469         * platform/graphics/avfoundation/cf/InbandTextTrackPrivateLegacyAVCF.cpp:
1470         * platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
1471         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
1472         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
1473         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
1474         * platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.mm:
1475         * platform/graphics/avfoundation/objc/InbandTextTrackPrivateLegacyAVFObjC.mm:
1476         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
1477         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
1478         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1479         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
1480         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
1481         * platform/graphics/ca/win/WKCACFViewLayerTreeHost.cpp:
1482         * platform/graphics/cocoa/FontCascadeCocoa.mm:
1483         * platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp:
1484         * platform/graphics/cv/PixelBufferConformerCV.cpp:
1485         * platform/graphics/ios/FontCacheIOS.mm:
1486         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
1487         * platform/graphics/mac/FontCacheMac.mm:
1488         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
1489         * platform/graphics/mac/MediaTimeQTKit.mm:
1490         * platform/graphics/mac/PDFDocumentImageMac.mm:
1491         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
1492         * platform/ios/DragImageIOS.mm:
1493         * platform/ios/PlatformPasteboardIOS.mm:
1494         * platform/ios/PlatformScreenIOS.mm:
1495         * platform/ios/PlatformSpeechSynthesizerIOS.mm:
1496         * platform/ios/QuickLookSoftLink.h:
1497         * platform/ios/QuickLookSoftLink.mm:
1498         * platform/ios/RemoteCommandListenerIOS.mm:
1499         * platform/ios/ThemeIOS.mm:
1500         * platform/ios/ValidationBubbleIOS.mm:
1501         * platform/ios/WebCoreMotionManager.mm:
1502         * platform/ios/WebItemProviderPasteboard.mm:
1503         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
1504         * platform/mac/DragImageMac.mm:
1505         * platform/mac/MediaRemoteSoftLink.cpp:
1506         * platform/mac/MediaRemoteSoftLink.h:
1507         * platform/mac/SerializedPlatformRepresentationMac.mm:
1508         * platform/mac/WebPlaybackControlsManager.mm:
1509         * platform/mac/WebVideoFullscreenController.mm:
1510         * platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm:
1511         * platform/mediastream/ios/CoreAudioCaptureSourceIOS.mm:
1512         * platform/mediastream/libwebrtc/H264VideoToolBoxEncoder.mm:
1513         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
1514         * platform/network/cf/CookieJarCFNet.cpp:
1515         * platform/network/ios/NetworkStateNotifierIOS.mm:
1516         * platform/network/ios/PreviewConverter.mm:
1517         * platform/network/mac/BlobDataFileReferenceMac.mm:
1518         * platform/spi/cocoa/AVKitSPI.h:
1519         (-[AVTouchBarPlaybackControlsControlling NS_ENUM]): Deleted.
1520         * platform/spi/cocoa/NSAttributedStringSPI.h:
1521         * platform/spi/ios/DataDetectorsUISPI.h:
1522         * platform/spi/mac/AVFoundationSPI.h:
1523         * platform/spi/mac/DataDetectorsSPI.h:
1524         * platform/spi/mac/LookupSPI.h:
1525         * platform/spi/mac/TUCallSPI.h:
1526         * platform/win/ScrollbarThemeWin.cpp:
1527         * rendering/RenderThemeCocoa.mm:
1528         * rendering/RenderThemeIOS.mm:
1529         * rendering/RenderThemeWin.cpp:
1530         * testing/Internals.mm:
1531         * xml/XSLStyleSheetLibxslt.cpp:
1532         * xml/XSLTExtensions.cpp:
1533         * xml/XSLTProcessorLibxslt.cpp:
1534         * xml/XSLTUnicodeSort.cpp:
1535
1536 2017-07-05  Zalan Bujtas  <zalan@apple.com>
1537
1538         REGRESSION: Stack overflow in RenderBlockFlow::layoutBlock after increasing the font size to max in some RTL vertical books.
1539         https://bugs.webkit.org/show_bug.cgi?id=174144
1540         <rdar://problem/32781038>
1541
1542         Reviewed by Simon Fraser.
1543
1544         We set the start/end margin on the ruby renderer to support overhanging content. The margins ensure that
1545         adjacent boxes on the line are placed properly respecting the overhanging content.
1546         The line breaking algorithm also takes this value into account as it affects the line's available width.
1547         We need to reset this value before laying out the lines, otherwise we might end up using this value on the line twice;
1548         first as the renderer's margins (as the result of the previous layout) and second as the renderer's overhanging value.
1549         Since this is not strictly part of the renderer's layout context (i.e. we set them during the line layout and not at
1550         RenderRubyRun::layout) we can't rely on the ruby's layout logic to reset them.
1551
1552         Test: fast/ruby/ruby-overhang-margin-crash.html
1553
1554         * rendering/RenderBlockLineLayout.cpp:
1555         (WebCore::RenderBlockFlow::layoutLineBoxes):
1556
1557 2017-07-05  Yusuke Suzuki  <utatane.tea@gmail.com>
1558
1559         Upgrade GCC baseline
1560         https://bugs.webkit.org/show_bug.cgi?id=174155
1561
1562         Reviewed by Michael Catanzaro.
1563
1564         Remove workaround for old GCC.
1565
1566         * CMakeLists.txt:
1567
1568 2017-07-05  Chris Dumez  <cdumez@apple.com>
1569
1570         Unreviewed attempt to fix iOS build after r219177.
1571
1572         * page/ios/UserAgentIOS.mm:
1573         * platform/spi/ios/UIKitSPI.h:
1574
1575 2017-07-05  Chris Dumez  <cdumez@apple.com>
1576
1577         Unreviewed attempt to fix iOS build after r219177.
1578
1579         * page/ios/UserAgentIOS.mm:
1580         * platform/spi/ios/UIKitSPI.h:
1581
1582 2017-07-05  Yusuke Suzuki  <utatane.tea@gmail.com>
1583
1584         Use std::lock_guard instead of std::unique_lock if move semantics and try_lock is not necessary
1585         https://bugs.webkit.org/show_bug.cgi?id=174148
1586
1587         Reviewed by Mark Lam.
1588
1589         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
1590         (WebCore::AudioSourceProviderAVFObjC::~AudioSourceProviderAVFObjC):
1591
1592 2017-07-05  Yusuke Suzuki  <utatane.tea@gmail.com>
1593
1594         [WTF] Clean up StringStatics.cpp by using LazyNeverDestroyed<> for Atoms
1595         https://bugs.webkit.org/show_bug.cgi?id=174150
1596
1597         Reviewed by Mark Lam.
1598
1599         * Modules/mediacontrols/MediaControlsHost.cpp:
1600         (WebCore::MediaControlsHost::captionDisplayMode):
1601         * Modules/mediastream/RTCDataChannel.cpp:
1602         (WebCore::RTCDataChannel::binaryType):
1603         * accessibility/AXObjectCache.cpp:
1604         (WebCore::createFromRenderer):
1605         * accessibility/AccessibilityMediaControls.cpp:
1606         (WebCore::AccessibilityMediaControl::controlTypeName):
1607         * accessibility/AccessibilityObject.cpp:
1608         (WebCore::AccessibilityObject::language):
1609         (WebCore::AccessibilityObject::defaultLiveRegionStatusForRole):
1610         (WebCore::AccessibilityObject::actionVerb):
1611         (WebCore::AccessibilityObject::getAttribute):
1612         (WebCore::AccessibilityObject::placeholderValue):
1613         * accessibility/AccessibilityObject.h:
1614         (WebCore::AccessibilityObject::accessKey):
1615         (WebCore::AccessibilityObject::ariaLiveRegionRelevant):
1616         * accessibility/AccessibilityRenderObject.cpp:
1617         (WebCore::AccessibilityRenderObject::accessKey):
1618         (WebCore::AccessibilityRenderObject::actionVerb):
1619         * bindings/js/JSCustomElementInterface.cpp:
1620         (WebCore::JSCustomElementInterface::constructElementWithFallback):
1621         * bindings/js/JSCustomElementRegistryCustom.cpp:
1622         (WebCore::JSCustomElementRegistry::define):
1623         * bindings/scripts/CodeGeneratorJS.pm:
1624         (GenerateDefaultValue):
1625         * bindings/scripts/test/JS/JSTestObj.cpp:
1626         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringBody):
1627         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringIsNullBody):
1628         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringIsEmptyStringBody):
1629         * css/CSSPageRule.cpp:
1630         (WebCore::CSSPageRule::selectorText):
1631         * css/CSSPrimitiveValue.cpp:
1632         (WebCore::valueName):
1633         * css/CSSSelector.cpp:
1634         (WebCore::simpleSelectorSpecificityInternal):
1635         (WebCore::CSSSelector::specificityForPage):
1636         (WebCore::CSSSelector::RareData::RareData):
1637         * css/CSSSelector.h:
1638         (WebCore::CSSSelector::argument):
1639         * css/CSSSelectorList.cpp:
1640         (WebCore::SelectorNeedsNamespaceResolutionFunctor::operator()):
1641         * css/PageRuleCollector.cpp:
1642         (WebCore::checkPageSelectorComponents):
1643         * css/RuleSet.cpp:
1644         (WebCore::computeMatchBasedOnRuleHash):
1645         (WebCore::RuleSet::addRule):
1646         * css/SelectorChecker.cpp:
1647         (WebCore::tagMatches):
1648         * css/SelectorFilter.cpp:
1649         (WebCore::collectDescendantSelectorIdentifierHashes):
1650         * css/StyleBuilderConverter.h:
1651         (WebCore::StyleBuilderConverter::convertStringOrAuto):
1652         (WebCore::StyleBuilderConverter::convertStringOrNone):
1653         * css/StyleBuilderCustom.h:
1654         (WebCore::StyleBuilderCustom::applyValueWebkitLocale):
1655         (WebCore::StyleBuilderCustom::applyValueWebkitTextEmphasisStyle):
1656         (WebCore::StyleBuilderCustom::applyValueContent):
1657         (WebCore::StyleBuilderCustom::applyValueAlt):
1658         * css/StyleSheetContents.cpp:
1659         (WebCore::StyleSheetContents::StyleSheetContents):
1660         (WebCore::StyleSheetContents::namespaceURIFromPrefix):
1661         * css/makeprop.pl:
1662         * css/parser/CSSParserImpl.cpp:
1663         (WebCore::CSSParserImpl::parsePageSelector):
1664         * css/parser/CSSSelectorParser.cpp:
1665         (WebCore::CSSSelectorParser::consumeCompoundSelector):
1666         (WebCore::CSSSelectorParser::consumeName):
1667         (WebCore::CSSSelectorParser::consumeAttribute):
1668         (WebCore::CSSSelectorParser::defaultNamespace):
1669         (WebCore::CSSSelectorParser::determineNamespace):
1670         (WebCore::CSSSelectorParser::prependTypeSelectorIfNeeded):
1671         * cssjit/SelectorCompiler.cpp:
1672         (WebCore::SelectorCompiler::attributeNameTestingRequiresNamespaceRegister):
1673         (WebCore::SelectorCompiler::equalTagNames):
1674         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeMatching):
1675         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementHasTagName):
1676         * dom/Attr.cpp:
1677         (WebCore::Attr::setPrefix):
1678         (WebCore::Attr::attachToElement):
1679         * dom/Attribute.h:
1680         (WebCore::Attribute::nameMatchesFilter):
1681         * dom/ConstantPropertyMap.cpp:
1682         (WebCore::ConstantPropertyMap::nameForProperty):
1683         * dom/ContainerNode.cpp:
1684         (WebCore::ContainerNode::getElementsByTagName):
1685         (WebCore::ContainerNode::getElementsByTagNameNS):
1686         * dom/CustomElementReactionQueue.cpp:
1687         (WebCore::CustomElementReactionQueue::enqueuePostUpgradeReactions):
1688         * dom/DatasetDOMStringMap.cpp:
1689         (WebCore::convertPropertyNameToAttributeName):
1690         * dom/Document.cpp:
1691         (WebCore::createUpgradeCandidateElement):
1692         (WebCore::Document::createElementForBindings):
1693         (WebCore::Document::importNode):
1694         (WebCore::Document::hasValidNamespaceForElements):
1695         (WebCore::Document::processBaseElement):
1696         (WebCore::Document::dir):
1697         (WebCore::Document::bgColor):
1698         (WebCore::Document::fgColor):
1699         (WebCore::Document::alinkColor):
1700         (WebCore::Document::linkColorForBindings):
1701         (WebCore::Document::vlinkColor):
1702         * dom/Document.h:
1703         * dom/Element.cpp:
1704         (WebCore::Element::setBooleanAttribute):
1705         (WebCore::Element::synchronizeAttribute):
1706         (WebCore::Element::getAttribute):
1707         (WebCore::Element::getAttributeNS):
1708         (WebCore::Element::setAttribute):
1709         (WebCore::Element::parserSetAttributes):
1710         (WebCore::Element::didMoveToNewDocument):
1711         (WebCore::Element::setPrefix):
1712         (WebCore::Element::insertedInto):
1713         (WebCore::Element::removedFrom):
1714         (WebCore::Element::removeAttributeInternal):
1715         (WebCore::Element::addAttributeInternal):
1716         (WebCore::Element::removeAttributeNS):
1717         (WebCore::Element::getAttributeNodeNS):
1718         (WebCore::Element::hasAttributeNS):
1719         (WebCore::Element::computeInheritedLanguage):
1720         (WebCore::Element::updateNameForDocument):
1721         (WebCore::Element::updateIdForDocument):
1722         (WebCore::Element::didAddAttribute):
1723         (WebCore::Element::didRemoveAttribute):
1724         (WebCore::Element::cloneAttributesFromElement):
1725         * dom/Element.h:
1726         (WebCore::Element::attributeWithoutSynchronization):
1727         (WebCore::Element::idForStyleResolution):
1728         (WebCore::Element::getIdAttribute):
1729         (WebCore::Element::getNameAttribute):
1730         * dom/EventTarget.cpp:
1731         (WebCore::legacyType):
1732         * dom/MutationRecord.h:
1733         (WebCore::MutationRecord::attributeName):
1734         (WebCore::MutationRecord::attributeNamespace):
1735         * dom/NamedNodeMap.cpp:
1736         (WebCore::NamedNodeMap::removeNamedItemNS):
1737         * dom/Node.cpp:
1738         (WebCore::Node::prefix):
1739         (WebCore::Node::localName):
1740         (WebCore::Node::namespaceURI):
1741         (WebCore::Node::checkSetPrefix):
1742         (WebCore::locateDefaultNamespace):
1743         (WebCore::Node::isDefaultNamespace):
1744         (WebCore::Node::lookupNamespaceURI):
1745         (WebCore::locateNamespacePrefix):
1746         (WebCore::Node::lookupPrefix):
1747         * dom/NodeRareData.h:
1748         (WebCore::NodeListsNodeData::addCachedTagCollectionNS):
1749         (WebCore::NodeListsNodeData::addCachedCollection):
1750         (WebCore::NodeListsNodeData::cachedCollection):
1751         (WebCore::NodeListsNodeData::removeCacheWithAtomicName):
1752         (WebCore::NodeListsNodeData::removeCachedTagCollectionNS):
1753         (WebCore::NodeListsNodeData::removeCachedCollection):
1754         * dom/PseudoElement.cpp:
1755         (WebCore::pseudoElementTagName):
1756         * dom/QualifiedName.cpp:
1757         (WebCore::QualifiedName::init):
1758         (WebCore::nullQName):
1759         (WebCore::createQualifiedName):
1760         * dom/QualifiedName.h:
1761         (WebCore::QualifiedName::hasPrefix):
1762         * dom/SelectorQuery.cpp:
1763         (WebCore::SelectorDataList::executeSingleTagNameSelectorData):
1764         * dom/SlotAssignment.cpp:
1765         (WebCore::slotNameFromAttributeValue):
1766         * dom/SlotAssignment.h:
1767         (WebCore::SlotAssignment::defaultSlotName):
1768         (WebCore::ShadowRoot::didRemoveAllChildrenOfShadowHost):
1769         (WebCore::ShadowRoot::didChangeDefaultSlot):
1770         * dom/TagCollection.cpp:
1771         (WebCore::TagCollection::TagCollection):
1772         (WebCore::HTMLTagCollection::HTMLTagCollection):
1773         * dom/TagCollection.h:
1774         (WebCore::TagCollectionNS::elementMatches):
1775         * dom/make_names.pl:
1776         (printNamesCppFile):
1777         (printDefinitions):
1778         (printFactoryCppFile):
1779         * editing/CompositeEditCommand.cpp:
1780         (WebCore::CompositeEditCommand::removeNodeAttribute):
1781         * editing/Editing.cpp:
1782         (WebCore::createHTMLElement):
1783         * editing/MarkupAccumulator.cpp:
1784         (WebCore::MarkupAccumulator::serializeNodesWithNamespaces):
1785         (WebCore::MarkupAccumulator::shouldAddNamespaceElement):
1786         (WebCore::MarkupAccumulator::shouldAddNamespaceAttribute):
1787         (WebCore::MarkupAccumulator::appendNamespace):
1788         (WebCore::MarkupAccumulator::appendOpenTag):
1789         (WebCore::MarkupAccumulator::appendAttribute):
1790         * editing/gtk/EditorGtk.cpp:
1791         (WebCore::elementURL):
1792         * editing/markup.cpp:
1793         (WebCore::AttributeChange::AttributeChange):
1794         * html/Autocapitalize.cpp:
1795         (WebCore::stringForAutocapitalizeType):
1796         * html/Autofill.cpp:
1797         (WebCore::AutofillData::createFromHTMLFormControlElement):
1798         * html/DOMTokenList.h:
1799         (WebCore::DOMTokenList::item):
1800         * html/FormAssociatedElement.cpp:
1801         (WebCore::FormAssociatedElement::name):
1802         * html/HTMLButtonElement.cpp:
1803         (WebCore::HTMLButtonElement::formControlType):
1804         * html/HTMLDetailsElement.cpp:
1805         (WebCore::HTMLDetailsElement::toggleOpen):
1806         * html/HTMLDocument.cpp:
1807         (WebCore::HTMLDocument::isCaseSensitiveAttribute):
1808         * html/HTMLElement.cpp:
1809         (WebCore::HTMLElement::eventNameForEventHandlerAttribute):
1810         (WebCore::toValidDirValue):
1811         * html/HTMLImageElement.cpp:
1812         (WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
1813         * html/HTMLInputElement.cpp:
1814         (WebCore::HTMLInputElement::name):
1815         (WebCore::HTMLInputElement::updateType):
1816         * html/HTMLMediaElement.cpp:
1817         (WebCore::HTMLMediaElement::doesHaveAttribute):
1818         * html/HTMLOptionElement.cpp:
1819         (WebCore::HTMLOptionElement::createForJSConstructor):
1820         * html/HTMLParamElement.cpp:
1821         (WebCore::HTMLParamElement::name):
1822         * html/HTMLSelectElement.cpp:
1823         (WebCore::HTMLSelectElement::setMultiple):
1824         * html/HTMLTableCellElement.cpp:
1825         (WebCore::HTMLTableCellElement::scope):
1826         * html/HTMLTrackElement.cpp:
1827         (WebCore::HTMLTrackElement::mediaElementCrossOriginAttribute):
1828         * html/LabelableElement.cpp:
1829         (WebCore::LabelableElement::labels):
1830         * html/LabelsNodeList.cpp:
1831         (WebCore::LabelsNodeList::~LabelsNodeList):
1832         * html/MediaController.cpp:
1833         (MediaController::playbackState):
1834         (eventNameForReadyState):
1835         * html/MediaDocument.cpp:
1836         (WebCore::MediaDocumentParser::createDocumentStructure):
1837         * html/parser/AtomicHTMLToken.h:
1838         (WebCore::AtomicHTMLToken::initializeAttributes):
1839         * html/parser/HTMLConstructionSite.cpp:
1840         (WebCore::HTMLConstructionSite::createElement):
1841         (WebCore::HTMLConstructionSite::createHTMLElementOrFindCustomElementInterface):
1842         * html/parser/HTMLParserIdioms.cpp:
1843         (WebCore::stripLeadingAndTrailingHTMLSpaces):
1844         (WebCore::parseHTMLHashNameReference):
1845         * html/parser/HTMLTreeBuilder.cpp:
1846         (WebCore::createForeignAttributesMap):
1847         * html/track/InbandTextTrack.cpp:
1848         (WebCore::InbandTextTrack::InbandTextTrack):
1849         * html/track/LoadableTextTrack.cpp:
1850         (WebCore::LoadableTextTrack::id):
1851         * html/track/TextTrack.cpp:
1852         (WebCore::TextTrack::captionMenuOffItem):
1853         (WebCore::TextTrack::captionMenuAutomaticItem):
1854         * html/track/TrackBase.cpp:
1855         (WebCore::MediaTrackBase::setKindInternal):
1856         * html/track/VTTRegion.cpp:
1857         (WebCore::VTTRegion::scroll):
1858         * html/track/WebVTTElement.cpp:
1859         (WebCore::nodeTypeToTagName):
1860         * html/track/WebVTTElement.h:
1861         * html/track/WebVTTToken.h:
1862         (WebCore::WebVTTToken::StartTag):
1863         * loader/FrameLoader.cpp:
1864         (WebCore::FrameLoader::clear):
1865         * loader/FrameLoader.h:
1866         * loader/ImageLoader.cpp:
1867         (WebCore::ImageLoader::clearFailedLoadURL):
1868         * loader/NavigationAction.h:
1869         * loader/PolicyChecker.cpp:
1870         (WebCore::PolicyChecker::checkNavigationPolicy):
1871         * page/DOMWindow.cpp:
1872         (WebCore::DOMWindow::showModalDialog):
1873         * page/EventHandler.cpp:
1874         (WebCore::eventNameForTouchPointState):
1875         * page/FrameTree.cpp:
1876         (WebCore::FrameTree::setName):
1877         (WebCore::FrameTree::clearName):
1878         * page/Page.cpp:
1879         (WebCore::Page::groupName):
1880         * platform/graphics/ComplexTextController.cpp:
1881         (WebCore::ComplexTextController::offsetForPosition):
1882         * platform/graphics/FontCache.cpp:
1883         (WebCore::FontCache::alternateFamilyName):
1884         * platform/graphics/FontDescription.h:
1885         (WebCore::FontCascadeDescription::initialLocale):
1886         * platform/graphics/FontGenericFamilies.cpp:
1887         (WebCore::genericFontFamilyForScript):
1888         * platform/graphics/InbandTextTrackPrivate.h:
1889         (WebCore::InbandTextTrackPrivate::inBandMetadataTrackDispatchType):
1890         * platform/graphics/TrackPrivateBase.h:
1891         (WebCore::TrackPrivateBase::id):
1892         (WebCore::TrackPrivateBase::label):
1893         (WebCore::TrackPrivateBase::language):
1894         * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
1895         (WebCore::AVTrackPrivateAVFObjCImpl::id):
1896         (WebCore::AVTrackPrivateAVFObjCImpl::label):
1897         (WebCore::AVTrackPrivateAVFObjCImpl::language):
1898         * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.h:
1899         * platform/graphics/avfoundation/cf/InbandTextTrackPrivateAVCF.cpp:
1900         (WebCore::InbandTextTrackPrivateAVCF::label):
1901         (WebCore::InbandTextTrackPrivateAVCF::language):
1902         * platform/graphics/avfoundation/cf/InbandTextTrackPrivateLegacyAVCF.cpp:
1903         (WebCore::InbandTextTrackPrivateLegacyAVCF::label):
1904         (WebCore::InbandTextTrackPrivateLegacyAVCF::language):
1905         * platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.mm:
1906         (WebCore::InbandTextTrackPrivateAVFObjC::label):
1907         (WebCore::InbandTextTrackPrivateAVFObjC::language):
1908         * platform/graphics/avfoundation/objc/InbandTextTrackPrivateLegacyAVFObjC.mm:
1909         (WebCore::InbandTextTrackPrivateLegacyAVFObjC::label):
1910         (WebCore::InbandTextTrackPrivateLegacyAVFObjC::language):
1911         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1912         (WebCore::metadataType):
1913         (WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive):
1914         * platform/graphics/cocoa/FontCacheCoreText.cpp:
1915         (WebCore::FontCache::platformAlternateFamilyName):
1916         * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
1917         (WebCore::FontCascadeDescription::effectiveFamilyAt):
1918         * platform/graphics/freetype/FontCacheFreeType.cpp:
1919         (WebCore::FontCache::platformAlternateFamilyName):
1920         * platform/graphics/gstreamer/InbandMetadataTextTrackPrivateGStreamer.h:
1921         (WebCore::InbandMetadataTextTrackPrivateGStreamer::create):
1922         * platform/graphics/win/FontCacheWin.cpp:
1923         (WebCore::FontCache::platformAlternateFamilyName):
1924         * platform/mediastream/AudioTrackPrivateMediaStream.h:
1925         * platform/mediastream/RealtimeMediaSourceSettings.cpp:
1926         (WebCore::RealtimeMediaSourceSettings::facingMode):
1927         * platform/mediastream/VideoTrackPrivateMediaStream.h:
1928         * rendering/HitTestResult.cpp:
1929         (WebCore::HitTestResult::linkSuggestedFilename):
1930         * rendering/InlineTextBox.cpp:
1931         (WebCore::InlineTextBox::paint):
1932         * rendering/RenderListItem.cpp:
1933         (WebCore::RenderListItem::markerText):
1934         * rendering/RenderText.cpp:
1935         (WebCore::RenderText::previousOffset):
1936         (WebCore::RenderText::nextOffset):
1937         * rendering/RenderTreeAsText.cpp:
1938         (WebCore::RenderTreeAsText::writeRenderObject):
1939         * rendering/TextPainter.cpp:
1940         (WebCore::TextPainter::paintTextAndEmphasisMarksIfNeeded):
1941         * rendering/style/RenderStyle.cpp:
1942         (WebCore::RenderStyle::textEmphasisMarkString):
1943         * rendering/style/RenderStyle.h:
1944         (WebCore::RenderStyle::initialHyphenationString):
1945         (WebCore::RenderStyle::initialTextEmphasisCustomMark):
1946         (WebCore::RenderStyle::initialContentAltText):
1947         (WebCore::RenderStyle::initialLineGrid):
1948         (WebCore::RenderStyle::initialFlowThread):
1949         (WebCore::RenderStyle::initialRegionThread):
1950         * style/StyleScope.cpp:
1951         (WebCore::Style::Scope::collectActiveStyleSheets):
1952         * svg/SVGElement.cpp:
1953         (WebCore::SVGElement::getPresentationAttribute):
1954         * svg/SVGElement.h:
1955         (WebCore::SVGAttributeHashTranslator::hash):
1956         * svg/SVGUseElement.cpp:
1957         (WebCore::SVGUseElement::transferSizeAttributesToTargetClone):
1958         * svg/animation/SVGSMILElement.cpp:
1959         (WebCore::SVGSMILElement::constructAttributeName):
1960         * testing/MockCDMFactory.cpp:
1961         (WebCore::MockCDMInstance::requestLicense):
1962         * xml/XMLErrors.cpp:
1963         (WebCore::createXHTMLParserErrorHeader):
1964         * xml/XPathStep.cpp:
1965         (WebCore::XPath::nodeMatchesBasicTest):
1966         (WebCore::XPath::Step::nodesInAxis):
1967         * xml/parser/XMLDocumentParserLibxml2.cpp:
1968         (WebCore::XMLDocumentParser::XMLDocumentParser):
1969         (WebCore::handleNamespaceAttributes):
1970         (WebCore::handleElementAttributes):
1971
1972 2017-07-05  Chris Dumez  <cdumez@apple.com>
1973
1974         [iOS] User agent string incorrectly says "iPhone" instead of "iPad" on newer iPads
1975         https://bugs.webkit.org/show_bug.cgi?id=174182
1976         <rdar://problem/32868369>
1977
1978         Reviewed by Tim Horton.
1979
1980         In deviceNameForUserAgent() on iOS, we were forcefully returning "iPhone" if
1981         [UIApplication _isClassic] returns true. Update check to return "iPad" if
1982         [UIApplication _isClassic] returns true but [UIApplication _classMode] returns
1983         UIApplicationSceneClassicModeOriginalPad.
1984
1985         * page/ios/UserAgentIOS.mm:
1986         (WebCore::isClassicPad):
1987         (WebCore::isClassicPhone):
1988         (WebCore::osNameForUserAgent):
1989         (WebCore::deviceNameForUserAgent):
1990         * platform/spi/ios/UIKitSPI.h:
1991
1992 2017-07-05  Yusuke Suzuki  <utatane.tea@gmail.com>
1993
1994         WTF::Thread should have the threads stack bounds.
1995         https://bugs.webkit.org/show_bug.cgi?id=173975
1996
1997         Reviewed by Keith Miller.
1998
1999         When creating WebThread, we first allocate WebCore::ThreadGlobalData in UI thread
2000         and share it with WebThread.
2001         The problem is that WebCore::ThreadGlobalData has CachedResourceRequestInitiators.
2002         It allocates AtomicString, which requires WTFThreadData.
2003
2004         Before this patch, it was OK because WTFThreadData does not touch threading related
2005         things except for ThreadSpecific<>. However, after this patch, it touches
2006         WTF::Thread::current() which requires WTF::initializeThreading().
2007
2008         In this patch, we call WTF::initializeThreading() before allocating WebCore::ThreadGlobalData.
2009         And we also call AtomicString::init() before calling WebCore::ThreadGlobalData since
2010         WebCore::ThreadGlobalData allocates AtomicString.
2011
2012         This fixes crashes in the iOS web threading environment (UIWebView).
2013
2014         * platform/ios/wak/WebCoreThread.mm:
2015         (StartWebThread):
2016
2017 2017-07-05  Myles C. Maxfield  <mmaxfield@apple.com>
2018
2019         CSSFontStyleValue::isItalic seems a bit bogus.
2020         https://bugs.webkit.org/show_bug.cgi?id=174149
2021
2022         Reviewed by Tim Horton.
2023
2024         Simple typo.
2025
2026         Test: editing/execCommand/italicizeByCharacter-normal.html
2027
2028         * css/CSSFontStyleValue.h:
2029
2030 2017-07-05  Brady Eidson  <beidson@apple.com>
2031
2032         Allow navigations in subframes to get a ShouldOpenExternalURLsPolicy of "ShouldAllow".
2033         <rdar://problem/22485589> and https://bugs.webkit.org/show_bug.cgi?id=174178
2034
2035         Reviewed by Alex Christensen.
2036
2037         Test: loader/navigation-policy/should-open-external-urls/subframe-navigated-programatically-by-main-frame.html
2038
2039         This patch introduces a new flag to FrameLoadRequest to track when it is known with certainty that a 
2040         FrameLoadRequest originates from the main frame.
2041         
2042         Later, when calculating the final ShouldOpenExternalURLsPolicy, main frames navigating iframes get to propagate
2043         their permissions to the iframe.
2044         
2045         * bindings/js/CommonVM.cpp:
2046         (WebCore::lexicalFrameFromCommonVM): Helper to grab the current frame associated with the current JS callstack.
2047         * bindings/js/CommonVM.h:
2048
2049         * inspector/InspectorFrontendClientLocal.cpp:
2050         (WebCore::InspectorFrontendClientLocal::openInNewTab):
2051
2052         * inspector/InspectorPageAgent.cpp:
2053         (WebCore::InspectorPageAgent::navigate):
2054
2055         Add the new flag to FrameLoadRequest (and force almost everybody to explicitly include the flag):
2056         * loader/FrameLoadRequest.cpp:
2057         (WebCore::FrameLoadRequest::FrameLoadRequest):
2058         * loader/FrameLoadRequest.h:
2059         (WebCore::FrameLoadRequest::FrameLoadRequest):
2060         (WebCore::FrameLoadRequest::navigationInitiatedByMainFrame):
2061
2062         * loader/FrameLoader.cpp:
2063         (WebCore::FrameLoader::urlSelected):
2064         (WebCore::FrameLoader::loadURLIntoChildFrame):
2065         (WebCore::shouldOpenExternalURLsPolicyToApply): Helper that takes the new flag into account when deciding
2066           what the final ShouldOpenExternalURLsPolicy will be.
2067         (WebCore::applyShouldOpenExternalURLsPolicyToNewDocumentLoader):
2068         (WebCore::FrameLoader::loadURL):
2069         (WebCore::FrameLoader::load):
2070         (WebCore::FrameLoader::loadWithNavigationAction):
2071         (WebCore::FrameLoader::reloadWithOverrideEncoding):
2072         (WebCore::FrameLoader::reload):
2073         (WebCore::FrameLoader::loadPostRequest):
2074         (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):
2075         (WebCore::FrameLoader::loadDifferentDocumentItem):
2076         (WebCore::createWindow):
2077         (WebCore::FrameLoader::applyShouldOpenExternalURLsPolicyToNewDocumentLoader): Deleted.
2078         * loader/FrameLoader.h:
2079
2080         * loader/FrameLoaderTypes.h:
2081
2082         * loader/NavigationAction.h:
2083         (WebCore::NavigationAction::navigationInitiatedByMainFrame):
2084         * loader/NavigationScheduler.cpp:
2085         (WebCore::ScheduledNavigation::ScheduledNavigation): Grab the "initiating frame" at the time the 
2086           ScheduledNavigation is created, as it dictates the policy we decide later.
2087         (WebCore::ScheduledNavigation::navigationInitiatedByMainFrame):
2088         (WebCore::NavigationScheduler::scheduleLocationChange):
2089
2090         * page/ContextMenuController.cpp:
2091         (WebCore::openNewWindow):
2092         (WebCore::ContextMenuController::contextMenuItemSelected):
2093
2094         * page/DOMWindow.cpp:
2095         (WebCore::DOMWindow::createWindow):
2096
2097 2017-07-05  Simon Fraser  <simon.fraser@apple.com>
2098
2099         Another build fix, for Mac.
2100
2101         * platform/graphics/cocoa/IOSurface.mm:
2102         (WebCore::IOSurface::surfaceID):
2103
2104 2017-07-05  Simon Fraser  <simon.fraser@apple.com>
2105
2106         Further attempts to fix the iOS public SDK build.
2107
2108         * platform/graphics/cocoa/IOSurface.mm:
2109         (WebCore::IOSurface::surfaceID):
2110         * platform/spi/cocoa/IOSurfaceSPI.h:
2111
2112 2017-07-05  Don Olmstead  <don.olmstead@sony.com>
2113
2114         [WinCairo] Consolidate CMake code related to CURL
2115         https://bugs.webkit.org/show_bug.cgi?id=170860
2116
2117         Reviewed by Alex Christensen.
2118
2119         No new tests. No change in functionality.
2120
2121         * PlatformWinCairo.cmake:
2122         * platform/Curl.cmake: Added.
2123
2124 2017-07-03  Myles C. Maxfield  <mmaxfield@apple.com>
2125
2126         Remove copy of ICU headers from WebKit
2127         https://bugs.webkit.org/show_bug.cgi?id=116407
2128
2129         Reviewed by Alex Christensen.
2130
2131         Use WTF's copy of ICU headers.
2132
2133         No new tests because there is no behavior change.
2134
2135         * Configurations/WebCore.xcconfig:
2136         * icu/unicode/bytestream.h: Removed.
2137         * icu/unicode/localpointer.h: Removed.
2138         * icu/unicode/parseerr.h: Removed.
2139         * icu/unicode/platform.h: Removed.
2140         * icu/unicode/ptypes.h: Removed.
2141         * icu/unicode/putil.h: Removed.
2142         * icu/unicode/rep.h: Removed.
2143         * icu/unicode/std_string.h: Removed.
2144         * icu/unicode/strenum.h: Removed.
2145         * icu/unicode/stringpiece.h: Removed.
2146         * icu/unicode/ubrk.h: Removed.
2147         * icu/unicode/uchar.h: Removed.
2148         * icu/unicode/ucnv.h: Removed.
2149         * icu/unicode/ucnv_err.h: Removed.
2150         * icu/unicode/ucol.h: Removed.
2151         * icu/unicode/uconfig.h: Removed.
2152         * icu/unicode/ucurr.h: Removed.
2153         * icu/unicode/uenum.h: Removed.
2154         * icu/unicode/uiter.h: Removed.
2155         * icu/unicode/uloc.h: Removed.
2156         * icu/unicode/umachine.h: Removed.
2157         * icu/unicode/unistr.h: Removed.
2158         * icu/unicode/unorm.h: Removed.
2159         * icu/unicode/unorm2.h: Removed.
2160         * icu/unicode/uobject.h: Removed.
2161         * icu/unicode/urename.h: Removed.
2162         * icu/unicode/uscript.h: Removed.
2163         * icu/unicode/uset.h: Removed.
2164         * icu/unicode/ustring.h: Removed.
2165         * icu/unicode/utext.h: Removed.
2166         * icu/unicode/utf.h: Removed.
2167         * icu/unicode/utf16.h: Removed.
2168         * icu/unicode/utf8.h: Removed.
2169         * icu/unicode/utf_old.h: Removed.
2170         * icu/unicode/utypes.h: Removed.
2171         * icu/unicode/uvernum.h: Removed.
2172         * icu/unicode/uversion.h: Removed.
2173         * platform/graphics/FontCache.h:
2174         (WebCore::FontDescriptionKey::makeFlagsKey):
2175
2176 2017-07-05  Wenson Hsieh  <wenson_hsieh@apple.com>
2177
2178         When dragging a selection, clearing the selection in dragstart should not crash the web process
2179         https://bugs.webkit.org/show_bug.cgi?id=174142
2180         <rdar://problem/33067501>
2181
2182         Reviewed by Tim Horton.
2183
2184         Currenly, if the page clears the current selection after dragging starts on selected content, the web process
2185         will crash while attempting to write pasteboard data for a nonexistent selection. This patch adds a trivial
2186         check for this case, bailing if no DHTML dragging data was specified by the page during a selection drag and the
2187         selection has been cleared.
2188
2189         Also removes some unused code for estimating the bounds of the current selection. On iOS, dragging was actually
2190         crashing earlier, in this codepath. However, this information isn't even used anymore, since the drag anchor
2191         point is no longer necessary on iOS.
2192
2193         Test: DataInteractionTests.DoNotCrashWhenSelectionIsClearedInDragStart
2194
2195         * page/DragController.cpp:
2196         (WebCore::DragController::startDrag):
2197
2198 2017-07-05  Simon Fraser  <simon.fraser@apple.com>
2199
2200         Try to fix iOS 10.3 public SDK builds.
2201
2202         * platform/spi/cocoa/IOSurfaceSPI.h:
2203
2204 2017-07-05  Zalan Bujtas  <zalan@apple.com>
2205
2206         REGRESSION (r217522): "Show My Relationship" link in familysearch.org does not work.
2207         https://bugs.webkit.org/show_bug.cgi?id=174070
2208         <rdar://problem/32940653>
2209
2210         Reviewed by Simon Fraser.
2211
2212         Decouple in- and out-of-flow computed position values. Now we match blink's implementation on
2213         in-flow values.
2214         This also fixes the flickering content while scrolling on hbr.org.  
2215
2216         Covered by existing test cases.
2217
2218         * css/CSSComputedStyleDeclaration.cpp:
2219         (WebCore::positionOffsetValue):
2220
2221 2017-07-05  Devin Rousso  <drousso@apple.com>
2222
2223         Web Inspector: Allow users to log any tracked canvas context
2224         https://bugs.webkit.org/show_bug.cgi?id=173397
2225         <rdar://problem/33111581>
2226
2227         Reviewed by Joseph Pecoraro.
2228
2229         Tests: inspector/canvas/resolveCanvasContext-2d.html
2230                inspector/canvas/resolveCanvasContext-webgl.html
2231                inspector/canvas/resolveCanvasContext-webgl2.html
2232                inspector/canvas/resolveCanvasContext-webgpu.html
2233
2234         * inspector/InspectorCanvasAgent.h:
2235         * inspector/InspectorCanvasAgent.cpp:
2236         (WebCore::InspectorCanvasAgent::InspectorCanvasAgent):
2237         (WebCore::contextAsScriptValue):
2238         (WebCore::InspectorCanvasAgent::resolveCanvasContext):
2239
2240 2017-07-05  Emilio Cobos Álvarez  <ecobos@igalia.com>
2241
2242         Style sharing check for fullscreen element seems bogus.
2243         https://bugs.webkit.org/show_bug.cgi?id=160196
2244
2245         Reviewed by Antti Koivisto.
2246
2247         No new tests (no easy way to test this reliably).
2248
2249         * style/StyleSharingResolver.cpp:
2250         (WebCore::Style::SharingResolver::canShareStyleWithElement):
2251
2252 2017-07-05  Simon Fraser  <simon.fraser@apple.com>
2253
2254         Add a logging channel for IOSurface allocations
2255         https://bugs.webkit.org/show_bug.cgi?id=174167
2256
2257         Reviewed by Tim Horton.
2258
2259         Add an "IOSurface" log channel, make IOSurface TextStream-loggable, and log cached
2260         and new IOSurface allocations. Do some namespace-related cleanup.
2261
2262         * platform/Logging.h:
2263         * platform/graphics/cocoa/IOSurface.h:
2264         * platform/graphics/cocoa/IOSurface.mm:
2265         (WebCore::WebCore::IOSurface::create):
2266         (WebCore::WebCore::IOSurface::surfaceID):
2267         (WebCore::operator<<):
2268
2269 2017-07-05  Antti Koivisto  <antti@apple.com>
2270
2271         Low memory notification shouldn't cause style recalc
2272         https://bugs.webkit.org/show_bug.cgi?id=173574
2273         <rdar://problem/32616997>
2274
2275         Reviewed by Andreas Kling.
2276
2277         Patch mostly by Myles.
2278
2279         When we receive a low memory warning, we clear the style resolver. Previously, we were using
2280         this as an opportunity to also purge the CSSFontSelector. However, purging the font selector
2281         is wasteful, since the exact same set of CSSFontFace objects will be recreated as soon as the
2282         CSSFontSelector is recreated. It's also harmful because this purge operation causes fonts to
2283         be removed from the document's working set, and therefore triggers a relayout. Instead, this
2284         call should be softened to only delete any transitory caches the CSSFontSelector owns.
2285
2286         We can simply delay the rebuild of the CSSFontSelector to
2287         StyleResolver::appendAuthorStyleSheets(), when it's really needed. This way, we can sidestep
2288         this whole problem.
2289
2290         There's also an added benefit: Now, buildStarted() doesn't have to be idempotent, so we can
2291         enforce a stricter calling sequence with ASSERT()s.
2292
2293         * css/CSSFontFaceSet.cpp:
2294         (WebCore::CSSFontFaceSet::emptyCaches):
2295         * css/CSSFontFaceSet.h:
2296         * css/CSSFontSelector.cpp:
2297         (WebCore::CSSFontSelector::emptyCaches):
2298
2299             Add a separate function to clear font selector caches.
2300
2301         (WebCore::CSSFontSelector::buildStarted):
2302         (WebCore::CSSFontSelector::buildCompleted):
2303         (WebCore::CSSFontSelector::addFontFaceRule):
2304         (WebCore::CSSFontSelector::fontModified):
2305
2306             No need to invalidate while building.
2307
2308         (WebCore::CSSFontSelector::fontRangesForFamily):
2309         * css/CSSFontSelector.h:
2310         * css/StyleResolver.cpp:
2311         (WebCore::StyleResolver::StyleResolver):
2312         (WebCore::StyleResolver::addCurrentSVGFontFaceRules):
2313
2314             Factor into a function from the constructor.
2315
2316         (WebCore::StyleResolver::appendAuthorStyleSheets):
2317
2318             Font selector build is now started and finished by StyleScope.
2319
2320         * css/StyleResolver.h:
2321         * dom/Document.cpp:
2322         (WebCore::Document::resolveStyle):
2323
2324             Call FrameView::styleDidChange() to update any custom scrollbars.
2325             This bug was hidden by spurious style recalcs, tested by fast/css/scrollbar-dynamic-style-change.html
2326
2327         (WebCore::Document::userAgentShadowTreeStyleResolver):
2328         (WebCore::Document::didClearStyleResolver):
2329
2330             Don't start the font selector rebuild after clearing the resolver. It would cause style recalc trashing.
2331             Instead the build starts when the new resolver is constructed.
2332
2333         * page/MemoryRelease.cpp:
2334         (WebCore::releaseCriticalMemory):
2335
2336             Release font selector caches.
2337
2338         * style/StyleScope.cpp:
2339         (WebCore::Style::Scope::resolver):
2340
2341 2017-07-05  Brent Fulgham  <bfulgham@apple.com>
2342
2343         [WK2] Prevent ResourceLoadStatistics from triggering a cascade of read/write events
2344         https://bugs.webkit.org/show_bug.cgi?id=174062\
2345         <rdar://problem/33086744>
2346
2347         Reviewed by Chris Dumez.
2348
2349         Treat DISPATCH_VNODE_DELETE, DISPATCH_VNODE_RENAME, and DISPATCH_VNODE_REVOKE as equivalent
2350         "file is unavailable" events, and act as though the file was deleted. Don't listen for
2351         DISPATCH_VNODE_EXTEND, since we always get a DISPATCH_VNODE_WRITE as well, and we only
2352         want to read once.
2353
2354         Finally, add some logging to support future investigations.
2355
2356         * platform/FileMonitor.h:
2357         (WebCore::FileMonitor::platformMonitor): Expose dispatch_source_t for logging purposes.
2358         * platform/cocoa/FileMonitorCocoa.mm:
2359         (WebCore::FileMonitor::startMonitoring): Add logging.
2360         (WebCore::FileMonitor::stopMonitoring): Ditto.
2361
2362 2017-07-05  Jonathan Bedard  <jbedard@apple.com>
2363
2364         Add WebKitPrivateFrameworkStubs for iOS 11
2365         https://bugs.webkit.org/show_bug.cgi?id=173988
2366
2367         Reviewed by David Kilzer.
2368
2369         * Configurations/WebCore.xcconfig: iphoneos and iphonesimulator should use the
2370         same directory for private framework stubs.
2371
2372 2017-07-05  Emilio Cobos Álvarez  <ecobos@igalia.com>
2373
2374         Don't resolve an extra computed style for getComputedStyle in a display: none subtree.
2375         https://bugs.webkit.org/show_bug.cgi?id=174145
2376
2377         Before this, we were also resolving the first ancestor's style as
2378         inheriting from itself, which felt pretty wrong (though I think it's
2379         not observable).
2380
2381         Reviewed by Antti Koivisto.
2382
2383         No new tests (non-observable behavior).
2384
2385         * dom/Element.cpp:
2386         (WebCore::Element::resolveComputedStyle):
2387
2388 2017-07-05  Frederic Wang  <fwang@igalia.com>
2389
2390         Move ScrolledContentsLayer property to ScrollingStateScrollingNode
2391         https://bugs.webkit.org/show_bug.cgi?id=174134
2392
2393         Reviewed by Simon Fraser.
2394
2395         ScrollingStateFrameScrollingNode and ScrollingStateOverflowScrollingNode both use a
2396         ScrolledContentsLayer property for the same purpose. This commit moves that property into
2397         their parent class ScrollingStateScrollingNode, so that more code is shared between the two
2398         classes. This will also help the refactoring in bug 174130.
2399
2400         No new tests, only dumped tree may change a bit.
2401
2402         * page/scrolling/ScrollingStateFrameScrollingNode.cpp: Remove scrolled contents layer.
2403         (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
2404         (WebCore::ScrollingStateFrameScrollingNode::dumpProperties):
2405         (WebCore::ScrollingStateFrameScrollingNode::setScrolledContentsLayer): Deleted.
2406         * page/scrolling/ScrollingStateFrameScrollingNode.h: Ditto.
2407         * page/scrolling/ScrollingStateOverflowScrollingNode.cpp: Ditto.
2408         (WebCore::ScrollingStateOverflowScrollingNode::ScrollingStateOverflowScrollingNode):
2409         (WebCore::ScrollingStateOverflowScrollingNode::dumpProperties):
2410         (WebCore::ScrollingStateOverflowScrollingNode::setScrolledContentsLayer): Deleted.
2411         * page/scrolling/ScrollingStateOverflowScrollingNode.h: Ditto.
2412         (): Deleted.
2413         (WebCore::ScrollingStateOverflowScrollingNode::scrolledContentsLayer): Deleted.
2414         * page/scrolling/ScrollingStateScrollingNode.cpp: Add scrolled contents layer.
2415         (WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode):
2416         (WebCore::ScrollingStateScrollingNode::setScrolledContentsLayer):
2417         (WebCore::ScrollingStateScrollingNode::dumpProperties): Use the label from the overflow class
2418         which is different from the frame class. The dumping order may change a bit too.
2419         * page/scrolling/ScrollingStateScrollingNode.h: Add ScrolledContentsLayer to the enum and
2420         scrolled contents layer.
2421         (WebCore::ScrollingStateScrollingNode::scrolledContentsLayer):
2422         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
2423         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren): Adjust enum value
2424         to use ScrollingStateScrollingNode::ScrolledContentsLayer.
2425
2426 2017-07-05  Emilio Cobos Álvarez  <ecobos@igalia.com>
2427
2428         ProcessingInstruction::clearExistingCachedSheet doesn't really exist.
2429         https://bugs.webkit.org/show_bug.cgi?id=174146
2430
2431         Reviewed by Chris Dumez.
2432
2433         No new tests (no functionality change).
2434
2435         * dom/ProcessingInstruction.h: Remove dead declaration.
2436
2437 2017-07-05  Matt Lewis  <jlewis3@apple.com>
2438
2439         Unreviewed, rolling out r219128.
2440
2441         Spoke with engineer who originally submitted, Patch for APi
2442         test to follow.
2443
2444         Reverted changeset:
2445
2446         "Unreviewed, rolling out r219070."
2447         https://bugs.webkit.org/show_bug.cgi?id=174082
2448         http://trac.webkit.org/changeset/219128
2449
2450 2017-07-05  Matt Lewis  <jlewis3@apple.com>
2451
2452         Unreviewed, rolling out r219070.
2453
2454         This revision caused consistent failures of the API test
2455         UIPasteboardTests.DoNotPastePlainTextAsURL on iOS.
2456
2457         Reverted changeset:
2458
2459         "Pasting single words copied to UIPasteboard inserts URLs in
2460         editable areas"
2461         https://bugs.webkit.org/show_bug.cgi?id=174082
2462         http://trac.webkit.org/changeset/219070
2463
2464 2017-07-05  Youenn Fablet  <youenn@apple.com>
2465
2466         Receiving tracks should be ended when peer connection is being closed
2467         https://bugs.webkit.org/show_bug.cgi?id=174109
2468
2469         Reviewed by Eric Carlson.
2470
2471         Test: webrtc/peer-connection-track-end.html
2472
2473         As per https://www.w3.org/TR/webrtc/#dom-rtcpeerconnection-close, tracks should be ended when peer connection is closed.
2474         Also updating transceiver stopped state.
2475
2476         * Modules/mediastream/RTCPeerConnection.cpp:
2477         (WebCore::RTCPeerConnection::doClose):
2478         * Modules/mediastream/RTCRtpReceiver.cpp:
2479         (WebCore::RTCRtpReceiver::stop):
2480         * Modules/mediastream/RTCRtpReceiver.h:
2481
2482 2017-07-04  Said Abou-Hallawa  <sabouhallawa@apple.com>
2483
2484         Unreviewed, review follow-up after r218961
2485
2486         * platform/graphics/BitmapImage.cpp:
2487         (WebCore::BitmapImage::updateFromSettings):
2488
2489 2017-07-04  Antti Koivisto  <antti@apple.com>
2490
2491         RenderThemeCocoa::mediaControlsFormattedStringForDuration is leaking NSDateComponentsFormatters
2492         https://bugs.webkit.org/show_bug.cgi?id=174138
2493
2494         Reviewed by Ryosuke Niwa.
2495
2496         Saw a random spin here during media playback. Looks like we are leaking.
2497
2498         * rendering/RenderThemeCocoa.h:
2499         * rendering/RenderThemeCocoa.mm:
2500         (WebCore::RenderThemeCocoa::mediaControlsFormattedStringForDuration):
2501
2502             Reuse NSDateComponentsFormatter.
2503
2504 2017-07-04  Antti Koivisto  <antti@apple.com>
2505
2506         FrameView should not set RenderView::logicalWidth directly for printing
2507         https://bugs.webkit.org/show_bug.cgi?id=174135
2508
2509         Reviewed by Zalan Bujtas.
2510
2511         Renderer logicalWidth should be set by layout. Direct override by RenderView when printing means
2512         that we don't layout children in all cases when the width changes. This is currently mostly hidden
2513         by spurious layouts but causes problems when trying to fix other things that reduces those.
2514
2515         * page/FrameView.cpp:
2516         (WebCore::FrameView::forceLayoutForPagination):
2517
2518             Instead of calling setLogicalWidth directly call the new setPageLogicalSize that sets both the width
2519             and the height uniformly.
2520
2521         * rendering/RenderView.cpp:
2522         (WebCore::RenderView::updateLogicalWidth):
2523
2524             Use pageLogicalSize->width() in printing state instead of skipping the logical width update entirely.
2525             This ensures that the layout will progress to children when the page logical width changes.
2526
2527         (WebCore::RenderView::initializeLayoutState):
2528         (WebCore::RenderView::layout):
2529         (WebCore::RenderView::pageOrViewLogicalHeight):
2530         (WebCore::RenderView::setPageLogicalSize):
2531         * rendering/RenderView.h:
2532
2533             Replace the existing m_pageLogicalHeight with std::optional m_pageLogicalSize.
2534
2535 2017-07-04  Xabier Rodriguez Calvar  <calvaris@igalia.com>
2536
2537         [EME] Solve a couple of compiler warnings
2538         https://bugs.webkit.org/show_bug.cgi?id=174020
2539
2540         Reviewed by Michael Catanzaro.
2541
2542         * Modules/encryptedmedia/CDM.cpp:
2543         (WebCore::CDM::isPersistentType): Added default return and
2544         assertion.
2545         * Modules/encryptedmedia/MediaKeySession.cpp:
2546         (WebCore::MediaKeySession::updateKeyStatuses): This warning was
2547         already solved but I think adding an assertion for the default
2548         case can help catch errors in the future.
2549
2550 2017-07-04  Joseph Pecoraro  <pecoraro@apple.com>
2551
2552         Cleanup some StringBuilder use
2553         https://bugs.webkit.org/show_bug.cgi?id=174118
2554
2555         Reviewed by Andreas Kling.
2556
2557         * Modules/mediastream/PeerConnectionBackend.cpp:
2558         (WebCore::filterICECandidate):
2559         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
2560         * contentextensions/ContentExtension.cpp:
2561         (WebCore::ContentExtensions::ContentExtension::compileGlobalDisplayNoneStyleSheet):
2562         * css/CSSFontStyleRangeValue.cpp:
2563         (WebCore::CSSFontStyleRangeValue::customCSSText):
2564         * css/CSSFontStyleValue.cpp:
2565         (WebCore::CSSFontStyleValue::customCSSText):
2566         * css/CSSGridAutoRepeatValue.cpp:
2567         (WebCore::CSSGridAutoRepeatValue::customCSSText):
2568         * css/parser/CSSParser.cpp:
2569         (WebCore::CSSParser::parseFontFaceDescriptor):
2570         * dom/Attr.cpp:
2571         * html/canvas/WebGPURenderingContext.cpp:
2572         * html/parser/HTMLParserIdioms.cpp:
2573         * platform/network/ParsedContentType.cpp:
2574         * platform/network/cocoa/CookieCocoa.mm:
2575         * platform/text/mac/LocaleMac.mm:
2576         * xml/XMLHttpRequest.cpp:
2577         (WebCore::XMLHttpRequest::getAllResponseHeaders):
2578
2579 2017-07-03  Andreas Kling  <akling@apple.com>
2580
2581         Null RenderLayer* deref in FrameView::adjustTiledBackingCoverage()
2582         https://bugs.webkit.org/show_bug.cgi?id=174106
2583         <rdar://problem/33085838>
2584
2585         Reviewed by Tim Horton.
2586
2587         I haven't been able to reproduce this crash locally, but I have seen
2588         video of someone who can, so here's a null check for the RenderView::layer()
2589         which could be null if we're called between RenderView construction
2590         and the first callback to RenderLayerModelObject::styleDidChange().
2591
2592         * page/FrameView.cpp:
2593         (WebCore::FrameView::adjustTiledBackingCoverage):
2594
2595 2017-07-03  Matt Rajca  <mrajca@apple.com>
2596
2597         Add/remove appropriate media element behavior restrictions when updateWebsitePolicies is called
2598         https://bugs.webkit.org/show_bug.cgi?id=174103
2599
2600         Reviewed by Alex Christensen.
2601
2602         Test: Added API test.
2603
2604         Added support for updating rate change behavior restrictions on media elements that have already
2605         been created.
2606
2607         * html/HTMLMediaElement.cpp:
2608         (WebCore::HTMLMediaElement::updateRateChangeRestrictions):
2609         * html/HTMLMediaElement.h:
2610         * page/Page.cpp:
2611         (WebCore::Page::updateMediaElementRateChangeRestrictions):
2612         * page/Page.h:
2613
2614 2017-07-03  Matt Lewis  <jlewis3@apple.com>
2615
2616         Unreviewed, rolling out r219103.
2617
2618         Caused multiple build failures.
2619
2620         Reverted changeset:
2621
2622         "Remove copy of ICU headers from WebKit"
2623         https://bugs.webkit.org/show_bug.cgi?id=116407
2624         http://trac.webkit.org/changeset/219103
2625
2626 2017-07-03  Myles C. Maxfield  <mmaxfield@apple.com>
2627
2628         Remove copy of ICU headers from WebKit
2629         https://bugs.webkit.org/show_bug.cgi?id=116407
2630
2631         Reviewed by Alex Christensen.
2632
2633         Use WTF's copy of ICU headers.
2634
2635         No new tests because there is no behavior change.
2636
2637         * Configurations/WebCore.xcconfig:
2638         * icu/unicode/bytestream.h: Removed.
2639         * icu/unicode/localpointer.h: Removed.
2640         * icu/unicode/parseerr.h: Removed.
2641         * icu/unicode/platform.h: Removed.
2642         * icu/unicode/ptypes.h: Removed.
2643         * icu/unicode/putil.h: Removed.
2644         * icu/unicode/rep.h: Removed.
2645         * icu/unicode/std_string.h: Removed.
2646         * icu/unicode/strenum.h: Removed.
2647         * icu/unicode/stringpiece.h: Removed.
2648         * icu/unicode/ubrk.h: Removed.
2649         * icu/unicode/uchar.h: Removed.
2650         * icu/unicode/ucnv.h: Removed.
2651         * icu/unicode/ucnv_err.h: Removed.
2652         * icu/unicode/ucol.h: Removed.
2653         * icu/unicode/uconfig.h: Removed.
2654         * icu/unicode/ucurr.h: Removed.
2655         * icu/unicode/uenum.h: Removed.
2656         * icu/unicode/uiter.h: Removed.
2657         * icu/unicode/uloc.h: Removed.
2658         * icu/unicode/umachine.h: Removed.
2659         * icu/unicode/unistr.h: Removed.
2660         * icu/unicode/unorm.h: Removed.
2661         * icu/unicode/unorm2.h: Removed.
2662         * icu/unicode/uobject.h: Removed.
2663         * icu/unicode/urename.h: Removed.
2664         * icu/unicode/uscript.h: Removed.
2665         * icu/unicode/uset.h: Removed.
2666         * icu/unicode/ustring.h: Removed.
2667         * icu/unicode/utext.h: Removed.
2668         * icu/unicode/utf.h: Removed.
2669         * icu/unicode/utf16.h: Removed.
2670         * icu/unicode/utf8.h: Removed.
2671         * icu/unicode/utf_old.h: Removed.
2672         * icu/unicode/utypes.h: Removed.
2673         * icu/unicode/uvernum.h: Removed.
2674         * icu/unicode/uversion.h: Removed.
2675
2676 2017-07-03  Myles C. Maxfield  <mmaxfield@apple.com>
2677
2678         REGRESSION(Variation Fonts): Specifying Skia by PostScript name does not yield the expected result
2679         https://bugs.webkit.org/show_bug.cgi?id=174079
2680         <rdar://problem/33040854>
2681
2682         Reviewed by Alex Christensen.
2683
2684         Because Skia is a variation font, its PostScript name contains values to apply to its variation
2685         axes. However, WebKit's variation code was overwriting these intrinsive values with ones specified
2686         by CSS. Therefore, the intrinsic ones were being ignored. The solution is just to pass a flag from
2687         the lookup code to the variations code describing if the font was created via a PostScript name,
2688         and to not apply the CSS properties to it if it was.
2689
2690         Test: fast/text/variations/skia-postscript-name.html
2691
2692         * platform/graphics/FontCache.h:
2693         * platform/graphics/cocoa/FontCacheCoreText.cpp:
2694         (WebCore::preparePlatformFont):
2695         (WebCore::platformFontLookupWithFamily):
2696         (WebCore::fontWithFamily):
2697
2698 2017-07-03  Brady Eidson  <beidson@apple.com>
2699
2700         Switch all WebKit API related to favicons from WebIconDatabase over to new WebCore::IconLoader mechanism.
2701         https://bugs.webkit.org/show_bug.cgi?id=174073
2702
2703         Reviewed by Andy Estes.
2704
2705         Covered by existing API test.
2706
2707         * loader/DocumentLoader.cpp:
2708         (WebCore::DocumentLoader::startIconLoading):
2709         * loader/EmptyClients.cpp:
2710         * loader/FrameLoaderClient.h:
2711
2712 2017-07-03  Sam Weinig  <sam@webkit.org>
2713
2714         [WebIDL] Remove more unnecessary uses of the preprocessor in idl files
2715         https://bugs.webkit.org/show_bug.cgi?id=174083
2716
2717         Reviewed by Alex Christensen.
2718
2719         Purge as much preprocessor use as possible.
2720
2721         * Configurations/FeatureDefines.xcconfig:
2722         Add ENABLE_NAVIGATOR_STANDALONE.
2723
2724         * animation/Animatable.idl:
2725         Remove unnecessary check for LANGUAGE_OBJECTIVE_C. We no longer generate those bindings.
2726
2727         * html/MediaError.idl:
2728         Use [Conditional] rather than the preprocessor.
2729
2730         * page/Navigator.idl:
2731         Use [Conditional] rather than the preprocessor with the new ENABLE_NAVIGATOR_STANDALONE.
2732
2733         * testing/Internals.cpp:
2734         * testing/Internals.h:
2735         Expose setQuickLookPassword on all platforms, as it doesn't hurt since it is only for testing,
2736         but make the implementation do nothing.
2737
2738         * testing/Internals.idl:
2739         Use [Conditional] rather than the preprocessor.
2740
2741 2017-07-03  Daewoong Jang  <daewoong.jang@navercorp.com>
2742
2743         [Curl] Fix compilation errors
2744         https://bugs.webkit.org/show_bug.cgi?id=174085
2745
2746         Reviewed by Alex Christensen.
2747
2748         * platform/network/curl/CurlContext.cpp:
2749         (WebCore::CurlContext::initCookieSession):
2750         * platform/network/curl/CurlContext.h:
2751
2752 2017-07-03  Youenn Fablet  <youenn@apple.com>
2753
2754         WebAudioSourceProviderAVFObjC should not reconfigure for each data call
2755         https://bugs.webkit.org/show_bug.cgi?id=174101
2756
2757         Reviewed by Eric Carlson.
2758
2759         Covered by manual testing, in particular
2760         https://webrtc.github.io/samples/src/content/peerconnection/webaudio-output/
2761         and https://webrtc.github.io/samples/src/content/getusermedia/volume/.
2762         Also improved LayoutTests web audio peer connection tests to make them more robust.
2763
2764         Before the patch, reconfiguration of the web audio provider was happening for every audioSamplesAvailable call.
2765         It is now happening only when the format of the audio samples is changing.
2766         Changed some member fields from uinque_ptr to optional as a minor improvement.
2767
2768         * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.h:
2769         * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm:
2770         (WebCore::WebAudioSourceProviderAVFObjC::provideInput):
2771         (WebCore::WebAudioSourceProviderAVFObjC::prepare):
2772         (WebCore::WebAudioSourceProviderAVFObjC::unprepare):
2773         (WebCore::WebAudioSourceProviderAVFObjC::audioSamplesAvailable):
2774
2775 2017-06-30  Alex Christensen  <achristensen@webkit.org>
2776
2777         Stop using dispatch_async in ResourceHandleCFURLConnectionDelegateWithOperationQueue
2778         https://bugs.webkit.org/show_bug.cgi?id=174059
2779
2780         Reviewed by Andy Estes.
2781
2782         Use dispatch_async_f and callOnMainThread instead.
2783         No change in behavior.
2784         This will allow me to use this code on Windows.
2785
2786         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
2787         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willSendRequest):
2788         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
2789         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveData):
2790         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didFinishLoading):
2791         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didFail):
2792         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willCacheResponse):
2793         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveChallenge):
2794         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didSendBodyData):
2795         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::canRespondToProtectionSpace):
2796
2797 2017-07-03  Andy Estes  <aestes@apple.com>
2798
2799         [Xcode] Add an experimental setting to build with ccache
2800         https://bugs.webkit.org/show_bug.cgi?id=173875
2801
2802         Reviewed by Tim Horton.
2803
2804         * Configurations/DebugRelease.xcconfig: Included ccache.xcconfig.
2805
2806 2017-07-02  Ryosuke Niwa  <rniwa@webkit.org>
2807
2808         REGRESSION(r218910): Crash inside textMarkerDataForFirstPositionInTextControl
2809         https://bugs.webkit.org/show_bug.cgi?id=174077
2810         <rdar://problem/33083972>
2811
2812         Reviewed by Chris Fleizach.
2813
2814         The bug was caused by textMarkerDataForFirstPositionInTextControl assuming that
2815         there is always a root editable element (a.k.a. editing host) in the text control.
2816         When the text control is readonly or disabled, this is not the case.
2817
2818         Fixed the bug by adding an early exit when there is no editing host.
2819
2820         Test: accessibility/mac/input-type-change-crash.html
2821
2822         * accessibility/AXObjectCache.cpp:
2823         (WebCore::AXObjectCache::textMarkerDataForFirstPositionInTextControl):
2824
2825 2017-07-03  Devin Rousso  <drousso@apple.com>
2826
2827         Web Inspector: Support listing WebGL2 and WebGPU contexts
2828         https://bugs.webkit.org/show_bug.cgi?id=173396
2829
2830         Reviewed by Joseph Pecoraro.
2831
2832         Tests: inspector/canvas/create-context-2d.html
2833                inspector/canvas/create-context-webgl.html
2834                inspector/canvas/create-context-webgl2.html
2835                inspector/canvas/create-context-webgpu.html
2836
2837         Split "inspector/canvas/create-canvas-contexts.html" into a test for each context type.
2838
2839         * html/HTMLCanvasElement.cpp:
2840         (WebCore::HTMLCanvasElement::getContextWebGPU):
2841         * inspector/InspectorCanvasAgent.cpp:
2842         (WebCore::InspectorCanvasAgent::buildObjectForCanvas):
2843
2844 2017-07-03  Alex Christensen  <achristensen@webkit.org>
2845
2846         REGRESSION(r215096) Queries of URLs with non-special schemes should not percent-encode single quotes
2847         https://bugs.webkit.org/show_bug.cgi?id=174051
2848
2849         Reviewed by Tim Horton.
2850
2851         In r215096 I added ' to the set of characters to be percent-encoded in queries,
2852         but for interoperability and compatibility we need to do this only for special schemes, like http.
2853
2854         Covered by new API tests.
2855
2856         * platform/URLParser.cpp:
2857         (WebCore::isC0Control):
2858         (WebCore::shouldPercentEncodeQueryByte):
2859         (WebCore::URLParser::utf8QueryEncode):
2860         (WebCore::URLParser::encodeQuery):
2861
2862 2017-07-03  Chris Fleizach  <cfleizach@apple.com>
2863
2864         AX: role="none" (or presentation) does not work on iframes
2865         https://bugs.webkit.org/show_bug.cgi?id=173930
2866         <rdar://problem/33034347>
2867
2868         Reviewed by Ryosuke Niwa.
2869
2870         Support setting a presentational role on an iframe so that the AXWebArea disappears from the hierarchy.
2871         Accomplish this by adding children for attachment and scroll view elements the way other children are added.
2872         That is, only add the non-ignored children directly (which means move the addChild logic into AccessibilityObject.)
2873
2874         Test: accessibility/presentation-role-iframe.html
2875
2876         * accessibility/AccessibilityNodeObject.cpp:
2877         (WebCore::AccessibilityNodeObject::AccessibilityNodeObject):
2878         (WebCore::AccessibilityNodeObject::insertChild): Deleted.
2879         (WebCore::AccessibilityNodeObject::addChild): Deleted.
2880         * accessibility/AccessibilityNodeObject.h:
2881         * accessibility/AccessibilityObject.cpp:
2882         (WebCore::AccessibilityObject::AccessibilityObject):
2883         (WebCore::AccessibilityObject::insertChild):
2884         (WebCore::AccessibilityObject::addChild):
2885         (WebCore::nodeHasPresentationRole):
2886         * accessibility/AccessibilityObject.h:
2887         (WebCore::AccessibilityObject::addChild): Deleted.
2888         (WebCore::AccessibilityObject::insertChild): Deleted.
2889         * accessibility/AccessibilityRenderObject.cpp:
2890         (WebCore::webAreaIsPresentational):
2891         (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
2892         (WebCore::AccessibilityRenderObject::addAttachmentChildren):
2893         * accessibility/AccessibilityScrollView.cpp:
2894         (WebCore::AccessibilityScrollView::addChildren):
2895
2896 2017-07-03  Matt Lewis  <jlewis3@apple.com>
2897
2898         Unreviewed, rolling out r219024.
2899
2900         This patch cause 3 didferent test to fail.
2901
2902         Reverted changeset:
2903
2904         "REGRESSION(r215096) Queries of URLs with non-special schemes
2905         should not percent-encode single quotes"
2906         https://bugs.webkit.org/show_bug.cgi?id=174051
2907         http://trac.webkit.org/changeset/219024
2908
2909 2017-07-03  Wenson Hsieh  <wenson_hsieh@apple.com>
2910
2911         Pasting single words copied to UIPasteboard inserts URLs in editable areas
2912         https://bugs.webkit.org/show_bug.cgi?id=174082
2913         <rdar://problem/33046992>
2914
2915         Reviewed by Tim Horton.
2916
2917         Currently, our heuristics for coercing plain text to URLs when reading URLs off of the UIPasteboard allows URLs
2918         to be created as long as -[UIPasteboard valuesForPasteboardType:inItemSet:] returns a non-null NSURL. However,
2919         UIPasteboard automatically coerces any NSString into an NSURL if it initializes an NSURL via +URLWithString:.
2920         Thus, single-word strings such as "hello" that are written to the pasteboard as "public.utf8-plain-text" can
2921         be read back as NSURLs for "public.url". This currently causes bugs in shipping software: e.g. copying and
2922         pasting a single word from an editable input or textarea and pasting into a rich contenteditable area using
2923         WebKit1 inserts a link. However, when combined with another change in WebKit that attempts to read "public.url"
2924         before "public.text" when reading plain text from the pasteboard, this now also affects pasting in plain text
2925         areas, where pasted plain-text strings that are not URLs will paste as URL-encoded strings anyways (for
2926         instance, replacing "[hello]" with "%5Bhello%5D").
2927
2928         To fix this, and existing issues with pasting single words in contenteditables, we make
2929         PlatformPasteboard::readString and PlatformPasteboard::readURL only accept a coerced NSURL as an URL if it also
2930         parses as a valid URL in WebKit (otherwise, we return an empty string).
2931
2932         Tests:
2933             UIPasteboardTests.DoNotPastePlainTextAsURL
2934             UIPasteboardTests.PastePlainTextAsURL
2935             UIPasteboardTests.PasteURLWithPlainTextAsURL
2936
2937         * platform/PlatformPasteboard.h:
2938         * platform/ios/AbstractPasteboard.h:
2939         * platform/ios/PlatformPasteboardIOS.mm:
2940         (WebCore::PlatformPasteboard::allowReadingURLAtIndex):
2941
2942         Allow an URL to be read if either (1) an URL was explicitly specified in the UIPasteboard, or (2) the "proposed"
2943         URL returned from -valuesForPasteboardType: is valid.
2944
2945         (WebCore::PlatformPasteboard::readString):
2946         (WebCore::PlatformPasteboard::readURL):
2947
2948         Consult allowReadingURLAtIndex here (in the case of ::readString, only if the given pasteboard type is
2949         "public.url").
2950
2951         * platform/ios/WebItemProviderPasteboard.h:
2952         * platform/ios/WebItemProviderPasteboard.mm:
2953         (-[WebItemProviderPasteboard itemProviders]):
2954         (-[WebItemProviderPasteboard setItemProviders:]):
2955
2956 2017-07-03  Zan Dobersek  <zdobersek@igalia.com>
2957
2958         [GCrypt] Implement CryptoKeyEC SPKI exports
2959         https://bugs.webkit.org/show_bug.cgi?id=173646
2960
2961         Reviewed by Jiewen Tan.
2962
2963         No new tests -- affected tests are now passing and are unskipped.
2964
2965         Implement libgcrypt-based support for SPKI exports of EC keys.
2966
2967         Initially, the ECParameters structure is created so that it will be later embedded
2968         into the SubjectPublicKeyInfo structure. First the root element of this structure
2969         is written into, specifying namedCurve as the chosen member (even if other choices
2970         are not really available). We then write out the object identifier into this
2971         namedCurve member that properly represents this key's curve type.
2972
2973         The SubjectPublicKeyInfo structure is created next. We write out id-ecPublicKey
2974         identifier as the chosen algorithm identifier. Web Crypto specification demands
2975         that the id-ecDH identifier is used in case of ECDH keys, but no existing test in
2976         the W3C test suite expects this, so this should be revisited later. Data of the
2977         previously-constructed ECParameters structure is written out into the
2978         AlgorithmIdentifier's parameters member.
2979
2980         The `q` MPI data is then retrieved. Its size is validated, as well as the first
2981         byte of data in order to ensure the MPI represents an uncompressed EC point.
2982         The data is then written into the subjectPublicKey member.
2983
2984         Finally the encoded SubjectPublicKeyInfo structure data is extracted and returned
2985         from the platformExportSpki() function, completion the export operation.
2986
2987         * crypto/gcrypt/CryptoKeyECGCrypt.cpp:
2988         (WebCore::curveIdentifier):
2989         (WebCore::CryptoKeyEC::platformExportSpki):
2990
2991 2017-07-02  Sam Weinig  <sam@webkit.org>
2992
2993         [WebIDL] Remove special casing for RegExp which is no longer required by the spec
2994         https://bugs.webkit.org/show_bug.cgi?id=174025
2995
2996         Reviewed by Chris Dumez.
2997
2998         * bindings/scripts/CodeGeneratorJS.pm:
2999         (GenerateDictionaryImplementationContent):
3000         (GenerateOverloadDispatcher):
3001         Remove special casing.
3002
3003         * bindings/scripts/IDLParser.pm:
3004         (parseNonAnyType):
3005         Remove parsing of RegExp.
3006
3007         * bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
3008         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
3009         * bindings/scripts/test/JS/JSTestObj.cpp:
3010         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
3011         * bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
3012         Update test results.
3013
3014 2017-07-02  Youenn Fablet  <youenn@apple.com>
3015
3016         RealtimeOutgoingVideoSource should pass frame timestamp
3017         https://bugs.webkit.org/show_bug.cgi?id=174055
3018
3019         Reviewed by Eric Carlson.
3020
3021         Covered by manual testing since this only affects video encoding quality.
3022
3023         * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:
3024         (WebCore::RealtimeOutgoingVideoSource::sendFrame):
3025
3026 2017-07-01  Dan Bernstein  <mitz@apple.com>
3027
3028         <rdar://problem/33096441> r219055 broke non-iOS builds.
3029
3030         * platform/graphics/cocoa/FontCacheCoreText.cpp:
3031         (WebCore::lookupFallbackFont):
3032
3033 2017-07-01  Dan Bernstein  <mitz@apple.com>
3034
3035         [iOS] Remove code only needed when building for iOS 9.x
3036         https://bugs.webkit.org/show_bug.cgi?id=174068
3037
3038         Reviewed by Tim Horton.
3039
3040         * Configurations/FeatureDefines.xcconfig:
3041         * editing/cocoa/DataDetection.mm:
3042         (WebCore::DataDetection::isDataDetectorLink):
3043         (WebCore::DataDetection::shouldCancelDefaultAction):
3044         (WebCore::constructURLStringForResult):
3045         (WebCore::DataDetection::detectContentInRange):
3046         * page/cocoa/ResourceUsageThreadCocoa.mm:
3047         (WebCore::vmPageSize):
3048         * platform/cocoa/DataDetectorsCoreSoftLink.h:
3049         * platform/cocoa/DataDetectorsCoreSoftLink.mm:
3050         * platform/graphics/FontPlatformData.cpp:
3051         * platform/graphics/FontPlatformData.h:
3052         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
3053         (layerContentsFormat):
3054         (PlatformCALayerCocoa::updateContentsFormat):
3055         (PlatformCALayerCocoa::backingStoreBytesPerPixel):
3056         * platform/graphics/cg/GraphicsContextCG.cpp:
3057         (WebCore::extendedSRGBColorSpaceRef):
3058         * platform/graphics/cg/PDFDocumentImage.cpp:
3059         (WebCore::PDFDocumentImage::drawPDFPage):
3060         * platform/graphics/cocoa/FontCacheCoreText.cpp:
3061         (WebCore::lookupFallbackFont):
3062         * platform/graphics/cocoa/FontCocoa.mm:
3063         (WebCore::Font::variantCapsSupportsCharacterForSynthesis):
3064         (WebCore::Font::platformWidthForGlyph):
3065         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
3066         (WebCore::FontPlatformData::FontPlatformData):
3067         (WebCore::FontPlatformData::ctFont):
3068         * platform/graphics/cocoa/IOSurface.mm:
3069         (WebCore::IOSurface::sinkIntoImage):
3070         * platform/graphics/cocoa/WebCoreDecompressionSession.mm:
3071         (WebCore::WebCoreDecompressionSession::setTimebase):
3072         * platform/graphics/ios/FontCacheIOS.mm:
3073         (WebCore::systemFontModificationAttributes):
3074         (WebCore::systemFontDescriptor):
3075         * platform/graphics/mac/FontCustomPlatformData.cpp:
3076         (WebCore::FontCustomPlatformData::supportsFormat):
3077         * platform/ios/LegacyTileGridTile.mm:
3078         (WebCore::LegacyTileGridTile::LegacyTileGridTile):
3079         * platform/ios/PlatformScreenIOS.mm:
3080         (WebCore::screenSupportsExtendedColor):
3081         * platform/ios/RemoteCommandListenerIOS.mm:
3082         (WebCore::RemoteCommandListenerIOS::RemoteCommandListenerIOS):
3083         (WebCore::RemoteCommandListenerIOS::~RemoteCommandListenerIOS):
3084         (WebCore::RemoteCommandListenerIOS::updateSupportedCommands):
3085         * platform/spi/cf/CFNetworkSPI.h:
3086         * platform/spi/cg/CoreGraphicsSPI.h:
3087         * platform/spi/cocoa/DataDetectorsCoreSPI.h:
3088         * platform/spi/cocoa/QuartzCoreSPI.h:
3089         * platform/spi/mac/AVFoundationSPI.h:
3090
3091 2017-07-01  Myles C. Maxfield  <mmaxfield@apple.com>
3092
3093         REGRESSION(r218371): Reeder's default font is Times instead of San Francisco
3094         https://bugs.webkit.org/show_bug.cgi?id=173617
3095         <rdar://problem/32969819>
3096
3097         Reviewed by Simon Fraser.
3098
3099         On systems where USE_PLATFORM_SYSTEM_FALLBACK_LIST is set to true, the code in
3100         platformFontWithFamilySpecialCase() is still used when @font-face blocks specify
3101         src:local(system-ui), which made the assertion erroneously fire.
3102
3103         Unfortunately, our architecture is such that an @font-face block represents a
3104         single entry in the font-family fallback list, which means it would be quite
3105         difficult to make local(system-ui) in an @font-face block expand at the level
3106         of the font cascade. So, this patch simply reverts to the previous behavior for
3107         local(system-ui) (which doesn't include the entire Core Text cascade list).
3108         This means that "font-family: system-ui" and "src: local(system-ui)" have
3109         different behavior, which is undesirable, but architecturally difficult to
3110         solve. I've added some FIXMEs to the code in the relevant places and filed
3111         https://bugs.webkit.org/show_bug.cgi?id=174023.
3112
3113         Test: fast/text/font-face-local-system.html
3114
3115         * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
3116         (WebCore::FontCascadeDescription::effectiveFamilyAt):
3117         * platform/graphics/ios/FontCacheIOS.mm:
3118         (WebCore::systemFontDescriptor):
3119         (WebCore::platformFontWithFamilySpecialCase):
3120         * platform/graphics/mac/FontCacheMac.mm:
3121         (WebCore::platformFontWithFamilySpecialCase):
3122
3123 2017-07-01  Ryosuke Niwa  <rniwa@webkit.org>
3124
3125         Frame.h doesn't need to include FrameLoader.h, IntRect.h, and NavigationScheduler.h
3126         https://bugs.webkit.org/show_bug.cgi?id=174004
3127
3128         Reviewed by Simon Fraser.
3129
3130         Made FrameLoader and NavigationScheduler UniqueRef in Frame so that we can forward declare them,
3131         and forward declared IntPoint and IntRect to avoid including FrameLoader.h, IntRect.h,
3132         and NavigationScheduler.h in Frame.h
3133
3134         * Modules/mediastream/MediaStream.cpp:
3135         * Modules/webaudio/AudioContext.cpp:
3136         * Modules/websockets/WebSocket.cpp:
3137         (WebCore::WebSocket::connect): Avoid calling loader().mixedContentChecker().canRunInsecureContent(~)
3138         on a nullptr even though this used to work because we weren't de-referencing it.
3139         * bindings/js/ScriptController.cpp:
3140         * dom/Document.cpp:
3141         * dom/EventDispatcher.cpp:
3142         * editing/Editor.cpp:
3143         * editing/cocoa/EditorCocoa.mm:
3144         * editing/ios/EditorIOS.mm:
3145         * editing/mac/EditorMac.mm:
3146         * history/CachedPage.cpp:
3147         * html/HTMLObjectElement.cpp:
3148         * html/parser/HTMLDocumentParser.cpp:
3149         (WebCore::DocumentLoader::~DocumentLoader): Check !isLoading() before accessing frameLoader to avoid
3150         accessing m_frame->loader() inside ~FrameLoader.
3151         * html/parser/XSSAuditor.cpp:
3152         * html/parser/XSSAuditorDelegate.cpp:
3153         * inspector/InspectorInstrumentation.h:
3154         * loader/CrossOriginPreflightChecker.cpp:
3155         * loader/FrameLoader.cpp:
3156         (WebCore::FrameLoader::setOpener): Avoid accessing this FrameLoader via m_opener->loader() when it's
3157         this FrameLoader inside ~FrameLoader since UniqueRef<FrameLoader> is clears itself before calling
3158         the destructor of FrameLoader.
3159         * loader/ImageLoader.cpp:
3160         * loader/LinkLoader.cpp:
3161         * loader/SubframeLoader.cpp:
3162         * loader/appcache/ApplicationCacheGroup.cpp:
3163         * loader/appcache/DOMApplicationCache.cpp:
3164         * mathml/MathMLElement.cpp:
3165         * page/DOMWindow.cpp:
3166         * page/Frame.cpp:
3167         (WebCore::Frame::Frame):
3168         (WebCore::Frame::init): Moved here from Frame.h
3169         (WebCore::Frame::setDocument):
3170         * page/Frame.h:
3171         (WebCore::Frame::loader):
3172         (WebCore::Frame::navigationScheduler):
3173         * page/History.cpp:
3174         * page/Location.cpp:
3175         * page/PerformanceLogging.cpp:
3176         * page/PerformanceNavigation.cpp:
3177         * page/UserContentProvider.cpp:
3178         * page/ios/FrameIOS.mm:
3179         (WebCore::Frame::initWithSimpleHTMLDocument):
3180         * plugins/PluginInfoProvider.cpp:
3181         * replay/ReplayInputCreationMethods.cpp:
3182         * replay/UserInputBridge.cpp:
3183         * xml/XSLTProcessorLibxslt.cpp:
3184         * xml/parser/XMLDocumentParserLibxml2.cpp:
3185
3186 2017-07-01  Dan Bernstein  <mitz@apple.com>
3187
3188         [macOS] Remove code only needed when building for OS X Yosemite
3189         https://bugs.webkit.org/show_bug.cgi?id=174067
3190
3191         Reviewed by Tim Horton.
3192
3193         * Configurations/Base.xcconfig:
3194         * Configurations/DebugRelease.xcconfig:
3195         * Configurations/FeatureDefines.xcconfig:
3196         * Configurations/Version.xcconfig:
3197         * accessibility/AXObjectCache.cpp:
3198         (WebCore::AXObjectCache::setEnhancedUserInterfaceAccessibility):
3199         * html/HTMLCanvasElement.cpp:
3200         * page/WheelEventDeltaFilter.cpp:
3201         (WebCore::WheelEventDeltaFilter::create):
3202         * page/mac/WheelEventDeltaFilterMac.h:
3203         * page/mac/WheelEventDeltaFilterMac.mm:
3204         * page/scrolling/ScrollingMomentumCalculator.cpp:
3205         * page/scrolling/mac/ScrollingMomentumCalculatorMac.h:
3206         * page/scrolling/mac/ScrollingMomentumCalculatorMac.mm:
3207         * platform/cocoa/NetworkExtensionContentFilter.mm:
3208         (replacementDataFromDecisionInfo):
3209         (WebCore::NetworkExtensionContentFilter::initialize):
3210         (WebCore::NetworkExtensionContentFilter::willSendRequest):
3211         (WebCore::NetworkExtensionContentFilter::responseReceived):
3212         (WebCore::NetworkExtensionContentFilter::addData):
3213         (WebCore::NetworkExtensionContentFilter::finishedAddingData):
3214         (WebCore::NetworkExtensionContentFilter::unblockHandler):
3215         * platform/graphics/ComplexTextController.h:
3216         * platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.mm:
3217         (PlatformCAAnimationCocoa::setTimingFunction):
3218         * platform/graphics/cocoa/FontCacheCoreText.cpp:
3219         (WebCore::FontCache::platformAlternateFamilyName):
3220         * platform/graphics/cocoa/FontCocoa.mm:
3221         (WebCore::Font::platformInit):
3222         * platform/graphics/cocoa/IOSurface.mm:
3223         (WebCore::IOSurface::sinkIntoImage):
3224         * platform/graphics/cocoa/WebGPULayer.mm:
3225         (-[WebGPULayer initWithGPUDevice:]):
3226         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
3227         (WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun):
3228         * platform/graphics/mac/WebGLLayer.mm:
3229         (-[WebGLLayer initWithGraphicsContext3D:]):
3230         * platform/mac/BlacklistUpdater.mm:
3231         * platform/mac/PlatformScreenMac.mm:
3232         (WebCore::screenSupportsExtendedColor):
3233         * platform/mac/ValidationBubbleMac.mm:
3234         (WebCore::ValidationBubble::ValidationBubble):
3235         * platform/mac/WebGLBlacklist.mm:
3236         (WebCore::WebGLBlacklist::create):
3237         * platform/network/cocoa/WebCoreNSURLSession.h:
3238         * platform/network/cocoa/WebCoreNSURLSession.mm:
3239         * platform/network/mac/CertificateInfoMac.mm:
3240         (WebCore::CertificateInfo::containsNonRootSHA1SignedCertificate):
3241         * platform/network/mac/CookieJarMac.mm:
3242         (WebCore::setCookiesFromDOM):
3243         * platform/spi/cf/CFNetworkSPI.h:
3244         * platform/spi/cg/CoreGraphicsSPI.h:
3245         * platform/spi/cocoa/NEFilterSourceSPI.h:
3246         * platform/spi/cocoa/NSURLConnectionSPI.h:
3247         * platform/spi/cocoa/QuartzCoreSPI.h:
3248         * platform/spi/mac/NSScrollingInputFilterSPI.h:
3249         * platform/spi/mac/NSScrollingMomentumCalculatorSPI.h:
3250         * platform/spi/mac/TUCallSPI.h:
3251         * rendering/RenderThemeMac.mm:
3252         (WebCore::RenderThemeMac::levelIndicatorFor):
3253         * svg/SVGToOTFFontConversion.cpp:
3254         (WebCore::SVGToOTFFontConverter::appendKERNTable):
3255         (WebCore::SVGToOTFFontConverter::SVGToOTFFontConverter):
3256
3257 2017-06-30  Said Abou-Hallawa  <sabouhallawa@apple.com>
3258
3259         If an image appears more than once on a page, decoding for painting one instance repaints them all
3260         https://bugs.webkit.org/show_bug.cgi?id=169944
3261
3262         Reviewed by Simon Fraser.
3263
3264         Make the Image::draw*() and GraphicsContext::draw*() functions return an
3265         ImageDrawResult which indicates whether the image is drawn or has requested
3266         an asynchronous image decoding.
3267
3268         If the image requested an asynchronous image decoding, the issuer of the
3269         Image::draw(), which is of type CachedImageClient, will add itself to a
3270         set of m_pendingImageDrawingClients, which owned by CachedImage.
3271
3272         When receiving the imageFrameAvailable() notification for a lrage image 
3273         from the decoding thread, CachedImage will loop through the clients that
3274         are only in m_pendingImageDrawingClients to ask them to repaint their
3275         rectangles.
3276
3277         Test: fast/images/async-image-multiple-clients-repaint.html
3278
3279         * loader/cache/CachedImage.cpp:
3280         (WebCore::CachedImage::didRemoveClient):
3281         (WebCore::CachedImage::addPendingImageDrawingClient):
3282         (WebCore::CachedImage::allClientsRemoved):
3283         (WebCore::CachedImage::clear):
3284         (WebCore::CachedImage::imageFrameAvailable):
3285         * loader/cache/CachedImage.h:
3286         * platform/graphics/BitmapImage.cpp:
3287         (WebCore::BitmapImage::draw):
3288         * platform/graphics/BitmapImage.h:
3289         * platform/graphics/CrossfadeGeneratedImage.cpp:
3290         (WebCore::CrossfadeGeneratedImage::draw):
3291         * platform/graphics/CrossfadeGeneratedImage.h:
3292         * platform/graphics/GeneratedImage.h:
3293         * platform/graphics/GradientImage.cpp:
3294         (WebCore::GradientImage::draw):
3295         * platform/graphics/GradientImage.h:
3296         * platform/graphics/GraphicsContext.cpp:
3297         (WebCore::GraphicsContext::drawImage):
3298         (WebCore::GraphicsContext::drawTiledImage):
3299         * platform/graphics/GraphicsContext.h:
3300         * platform/graphics/Image.cpp:
3301         (WebCore::Image::drawTiled):
3302         * platform/graphics/Image.h:
3303         * platform/graphics/ImageTypes.h:
3304         * platform/graphics/NamedImageGeneratedImage.cpp:
3305         (WebCore::NamedImageGeneratedImage::draw):
3306         * platform/graphics/NamedImageGeneratedImage.h:
3307         * platform/graphics/cg/PDFDocumentImage.cpp:
3308         (WebCore::PDFDocumentImage::draw):
3309         * platform/graphics/cg/PDFDocumentImage.h:
3310         * rendering/RenderBoxModelObject.cpp:
3311         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
3312         * rendering/RenderImage.cpp:
3313         (WebCore::RenderImage::paintIntoRect):
3314         * svg/graphics/SVGImage.cpp:
3315         (WebCore::SVGImage::drawForContainer):
3316         (WebCore::SVGImage::draw):
3317         * svg/graphics/SVGImage.h:
3318         * svg/graphics/SVGImageForContainer.cpp:
3319         (WebCore::SVGImageForContainer::draw):
3320         * svg/graphics/SVGImageForContainer.h:
3321
3322 2017-06-30  Ryosuke Niwa  <rniwa@webkit.org>
3323
3324         REGRESSION(r214194): Safari leaves a popup window open opened during before unload
3325         https://bugs.webkit.org/show_bug.cgi?id=174016
3326
3327         Reviewed by Chris Dumez.
3328
3329         Address Dan's review comments.
3330
3331         * loader/NavigationDisabler.h:
3332         (WebCore::NavigationDisabler::NavigationDisabler):
3333         (WebCore::NavigationDisabler::~NavigationDisabler):
3334
3335 2017-06-30  Wenson Hsieh  <wenson_hsieh@apple.com>
3336
3337         [iOS DnD] Text indicators for dragged links should always be legible if the link is legible
3338         https://bugs.webkit.org/show_bug.cgi?id=173860
3339         <rdar://problem/32974385>
3340
3341         Reviewed by Tim Horton.
3342
3343         Currently, TextIndicatorOptionUseBoundingRectAndPaintAllContentForComplexRanges ensures that links backed by a
3344         RenderReplaced element don't render blank text indicators by additionally forcing the
3345         TextIndicatorOptionPaintAllContent option in order to capture the RenderReplaced content. If estimated
3346         background color is requested, this patch adds an additional path for "upgrading" the text indicator to paint
3347         all content: if the text color is not legible against the estimated background color, then it is likely that the
3348         background color estimate failed or the link itself was not legible in the first place; in the former case, to
3349         ensure that the link is still legible, we upgrade the given TextIndicatorOptions to paint all contents in the
3350         range.
3351
3352         There is currently no way to test this, and also no simple way to introduce infrastructure to test text
3353         indicators.
3354
3355         * page/TextIndicator.cpp:
3356         (WebCore::estimatedTextColorsForRange):
3357
3358         Estimates all text colors that appear in a range by iterating over the text node renderers and consulting their
3359         render styles.
3360
3361         (WebCore::adjustTextIndicatorDataOptionsForEstimatedColorsIfNecessary):
3362
3363         If foreground text color is deemed not legible, force TextIndicatorOptionPaintAllContent instead of
3364         TextIndicatorOptionUseBoundingRectAndPaintAllContentForComplexRanges.
3365
3366         (WebCore::initializeIndicator):
3367         * rendering/TextPaintStyle.cpp:
3368         (WebCore::textColorIsLegibleAgainstBackgroundColor):
3369         (WebCore::adjustColorForVisibilityOnBackground):
3370
3371         Allow other parts of WebCore to check the legibility of text against a background color.
3372
3373         * rendering/TextPaintStyle.h:
3374
3375 2017-06-30  Alex Christensen  <achristensen@webkit.org>
3376
3377         REGRESSION(r215096) Queries of URLs with non-special schemes should not percent-encode single quotes
3378         https://bugs.webkit.org/show_bug.cgi?id=174051
3379         <rdar://problem/33002846>
3380
3381         Reviewed by Tim Horton.
3382
3383         In r215096 I added ' to the set of characters to be percent-encoded in queries,
3384         but for interoperability and compatibility we need to do this only for special schemes, like http.
3385
3386         Covered by new API tests.
3387
3388         * platform/URLParser.cpp:
3389         (WebCore::isC0Control):
3390         (WebCore::shouldPercentEncodeQueryByte):
3391         (WebCore::URLParser::utf8QueryEncode):
3392         (WebCore::URLParser::encodeQuery):
3393
3394 2017-06-30  Daniel Bates  <dabates@apple.com>
3395
3396         Attempt to fix the build following <https://trac.webkit.org/changeset/219019>
3397         (https://bugs.webkit.org/show_bug.cgi?id=165160)
3398
3399         Export the FrameLoadRequest move constructor and move operator so that they
3400         can be used from WebKit.
3401
3402         * loader/FrameLoadRequest.h:
3403
3404 2017-06-30  Don Olmstead  <don.olmstead@sony.com>
3405
3406         [WebCore] Update AXObjectCache for !HAVE(ACCESSIBILITY)
3407         https://bugs.webkit.org/show_bug.cgi?id=174045
3408
3409         Reviewed by Konstantin Tokarev.
3410
3411         No new tests. No change in behavior.
3412
3413         * accessibility/AXObjectCache.h:
3414         (WebCore::AXObjectCache::checkedStateChanged):
3415         (WebCore::AXObjectCache::childrenChanged):
3416         (WebCore::AXObjectCache::deferRecomputeIsIgnored):
3417         (WebCore::AXObjectCache::deferTextChangedIfNeeded):
3418         (WebCore::AXObjectCache::focusAriaModalNodeTimerFired):
3419         (WebCore::AXObjectCache::handleAriaExpandedChange):
3420         (WebCore::AXObjectCache::handleAriaRoleChanged):
3421         (WebCore::AXObjectCache::handleAttributeChanged):
3422         (WebCore::AXObjectCache::handleScrollbarUpdate):
3423         (WebCore::AXObjectCache::liveRegionChangedNotificationPostTimerFired):
3424         (WebCore::AXObjectCache::notificationPostTimerFired):
3425         (WebCore::AXObjectCache::passwordNotificationPostTimerFired):
3426         (WebCore::AXObjectCache::performDeferredCacheUpdate):
3427         (WebCore::AXObjectCache::postNotification):
3428         (WebCore::AXObjectCache::postPlatformNotification):
3429         (WebCore::AXObjectCache::postTextReplacementNotification):
3430         (WebCore::AXObjectCache::postTextReplacementNotificationForTextControl):
3431         (WebCore::AXObjectCache::postTextStateChangeNotification):
3432         (WebCore::AXObjectCache::recomputeIsIgnored):
3433         (WebCore::AXObjectCache::textChanged):
3434         (WebCore::AXObjectCache::updateCacheAfterNodeIsAttached):
3435         (WebCore::AXObjectCache::focusAriaModalNode): Deleted.
3436
3437 2017-06-30  Daniel Bates  <dabates@apple.com>
3438
3439         Attempt to fix the Apple Windows build following <https://trac.webkit.org/changeset/219013>
3440         (https://bugs.webkit.org/show_bug.cgi?id=165160)
3441
3442         Make FrameLoadRequest move constructor and move operator out-of-line so that callers
3443         do not need to include header SecurityOrigin.h.
3444
3445         * loader/FrameLoadRequest.cpp:
3446         * loader/FrameLoadRequest.h:
3447
3448 2017-06-30  Alex Christensen  <achristensen@webkit.org>
3449
3450         Stop soft linking with CFNetwork
3451         https://bugs.webkit.org/show_bug.cgi?id=174029
3452
3453         Reviewed by Jer Noble.
3454
3455         We link directly with CFNetwork.  There's no reason to soft link, 
3456         and it is causing a problem with linking when doing interesting things with CFNetwork.
3457
3458         * platform/spi/cf/CFNetworkSPI.h:
3459
3460 2017-06-30  Daniel Bates  <dabates@apple.com>
3461
3462         API::FrameInfo should know the web page that contains the frame; add API property webView to WKFrameInfo
3463         https://bugs.webkit.org/show_bug.cgi?id=165160
3464         <rdar://problem/29451999>
3465
3466         Reviewed by Brady Eidson.
3467
3468         Pass the document that is requesting the load to the loader.
3469
3470         * inspector/InspectorFrontendClientLocal.cpp:
3471         (WebCore::InspectorFrontendClientLocal::openInNewTab): Pass the document when instantiating the FrameLoadRequest.
3472         Also use C++11 brace initialization to instantiate ResourceRequest.
3473         * inspector/InspectorPageAgent.cpp:
3474         (WebCore::InspectorPageAgent::navigate): Pass the document when instantiating the FrameLoadRequest.
3475         * loader/FrameLoadRequest.cpp:
3476         (WebCore::FrameLoadRequest::FrameLoadRequest): Moved from FrameLoadRequest.h.
3477         (WebCore::FrameLoadRequest::requester): Added.
3478         (WebCore::FrameLoadRequest::requesterSecurityOrigin): Added.
3479         * loader/FrameLoadRequest.h:
3480         (WebCore::FrameLoadRequest::FrameLoadRequest): Marked as WEBCORE_EXPORT and modified to take
3481         the document that requested the load.
3482         (WebCore::FrameLoadRequest::requester): Deleted; made out-of-line/moved to FrameLoadRequest.cpp.
3483         * loader/FrameLoader.cpp:
3484         (WebCore::FrameLoader::urlSelected): Pass the document when instantiating the FrameLoadRequest. Also use C++11
3485         brace initialization to instantiate ResourceRequest.
3486         (WebCore::FrameLoader::loadURLIntoChildFrame): Pass the document when instantiating the FrameLoadRequest.
3487         (WebCore::FrameLoader::loadFrameRequest): Substitute FrameLoadRequest::requesterSecurityOrigin() for
3488         FrameLoadRequest::requester() as the former replaces the latter.
3489         (WebCore::FrameLoader::loadURL): Pass the document when instantiating the NavigationAction.
3490         (WebCore::FrameLoader::load): Ditto.
3491         (WebCore::FrameLoader::loadWithDocumentLoader): Pass the document when instantiating the NavigationAction.
3492         Also use C++11 brace initialization syntax to instantiate the NavigationAction.
3493         (WebCore::FrameLoader::reload): Ditto.
3494         (WebCore::FrameLoader::loadPostRequest): Ditto.
3495         (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy): Pass the document when instantiating the NavigationAction.
3496         (WebCore::FrameLoader::loadDifferentDocumentItem): Pass the document when instantiating the NavigationAction.
3497         Also use C++11 brace initialization syntax to instantiate the NavigationAction.
3498         (WebCore::createWindow): Pass the document when instantiating the NavigationAction.
3499         * loader/NavigationAction.cpp:
3500         (WebCore::NavigationAction::NavigationAction): Modified to take the source document.
3501         * loader/NavigationAction.h:
3502         (WebCore::NavigationAction::isEmpty): Consider a NavigationAction empty if does not have a source document
3503         or the associated ResourceRequest has an empty URL.
3504         (WebCore::NavigationAction::sourceDocument): Added.
3505         (WebCore::NavigationAction::NavigationAction): Deleted; made out-of-line/moved to NavigationAction.cpp to
3506         avoid the need to include the header Document.h.
3507         * loader/NavigationScheduler.cpp:
3508         (WebCore::ScheduledURLNavigation::ScheduledURLNavigation): Store the document that scheduled the navigation.
3509         Also use C++11 brace initialization to instantiate in the member initialization list.
3510         (WebCore::ScheduledURLNavigation::initiatingDocument): Added. Retrieves the document that scheduled the navigation.
3511         (WebCore::NavigationScheduler::scheduleLocationChange): Pass the document when instantiating the FrameLoadRequest.
3512         * loader/PolicyChecker.cpp:
3513         (WebCore::PolicyChecker::checkNavigationPolicy): Pass the document when instantiating the NavigationAction.
3514         Also use C++11 brace initialization syntax to instantiate the NavigationAction.
3515         * page/ContextMenuController.cpp:
3516         (WebCore::openNewWindow):
3517         (WebCore::ContextMenuController::contextMenuItemSelected): Pass the document when instantiating the FrameLoadRequest.
3518         Also use C++11 brace initialization syntax to instantiate the FrameLoadRequest.
3519         * page/DOMWindow.cpp:
3520         (WebCore::DOMWindow::createWindow): Pass the document when instantiating the FrameLoadRequest.
3521
3522 2017-06-29  Jer Noble  <jer.noble@apple.com>
3523
3524         Make Legacy EME API controlled by RuntimeEnabled setting.
3525         https://bugs.webkit.org/show_bug.cgi?id=173994
3526
3527         Reviewed by Sam Weinig.
3528
3529         Add a new RuntimeEnabledFeatures setting to control the availability of the WebKit prefixed EME APIs.
3530
3531         * Configurations/FeatureDefines.xcconfig:
3532         * Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.idl:
3533         * Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.idl:
3534         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.idl:
3535         * Modules/encryptedmedia/legacy/WebKitMediaKeys.idl:
3536         * dom/Element.idl:
3537         * html/HTMLMediaElement.cpp:
3538         (WebCore::HTMLMediaElement::mediaPlayerKeyNeeded):
3539         (WebCore::HTMLMediaElement::webkitSetMediaKeys):
3540         (WebCore::HTMLMediaElement::keyAdded):
3541         * html/HTMLMediaElement.idl:
3542         * html/WebKitMediaKeyError.idl:
3543         * page/RuntimeEnabledFeatures.h:
3544         (WebCore::RuntimeEnabledFeatures::setLegacyEncryptedMediaAPIEnabled):
3545         (WebCore::RuntimeEnabledFeatures::legacyEncryptedMediaAPIEnabled):
3546
3547 2017-06-30  Chris Dumez  <cdumez@apple.com>
3548
3549         Move ResourceLoadStatisticsStore to WebKit2/UIProcess
3550         https://bugs.webkit.org/show_bug.cgi?id=174033
3551
3552         Reviewed by Brent Fulgham.
3553
3554         Move ResourceLoadStatisticsStore to WebKit2/UIProcess since it is only
3555         used in the WebKit2 UIProcess.
3556
3557         * CMakeLists.txt:
3558         * WebCore.xcodeproj/project.pbxproj:
3559         * loader/ResourceLoadObserver.cpp:
3560         (WebCore::primaryDomain):
3561         * loader/ResourceLoadStatistics.cpp:
3562         (WebCore::ResourceLoadStatistics::primaryDomain):
3563         * loader/ResourceLoadStatistics.h:
3564
3565 2017-06-30  Ryosuke Niwa  <rniwa@webkit.org>
3566
3567         Ran sort-Xcode-project-file.
3568
3569         * WebCore.xcodeproj/project.pbxproj:
3570
3571 2017-06-30  Ryosuke Niwa  <rniwa@webkit.org>
3572
3573         REGRESSION(r214194): Safari leaves a popup window open opened during before unload
3574         https://bugs.webkit.org/show_bug.cgi?id=174016
3575
3576         Reviewed by Chris Dumez.
3577
3578         The bug was caused by WebKit allowing the opening of a new window via window.open but disallowing
3579         the initial navigation within the newly opened window while a beforeunload event is being dispatched.
3580
3581         Because some websites which opens a window during a beforeunload event relies on the opened page
3582         to communicate back in order to close it. This resulted in a newly opened popup window with about:blank
3583         being left out on those websites.
3584
3585         Fixed the bug by allowing the navigation of a new window as well as an existing another window.
3586         More concretely, we disallow navigations within the same frame tree as the one in which a beforeunload
3587         event is being dispatched, and allow navigations elsewhere (i.e. different window / page).
3588         During the destruction of a frame-less document, disallow all the navigations.
3589
3590         Tests: fast/events/before-unload-navigate-different-window.html
3591                fast/events/before-unload-open-window.html
3592                fast/events/before-unload-sibling-frame.html
3593
3594         * WebCore.xcodeproj/project.pbxproj:
3595         * dom/Document.cpp:
3596         (WebCore::Document::prepareForDestruction):
3597         * loader/FrameLoader.cpp:
3598         (WebCore::FrameLoader::isNavigationAllowed):
3599         (WebCore::FrameLoader::shouldClose):
3600         * loader/NavigationDisabler.h: Added. Extracted from NavigationScheduler.h
3601         (WebCore::NavigationDisabler::NavigationDisabler): Increment the newly added counter on MainFrame unless
3602         the frame is null (during the destruction of a frameless document) in which case we increment the global
3603         disable count.
3604         (WebCore::NavigationDisabler::~NavigationDisabler): Ditto for decrementation.
3605         (WebCore::NavigationDisabler::isNavigationAllowed): Only allow the navigation when there is no frameless
3606         document in destruction, and none of the frame in the same frame tree as the one given is currently in
3607         the process of dispatching a beforeunload event.
3608         * loader/NavigationScheduler.cpp:
3609         (WebCore::NavigationScheduler::shouldScheduleNavigation):
3610         * loader/NavigationScheduler.h:
3611         (WebCore::NavigationDisabler): Moved to NavigationDisabler.h.
3612         * page/MainFrame.h:
3613         (WebCore::MainFrame): Added s_globalNavigationDisableCount.
3614
3615 2017-06-30  Sam Weinig  <sam@webkit.org>
3616
3617         [WebIDL] Add support for conditionally read-write attributes
3618         https://bugs.webkit.org/show_bug.cgi?id=173993
3619
3620         Reviewed by Alex Christensen.
3621
3622         The MEDIA_SOURCE feature/conditional requires changing a few readonly
3623         attributes into read-write attributes. In the past we handled this with
3624         custom bindings. This patch adds a new extended attribute, ConditionallyReadWrite
3625         which achieves the same result.
3626
3627         * WebCore.xcodeproj/project.pbxproj:
3628         Move a few custom binding to the "GC / Wrapping Only" group.
3629
3630         * bindings/js/JSAudioTrackCustom.cpp:
3631         (WebCore::JSAudioTrack::setKind): Deleted.
3632         (WebCore::JSAudioTrack::setLanguage): Deleted.
3633         * bindings/js/JSTextTrackCustom.cpp:
3634         (WebCore::JSTextTrack::setLanguage): Deleted.
3635         * bindings/js/JSVideoTrackCustom.cpp:
3636         (WebCore::JSVideoTrack::setKind): Deleted.
3637         (WebCore::JSVideoTrack::setLanguage): Deleted.
3638         Remove no longer needed custom bindings.
3639
3640         * bindings/scripts/CodeGeneratorJS.pm:
3641         (GeneratePropertiesHashTable):
3642         (GenerateImplementation):
3643         (GenerateAttributeSetterDefinition):
3644         (GenerateCallbackImplementationContent):
3645         (GenerateHashTableValueArray):
3646         (GenerateHashTable):
3647         Pipe ConditionallyReadWrite through the generator.
3648
3649         * bindings/scripts/IDLAttributes.json:
3650         Add ConditionallyReadWrite.
3651
3652         * bindings/scripts/test/JS/JSTestObj.cpp:
3653         * bindings/scripts/test/TestObj.idl:
3654         Add tests for ConditionallyReadWrite.
3655
3656         * html/track/AudioTrack.idl:
3657         * html/track/TextTrack.idl:
3658         * html/track/VideoTrack.idl:
3659         Replace [Custom] with [ConditionallyReadWrite].
3660
3661 2017-06-30  Chris Dumez  <cdumez@apple.com>
3662
3663         ResourceLoadObserver does not need a ResourceLoadStatisticsStore
3664         https://bugs.webkit.org/show_bug.cgi?id=174013
3665
3666         Reviewed by Brent Fulgham.
3667
3668         ResourceLoadObserver does not need a ResourceLoadStatisticsStore. ResourceLoadStatisticsStore is too complicated for its needs.
3669         ResourceLoadStatisticsStore can then be moved to WebKit2/UIProcess in a follow-up.
3670
3671         * Modules/websockets/WebSocket.cpp:
3672         (WebCore::WebSocket::connect):
3673         * dom/UserGestureIndicator.cpp:
3674         (WebCore::UserGestureIndicator::UserGestureIndicator):
3675         * loader/DocumentLoader.cpp:
3676         (WebCore::DocumentLoader::willSendRequest):
3677         * loader/FrameLoader.cpp:
3678         (WebCore::FrameLoader::loadResourceSynchronously):
3679         * loader/ResourceLoadObserver.cpp:
3680         (WebCore::ResourceLoadObserver::shared):
3681         (WebCore::ResourceLoadObserver::setNotificationCallback):
3682         (WebCore::ResourceLoadObserver::shouldLog):
3683         (WebCore::ResourceLoadObserver::logFrameNavigation):
3684         (WebCore::ResourceLoadObserver::logSubresourceLoading):
3685         (WebCore::ResourceLoadObserver::logWebSocketLoading):
3686         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
3687         (WebCore::ResourceLoadObserver::ensureResourceStatisticsForPrimaryDomain):
3688         (WebCore::ResourceLoadObserver::takeResourceStatisticsForPrimaryDomain):
3689         (WebCore::ResourceLoadObserver::isPrevalentResource):
3690         (WebCore::ResourceLoadObserver::statisticsForOrigin):
3691         (WebCore::ResourceLoadObserver::takeStatistics):
3692         * loader/ResourceLoadObserver.h:
3693         * loader/ResourceLoadStatisticsStore.cpp:
3694         * loader/ResourceLoadStatisticsStore.h:
3695         * loader/SubresourceLoader.cpp:
3696         (WebCore::SubresourceLoader::willSendRequestInternal):
3697         * testing/Internals.cpp:
3698         (WebCore::Internals::resourceLoadStatisticsForOrigin):
3699
3700 2017-06-30  Fujii Hironori  <Hironori.Fujii@sony.com>
3701
3702         ASSERTION FAILED: !canAnimate() && !m_currentFrame
3703         https://bugs.webkit.org/show_bug.cgi?id=173089
3704
3705         Reviewed by Said Abou-Hallawa.
3706
3707         WebCore::BitmapImage::draw() has an assertion which ensures
3708         m_currentFrame is zero in case of async decoding. But, this
3709         assertion failed if an GIF animation image which have finished its
3710         animation was repainted. In that time, m_currentFrame was the last
3711         frame index of the image.
3712
3713         Test: fast/images/animated-gif-paint-after-animation.html
3714
3715         * platform/graphics/BitmapImage.cpp:
3716         (WebCore::BitmapImage::draw): Assert m_currentFrame is zero or the animation finished.
3717         Call requestFrameAsyncDecodingAtIndex with m_currentFrame instead of zero.
3718
3719 2017-06-30  Ross Kirsling  <ross.kirsling@sony.com>
3720
3721         [PAL] Move Sound into PAL
3722         https://bugs.webkit.org/show_bug.cgi?id=173999
3723
3724         Reviewed by Alex Christensen.
3725
3726         * Configurations/WebCore.xcconfig:
3727         * PlatformGTK.cmake:
3728         * PlatformMac.cmake:
3729         * PlatformWPE.cmake:
3730         * PlatformWin.cmake:
3731         * WebCore.xcodeproj/project.pbxproj:
3732         * editing/Editor.cpp:
3733         (WebCore::Editor::cut):
3734         (WebCore::Editor::copy):
3735         (WebCore::Editor::performDelete):
3736         * editing/EditorCommand.cpp:
3737         (WebCore::executeSelectToMark):
3738         (WebCore::executeSwapWithMark):
3739         * editing/mac/EditorMac.mm:
3740         (WebCore::Editor::takeFindStringFromSelection):
3741         * inspector/InspectorFrontendHost.cpp:
3742         (WebCore::InspectorFrontendHost::beep):
3743         * platform/Sound.h: Removed.
3744
3745 2017-06-30  Wenson Hsieh  <wenson_hsieh@apple.com>
3746
3747         [iOS DnD] Drag caret rect is incorrectly computed when dropping in editable content in iframes
3748         https://bugs.webkit.org/show_bug.cgi?id=174017
3749         <rdar://problem/32959782>
3750
3751         Reviewed by Simon Fraser.
3752
3753         We're currenly computing the drag caret rect (for the purposes of presentation at the client layers)
3754         incorrectly, in per-frame document coordinates instead of root view coordinates in the mainframe. This means
3755         drag caret geometry from embedded iframes in the document will show up in the content view with a rect in the
3756         coordinate space of the iframe.
3757
3758         To fix this, we need to convert the drag caret rect to root view coordinates. This patch teaches
3759         DragCaretController to do this, and tweaks WebKit/WebKit2 to use caretRectInRootViewCoordinates.
3760
3761         Test: DataInteractionTests.ExternalSourcePlainTextToIFrame
3762
3763         * editing/FrameSelection.cpp:
3764         (WebCore::DragCaretController::caretRectInRootViewCoordinates):
3765         * editing/FrameSelection.h:
3766
3767 2017-06-30  Sam Weinig  <sam@webkit.org>
3768
3769         [WebIDL] Replace use of __is_polymorphic with standard std::is_polymorphic<>::value
3770         https://bugs.webkit.org/show_bug.cgi?id=174012
3771
3772         Reviewed by Alex Christensen.
3773
3774         * bindings/scripts/CodeGeneratorJS.pm:
3775         (GenerateImplementation):
3776         Replace __is_polymorphic with standard std::is_polymorphic<>::value. Remove clang
3777         specific guard now that we are using something other compilers support.
3778
3779         * bindings/scripts/test/JS/JSInterfaceName.cpp:
3780         * bindings/scripts/test/JS/JSMapLike.cpp:
3781         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
3782         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
3783         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
3784         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
3785         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
3786         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
3787         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
3788         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
3789         * bindings/scripts/test/JS/JSTestException.cpp:
3790         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
3791         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
3792         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
3793         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
3794         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
3795         * bindings/scripts/test/JS/JSTestInterface.cpp:
3796         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
3797         * bindings/scripts/test/JS/JSTestIterable.cpp:
3798         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
3799         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
3800         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
3801         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
3802         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
3803         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
3804         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
3805         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
3806         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
3807         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
3808         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
3809         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
3810         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
3811         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
3812         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
3813         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
3814         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
3815         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
3816         * bindings/scripts/test/JS/JSTestNode.cpp:
3817         * bindings/scripts/test/JS/JSTestObj.cpp:
3818         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
3819         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
3820         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
3821         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
3822         * bindings/scripts/test/JS/JSTestSerialization.cpp:
3823         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
3824         * bindings/scripts/test/JS/JSTestStringifier.cpp:
3825         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
3826         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
3827         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
3828         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
3829         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
3830         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
3831         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
3832         Update test results.
3833
3834 2017-06-30  Youenn Fablet  <youenn@apple.com>
3835
3836        Support PeerConnectionStates::BundlePolicy::MaxBundle when setting rtc configuration
3837        https://bugs.webkit.org/show_bug.cgi?id=169389
3838
3839        Reviewed by Alex Christensen.
3840
3841        Covered by manual testing (appr.tc and https://youennf.github.io/webrtc-tests/src/content/peerconnection/trickle-ice/).
3842        Updated test is showing some more failing but this is due to the fact that we are no longer totally lying on the configuration of the
3843         underlying libwebrtc backend.
3844
3845         Previously, we were creating a libwebrtc peer connection and then setting its configuration.
3846         libwebrtc does not like the configuration to be changed and may refuse to set the configuration.
3847         Instead of doing that, we are now creating the libwebrtc peer connection with the provided configuration.
3848
3849         ICE candidate pool size is disabled as it is creating issues with running tests on bots.
3850
3851         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
3852         (WebCore::MediaEndpointPeerConnection::setConfiguration):
3853         * Modules/mediastream/MediaEndpointPeerConnection.h:
3854         * Modules/mediastream/PeerConnectionBackend.h:
3855         * Modules/mediastream/RTCPeerConnection.cpp:
3856         (WebCore::RTCPeerConnection::initializeWith):
3857         (WebCore::iceServersFromConfiguration):
3858         (WebCore::RTCPeerConnection::initializeConfiguration):
3859         (WebCore::RTCPeerConnection::setConfiguration):
3860         * Modules/mediastream/RTCPeerConnection.h:
3861         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
3862         (WebCore::LibWebRTCMediaEndpoint::LibWebRTCMediaEndpoint):
3863         (WebCore::LibWebRTCMediaEndpoint::setConfiguration):
3864         (WebCore::LibWebRTCMediaEndpoint::stop):
3865         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
3866         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
3867         (WebCore::configurationFromMediaEndpointConfiguration):
3868         (WebCore::LibWebRTCPeerConnectionBackend::setConfiguration):
3869         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
3870         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
3871         (WebCore::createActualPeerConnection):
3872         (WebCore::LibWebRTCProvider::createPeerConnection):
3873         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
3874
3875
3876 2017-06-30  Antoine Quint  <graouts@apple.com>
3877
3878         Top controls bars should invert with right-to-left user interface layout direction locale
3879         https://bugs.webkit.org/show_bug.cgi?id=173989
3880         <rdar://problem/32863552>
3881
3882         Reviewed by Dean Jackson.
3883
3884         When the user interface layout direction is set by the locale to be right-to-left, we now:
3885
3886             - invert the two top controls bars
3887             - invert the layout order for the fullscreen / PiP controls bar
3888             - orient the volume button the opposite direction when presented in a top controls bar
3889
3890         Test: media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-rtl.html
3891
3892         * Modules/modern-media-controls/controls/icon-service.js: Add new RTL variants for the mute and unmute icons.
3893         * Modules/modern-media-controls/controls/inline-media-controls.css: Invert the position of the two top controls
3894         bars when we switch user interface layout direction.
3895         (.media-controls.inline.uses-ltr-user-interface-layout-direction > .controls-bar.top-left,):
3896         (.media-controls.inline.uses-ltr-user-interface-layout-direction > .controls-bar.top-right,):
3897         (.media-controls.inline > .controls-bar.top-left): Deleted.
3898         (.media-controls.inline > .controls-bar.top-right): Deleted.
3899         * Modules/modern-media-controls/controls/inline-media-controls.js:
3900         (InlineMediaControls.prototype.layout): Default to using the LTR variant for the mute button icon since
3901         it should only use the RTL variant in case the locale requires it *and* we display the mute button in a
3902         top controls bar rather than the bottom controls bar (ie. when width becomes constrained).
3903         (InlineMediaControls.prototype._topLeftContainerButtons): Invert the order of the fullscreen and PiP
3904         buttons based on the user interface layout direction.
3905         (InlineMediaControls.prototype._addTopRightBarWithMuteButtonToChildren):
3906         (InlineMediaControls):
3907         * Modules/modern-media-controls/controls/media-controls.js:
3908         (MediaControls.prototype.set usesLTRUserInterfaceLayoutDirection): Schedule a layout when the user interface
3909         layout direction changes.
3910         * Modules/modern-media-controls/controls/mute-button.js: Add a new "usesRTLIconVariant" property, false by
3911         default, to indicate we want to use the RTL variant of the button's icon.
3912         (MuteButton):
3913         (MuteButton.prototype.get muted):
3914         (MuteButton.prototype.set muted):
3915         (MuteButton.prototype.set usesRTLIconVariant):
3916         (MuteButton.prototype.layout):
3917         * Modules/modern-media-controls/images/iOS/Mute-RTL.svg: Added.
3918         * Modules/modern-media-controls/images/iOS/VolumeHi-RTL.svg: Added.
3919         * Modules/modern-media-controls/images/macOS/Mute-RTL.svg: Added.
3920         * Modules/modern-media-controls/images/macOS/VolumeHi-RTL.svg: Added.
3921         * Modules/modern-media-controls/media/media-controller.js: Use an ivar to track when it's worth notifying the
3922         media controls that the user interface layout direction has changed. This means we won't need to schedule a
3923         layout in case it's set to the current value.
3924         (MediaController):
3925         (MediaController.prototype.set usesLTRUserInterfaceLayoutDirection):
3926
3927 2017-06-29  Zalan Bujtas  <zalan@apple.com>
3928
3929         BreakingContext::handleReplaced() should use replacedBox instead of m_current.renderer().
3930         https://bugs.webkit.org/show_bug.cgi?id=174011
3931
3932         Reviewed by Simon Fraser.
3933
3934         No change in functionality.
3935
3936         * rendering/line/BreakingContext.h:
3937         (WebCore::BreakingContext::handleReplaced):
3938         * rendering/line/LineWidth.cpp:
3939         (WebCore::LineWidth::applyOverhang):
3940         * rendering/line/LineWidth.h:
3941
3942 2017-06-29  Wenson Hsieh  <wenson_hsieh@apple.com>
3943
3944         [iOS DnD] Web content process crashes when the selection is moved far offscreen in dragstart
3945         https://bugs.webkit.org/show_bug.cgi?id=174010
3946         <rdar://problem/32597802>
3947
3948         Reviewed by Tim Horton.
3949
3950         The TextIndicator snapshot generated in createDragImageForSelection is not guaranteed to succeed; this patch
3951         adds a null check following TextIndicator::createWithSelectionInFrame and bails early if the snapshot was not
3952         successful.
3953
3954         Test: DataInteractionTests.DoNotCrashWhenSelectionMovesOffscreenAfterDragStart
3955
3956         * platform/ios/DragImageIOS.mm:
3957         (WebCore::createDragImageForSelection):
3958
3959 2017-06-29  Chris Fleizach  <cfleizach@apple.com>
3960
3961         AX: Cannot call setValue() on contenteditable or ARIA text controls
3962         https://bugs.webkit.org/show_bug.cgi?id=173520
3963
3964         Reviewed by Ryosuke Niwa.
3965
3966         Add support for changing the value of a contenteditable and any other aria text control in setValue().
3967  
3968         Test: accessibility/mac/set-value-editable-types.html
3969
3970         * accessibility/AccessibilityRenderObject.cpp:
3971         (WebCore::AccessibilityRenderObject::setValue):
3972
3973 2017-06-28  Simon Fraser  <simon.fraser@apple.com>
3974
3975         getBoundingClientRect returns wrong value for combination of page zoom and scroll
3976         https://bugs.webkit.org/show_bug.cgi?id=173841
3977         rdar://problem/32983841
3978
3979         Reviewed by Dean Jackson.
3980
3981         The layout viewport returned by FrameView::layoutViewportRect() is affected by page (Command-+) zooming,
3982         since it's computed using scroll positions, so when we use its origin to convert into client coordinates
3983         (which are zoom-agnostic), we need to account for page zoom, so fix FrameView::documentToClientOffset()
3984         to do this.
3985
3986         Callers of documentToClientOffset() were checked, revealing that event client coordinates were also
3987         wrong with page zoom and are fixed in the same way. It was found that SimulatedClick was using an
3988         entirely wrong rect to compute its location: Element::clientRect() is NOT in client coordinates,
3989         so change this code to use getBoundingClientRect() instead.
3990
3991         Minor refactoring in MouseRelatedEvent to make getting to the FrameView cleaner.
3992
3993         Some geometry types enhanced to have non-mutating scale functions.
3994
3995         Tests: fast/events/simulated-click-zoomed.html
3996                fast/visual-viewport/client-rects-relative-to-layout-viewport-zoomed.html
3997
3998         * dom/MouseRelatedEvent.cpp:
3999         (WebCore::MouseRelatedEvent::init):
4000         (WebCore::MouseRelatedEvent::initCoordinates):