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