[LFC][Floating] Add basic left/right floating positioning.
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-07-31  Zalan Bujtas  <zalan@apple.com>
2
3         [LFC][Floating] Add basic left/right floating positioning.
4         https://bugs.webkit.org/show_bug.cgi?id=188148
5
6         Reviewed by Antti Koivisto.
7
8         This patch implements simple floating positioning.
9         (Floatings with different containing blocks do not work yet.)
10
11         * layout/FloatingContext.cpp:
12         (WebCore::Layout::FloatingPair::isEmpty const):
13         (WebCore::Layout::Iterator::current const):
14         (WebCore::Layout::Iterator::verticalPosition const):
15         (WebCore::Layout::FloatingContext::FloatingContext):
16         (WebCore::Layout::FloatingContext::computePosition const):
17         (WebCore::Layout::FloatingContext::floatingPosition const):
18         (WebCore::Layout::FloatingContext::initialVerticalPosition const):
19         (WebCore::Layout::FloatingContext::alignWithContainingBlock const):
20         (WebCore::Layout::FloatingContext::alignWithFloatings const):
21         (WebCore::Layout::floatingDisplayBox):
22         (WebCore::Layout::FloatingPair::FloatingPair):
23         (WebCore::Layout::FloatingPair::left const):
24         (WebCore::Layout::FloatingPair::right const):
25         (WebCore::Layout::FloatingPair::intersects const):
26         (WebCore::Layout::Iterator::Iterator):
27         (WebCore::Layout::Iterator::operator++):
28         (WebCore::Layout::Iterator::set):
29         (WebCore::Layout::FloatingContext::computePosition): Deleted.
30         * layout/FloatingContext.h:
31         * layout/FloatingState.cpp:
32         (WebCore::Layout::FloatingState::append):
33         * layout/FloatingState.h:
34         (WebCore::Layout::FloatingState::floatings const):
35         (WebCore::Layout::FloatingState::last const):
36         * layout/blockformatting/BlockFormattingContext.cpp:
37         (WebCore::Layout::BlockFormattingContext::layout const):
38         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
39         * layout/displaytree/DisplayBox.cpp:
40         (WebCore::Display::Box::Rect::Rect):
41         * layout/displaytree/DisplayBox.h:
42         (WebCore::Display::Box::Rect::intersects const):
43         (WebCore::Display::Box::rect const):
44
45 2018-07-31  Rob Buis  <rbuis@igalia.com>
46
47         Remove ResourceResponse::cacheBodyKey API
48         https://bugs.webkit.org/show_bug.cgi?id=188192
49
50         Reviewed by Frédéric Wang.
51
52         Removed unused API.
53
54         No new tests needed since this API is not used.
55
56         * platform/network/ResourceResponseBase.h:
57         (WebCore::ResourceResponseBase::encode const):
58         (WebCore::ResourceResponseBase::decode):
59         (WebCore::ResourceResponseBase::cacheBodyKey const): Deleted.
60         (WebCore::ResourceResponseBase::setCacheBodyKey): Deleted.
61
62 2018-07-30  Simon Fraser  <simon.fraser@apple.com>
63
64         Shrink GraphicsLayerCA
65         https://bugs.webkit.org/show_bug.cgi?id=188141
66
67         Reviewed by Zalan Bujtas.
68         
69         Shrink GraphicsLayerCA from 1040 to 880 bytes by:
70         * moving all the clone-related stuff into the lazily-allocated m_layerClones
71         * moving all the animation-related stuff into the lazily-allocated m_animations
72         * making enums be 8-bit
73         * re-ordering data members
74
75         * page/cocoa/ResourceUsageOverlayCocoa.mm:
76         (WebCore::ResourceUsageOverlay::platformInitialize):
77         * platform/graphics/GraphicsLayer.cpp:
78         (WebCore::GraphicsLayer::GraphicsLayer):
79         (WebCore::operator<<):
80         * platform/graphics/GraphicsLayer.h:
81         * platform/graphics/GraphicsLayerClient.h:
82         * platform/graphics/WindRule.h:
83         * platform/graphics/ca/GraphicsLayerCA.cpp:
84         (WebCore::GraphicsLayerCA::GraphicsLayerCA):
85         (WebCore::GraphicsLayerCA::moveOrCopyAnimations):
86         (WebCore::GraphicsLayerCA::addProcessingActionForAnimation):
87         (WebCore::GraphicsLayerCA::setContentsToSolidColor):
88         (WebCore::GraphicsLayerCA::setContentsToImage):
89         (WebCore::GraphicsLayerCA::setContentsToPlatformLayer):
90         (WebCore::GraphicsLayerCA::contentsLayerForMedia const):
91         (WebCore::GraphicsLayerCA::layerDidDisplay):
92         (WebCore::layerTypeForCustomBackdropAppearance):
93         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
94         (WebCore::GraphicsLayerCA::updateGeometry):
95         (WebCore::GraphicsLayerCA::updateMasksToBounds):
96         (WebCore::GraphicsLayerCA::updateContentsVisibility):
97         (WebCore::GraphicsLayerCA::updateContentsOpaque):
98         (WebCore::GraphicsLayerCA::updateBackfaceVisibility):
99         (WebCore::GraphicsLayerCA::updateFilters):
100         (WebCore::GraphicsLayerCA::updateBackdropFilters):
101         (WebCore::GraphicsLayerCA::updateBackdropFiltersRect):
102         (WebCore::GraphicsLayerCA::ensureStructuralLayer):
103         (WebCore::GraphicsLayerCA::updateDrawsContent):
104         (WebCore::GraphicsLayerCA::updateCoverage):
105         (WebCore::GraphicsLayerCA::updateDebugIndicators):
106         (WebCore::GraphicsLayerCA::updateContentsImage):
107         (WebCore::GraphicsLayerCA::updateContentsPlatformLayer):
108         (WebCore::GraphicsLayerCA::updateContentsColorLayer):
109         (WebCore::GraphicsLayerCA::updateContentsRects):
110         (WebCore::GraphicsLayerCA::updateMasksToBoundsRect):
111         (WebCore::GraphicsLayerCA::updateMaskLayer):
112         (WebCore::GraphicsLayerCA::updateAnimations):
113         (WebCore::GraphicsLayerCA::isRunningTransformAnimation const):
114         (WebCore::GraphicsLayerCA::ensureLayerAnimations):
115         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
116         * platform/graphics/ca/GraphicsLayerCA.h:
117         (WebCore::GraphicsLayerCA::animationIsRunning const):
118         (WebCore::GraphicsLayerCA::primaryLayerClones const): Deleted.
119         * platform/graphics/ca/PlatformCALayerClient.h:
120         (WebCore::PlatformCALayerClient::platformCALayerContentsOrientation const):
121         * platform/graphics/ca/TileCoverageMap.h:
122         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
123         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
124         (PlatformCALayerCocoa::PlatformCALayerCocoa):
125         (PlatformCALayerCocoa::requiresCustomAppearanceUpdateOnBoundsChange const):
126         (PlatformCALayerCocoa::updateCustomAppearance):
127         (PlatformCALayer::drawLayerContents):
128         * rendering/RenderLayerBacking.cpp:
129         (WebCore::RenderLayerBacking::updateCustomAppearance):
130         (WebCore::RenderLayerBacking::updateConfiguration):
131         * rendering/RenderLayerCompositor.cpp:
132         (WebCore::RenderLayerCompositor::rootBackgroundColorOrTransparencyChanged):
133         (WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
134
135 2018-07-30  Justin Fan  <justin_fan@apple.com>
136
137         [WebGL2] Support compilation of GLSL ES version 300 shaders
138         https://bugs.webkit.org/show_bug.cgi?id=187982
139         <rdar://problem/42564229>
140
141         Reviewed by Dean Jackson.
142
143         Test: fast/canvas/webgl/webgl2-glsl3-compile.html
144
145         * html/canvas/WebGLRenderingContextBase.cpp:
146         (WebCore::WebGLRenderingContextBase::create): Rename 'useGLES3' to 'isWebGL2' (everywhere) to make more sense.
147         * platform/graphics/GraphicsContext3DAttributes.h: Rename 'useGLES3' to 'isWebGL2'.
148         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
149         (WebCore::setPixelFormat): Back WebGL2 contexts with OpenGL 4 for full OpenGL ES 3 support. 
150         (WebCore::GraphicsContext3D::GraphicsContext3D): Request correct GLSL output version and WebGL 2 for ANGLE shader compilation.
151         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
152         (WebCore::GraphicsContext3D::checkVaryingsPacking const): MAX_VARYING_FLOATS is deprecated in OpenGL 3+.
153         * platform/graphics/texmap/GraphicsContext3DTextureMapper.cpp: Rename 'useGLES3' to 'isWebGL2'.
154         (WebCore::GraphicsContext3D::create):
155         (WebCore::GraphicsContext3D::GraphicsContext3D):
156
157 2018-07-30  Justin Fan  <justin_fan@apple.com>
158
159         Match GraphicsContext3D with correct virtual screen using registryID
160         https://bugs.webkit.org/show_bug.cgi?id=188072
161         <rdar://problem/42634940>
162
163         Reviewed by Dean Jackson.
164
165         Follow up to https://bugs.webkit.org/show_bug.cgi?id=187750. Rather than matching rendererIDs, 
166         which can vary between processes, match GPU to display using registryID that is unique to a GPU, 
167         which was added to CGL in MacOS 10.13. 
168
169         No new tests. Manually tested on MacBookPro13,3 and iMacPro1,1 with Apple DisplayPort Cinema Display
170         and RX 580 external GPU. 
171
172         * platform/PlatformScreen.h:
173         * platform/ScreenProperties.h:
174         (WebCore::ScreenData::encode const):
175         (WebCore::ScreenData::decode):
176         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
177         (WebCore::setGPUByRegistryID):
178         (WebCore::setGPUByDisplayMask):
179         (WebCore::GraphicsContext3D::GraphicsContext3D):
180         (WebCore::GraphicsContext3D::screenDidChange):
181         (WebCore::identifyAndSetCurrentGPU): Deleted.
182         * platform/mac/PlatformScreenMac.mm:
183         (WebCore::collectScreenProperties):
184         (WebCore::primaryRegistryID):
185         (WebCore::registryIDForDisplay):
186         (WebCore::registryIDForDisplayMask):
187         (WebCore::rendererIDForDisplayMask): Deleted.
188         (WebCore::rendererIDForDisplay): Deleted.
189         (WebCore::primaryRendererID): Deleted.
190
191 2018-07-30  Rob Buis  <rbuis@igalia.com>
192
193         Merge PlatformCookieJar functions into NetworkStorageSession
194         https://bugs.webkit.org/show_bug.cgi?id=188137
195
196         Reviewed by Alex Christensen.
197
198         No new tests -- no change in WebKit functionality.
199
200         * PlatformMac.cmake: Remove CookieJarMac.mm reference
201         * SourcesCocoa.txt: Remove CookieJarMac.mm reference
202         * WebCore.xcodeproj/project.pbxproj:
203         * loader/CookieJar.cpp: Remove PlatformCookieJar.h reference.
204         * platform/Curl.cmake: Remove CookieJarCurl.cpp reference.
205         * platform/SourcesSoup.txt: Remove CookieJarSoup.cpp reference.
206         * platform/network/CacheValidation.cpp: Adapt callsites to use
207         NetworkStorageSession instead of CookieJar functions.
208
209         (WebCore::headerValueForVary):
210         * platform/network/NetworkStorageSession.h: Add PlatformCookieJar
211         functions.
212
213         * platform/network/PlatformCookieJar.h: Removed.
214         * platform/network/SocketStreamHandleImpl.cpp: Adapt callsites to
215         use NetworkStorageSession instead of CookieJar functions.
216         (WebCore::cookieDataForHandshake):
217         * platform/network/cf/CookieJarCFNet.cpp: Removed.
218         * platform/network/cf/NetworkStorageSessionCFNet.cpp: Move functions
219         from CookieJarCFNet.cpp.
220         (WebCore::cookieDomain):
221         (WebCore::canonicalCookieTime):
222         (WebCore::cookieCreatedTime):
223         (WebCore::cookieExpirationTime):
224         (WebCore::cookieName):
225         (WebCore::cookiePath):
226         (WebCore::cookieValue):
227         (WebCore::filterCookies):
228         (WebCore::copyCookiesForURLWithFirstPartyURL):
229         (WebCore::createCookies):
230         (WebCore::NetworkStorageSession::setCookiesFromDOM const):
231         (WebCore::containsSecureCookies):
232         (WebCore::NetworkStorageSession::cookiesForDOM const):
233         (WebCore::NetworkStorageSession::cookieRequestHeaderFieldValue const):
234         (WebCore::NetworkStorageSession::cookiesEnabled const):
235         (WebCore::NetworkStorageSession::getRawCookies const):
236         (WebCore::NetworkStorageSession::deleteCookie const):
237         (WebCore::NetworkStorageSession::getHostnamesWithCookies):
238         (WebCore::NetworkStorageSession::deleteAllCookies):
239         (WebCore::NetworkStorageSession::deleteCookiesForHostnames):
240         (WebCore::NetworkStorageSession::deleteAllCookiesModifiedSince):
241         * platform/network/cocoa/NetworkStorageSessionCocoa.mm: Move functions
242         from CookieJarMac.mm.
243         (WebCore::httpCookies):
244         (WebCore::deleteHTTPCookie):
245         (WebCore::policyProperties):
246         (WebCore::cookiesForURL):
247         (WebCore::setHTTPCookiesForURL):
248         (WebCore::httpCookiesForURL):
249         (WebCore::filterCookies):
250         (WebCore::applyPartitionToCookies):
251         (WebCore::cookiesAreBlockedForURL):
252         (WebCore::cookiesInPartitionForURL):
253         (WebCore::cookiesForSession):
254         (WebCore::deleteAllHTTPCookies):
255         (WebCore::NetworkStorageSession::cookiesForDOM const):
256         (WebCore::NetworkStorageSession::cookieRequestHeaderFieldValue const):
257         (WebCore::NetworkStorageSession::setCookiesFromDOM const):
258         (WebCore::httpCookieAcceptPolicy):
259         (WebCore::NetworkStorageSession::cookiesEnabled const):
260         (WebCore::NetworkStorageSession::getRawCookies const):
261         (WebCore::NetworkStorageSession::deleteCookie const):
262         (WebCore::NetworkStorageSession::getHostnamesWithCookies):
263         (WebCore::NetworkStorageSession::deleteAllCookies):
264         (WebCore::NetworkStorageSession::deleteCookiesForHostnames):
265         (WebCore::NetworkStorageSession::deleteAllCookiesModifiedSince):
266         * platform/network/curl/CookieJarCurl.cpp: Removed.
267         * platform/network/curl/CookieJarCurl.h:
268         * platform/network/curl/NetworkStorageSessionCurl.cpp: Merge functions
269         from CookieJarCurl.cpp.
270         (WebCore::NetworkStorageSession::setCookiesFromDOM const):
271         (WebCore::NetworkStorageSession::cookiesEnabled const):
272         (WebCore::NetworkStorageSession::cookiesForDOM const):
273         (WebCore::NetworkStorageSession::deleteCookie const):
274         (WebCore::NetworkStorageSession::deleteAllCookies):
275         (WebCore::NetworkStorageSession::deleteAllCookiesModifiedSince):
276         (WebCore::NetworkStorageSession::deleteCookiesForHostnames):
277         (WebCore::NetworkStorageSession::getHostnamesWithCookies):
278         (WebCore::NetworkStorageSession::getRawCookies const):
279         (WebCore::NetworkStorageSession::cookieRequestHeaderFieldValue const):
280         * platform/network/mac/CookieJarMac.mm: Removed.
281         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
282         * platform/network/soup/CookieJarSoup.cpp: Removed.
283         * platform/network/soup/NetworkStorageSessionSoup.cpp: Merge functions
284         from CookieJarSoup.cpp.
285         (WebCore::NetworkStorageSession::cookiesEnabled const):
286         (WebCore::httpOnlyCookieExists):
287         (WebCore::NetworkStorageSession::setCookiesFromDOM const):
288         (WebCore::NetworkStorageSession::deleteCookie const):
289         (WebCore::NetworkStorageSession::deleteAllCookies):
290         (WebCore::NetworkStorageSession::deleteAllCookiesModifiedSince):
291         (WebCore::NetworkStorageSession::deleteCookiesForHostnames):
292         (WebCore::NetworkStorageSession::getHostnamesWithCookies):
293         (WebCore::NetworkStorageSession::getRawCookies const):
294         (WebCore::cookiesForSession):
295         (WebCore::NetworkStorageSession::cookiesForDOM const):
296         (WebCore::NetworkStorageSession::cookieRequestHeaderFieldValue const):
297
298 2018-07-30  Chris Dumez  <cdumez@apple.com>
299
300         Nullptr crash accessing Document in GenericEventQueue::dispatchOneEvent()
301         https://bugs.webkit.org/show_bug.cgi?id=187284
302
303         Unreviewed, roll r233496 and r233571 now that all known issues have been fixed via
304         dependency bugs.
305
306         Test: media/track/video-track-addition-and-frame-removal.html
307
308         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
309         (WebCore::WebKitMediaKeySession::suspend):
310         (WebCore::WebKitMediaKeySession::resume):
311         (WebCore::WebKitMediaKeySession::stop):
312         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.h:
313         * Modules/mediasource/MediaSource.cpp:
314         (WebCore::MediaSource::removeSourceBuffer):
315         (WebCore::MediaSource::suspend):
316         (WebCore::MediaSource::resume):
317         * Modules/mediasource/MediaSource.h:
318         * Modules/mediasource/SourceBuffer.cpp:
319         (WebCore::SourceBuffer::suspend):
320         (WebCore::SourceBuffer::resume):
321         (WebCore::SourceBuffer::stop):
322         * Modules/mediasource/SourceBuffer.h:
323         * Modules/mediasource/SourceBufferList.cpp:
324         (WebCore::SourceBufferList::SourceBufferList):
325         (WebCore::SourceBufferList::canSuspendForDocumentSuspension const):
326         (WebCore::SourceBufferList::suspend):
327         (WebCore::SourceBufferList::resume):
328         (WebCore::SourceBufferList::stop):
329         (WebCore::SourceBufferList::activeDOMObjectName const):
330         * Modules/mediasource/SourceBufferList.h:
331         * Modules/mediasource/SourceBufferList.idl:
332         * dom/Document.h:
333         (WebCore::Document::hasBrowsingContext const):
334         * dom/GenericEventQueue.cpp:
335         (WebCore::GenericEventQueue::dispatchOneEvent):
336         * html/HTMLMediaElement.cpp:
337         (WebCore::HTMLMediaElement::prepareForLoad):
338         (WebCore::HTMLMediaElement::selectMediaResource):
339         (WebCore::HTMLMediaElement::prepareToPlay):
340         (WebCore::HTMLMediaElement::playInternal):
341         (WebCore::HTMLMediaElement::pauseInternal):
342         (WebCore::HTMLMediaElement::sourceWasAdded):
343         * html/track/AudioTrackList.cpp:
344         (AudioTrackList::activeDOMObjectName const):
345         * html/track/AudioTrackList.h:
346         * html/track/AudioTrackList.idl:
347         * html/track/TextTrackList.cpp:
348         (TextTrackList::activeDOMObjectName const):
349         * html/track/TextTrackList.h:
350         * html/track/TextTrackList.idl:
351         * html/track/TrackListBase.cpp:
352         (WebCore::TrackListBase::TrackListBase):
353         (WebCore::TrackListBase::canSuspendForDocumentSuspension const):
354         (WebCore::TrackListBase::suspend):
355         (WebCore::TrackListBase::resume):
356         (WebCore::TrackListBase::stop):
357         * html/track/TrackListBase.h:
358         * html/track/VideoTrackList.cpp:
359         (VideoTrackList::activeDOMObjectName const):
360         * html/track/VideoTrackList.h:
361         * html/track/VideoTrackList.idl:
362
363 2018-07-30  Chris Dumez  <cdumez@apple.com>
364
365         Unreviewed internal build fix after r234347.
366
367         * html/StepRange.cpp:
368         (WebCore::StepRange::StepRange):
369
370 2018-07-29  Simon Fraser  <simon.fraser@apple.com>
371
372         Shrink GraphicsLayer by making m_transform and m_childrenTransform be unique_ptrs
373         https://bugs.webkit.org/show_bug.cgi?id=188143
374
375         Reviewed by Zalan Bujtas.
376
377         m_transform and m_childrenTransform are usually identity; save space by making
378         these unique_ptrs. The getters still return references by returning a reference
379         to a NeverDestroyed<TransformationMatrix> if necessary.
380         
381         Shrinks GraphicsLayerCA from 840 to 640 bytes.
382
383         * platform/graphics/GraphicsLayer.cpp:
384         (WebCore::identityTransform):
385         (WebCore::GraphicsLayer::transform const):
386         (WebCore::GraphicsLayer::setTransform):
387         (WebCore::GraphicsLayer::childrenTransform const):
388         (WebCore::GraphicsLayer::setChildrenTransform):
389         (WebCore::GraphicsLayer::dumpProperties const):
390         * platform/graphics/GraphicsLayer.h:
391         (WebCore::GraphicsLayer::hasNonIdentityTransform const):
392         (WebCore::GraphicsLayer::hasNonIdentityChildrenTransform const):
393         (WebCore::GraphicsLayer::transform const): Deleted.
394         (WebCore::GraphicsLayer::setTransform): Deleted.
395         (WebCore::GraphicsLayer::childrenTransform const): Deleted.
396         (WebCore::GraphicsLayer::setChildrenTransform): Deleted.
397         (WebCore::GraphicsLayer::hasFlattenedPerspectiveTransform): Deleted. It was unused.
398         * platform/graphics/ca/GraphicsLayerCA.cpp:
399         (WebCore::GraphicsLayerCA::setTransform):
400         (WebCore::GraphicsLayerCA::setChildrenTransform):
401         (WebCore::GraphicsLayerCA::layerTransform const):
402         (WebCore::GraphicsLayerCA::updateTransform):
403         (WebCore::GraphicsLayerCA::updateChildrenTransform):
404         (WebCore::GraphicsLayerCA::removeCAAnimationFromLayer):
405
406 2018-07-30  Thibault Saunier  <tsaunier@igalia.com>
407
408         [GStreamer] Make codecparsers optionnal
409         https://bugs.webkit.org/show_bug.cgi?id=188010
410
411         And avoid building libWebRTC if it won't be used. While there is no other
412         WebRTC backend, it makes no sense to expose an option.
413
414         Error out when WEBRTC or MEDIA_STREAM is enabled but GStreamer < 1.10
415
416         Reviewed by Alejandro G. Castro.
417
418         * platform/GStreamer.cmake:
419
420 2018-07-28  Darin Adler  <darin@apple.com>
421
422         [Cocoa] Update more WebCore Objective-C code to be ARC compatible
423         https://bugs.webkit.org/show_bug.cgi?id=188140
424
425         Reviewed by Sam Weinig.
426
427         This make sure we don't put any Objective-C objects into HashMap/Set
428         data structures, which doesn't work under ARC at this time. We could
429         fix that some day, but it's pretty simple to change code not to rely
430         on it, for now, and not as simple to support it in HashMap/Set.
431
432         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
433         (-[WebAccessibilityObjectWrapperBase updateObjectBackingStore]):
434         Use CFRetain/CFAutorelease instead of retain/autorelease.
435
436         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
437         (createAccessibilityRoleMap): Use CFStringRef in a HashMap rather than
438         NSString * for string constants.
439         (roleValueToNSString): Updated for above change.
440
441         * bridge/objc/WebScriptObject.mm:
442         (-[WebScriptObject stringRepresentation]): Updated since objectValue
443         is now CFTypeRef rather than NSObject *.
444
445         * bridge/objc/objc_instance.mm:
446         (ObjcInstance::create): Use CFTypeRef instead of id for the key types
447         in a HashMap.
448         (ObjcInstance::~ObjcInstance): Updated for the above change.
449         (ObjcInstance::invokeObjcMethod): Updated since objectValue is now
450         CFTypeRef.
451         (ObjcInstance::invokeDefaultMethod): Ditto.
452         (ObjcInstance::setValueOfUndefinedField): Ditto.
453         * bridge/objc/objc_runtime.mm:
454         (JSC::Bindings::ObjcArray::setValueAt const): Ditto.
455
456         * bridge/objc/objc_utility.h: Use #pragma once. Use CFTypeRef instead
457         of NSObject * for objectValue, since it's in a union and ARC does not
458         support strong Objective-C object pointers in a union.
459
460         * bridge/objc/objc_utility.mm:
461         (JSC::Bindings::convertValueToObjcValue): Updated since objectValue is
462         now CFTypeRef.
463
464         * editing/cocoa/HTMLConverter.mm:
465         (HTMLConverter::_processElement): Use CFTypeRef rather than NSTextTable
466         for a HashMap.
467         (HTMLConverter::_exitElement): Ditto.
468
469         * editing/cocoa/WebContentReaderCocoa.mm:
470         (WebCore::attributesForAttributedStringConversion): Use CFRetain rather
471         than -[NSObject retain] in a workaround for an overrelease.
472
473         * editing/mac/DictionaryLookup.h: Removed code to make this usable from
474         non-Objective-C source files. Use tuples rather than out arguments
475         for the results of the various functions.
476
477         * editing/mac/DictionaryLookup.mm:
478         (WebCore::DictionaryLookup::rangeForSelection): Return a tuple rather
479         than using an out argument for options.
480         (WebCore::DictionaryLookup::rangeAtHitTestResult): Ditto.
481         (WebCore::DictionaryLookup::stringForPDFSelection): Ditto.
482         (WebCore::showPopupOrCreateAnimationController): Removed use of typedef
483         PlatformAnimationController.
484         (WebCore::DictionaryLookup::animationControllerForPopup): Ditto.
485
486         * html/HTMLMediaElement.h: Put the videoFullscreenLayer function inside
487         an __OBJC__ ifdef since we can't do the type conversion without the
488         full Objective-C type.
489
490         * page/mac/EventHandlerMac.mm:
491         (WebCore::selfRetainingNSScrollViewScrollWheel): Use CFRetain/CFRelease
492         instead of retain/release.
493         (WebCore::EventHandler::selectClosestWordFromHitTestResultBasedOnLookup):
494         Updated to use tuple return value from DictionaryLookup.
495
496         * page/scrolling/ScrollingStateNode.h: Replaced direct use of PlatformLayer*
497         in a union with use of a "typless" void* pointer and added helper functions
498         to convert in both directions.
499         * page/scrolling/cocoa/ScrollingStateNode.mm:
500         (WebCore::LayerRepresentation::retainPlatformLayer): Use CFRetain instead
501         of retain.
502         (WebCore::LayerRepresentation::releasePlatformLayer): Use CFRelease instead
503         of release.
504         (WebCore::LayerRepresentation::makePlatformLayerTyped): Added.
505         (WebCore::LayerRepresentation::makePlatformLayerTypeless): Ditto.
506         * page/scrolling/coordinatedgraphics/ScrollingStateNodeCoordinatedGraphics.cpp:
507         (WebCore::LayerRepresentation::retainPlatformLayer): Updated argument type.
508         (WebCore::LayerRepresentation::releasePlatformLayer): Ditto.
509         (WebCore::LayerRepresentation::makePlatformLayerTyped): Added.
510         (WebCore::LayerRepresentation::makePlatformLayerTypeless): Ditto.
511
512         * platform/gamepad/cocoa/GameControllerGamepadProvider.h: Use CFTypeRef
513         instad of GCController * for key type of HashMap.
514         * platform/gamepad/cocoa/GameControllerGamepadProvider.mm:
515         (WebCore::GameControllerGamepadProvider::controllerDidConnect): Updated
516         for the above change.
517         (WebCore::GameControllerGamepadProvider::controllerDidDisconnect): Ditto.
518
519         * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
520         Use SOFT_LINK_CONSTANT_MAY_FAIL instead of SOFT_LINK_POINTER_OPTIONAL for
521         strings, since SOFT_LINK_POINTER_OPTIONAL does not work for Objective-C
522         types under ARC.
523         (WebCore::AVTrackPrivateAVFObjCImpl::audioKind const): Added checks
524         for the constants.
525         (WebCore::AVTrackPrivateAVFObjCImpl::videoKind const): Ditto.
526         (WebCore::AVTrackPrivateAVFObjCImpl::label const): Ditto.
527
528         * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.h:
529         Use #pragma once and use CFTypeRef instead of AVMediaSelectionOption *
530         in the key to a HashMap.
531         * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm:
532         (WebCore::MediaSelectionGroupAVFObjC::updateOptions): Updated for
533         the above change.
534
535         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
536         Use SOFT_LINK_CONSTANT_MAY_FAIL instead of SOFT_LINK_POINTER_OPTIONAL for
537         strings, since SOFT_LINK_POINTER_OPTIONAL does not work for Objective-C
538         types under ARC.
539         (WebCore::customSchemeURL): Removed unnecessary use of
540         NeverDestroyed<RetainPtr>. Can just use a straight pointer without calling
541         release, and that works with or without ARC.
542         (WebCore::imageDecoderAssetOptions): Ditto. Here, had to add a retain,
543         which we'll remove when we turn on ARC. Added canLoad checks, needed
544         because of SOFT_LINK_CONSTANT_MAY_FAIL.
545         (WebCore::ImageDecoderAVFObjC::firstEnabledTrack): Added canLoad check,
546         needed because of SOFT_LINK_CONSTANT_MAY_FAIL.
547
548         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
549         Use CFTypeRef instead of AVAssetResourceLoadingRequest in HashMap.
550         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
551         (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource):
552         Updated for above.
553         (WebCore::MediaPlayerPrivateAVFoundationObjC::didCancelLoadingRequest): Ditto.
554         (WebCore::MediaPlayerPrivateAVFoundationObjC::didStopLoadingRequest): Ditto.
555
556         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
557         Use CFTypeRef instead of AVSampleBufferAudioRenderer in HashMap.
558         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
559         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVolume): Updated for above.
560         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setMuted): Ditto.
561         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setPreservesPitch): Ditto.
562         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setHasAvailableAudioSample): Ditto.
563         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::addAudioRenderer): Ditto.
564         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::removeAudioRenderer): Ditto.
565
566         * platform/graphics/metal/GPUDrawableMetal.mm: Updated include; under ARC, it's
567         not safe to call a method on a class without seeing its interface.
568
569         * platform/mac/VideoFullscreenInterfaceMac.mm: Added an explicit
570         __unsafe_unretained for a delegate. Could consider moving to weak, but for now
571         this preserves the current behavior and compiles under ARC.
572
573         * platform/mac/WebCoreFullScreenPlaceholderView.h: Use strong for the contents,
574         weak for the target, and changed the action to be hard-coded instead of an
575         arbitrary selector. If we find we need the flexibility again later, we can do
576         it with a block, which is more ARC-friendly than calling an arbitrary selector.
577         * platform/mac/WebCoreFullScreenPlaceholderView.mm:
578         (-[WebCoreFullScreenPlaceholderView initWithFrame:]): Call function directly
579         instead of taking advantage of "using".
580         (-[WebCoreFullScreenPlaceholderView mouseDown:]): Call cancelOperation: on the
581         target rather than performing an arbitrary selector.
582
583         * platform/mac/WebCoreObjCExtras.mm:
584         (WebCoreObjCScheduleDeallocateOnMainThread): Use sel_registerName instead of
585         @selector, since @selector is not supported under ARC.
586
587         * platform/network/ResourceHandle.h: Use a return value rather than using an
588         inout argument in applySniffingPoliciesAndStoragePartitionIfNeeded.
589
590         * platform/network/cocoa/CookieStorageObserver.mm:
591         (WebCore::CookieStorageObserver::startObserving): Removed unnecessary
592         assertion of repondsToSelector since we are about to dispatch it immediately
593         after. Call the selector in the conventional way instead of using performSelector.
594
595         * platform/network/cocoa/WebCoreNSURLSession.h: Use #pragma once and use
596         CFTypeRef instead of an Objective-C type. Also use an explicit __unsafe_unretained
597         for the session in the data task.
598         * platform/network/cocoa/WebCoreNSURLSession.mm:
599         (-[WebCoreNSURLSession dealloc]): Updated for the above.
600         (-[WebCoreNSURLSession taskCompleted:]): Ditto.
601         (-[WebCoreNSURLSession invalidateAndCancel]): Ditto.
602         (-[WebCoreNSURLSession getTasksWithCompletionHandler:]): Ditto.
603         (-[WebCoreNSURLSession getAllTasksWithCompletionHandler:]): Ditto.
604         (-[WebCoreNSURLSession dataTaskWithRequest:]): Ditto.
605         (-[WebCoreNSURLSession dataTaskWithURL:]): Ditto.
606
607         * platform/network/mac/ResourceHandleMac.mm:
608         (WebCore::ResourceHandle::applySniffingPoliciesAndStoragePartitionIfNeeded):
609         Use a return value instead of an inout argument. Also use bridging casts.
610         (WebCore::ResourceHandle::createNSURLConnection): Updated for the change above.
611         Also use a bridging cast.
612         (WebCore::ResourceHandle::schedule): Use a bridging cast.
613         (WebCore::ResourceHandle::unschedule): Ditto.
614
615         * platform/network/mac/WebCoreURLResponse.mm:
616         (WebCore::adjustMIMETypeIfNecessary): Use a bridging cast.
617
618         * testing/Internals.cpp:
619         (WebCore::Internals::rangeForDictionaryLookupAtLocation): Moved the macOS
620         version of this function out of this file ...
621         * testing/Internals.mm:
622         (WebCore::Internals::rangeForDictionaryLookupAtLocation): ... to here.
623
624 2018-07-29  Yusuke Suzuki  <utatane.tea@gmail.com>
625
626         Use static global variables instead of static NeverDestroyed inside function if possible
627         https://bugs.webkit.org/show_bug.cgi?id=188146
628
629         Reviewed by Darin Adler.
630
631         This patch leverages constexpr constructors / trivial destructors more to remove unnecessary `static NeverDestroyed`
632         inside a function. It simplifies the code, removes the unnecessary function, and ensures the initialization at
633         a program loader phase.
634
635         We make StepRange::StepDescription constructor constexpr to remove bunch of `static NeverDestroyed<const StepRange::StepDescription>`.
636         And we use `static Lock` since WTF::Lock has constexpr constructor.
637
638         No behavior change.
639
640         * dom/MessagePort.cpp:
641         (WebCore::MessagePort::deref const):
642         (WebCore::MessagePort::isExistingMessagePortLocallyReachable):
643         (WebCore::MessagePort::notifyMessageAvailable):
644         (WebCore::MessagePort::MessagePort):
645         (WebCore::MessagePort::~MessagePort):
646         (WebCore::allMessagePortsLock): Deleted.
647         * dom/ScriptExecutionContext.cpp:
648         (WebCore::ScriptExecutionContext::contextIdentifier const):
649         (WebCore::ScriptExecutionContext::removeFromContextsMap):
650         (WebCore::ScriptExecutionContext::~ScriptExecutionContext):
651         (WebCore::ScriptExecutionContext::postTaskTo):
652         (WebCore::allScriptExecutionContextsMapLock): Deleted.
653         * html/DateInputType.cpp:
654         (WebCore::DateInputType::createStepRange const):
655         * html/DateTimeInputType.cpp:
656         (WebCore::DateTimeInputType::createStepRange const):
657         * html/DateTimeLocalInputType.cpp:
658         (WebCore::DateTimeLocalInputType::createStepRange const):
659         * html/MonthInputType.cpp:
660         (WebCore::MonthInputType::createStepRange const):
661         * html/RangeInputType.cpp:
662         (WebCore::RangeInputType::createStepRange const):
663         * html/StepRange.h:
664         (WebCore::StepRange::StepDescription::StepDescription):
665         * html/TimeInputType.cpp:
666         (WebCore::TimeInputType::createStepRange const):
667         * html/WeekInputType.cpp:
668         (WebCore::WeekInputType::createStepRange const):
669         * page/SecurityPolicy.cpp:
670         (WebCore::originAccessMap):
671         (WebCore::SecurityPolicy::isAccessWhiteListed):
672         (WebCore::SecurityPolicy::addOriginAccessWhitelistEntry):
673         (WebCore::SecurityPolicy::removeOriginAccessWhitelistEntry):
674         (WebCore::SecurityPolicy::resetOriginAccessWhitelists):
675         (WebCore::originAccessMapLock): Deleted.
676         * platform/SchemeRegistry.cpp:
677         (WebCore::allBuiltinSchemes):
678         (WebCore::builtinLocalURLSchemes):
679         (WebCore::localURLSchemes):
680         (WebCore::displayIsolatedURLSchemes):
681         (WebCore::builtinSecureSchemes):
682         (WebCore::secureSchemes):
683         (WebCore::builtinSchemesWithUniqueOrigins):
684         (WebCore::schemesWithUniqueOrigins):
685         (WebCore::builtinCanDisplayOnlyIfCanRequestSchemes):
686         (WebCore::canDisplayOnlyIfCanRequestSchemes):
687         (WebCore::SchemeRegistry::registerURLSchemeAsLocal):
688         (WebCore::SchemeRegistry::removeURLSchemeRegisteredAsLocal):
689         (WebCore::ContentSecurityPolicyBypassingSchemes):
690         (WebCore::cachePartitioningSchemes):
691         (WebCore::serviceWorkerSchemes):
692         (WebCore::SchemeRegistry::shouldTreatURLSchemeAsLocal):
693         (WebCore::SchemeRegistry::registerURLSchemeAsNoAccess):
694         (WebCore::SchemeRegistry::shouldTreatURLSchemeAsNoAccess):
695         (WebCore::SchemeRegistry::registerURLSchemeAsDisplayIsolated):
696         (WebCore::SchemeRegistry::shouldTreatURLSchemeAsDisplayIsolated):
697         (WebCore::SchemeRegistry::registerURLSchemeAsSecure):
698         (WebCore::SchemeRegistry::shouldTreatURLSchemeAsSecure):
699         (WebCore::SchemeRegistry::canDisplayOnlyIfCanRequest):
700         (WebCore::SchemeRegistry::registerAsCanDisplayOnlyIfCanRequest):
701         (WebCore::SchemeRegistry::registerURLSchemeAsBypassingContentSecurityPolicy):
702         (WebCore::SchemeRegistry::removeURLSchemeRegisteredAsBypassingContentSecurityPolicy):
703         (WebCore::SchemeRegistry::schemeShouldBypassContentSecurityPolicy):
704         (WebCore::SchemeRegistry::registerURLSchemeAsCachePartitioned):
705         (WebCore::SchemeRegistry::shouldPartitionCacheForURLScheme):
706         (WebCore::SchemeRegistry::registerURLSchemeServiceWorkersCanHandle):
707         (WebCore::SchemeRegistry::canServiceWorkersHandleURLScheme):
708         (WebCore::SchemeRegistry::isServiceWorkerContainerCustomScheme):
709         (WebCore::schemeRegistryLock): Deleted.
710
711 2018-07-29  Basuke Suzuki  <Basuke.Suzuki@sony.com>
712
713         [Curl] Fix the bug when client reject the redirect on WebKitLegacy.
714         https://bugs.webkit.org/show_bug.cgi?id=188130
715
716         Reviewed by Darin Adler.
717
718         ResourceHandle for Curl port has a bug when a client returns en empty request which
719         indicates the redirecti is rejected by the client. It should be quit the task immediately,
720         but it kept doing the job. Fixed.
721         NetworkDataTask implementation did the right thing and there's no bug for them. 
722
723         Test: http/tests/xmlhttprequest/xmlhttprequest-unsafe-redirect-expected.txt
724
725         * platform/network/curl/ResourceHandleCurl.cpp:
726         (WebCore::ResourceHandle::continueAfterWillSendRequest):
727
728 2018-07-28  Simon Fraser  <simon.fraser@apple.com>
729
730         Reset CompositingPolicyOverride between tests
731         https://bugs.webkit.org/show_bug.cgi?id=188138
732
733         Reviewed by Zalan Bujtas.
734
735         WK1 tests were failing after r234330 because the compositing policy override optional
736         was left set on the Page (WK1 has injected bundle SPI to clear it). Fix by having 
737         Internals::resetToConsistentState clear this state.
738
739         * testing/Internals.cpp:
740         (WebCore::Internals::resetToConsistentState):
741
742 2018-07-24  Simon Fraser  <simon.fraser@apple.com>
743
744         Animation stops with object-fit:contain on an animated 2d canvas
745         https://bugs.webkit.org/show_bug.cgi?id=187840
746
747         Reviewed by Zalan Bujtas.
748         
749         If a canvas has object-fit: cover or contain, repaints need to mapped through
750         the rect that is used to position the canvas in the element bounds, which is replacedContentRect().
751         
752         Add a version of replacedContentRect() that doesn't require passing the intrinsicSize() since
753         all but RenderVideo just pass the RenderReplaced's intrinsicSize.
754
755         Test: fast/repaint/canvas-object-fit.html
756
757         * html/HTMLCanvasElement.cpp:
758         (WebCore::HTMLCanvasElement::didDraw):
759         * rendering/RenderHTMLCanvas.cpp:
760         (WebCore::RenderHTMLCanvas::paintReplaced):
761         * rendering/RenderImage.cpp:
762         (WebCore::RenderImage::updateInnerContentRect):
763         (WebCore::RenderImage::paintReplaced):
764         * rendering/RenderLayerBacking.cpp:
765         (WebCore::RenderLayerBacking::contentsBox const):
766         * rendering/RenderReplaced.h:
767         (WebCore::RenderReplaced::replacedContentRect const):
768         * rendering/shapes/ShapeOutsideInfo.cpp:
769         (WebCore::ShapeOutsideInfo::createShapeForImage const):
770
771 2018-07-27  Simon Fraser  <simon.fraser@apple.com>
772
773         Adjust the color matrix for the inverse apple-invert-lightness() transformation
774         https://bugs.webkit.org/show_bug.cgi?id=188131
775         rdar://problem/42673070
776
777         Reviewed by Zalan Bujtas.
778
779         Use the correct inverse matrix values.
780
781         Test: editing/style/inverse-color-filter.html
782
783         * platform/graphics/filters/FilterOperation.cpp:
784         (WebCore::InvertLightnessFilterOperation::inverseTransformColor const):
785
786 2018-07-27  Eric Carlson  <eric.carlson@apple.com>
787
788         [iOS] Don't deactivate audio session
789         https://bugs.webkit.org/show_bug.cgi?id=188127
790         <rdar://problem/42544143>
791
792         Reviewed by Jon Lee.
793         
794         r233435 includes a change that deactivates the shared audio session when there are no more
795         active media sessions. This is a good in WK2 because it allows other applications to resume
796         playing audio when WebKit stops playing, but it is potentially bad in WK1 where the host
797         app may also be playing audio.
798
799         * platform/audio/PlatformMediaSessionManager.cpp:
800         (WebCore::PlatformMediaSessionManager::removeSession): Don't deactivate the audio session.
801
802 2018-07-27  Chris Dumez  <cdumez@apple.com>
803
804         Fix thread-safety issues related to RealtimeMediaSource::audioSamplesAvailable()
805         https://bugs.webkit.org/show_bug.cgi?id=188097
806         <rdar://problem/42558823>
807
808         Reviewed by Eric Carlson.
809
810         Fix thread-safety issues related to RealtimeMediaSource::audioSamplesAvailable(). RealtimeMediaSource::audioSamplesAvailable()
811         is called on a background thread but iterates over observers that may get destroyed concurrently on the main thread.
812
813         To address the issue:
814         - Introduce a Lock to protect m_observer accesses
815         - Copy observers to a Vector before iterating over them
816
817         * platform/mediastream/MediaStreamTrackPrivate.cpp:
818         (WebCore::MediaStreamTrackPrivate::forEachObserver const):
819         (WebCore::MediaStreamTrackPrivate::addObserver):
820         (WebCore::MediaStreamTrackPrivate::removeObserver):
821         (WebCore::MediaStreamTrackPrivate::setEnabled):
822         (WebCore::MediaStreamTrackPrivate::endTrack):
823         (WebCore::MediaStreamTrackPrivate::sourceStarted):
824         (WebCore::MediaStreamTrackPrivate::sourceStopped):
825         (WebCore::MediaStreamTrackPrivate::sourceMutedChanged):
826         (WebCore::MediaStreamTrackPrivate::sourceSettingsChanged):
827         (WebCore::MediaStreamTrackPrivate::videoSampleAvailable):
828         (WebCore::MediaStreamTrackPrivate::audioSamplesAvailable):
829         (WebCore::MediaStreamTrackPrivate::updateReadyState):
830         * platform/mediastream/MediaStreamTrackPrivate.h:
831         (WebCore::MediaStreamTrackPrivate::Observer::sampleBufferUpdated):
832         (WebCore::MediaStreamTrackPrivate::Observer::audioSamplesAvailable):
833         * platform/mediastream/RealtimeMediaSource.cpp:
834         (WebCore::RealtimeMediaSource::addObserver):
835         (WebCore::RealtimeMediaSource::removeObserver):
836         (WebCore::RealtimeMediaSource::forEachObserver const):
837         (WebCore::RealtimeMediaSource::notifyMutedObservers const):
838         (WebCore::RealtimeMediaSource::settingsDidChange):
839         (WebCore::RealtimeMediaSource::videoSampleAvailable):
840         (WebCore::RealtimeMediaSource::audioSamplesAvailable):
841         (WebCore::RealtimeMediaSource::start):
842         (WebCore::RealtimeMediaSource::requestStop):
843         (WebCore::RealtimeMediaSource::captureFailed):
844         * platform/mediastream/RealtimeMediaSource.h:
845         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
846         (WebCore::AudioTrackPrivateMediaStreamCocoa::audioSamplesAvailable):
847         * platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.cpp:
848         * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm:
849
850 2018-07-27  Alex Christensen  <achristensen@webkit.org>
851
852         Don't include WebPageProxy.h just for UndoOrRedo
853         https://bugs.webkit.org/show_bug.cgi?id=188086
854
855         Reviewed by Saam Barati.
856
857         * platform/DragItem.h:
858
859 2018-07-27  Alex Christensen  <achristensen@webkit.org>
860
861         Make CompletionHandler more const correct
862         https://bugs.webkit.org/show_bug.cgi?id=186543
863
864         Reviewed by Saam Barati.
865
866         * dom/messageports/MessagePortChannel.cpp:
867         (WebCore::MessagePortChannel::checkRemotePortForActivity):
868         * dom/messageports/MessagePortChannelProviderImpl.cpp:
869         (WebCore::MessagePortChannelProviderImpl::checkRemotePortForActivity):
870         * loader/DocumentLoader.cpp:
871         (WebCore::DocumentLoader::responseReceived):
872         * loader/FrameLoader.cpp:
873         (WebCore::FrameLoader::loadURL):
874         (WebCore::FrameLoader::loadWithDocumentLoader):
875         (WebCore::FrameLoader::loadPostRequest):
876         * platform/network/cocoa/WebCoreNSURLSession.mm:
877         (WebCore::WebCoreNSURLSessionDataTaskClient::redirectReceived):
878         * workers/service/server/RegistrationDatabase.cpp:
879         (WebCore::RegistrationDatabase::pushChanges):
880         (WebCore::RegistrationDatabase::clearAll):
881         * workers/service/server/SWServer.cpp:
882         (WebCore::SWServer::matchAll):
883         * workers/service/server/SWServer.h:
884         * workers/service/server/SWServerWorker.cpp:
885         (WebCore::SWServerWorker::matchAll):
886         * workers/service/server/SWServerWorker.h:
887
888 2018-07-27  Simon Fraser  <simon.fraser@apple.com>
889
890         Be more conservative with compositing layer creation when memory is low
891         https://bugs.webkit.org/show_bug.cgi?id=187866
892         rdar://problem/42366345
893
894         Reviewed by Zalan Bujtas.
895         
896         When process physical footprint is above a fraction of the jetsam limit, be more conservative in making
897         compositing layers. We avoid compositing for these situations:
898         1. Layers with 3D transforms which are affine (like translateZ(0)).
899         2. Layers with will-change
900         3. Layers for canvases (other than WebGL/WebGPU)
901         
902         We reuse some macOS code in MemoryPressureHandler() but choose different thresholds for iOS,
903         falling into "conservative mode" at 50% of jetsam limit, and "strict mode" at 65%.
904         Compositing chooses to be more conservative in either "conservative" or "strict" memory modes.
905         
906         Plumb through a "compositingPolicyOverride" both so that on-device testing isn't
907         flakily falling into a different mode, and so that we can impose the conservative
908         mode for testing.
909
910         Test: compositing/layer-creation/compositing-policy.html
911
912         * page/Page.h:
913         (WebCore::Page::compositingPolicyOverride const):
914         (WebCore::Page::setCompositingPolicyOverride):
915         * platform/graphics/transforms/Matrix3DTransformOperation.cpp:
916         (WebCore::Matrix3DTransformOperation::isRepresentableIn2D const):
917         * platform/graphics/transforms/Matrix3DTransformOperation.h:
918         * platform/graphics/transforms/PerspectiveTransformOperation.h:
919         * platform/graphics/transforms/RotateTransformOperation.h:
920         * platform/graphics/transforms/ScaleTransformOperation.h:
921         * platform/graphics/transforms/TransformOperation.h:
922         (WebCore::TransformOperation::isRepresentableIn2D const):
923         * platform/graphics/transforms/TransformOperations.h:
924         (WebCore::TransformOperations::has3DOperation const):
925         (WebCore::TransformOperations::isRepresentableIn2D const):
926         * platform/graphics/transforms/TranslateTransformOperation.h:
927         * rendering/RenderLayerBacking.cpp:
928         (WebCore::RenderLayerBacking::updateGeometry):
929         * rendering/RenderLayerCompositor.cpp:
930         (WebCore::RenderLayerCompositor::cacheAcceleratedCompositingFlags):
931         (WebCore::RenderLayerCompositor::updateCompositingPolicy):
932         (WebCore::RenderLayerCompositor::updateCompositingLayers):
933         (WebCore::RenderLayerCompositor::requiresCompositingForTransform const):
934         (WebCore::RenderLayerCompositor::requiresCompositingForVideo const):
935         (WebCore::RenderLayerCompositor::requiresCompositingForCanvas const):
936         (WebCore::RenderLayerCompositor::requiresCompositingForPlugin const):
937         (WebCore::RenderLayerCompositor::requiresCompositingForWillChange const):
938         (WebCore::RenderLayerCompositor::needsFixedRootBackgroundLayer const):
939         (WebCore::operator<<):
940         * rendering/RenderLayerCompositor.h:
941         * testing/Internals.cpp:
942         (WebCore::Internals::setCompositingPolicyOverride):
943         (WebCore::Internals::compositingPolicyOverride const):
944         * testing/Internals.h:
945         * testing/Internals.idl:
946
947 2018-07-27  Zalan Bujtas  <zalan@apple.com>
948
949         [WK1] ASSERTION FAILED: renderer().repaintLayoutRects().m_repaintRect == renderer().clippedOverflowRectForRepaint(renderer().containerForRepaint()) in WebCore::RenderLayer::updateLayerPositionsAfterScroll
950         https://bugs.webkit.org/show_bug.cgi?id=188122
951         <rdar://problem/42584790>
952
953         Reviewed by Simon Fraser.
954
955         When ScrollView's m_paintsEntireContents flag flips due to layer backing changes, the repaint area transitions from
956         visual to layout overflow. When this happens the cached repaint rects become invalid and they need to be recomputed.
957         Currently there's no mechanism to trigger repaint cache invalidation from ScrollView.
958         Skip assertion for now on WK1 (see webkit.org/b/188121)
959
960         * rendering/RenderLayer.cpp:
961         (WebCore::RenderLayer::updateLayerPositionsAfterScroll):
962
963 2018-07-27  Myles C. Maxfield  <mmaxfield@apple.com>
964
965         [WIN] Crash when trying to access store pages
966         https://bugs.webkit.org/show_bug.cgi?id=188032
967         <rdar://problem/42467016>
968
969         Reviewed by Brent Fulgham.
970
971         The Windows implementation of GlyphBuffer has an additional member, m_offsets, which represents
972         an additional offset to the position to paint each glyph. It also has two add() functions, one
973         which appends to this vector, and one which doesn't. The one that doesn't append to the vector
974         should never be called on Windows (because Windows requires this vector to be full).
975
976         There were two situations where it was getting called:
977         1) Inside ComplexTextController
978         2) Inside display list playback
979
980         Windows shouldn't be using ComplexTextController because the Windows implementation of this 
981         class isn't ready yet; instead it should be using UniscribeController. The display list playback
982         code should be used on Windows.
983
984         Rather than fix the function to append an offset, we actually don't need the m_offsets vector
985         in the first place. Instead, we can do it the same way that the Cocoa ports do it, which is to
986         bake the offsets into the glyph advances. This is possible because the GlyphBuffer doesn't need
987         to distinguish between layout advances and paint advances, so we can bake them together and
988         just put paint advances in the GlyphBuffer. This should be a small (probably within-the-noise)
989         performance and memory improvement.
990
991         * platform/graphics/ComplexTextController.cpp:
992         (WebCore::ComplexTextController::ComplexTextController): Make sure that ComplexTextController
993         isn't used on Windows.
994         * platform/graphics/FontCascade.cpp:
995         (WebCore::FontCascade::widthOfTextRange const): Switch from ComplexTextController to
996         UniscribeController on Windows.
997         (WebCore::FontCascade::drawGlyphBuffer const): After deleting the m_offsets vector, there's
998         no reason to consult it when drawing.
999         * platform/graphics/GlyphBuffer.h: Remove m_offsets
1000         (WebCore::GlyphBuffer::clear):
1001         (WebCore::GlyphBuffer::advanceAt const):
1002         (WebCore::GlyphBuffer::add):
1003         (WebCore::GlyphBuffer::expandLastAdvance):
1004         (WebCore::GlyphBuffer::shrink):
1005         (WebCore::GlyphBuffer::swap):
1006         (WebCore::GlyphBuffer::offsetAt const): Deleted.
1007         * platform/graphics/win/FontCGWin.cpp:
1008         (WebCore::FontCascade::drawGlyphs): After deleting the m_offsets vector, there's no reason
1009         to consult it when drawing.
1010         * platform/graphics/win/FontCascadeDirect2D.cpp:
1011         (WebCore::FontCascade::drawGlyphs): Ditto.
1012         * platform/graphics/win/UniscribeController.cpp:
1013         (WebCore::UniscribeController::shapeAndPlaceItem): Bake in the offsets into the glyph advances.
1014
1015 2018-07-27  Basuke Suzuki  <Basuke.Suzuki@sony.com>
1016
1017         [Curl] Crash on synchronous request via ResourceHandle.
1018         https://bugs.webkit.org/show_bug.cgi?id=188033
1019
1020         Reviewed by Alex Christensen.
1021
1022         The timing of instantiation of delegate was wrong. Move it inside `delegate` getter().
1023         This bug was introduced at r228577.
1024
1025         Test: http/tests/xmlhttprequest/simple-sync.html
1026
1027         * platform/network/curl/ResourceHandleCurl.cpp:
1028         (WebCore::ResourceHandle::start):
1029         (WebCore::ResourceHandle::delegate):
1030
1031 2018-07-03  David Fenton  <david_fenton@apple.com>
1032
1033         Unreviewed, rolling out r233461.
1034
1035         assertions triggered on ios11 Debug wk2
1036
1037         Reverted changeset:
1038
1039         "[iOS] Add assert to catch improper use of WebCore::Timer in
1040         UI Process"
1041         https://bugs.webkit.org/show_bug.cgi?id=185330
1042         https://trac.webkit.org/changeset/233461
1043
1044 2018-07-27  Chris Dumez  <cdumez@apple.com>
1045
1046         [Media] Avoid unnecessarily constructing *TrackList objects
1047         https://bugs.webkit.org/show_bug.cgi?id=188094
1048
1049         Reviewed by Eric Carlson.
1050
1051         Avoid unnecessarily constructing *TrackList objects as this is preventing us from making them
1052         ActiveDOMObjects.
1053
1054         * Modules/mediasource/MediaSource.cpp:
1055         (WebCore::MediaSource::removeSourceBuffer):
1056         * Modules/mediasource/SourceBuffer.cpp:
1057         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment):
1058         * html/HTMLMediaElement.cpp:
1059         (WebCore::HTMLMediaElement::addAudioTrack):
1060         (WebCore::HTMLMediaElement::addTextTrack):
1061         (WebCore::HTMLMediaElement::addVideoTrack):
1062         (WebCore::HTMLMediaElement::ensureAudioTracks):
1063         (WebCore::HTMLMediaElement::ensureTextTracks):
1064         (WebCore::HTMLMediaElement::ensureVideoTracks):
1065         (WebCore::HTMLMediaElement::setSelectedTextTrack):
1066         (WebCore::HTMLMediaElement::audioTracks): Deleted.
1067         (WebCore::HTMLMediaElement::textTracks): Deleted.
1068         (WebCore::HTMLMediaElement::videoTracks): Deleted.
1069         * html/HTMLMediaElement.h:
1070         (WebCore::HTMLMediaElement::audioTracks const):
1071         (WebCore::HTMLMediaElement::textTracks const):
1072         (WebCore::HTMLMediaElement::videoTracks const):
1073         * html/HTMLMediaElement.idl:
1074         * html/shadow/MediaControlElements.cpp:
1075         (WebCore::MediaControlClosedCaptionsTrackListElement::updateDisplay):
1076         (WebCore::MediaControlClosedCaptionsTrackListElement::rebuildTrackListMenu):
1077         (WebCore::MediaControlTextTrackContainerElement::updateTextStrokeStyle):
1078         * html/track/TextTrack.cpp:
1079         (WebCore::TextTrack::setKind):
1080         (WebCore::TextTrack::trackIndex):
1081         (WebCore::TextTrack::trackIndexRelativeToRenderedTracks):
1082         (WebCore::TextTrack::setLanguage):
1083         * html/track/VideoTrack.cpp:
1084         (WebCore::VideoTrack::setKind):
1085         (WebCore::VideoTrack::setLanguage):
1086         * platform/cocoa/PlaybackSessionModelMediaElement.mm:
1087         (WebCore::PlaybackSessionModelMediaElement::setMediaElement):
1088         (WebCore::PlaybackSessionModelMediaElement::updateMediaSelectionOptions):
1089
1090 2018-07-27  Basuke Suzuki  <Basuke.Suzuki@sony.com>
1091
1092         [Curl] Set correct source info to ResourceResponse.
1093         https://bugs.webkit.org/show_bug.cgi?id=188069
1094
1095         Reviewed by Fujii Hironori.
1096
1097         ResourceResponseBase::Source::Network must be set by each ports. Curl port
1098         didn't set this.
1099
1100         Test: http/tests/cache/disk-cache/disk-cache-302-status-code.html
1101
1102         * platform/network/curl/ResourceResponseCurl.cpp:
1103         (WebCore::ResourceResponse::ResourceResponse):
1104
1105 2018-07-26  Andy VanWagoner  <andy@vanwagoner.family>
1106
1107         [INTL] Remove INTL sub-feature compile flags
1108         https://bugs.webkit.org/show_bug.cgi?id=188081
1109
1110         Reviewed by Michael Catanzaro.
1111
1112         Compile time feature flags for INTL sub features were removed, and are covered by existing tests.
1113
1114         * Configurations/FeatureDefines.xcconfig:
1115
1116 2018-07-26  Zalan Bujtas  <zalan@apple.com>
1117
1118         [Fullscreen] Do not create composited layers for renderers unless they are part of the fullscreen subtree.
1119         https://bugs.webkit.org/show_bug.cgi?id=188087
1120         <rdar://problem/42632124>
1121
1122         Reviewed by Simon Fraser.
1123
1124         Sibling composited layers prevent battery lifetime optimizations when in fullscreen.
1125
1126         Test: compositing/no-compositing-when-fulll-screen-is-present.html
1127
1128         * rendering/RenderLayer.cpp:
1129         (WebCore::RenderLayer::isDescendantOf const):
1130         * rendering/RenderLayer.h:
1131         * rendering/RenderLayerCompositor.cpp:
1132         (WebCore::isDescendantOfFullScreenLayer):
1133         (WebCore::RenderLayerCompositor::requiresCompositingForWillChange const):
1134         (WebCore::RenderLayerCompositor::requiresCompositingForPosition const):
1135
1136 2018-07-26  Ryan Haddad  <ryanhaddad@apple.com>
1137
1138         Unreviewed, rolling out r234281.
1139
1140         Broke internal builds.
1141
1142         Reverted changeset:
1143
1144         "[Datalist] Add button to TextFieldInputs with a datalist"
1145         https://bugs.webkit.org/show_bug.cgi?id=187741
1146         https://trac.webkit.org/changeset/234281
1147
1148 2018-07-26  Aditya Keerthi  <akeerthi@apple.com>
1149
1150         [Datalist] Add button to TextFieldInputs with a datalist
1151         https://bugs.webkit.org/show_bug.cgi?id=187741
1152
1153         Reviewed by Tim Horton.
1154
1155         TextFieldInputs that have an associated datalist element should be drawn as
1156         combo boxes. However, we cannot use NSComboBox for this control, as NSComboBox
1157         is not height-resizable. Furthermore, the input should also be able to contain
1158         additional elements, such as the stepper for type=number and the cancel button
1159         for type=search. For these reasons, we draw a button at the end of the input,
1160         mimicking appearance of a combo box.
1161
1162         The list-button -webkit-appearance value was added to display the new button.
1163
1164         Tests: fast/forms/datalist/datalist-searchinput-appearance.html
1165                fast/forms/datalist/datalist-textinput-appearance.html
1166
1167         * Resources/ListButtonArrow.png: Added.
1168         * Resources/ListButtonArrow@2x.png: Added.
1169         * WebCore.xcodeproj/project.pbxproj:
1170         * css/CSSPrimitiveValueMappings.h:
1171         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
1172         * css/CSSProperties.json:
1173         * css/CSSValueKeywords.in:
1174         * css/html.css:
1175         (input::-webkit-list-button):
1176         * html/HTMLInputElement.cpp:
1177         (WebCore::HTMLInputElement::dataListButtonElement const):
1178         (WebCore::HTMLInputElement::isShowingList const):
1179         * html/HTMLInputElement.h:
1180         * html/InputType.h:
1181         (WebCore::InputType::dataListButtonElement const):
1182         (WebCore::InputType::isShowingList const):
1183         * html/TextFieldInputType.cpp:
1184         (WebCore::TextFieldInputType::needsContainer const):
1185         (WebCore::TextFieldInputType::createShadowSubtree):
1186         (WebCore::TextFieldInputType::destroyShadowSubtree):
1187         (WebCore::TextFieldInputType::listAttributeTargetChanged):
1188         (WebCore::TextFieldInputType::dataListButtonElement const):
1189         (WebCore::TextFieldInputType::dataListButtonElementWasClicked):
1190         (WebCore::TextFieldInputType::didCloseSuggestions):
1191         (WebCore::TextFieldInputType::isShowingList const):
1192         * html/TextFieldInputType.h:
1193         * html/shadow/DataListButtonElement.cpp: Added.
1194         (WebCore::DataListButtonElement::create):
1195         (WebCore::DataListButtonElement::DataListButtonElement):
1196         (WebCore::DataListButtonElement::~DataListButtonElement):
1197         (WebCore::DataListButtonElement::defaultEventHandler):
1198         * html/shadow/DataListButtonElement.h: Added.
1199         * platform/ThemeTypes.h:
1200         * rendering/RenderTheme.cpp:
1201         (WebCore::RenderTheme::adjustStyle):
1202         (WebCore::RenderTheme::adjustListButtonStyle const):
1203         * rendering/RenderTheme.h:
1204         * rendering/RenderThemeMac.h:
1205         * rendering/RenderThemeMac.mm:
1206         (-[WebListButtonCell drawWithFrame:inView:]):
1207         (WebCore::RenderThemeMac::paintListButtonForInput):
1208         (WebCore::RenderThemeMac::adjustListButtonStyle const):
1209         (WebCore::RenderThemeMac::paintTextField):
1210         (WebCore::RenderThemeMac::paintSearchField):
1211         (WebCore::RenderThemeMac::paintSearchFieldCancelButton):
1212         (WebCore::RenderThemeMac::listButton const):
1213
1214 2018-07-26  Antoine Quint  <graouts@apple.com>
1215
1216         [Web Animations] Accelerated animations don't respect a positive delay value
1217         https://bugs.webkit.org/show_bug.cgi?id=186930
1218         <rdar://problem/41393393>
1219
1220         Reviewed by Dean Jackson.
1221
1222         Test: webanimations/accelerated-animation-with-delay.html
1223
1224         We would mistakenly clear the list of pending accelerated actions in KeyframeEffectReadOnly::applyPendingAcceleratedActions()
1225         even if we failed to proceed because of the target element's renderer not being composited yet. Now, we clear the list after
1226         we've established we can apply them, and if we can't we inform the animation with a call to acceleratedStateDidChange() which
1227         will in turn call into the document timeline so that we may consider these animations on the next tick.
1228
1229         For this to work correctly we must make a change to DocumentTimeline::applyPendingAcceleratedAnimations() which only cleared
1230         its list of pending accelerated animations _after_ iterating through them, which would be problematic since we would now add
1231         animations to this list. That list is now copied and cleared prior to iterating through its members.
1232
1233         We also fix the naming of the m_pendingAcceleratedActions copy in KeyframeEffectReadOnly::applyPendingAcceleratedActions()
1234         to have a more similar name.
1235
1236         * animation/DocumentTimeline.cpp:
1237         (WebCore::DocumentTimeline::applyPendingAcceleratedAnimations):
1238         * animation/KeyframeEffectReadOnly.cpp:
1239         (WebCore::KeyframeEffectReadOnly::applyPendingAcceleratedActions):
1240
1241 2018-07-26  Ross Kirsling  <ross.kirsling@sony.com>
1242
1243         String(View) should have a splitAllowingEmptyEntries function instead of a flag parameter
1244         https://bugs.webkit.org/show_bug.cgi?id=187963
1245
1246         Reviewed by Alex Christensen.
1247
1248         * Modules/applepay/cocoa/PaymentContactCocoa.mm:
1249         (WebCore::convert):
1250         * Modules/cache/DOMCache.cpp:
1251         (WebCore::hasResponseVaryStarHeaderValue):
1252         * Modules/cache/DOMCacheEngine.cpp:
1253         (WebCore::DOMCacheEngine::queryCacheMatch):
1254         * Modules/mediastream/PeerConnectionBackend.cpp:
1255         (WebCore::filterICECandidate):
1256         (WebCore::PeerConnectionBackend::filterSDP const):
1257         * Modules/websockets/WebSocketHandshake.cpp:
1258         (WebCore::WebSocketHandshake::checkResponseHeaders):
1259         * accessibility/AccessibilityObject.h:
1260         (WebCore::AccessibilityObject::determineARIADropEffects):
1261         * accessibility/AccessibilityRenderObject.cpp:
1262         (WebCore::AccessibilityRenderObject::determineARIADropEffects):
1263         * accessibility/AccessibilityRenderObject.h:
1264         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1265         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
1266         * editing/cocoa/DataDetection.mm:
1267         (WebCore::DataDetection::shouldCancelDefaultAction):
1268         * editing/markup.cpp:
1269         (WebCore::fillContainerFromString):
1270         (WebCore::createFragmentFromText):
1271         * html/EmailInputType.cpp:
1272         (WebCore::EmailInputType::typeMismatchFor const):
1273         (WebCore::EmailInputType::sanitizeValue const):
1274         * html/HTMLInputElement.cpp:
1275         (WebCore::parseAcceptAttribute):
1276         * html/ValidationMessage.cpp:
1277         (WebCore::ValidationMessage::setMessageDOMAndStartTimer):
1278         * html/canvas/WebGLRenderingContextBase.cpp:
1279         (WebCore::WebGLRenderingContextBase::compileShader):
1280         * inspector/agents/InspectorDOMAgent.cpp:
1281         (WebCore::InspectorDOMAgent::nodeForPath):
1282         * loader/FormSubmission.cpp:
1283         (WebCore::encodingFromAcceptCharset):
1284         * loader/ResourceTiming.cpp:
1285         (WebCore::passesTimingAllowCheck):
1286         * page/WindowFeatures.cpp:
1287         (WebCore::parseDisabledAdaptations):
1288         (WebCore::parseDialogFeaturesMap):
1289         * platform/URL.cpp:
1290         (WebCore::isIPv4Address):
1291         (WebCore::isIPv6Address):
1292         * platform/graphics/GLContext.cpp:
1293         (WebCore::GLContext::version):
1294         * platform/graphics/freetype/FontCacheFreeType.cpp:
1295         (WebCore::patternToFamilies):
1296         * platform/graphics/gstreamer/GStreamerCommon.cpp:
1297         (WebCore::extractGStreamerOptionsFromCommandLine):
1298         * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
1299         (WebCore::Extensions3DOpenGLCommon::Extensions3DOpenGLCommon):
1300         (WebCore::Extensions3DOpenGLCommon::initializeAvailableExtensions):
1301         * platform/gtk/PasteboardHelper.cpp:
1302         (WebCore::PasteboardHelper::fillSelectionData):
1303         * platform/gtk/SelectionData.cpp:
1304         (WebCore::SelectionData::setURIList):
1305         * platform/network/CacheValidation.cpp:
1306         (WebCore::collectVaryingRequestHeaders):
1307         * platform/network/HTTPParsers.cpp:
1308         (WebCore::filenameFromHTTPContentDisposition):
1309         (WebCore::parseXFrameOptionsHeader):
1310         (WebCore::parseAccessControlExposeHeadersAllowList):
1311         * platform/network/curl/CookieUtil.cpp:
1312         (WebCore::CookieUtil::parseCookieHeader):
1313         * platform/network/curl/CurlCacheEntry.cpp:
1314         (WebCore::CurlCacheEntry::loadResponseHeaders):
1315         * platform/network/curl/CurlCacheManager.cpp:
1316         (WebCore::CurlCacheManager::loadIndex):
1317         * platform/network/soup/CookieJarSoup.cpp:
1318         (WebCore::setCookiesFromDOM):
1319         * svg/SVGAnimationElement.cpp:
1320         (WebCore::SVGAnimationElement::parseAttribute):
1321         * svg/SVGToOTFFontConversion.cpp:
1322         (WebCore::SVGToOTFFontConverter::appendOS2Table):
1323         * svg/animation/SVGSMILElement.cpp:
1324         (WebCore::SVGSMILElement::parseBeginOrEnd):
1325         * testing/MockCDMFactory.cpp:
1326         (WebCore::MockCDM::sanitizeResponse const):
1327         (WebCore::MockCDMInstance::updateLicense):
1328         Update split/splitAllowingEmptyEntries usage.
1329
1330 2018-07-26  Nan Wang  <n_wang@apple.com>
1331
1332         AX: nothing returned for various previous text marker APIs from one div/p node to another
1333         https://bugs.webkit.org/show_bug.cgi?id=188071
1334
1335         Reviewed by Chris Fleizach.
1336
1337         TextIterator is emitting an extra '\n' at the end of the <p> node and there's no
1338         corresponding text node in the DOM tree, so we are not able to handle that for 
1339         text markers. Fixed it by ignoring the extra '\n' and anchor the text marker to 
1340         the previous child text node.
1341
1342         Test: accessibility/mac/text-marker-p-tags.html
1343
1344         * accessibility/AXObjectCache.cpp:
1345         (WebCore::AXObjectCache::traverseToOffsetInRange):
1346
1347 2018-07-26  Commit Queue  <commit-queue@webkit.org>
1348
1349         Unreviewed, rolling out r234181 and r234189.
1350         https://bugs.webkit.org/show_bug.cgi?id=188075
1351
1352         These are not needed right now (Requested by thorton on
1353         #webkit).
1354
1355         Reverted changesets:
1356
1357         "Enable Web Content Filtering on watchOS"
1358         https://bugs.webkit.org/show_bug.cgi?id=187979
1359         https://trac.webkit.org/changeset/234181
1360
1361         "HAVE(PARENTAL_CONTROLS) should be true on watchOS"
1362         https://bugs.webkit.org/show_bug.cgi?id=187985
1363         https://trac.webkit.org/changeset/234189
1364
1365 2018-07-26  Timothy Hatcher  <timothy@apple.com>
1366
1367         Use the Page's appearance when converting pasteboard attributed strings.
1368         https://bugs.webkit.org/show_bug.cgi?id=188067
1369         rdar://problem/42632246
1370
1371         Reviewed by Wenson Hsieh.
1372
1373         * editing/cocoa/WebContentReaderCocoa.mm:
1374         (WebCore::createFragment): Create a LocalDefaultSystemAppearance based on the Page.
1375
1376 2018-07-26  Eric Carlson  <eric.carlson@apple.com>
1377
1378         Switching tabs should not close PiP window
1379         https://bugs.webkit.org/show_bug.cgi?id=188054
1380         <rdar://problem/41212379>
1381
1382         Reviewed by Jon Lee.
1383
1384         No new tests, fixes an existing test.
1385         
1386         Prior to r233926, calling VideoFullscreenInterfaceMac::requestHideAndExitFullscreen was a noop.
1387         In r233926 it was updated to close the PiP window and was called from the PIPViewControllerDelegate
1388         selectors to close the PiP window. requestHideAndExitFullscreen is also called from 
1389         WebPageProxy::viewDidLeaveWindow when the web view is removed from it window, so switching
1390         tabs also closed the PiP window. Revert the changes to requestHideAndExitFullscreen, and add
1391         a new method that is only used by the delegate to exit PiP.
1392
1393         * platform/mac/VideoFullscreenInterfaceMac.h:
1394         (WebCore::VideoFullscreenInterfaceMac::requestHideAndExitFullscreen): Make this an empty,
1395         do-nothing method.
1396         * platform/mac/VideoFullscreenInterfaceMac.mm:
1397         (-[WebVideoFullscreenInterfaceMacObjC pipShouldClose:]): Call requestHideAndExitPiP.
1398         (-[WebVideoFullscreenInterfaceMacObjC pipActionStop:]): Ditto.
1399         (WebCore::VideoFullscreenInterfaceMac::requestHideAndExitPiP): Renamed from requestHideAndExitFullscreen.
1400         (WebCore::VideoFullscreenInterfaceMac::requestHideAndExitFullscreen): Deleted.
1401
1402 2018-07-04  Darin Adler  <darin@apple.com>
1403
1404         Improve WebGPU implementation, including using Metal Objective-C protocols more simply and correctly
1405         https://bugs.webkit.org/show_bug.cgi?id=187333
1406
1407         Reviewed by Sam Weinig.
1408
1409         - Used a new OBJC_PROTOCOL macro to handle things in the Metal API that are protocols.
1410           The code previously had used OBJC_CLASS, but that created unrelated classes.
1411           Fixing this allows removing many typecasts that were in the existing code, makes it
1412           ARC-compatible, and also allowed the compiler to detect a couple mistakes where we
1413           were calling methods that don't exist.
1414
1415         - Eliminated use of separate heap-allocated, reference-counted objects to
1416           hold pointers to Metal objects.
1417
1418         - Reduced the use of the WebGPU wrappers to pass around arguments inside the code.
1419           They are now used only as part of the DOM binding; the inner GPU objects are used
1420           whenever possible. This cuts down the number of separate functions needed a bit,
1421           since we don't always need accessors for the things inside the wrappers.
1422
1423         - Used references rather than pointers in many cases.
1424
1425         - Took out three kinds of null checks: 1) Unneeded ones since Objective-C has the
1426           "do nothing and return 0" behavior for methods without return values and that return
1427           integer scalars. 2) Checks that aren't needed because the code has clear, invariant
1428           guarantees that the pointer won't be null. 3) The simplest variant of (2), checks
1429           that can be obviated by using reference types instead of pointer types.
1430
1431         - For Metal-specific functions and data members, used the function name metal() and
1432           the data member name m_metal rather than longer wordier names with the word "platform"
1433           in them. We could use "platform" if these objects were platform-specific objects used
1434           in a cross-platform way that needed a common name. But in this case it's clearer to
1435           call them "metal" since we are dropping down to the metal with Metal API, and
1436           shared platform-independent code will not be accessing these.
1437
1438         - Fixed the common mistake of using "unsigned long" in our C++ code to match IDL.
1439           The "unsigned long" type in IDL correponds to the "unsigned" type in WebKit code.
1440
1441         - Used "const" more in the GPU functions that are wrappers around Metal objects to
1442           reflect the fact that these have semantics of smart pointers; most operations can be
1443           done without changing which object is pointed to. This allows us to use const
1444           references to pass things around without reference count churn.
1445
1446         - Reduced includes.
1447
1448         - Added "explicit" keywords where appropriate.
1449
1450         - Removed unused functions. In particular, removed non-Metal stub versions of the
1451           functions in the GPU classes: the right way to start a new port is to clone the
1452           Metal-specific files and turn the into stubs if needed, it does not make it
1453           significantly more convenient to have stubs in the platform independent files,
1454           especially ones that are not compiled for any platform.
1455
1456         - Removed most the WEBCORE_EXPORT in the GPU headers; left only what's needed to
1457           support testing with TestWebKitAPI.
1458
1459         - Fixed two storage leaks in GPUDevice by adding missing adoptNS.
1460
1461         * PlatformMac.cmake: Moved files from platform/graphics/cocoa to platform/graphics/metal.
1462         * SourcesCocoa.txt: Ditto.
1463         * WebCore.xcodeproj/project.pbxproj: Ditto. Fixed paths on some files and groups/directories.
1464         Made the platform files that abstract GPU all be "project" visible, not "private", since
1465         they don't need to be visible outside WebCore. Removed reference to FontSelectionKeywordValues.h,
1466         which does not seem to be a source file, a derived source file, or mentioned in any change log.
1467
1468         * bindings/js/JSWebGPURenderPassAttachmentDescriptorCustom.cpp:
1469         (WebCore::toJSNewlyCreated): Create the correct wrapper for a
1470         WebGPURenderPassDepthAttachmentDescriptor. The old code would instead
1471         create a WebGPURenderPassAttachmentDescriptor wrapper, which can't be
1472         used to access the clearDepth attribute.
1473
1474         * html/canvas/WebGPUBuffer.cpp:
1475         (WebCore::WebGPUBuffer::create): Use more references rather than pointers for things
1476         that are never null. Added comment about possibly returning null on failure in future.
1477         (WebCore::WebGPUBuffer::WebGPUBuffer): Updated to store the GPUBuffer inside the class
1478         instead of in a separate reference counted object.
1479         * html/canvas/WebGPUBuffer.h: Ditto.
1480
1481         * html/canvas/WebGPUCommandBuffer.cpp:
1482         (WebCore::WebGPUCommandBuffer::create): Use references and lower level types.
1483         (WebCore::WebGPUCommandBuffer::WebGPUCommandBuffer): Store the GPUCommandBuffer
1484         inside the class.
1485         (WebCore::WebGPUCommandBuffer::commit): Removed unneeded null checks.
1486         (WebCore::WebGPUCommandBuffer::presentDrawable): Ditto.
1487         (WebCore::WebGPUCommandBuffer::createRenderCommandEncoderWithDescriptor):
1488         Removed unneeded local variable.
1489         (WebCore::WebGPUCommandBuffer::createComputeCommandEncoder): Ditto.
1490         (WebCore::WebGPUCommandBuffer::completed): Store the DOMPromiseProxy in this
1491         class, not in GPUCommandBuffer.
1492         * html/canvas/WebGPUCommandBuffer.h: Ditto.
1493
1494         * html/canvas/WebGPUCommandQueue.cpp:
1495         (WebCore::WebGPUCommandQueue::create): Use references and lower level types.
1496         (WebCore::WebGPUCommandQueue::WebGPUCommandQueue): Store the GPUCommandQueue
1497         inside the class.
1498         (WebCore::WebGPUCommandQueue::createCommandBuffer): Ditto.
1499         * html/canvas/WebGPUCommandQueue.h: Ditto.
1500         * html/canvas/WebGPUCommandQueue.idl: The return value of createCommandBuffer
1501         is no longer nullable.
1502
1503         * html/canvas/WebGPUComputeCommandEncoder.cpp:
1504         (WebCore::WebGPUComputeCommandEncoder::create): More of the same.
1505         (WebCore::WebGPUComputeCommandEncoder::WebGPUComputeCommandEncoder): Ditto.
1506         (WebCore::WebGPUComputeCommandEncoder::setComputePipelineState): Ditto.
1507         (WebCore::WebGPUComputeCommandEncoder::setBuffer): Ditto.
1508         (WebCore::WebGPUComputeCommandEncoder::dispatch): Ditto.
1509         (WebCore::WebGPUComputeCommandEncoder::endEncoding): Ditto.
1510         * html/canvas/WebGPUComputeCommandEncoder.h: Ditto.
1511
1512         * html/canvas/WebGPUComputePipelineState.cpp:
1513         (WebCore::WebGPUComputePipelineState::create): More of the same.
1514         (WebCore::WebGPUComputePipelineState::WebGPUComputePipelineState): Ditto.
1515         * html/canvas/WebGPUComputePipelineState.h: Ditto.
1516
1517         * html/canvas/WebGPUDepthStencilDescriptor.cpp:
1518         (WebCore::WebGPUDepthStencilDescriptor::create): More of the same.
1519         (WebCore::WebGPUDepthStencilDescriptor::depthWriteEnabled const): Ditto.
1520         (WebCore::WebGPUDepthStencilDescriptor::setDepthWriteEnabled): Ditto.
1521         (WebCore::WebGPUDepthStencilDescriptor::depthCompareFunction const): Ditto.
1522         (WebCore::WebGPUDepthStencilDescriptor::setDepthCompareFunction): Ditto.
1523         * html/canvas/WebGPUDepthStencilDescriptor.h: Ditto. Also fixed a bug
1524         where m_depthCompareFunction was uninitialized in newly created objects.
1525
1526         * html/canvas/WebGPUDepthStencilState.cpp:
1527         (WebCore::WebGPUDepthStencilState::create): More of the same.
1528         (WebCore::WebGPUDepthStencilState::WebGPUDepthStencilState): Ditto.
1529         (WebCore::WebGPUDepthStencilState::label const): Ditto.
1530         (WebCore::WebGPUDepthStencilState::setLabel): Ditto.
1531         * html/canvas/WebGPUDepthStencilState.h: Ditto.
1532
1533         * html/canvas/WebGPUDrawable.cpp:
1534         (WebCore::WebGPUDrawable::create): More of the same.
1535         (WebCore::WebGPUDrawable::WebGPUDrawable): Ditto.
1536         * html/canvas/WebGPUDrawable.h: Ditto.
1537
1538         * html/canvas/WebGPUEnums.cpp: Removed some stray const.
1539         * html/canvas/WebGPUEnums.h: Ditto.
1540
1541         * html/canvas/WebGPUFunction.cpp:
1542         (WebCore::WebGPUFunction::create): More of the same.
1543         (WebCore::WebGPUFunction::WebGPUFunction): Ditto.
1544         * html/canvas/WebGPUFunction.h: Ditto.
1545
1546         * html/canvas/WebGPULibrary.cpp:
1547         (WebCore::WebGPULibrary::create): More of the same.
1548         (WebCore::WebGPULibrary::WebGPULibrary): Ditto.
1549         (WebCore::WebGPULibrary::functionNames const): Ditto.
1550         (WebCore::WebGPULibrary::functionWithName const): Ditto.
1551         * html/canvas/WebGPULibrary.h: Ditto.
1552
1553         * html/canvas/WebGPUObject.cpp:
1554         (WebCore::WebGPUObject::WebGPUObject):
1555         (WebCore::WebGPUObject::deleteObject): Deleted this unused function.
1556         We can bring it back later if we find we need it the way we did with the
1557         WebGL implementation, but currently it's a never-called stub. Also
1558         deleted the isDeleted and m_deleted for the same reason.
1559         * html/canvas/WebGPUObject.h: Ditto.
1560
1561         * html/canvas/WebGPURenderCommandEncoder.cpp:
1562         (WebCore::WebGPURenderCommandEncoder::create): More of the same.
1563         (WebCore::WebGPURenderCommandEncoder::WebGPURenderCommandEncoder): Ditto.
1564         (WebCore::WebGPURenderCommandEncoder::setRenderPipelineState): Ditto.
1565         (WebCore::WebGPURenderCommandEncoder::setDepthStencilState): Ditto.
1566         (WebCore::WebGPURenderCommandEncoder::setVertexBuffer): Ditto.
1567         (WebCore::WebGPURenderCommandEncoder::setFragmentBuffer): Ditto.
1568         (WebCore::WebGPURenderCommandEncoder::drawPrimitives): Ditto.
1569         (WebCore::WebGPURenderCommandEncoder::endEncoding): Ditto.
1570         * html/canvas/WebGPURenderCommandEncoder.h: Ditto.
1571
1572         * html/canvas/WebGPURenderPassAttachmentDescriptor.cpp:
1573         (WebCore::WebGPURenderPassAttachmentDescriptor::WebGPURenderPassAttachmentDescriptor):
1574         More of the same.
1575         (WebCore::WebGPURenderPassAttachmentDescriptor::loadAction const): Ditto.
1576         (WebCore::WebGPURenderPassAttachmentDescriptor::setLoadAction): Ditto.
1577         (WebCore::WebGPURenderPassAttachmentDescriptor::storeAction const): Ditto.
1578         (WebCore::WebGPURenderPassAttachmentDescriptor::setStoreAction): Ditto.
1579         (WebCore::WebGPURenderPassAttachmentDescriptor::texture const): Ditto.
1580         (WebCore::WebGPURenderPassAttachmentDescriptor::setTexture): Ditto.
1581         * html/canvas/WebGPURenderPassAttachmentDescriptor.h: Ditto.
1582
1583         * html/canvas/WebGPURenderPassColorAttachmentDescriptor.cpp:
1584         (WebCore::WebGPURenderPassColorAttachmentDescriptor::create): More of the same.
1585         (WebCore::WebGPURenderPassColorAttachmentDescriptor::WebGPURenderPassColorAttachmentDescriptor): Ditto.
1586         (WebCore::WebGPURenderPassColorAttachmentDescriptor::descriptor const): Ditto.
1587         (WebCore::WebGPURenderPassColorAttachmentDescriptor::clearColor const): Ditto.
1588         (WebCore::WebGPURenderPassColorAttachmentDescriptor::setClearColor): Ditto.
1589         * html/canvas/WebGPURenderPassColorAttachmentDescriptor.h: Ditto.
1590
1591         * html/canvas/WebGPURenderPassDepthAttachmentDescriptor.cpp:
1592         (WebCore::WebGPURenderPassDepthAttachmentDescriptor::create): More of the same.
1593         (WebCore::WebGPURenderPassDepthAttachmentDescriptor::WebGPURenderPassDepthAttachmentDescriptor): Ditto.
1594         (WebCore::WebGPURenderPassDepthAttachmentDescriptor::clearDepth const): Ditto.
1595         (WebCore::WebGPURenderPassDepthAttachmentDescriptor::setClearDepth): Ditto.
1596         (WebCore::WebGPURenderPassDepthAttachmentDescriptor::descriptor const): Ditto.
1597         * html/canvas/WebGPURenderPassDepthAttachmentDescriptor.h: Ditto.
1598
1599         * html/canvas/WebGPURenderPassDescriptor.cpp:
1600         (WebCore::WebGPURenderPassDescriptor::create): More of the same.
1601         (WebCore::WebGPURenderPassDescriptor::depthAttachment): Ditto.
1602         (WebCore::WebGPURenderPassDescriptor::colorAttachments): Ditto.
1603         * html/canvas/WebGPURenderPassDescriptor.h: Ditto.
1604
1605         * html/canvas/WebGPURenderPipelineColorAttachmentDescriptor.cpp:
1606         (WebCore::WebGPURenderPipelineColorAttachmentDescriptor::create): More of the same.
1607         (WebCore::WebGPURenderPipelineColorAttachmentDescriptor::WebGPURenderPipelineColorAttachmentDescriptor): Ditto.
1608         (WebCore::WebGPURenderPipelineColorAttachmentDescriptor::pixelFormat const): Ditto.
1609         (WebCore::WebGPURenderPipelineColorAttachmentDescriptor::setPixelFormat): Ditto.
1610         * html/canvas/WebGPURenderPipelineColorAttachmentDescriptor.h: Ditto.
1611
1612         * html/canvas/WebGPURenderPipelineDescriptor.cpp:
1613         (WebCore::WebGPURenderPipelineDescriptor::create): More of the same.
1614         (WebCore::WebGPURenderPipelineDescriptor::vertexFunction const): Ditto.
1615         (WebCore::WebGPURenderPipelineDescriptor::setVertexFunction): Ditto.
1616         (WebCore::WebGPURenderPipelineDescriptor::fragmentFunction const): Ditto.
1617         (WebCore::WebGPURenderPipelineDescriptor::setFragmentFunction): Ditto.
1618         (WebCore::WebGPURenderPipelineDescriptor::colorAttachments): Ditto.
1619         (WebCore::WebGPURenderPipelineDescriptor::depthAttachmentPixelFormat const): Ditto.
1620         (WebCore::WebGPURenderPipelineDescriptor::setDepthAttachmentPixelFormat): Ditto.
1621         (WebCore::WebGPURenderPipelineDescriptor::reset): Ditto.
1622         * html/canvas/WebGPURenderPipelineDescriptor.h: Ditto.
1623
1624         * html/canvas/WebGPURenderPipelineState.cpp:
1625         (WebCore::WebGPURenderPipelineState::create): More of the same.
1626         (WebCore::WebGPURenderPipelineState::WebGPURenderPipelineState): Ditto.
1627         (WebCore::WebGPURenderPipelineState::label const): Ditto.
1628         (WebCore::WebGPURenderPipelineState::setLabel): Ditto.
1629         * html/canvas/WebGPURenderPipelineState.h: Ditto.
1630
1631         * html/canvas/WebGPURenderingContext.cpp:
1632         (WebCore::WebGPURenderingContext::create): More of the same.
1633         (WebCore::WebGPURenderingContext::WebGPURenderingContext): Ditto.
1634         (WebCore::WebGPURenderingContext::initializeNewContext): Ditto.
1635         (WebCore::WebGPURenderingContext::platformLayer const): Ditto.
1636         (WebCore::WebGPURenderingContext::markLayerComposited): Ditto.
1637         (WebCore::WebGPURenderingContext::reshape): Ditto.
1638         (WebCore::WebGPURenderingContext::createLibrary): Ditto.
1639         (WebCore::WebGPURenderingContext::createRenderPipelineState): Ditto.
1640         (WebCore::WebGPURenderingContext::createDepthStencilState): Ditto.
1641         (WebCore::WebGPURenderingContext::createComputePipelineState): Ditto.
1642         (WebCore::WebGPURenderingContext::createCommandQueue): Ditto.
1643         (WebCore::WebGPURenderingContext::nextDrawable): Ditto.
1644         (WebCore::WebGPURenderingContext::createBuffer): Ditto.
1645         (WebCore::WebGPURenderingContext::createTexture): Ditto.
1646         * html/canvas/WebGPURenderingContext.h: Made many functions final and
1647         private.
1648         * html/canvas/WebGPURenderingContext.idl: The return value of most of
1649         the create functions are no longer nullable.
1650
1651         * html/canvas/WebGPUSize.h: Use "unsigned" instead of "unsigned long".
1652
1653         * html/canvas/WebGPUTexture.cpp:
1654         (WebCore::WebGPUTexture::createFromDrawableTexture): More of the same.
1655         (WebCore::WebGPUTexture::create): Ditto.
1656         (WebCore::WebGPUTexture::WebGPUTexture): Ditto.
1657         * html/canvas/WebGPUTexture.h: Ditto.
1658
1659         * html/canvas/WebGPUTextureDescriptor.cpp:
1660         (WebCore::WebGPUTextureDescriptor::create): More of the same.
1661         (WebCore::WebGPUTextureDescriptor::WebGPUTextureDescriptor): Ditto.
1662         (WebCore::WebGPUTextureDescriptor::width const): Ditto.
1663         (WebCore::WebGPUTextureDescriptor::setWidth): Ditto.
1664         (WebCore::WebGPUTextureDescriptor::height const): Ditto.
1665         (WebCore::WebGPUTextureDescriptor::setHeight): Ditto.
1666         (WebCore::WebGPUTextureDescriptor::sampleCount const): Ditto.
1667         (WebCore::WebGPUTextureDescriptor::setSampleCount): Ditto.
1668         (WebCore::WebGPUTextureDescriptor::textureType const): Ditto.
1669         (WebCore::WebGPUTextureDescriptor::setTextureType): Ditto.
1670         (WebCore::WebGPUTextureDescriptor::storageMode const): Ditto.
1671         (WebCore::WebGPUTextureDescriptor::setStorageMode): Ditto.
1672         (WebCore::WebGPUTextureDescriptor::usage const): Ditto.
1673         (WebCore::WebGPUTextureDescriptor::setUsage): Ditto.
1674         * html/canvas/WebGPUTextureDescriptor.h: Ditto.
1675
1676         * platform/graphics/metal/GPUBufferMetal.mm: Moved from "cocoa" directory.
1677         (WebCore::GPUBuffer::GPUBuffer): Simplify code using references and the
1678         "metal" naming.
1679
1680         * platform/graphics/metal/GPUCommandBufferMetal.mm:
1681         (WebCore::GPUCommandBuffer::GPUCommandBuffer): Take a function to be called as the
1682         completed handler and set it up.
1683         (WebCore::GPUCommandBuffer::presentDrawable const): Ditto.
1684         (WebCore::GPUCommandBuffer::commit const): Ditto.
1685         (WebCore::GPUCommandBuffer::addCompletedHandler): Deleted.
1686
1687         * platform/graphics/metal/GPUCommandQueueMetal.mm:
1688         (WebCore::GPUCommandQueue::GPUCommandQueue): Ditto. Also rewrote label handling a bit.
1689         (WebCore::GPUCommandQueue::label const): Ditto.
1690         (WebCore::GPUCommandQueue::setLabel const): Ditto.
1691
1692         * platform/graphics/metal/GPUComputeCommandEncoderMetal.mm:
1693         (WebCore::GPUComputeCommandEncoder::GPUComputeCommandEncoder): Ditto.
1694         (WebCore::GPUComputeCommandEncoder::setComputePipelineState const): Ditto.
1695         (WebCore::GPUComputeCommandEncoder::setBuffer const): Ditto.
1696         (WebCore::GPUComputeCommandEncoder::dispatch const): Ditto.
1697         (WebCore::GPUComputeCommandEncoder::endEncoding const): Ditto.
1698
1699         * platform/graphics/metal/GPUComputePipelineStateMetal.mm:
1700         (WebCore::GPUComputePipelineState::GPUComputePipelineState): Ditto.
1701
1702         * platform/graphics/metal/GPUDepthStencilDescriptorMetal.mm:
1703         (WebCore::GPUDepthStencilDescriptor::GPUDepthStencilDescriptor): Ditto.
1704         (WebCore::GPUDepthStencilDescriptor::depthWriteEnabled const): Ditto.
1705         (WebCore::GPUDepthStencilDescriptor::setDepthWriteEnabled const): Ditto.
1706         (WebCore::GPUDepthStencilDescriptor::depthCompareFunction const): Ditto.
1707         (WebCore::GPUDepthStencilDescriptor::setDepthCompareFunction const): Ditto.
1708
1709         * platform/graphics/metal/GPUDepthStencilStateMetal.mm:
1710         (WebCore::GPUDepthStencilState::GPUDepthStencilState): Ditto.
1711         (WebCore::GPUDepthStencilState::label const): Ditto.
1712         (WebCore::GPUDepthStencilState::setLabel const): Ditto. This is one of the
1713         functions that was calling a method that does not exist. Added a comment.
1714
1715         * platform/graphics/metal/GPUDeviceMetal.mm:
1716         (WebCore::GPUDevice::GPUDevice): Ditto. Also fixed two storage leaks where
1717         we neglected to do adoptNS on the result of MTLCreateSystemDefaultDevice and
1718         on the result of -[[WebGPULayer alloc] initWithGPUDevice:].
1719         (WebCore::GPUDevice::reshape const): Ditto.
1720         (WebCore::GPUDevice::platformLayer const): Ditto.
1721         (WebCore::GPUDevice::operator! const): Ditto.
1722
1723         * platform/graphics/metal/GPUDrawableMetal.mm:
1724         (WebCore::GPUDrawable::GPUDrawable): Ditto.
1725         (WebCore::GPUDrawable::release): Ditto.
1726         (WebCore::GPUDrawable::metal const): Ditto.
1727         (WebCore::GPUDrawable::texture const): Ditto.
1728
1729         * platform/graphics/metal/GPUFunctionMetal.mm:
1730         (WebCore::GPUFunction::GPUFunction): Ditto.
1731         (WebCore::GPUFunction::name const): Ditto.
1732         (WebCore::GPUFunction::metal const): Ditto.
1733         (WebCore::GPUFunction::operator! const): Ditto.
1734
1735         * platform/graphics/metal/GPULibraryMetal.mm:
1736         (WebCore::GPULibrary::GPULibrary): Ditto.
1737         (WebCore::GPULibrary::label const): Ditto.
1738         (WebCore::GPULibrary::setLabel const): Ditto.
1739         (WebCore::GPULibrary::functionNames const): Ditto.
1740         (WebCore::GPULibrary::metal const): Ditto.
1741
1742         * platform/graphics/metal/GPURenderCommandEncoderMetal.mm:
1743         (WebCore::GPURenderCommandEncoder::GPURenderCommandEncoder): Ditto.
1744         (WebCore::GPURenderCommandEncoder::setRenderPipelineState const): Ditto.
1745         (WebCore::GPURenderCommandEncoder::setDepthStencilState const): Ditto.
1746         (WebCore::GPURenderCommandEncoder::setVertexBuffer const): Ditto.
1747         (WebCore::GPURenderCommandEncoder::setFragmentBuffer const): Ditto.
1748         (WebCore::GPURenderCommandEncoder::drawPrimitives const): Ditto.
1749         (WebCore::GPURenderCommandEncoder::endEncoding const): Ditto.
1750
1751         * platform/graphics/metal/GPURenderPassAttachmentDescriptorMetal.mm:
1752         (WebCore::GPURenderPassAttachmentDescriptor::GPURenderPassAttachmentDescriptor): Ditto.
1753         (WebCore::GPURenderPassAttachmentDescriptor::loadAction const): Ditto.
1754         (WebCore::GPURenderPassAttachmentDescriptor::setLoadAction const): Ditto.
1755         (WebCore::GPURenderPassAttachmentDescriptor::storeAction const): Ditto.
1756         (WebCore::GPURenderPassAttachmentDescriptor::setStoreAction const): Ditto.
1757         (WebCore::GPURenderPassAttachmentDescriptor::setTexture const): Ditto.
1758
1759         * platform/graphics/metal/GPURenderPassColorAttachmentDescriptorMetal.mm:
1760         (WebCore::GPURenderPassColorAttachmentDescriptor::GPURenderPassColorAttachmentDescriptor): Ditto.
1761         (WebCore::GPURenderPassColorAttachmentDescriptor::clearColor const): Ditto.
1762         (WebCore::GPURenderPassColorAttachmentDescriptor::setClearColor const): Ditto.
1763         (WebCore::GPURenderPassColorAttachmentDescriptor::metal const): Ditto.
1764
1765         * platform/graphics/metal/GPURenderPassDepthAttachmentDescriptorMetal.mm:
1766         (WebCore::GPURenderPassDepthAttachmentDescriptor::GPURenderPassDepthAttachmentDescriptor): Ditto.
1767         (WebCore::GPURenderPassDepthAttachmentDescriptor::clearDepth const): Ditto.
1768         (WebCore::GPURenderPassDepthAttachmentDescriptor::setClearDepth const): Ditto.
1769         (WebCore::GPURenderPassDepthAttachmentDescriptor::metal const): Ditto.
1770
1771         * platform/graphics/metal/GPURenderPassDescriptorMetal.mm:
1772         (WebCore::GPURenderPassDescriptor::GPURenderPassDescriptor): Ditto.
1773         (WebCore::GPURenderPassDescriptor::colorAttachments const): Ditto.
1774         (WebCore::GPURenderPassDescriptor::depthAttachment const): Ditto.
1775         (WebCore::GPURenderPassDescriptor::metal const): Ditto.
1776
1777         * platform/graphics/metal/GPURenderPipelineColorAttachmentDescriptorMetal.mm:
1778         (WebCore::GPURenderPipelineColorAttachmentDescriptor::GPURenderPipelineColorAttachmentDescriptor): Ditto.
1779         (WebCore::GPURenderPipelineColorAttachmentDescriptor::pixelFormat const): Ditto.
1780         (WebCore::GPURenderPipelineColorAttachmentDescriptor::setPixelFormat const): Ditto.
1781         (WebCore::GPURenderPipelineColorAttachmentDescriptor::metal const): Ditto.
1782
1783         * platform/graphics/metal/GPURenderPipelineDescriptorMetal.mm:
1784         (WebCore::GPURenderPipelineDescriptor::GPURenderPipelineDescriptor): Ditto.
1785         (WebCore::GPURenderPipelineDescriptor::depthAttachmentPixelFormat const): Ditto.
1786         (WebCore::GPURenderPipelineDescriptor::setDepthAttachmentPixelFormat const): Ditto.
1787         (WebCore::GPURenderPipelineDescriptor::setVertexFunction const): Ditto.
1788         (WebCore::GPURenderPipelineDescriptor::setFragmentFunction const): Ditto.
1789         (WebCore::GPURenderPipelineDescriptor::colorAttachments const): Ditto.
1790         (WebCore::GPURenderPipelineDescriptor::reset const): Ditto.
1791         (WebCore::GPURenderPipelineDescriptor::metal const): Ditto.
1792
1793         * platform/graphics/metal/GPURenderPipelineStateMetal.mm:
1794         (WebCore::GPURenderPipelineState::GPURenderPipelineState): Ditto.
1795         (WebCore::GPURenderPipelineState::label const): Ditto.
1796         (WebCore::GPURenderPipelineState::setLabel const): Ditto. This is one of the
1797         functions that was calling a method that does not exist. Added a comment.
1798         (WebCore::GPURenderPipelineState::metal const): Ditto.
1799
1800         * platform/graphics/metal/GPUTextureDescriptorMetal.mm:
1801         (WebCore::GPUTextureDescriptor::GPUTextureDescriptor): Ditto.
1802         (WebCore::GPUTextureDescriptor::width const): Ditto.
1803         (WebCore::GPUTextureDescriptor::setWidth const): Ditto.
1804         (WebCore::GPUTextureDescriptor::height const): Ditto.
1805         (WebCore::GPUTextureDescriptor::setHeight const): Ditto.
1806         (WebCore::GPUTextureDescriptor::sampleCount const): Ditto.
1807         (WebCore::GPUTextureDescriptor::setSampleCount const): Ditto.
1808         (WebCore::GPUTextureDescriptor::textureType const): Ditto.
1809         (WebCore::GPUTextureDescriptor::setTextureType const): Ditto.
1810         (WebCore::GPUTextureDescriptor::storageMode const): Ditto.
1811         (WebCore::GPUTextureDescriptor::setStorageMode const): Ditto.
1812         (WebCore::GPUTextureDescriptor::usage const): Ditto.
1813         (WebCore::GPUTextureDescriptor::setUsage const): Ditto.
1814         (WebCore::GPUTextureDescriptor::metal const): Ditto.
1815
1816         * platform/graphics/metal/GPUTextureMetal.mm:
1817         (WebCore::GPUTexture::GPUTexture): Ditto.
1818         (WebCore::GPUTexture::width const): Ditto.
1819         (WebCore::GPUTexture::height const): Ditto.
1820         (WebCore::GPUTexture::metal const): Ditto.
1821
1822         * platform/graphics/gpu/GPUBuffer.cpp: Removed unused stubs.
1823         (WebCore::GPUBuffer::length const): Moved this function here since it has
1824         a useful platform-independent implementation.
1825
1826         * platform/graphics/gpu/GPUBuffer.h: Use OBJC_PROTOCOL for MTLBuffer.
1827         Did the other thigs mentioned above: USE(METAL), remove WEBCORE_EXPORT,
1828         no longer be RefCounted, etc.
1829
1830         * platform/graphics/gpu/GPUCommandBuffer.cpp: Ditto.
1831         * platform/graphics/gpu/GPUCommandBuffer.h: Ditto. Use OBJC_PROTOCOL
1832         for MTLCommandBuffer.
1833
1834         * platform/graphics/gpu/GPUCommandQueue.cpp: Ditto.
1835         * platform/graphics/gpu/GPUCommandQueue.h: Ditto. Use OBJC_PROTOCOL for
1836         MTLCommandQueue.
1837
1838         * platform/graphics/gpu/GPUComputeCommandEncoder.cpp: Ditto.
1839         * platform/graphics/gpu/GPUComputeCommandEncoder.h: Ditto. Use OBJC_PROTOCOL for
1840         MTLComputeCommandEncoder.
1841
1842         * platform/graphics/gpu/GPUComputePipelineState.cpp: Ditto.
1843         * platform/graphics/gpu/GPUComputePipelineState.h: Ditto. Use OBJC_PROTOCOL for
1844         MTLComputePipelineState.
1845
1846         * platform/graphics/gpu/GPUDepthStencilDescriptor.cpp: Ditto.
1847         * platform/graphics/gpu/GPUDepthStencilDescriptor.h: Ditto.
1848
1849         * platform/graphics/gpu/GPUDepthStencilState.cpp: Ditto.
1850         * platform/graphics/gpu/GPUDepthStencilState.h: Ditto. Use OBJC_PROTOCOL for
1851         MTLDepthStencilState.
1852
1853         * platform/graphics/gpu/GPUDevice.cpp: Ditto.
1854         * platform/graphics/gpu/GPUDevice.h: Ditto. Use OBJC_PROTOCOL for MTLDevice.
1855
1856         * platform/graphics/gpu/GPUDrawable.cpp: Ditto.
1857         * platform/graphics/gpu/GPUDrawable.h: Ditto. Use OBJC_PROTOCOL for
1858         MTLDrawable and MTLTexture.
1859
1860         * platform/graphics/gpu/GPUEnums.h: Tweaked formatting.
1861
1862         * platform/graphics/gpu/GPUFunction.cpp: Ditto.
1863         * platform/graphics/gpu/GPUFunction.h: Ditto. Use OBJC_PROTOCOL for
1864         MTLFunction.
1865
1866         * platform/graphics/gpu/GPULibrary.cpp: Ditto.
1867         * platform/graphics/gpu/GPULibrary.h: Ditto. Use OBJC_PROTOCOL for
1868         MTLLibrary.
1869
1870         * platform/graphics/gpu/GPURenderCommandEncoder.cpp: Ditto.
1871         * platform/graphics/gpu/GPURenderCommandEncoder.h: Ditto.
1872         Use OBJC_PROTOCOL for MTLRenderCommandEncoder.
1873
1874         * platform/graphics/gpu/GPURenderPassAttachmentDescriptor.cpp: Ditto.
1875         * platform/graphics/gpu/GPURenderPassAttachmentDescriptor.h: Ditto.
1876
1877         * platform/graphics/gpu/GPURenderPassColorAttachmentDescriptor.cpp: Ditto.
1878         * platform/graphics/gpu/GPURenderPassColorAttachmentDescriptor.h: Ditto.
1879
1880         * platform/graphics/gpu/GPURenderPassDepthAttachmentDescriptor.cpp: Ditto.
1881         * platform/graphics/gpu/GPURenderPassDepthAttachmentDescriptor.h: Ditto.
1882
1883         * platform/graphics/gpu/GPURenderPassDescriptor.cpp: Ditto.
1884         * platform/graphics/gpu/GPURenderPassDescriptor.h: Ditto.
1885
1886         * platform/graphics/gpu/GPURenderPipelineColorAttachmentDescriptor.cpp: Ditto.
1887         * platform/graphics/gpu/GPURenderPipelineColorAttachmentDescriptor.h: Ditto.
1888
1889         * platform/graphics/gpu/GPURenderPipelineDescriptor.cpp: Ditto.
1890         * platform/graphics/gpu/GPURenderPipelineDescriptor.h: Ditto.
1891
1892         * platform/graphics/gpu/GPURenderPipelineState.cpp: Ditto.
1893         * platform/graphics/gpu/GPURenderPipelineState.h: Ditto. Use OBJC_PROTOCOL
1894         for MTLRenderPipelineState.
1895
1896         * platform/graphics/gpu/GPUSize.h: Use "unsigned" instead of "unsigned long".
1897
1898         * platform/graphics/gpu/GPUTexture.cpp: Ditto.
1899         * platform/graphics/gpu/GPUTexture.h: Ditto. Use OBJC_PROTOCOL for
1900         MTLTexture.
1901
1902         * platform/graphics/gpu/GPUTextureDescriptor.cpp: Ditto.
1903         * platform/graphics/gpu/GPUTextureDescriptor.h: Ditto.
1904
1905 2018-07-26  Zalan Bujtas  <zalan@apple.com>
1906
1907         [LFC][Floating] Add skeleton for basic positioning.
1908         https://bugs.webkit.org/show_bug.cgi?id=187974
1909
1910         Reviewed by Antti Koivisto.
1911
1912         Add floating boxes to an empty floating context.
1913
1914         * layout/FloatingContext.cpp:
1915         (WebCore::Layout::FloatingContext::FloatingContext):
1916         (WebCore::Layout::FloatingContext::computePosition):
1917         * layout/FloatingContext.h:
1918         (WebCore::Layout::FloatingContext::floatingState const):
1919         (WebCore::Layout::FloatingContext::layoutContext const):
1920         * layout/FloatingState.cpp:
1921         (WebCore::Layout::FloatingState::FloatingState):
1922         (WebCore::Layout::FloatingState::append):
1923         * layout/FloatingState.h:
1924         (WebCore::Layout::FloatingState::create):
1925         (WebCore::Layout::FloatingState::isEmpty const):
1926         (WebCore::Layout::FloatingState::layoutContext const):
1927         * layout/FormattingState.h:
1928         * layout/LayoutContext.cpp:
1929         (WebCore::Layout::LayoutContext::establishedFormattingState):
1930         * layout/LayoutContext.h:
1931         * layout/blockformatting/BlockFormattingContext.cpp:
1932         (WebCore::Layout::BlockFormattingContext::layout const):
1933         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
1934         (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
1935         * layout/blockformatting/BlockFormattingContext.h:
1936         * layout/blockformatting/BlockInvalidation.cpp:
1937         (WebCore::Layout::invalidationStopsAtFormattingContextBoundary):
1938         * layout/layouttree/LayoutBox.cpp:
1939         (WebCore::Layout::Box::isLeftFloatingPositioned const):
1940         (WebCore::Layout::Box::isRightFloatingPositioned const):
1941         * layout/layouttree/LayoutBox.h:
1942
1943 2018-07-26  Zalan Bujtas  <zalan@apple.com>
1944
1945         [LFC][BFC] Do not try to access containing block's height during descendant height computation
1946         https://bugs.webkit.org/show_bug.cgi?id=187970
1947
1948         Reviewed by Antti Koivisto.
1949
1950         Mostly becasue in BFC, we compute the descendents' height first so the containing block's height is probably not computed yet.
1951
1952         * layout/FormattingContextGeometry.cpp:
1953         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedHeightAndMargin):
1954         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
1955         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
1956
1957 2018-07-26  Frederic Wang  <fwang@igalia.com>
1958
1959         Unreviewed, add bug references into FIXME comments for CSSOM View API
1960
1961         * dom/Element.idl:
1962         * page/ScrollToOptions.idl:
1963
1964 2018-07-26  Zalan Bujtas  <zalan@apple.com>
1965
1966         [LFC][BFC] assert-not-implemented-yet on inflow non-replaced height when style is not fixed/auto.
1967         https://bugs.webkit.org/show_bug.cgi?id=187969
1968
1969         Reviewed by Antti Koivisto.
1970
1971         Assert on unsupported height types when computing inflow non-replaced height.
1972
1973         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1974         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
1975
1976 2018-07-26  Antoine Quint  <graouts@apple.com>
1977
1978         [Web Animations] REGRESSION: transition added immediately after element creation doesn't work
1979         https://bugs.webkit.org/show_bug.cgi?id=187942
1980
1981         Reviewed by Dean Jackson.
1982
1983         Tests: webanimations/accelerated-transition-by-removing-property.html
1984                webanimations/partly-accelerated-transition-by-removing-property.html
1985
1986         The Style::TreeResolver::createAnimatedElementUpdate() function expected a flag to be set that indicates that
1987         running animations on an element should yield a change in composited state for that element's layer. We did not
1988         have code accounting for this flag in the Web Animations engine. We now have a resolveAnimationsForElement()
1989         method on DocumentTimeline which looks at all animations resolved on the element and see if all of them are
1990         running accelerated and whether at least one of them is pending. In that case, we set the shouldRecompositeLayer
1991         flag in createAnimatedElementUpdate() to true which guarantees the element's layer will have a backing when
1992         we attempt to start the animation in KeyframeEffectReadOnly::applyPendingAcceleratedActions() where we would
1993         have previously failed to have layer-backed renderer to perform an accelerated animation on (under certain
1994         circumstances, see test).
1995
1996         * animation/DocumentTimeline.cpp:
1997         (WebCore::DocumentTimeline::resolveAnimationsForElement):
1998         * animation/DocumentTimeline.h:
1999         * animation/KeyframeEffectReadOnly.h:
2000         (WebCore::KeyframeEffectReadOnly::hasPendingAcceleratedAction const):
2001         * style/StyleTreeResolver.cpp:
2002         (WebCore::Style::TreeResolver::createAnimatedElementUpdate):
2003
2004 2018-07-25  Chris Dumez  <cdumez@apple.com>
2005
2006         Allow ActiveDOMObject's canSuspend / suspend / resume overrides to destroy ActiveDOMObjects
2007         https://bugs.webkit.org/show_bug.cgi?id=188025
2008
2009         Reviewed by Alex Christensen.
2010
2011         Apply the same logic as in ScriptExecutionContext::stopActiveDOMObjects() to support destruction of
2012         ActiveDOMObjects while we're calling ActiveDOMObject's canSuspend / suspend / resume overrides.
2013
2014         We copy m_activeDOMObjects into a Vector and iterate over the copy instead of m_activeDOMObjects.
2015         Since ActiveDOMObject is not RefCounted or CanMakeWeakPtr, we verify that the raw pointer is still
2016         valid by checking if m_activeDOMObjects still contains it, as we iterate. This is safe as the
2017         ActiveDOMObject destructor removes the object from ScriptExecutionContext::m_activeDOMObjects.
2018         New ActiveDOMObjects with the same pointer value cannot be created while we iterate as we already
2019         prevent the construction of new ActiveDOMObjects while we iterate via RELEASE_ASSERT().
2020
2021         * dom/ScriptExecutionContext.cpp:
2022         (WebCore::ScriptExecutionContext::canSuspendActiveDOMObjectsForDocumentSuspension):
2023         (WebCore::ScriptExecutionContext::forEachActiveDOMObject const):
2024         (WebCore::ScriptExecutionContext::suspendActiveDOMObjects):
2025         (WebCore::ScriptExecutionContext::resumeActiveDOMObjects):
2026         (WebCore::ScriptExecutionContext::stopActiveDOMObjects):
2027         (WebCore::ScriptExecutionContext::willDestroyActiveDOMObject):
2028         * dom/ScriptExecutionContext.h:
2029
2030 2018-07-25  Justin Fan  <justin_fan@apple.com>
2031
2032         Systems with no NSScreens hitting assertion in rendererIDForDisplay when creating WebGL context
2033         https://bugs.webkit.org/show_bug.cgi?id=188023
2034         <rdar://problem/42476622>
2035
2036         Reviewed by Simon Fraser.
2037
2038         On systems with no NSScreens, PlatformScreenMac's screenData map is not populated; rendererIDForDisplay
2039         will thus hit an assertion rather than returning 0. Removing the assertion for now. 
2040
2041         Covered by existing tests.
2042
2043         * platform/mac/PlatformScreenMac.mm:
2044         (WebCore::rendererIDForDisplay):
2045
2046 2018-07-25  Zalan Bujtas  <zalan@apple.com>
2047
2048         Build fix after r234215. Unreviewed.
2049
2050         * rendering/RenderTheme.cpp:
2051
2052 2018-07-25  Zalan Bujtas  <zalan@apple.com>
2053
2054         REGRESSION(r227577) Text on TV & Movies page doesn't wrap properly in iTunes
2055         https://bugs.webkit.org/show_bug.cgi?id=188018
2056         <rdar://problem/42517520>
2057
2058         Reviewed by Dean Jackson.
2059
2060         Manual rollout of r227577.
2061
2062         Test: fast/overflow/line-clamp-with-text-shadow.html
2063
2064         * Sources.txt:
2065         * WebCore.xcodeproj/project.pbxproj:
2066         * css/CSSComputedStyleDeclaration.cpp:
2067         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
2068         * css/CSSProperties.json:
2069         * css/StyleBuilderCustom.h:
2070         (WebCore::StyleBuilderCustom::applyValueWebkitLinesClamp): Deleted.
2071         * css/parser/CSSParserContext.cpp:
2072         (WebCore::CSSParserContext::CSSParserContext):
2073         * css/parser/CSSParserContext.h:
2074         (WebCore::CSSParserContextHash::hash):
2075         * css/parser/CSSPropertyParser.cpp:
2076         (WebCore::CSSPropertyParser::parseSingleValue):
2077         (WebCore::consumeLinesClamp): Deleted.
2078         * page/Settings.yaml:
2079         * rendering/RenderBlockFlow.cpp:
2080         (WebCore::RenderBlockFlow::willCreateColumns const):
2081         (WebCore::getHeightForLineCount):
2082         (WebCore::RenderBlockFlow::heightForLineCount):
2083         (WebCore::RenderBlockFlow::layoutExcludedChildren):
2084         (WebCore::RenderBlockFlow::logicalHeightForLineCount): Deleted.
2085         (WebCore::RenderBlockFlow::logicalHeightExcludingLineCount): Deleted.
2086         * rendering/RenderBlockFlow.h:
2087         * rendering/RenderDeprecatedFlexibleBox.cpp:
2088         (WebCore::RenderDeprecatedFlexibleBox::applyLineClamp):
2089         * rendering/RenderFragmentContainer.cpp:
2090         (WebCore::RenderFragmentContainer::pageLogicalHeightForOffset const): Deleted.
2091         * rendering/RenderFragmentContainer.h:
2092         * rendering/RenderFragmentedFlow.cpp:
2093         (WebCore::RenderFragmentedFlow::validateFragments):
2094         (WebCore::RenderFragmentedFlow::pageLogicalHeightForOffset const):
2095         (WebCore::RenderFragmentedFlow::pageRemainingLogicalHeightForOffset const):
2096         * rendering/RenderFragmentedFlow.h:
2097         * rendering/RenderLinesClampFlow.cpp: Removed.
2098         * rendering/RenderLinesClampFlow.h: Removed.
2099         * rendering/RenderLinesClampSet.cpp: Removed.
2100         * rendering/RenderLinesClampSet.h: Removed.
2101         * rendering/RenderMultiColumnFlow.cpp:
2102         (WebCore::RenderMultiColumnFlow::isColumnSpanningDescendant const): Deleted.
2103         (WebCore::RenderMultiColumnFlow::createMultiColumnSet): Deleted.
2104         * rendering/RenderMultiColumnFlow.h:
2105         (WebCore::RenderMultiColumnFlow::multiColumnBlockFlow const): Deleted.
2106         (WebCore::RenderMultiColumnFlow::hasColumnSpanner const): Deleted.
2107         (WebCore::RenderMultiColumnFlow::findColumnSpannerPlaceholder const): Deleted.
2108         (WebCore::RenderMultiColumnFlow::columnCount const): Deleted.
2109         (WebCore::RenderMultiColumnFlow::columnWidth const): Deleted.
2110         (WebCore::RenderMultiColumnFlow::columnHeightAvailable const): Deleted.
2111         (WebCore::RenderMultiColumnFlow::setColumnHeightAvailable): Deleted.
2112         (WebCore::RenderMultiColumnFlow::inBalancingPass const): Deleted.
2113         (WebCore::RenderMultiColumnFlow::setInBalancingPass): Deleted.
2114         (WebCore::RenderMultiColumnFlow::needsHeightsRecalculation const): Deleted.
2115         (WebCore::RenderMultiColumnFlow::setNeedsHeightsRecalculation): Deleted.
2116         (WebCore::RenderMultiColumnFlow::shouldRelayoutForPagination const): Deleted.
2117         (WebCore::RenderMultiColumnFlow::setColumnCountAndWidth): Deleted.
2118         (WebCore::RenderMultiColumnFlow::progressionIsInline const): Deleted.
2119         (WebCore::RenderMultiColumnFlow::setProgressionIsInline): Deleted.
2120         (WebCore::RenderMultiColumnFlow::progressionIsReversed const): Deleted.
2121         (WebCore::RenderMultiColumnFlow::setProgressionIsReversed): Deleted.
2122         (WebCore::RenderMultiColumnFlow::spannerMap): Deleted.
2123         * rendering/RenderMultiColumnSet.cpp:
2124         (WebCore::RenderMultiColumnSet::collectLayerFragments):
2125         (WebCore::RenderMultiColumnSet::columnTranslationForOffset const):
2126         * rendering/RenderMultiColumnSet.h:
2127         (WebCore::RenderMultiColumnSet::multiColumnBlockFlow const): Deleted.
2128         (WebCore::RenderMultiColumnSet::multiColumnFlow const): Deleted.
2129         (WebCore::RenderMultiColumnSet::logicalTopInFragmentedFlow const): Deleted.
2130         (WebCore::RenderMultiColumnSet::logicalBottomInFragmentedFlow const): Deleted.
2131         (WebCore::RenderMultiColumnSet::logicalHeightInFragmentedFlow const): Deleted.
2132         (WebCore::RenderMultiColumnSet::computedColumnCount const): Deleted.
2133         (WebCore::RenderMultiColumnSet::computedColumnWidth const): Deleted.
2134         (WebCore::RenderMultiColumnSet::computedColumnHeight const): Deleted.
2135         (WebCore::RenderMultiColumnSet::columnHeightComputed const): Deleted.
2136         (WebCore::RenderMultiColumnSet::setComputedColumnWidthAndCount): Deleted.
2137         (WebCore::RenderMultiColumnSet::updateMinimumColumnHeight): Deleted.
2138         (WebCore::RenderMultiColumnSet::minimumColumnHeight const): Deleted.
2139         (WebCore::RenderMultiColumnSet::forcedBreaksCount const): Deleted.
2140         (WebCore::RenderMultiColumnSet::hasBeenFlowed const): Deleted.
2141         (WebCore::RenderMultiColumnSet::skipLayerFragmentCollectionForColumn const): Deleted.
2142         (WebCore::RenderMultiColumnSet::customBlockProgressionAdjustmentForColumn const): Deleted.
2143         (WebCore::RenderMultiColumnSet::ContentRun::ContentRun): Deleted.
2144         (WebCore::RenderMultiColumnSet::ContentRun::assumedImplicitBreaks const): Deleted.
2145         (WebCore::RenderMultiColumnSet::ContentRun::assumeAnotherImplicitBreak): Deleted.
2146         (WebCore::RenderMultiColumnSet::ContentRun::breakOffset const): Deleted.
2147         (WebCore::RenderMultiColumnSet::ContentRun::columnLogicalHeight const): Deleted.
2148         * rendering/RenderObject.h:
2149         (WebCore::RenderObject::isRenderLinesClampFlow const): Deleted.
2150         (WebCore::RenderObject::isRenderLinesClampSet const): Deleted.
2151         * rendering/style/LineClampValue.h:
2152         (WebCore::LinesClampValue::LinesClampValue): Deleted.
2153         (WebCore::LinesClampValue::isNone const): Deleted.
2154         (WebCore::LinesClampValue::operator== const): Deleted.
2155         (WebCore::LinesClampValue::operator!= const): Deleted.
2156         (WebCore::LinesClampValue::start const): Deleted.
2157         (WebCore::LinesClampValue::end const): Deleted.
2158         (WebCore::LinesClampValue::center const): Deleted.
2159         * rendering/style/RenderStyle.h:
2160         (WebCore::RenderStyle::lineClamp const):
2161         (WebCore::RenderStyle::setLineClamp):
2162         (WebCore::RenderStyle::initialLineClamp):
2163         (WebCore::RenderStyle::hasInlineColumnAxis const):
2164         (WebCore::RenderStyle::linesClamp const): Deleted.
2165         (WebCore::RenderStyle::hasLinesClamp const): Deleted.
2166         (WebCore::RenderStyle::setLinesClamp): Deleted.
2167         (WebCore::RenderStyle::initialLinesClamp): Deleted.
2168         * rendering/style/StyleRareNonInheritedData.cpp:
2169         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
2170         (WebCore::StyleRareNonInheritedData::operator== const):
2171         * rendering/style/StyleRareNonInheritedData.h:
2172         * rendering/updating/RenderTreeBuilderMultiColumn.cpp:
2173         (WebCore::isValidColumnSpanner):
2174         (WebCore::RenderTreeBuilder::MultiColumn::createFragmentedFlow):
2175         (WebCore::RenderTreeBuilder::MultiColumn::processPossibleSpannerDescendant):
2176
2177 2018-07-25  Chris Dumez  <cdumez@apple.com>
2178
2179         navigator.userAgent may return outdated value after webView.customUserAgent is set
2180         https://bugs.webkit.org/show_bug.cgi?id=188009
2181         <rdar://problem/42566456>
2182
2183         Reviewed by Alex Christensen.
2184
2185         Invalidate the navigator.userAgent cache whenever the user agent gets changed to avoid exposing
2186         outdated values to JavaScript.
2187
2188         * page/Navigator.cpp:
2189         (WebCore::Navigator::userAgentChanged):
2190         * page/Navigator.h:
2191         * page/NavigatorID.idl:
2192         * page/Page.cpp:
2193         (WebCore::Page::userAgentChanged):
2194         * page/Page.h:
2195
2196 2018-07-25  David Fenton  <david_fenton@apple.com>
2197
2198         Unreviewed, rolling out r234187.
2199
2200         the layout test added with this change is flaky on the bots
2201
2202         Reverted changeset:
2203
2204         "Animation stops with object-fit:contain on an animated 2d
2205         canvas"
2206         https://bugs.webkit.org/show_bug.cgi?id=187840
2207         https://trac.webkit.org/changeset/234187
2208
2209 2018-07-25  Chris Dumez  <cdumez@apple.com>
2210
2211         Turn assertion preventing removal of ActiveDOMObjects while we iterate over them into a RELEASE_ASSERT
2212         https://bugs.webkit.org/show_bug.cgi?id=187978
2213
2214         Reviewed by Eric Carlson.
2215
2216         Turn assertion preventing removal of ActiveDOMObjects while we iterate over them into a RELEASE_ASSERT.
2217         If code does this, this leads to hard to investigate crashes such as rdar://problem/42160890. With a
2218         release assertion, we would find the culprits right away. The assertion guarding against addition of
2219         ActiveDOMObjects while we iterate is already a RELEASE_ASSERT.
2220
2221         * dom/ScriptExecutionContext.cpp:
2222         (WebCore::ScriptExecutionContext::canSuspendActiveDOMObjectsForDocumentSuspension):
2223         (WebCore::ScriptExecutionContext::suspendActiveDOMObjects):
2224         (WebCore::ScriptExecutionContext::resumeActiveDOMObjects):
2225         (WebCore::ScriptExecutionContext::willDestroyActiveDOMObject):
2226         * dom/ScriptExecutionContext.h:
2227
2228 2018-07-24  Chris Dumez  <cdumez@apple.com>
2229
2230         REGRESSION (r219757): Accessing response getter of XHR instance from IFRAME sets constructor to Object from the IFRAME
2231         https://bugs.webkit.org/show_bug.cgi?id=187411
2232         <rdar://problem/41920593>
2233
2234         Reviewed by Sam Weinig.
2235
2236         Update JSXMLHttpRequest::response() to use the XMLHttpRequest's global object exec when constructing a JSONObject
2237         for the response instead of the caller's exec.
2238
2239         Test: http/tests/xmlhttprequest/xhr-response-constructor-subframe.html
2240
2241         * bindings/js/JSXMLHttpRequestCustom.cpp:
2242         (WebCore::JSXMLHttpRequest::response const):
2243
2244 2018-07-24  Simon Fraser  <simon.fraser@apple.com>
2245
2246         Animation stops with object-fit:contain on an animated 2d canvas
2247         https://bugs.webkit.org/show_bug.cgi?id=187840
2248
2249         Reviewed by Zalan Bujtas.
2250         
2251         If a canvas has object-fit: cover or contain, repaints need to mapped through
2252         the rect that is used to position the canvas in the element bounds, which is replacedContentRect().
2253         
2254         Add a version of replacedContentRect() that doesn't require passing the intrinsicSize() since
2255         all but RenderVideo just pass the RenderReplaced's intrinsicSize.
2256
2257         Test: fast/repaint/canvas-object-fit.html
2258
2259         * html/HTMLCanvasElement.cpp:
2260         (WebCore::HTMLCanvasElement::didDraw):
2261         * rendering/RenderHTMLCanvas.cpp:
2262         (WebCore::RenderHTMLCanvas::paintReplaced):
2263         * rendering/RenderImage.cpp:
2264         (WebCore::RenderImage::updateInnerContentRect):
2265         (WebCore::RenderImage::paintReplaced):
2266         * rendering/RenderLayerBacking.cpp:
2267         (WebCore::RenderLayerBacking::contentsBox const):
2268         * rendering/RenderReplaced.h:
2269         (WebCore::RenderReplaced::replacedContentRect const):
2270         * rendering/shapes/ShapeOutsideInfo.cpp:
2271         (WebCore::ShapeOutsideInfo::createShapeForImage const):
2272
2273 2018-07-24  Basuke Suzuki  <Basuke.Suzuki@sony.com>
2274
2275         [Curl] Add support for wss:// websockets
2276         https://bugs.webkit.org/show_bug.cgi?id=172630
2277
2278         Reviewed by Fujii Hironori.
2279
2280         To support secure WebSocket connection, it is almost rewritten by using existing
2281         backend for CurlHandle to handle TLS connection and proxy support.
2282
2283         Test: http/tests/websocket/tests/hybi/simple-wss.html
2284
2285         * platform/network/curl/CurlContext.cpp:
2286         (WebCore::CurlSocketHandle::CurlSocketHandle):
2287         (WebCore::CurlSocketHandle::connect):
2288         (WebCore::CurlSocketHandle::send):
2289         (WebCore::CurlSocketHandle::receive):
2290         (WebCore::CurlSocketHandle::wait):
2291         * platform/network/curl/CurlContext.h:
2292         * platform/network/curl/SocketStreamHandleImpl.h:
2293         (WebCore::SocketStreamHandleImpl::SocketData::SocketData): Deleted.
2294         * platform/network/curl/SocketStreamHandleImplCurl.cpp:
2295         (WebCore::SocketStreamHandleImpl::SocketStreamHandleImpl):
2296         (WebCore::SocketStreamHandleImpl::~SocketStreamHandleImpl):
2297         (WebCore::SocketStreamHandleImpl::platformSendInternal):
2298         (WebCore::SocketStreamHandleImpl::platformClose):
2299         (WebCore::SocketStreamHandleImpl::threadEntryPoint):
2300         (WebCore::SocketStreamHandleImpl::handleError):
2301         (WebCore::SocketStreamHandleImpl::stopThread):
2302         (WebCore::createCopy): Deleted.
2303         (WebCore::SocketStreamHandleImpl::readData): Deleted.
2304         (WebCore::SocketStreamHandleImpl::sendData): Deleted.
2305         (WebCore::SocketStreamHandleImpl::waitForAvailableData): Deleted.
2306         (WebCore::SocketStreamHandleImpl::startThread): Deleted.
2307         (WebCore::SocketStreamHandleImpl::didReceiveData): Deleted.
2308         (WebCore::SocketStreamHandleImpl::didOpenSocket): Deleted.
2309
2310 2018-07-24  Tim Horton  <timothy_horton@apple.com>
2311
2312         Enable Web Content Filtering on watchOS
2313         https://bugs.webkit.org/show_bug.cgi?id=187979
2314         <rdar://problem/42559346>
2315
2316         Reviewed by Wenson Hsieh.
2317
2318         * Configurations/FeatureDefines.xcconfig:
2319
2320 2018-07-24  Chris Dumez  <cdumez@apple.com>
2321
2322         Unreviewed, rolling out r233496 and r233571.
2323
2324         Likely cause of <rdar://problem/42160890> and
2325         <rdar://problem/42329658> as ActiveDOMObjects can now be
2326         constructed / destroyed while we are iterating over them.
2327
2328         Reverted changesets:
2329
2330         "Nullptr crash accessing Document in
2331         GenericEventQueue::dispatchOneEvent()"
2332         https://bugs.webkit.org/show_bug.cgi?id=187284
2333         https://trac.webkit.org/changeset/233496
2334
2335         "REGRESSION(r233496): macOS Sierra hits debug assertions in
2336         TrackListBase::suspend"
2337         https://bugs.webkit.org/show_bug.cgi?id=187378
2338         https://trac.webkit.org/changeset/233571
2339
2340 2018-07-24  Aditya Keerthi  <akeerthi@apple.com>
2341
2342         [Datalist][macOS] Display suggestions for input[type=color]
2343         https://bugs.webkit.org/show_bug.cgi?id=187794
2344
2345         Reviewed by Tim Horton.
2346
2347         * html/ColorInputType.cpp:
2348         (WebCore::ColorInputType::shouldRespectListAttribute):
2349
2350 2018-07-24  Ryan Haddad  <ryanhaddad@apple.com>
2351
2352         Unreviewed, rolling out r234121.
2353
2354         Caused perf test failures.
2355
2356         Reverted changeset:
2357
2358         "We should cache the compiled sandbox profile in a data vault"
2359         https://bugs.webkit.org/show_bug.cgi?id=184991
2360         https://trac.webkit.org/changeset/234121
2361
2362 2018-07-24  Antoine Quint  <graouts@apple.com>
2363
2364         [Web Animations] Add an ASSERT() to check the contract that a CSSTransition has a valid effect in setTimingProperties()
2365         https://bugs.webkit.org/show_bug.cgi?id=187954
2366
2367         Reviewed by Dean Jackson.
2368
2369         * animation/CSSTransition.cpp:
2370         (WebCore::CSSTransition::setTimingProperties):
2371
2372 2018-07-24  Antoine Quint  <graouts@apple.com>
2373
2374         [Web Animations] Crash when setting an animation style on an existing animation that had its effect set to null
2375         https://bugs.webkit.org/show_bug.cgi?id=187953
2376
2377         Reviewed by Dean Jackson.
2378
2379         Test: webanimations/setting-css-animation-timing-property-via-style-after-clearing-effect.html
2380
2381         Ensure that we have a valid effect before proceeding to update its timing. 
2382
2383         * animation/CSSAnimation.cpp:
2384         (WebCore::CSSAnimation::syncPropertiesWithBackingAnimation):
2385
2386 2018-07-24  Eric Carlson  <eric.carlson@apple.com>
2387
2388         [MediaStream] Restructure getDisplayMedia classes
2389         https://bugs.webkit.org/show_bug.cgi?id=187905
2390         <rdar://problem/42500215>
2391
2392         Unreviewed build fix.
2393
2394         * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp: 
2395
2396 2018-07-24  Antoine Quint  <graouts@apple.com>
2397
2398         [Web Animations] Crash when setting "animation: none" after clearing an animation's effect
2399         https://bugs.webkit.org/show_bug.cgi?id=187952
2400
2401         Reviewed by Dean Jackson.
2402
2403         Test: webanimations/setting-css-animation-none-after-clearing-effect.html
2404
2405         We need to ensure that the animation we're trying to remove has not had its effect cleared via the
2406         Web Animations API since its creation before trying to check its phase.
2407
2408         * animation/AnimationTimeline.cpp:
2409         (WebCore::AnimationTimeline::cancelOrRemoveDeclarativeAnimation):
2410
2411 2018-07-24  Antoine Quint  <graouts@apple.com>
2412
2413         [Web Animations] Crash accessing CSSAnimation::bindingsCurrentTime when effect has been set to null
2414         https://bugs.webkit.org/show_bug.cgi?id=187950
2415         <rdar://problem/42515747>
2416
2417         Reviewed by Dean Jackson.
2418
2419         Test: webanimations/accessing-current-time-after-clearing-css-animation-effect.html
2420
2421         While a CSSAnimation has an effect created for it by the implementation, the developer may yet manipulate
2422         its effect via the Web Animations API and set it to null. As such, we must not assume it's always non-null.
2423
2424         * animation/CSSAnimation.cpp:
2425         (WebCore::CSSAnimation::bindingsCurrentTime const):
2426
2427 2018-07-24  Zalan Bujtas  <zalan@apple.com>
2428
2429         [LFC][IFC] BlockContainer::establishesInlineFormattingContext should only check the first inflow child.
2430         https://bugs.webkit.org/show_bug.cgi?id=187965
2431
2432         Reviewed by Antti Koivisto.
2433
2434         * layout/layouttree/LayoutBlockContainer.cpp:
2435         (WebCore::Layout::BlockContainer::establishesInlineFormattingContext const):
2436
2437 2018-07-24  Myles C. Maxfield  <mmaxfield@apple.com>
2438
2439         [Cocoa] Stop crashing in lastResortFallbackFont()
2440         https://bugs.webkit.org/show_bug.cgi?id=187936
2441
2442         Reviewed by Jon Lee.
2443
2444         CoreText can get into a state where both Times and Lucida Grande are inaccessible.
2445         Instead of crashing, we should use the real LastResort, which is backed by a section
2446         in the .rodata of the CoreText dylib, and as such should always exist.
2447
2448         * platform/graphics/FontCache.cpp:
2449         (WebCore::FontCache::fontForFamily):
2450         * platform/graphics/cocoa/FontCacheCoreText.cpp:
2451         (WebCore::FontCache::lastResortFallbackFont):
2452
2453 2018-07-24  Daniel Bates  <dabates@apple.com>
2454
2455         Cannot view PDF's on my.gov.au: "Refused to load https://my.gov.au/attachment/viewAttachment because it
2456         appears in neither the object-src directive nor the default-src directive of the Content Security Policy"
2457         https://bugs.webkit.org/show_bug.cgi?id=187870
2458         <rdar://problem/41190880>
2459
2460         Reviewed by Dean Jackson.
2461
2462         Fixes an issue where opening attachments on my.gov.au would show a "Blocked Plug-in" message.
2463
2464         Opening an attachment on my.gov.au opens a same-origin plugin document in a child window. Currently
2465         same-origin plugin documents inherit their CSP policy from their opener. If the opener's CSP policy
2466         disallows embedding plugins then the plugin document would be blocked from loading a plugin. For now
2467         we relax the inheritance model such that we only inherit the plugin-types and report-uri directives
2468         from the opener.
2469
2470         Developers that want to block plugin content from being loaded in a same-origin child window must now
2471         serve such plugin content with a CSP policy that includes "object-src 'none'". This matches the behavior
2472         described in the second Note in section object-src of the CSP 3 spec: <https://w3c.github.io/webappsec-csp/#directive-object-src>
2473         (Editor's Draft, 10 July 2018). It also makes the behavior in WebKit more closely aligned with the
2474         behavior of Chrome and Firefox.
2475
2476         Tests: http/tests/security/contentSecurityPolicy/same-origin-plugin-document-allowed-in-child-window.html
2477                http/tests/security/contentSecurityPolicy/same-origin-plugin-document-blocked-in-child-window-report.php
2478                http/tests/security/contentSecurityPolicy/same-origin-plugin-document-with-csp-blocked-in-child-window.html
2479
2480         * dom/Document.cpp:
2481         (WebCore::Document::initContentSecurityPolicy): For plugin documents that have an opener call ContentSecurityPolicy::createPolicyForPluginDocumentFrom()
2482         to only inherit the plugin-types and report-uri directives from its opener's CSP policy. Otherwise, call ContentSecurityPolicy::copyStateFrom()
2483         to inherit all directives from the owner frame as we do now.
2484         * page/csp/ContentSecurityPolicy.cpp:
2485         (WebCore::ContentSecurityPolicy::createPolicyForPluginDocumentFrom): Create a new policy from the specified policy
2486         inheriting only the plugin-types and report-uri directives.
2487         * page/csp/ContentSecurityPolicy.h: Define a new PolicyFrom enumerator, InheritedForPluginDocument, for plugin documents
2488         loaded in a child window.
2489         * page/csp/ContentSecurityPolicyDirectiveList.cpp:
2490         (WebCore::ContentSecurityPolicyDirectiveList::parse): When policyFrom is InheritedForPluginDocument then only
2491         recognize the plugin-types and report-uri directives when parsing the policy.
2492
2493 2018-07-24  Daniel Bates  <dabates@apple.com>
2494
2495         Rename Document::firstPartyForSameSiteCookies() to siteForCookies()
2496         https://bugs.webkit.org/show_bug.cgi?id=187892
2497
2498         Reviewed by Dean Jackson.
2499
2500         Standardize on the spec. language "site for cookies" for the names of the setter and getter
2501         on Document. The latest description of Same-Site cookies is in <https://httpwg.org/http-extensions/rfc6265bis.html>.
2502
2503         No functionality changed. So, no new tests.
2504
2505         * dom/Document.h:
2506         (WebCore::Document::siteForCookies const):
2507         (WebCore::Document::setSiteForCookies):
2508         (WebCore::Document::firstPartyForSameSiteCookies const): Deleted.
2509         (WebCore::Document::setFirstPartyForSameSiteCookies): Deleted.
2510         * loader/FrameLoader.cpp:
2511         (WebCore::FrameLoader::setFirstPartyForCookies):
2512         (WebCore::FrameLoader::addSameSiteInfoToRequestIfNeeded):
2513         * workers/service/context/ServiceWorkerThreadProxy.cpp:
2514         (WebCore::createPageForServiceWorker):
2515         * xml/XSLTProcessor.cpp:
2516         (WebCore::XSLTProcessor::createDocumentFromSource):
2517
2518 2018-07-24  Ross Kirsling  <ross.kirsling@sony.com>
2519
2520         WebCore::URL::hostIsIPAddress needs a Windows implementation
2521         https://bugs.webkit.org/show_bug.cgi?id=187859
2522
2523         Reviewed by Fujii Hironori.
2524
2525         * platform/URL.cpp:
2526         (WebCore::isIPv4Address): Added.
2527         (WebCore::isIPv6Address): Added.
2528         (WebCore::URL::hostIsIPAddress):
2529         Turn this stub into a platform-agnostic default implementation.
2530
2531 2018-07-24  Eric Carlson  <eric.carlson@apple.com>
2532
2533         [MediaStream] Restructure getDisplayMedia classes
2534         https://bugs.webkit.org/show_bug.cgi?id=187905
2535
2536         Reviewed by Dean Jackson.
2537
2538         No new tests, no functional changes.
2539
2540         * platform/mediastream/CaptureDeviceManager.h:
2541         (WebCore::CaptureDeviceManager::refreshCaptureDevices): Deleted, no need for it to be a 
2542         virtual method.
2543         * platform/mediastream/mac/AVCaptureDeviceManager.h:
2544
2545         * platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.h: refreshCaptureDevices is
2546         no longer virtual.
2547
2548         * platform/mediastream/mac/DisplayCaptureManagerCocoa.cpp:
2549         (WebCore::DisplayCaptureManagerCocoa::captureDevices):
2550         (WebCore::DisplayCaptureManagerCocoa::updateDisplayCaptureDevices): Moved functionality 
2551         to ScreenDisplayCaptureSourceMac.
2552         (WebCore::DisplayCaptureManagerCocoa::screenCaptureDeviceWithPersistentID): Ditto.
2553         (WebCore::displayReconfigurationCallBack): Deleted, moved to ScreenDisplayCaptureSourceMac.
2554         (WebCore::DisplayCaptureManagerCocoa::~DisplayCaptureManagerCocoa): Deleted.
2555         (WebCore::DisplayCaptureManagerCocoa::refreshCaptureDevices): Deleted.
2556         * platform/mediastream/mac/DisplayCaptureManagerCocoa.h:
2557
2558         * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
2559         (WebCore::roundUpToMacroblockMultiple): Moved from ScreenDisplayCaptureSourceMac.
2560         (WebCore::DisplayCaptureSourceCocoa::applySize): Ditto.
2561         (WebCore::DisplayCaptureSourceCocoa::sampleBufferFromPixelBuffer): Ditto.
2562         (WebCore::DisplayCaptureSourceCocoa::pixelBufferFromIOSurface): Ditto.
2563         * platform/mediastream/mac/DisplayCaptureSourceCocoa.h:
2564
2565         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h:
2566         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
2567         (WebCore::updateDisplayID):
2568         (WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream): Fix log message.
2569         (WebCore::ScreenDisplayCaptureSourceMac::startDisplayStream): Ditto.
2570         (WebCore::ScreenDisplayCaptureSourceMac::applySize): Update for base class changes.
2571         (WebCore::ScreenDisplayCaptureSourceMac::applyFrameRate): Ditto.
2572         (WebCore::ScreenDisplayCaptureSourceMac::frameAvailable): Ditto.
2573         (WebCore::ScreenDisplayCaptureSourceMac::screenCaptureDeviceWithPersistentID): Moved from
2574         DisplayCaptureManagerCocoa.
2575         (WebCore::ScreenDisplayCaptureSourceMac::screenCaptureDevices): Ditto.
2576         (WebCore::roundUpToMacroblockMultiple): Moved to DisplayCaptureSourceCocoa.
2577         (WebCore::ScreenDisplayCaptureSourceMac::updateDisplayID): Ditto.
2578         (WebCore::ScreenDisplayCaptureSourceMac::sampleBufferFromPixelBuffer): Ditto.
2579         (WebCore::ScreenDisplayCaptureSourceMac::pixelBufferFromIOSurface): Ditto.
2580
2581 2018-07-24  Zalan Bujtas  <zalan@apple.com>
2582
2583         [LFC] Move geometry data structures to a dedicated file
2584         https://bugs.webkit.org/show_bug.cgi?id=187939
2585
2586         Reviewed by Antti Koivisto.
2587
2588         * WebCore.xcodeproj/project.pbxproj:
2589         * layout/FormattingContext.h:
2590         (WebCore::Layout::FormattingContext::Geometry::Position::operator LayoutPoint const): Deleted.
2591         * layout/FormattingContextGeometry.cpp:
2592         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
2593         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
2594         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
2595         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
2596         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedHeightAndMargin):
2597         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
2598         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin):
2599         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
2600         (WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry):
2601         (WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry):
2602         (WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin):
2603         (WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin):
2604         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
2605         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
2606         (WebCore::Layout::FormattingContext::Geometry::computedBorder):
2607         (WebCore::Layout::FormattingContext::Geometry::computedPadding):
2608         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue):
2609         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue):
2610         * layout/blockformatting/BlockFormattingContext.h:
2611         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2612         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
2613         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
2614         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
2615         (WebCore::Layout::BlockFormattingContext::Geometry::staticPosition):
2616         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowPositionedPosition):
2617         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
2618         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):
2619         * layout/displaytree/DisplayBox.h:
2620         (WebCore::Display::Box::setHorizontalMargin):
2621         (WebCore::Display::Box::setVerticalMargin):
2622         (WebCore::Display::Box::setVerticalNonCollapsedMargin):
2623         (WebCore::Display::Box::setBorder):
2624         (WebCore::Display::Box::setPadding):
2625
2626 2018-07-24  Thibault Saunier  <tsaunier@igalia.com>
2627
2628         [GStreamer] Implement bitrate modulation support in GStreamer based libwebrtc Encoders
2629         https://bugs.webkit.org/show_bug.cgi?id=187643
2630
2631         Reviewed by Philippe Normand.
2632
2633         Problem being that we do not have a proper unified encoder API in GStreamer, some work
2634         started at https://bugzilla.gnome.org/show_bug.cgi?id=796716 but it is quite controversial
2635         and meanwhile we should just move forward working around that limitation.
2636
2637         Source/WebCore:
2638         * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
2639         (WebCore::GStreamerVideoEncoder::GStreamerVideoEncoder):
2640         (WebCore::GStreamerVideoEncoder::InitEncode):
2641         (WebCore::GStreamerVideoEncoder::getBitrateSetter):
2642         (WebCore::GStreamerVideoEncoder::createEncoder):
2643         (WebCore::GStreamerVideoEncoder::AddCodecIfSupported):
2644         (WebCore::GStreamerVideoEncoder::SetRestrictionCaps):
2645         (WebCore::GStreamerVideoEncoder::CreateEncoder): Deleted.
2646
2647 2018-07-24  Zan Dobersek  <zdobersek@igalia.com>
2648
2649         REGRESSION(r234055): inverted return values in MediaPlayer::wouldTaintOrigin()
2650         https://bugs.webkit.org/show_bug.cgi?id=187944
2651
2652         Reviewed by Carlos Garcia Campos.
2653
2654         The MediaPlayer::wouldTaintOrigin(), as introduced in r234055, should
2655         return false when the URL protocol is `data:`, and should return true
2656         when the given SecurityOrigin cannot access the media URL.
2657
2658         This matches behavior of CanvasRenderingContext::wouldTaintOrigin()
2659         which the new method falls back to when the MediaPlayerPrivate
2660         implementation doesn't or can't determine the would-taint result.
2661
2662         This fixes a bunch of failing and timing-out WebGL test cases on ports
2663         using GStreamer (on which the MediaPlayerPrivate derivate doesn't
2664         implement the wouldTaintOrigin() method).
2665
2666         * platform/graphics/MediaPlayer.cpp:
2667         (WebCore::MediaPlayer::wouldTaintOrigin const):
2668
2669 2018-07-24  Zan Dobersek  <zdobersek@igalia.com>
2670
2671         [TextureMapper] Separate repaint counter state from debug visuals
2672         https://bugs.webkit.org/show_bug.cgi?id=187946
2673
2674         Reviewed by Carlos Garcia Campos.
2675
2676         Instead of managing the repaint counter visibility along with the
2677         debug border visuals, do that together with the repaint count value.
2678
2679         TextureMapperLayer::setRepaintCount() is renamed to setRepaintCounter()
2680         and now also sets the repaint counter visibility state instead of the
2681         setDebugVisuals() method.
2682
2683         GraphicsLayerTextureMapper implementation is adjusted appropriately.
2684         The unused setRepaintCount() method is also removed.
2685
2686         CoordinatedGraphicsLayerState now holds repaint counter state (both
2687         visibility and count value) in a struct that's separate from debug
2688         border state. CoordinatedGraphicsLayer implementation now updates
2689         that state accordingly.
2690
2691         No new tests -- no change in behavior.
2692
2693         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
2694         (WebCore::GraphicsLayerTextureMapper::setShowRepaintCounter):
2695         (WebCore::GraphicsLayerTextureMapper::commitLayerChanges):
2696         (WebCore::GraphicsLayerTextureMapper::setRepaintCount): Deleted.
2697         * platform/graphics/texmap/GraphicsLayerTextureMapper.h:
2698         * platform/graphics/texmap/TextureMapperLayer.cpp:
2699         (WebCore::TextureMapperLayer::setDebugVisuals):
2700         (WebCore::TextureMapperLayer::setRepaintCounter):
2701         (WebCore::TextureMapperLayer::setRepaintCount): Deleted.
2702         * platform/graphics/texmap/TextureMapperLayer.h:
2703         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
2704         (WebCore::CoordinatedGraphicsLayer::didUpdateTileBuffers):
2705         (WebCore::CoordinatedGraphicsLayer::setShowRepaintCounter):
2706         (WebCore::CoordinatedGraphicsLayer::syncLayerState):
2707         * platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
2708         (WebCore::CoordinatedGraphicsLayerState::CoordinatedGraphicsLayerState):
2709         (WebCore::DebugVisuals::DebugVisuals): Deleted.
2710
2711 2018-07-24  Thibault Saunier  <tsaunier@igalia.com>
2712
2713         [WPE][GTK] Implement PeerConnection API on top of libwebrtc
2714         https://bugs.webkit.org/show_bug.cgi?id=186932
2715
2716         Reviewed by Philippe Normand.
2717
2718         Enabled many webrtc tests.
2719
2720         * platform/GStreamer.cmake: Build new files
2721         * platform/graphics/gstreamer/GStreamerCommon.cpp: Fix minor style issues
2722         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: Add a way to give precise name to pipelines
2723         and give useful names to pipelines with sources comming from a PeerConnection
2724         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: Ditto.
2725         * platform/mediastream/gstreamer/GStreamerVideoFrameLibWebRTC.cpp: Added. Implement a subclass of webrtc::VideoFrame
2726         to represent a kNative GStreamer video frame.
2727         * platform/mediastream/gstreamer/GStreamerVideoFrameLibWebRTC.h: Added. Ditto.
2728         * platform/mediastream/gstreamer/RealtimeIncomingAudioSourceLibWebRTC.cpp: Handle incoming audio samples from libwebrtc.
2729         * platform/mediastream/gstreamer/RealtimeIncomingAudioSourceLibWebRTC.h: Ditto.
2730         * platform/mediastream/gstreamer/RealtimeIncomingVideoSourceLibWebRTC.cpp: Handle incoming video frames from libwebrtc.
2731         * platform/mediastream/gstreamer/RealtimeIncomingVideoSourceLibWebRTC.h: Ditto.
2732         * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp: Handle passing locally captured audio sample to libwebrtc.
2733         * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.h: Ditto.
2734         * platform/mediastream/gstreamer/RealtimeOutgoingVideoSourceLibWebRTC.cpp: Handle passing locally captured vidoe frames to libwebrtc.
2735         * platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp: Added. Implement a video decoder factory and LibWebRTC Video decoders based on GStreamer.
2736         * platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.h: Added. Ditto.
2737         * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp: Added. Implement a video encoder factory and LibWebRTC H264/VP8 Video encoders based on GStreamer.
2738         * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.h: Added. Ditto.
2739         * platform/mediastream/libwebrtc/LibWebRTCAudioFormat.h: Add information about signness of the LibWebRTC audio format.
2740         * platform/mediastream/libwebrtc/LibWebRTCProviderGlib.cpp: Add support for newly added Encoder/Decoder factories.
2741         * platform/mediastream/libwebrtc/LibWebRTCProviderGlib.h: Ditto.
2742
2743 2018-07-24  Dirk Schulze  <krit@webkit.org>
2744
2745         [css-masking] Black backdrop on -webkit-clip-path on SVG root
2746         https://bugs.webkit.org/show_bug.cgi?id=187880
2747
2748         Reviewed by Simon Fraser.
2749
2750         For SVG document root elements, we currently clip twice:
2751         In RenderLayer and SVGRenderSupport.
2752         Avoid clipping in RenderLayer which currently clips before we established a
2753         backdrop for an SVG document.
2754
2755         Tests: svg/clip-path/clip-path-on-svg-005-expected.svg
2756                svg/clip-path/clip-path-on-svg-005.svg
2757
2758         * rendering/RenderLayer.cpp:
2759         (WebCore::RenderLayer::setupClipPath): Skip actual clipping.
2760
2761 2018-07-24  Zan Dobersek  <zdobersek@igalia.com>
2762
2763         [Nicosia] Add TextureMapperAnimations member to CompositingLayer::LayerState
2764         https://bugs.webkit.org/show_bug.cgi?id=187941
2765
2766         Reviewed by Carlos Garcia Campos.
2767
2768         Nicosia::CompositingLayer::LayerState gains a TextureMapperAnimations
2769         member that will be assigned a list of all active animations during each
2770         layer flush. Despite the name, TextureMapperAnimations doesn't depend on
2771         any other TextureMapper class. It might be renamed and moved in the
2772         future, but for now it's used as-is.
2773
2774         In CoordinatedGraphicsLayer, the syncAnimations() method now flips on
2775         the animationsChanged flag in the LayerState::Delta struct. This causes
2776         all the active animations to be copied over into the layer state in
2777         flushCompositingStateForThisLayerOnly().
2778
2779         * platform/graphics/nicosia/NicosiaPlatformLayer.h:
2780         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
2781         (WebCore::CoordinatedGraphicsLayer::syncAnimations):
2782         (WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):
2783
2784 2018-07-24  Zan Dobersek  <zdobersek@igalia.com>
2785
2786         [Nicosia] Add FilterOperations member to CompositionLayer::LayerState
2787         https://bugs.webkit.org/show_bug.cgi?id=187901
2788
2789         Reviewed by Carlos Garcia Campos.
2790
2791         Nicosia::CompositionLayer::LayerState gains a FilterOperations member
2792         that can be assigned the list of filter operations for a given layer.
2793         The corresponding filtersChanged boolean is added to LayerState::Delta.
2794
2795         CoordinatedGraphicsLayer::syncFilters() flips on that delta member,
2796         which in turn causes the FilterOperations value to be updated during
2797         the layer flush, in flushCompositingStateForThisLayerOnly().
2798
2799         * platform/graphics/nicosia/NicosiaPlatformLayer.h:
2800         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
2801         (WebCore::CoordinatedGraphicsLayer::syncFilters):
2802         (WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):
2803
2804 2018-07-24  Zan Dobersek  <zdobersek@igalia.com>
2805
2806         [CoordGraphics] Use adjusted position, anchor point, size values for Nicosia::CompositionLayer state
2807         https://bugs.webkit.org/show_bug.cgi?id=187899
2808
2809         Reviewed by Carlos Garcia Campos.
2810
2811         As is done for the CoordinatedGraphicsLayerState, the scale-adjusted
2812         position, anchor point and size values should be used when updating the
2813         corresponding Nicosia::CompositionLayer::LayerState members.
2814
2815         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
2816         (WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):
2817
2818 2018-07-23  Manuel Rego Casasnovas  <rego@igalia.com>
2819
2820         [css-grid] Add support for calc() in gutter properties
2821         https://bugs.webkit.org/show_bug.cgi?id=187902
2822
2823         Reviewed by Simon Fraser.
2824
2825         The parsing was already accepting calc() in grid row and column gaps,
2826         however the code was not taking that into account properly.
2827         If the calc() had a percentage it was ignored and that's wrong.
2828
2829         The fix is just a change in the ceck at RenderGrid::availableSpaceForGutters().
2830
2831         Tests: imported/w3c/web-platform-tests/css/css-grid/abspos/grid-positioned-items-gaps-002-rtl.html
2832                imported/w3c/web-platform-tests/css/css-grid/abspos/grid-positioned-items-gaps-002.html
2833                imported/w3c/web-platform-tests/css/css-grid/alignment/grid-gutters-011.html
2834                imported/w3c/web-platform-tests/css/css-grid/alignment/grid-gutters-012.html
2835
2836         * rendering/RenderGrid.cpp:
2837         (WebCore::RenderGrid::availableSpaceForGutters const):
2838
2839 2018-07-23  Aditya Keerthi  <akeerthi@apple.com>
2840
2841         Remove extraneous #endif in html.css
2842         https://bugs.webkit.org/show_bug.cgi?id=187934
2843
2844         Reviewed by Tim Horton.
2845
2846         * css/html.css: Remove extraneous #endif.
2847
2848 2018-07-23  Sihui Liu  <sihui_liu@apple.com>
2849
2850         CrashTracer: com.apple.WebKit.Storage at WebCore: WebCore::encodeKey
2851         https://bugs.webkit.org/show_bug.cgi?id=187927
2852
2853         Reviewed by Chris Dumez.
2854
2855         IDBKeyData is valid only when each key of it is valid.
2856
2857         Test: LayoutTests/storage/indexeddb/index-multientry.html
2858
2859         * Modules/indexeddb/IDBKeyData.cpp:
2860         (WebCore::IDBKeyData::isValid const):
2861         * Modules/indexeddb/IDBKeyData.h:
2862         (WebCore::IDBKeyData::isValid const): Deleted.
2863
2864 2018-07-23  Ben Richards  <benton_richards@apple.com>
2865
2866         We should cache the compiled sandbox profile in a data vault
2867         https://bugs.webkit.org/show_bug.cgi?id=184991
2868
2869         Reviewed by Ryosuke Niwa.
2870
2871         Added functionality to FileHandle so that it can lock a file while open.
2872         Added a function to FileSystem to delete non empty directories.
2873
2874         * platform/FileHandle.cpp:
2875         (WebCore::FileHandle::FileHandle):
2876         (WebCore::FileHandle::open):
2877         (WebCore::FileHandle::close):
2878         * platform/FileHandle.h:
2879         * platform/FileSystem.h:
2880         * platform/cocoa/FileSystemCocoa.mm:
2881         (WebCore::FileSystem::deleteNonEmptyDirectory):
2882
2883 2018-07-23  Justin Fan  <justin_fan@apple.com>
2884
2885         [macOS] Ensure that WebGL contexts are always set to an accelerated virtual screen
2886         https://bugs.webkit.org/show_bug.cgi?id=187923
2887
2888         Reviewed by Dean Jackson.
2889
2890         On eGPU displays, it is possible that CGL does not match the preferred renderer. 
2891         In this case, and when the web process is blocked from accessing the window server, 
2892         3D contexts *may* default to the software renderer. Ensure that even if this occurs,
2893         we set the context to use a hardware-accelerated renderer/virtual screen.
2894
2895         No new tests. Existing behavior covered by existing tests.
2896         Requires multiple screens, at least one attached to an eGPU, to stress. 
2897
2898         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
2899         (WebCore::identifyAndSetCurrentGPU):
2900
2901 2018-07-23  Sam Weinig  <sam@webkit.org>
2902
2903         Convert some obvious never-null pointers to references in the editing code
2904         https://bugs.webkit.org/show_bug.cgi?id=187914
2905
2906         Reviewed by Dean Jackson.
2907
2908         Fixup trivial cases of never-null pointers that really should be references.
2909
2910         * editing/ApplyStyleCommand.cpp:
2911         (WebCore::ApplyStyleCommand::shouldApplyInlineStyleToRun):
2912         (WebCore::ApplyStyleCommand::removeInlineStyleFromElement):
2913         (WebCore::ApplyStyleCommand::removeImplicitlyStyledElement):
2914         (WebCore::ApplyStyleCommand::removeCSSStyle):
2915         (WebCore::ApplyStyleCommand::applyInlineStyleToPushDown):
2916         (WebCore::ApplyStyleCommand::applyInlineStyleChange):
2917         * editing/EditingStyle.cpp:
2918         (WebCore::EditingStyle::overrideWithStyle):
2919         (WebCore::EditingStyle::conflictsWithInlineStyleOfElement const):
2920         (WebCore::EditingStyle::conflictsWithImplicitStyleOfElement const):
2921         (WebCore::EditingStyle::conflictsWithImplicitStyleOfAttributes const):
2922         (WebCore::EditingStyle::extractConflictingImplicitStyleOfAttributes const):
2923         (WebCore::EditingStyle::styleIsPresentInComputedStyleOfNode const):
2924         (WebCore::EditingStyle::elementIsStyledSpanOrHTMLEquivalent):
2925         (WebCore::EditingStyle::mergeInlineStyleOfElement):
2926         (WebCore::EditingStyle::wrappingStyleForSerialization):
2927         (WebCore::EditingStyle::legacyFontSize const):
2928         (WebCore::StyleChange::StyleChange):
2929         (WebCore::StyleChange::extractTextStyles):
2930         (WebCore::legacyFontSizeFromCSSValue):
2931         * editing/EditingStyle.h:
2932         (WebCore::EditingStyle::conflictsWithInlineStyleOfElement const):
2933         * editing/Editor.cpp:
2934         (WebCore::Editor::selectionStartCSSPropertyValue):
2935         * editing/ReplaceSelectionCommand.cpp:
2936         (WebCore::ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline):
2937         (WebCore::isInlineNodeWithStyle):
2938         * editing/markup.cpp:
2939         (WebCore::StyledMarkupAccumulator::appendElement):
2940         (WebCore::StyledMarkupAccumulator::serializeNodes):
2941
2942 2018-07-23  Per Arne Vollan  <pvollan@apple.com>
2943
2944         WebCore::primaryScreenDisplayID() always return 0
2945         https://bugs.webkit.org/show_bug.cgi?id=187922
2946         <rdar://problem/42286933>
2947
2948         Reviewed by Geoffrey Garen.
2949
2950         This function should return a valid display ID.
2951
2952         No new tests. Testing this requires a dual monitor setup.
2953
2954         * platform/mac/PlatformScreenMac.mm:
2955         (WebCore::primaryScreenDisplayID):
2956
2957 2018-07-23  Nan Wang  <n_wang@apple.com>
2958
2959         AX: Press tab to highlight items on a webpage is not working with voiceover enabled
2960         https://bugs.webkit.org/show_bug.cgi?id=187824
2961
2962         Reviewed by Zalan Bujtas.
2963
2964         We are deferring posting focused element change notification when the document needs a
2965         style recalculation. However, we only perform the cache update after a layout is completed.
2966         Added a timer to perform the cache update in the next runloop when non-layout type of mutation
2967         happens.
2968         
2969         Test: accessibility/mac/tab-focus-post-notification.html
2970
2971         * accessibility/AXObjectCache.cpp:
2972         (WebCore::AXObjectCache::AXObjectCache):
2973         (WebCore::AXObjectCache::~AXObjectCache):
2974         (WebCore::AXObjectCache::deferFocusedUIElementChangeIfNeeded):
2975         (WebCore::AXObjectCache::performCacheUpdateTimerFired):
2976         * accessibility/AXObjectCache.h:
2977         (WebCore::AXObjectCache::AXObjectCache):
2978         (WebCore::AXObjectCache::performCacheUpdateTimerFired):
2979
2980 2018-07-23  Chris Dumez  <cdumez@apple.com>
2981
2982         WebResourceLoadStatisticsStore fails to unregister itself as a MessageReceiver in its destructor
2983         https://bugs.webkit.org/show_bug.cgi?id=187910
2984         <rdar://problem/42356526>
2985
2986         Reviewed by Brent Fulgham.
2987
2988         Add internals API that causes the ResourceLoadObserver to notify its observer, and avoid waiting
2989         for the 5 second delay.
2990
2991         * testing/Internals.cpp:
2992         (WebCore::Internals::notifyResourceLoadObserver):
2993         * testing/Internals.h:
2994         * testing/Internals.idl:
2995
2996 2018-07-23  Zalan Bujtas  <zalan@apple.com>
2997
2998         [LCF][IFC] Add support for hyphenation.
2999         https://bugs.webkit.org/show_bug.cgi?id=187913
3000
3001         Reviewed by Antti Koivisto.
3002
3003         Move the hyphenation logic over from SimpleLineLayout::TextFragmentIterator.
3004
3005         * layout/inlineformatting/textlayout/Runs.h:
3006         (WebCore::Layout::TextRun::hasHyphen const):
3007         (WebCore::Layout::LayoutRun::setHasHyphen):
3008         (WebCore::Layout::LayoutRun::hasHyphen const):
3009         (WebCore::Layout::LayoutRun::LayoutRun):
3010         (WebCore::Layout::TextRun::createNonWhitespaceRunWithHyphen):
3011         (WebCore::Layout::TextRun::TextRun):
3012         * layout/inlineformatting/textlayout/TextContentProvider.cpp:
3013         (WebCore::Layout::TextContentProvider::findTextItemSlow const):
3014         (WebCore::Layout::TextContentProvider::width const):
3015         (WebCore::Layout::TextContentProvider::hyphenPositionBefore const):
3016         * layout/inlineformatting/textlayout/TextContentProvider.h:
3017         * layout/inlineformatting/textlayout/simple/SimpleLineBreaker.cpp:
3018         (WebCore::Layout::SimpleLineBreaker::Line::setTextAlign):
3019         (WebCore::Layout::SimpleLineBreaker::Line::justifyRuns):
3020         (WebCore::Layout::SimpleLineBreaker::Line::adjustRunsForTextAlign):
3021         (WebCore::Layout::SimpleLineBreaker::Line::collectExpansionOpportunities):
3022         (WebCore::Layout::SimpleLineBreaker::Line::closeLastRun):
3023         (WebCore::Layout::SimpleLineBreaker::Line::append):
3024         (WebCore::Layout::SimpleLineBreaker::Line::reset):
3025         (WebCore::Layout::SimpleLineBreaker::Style::Style):
3026         (WebCore::Layout::SimpleLineBreaker::handleLineEnd):
3027         (WebCore::Layout::SimpleLineBreaker::createRunsForLine):
3028         (WebCore::Layout::SimpleLineBreaker::hyphenPositionBefore const):
3029         (WebCore::Layout::SimpleLineBreaker::adjustSplitPositionWithHyphenation const):
3030         (WebCore::Layout::SimpleLineBreaker::split const):
3031         * layout/inlineformatting/textlayout/simple/SimpleLineBreaker.h:
3032
3033 2018-07-23  Antoine Quint  <graouts@apple.com>
3034
3035         [Web Animations] Querying the current time of a finished CSSAnimation after removing its target leads to a crash
3036         https://bugs.webkit.org/show_bug.cgi?id=187906
3037
3038         Reviewed by Dean Jackson.
3039
3040         Test: webanimations/accessing-current-time-after-finished-css-animation-target-removal.html
3041
3042         Because we carelessly look at a CSSAnimation's effect's timing in DeclarativeAnimation::bindingsCurrentTime
3043         without checking that the effect is non-null, we can crash in the case where the animation is finished and
3044         its target element has been removed, which caused the effect to be set to null.
3045
3046         We do not actually fix the lack of a null check, which will be the scope of a different patch, but instead
3047         ensure that we do _not_ set the animation's effect to null when its target is removed, which used to be
3048         performed via a call to WebAnimation::remove(). Instead, we introduce AnimationTimeline::elementWasRemoved()
3049         which notifies the timeline of an element being removed such that we may stop referencing any animation
3050         targeting this element from the various data structures holding strong references to the animation in question,
3051         and we then cancel the animation silently, which is a new option that ensures promises aren't resolved or
3052         rejected as a result.
3053
3054         Finally, the WebAnimation and AnimationEffectReadOnly classes established a ref-cycle as WebAnimation has
3055         `RefPtr<AnimationEffectReadOnly> m_effect` and AnimationEffectReadOnly has `RefPtr<WebAnimation> m_animation`.
3056         While it is correct that WebAnimation owns its effect, which is established by the DOM API, the
3057         reverse is not correct since we only hold the reverse internally for the benefit of our implementation.
3058         As such, we change AnimationEffectReadOnly's m_animation to be a WeakPtr<WebAnimation>. This means not
3059         calling WebAnimation::remove() and simply removing the animation from the animation maps on the timeline
3060         is sufficient to guarantee that the document timeline will not leak (and with it the document).
3061
3062         * animation/AnimationEffectReadOnly.h:
3063         (WebCore::AnimationEffectReadOnly::setAnimation):
3064         * animation/AnimationTimeline.cpp:
3065         (WebCore::AnimationTimeline::elementWasRemoved):
3066         * animation/AnimationTimeline.h:
3067         * animation/WebAnimation.cpp:
3068         (WebCore::WebAnimation::cancel):
3069         (WebCore::WebAnimation::resetPendingTasks):
3070         * animation/WebAnimation.h:
3071         * dom/Element.cpp:
3072         (WebCore::Element::removedFromAncestor):
3073         * rendering/updating/RenderTreeUpdater.cpp:
3074         (WebCore::RenderTreeUpdater::tearDownRenderers):
3075
3076 2018-07-23  Aditya Keerthi  <akeerthi@apple.com>
3077
3078         [iOS] Add support for input[type=color]
3079         https://bugs.webkit.org/show_bug.cgi?id=187871
3080
3081         Reviewed by Tim Horton.
3082
3083         * css/html.css: Remove unwanted styling for color inputs with a list attribute.
3084         * html/ColorInputType.cpp: Make the element focusable.
3085         (WebCore::ColorInputType::isMouseFocusable const):
3086         (WebCore::ColorInputType::isKeyboardFocusable const):
3087         * html/ColorInputType.h:
3088         * html/HTMLInputElement.h: Expose isColorControl() to WebKit.
3089         * page/Chrome.cpp:
3090         (WebCore::Chrome::createColorChooser):
3091
3092 2018-07-22  Dean Jackson  <dino@apple.com>
3093
3094         fullscreen env() variables should have initial values
3095         https://bugs.webkit.org/show_bug.cgi?id=187897
3096         <rdar://problem/42485682>
3097
3098         Reviewed by Sam Weinig.
3099
3100         The env() values for fullscreen properties need to be
3101         initialized, rather than wait for values to be set from WebKit.
3102         Without this, feature detection doesn't work, and properties
3103         won't parse correctly.
3104
3105         Test: fullscreen/fullscreen-env-initial.html
3106
3107         * dom/ConstantPropertyMap.cpp:
3108         (WebCore::ConstantPropertyMap::buildValues): Initialize the fullscreen values.
3109         (WebCore::ConstantPropertyMap::updateConstantsForFullscreen): Renamed function, because it
3110         also updates the duration value.
3111         (WebCore::ConstantPropertyMap::didChangeFullscreenInsets): Call new name.
3112         (WebCore::ConstantPropertyMap::updateConstantsForFullscreenInsets): Deleted.
3113         * dom/ConstantPropertyMap.h:
3114         * page/Page.cpp:
3115         (WebCore::Page::setFullscreenAutoHideDuration): Don't change the value if it doesn't need it.
3116         * page/Page.h: Add accessor for fullscreenAutoHideDuration. Also add a member variable.
3117         (WebCore::Page::fullscreenAutoHideDuration const):
3118
3119 2018-07-22  Zalan Bujtas  <zalan@apple.com>
3120
3121         [LFC][IFC] Add center/right/justify line alignment support.
3122         https://bugs.webkit.org/show_bug.cgi?id=187890
3123
3124         Reviewed by Antti Koivisto.
3125
3126         Move over some more code from simple line layout.
3127         (though text-align: justify is more preformant as now expansion opportunities are added as we process the text runs
3128         -as opposed to iterting through the runs again when we reach the end of the line.) 
3129
3130         * layout/inlineformatting/textlayout/Runs.h:
3131         (WebCore::Layout::LayoutRun::setLeft):
3132         (WebCore::Layout::LayoutRun::setExpansion):
3133         * layout/inlineformatting/textlayout/simple/SimpleLineBreaker.cpp:
3134         (WebCore::Layout::SimpleLineBreaker::Line::Line):
3135         (WebCore::Layout::SimpleLineBreaker::Line::setTextAlign):
3136         (WebCore::Layout::SimpleLineBreaker::Line::adjustedLeftForTextAlign const):
3137         (WebCore::Layout::SimpleLineBreaker::Line::justifyRuns):
3138         (WebCore::Layout::SimpleLineBreaker::Line::adjustRunsForTextAlign):
3139         (WebCore::Layout::expansionOpportunity):
3140         (WebCore::Layout::expansionBehavior):
3141         (WebCore::Layout::SimpleLineBreaker::Line::collectExpansionOpportunities):
3142         (WebCore::Layout::SimpleLineBreaker::Line::closeLastRun):
3143         (WebCore::Layout::SimpleLineBreaker::Line::append):
3144         (WebCore::Layout::SimpleLineBreaker::Line::collapseTrailingWhitespace):
3145         (WebCore::Layout::SimpleLineBreaker::Line::reset):
3146         (WebCore::Layout::SimpleLineBreaker::Style::Style):
3147         (WebCore::Layout::SimpleLineBreaker::handleLineEnd):
3148         (WebCore::Layout::SimpleLineBreaker::handleLineStart):
3149         (WebCore::Layout::isTextAlignRight):
3150         (WebCore::Layout::SimpleLineBreaker::createRunsForLine):
3151         * layout/inlineformatting/textlayout/simple/SimpleLineBreaker.h:
3152         (WebCore::Layout::SimpleLineBreaker::Line::setAvailableWidth):
3153         (WebCore::Layout::SimpleLineBreaker::Line::setCollapseWhitespace):
3154
3155 2018-07-21  Zalan Bujtas  <zalan@apple.com>
3156
3157         [LFC][IFC] Add verification for inline text runs.
3158         https://bugs.webkit.org/show_bug.cgi?id=187879
3159
3160         Reviewed by Antti Koivisto.
3161
3162         * layout/Verification.cpp:
3163         (WebCore::Layout::outputMismatchingSimpleLineInformationIfNeeded):
3164         (WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
3165         (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
3166         (WebCore::Layout::verifyAndOutputSubtree):
3167         (WebCore::Layout::outputMismatchingBoxInformationIfNeeded): Deleted.
3168         * layout/inlineformatting/InlineFormattingContext.cpp:
3169         (WebCore::Layout::InlineFormattingContext::layout const):
3170         * layout/inlineformatting/InlineFormattingState.h:
3171         (WebCore::Layout::InlineFormattingState::addLayoutRuns):
3172         (WebCore::Layout::InlineFormattingState::layoutRuns const):
3173         * layout/layouttree/LayoutTreeBuilder.cpp:
3174         (WebCore::Layout::outputLayoutBox):
3175         (WebCore::Layout::outputLayoutTree):
3176         (WebCore::Layout::TreeBuilder::showLayoutTree):
3177
3178 2018-07-21  Zalan Bujtas  <zalan@apple.com>
3179
3180         [LFC] Do not use virtual methods to construct floating/formatting states.
3181         https://bugs.webkit.org/show_bug.cgi?id=187875
3182
3183         Reviewed by Antti Koivisto.
3184
3185         LayoutContext::establishedFormattingState() does not require FormattingContext anymore only the root of the context.
3186
3187         * layout/FormattingContext.cpp:
3188         (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
3189         * layout/FormattingContext.h:
3190         * layout/LayoutContext.cpp:
3191         (WebCore::Layout::LayoutContext::layoutFormattingContextSubtree):
3192         (WebCore::Layout::LayoutContext::formattingStateForBox const):
3193         (WebCore::Layout::LayoutContext::establishedFormattingState):
3194         * layout/LayoutContext.h:
3195         * layout/blockformatting/BlockFormattingContext.cpp:
3196         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
3197         (WebCore::Layout::BlockFormattingContext::instrinsicWidthConstraints const):
3198         (WebCore::Layout::BlockFormattingContext::createFormattingState const): Deleted.
3199         (WebCore::Layout::BlockFormattingContext::createOrFindFloatingState const): Deleted.
3200         * layout/blockformatting/BlockFormattingContext.h:
3201         * layout/inlineformatting/InlineFormattingContext.cpp:
3202         (WebCore::Layout::InlineFormattingContext::createFormattingState const): Deleted.
3203         (WebCore::Layout::InlineFormattingContext::createOrFindFloatingState const): Deleted.
3204         * layout/inlineformatting/InlineFormattingContext.h:
3205
3206 2018-07-21  Zalan Bujtas  <zalan@apple.com>
3207
3208         [LFC][BFC] Do not collapse top/bottom margin with first/last inflow child from a non-block formatting context.
3209         https://bugs.webkit.org/show_bug.cgi?id=187867
3210
3211         Reviewed by Antti Koivisto.
3212
3213         The box's top/bottom margin never collapses with a non-block inflow child.
3214
3215         * layout/blockformatting/BlockMarginCollapse.cpp:
3216         (WebCore::Layout::isMarginTopCollapsedWithSibling):
3217         (WebCore::Layout::isMarginBottomCollapsedWithSibling):
3218         (WebCore::Layout::isMarginTopCollapsedWithParent):
3219         (WebCore::Layout::isMarginBottomCollapsedThrough):
3220         (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedMarginTopFromFirstChild):
3221         (WebCore::Layout::BlockFormattingContext::MarginCollapse::nonCollapsedMarginTop):
3222         (WebCore::Layout::BlockFormattingContext::MarginCollapse::computedNonCollapsedMarginTop):
3223         (WebCore::Layout::BlockFormattingContext::MarginCollapse::computedNonCollapsedMarginBottom):
3224         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginTop):
3225         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBottom):
3226         (WebCore::Layout::BlockFormattingContext::MarginCollapse::isMarginBottomCollapsedWithParent):
3227         (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedMarginBottomFromLastChild):
3228         (WebCore::Layout::BlockFormattingContext::MarginCollapse::nonCollapsedMarginBottom):
3229         * layout/layouttree/LayoutBox.cpp:
3230         (WebCore::Layout::Box::establishesBlockFormattingContextOnly const): <div style="overflow: hidden">foobar</div> establishes both inline and block formatting context (inline wins though).
3231         * layout/layouttree/LayoutBox.h: establishesBlockFormattingContext() does not need to be virtual since we can determine it by looking at the box's style. -while in case
3232         of inline formatting context, it is about the content.
3233
3234 2018-07-20  Jer Noble  <jer.noble@apple.com>
3235
3236         REGRESSION (r233974): Cannot close pip'd video; pops back into PiP.
3237         https://bugs.webkit.org/show_bug.cgi?id=187873
3238
3239         Reviewed by Jon Lee.
3240
3241         When the PIP machinery on Mac wants to close the PIP window (due to the close button being clicked), it does
3242         not consult our -shouldClosePiP handler; it just tells us that we're going to close. So we never setup the 
3243         necessary state on the WebProcess side and still think that our "targetIsFullscreen". When we get the "stop"
3244         action, just request exit fullscreen, but set up the _pipState to think we're already exiting (because we are).
3245
3246         * platform/mac/VideoFullscreenInterfaceMac.mm:
3247         (-[WebVideoFullscreenInterfaceMacObjC pipActionStop:]):
3248
3249 2018-07-20  Justin Fan  <justin_fan@apple.com>
3250
3251         Safari WebGL does not consistently provide correct GPU context on eGPU systems
3252         https://bugs.webkit.org/show_bug.cgi?id=187750
3253         <rdar://problem/39531436>
3254
3255         Reviewed by Dean Jackson.
3256
3257         Move GraphicsContext3DManager into its own class, and notify it when page/Chrome receives a 
3258         windowScreenDidChange message. Add a private data struct to track which hostWindow created each context.
3259         Upon notification, Manager updates the contexts that match the hostWindow with the
3260         provided displayID. Each context matches displayID to rendererID (set during process creation 
3261         if window server is blocked), which is matched to a virtual screen, and updates its GPU accordingly.
3262
3263         No new tests. This requires multiple GPUs or eGPUs, each with attached display(s), to test.
3264
3265         * WebCore.xcodeproj/project.pbxproj:
3266         * page/Chrome.cpp:
3267         (WebCore::Chrome::windowScreenDidChange): Now calls GraphicsContext3DManager::screenDidChange().
3268         * platform/PlatformScreen.h:
3269         * platform/ScreenProperties.h: Add rendererID to struct.
3270         (WebCore::ScreenData::encode const):
3271         (WebCore::ScreenData::decode):
3272         * platform/graphics/GraphicsContext3D.h:
3273         * platform/graphics/GraphicsContext3DManager.cpp: Added (copied out of GraphicsContext3DCocoa.mm).
3274         (WebCore::attachToAppleGraphicsControl):
3275         (WebCore::hasMuxCapability):
3276         (WebCore::hasMuxableGPU):
3277         (WebCore::GraphicsContext3DManager::sharedManager):
3278         (WebCore::displayWasReconfigured):
3279         (WebCore::GraphicsContext3DManager::updateAllContexts):
3280         (WebCore::GraphicsContext3DManager::screenDidChange):
3281         (WebCore::GraphicsContext3DManager::addContext):
3282         (WebCore::GraphicsContext3DManager::removeContext):
3283         (WebCore::GraphicsContext3DManager::hostWindowForContext const):
3284         (WebCore::GraphicsContext3DManager::addContextRequiringHighPerformance):
3285         (WebCore::GraphicsContext3DManager::removeContextRequiringHighPerformance):
3286         (WebCore::GraphicsContext3DManager::updateHighPerformanceState):
3287         (WebCore::GraphicsContext3DManager::disableHighPerformanceGPUTimerFired):
3288         (WebCore::GraphicsContext3DManager::recycleContextIfNecessary):
3289         * platform/graphics/GraphicsContext3DManager.h: Added (copied out of GraphicsContext3DCocoa.mm).
3290         (WebCore::GraphicsContext3DManager::hasTooManyContexts const):
3291         (WebCore::GraphicsContext3DManager::GraphicsContext3DManager):
3292         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
3293         (WebCore::GraphicsContext3D::create):
3294         (WebCore::GraphicsContext3D::createShared):
3295         (WebCore::identifyAndSetCurrentGPU): Now matches rendererIDs to determine virtual screen. 
3296         (WebCore::GraphicsContext3D::GraphicsContext3D):
3297         (WebCore::GraphicsContext3D::~GraphicsContext3D):
3298         (WebCore::GraphicsContext3D::setContextVisibility):
3299         (WebCore::GraphicsContext3D::simulateContextChanged):
3300         (WebCore::GraphicsContext3D::screenDidChange):
3301         (WebCore::attachToAppleGraphicsControl): Deleted.
3302         (WebCore::hasMuxCapability): Deleted.
3303         (WebCore::hasMuxableGPU): Deleted.
3304         (WebCore::GraphicsContext3DManager::GraphicsContext3DManager): Deleted.
3305         (WebCore::GraphicsContext3DManager::hasTooManyContexts const): Deleted.
3306         (WebCore::manager): Deleted.
3307         (WebCore::displayWasReconfigured): Deleted.
3308         (WebCore::GraphicsContext3DManager::updateAllContexts): Deleted.
3309         (WebCore::GraphicsContext3DManager::addContext): Deleted.
3310         (WebCore::GraphicsContext3DManager::removeContext): Deleted.
3311         (WebCore::GraphicsContext3DManager::addContextRequiringHighPerformance): Deleted.
3312         (WebCore::GraphicsContext3DManager::removeContextRequiringHighPerformance): Deleted.
3313         (WebCore::GraphicsContext3DManager::updateHighPerformanceState): Deleted.
3314         (WebCore::GraphicsContext3DManager::disableHighPerformanceGPUTimerFired): Deleted.
3315         (WebCore::GraphicsContext3DManager::recycleContextIfNecessary): Deleted.
3316         * platform/mac/PlatformScreenMac.mm: Provide a display's rendererID.
3317         (WebCore::rendererIDForDisplayMask):
3318         (WebCore::collectScreenProperties):
3319         (WebCore::rendererIDForDisplay):
3320         (WebCore::primaryRendererID):
3321
3322 2018-07-19  Simon Fraser  <simon.fraser@apple.com>
3323
3324         Remove completed animations from GraphicsLayer, thus avoiding excessive backing store allocation
3325         https://bugs.webkit.org/show_bug.cgi?id=187844
3326         rdar://problem/40387294
3327
3328         Reviewed by Dean Jackson.
3329         
3330         A keyframe animation which animates 3D transforms, and is fill-forwards, currently
3331         leaves the GraphicsLayer in a state where it has a "running" animation. However, the
3332         logic that computes animation extent in RenderLayerBacking::updateGeometry() only does
3333         so for running or paused animations. GraphicsLayer then thinks that it has an active
3334         transform animation with unknown extent, and refuses to detach its backing store.
3335         
3336         This triggers excessive layer creation on some sites (e.g. https://www.kqed.org).
3337         
3338         Fix by always removing animations from the GraphicsLayer when they finish, whether
3339         or not they fill forwards. This is done by having KeyframeAnimation::onAnimationEnd()
3340         always call endAnimation().
3341         
3342         This change only fixes the non-Web Animation code path. webkit.org/b/187845 exists
3343         to fix the other code path.
3344         
3345         Also improve some logging that would have revealed this problem sooner.
3346
3347         Test: compositing/backing/backing-store-attachment-fill-forwards-animation.html
3348
3349         * page/animation/AnimationBase.h:
3350         (WebCore::AnimationBase::endAnimation):
3351         * page/animation/ImplicitAnimation.cpp:
3352         (WebCore::ImplicitAnimation::endAnimation):
3353         * page/animation/ImplicitAnimation.h:
3354         * page/animation/KeyframeAnimation.cpp:
3355         (WebCore::KeyframeAnimation::endAnimation):
3356         (WebCore::KeyframeAnimation::onAnimationEnd):
3357         * page/animation/KeyframeAnimation.h:
3358         * platform/graphics/ca/GraphicsLayerCA.cpp:
3359         (WebCore::GraphicsLayerCA::addAnimation):
3360         (WebCore::GraphicsLayerCA::updateCoverage):
3361
3362 2018-07-20  Ryosuke Niwa  <rniwa@apple.com>
3363
3364