Please support WEBGL_compressed_texture_etc1 extension (and possibly WEBGL_compressed...
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-11-07  Kenneth Russell  <kbr@chromium.org>
2
3         Please support WEBGL_compressed_texture_etc1 extension (and possibly WEBGL_compressed_texture_etc too)
4         https://bugs.webkit.org/show_bug.cgi?id=197900
5
6         Reviewed by Dean Jackson.
7
8         Support the ETC1 and ETC2 compressed texture formats in WebKit's WebGL
9         implementation.
10
11         Tested by changing the code to allocate an OpenGL ES 3.0 context for WebGL,
12         and running in the iOS Simulator. The WebGL conformance tests
13         webgl-compressed-texture-etc.html and webgl-compressed-texture-etc1.html all
14         pass with these changes.
15
16         When an ANGLE backend is supported on iOS, these extensions will
17         automatically be supported, and some of the new validation code can be
18         removed.
19
20         * CMakeLists.txt:
21         * DerivedSources-input.xcfilelist:
22         * DerivedSources-output.xcfilelist:
23         * DerivedSources.make:
24         * Sources.txt:
25         * WebCore.xcodeproj/project.pbxproj:
26         * bindings/js/JSDOMConvertWebGL.cpp:
27         (WebCore::convertToJSValue):
28         * html/canvas/WebGL2RenderingContext.cpp:
29         (WebCore::WebGL2RenderingContext::getExtension):
30         (WebCore::WebGL2RenderingContext::getSupportedExtensions):
31         * html/canvas/WebGLCompressedTextureETC.cpp: Added.
32         (WebCore::WebGLCompressedTextureETC::WebGLCompressedTextureETC):
33         (WebCore::WebGLCompressedTextureETC::getName const):
34         (WebCore::WebGLCompressedTextureETC::supported):
35         * html/canvas/WebGLCompressedTextureETC.h: Added.
36         * html/canvas/WebGLCompressedTextureETC.idl: Added.
37         * html/canvas/WebGLCompressedTextureETC1.cpp: Added.
38         (WebCore::WebGLCompressedTextureETC1::WebGLCompressedTextureETC1):
39         (WebCore::WebGLCompressedTextureETC1::getName const):
40         (WebCore::WebGLCompressedTextureETC1::supported):
41         * html/canvas/WebGLCompressedTextureETC1.h: Added.
42         * html/canvas/WebGLCompressedTextureETC1.idl: Added.
43         * html/canvas/WebGLExtension.h:
44         * html/canvas/WebGLRenderingContext.cpp:
45         (WebCore::WebGLRenderingContext::getExtension):
46         (WebCore::WebGLRenderingContext::getSupportedExtensions):
47         * html/canvas/WebGLRenderingContextBase.cpp:
48         (WebCore::WebGLRenderingContextBase::extensionIsEnabled):
49         (WebCore::WebGLRenderingContextBase::validateCompressedTexFuncData):
50         (WebCore::WebGLRenderingContextBase::validateCompressedTexDimensions):
51         (WebCore::WebGLRenderingContextBase::validateCompressedTexSubDimensions):
52         * html/canvas/WebGLRenderingContextBase.h:
53         * platform/graphics/Extensions3D.h:
54         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
55         (WebCore::GraphicsContext3D::GraphicsContext3D):
56         * platform/graphics/opengl/Extensions3DOpenGL.cpp:
57         (WebCore::Extensions3DOpenGL::supportsExtension):
58
59 2019-11-07  Ryosuke Niwa  <rniwa@webkit.org>
60
61         WindowEventLoop should be shared among similar origin documents
62         https://bugs.webkit.org/show_bug.cgi?id=203882
63
64         Reviewed by Wenson Hsieh.
65
66         Made WindowEventLoop shared across similar origin documents.
67
68         Also added internals.queueTask to directly test the event loop behavior
69         since implicitly testing it via other features has been very cumbersome.
70
71         This will help test other features that use the HTML5 event loop as well.
72
73         Tests: http/tests/eventloop/queue-task-across-cross-site-frames.html
74                http/tests/eventloop/queue-task-across-frames.html
75
76         * dom/Document.cpp:
77         (WebCore::Document::eventLoop): Use WindowEventLoop::ensureForRegistrableDomain.
78         * dom/WindowEventLoop.cpp:
79         (WebCore::WindowEventLoop::ensureForRegistrableDomain): Added. Replaces create,
80         and returns an existing WindowEventLoop if the RegistrableDomain matches.
81         (WebCore::WindowEventLoop::WindowEventLoop): Added.
82         (WebCore::WindowEventLoop::~WindowEventLoop): Added. Removes itself from the map.
83         * dom/WindowEventLoop.h:
84         * testing/Internals.cpp:
85         (WebCore::Internals::queueTask): Added.
86         * testing/Internals.h:
87         * testing/Internals.idl:
88
89 2019-11-07  Chris Dumez  <cdumez@apple.com>
90
91         Drop GenericEventQueue class now that it is unused
92         https://bugs.webkit.org/show_bug.cgi?id=203980
93
94         Reviewed by Ryosuke Niwa.
95
96         Drop GenericEventQueue class now that it is unused. All users have been ported to the HTML
97         event loop. MainThreadGenericEventQueue remains for now but will get dropped in a follow-up
98         patch, once it is no longer used.
99
100         * dom/GenericEventQueue.cpp:
101         (WebCore::MainThreadGenericEventQueue::MainThreadGenericEventQueue):
102         (WebCore::MainThreadGenericEventQueue::enqueueEvent):
103         (WebCore::MainThreadGenericEventQueue::dispatchOneEvent):
104         (WebCore::MainThreadGenericEventQueue::close):
105         (WebCore::MainThreadGenericEventQueue::cancelAllEvents):
106         (WebCore::MainThreadGenericEventQueue::hasPendingEvents const):
107         (WebCore::MainThreadGenericEventQueue::hasPendingEventsOfType const):
108         (WebCore::MainThreadGenericEventQueue::setPaused):
109         (WebCore::MainThreadGenericEventQueue::suspend):
110         (WebCore::MainThreadGenericEventQueue::resume):
111         (WebCore::MainThreadGenericEventQueue::rescheduleAllEventsIfNeeded):
112         (WebCore::MainThreadGenericEventQueue::stop):
113         (WebCore::MainThreadGenericEventQueue::activeDOMObjectName const):
114         (WebCore::TaskQueueConstructor::construct): Deleted.
115         (WebCore::TaskQueueConstructor<Timer>::construct): Deleted.
116         (WebCore::GenericEventQueueBase<T>::GenericEventQueueBase): Deleted.
117         (WebCore::GenericEventQueueBase<T>::enqueueEvent): Deleted.
118         (WebCore::GenericEventQueueBase<T>::dispatchOneEvent): Deleted.
119         (WebCore::GenericEventQueueBase<T>::close): Deleted.
120         (WebCore::GenericEventQueueBase<T>::cancelAllEvents): Deleted.
121         (WebCore::GenericEventQueueBase<T>::hasPendingEvents const): Deleted.
122         (WebCore::GenericEventQueueBase<T>::hasPendingEventsOfType const): Deleted.
123         (WebCore::GenericEventQueueBase<T>::setPaused): Deleted.
124         (WebCore::GenericEventQueueBase<T>::suspend): Deleted.
125         (WebCore::GenericEventQueueBase<T>::resume): Deleted.
126         (WebCore::GenericEventQueueBase<T>::rescheduleAllEventsIfNeeded): Deleted.
127         (WebCore::GenericEventQueueBase<T>::stop): Deleted.
128         (WebCore::GenericEventQueueBase<T>::activeDOMObjectName const): Deleted.
129         (WebCore::GenericEventQueue::create): Deleted.
130         * dom/GenericEventQueue.h:
131         (WebCore::GenericEventQueueBase::isSuspended const): Deleted.
132         (WebCore::GenericEventQueueBase::isSuspendedOrPausedByClient const): Deleted.
133         (WebCore::MainThreadGenericEventQueue::MainThreadGenericEventQueue): Deleted.
134         (WebCore::GenericEventQueue::GenericEventQueue): Deleted.
135
136 2019-11-07  Chris Dumez  <cdumez@apple.com>
137
138         Port Worker to the HTML5 event loop
139         https://bugs.webkit.org/show_bug.cgi?id=203919
140
141         Reviewed by Ryosuke Niwa.
142
143         * dom/ActiveDOMObject.h:
144         * workers/Worker.cpp:
145         (WebCore::Worker::Worker):
146         (WebCore::Worker::terminate):
147         (WebCore::Worker::hasPendingActivity const):
148         (WebCore::Worker::notifyFinished):
149         (WebCore::Worker::dispatchEvent):
150         (WebCore::Worker::enqueueEvent): Deleted.
151         * workers/Worker.h:
152         * workers/WorkerMessagingProxy.cpp:
153         (WebCore::WorkerMessagingProxy::postMessageToWorkerObject):
154         (WebCore::WorkerMessagingProxy::postExceptionToWorkerObject):
155
156 2019-11-07  Chris Dumez  <cdumez@apple.com>
157
158         Port MessagePort to the HTML5 event loop
159         https://bugs.webkit.org/show_bug.cgi?id=203960
160
161         Reviewed by Ryosuke Niwa.
162
163         * dom/MessagePort.cpp:
164         (WebCore::MessagePort::MessagePort):
165         (WebCore::MessagePort::close):
166         (WebCore::MessagePort::dispatchMessages):
167         (WebCore::MessagePort::dispatchEvent):
168         * dom/MessagePort.h:
169         * dom/TaskSource.h:
170
171 2019-11-07  Antti Koivisto  <antti@apple.com>
172
173         Factor matched declarations cache into a class
174         https://bugs.webkit.org/show_bug.cgi?id=203972
175
176         Reviewed by Zalan Bujtas.
177
178         Move the code out from StyleResolver and rename "matched properties cache" -> "matched declarations cache"
179         to better describe it.
180
181         * Sources.txt:
182         * WebCore.xcodeproj/project.pbxproj:
183         * css/ElementRuleCollector.cpp:
184         (WebCore::ElementRuleCollector::declarationsForOrigin):
185
186         Add a helper.
187
188         (WebCore::ElementRuleCollector::transferMatchedRules):
189
190         Reserve vector capacity before adding rules.
191
192         (WebCore::ElementRuleCollector::addMatchedProperties):
193         * css/ElementRuleCollector.h:
194         (WebCore::MatchResult::operator== const):
195         (WebCore::MatchResult::operator!= const):
196
197         Remove the unneeded inline capacity so we can just use MatchResult itself in the cache.
198
199         * css/RuleSet.cpp:
200         (WebCore::RuleSet::addChildRules):
201         * css/StyleResolver.cpp:
202         (WebCore::StyleResolver::StyleResolver):
203         (WebCore::StyleResolver::invalidateMatchedDeclarationsCache):
204         (WebCore::StyleResolver::clearCachedDeclarationsAffectedByViewportUnits):
205         (WebCore::StyleResolver::applyMatchedProperties):
206         (WebCore::StyleResolver::sweepMatchedPropertiesCache): Deleted.
207         (WebCore::StyleResolver::computeMatchedPropertiesHash): Deleted.
208         (WebCore::StyleResolver::findFromMatchedPropertiesCache): Deleted.
209         (WebCore::StyleResolver::addToMatchedPropertiesCache): Deleted.
210         (WebCore::StyleResolver::invalidateMatchedPropertiesCache): Deleted.
211         (WebCore::StyleResolver::clearCachedPropertiesAffectedByViewportUnits): Deleted.
212         (WebCore::isCacheableInMatchedPropertiesCache): Deleted.
213         * css/StyleResolver.h:
214         (WebCore::StyleResolver::MatchedPropertiesCacheItem::MatchedPropertiesCacheItem): Deleted.
215         * dom/Document.cpp:
216         (WebCore::Document::invalidateMatchedPropertiesCacheAndForceStyleRecalc):
217         (WebCore::Document::updateViewportUnitsOnResize):
218         * page/Page.cpp:
219         (WebCore::Page::updateStyleAfterChangeInEnvironment):
220         * style/MatchedDeclarationsCache.cpp: Added.
221         (WebCore::Style::MatchedDeclarationsCache::MatchedDeclarationsCache):
222         (WebCore::Style::MatchedDeclarationsCache::isCacheable):
223         (WebCore::Style::MatchedDeclarationsCache::computeHash):
224         (WebCore::Style::MatchedDeclarationsCache::find):
225         (WebCore::Style::MatchedDeclarationsCache::add):
226         (WebCore::Style::MatchedDeclarationsCache::invalidate):
227         (WebCore::Style::MatchedDeclarationsCache::clearEntriesAffectedByViewportUnits):
228         (WebCore::Style::MatchedDeclarationsCache::sweep):
229         * style/MatchedDeclarationsCache.h: Added.
230         * style/StyleTreeResolver.cpp:
231         (WebCore::Style::TreeResolver::resolveElement):
232
233 2019-11-07  Eric Carlson  <eric.carlson@apple.com>
234
235         UserMediaController::from(document) can return nullptr
236         https://bugs.webkit.org/show_bug.cgi?id=203977
237         <rdar://problem/56908013>
238
239         Reviewed by Jer Noble.
240
241         * Modules/mediastream/MediaDevices.cpp:
242         (WebCore::MediaDevices::stop): NULL-check the UserMediaController.
243
244 2019-11-07  Chris Dumez  <cdumez@apple.com>
245
246         Port ServiceWorkerContainer to the HTML5 event loop
247         https://bugs.webkit.org/show_bug.cgi?id=203963
248
249         Reviewed by Ryosuke Niwa.
250
251         * workers/service/ServiceWorkerContainer.cpp:
252         (WebCore::ServiceWorkerContainer::ServiceWorkerContainer):
253         (WebCore::ServiceWorkerContainer::startMessages):
254         (WebCore::ServiceWorkerContainer::postMessage):
255         * workers/service/ServiceWorkerContainer.h:
256
257 2019-11-06  Ryosuke Niwa  <rniwa@webkit.org>
258
259         Integrate scroll event into HTML5 event loop
260         https://bugs.webkit.org/show_bug.cgi?id=203839
261         <rdar://problem/56890922>
262
263         Reviewed by Simon Fraser.
264
265         Dispatch scroll events on each pending scroll event targets inside the update-the-rendering step
266         of the event loop as specified in the HTML5 and CSSOM View Module specifications:
267         https://html.spec.whatwg.org/multipage/webappapis.html#update-the-rendering
268         https://drafts.csswg.org/cssom-view/#run-the-scroll-steps
269
270         The new behavior also matches that of Chrome and Firefox.
271
272         Like resize event, the current visual viewport specification does not specify when scroll event
273         is dispatched on visualViewport interface: https://github.com/WICG/visual-viewport/issues/66
274         For now, we always dispatch upon it after dispatching on all pending scroll event targets.
275
276         Tests: fast/events/scroll-multiple-elements-in-rendering-update.html
277                fast/events/scroll-subframe-in-rendering-update.html
278                fast/visual-viewport/visual-viewport-scroll-after-resize-in-subframe.html
279
280         * dom/Document.cpp:
281         (WebCore::Document::addPendingScrollEventTarget): Added.
282         (WebCore::Document::setNeedsVisualViewportScrollEvent): Added.
283         (WebCore::Document::runScrollSteps): Added. This implements run the scroll steps in CSS OM View.
284         * dom/Document.h:
285         * dom/DocumentEventQueue.cpp:
286         (WebCore::DocumentEventQueue::enqueueOrDispatchScrollEvent): Deleted.
287         (WebCore::DocumentEventQueue::enqueueScrollEvent): Deleted.
288         * dom/DocumentEventQueue.h:
289         * page/EventHandler.cpp:
290         (WebCore::EventHandler::sendScrollEvent):
291         * page/Page.cpp:
292         (WebCore::Page::updateRendering): Invoke runScrollSteps on each document in the frame tree order.
293         * page/VisualViewport.cpp:
294         (WebCore::VisualViewport::update):
295         (WebCore::VisualViewport::enqueueScrollEvent): Deleted.
296         * page/VisualViewport.h:
297         * rendering/RenderLayer.cpp:
298         (WebCore::RenderLayer::scrollTo):
299         * rendering/RenderListBox.cpp:
300         (WebCore::RenderListBox::scrollTo):
301
302 2019-11-07  Zalan Bujtas  <zalan@apple.com>
303
304         [LFC][MarginCollapsing] Drag anonymous block level boxes into margin collapsing
305         https://bugs.webkit.org/show_bug.cgi?id=203927
306         <rdar://problem/56963636>
307
308         Reviewed by Antti Koivisto.
309
310         We've been ignoring anonymous block level boxes in the context of margin collapsing. Now with IFC, we can't really do that anymore.
311         This patch removes the early bailout on anon boxes and addresses the fallout.
312
313         * layout/MarginTypes.h:
314         * layout/blockformatting/BlockMarginCollapse.cpp:
315         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithParentMarginBefore const):
316         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithPreviousSiblingMarginAfter const):
317         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithFirstInFlowChildMarginBefore const):
318         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithParentMarginAfter const):
319         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithLastInFlowChildMarginAfter const):
320         (WebCore::Layout::BlockFormattingContext::MarginCollapse::updateMarginAfterForPreviousSibling):
321         (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginAfter const):
322         (WebCore::Layout::BlockFormattingContext::MarginCollapse::estimatedMarginBefore):
323         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeIgnoringCollapsingThrough):
324         (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedVerticalValues):
325
326 2019-11-07  Alex Christensen  <achristensen@webkit.org>
327
328         Re-enable NSURLSession isolation after r252116
329         https://bugs.webkit.org/show_bug.cgi?id=203934
330         <rdar://problem/56921584>
331
332         Reviewed by Chris Dumez.
333
334         * platform/network/StoredCredentialsPolicy.h:
335
336 2019-11-07  Andres Gonzalez  <andresg_22@apple.com>
337
338         Rename AXIsolatedTreeNode to AXIsolatedObject for consistency with AXCoreObject and AccessibilityObject.
339         https://bugs.webkit.org/show_bug.cgi?id=203913
340
341         Reviewed by Chris Fleizach.
342
343         No new tests needed, no new functionality.
344
345         - Renamed AXIsolatedTreeNode as AXIsolatedObject.
346         - This makes the naming consistent with AXCoreObject and AccessibilityObject.
347         - Some code cleanup in WebAccessibilityObjectWrapperBase.h.
348
349         * accessibility/AXObjectCache.cpp:
350         (WebCore::AXObjectCache::createIsolatedAccessibilityTreeHierarchy):
351         (WebCore::AXObjectCache::generateIsolatedAccessibilityTree):
352         * accessibility/AXObjectCache.h:
353         * accessibility/isolatedtree/AXIsolatedTree.cpp:
354         (WebCore::AXIsolatedTree::nodeInTreeForID):
355         (WebCore::AXIsolatedTree::nodeForID const):
356         (WebCore::AXIsolatedTree::focusedUIElement):
357         (WebCore::AXIsolatedTree::rootNode):
358         (WebCore::AXIsolatedTree::setRoot):
359         (WebCore::AXIsolatedTree::appendNodeChanges):
360         (WebCore::AXIsolatedTree::applyPendingChanges):
361         * accessibility/isolatedtree/AXIsolatedTree.h:
362         * accessibility/isolatedtree/AXIsolatedTreeNode.cpp:
363         (WebCore::AXIsolatedObject::AXIsolatedObject):
364         (WebCore::AXIsolatedObject::create):
365         (WebCore::AXIsolatedObject::initializeAttributeData):
366         (WebCore::AXIsolatedObject::setProperty):
367         (WebCore::AXIsolatedObject::appendChild):
368         (WebCore::AXIsolatedObject::setParent):
369         (WebCore::AXIsolatedObject::setTreeIdentifier):
370         (WebCore::AXIsolatedObject::children):
371         (WebCore::AXIsolatedObject::focusedUIElement const):
372         (WebCore::AXIsolatedObject::parentObjectUnignored const):
373         (WebCore::AXIsolatedObject::accessibilityHitTest const):
374         (WebCore::AXIsolatedObject::tree const):
375         (WebCore::AXIsolatedObject::rectAttributeValue const):
376         (WebCore::AXIsolatedObject::doubleAttributeValue const):
377         (WebCore::AXIsolatedObject::unsignedAttributeValue const):
378         (WebCore::AXIsolatedObject::boolAttributeValue const):
379         (WebCore::AXIsolatedObject::stringAttributeValue const):
380         (WebCore::AXIsolatedObject::intAttributeValue const):
381         (WebCore::AXIsolatedObject::updateBackingStore):
382         (WebCore::AXIsolatedTreeNode::AXIsolatedTreeNode): Deleted.
383         (WebCore::AXIsolatedTreeNode::create): Deleted.
384         (WebCore::AXIsolatedTreeNode::initializeAttributeData): Deleted.
385         (WebCore::AXIsolatedTreeNode::setProperty): Deleted.
386         (WebCore::AXIsolatedTreeNode::appendChild): Deleted.
387         (WebCore::AXIsolatedTreeNode::setParent): Deleted.
388         (WebCore::AXIsolatedTreeNode::setTreeIdentifier): Deleted.
389         (WebCore::AXIsolatedTreeNode::children): Deleted.
390         (WebCore::AXIsolatedTreeNode::focusedUIElement const): Deleted.
391         (WebCore::AXIsolatedTreeNode::parentObjectUnignored const): Deleted.
392         (WebCore::AXIsolatedTreeNode::accessibilityHitTest const): Deleted.
393         (WebCore::AXIsolatedTreeNode::tree const): Deleted.
394         (WebCore::AXIsolatedTreeNode::rectAttributeValue const): Deleted.
395         (WebCore::AXIsolatedTreeNode::doubleAttributeValue const): Deleted.
396         (WebCore::AXIsolatedTreeNode::unsignedAttributeValue const): Deleted.
397         (WebCore::AXIsolatedTreeNode::boolAttributeValue const): Deleted.
398         (WebCore::AXIsolatedTreeNode::stringAttributeValue const): Deleted.
399         (WebCore::AXIsolatedTreeNode::intAttributeValue const): Deleted.
400         (WebCore::AXIsolatedTreeNode::updateBackingStore): Deleted.
401         * accessibility/isolatedtree/AXIsolatedTreeNode.h:
402         * accessibility/mac/WebAccessibilityObjectWrapperBase.h:
403
404 2019-11-07  Andres Gonzalez  <andresg_22@apple.com>
405
406         Implement AXIsolatedTreeNode::roleDescription.
407         https://bugs.webkit.org/show_bug.cgi?id=203863
408         <rdar://problem/56934443>
409
410         Reviewed by Chris Fleizach.
411
412         No new tests needed, no new functionality.
413
414         AccessibilityObjectWrapper cannot call any of the AX.*Text functions to
415         retrieve localized role descriptions, because when running on the
416         secondary thread, those AtomStrings are not accessible. Moreover, some
417         of the special cases require access to DOM objects that are not
418         available in the secondary thread. Therefore, added
419         AXCoreObject::rolePlatformDescription that runs in the main thread to
420         initialize the corresponding attribute in AXIsolatedTreeNode.
421         rolePlatformString, createPlatformRoleMap, roleToPlatformString,
422         ariaLandmarkRoleDescription, are helper functions. The platform
423         functions allow to customize the behavior of roleDescription in each
424         platform. The platform overrides are implemented for mac. Other
425         platforms are pending.
426
427         * accessibility/AccessibilityObject.cpp:
428         (WebCore::AccessibilityObject::rolePlatformString const):
429         (WebCore::AccessibilityObject::rolePlatformDescription const):
430         (WebCore::AccessibilityObject::ariaLandmarkRoleDescription const):
431         (WebCore::AccessibilityObject::roleDescription const):
432         (WebCore::Accessibility::createPlatformRoleMap):
433         (WebCore::Accessibility::roleToPlatformString):
434         * accessibility/AccessibilityObject.h:
435         * accessibility/AccessibilityObjectInterface.h:
436         * accessibility/isolatedtree/AXIsolatedTreeNode.cpp:
437         (WebCore::AXIsolatedTreeNode::initializeAttributeData):
438         * accessibility/isolatedtree/AXIsolatedTreeNode.h:
439         * accessibility/mac/AccessibilityObjectMac.mm:
440         (WebCore::AccessibilityObject::rolePlatformString const):
441         (WebCore::AccessibilityObject::rolePlatformDescription const):
442         (WebCore::Accessibility::createPlatformRoleMap):
443         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
444         (-[WebAccessibilityObjectWrapperBase accessibilityObject]):
445         (-[WebAccessibilityObjectWrapperBase ariaLandmarkRoleDescription]): Implementation moved to AccessibilityObject.
446         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
447         (-[WebAccessibilityObjectWrapper role]): Special cases moved to rolePlatformString.
448         (-[WebAccessibilityObjectWrapper roleDescription]):
449         (createAccessibilityRoleMap): Deleted, became Accessibility::createPlatformRoleMap.
450         (roleValueToNSString): Deleted, became Accessibility::roleToPlatformString.
451         * platform/LocalizedStrings.cpp:
452         (WebCore::AXARIAContentGroupText):
453         (WebCore::AXHorizontalRuleDescriptionText):
454         (WebCore::AXMarkText):
455         * platform/LocalizedStrings.h:
456         * platform/cocoa/LocalizedStringsCocoa.mm:
457         (WebCore::AXARIAContentGroupText): Deleted, moved to LocalizedStrings.cpp.
458         (WebCore::AXHorizontalRuleDescriptionText): Deleted, moved to LocalizedStrings.cpp.
459         (WebCore::AXMarkText): Deleted, moved to LocalizedStrings.cpp.
460
461 2019-11-07  Chris Lord  <clord@igalia.com>
462
463         Indentation in ThreadGlobalData.h is incorrect
464         https://bugs.webkit.org/show_bug.cgi?id=203895
465
466         Reviewed by Žan Doberšek.
467
468         No new tests -- no change in behavior.
469
470         * platform/ThreadGlobalData.h:
471         (WebCore::ThreadGlobalData::ThreadGlobalData::cachedResourceRequestInitiators):
472         (WebCore::ThreadGlobalData::ThreadGlobalData::eventNames):
473         (WebCore::ThreadGlobalData::ThreadGlobalData::threadTimers):
474         (WebCore::ThreadGlobalData::ThreadGlobalData::qualifiedNameCache):
475         (WebCore::ThreadGlobalData::ThreadGlobalData::cachedConverterICU):
476         (WebCore::ThreadGlobalData::ThreadGlobalData::currentState const):
477         (WebCore::ThreadGlobalData::ThreadGlobalData::setCurrentState):
478         (WebCore::ThreadGlobalData::ThreadGlobalData::isInRemoveAllEventListeners const):
479         (WebCore::ThreadGlobalData::ThreadGlobalData::setIsInRemoveAllEventListeners):
480
481 2019-11-05  Sergio Villar Senin  <svillar@igalia.com>
482
483         VRDisplay should not prevent entering the back/forward cache
484         https://bugs.webkit.org/show_bug.cgi?id=203105
485
486         Reviewed by Chris Dumez.
487
488         VRDisplay schedules asynchronous execution of events using the WindowEventLoop instead of
489         synchronously firing them. WindowEventLoop does correctly suspend while in cache.
490
491         Apart from that suspend()/resume() were implemented by forcing m_scriptedAnimationController
492         to suspend the VR request animation frame machinery while in cache.
493
494         Last but not least, stopPresenting() is now also called on suspension.
495
496         No new tests were added as there is no testing machinery for WebVR so far. It's unclear how
497         this unreleased feature will evolve as it's being replaced by WebXR.
498
499         * Modules/webvr/VRDisplay.cpp:
500         (WebCore::VRDisplay::dispatchVRDisplayEventInWindowEventLoop):
501         (WebCore::VRDisplay::platformDisplayConnected): Use dispatchVRDisplayEventInWindowEventLoop.
502         (WebCore::VRDisplay::platformDisplayDisconnected): Ditto.
503         (WebCore::VRDisplay::platformDisplayMounted): Ditto.
504         (WebCore::VRDisplay::platformDisplayUnmounted): Ditto.
505         (WebCore::VRDisplay::suspend): Added.
506         (WebCore::VRDisplay::resume): Added.
507         (WebCore::VRDisplay::stop): Call stopPresenting().
508         (WebCore::VRDisplay::shouldPreventEnteringBackForwardCache_DEPRECATED const): Deleted.
509         * Modules/webvr/VRDisplay.h:
510
511 2019-11-06  Devin Rousso  <drousso@apple.com>
512
513         Remove unimplemented property error log in when getting a property value from a computed style
514         https://bugs.webkit.org/show_bug.cgi?id=203943
515
516         Reviewed by Simon Fraser.
517
518         In r251581, the list of computed CSS properties was changed to be autogenerated from 'CSSProperties.json'.
519         One issue that arose from this was that `-webkit-text-decorations-in-effect` was no longer part of the
520         `CSSComputedStyleDeclaration`, which caused a number of editing tests to fail, as that property is used
521         for holding internal state related to various editing commands (e.g. `document.execCommand(...)`). In
522         order to get around this, `ComputedStyleExtractor::copyProperties()` was modified to instead copy all CSS
523         properties, regardless of whether they're part of the set of computed CSS properties. Unfortunately, this
524         had a side effect of triggering a longstanding `LOG_ERROR` (added in r6178) when attempting to retrieve
525         the value of certain CSS properties (e.g. `-internal-text-autosizing-status`).
526
527         Since this code path can be triggered by JavaScript (e.g. `getComputedStyle(node).getPropertyCSSValue("...")`),
528         it doesn't add much benefit to have this log, especially since the code itself is already annotated with
529         comments/FIXMEs for CSS properties that don't have a computed value.
530
531         * css/CSSComputedStyleDeclaration.cpp:
532         (WebCore::ComputedStyleExtractor::valueForPropertyInStyle):
533         (WebCore::logUnimplementedPropertyID): Deleted.
534         * css/SVGCSSComputedStyleDeclaration.cpp:
535         (WebCore::ComputedStyleExtractor::svgPropertyValue):
536
537 2019-11-06  Eric Liang  <ericliang@apple.com>
538
539         AX: WKWebView does not shift Accessibility Focus for Catalyst (203798)
540         https://bugs.webkit.org/show_bug.cgi?id=203798
541
542         Reviewed by Chris Fleizach.
543
544         Changed to use the new cocoa directory instead of macOS only
545
546         * accessibility/mac/AXObjectCacheMac.mm:
547         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
548
549 2019-11-06  Fujii Hironori  <Hironori.Fujii@sony.com>
550
551         WEBCORE_TESTSUPPORT_EXPORT should be used only for WebCoreTestSupport, not for WebCore
552         https://bugs.webkit.org/show_bug.cgi?id=203876
553
554         Reviewed by Ross Kirsling.
555
556         WEBCORE_TESTSUPPORT_EXPORT shouldn't be used for WebCore. It is
557         only for WebCoreTestSupport module.
558
559         WebCoreTestSupport symbols don't need to export on Windows because
560         it is a static library on it. WEBCORE_TESTSUPPORT_EXPORT should be
561         empty.
562
563         No behavioral changes.
564
565         * Modules/encryptedmedia/MediaKeyEncryptionScheme.idl:
566         * Modules/encryptedmedia/MediaKeySessionType.idl:
567         * Modules/encryptedmedia/MediaKeysRequirement.idl:
568         * Modules/mediastream/NavigatorMediaDevices.h:
569         * bindings/scripts/test/JS/JSTestNode.h:
570         * bindings/scripts/test/TestNode.idl:
571         * workers/service/context/ServiceWorkerThreadProxy.h:
572         Replaced wrongly marked WEBCORE_TESTSUPPORT_EXPORT with WEBCORE_EXPORT.
573
574         * testing/js/WebCoreTestSupportPrefix.h: Define WEBCORE_TESTSUPPORT_EXPORT empty.
575         * WebCorePrefix.h: Removed WEBCORE_TESTSUPPORT_EXPORT definition.
576
577 2019-11-06  Simon Fraser  <simon.fraser@apple.com>
578
579         Change the UIWebView layer border colors to more strongly differentiate them from WKWebView's colors
580         https://bugs.webkit.org/show_bug.cgi?id=203940
581         rdar://problem/56708548
582
583         Reviewed by Tim Horton, Wenson Hsieh.
584
585         Change layer border colors (which also affect the repaint counter) in UIWebView to use
586         a chartreuse color, so it's easy to tell at a glance whether an app is using the deprecated
587         UIWebView.
588
589         * platform/ios/LegacyTileCache.mm:
590         (WebCore::LegacyTileCache::colorForGridTileBorder const):
591
592 2019-11-06  Jer Noble  <jer.noble@apple.com>
593
594         Screen locks while watching previously-muted-then-unmuted video
595         https://bugs.webkit.org/show_bug.cgi?id=203906
596         <rdar://problem/55821375>
597
598         Reviewed by Eric Carlson.
599
600         Test: media/video-unmuted-after-play-holds-sleep-assertion.html
601
602         * html/HTMLMediaElement.cpp:
603         (WebCore::HTMLMediaElement::setMuted):
604
605 2019-11-06  Oriol Brufau  <obrufau@igalia.com>
606
607         Keep None value at the end of the ListStyleType enum
608         https://bugs.webkit.org/show_bug.cgi?id=203883
609
610         Reviewed by Manuel Rego Casasnovas.
611
612         Bug 203837 added a String value at the end of the ListStyleType enum.
613         This patch moves it before None, in order to keep None at the end.
614
615         * rendering/style/RenderStyleConstants.h:
616
617 2019-11-06  Zalan Bujtas  <zalan@apple.com>
618
619         [LFC][MarginCollapsing] Add Line::isConsideredEmpty
620         https://bugs.webkit.org/show_bug.cgi?id=203800
621         <rdar://problem/56854192>
622
623         Reviewed by Antti Koivisto.
624
625         https://www.w3.org/TR/CSS22/visuren.html#inline-formatting
626         Line boxes that contain no text, no preserved white space, no inline elements with non-zero margins, padding, or borders,
627         and no other in-flow content (such as images, inline blocks or inline tables), and do not end with a preserved newline
628         must be treated as zero-height line boxes for the purposes of determining the positions of any elements inside of them,
629         and must be treated as not existing for any other purpose.
630
631         Note that it does not necessarily mean visually non-empty line
632         <span style="font-size: 0px">this is still considered non-empty</span>
633
634         * layout/blockformatting/BlockMarginCollapse.cpp:
635         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginsCollapseThrough const):
636         * layout/inlineformatting/InlineLine.cpp:
637         (WebCore::Layout::Line::appendNonBreakableSpace):
638         (WebCore::Layout::Line::appendTextContent):
639         (WebCore::Layout::Line::appendNonReplacedInlineBox):
640         (WebCore::Layout::Line::appendReplacedInlineBox):
641         (WebCore::Layout::Line::appendLineBreak):
642         * layout/inlineformatting/InlineLineBox.h:
643         (WebCore::Layout::LineBox::isConsideredEmpty const):
644         (WebCore::Layout::LineBox::setIsConsideredNonEmpty):
645
646 2019-11-06  Chris Lord  <clord@igalia.com>
647
648         [Cairo] Cairo graphics backend uses ImageBuffer::copyImage just to access native image buffer handles
649         https://bugs.webkit.org/show_bug.cgi?id=203884
650
651         Reviewed by Carlos Garcia Campos.
652
653         The Cairo graphics backend uses ImageBuffer::copyImage(DontCopyBackingStore) frequently just to access
654         the native image pointer. This makes several functions unusable off-main-thread, so add an accessor
655         function to avoid doing this.
656
657         No new tests -- no change in behavior.
658
659         * platform/graphics/ImageBuffer.h:
660         * platform/graphics/cairo/CairoOperations.cpp:
661         (WebCore::Cairo::drawShadowLayerBuffer):
662         (WebCore::Cairo::drawShadowImage):
663         (WebCore::Cairo::fillShadowBuffer):
664         * platform/graphics/cairo/GraphicsContextCairo.cpp:
665         (WebCore::GraphicsContext::clipToImageBuffer):
666         * platform/graphics/cairo/GraphicsContextImplCairo.cpp:
667         (WebCore::GraphicsContextImplCairo::clipToImageBuffer):
668         * platform/graphics/cairo/ImageBufferCairo.cpp:
669         (WebCore::ImageBuffer::nativeImage const):
670
671 2019-11-06  Philippe Normand  <philn@igalia.com>
672
673         REGRESSION(r249428): [GStreamer] VP9 video rendered green
674         https://bugs.webkit.org/show_bug.cgi?id=201422
675         <rdar://problem/55945741>
676
677         Reviewed by Carlos Garcia Campos.
678
679         Enable the texture upload GStreamer meta code path. Until
680         GStreamer 1.16.2 this workaround is needed to fix VP9 (vp9dec)
681         rendering. For downstream users cherry-picking the corresponding
682         GStreamer patch[0], an environment variable can be set to bypass
683         the reintroduced slow color conversion: $WEBKIT_GST_NO_RGBA_CONVERSION.
684
685         [0] https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/commit/8d32de090554cf29fe359f83aa46000ba658a693
686
687         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
688         (WebCore::MediaPlayerPrivateGStreamerBase::createVideoSinkGL):
689
690 2019-11-06  youenn fablet  <youenn@apple.com>
691
692         There is no need to clean the content type header of a request if it is null
693         https://bugs.webkit.org/show_bug.cgi?id=203853
694
695         Reviewed by Geoffrey Garen.
696
697         No change of behavior.
698
699         * loader/CrossOriginAccessControl.cpp:
700         (WebCore::cleanHTTPRequestHeadersForAccessControl):
701         Stop early if content type is null so that we do not log an error that is not a real error.
702
703 2019-11-05  Ryosuke Niwa  <rniwa@webkit.org>
704
705         Integrate visualViewport's resize event with HTML5 event loop
706         https://bugs.webkit.org/show_bug.cgi?id=203842
707
708         Reviewed by Simon Fraser.
709
710         Integrate the visual viewport API's resize event with HTML5 event loop
711         as intended in r251867.
712
713         Test: fast/events/resize-subframe-in-rendering-update.html
714
715         * dom/DocumentEventQueue.cpp:
716         (WebCore::DocumentEventQueue::enqueueResizeEvent): Deleted.
717         * dom/DocumentEventQueue.h:
718         * page/VisualViewport.cpp:
719         (WebCore::VisualViewport::update):
720         (WebCore::VisualViewport::enqueueResizeEvent): Deleted.
721
722 2019-11-05  Fujii Hironori  <Hironori.Fujii@sony.com>
723
724         Unreviewed, rolling out r251908.
725
726         This workaround is not needed after r252086.
727
728         Reverted changeset:
729
730         "[WinCairo][Clang] Unreviewed build fix"
731         https://bugs.webkit.org/show_bug.cgi?id=203663
732         https://trac.webkit.org/changeset/251908
733
734         * workers/service/context/ServiceWorkerThreadProxy.cpp:
735         (WebCore::ServiceWorkerThreadProxy::identifier const): Deleted.
736         * workers/service/context/ServiceWorkerThreadProxy.h:
737
738 2019-11-05  Fujii Hironori  <Hironori.Fujii@sony.com>
739
740         [Win][CMake] Build WebCore as an OBJECT library unless Apple internal builds
741         https://bugs.webkit.org/show_bug.cgi?id=203663
742
743         Reviewed by Ross Kirsling.
744
745         No behavioral changes.
746
747         * CMakeLists.txt: Changed WebCoreTestSupport not to link with
748         WebCore for Windows. Because WebKit.dll exports WebCore symbols,
749         they will be duplicated with WebCore.
750
751 2019-11-05  Ryosuke Niwa  <rniwa@webkit.org>
752
753         REGRESSION (r251930): Flaky WK1 crash in printing/pseudo-class-outside-page.html
754         https://bugs.webkit.org/show_bug.cgi?id=203855
755
756         Reviewed by Simon Fraser.
757
758         Exit early when executing media queries removes FrameView.
759
760         * page/Frame.cpp:
761         (WebCore::Frame::setPrinting):
762
763 2019-11-05  Ryosuke Niwa  <rniwa@webkit.org>
764
765         Adding logging to diagnose crashes resulting from provisional document loader unexpectedly being nullptr
766         https://bugs.webkit.org/show_bug.cgi?id=203837
767
768         Reviewed by Geoffrey Garen.
769
770         Added various logging for DocumentLoader and FrameLoader to figure out why
771         FrameLoader::m_provisionalDocumentLoader can be nullptr in some cases.
772
773         * loader/DocumentLoader.cpp:
774         (WebCore::DocumentLoader::setRequest):
775         (WebCore::DocumentLoader::willSendRequest):
776         * loader/FrameLoader.cpp:
777         (WebCore::FrameLoader::setupForReplace):
778         (WebCore::FrameLoader::clearProvisionalLoadForPolicyCheck):
779         (WebCore::FrameLoader::stopAllLoaders):
780         (WebCore::FrameLoader::stopForBackForwardCache):
781         (WebCore::FrameLoader::clearProvisionalLoad):
782         (WebCore::FrameLoader::transitionToCommitted):
783         (WebCore::FrameLoader::continueFragmentScrollAfterNavigationPolicy):
784         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
785
786 2019-11-05  Oriol Brufau  <obrufau@igalia.com>
787
788         [css-lists] Implement list-style-type: <string>
789         https://bugs.webkit.org/show_bug.cgi?id=167729
790
791         Reviewed by Antti Koivisto.
792
793         This patch extends the syntax of the list-style-type property to accept
794         arbitrary string values in order to customize the marker contents.
795
796         When a string is specified for list-style-type, the patch sets it to a
797         special ListStyleType::String, and the string value is stored in an
798         extra field.
799
800         Tests: imported/w3c/web-platform-tests/css/css-lists/list-style-type-string-001a.html
801                imported/w3c/web-platform-tests/css/css-lists/list-style-type-string-001b.html
802                imported/w3c/web-platform-tests/css/css-lists/list-style-type-string-002.html
803                imported/w3c/web-platform-tests/css/css-lists/list-style-type-string-003.html
804                imported/w3c/web-platform-tests/css/css-lists/list-style-type-string-004.html
805                imported/w3c/web-platform-tests/css/css-lists/list-style-type-string-005a.html
806                imported/w3c/web-platform-tests/css/css-lists/list-style-type-string-005b.html
807                imported/w3c/web-platform-tests/css/css-lists/list-style-type-string-006.html
808                imported/w3c/web-platform-tests/css/css-lists/list-style-type-string-007.html
809                imported/w3c/web-platform-tests/css/css-lists/parsing/list-style-type-computed.html
810                imported/w3c/web-platform-tests/css/css-lists/parsing/list-style-type-valid.html
811
812         Some tests fail because mixed-bidi is not supported in markers
813         (https://bugs.webkit.org/show_bug.cgi?id=202849).
814
815         * css/CSSComputedStyleDeclaration.cpp:
816         (WebCore::ComputedStyleExtractor::valueForPropertyInStyle):
817         * css/CSSPrimitiveValueMappings.h:
818         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
819         * css/CSSProperties.json:
820         * css/parser/CSSParserFastPaths.cpp:
821         (WebCore::CSSParserFastPaths::isPartialKeywordPropertyID):
822         * css/parser/CSSParserFastPaths.h:
823         * css/parser/CSSPropertyParser.cpp:
824         (WebCore::CSSPropertyParser::parseSingleValue):
825         * rendering/RenderListMarker.cpp:
826         (WebCore::effectiveListMarkerType):
827         (WebCore::listMarkerSuffix):
828         (WebCore::listMarkerText):
829         (WebCore::RenderListMarker::styleDidChange):
830         (WebCore::RenderListMarker::paint):
831         (WebCore::RenderListMarker::updateContent):
832         (WebCore::RenderListMarker::computePreferredLogicalWidths):
833         (WebCore::RenderListMarker::updateMargins):
834         (WebCore::RenderListMarker::suffix const):
835         (WebCore::RenderListMarker::getRelativeMarkerRect):
836         * rendering/style/CounterContent.h:
837         (WebCore::CounterContent::CounterContent):
838         * rendering/style/RenderStyle.h:
839         (WebCore::RenderStyle::listStyleStringValue const):
840         (WebCore::RenderStyle::setListStyleStringValue):
841         (WebCore::RenderStyle::initialListStyleStringValue):
842         * rendering/style/RenderStyleConstants.cpp:
843         (WebCore::operator<<):
844         * rendering/style/RenderStyleConstants.h:
845         * rendering/style/StyleRareInheritedData.cpp:
846         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
847         (WebCore::StyleRareInheritedData::operator== const):
848         * rendering/style/StyleRareInheritedData.h:
849         * style/StyleBuilderCustom.h:
850         (WebCore::Style::BuilderCustom::applyInheritListStyleType):
851         (WebCore::Style::BuilderCustom::applyInitialListStyleType):
852         (WebCore::Style::BuilderCustom::applyValueListStyleType):
853
854 2019-11-05  Simon Fraser  <simon.fraser@apple.com>
855
856         Content can disappear with a combination of <video> with controls and clipping
857         https://bugs.webkit.org/show_bug.cgi?id=203834
858         rdar://problem/56559648
859
860         Reviewed by Zalan Bujtas.
861         
862         <video> with controls triggered a bug where a backing-sharing layer also claimed
863         that it didn't need any backing store. RenderLayerCompositor::requiresOwnBackingStore()
864         could early-return with 'false' if a layer had an indirect compositing reason of "Clipping",
865         while also backing-sharing. We need to check for backing-sharing first.
866
867         Test: compositing/shared-backing/clipping-and-shared-backing.html
868
869         * rendering/RenderLayerBacking.cpp:
870         (WebCore::RenderLayerBacking::setBackingSharingLayers):
871         * rendering/RenderLayerCompositor.cpp:
872         (WebCore::RenderLayerCompositor::requiresOwnBackingStore const):
873
874 2019-11-05  Said Abou-Hallawa  <sabouhallawa@apple.com>
875
876         Disabled SVG shapes should not be hit
877         https://bugs.webkit.org/show_bug.cgi?id=200140
878
879         Reviewed by Simon Fraser.
880
881         The fill and the stroke rectangles should not be computed for disabled
882         SVG shapes.
883
884         The existing code may calculate the root's boundary: at(0, 0) size 0x0
885         while one of its children boundary is calculated at: (47,47) size 6x6.
886         See circle-01-expected.txt.
887
888         * rendering/svg/RenderSVGEllipse.cpp:
889         (WebCore::RenderSVGEllipse::updateShapeFromElement):
890         * rendering/svg/RenderSVGRect.cpp:
891         (WebCore::RenderSVGRect::updateShapeFromElement):
892         * rendering/svg/RenderSVGShape.cpp:
893         (WebCore::RenderSVGShape::fillContains):
894         (WebCore::RenderSVGShape::strokeContains):
895
896 2019-11-05  Daniel Bates  <dabates@apple.com>
897
898         [Cocoa] Right Command key should have location DOM_KEY_LOCATION_RIGHT instead of DOM_KEY_LOCATION_STANDARD
899         https://bugs.webkit.org/show_bug.cgi?id=202601
900         <rdar://problem/55992775>
901
902         Reviewed by Wenson Hsieh.
903
904         On Cocoa platforms the right Command key is mapped to VK_APPS. Report VK_APPS as being on the
905         right side of the keyboard on these platforms.
906
907         * dom/KeyboardEvent.cpp:
908         (WebCore::keyLocationCode):
909
910 2019-11-05  Chris Dumez  <cdumez@apple.com>
911
912         DatabaseContext should not prevent entering the back/forward cache
913         https://bugs.webkit.org/show_bug.cgi?id=203103
914         <rdar://problem/56592193>
915
916         Reviewed by Geoffrey Garen.
917
918         Let pages with active webdatabase transactions into the back/forward cache. We make sure
919         to queue tasks that run script to the Window event loop, so that they get delayed when
920         the document is suspended.
921
922         This patch also makes sure that the transaction's error callback gets called if the database
923         gets closed while the transaction is going on. We previously did not happen and it was causing
924         issues because databases get closed on navigation.
925
926         No new tests, updated existing test.
927
928         * Modules/webdatabase/Database.cpp:
929         (WebCore::Database::runTransaction):
930         * Modules/webdatabase/DatabaseContext.cpp:
931         (WebCore::DatabaseContext::shouldPreventEnteringBackForwardCache_DEPRECATED const): Deleted.
932         * Modules/webdatabase/DatabaseContext.h:
933         * Modules/webdatabase/DatabaseManager.cpp:
934         (WebCore::DatabaseManager::openDatabase):
935         * Modules/webdatabase/SQLTransaction.cpp:
936         (WebCore::SQLTransaction::performPendingCallback):
937         (WebCore::SQLTransaction::notifyDatabaseThreadIsShuttingDown):
938         (WebCore::SQLTransaction::callErrorCallbackDueToInterruption):
939         (WebCore::SQLTransaction::checkAndHandleClosedDatabase):
940         (WebCore::SQLTransaction::deliverTransactionErrorCallback):
941         (WebCore::SQLTransaction::deliverSuccessCallback):
942         (WebCore::SQLTransaction::computeNextStateAndCleanupIfNeeded):
943         * Modules/webdatabase/SQLTransaction.h:
944
945 2019-11-05  Sihui Liu  <sihui_liu@apple.com>
946
947         REGRESSION (r250754): web page using IDBIndex doesn't load occasionally
948         https://bugs.webkit.org/show_bug.cgi?id=203431
949
950         Reviewed by Brady Eidson.
951
952         We now allow page to enter cache even when there are active IDB objects. The open database connection or blocked
953         database request on suspended pages may stop other active pages from deleting or opening the same database.
954
955         To fix this issue, we close those open connections on suspended page when we know from the versionchange event, 
956         that there is open/delete request blocked. For blocked requests on suspended page, we abort them and return 
957         error. This way, when the suspended page resumes, it will get close event fired on previously opened database 
958         connections, and error event fired on previously blocked requests.
959
960         API test: IndexedDB.IndexedDBInPageCache
961
962         * Modules/indexeddb/IDBDatabase.h:
963         * Modules/indexeddb/IDBOpenDBRequest.cpp:
964         (WebCore::IDBOpenDBRequest::requestCompleted):
965         (WebCore::IDBOpenDBRequest::requestBlocked):
966         (WebCore::IDBOpenDBRequest::setIsContextSuspended):
967         * Modules/indexeddb/IDBOpenDBRequest.h:
968         * Modules/indexeddb/IndexedDB.h:
969         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
970         (WebCore::IDBClient::IDBConnectionProxy::completeOpenDBRequest):
971         (WebCore::IDBClient::IDBConnectionProxy::fireVersionChangeEvent):
972         (WebCore::IDBClient::IDBConnectionProxy::didFireVersionChangeEvent):
973         (WebCore::IDBClient::setMatchingItemsContextSuspended):
974         (WebCore::IDBClient::IDBConnectionProxy::setContextSuspended):
975         * Modules/indexeddb/client/IDBConnectionProxy.h:
976         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
977         (WebCore::IDBClient::IDBConnectionToServer::didFireVersionChangeEvent):
978         * Modules/indexeddb/client/IDBConnectionToServer.h:
979         * Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
980         * Modules/indexeddb/server/IDBServer.cpp:
981         (WebCore::IDBServer::IDBServer::didFireVersionChangeEvent):
982         * Modules/indexeddb/server/IDBServer.h:
983         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
984         (WebCore::IDBServer::UniqueIDBDatabase::clearTransactionsOnConnection):
985         (WebCore::IDBServer::UniqueIDBDatabase::didFireVersionChangeEvent):
986         (WebCore::IDBServer::UniqueIDBDatabase::connectionClosedFromClient):
987         * Modules/indexeddb/server/UniqueIDBDatabase.h:
988         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
989         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didFireVersionChangeEvent):
990         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.h:
991         * Modules/indexeddb/shared/InProcessIDBServer.cpp:
992         (WebCore::InProcessIDBServer::didFireVersionChangeEvent):
993         * Modules/indexeddb/shared/InProcessIDBServer.h:
994         * dom/Document.cpp:
995         (WebCore::Document::setBackForwardCacheState):
996         * workers/WorkerGlobalScope.cpp:
997         (WebCore::WorkerGlobalScope::suspend):
998         (WebCore::WorkerGlobalScope::resume):
999         * workers/WorkerGlobalScope.h:
1000         * workers/WorkerThread.cpp:
1001         (WebCore::WorkerThread::suspend):
1002
1003 2019-11-05  Eric Carlson  <eric.carlson@apple.com>
1004
1005         http/tests/media/track-in-band-hls-metadata.html sometimes crashes after r251626
1006         https://bugs.webkit.org/show_bug.cgi?id=203849
1007         <rdar://problem/56889717>
1008
1009         Reviewed by Youenn Fablet.
1010
1011         No new tests, fixes existing test.
1012
1013         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1014         (-[WebCoreAVFMovieObserver metadataOutput:didOutputTimedMetadataGroups:fromPlayerItemTrack:]): Return early if
1015         m_player has been cleared.
1016         (-[WebCoreAVFMovieObserver metadataCollector:didCollectDateRangeMetadataGroups:indexesOfNewGroups:indexesOfModifiedGroups:]):
1017         Ditto.
1018
1019 2019-11-05  Andy Estes  <aestes@apple.com>
1020
1021         ApplePaySession should never prevent entering the back/forward cache
1022         https://bugs.webkit.org/show_bug.cgi?id=203087
1023         <rdar://problem/56744401>
1024
1025         Reviewed by Chris Dumez.
1026
1027         Rather than prevent entering the back/forward cache when there is an active session, abort
1028         the session on suspension and queue a task to the event loop that dispatches the cancel event.
1029
1030         Tests: http/tests/ssl/applepay/page-cache-active-apple-pay-session.html
1031                http/tests/ssl/applepay/page-cache-inactive-apple-pay-session.html
1032
1033         * Modules/applepay/ApplePaySession.cpp:
1034         (WebCore::ApplePaySession::canSuspendWithoutCanceling const):
1035         (WebCore::ApplePaySession::suspend):
1036         (WebCore::ApplePaySession::shouldPreventEnteringBackForwardCache_DEPRECATED const): Deleted.
1037         * Modules/applepay/ApplePaySession.h:
1038
1039 2019-11-05  youenn fablet  <youenn@apple.com>
1040
1041         MessagePort::close cannot assume that is execution context is not null
1042         https://bugs.webkit.org/show_bug.cgi?id=203843
1043         <rdar://problem/55599877>
1044
1045         Reviewed by Chris Dumez.
1046
1047         Covered by updated test.
1048
1049         * dom/MessagePort.cpp:
1050         (WebCore::MessagePort::close):
1051         Do not use m_scriptExecutionContext since it can be nulled out in MessagePort::disentangle.
1052         * dom/messageports/WorkerMessagePortChannelProvider.cpp:
1053         (WebCore::WorkerMessagePortChannelProvider::messagePortClosed):
1054
1055 2019-11-05  James Darpinian  <jdarpinian@chromium.org>
1056
1057         Enable powerPreference controlled GPU switching with ANGLE
1058         https://bugs.webkit.org/show_bug.cgi?id=203773
1059
1060         GPU switching can't be controlled from within ANGLE running in the content process
1061         due to sandbox restrictions. So we need to continue using the existing
1062         HighPerformanceGPUManager path with ANGLE.
1063
1064         Although the high power GPU is activated on request with this change, ANGLE does
1065         not use it yet.
1066
1067         Reviewed by Alex Christensen.
1068
1069         * platform/graphics/GraphicsContext3D.cpp:
1070         * platform/graphics/GraphicsContext3D.h:
1071         * platform/graphics/GraphicsContext3DManager.cpp:
1072         (WebCore::GraphicsContext3DManager::updateHighPerformanceState):
1073         (WebCore::GraphicsContext3DManager::disableHighPerformanceGPUTimerFired):
1074         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
1075         (WebCore::GraphicsContext3D::GraphicsContext3D):
1076
1077 2019-11-05  youenn fablet  <youenn@apple.com>
1078
1079         mp4 video element broken with service worker
1080         https://bugs.webkit.org/show_bug.cgi?id=184447
1081         <rdar://problem/39313155>
1082
1083         Reviewed by Chris Dumez.
1084
1085         Update fetch header handling to properly handle range header as per https://fetch.spec.whatwg.org/#headers-class.
1086         In particular, remove thre range header from a Request/Headers object whenever modified.
1087         Add checks so that range responses are not reused for non range requests.
1088         For that purpose, add a range-requested flag to ResourceResponse.
1089         Ass helper routines implementing part of fetch spec.
1090         Covered by enabled test.
1091
1092         * Modules/fetch/FetchHeaders.cpp:
1093         (WebCore::removePrivilegedNoCORSRequestHeaders):
1094         (WebCore::appendToHeaderMap):
1095         (WebCore::FetchHeaders::remove):
1096         (WebCore::FetchHeaders::set):
1097         * Modules/fetch/FetchHeaders.h:
1098         (WebCore::FetchHeaders::setInternalHeaders):
1099         * Modules/fetch/FetchRequest.cpp:
1100         (WebCore::FetchRequest::initializeWith):
1101         * loader/SubresourceLoader.cpp:
1102         (WebCore::SubresourceLoader::didReceiveResponse):
1103         * loader/cache/CachedResourceLoader.cpp:
1104         (WebCore::CachedResourceLoader::requestResource):
1105         * platform/network/HTTPParsers.cpp:
1106         (WebCore::isNoCORSSafelistedRequestHeaderName):
1107         (WebCore::isPriviledgedNoCORSRequestHeaderName):
1108         * platform/network/HTTPParsers.h:
1109         * platform/network/ResourceResponseBase.cpp:
1110         (WebCore::ResourceResponseBase::crossThreadData const):
1111         (WebCore::ResourceResponseBase::fromCrossThreadData):
1112         * platform/network/ResourceResponseBase.h:
1113         (WebCore::ResourceResponseBase::isRangeRequested const):
1114         (WebCore::ResourceResponseBase::setAsRangeRequested):
1115         (WebCore::ResourceResponseBase::encode const):
1116         (WebCore::ResourceResponseBase::decode):
1117
1118 2019-11-05  youenn fablet  <youenn@apple.com>
1119
1120         Enforce user gesture for getUserMedia in case a previous getUserMedia call was denied
1121         https://bugs.webkit.org/show_bug.cgi?id=203362
1122
1123         Reviewed by Eric Carlson.
1124
1125         Compute whether a media request is user priviledged or not.
1126         It is priviledged if it is created as part of a user gesture and no request of the same type
1127         has been previously created for the same user gesture.
1128         If getDisplayMedia is called twice as part of a single user gesture, getDisplaMedia will reject for the second call.
1129
1130         Remove the internal ability to disable user gesture check.
1131         Instead use internals API to simulate a user gesture.       
1132
1133         Test: fast/mediastream/getUserMedia-deny-persistency5.html and updated test.
1134
1135         * Modules/mediastream/MediaDevices.cpp:
1136         (WebCore::MediaDevices::computeUserGesturePriviledge):
1137         (WebCore::MediaDevices::getUserMedia):
1138         (WebCore::MediaDevices::getDisplayMedia):
1139         (WebCore::MediaDevices::getUserMedia const): Deleted.
1140         (WebCore::MediaDevices::getDisplayMedia const): Deleted.
1141         * Modules/mediastream/MediaDevices.h:
1142         * platform/mediastream/MediaStreamRequest.h:
1143         (WebCore::MediaStreamRequest::encode const):
1144         (WebCore::MediaStreamRequest::decode):
1145         * testing/Internals.cpp:
1146         (WebCore::Internals::setMediaStreamSourceInterrupted):
1147         (WebCore::Internals::setDisableGetDisplayMediaUserGestureConstraint): Deleted.
1148         * testing/Internals.h:
1149         * testing/Internals.idl:
1150
1151 2019-11-05  Carlos Garcia Campos  <cgarcia@igalia.com>
1152
1153         [FreeType] Too slow running encoding/legacy-mb-korean/euc-kr WPT tests
1154         https://bugs.webkit.org/show_bug.cgi?id=203544
1155
1156         Reviewed by Carlos Alberto Lopez Perez.
1157
1158         Use a cache for system fallbacks to keep the fonts sorted by font description. When a system fallback is needed
1159         again for the same font description, but different characters, we just iterate the cached font set comparing the
1160         charsets to get the best one. This avoids using FcFontMatch and FcFontSort is only called once per font description.
1161
1162         * platform/graphics/FontCache.h:
1163         * platform/graphics/freetype/FontCacheFreeType.cpp:
1164         (WebCore::CachedFontSet::CachedFontSet):
1165         (WebCore::CachedFontSet::bestForCharacters):
1166         (WebCore::FallbackFontDescriptionKey::FallbackFontDescriptionKey):
1167         (WebCore::FallbackFontDescriptionKey::operator== const):
1168         (WebCore::FallbackFontDescriptionKey::operator!= const):
1169         (WebCore::FallbackFontDescriptionKey::isHashTableDeletedValue const):
1170         (WebCore::FallbackFontDescriptionKey::computeHash const):
1171         (WebCore::FallbackFontDescriptionKeyHash::hash):
1172         (WebCore::FallbackFontDescriptionKeyHash::equal):
1173         (WebCore::systemFallbackCache):
1174         (WebCore::FontCache::systemFallbackForCharacters):
1175         (WebCore::FontCache::platformPurgeInactiveFontData):
1176
1177 2019-11-04  Chris Dumez  <cdumez@apple.com>
1178
1179         Drop SuspendableTaskQueue now that it is unused
1180         https://bugs.webkit.org/show_bug.cgi?id=203827
1181
1182         Reviewed by Ryosuke Niwa.
1183
1184         All users have been ported to the HTML5 event loop.
1185
1186         * PlatformWin.cmake:
1187         * Sources.txt:
1188         * WebCore.xcodeproj/project.pbxproj:
1189         * platform/SuspendableTaskQueue.cpp: Removed.
1190         * platform/SuspendableTaskQueue.h: Removed.
1191         * workers/service/ServiceWorkerContainer.h:
1192
1193 2019-11-04  Myles C. Maxfield  <mmaxfield@apple.com>
1194
1195         Rename ui-monospaced to ui-monospace to match the monospace generic font family
1196         https://bugs.webkit.org/show_bug.cgi?id=203602
1197
1198         Reviewed by Simon Fraser.
1199
1200         As per https://github.com/w3c/csswg-drafts/issues/4469
1201
1202         Updated existing tests.
1203
1204         * platform/graphics/cocoa/FontCacheCoreText.cpp:
1205         (WebCore::platformFontLookupWithFamily):
1206         (WebCore::fontWithFamilySpecialCase):
1207         * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
1208         (WebCore::matchSystemFontUse):
1209         * platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp:
1210         (WebCore::SystemFontDatabaseCoreText::createDesignSystemUIFont):
1211         (WebCore::SystemFontDatabaseCoreText::cascadeList):
1212         (WebCore::SystemFontDatabaseCoreText::systemFontParameters):
1213         * platform/graphics/cocoa/SystemFontDatabaseCoreText.h:
1214
1215 2019-11-04  Chris Dumez  <cdumez@apple.com>
1216
1217         MediaKeySession / WebKitMediaKeySession should not prevent entering the back/forward cache
1218         https://bugs.webkit.org/show_bug.cgi?id=203089
1219
1220         Reviewed by Youenn Fablet.
1221
1222         Port MediaKeySession / WebKitMediaKeySession to the HTML5 event loop instead of using its
1223         own GenericEventQueue / GenericTaskQueue. Because the HTML5 event loop plays nicely with
1224         the back/forward cache, we can now let pages using MediaKeySession / WebKitMediaKeySession
1225         into the back/forward cache.
1226
1227         Test: http/tests/navigation/page-cache-mediakeysession.html
1228
1229         * Modules/encryptedmedia/MediaKeySession.cpp:
1230         (WebCore::MediaKeySession::MediaKeySession):
1231         (WebCore::MediaKeySession::generateRequest):
1232         (WebCore::MediaKeySession::load):
1233         (WebCore::MediaKeySession::update):
1234         (WebCore::MediaKeySession::close):
1235         (WebCore::MediaKeySession::remove):
1236         (WebCore::MediaKeySession::enqueueMessage):
1237         (WebCore::MediaKeySession::updateKeyStatuses):
1238         (WebCore::MediaKeySession::hasPendingActivity const):
1239         (WebCore::MediaKeySession::activeDOMObjectName const):
1240         (WebCore::MediaKeySession::enqueueTask):
1241         (WebCore::MediaKeySession::enqueueEvent):
1242         (WebCore::MediaKeySession::shouldPreventEnteringBackForwardCache_DEPRECATED const): Deleted.
1243         (WebCore::MediaKeySession::stop): Deleted.
1244         * Modules/encryptedmedia/MediaKeySession.h:
1245         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
1246         (WebCore::WebKitMediaKeySession::WebKitMediaKeySession):
1247         (WebCore::WebKitMediaKeySession::~WebKitMediaKeySession):
1248         (WebCore::WebKitMediaKeySession::addKeyTimerFired):
1249         (WebCore::WebKitMediaKeySession::sendMessage):
1250         (WebCore::WebKitMediaKeySession::sendError):
1251         (WebCore::WebKitMediaKeySession::hasPendingActivity const):
1252         (WebCore::WebKitMediaKeySession::enqueueEvent):
1253         (WebCore::WebKitMediaKeySession::shouldPreventEnteringBackForwardCache_DEPRECATED const): Deleted.
1254         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.h:
1255
1256 2019-11-04  Ross Kirsling  <ross.kirsling@sony.com>
1257
1258         Unreviewed fix for non-unified build.
1259
1260         * style/PropertyCascade.cpp:
1261         (WebCore::Style::isValidVisitedLinkProperty): Deleted.
1262         * style/PropertyCascade.h:
1263         (WebCore::Style::isValidVisitedLinkProperty): Added.
1264         This is being used from StyleBuilder.cpp; it can't just be static inline in a .cpp file.
1265
1266         * Modules/cache/DOMCacheStorage.cpp:
1267         * css/DOMCSSRegisterCustomProperty.cpp:
1268         * inspector/InspectorInstrumentation.cpp:
1269         * style/StyleBuilder.cpp:
1270         * style/StyleBuilderState.cpp:
1271         * workers/service/ServiceWorkerProvider.cpp:
1272         * worklets/WorkletGlobalScope.h:
1273         Add missing includes.
1274
1275 2019-11-04  Chris Dumez  <cdumez@apple.com>
1276
1277         Unreviewed attempt to fix wincairo build after r252016.
1278
1279         * css/FontFaceSet.h:
1280
1281 2019-11-04  Wenson Hsieh  <wenson_hsieh@apple.com>
1282
1283         REGRESSION (r248750): Drop-down menu for Walgreens 2FA unresponsive to touch
1284         https://bugs.webkit.org/show_bug.cgi?id=203821
1285         <rdar://problem/56550488>
1286
1287         Reviewed by Zalan Bujtas.
1288
1289         The dropdown in question in the Walgreens app uses UIWebView. In this report, tapping the dropdown menu (which
1290         installs DOMTimers upon touchstart) no longer dispatches a click event. This reproduces in WebKit1, but not in
1291         WebKit2.
1292
1293         After r248750, we no longer transition from IndeterminateChange to NoChange before calling out to the client
1294         layer to report a deferred content observation change (in legacy WebKit, this is a call to the delegate method
1295         -webView:didObserveDeferredContentChange:forFrame:).
1296
1297         In WebKit2, logic in WebPage::handleSyntheticClick handles indeterminate content changes after dispatching
1298         mousemove by starting a fixed 32ms content observation timer, after the end of which we transition from
1299         indeterminate to either NoChange or VisibilityChange, and call out to the client. This logic is absent in
1300         WebKitLegacy, where we directly report the current content observation state to the client.
1301
1302         As such, the content change is still indeterminate when we finally call out to the client layer in the runloop
1303         after dispatching the mousemove event in EventHandler::mouseMoved(). Client code in UIKit does not expect this,
1304         and assumes that the given WKContentChange must either be NoChange or VisibilityChange; thus, it handles
1305         indeterminate change as VisibilityChange and does not dispatch a click.
1306
1307         This legacy-WebKit-specific call to didFinishContentChangeObserving is intended to act as a failsafe to stop
1308         content observation after mousemove, if any active timers scheduled during touchstart have already finished
1309         executing. To fix this bug, instead of calling out to WebChromeClient::didFinishContentChangeObserving directly,
1310         add a new method to ContentChangeObserver to inform it that a mousemove event has been handled; here, we call
1311         notifyClientIfNeeded, which will transition the content change state from indeterminate to NoChange if needed
1312         before calling out to the client.
1313
1314         No new test, because we don't have any mechanism for simulating user interaction in UIWebView (and inventing one
1315         at this stage would have diminishing returns at best).
1316
1317         * page/ios/ContentChangeObserver.cpp:
1318         (WebCore::ContentChangeObserver::willNotProceedWithFixedObservationTimeWindow):
1319         (WebCore::ContentChangeObserver::adjustObservedState):
1320         * page/ios/ContentChangeObserver.h:
1321         * page/ios/EventHandlerIOS.mm:
1322         (WebCore::EventHandler::mouseMoved):
1323
1324         Replace the call to WebChromeClient::didFinishContentChangeObserving with a ContentChangeObserver method that
1325         turns around and calls into notifyClientIfNeeded, via ContentChangeObserver::adjustObservedState.
1326
1327 2019-11-04  Chris Dumez  <cdumez@apple.com>
1328
1329         Port FontFaceSet to the HTML5 event loop
1330         https://bugs.webkit.org/show_bug.cgi?id=203769
1331
1332         Reviewed by Ryosuke Niwa.
1333
1334         * css/FontFaceSet.cpp:
1335         (WebCore::FontFaceSet::didFirstLayout):
1336         (WebCore::FontFaceSet::completedLoading):
1337         (WebCore::FontFaceSet::faceFinished):
1338         (WebCore::FontFaceSet::enqueueTask):
1339         * css/FontFaceSet.h:
1340         * dom/AbstractEventLoop.h:
1341
1342 2019-11-04  John Wilander  <wilander@apple.com>
1343
1344         Resource Load Statistics: Flush the shared ResourceLoadObserver when the webpage is closed by JavaScript
1345         https://bugs.webkit.org/show_bug.cgi?id=203623
1346         <rdar://problem/56756427>
1347
1348         Reviewed by Alex Christensen.
1349
1350         New API test added.
1351
1352         * loader/ResourceLoadObserver.cpp:
1353         (WebCore::ResourceLoadObserver::shared):
1354             Now returns its own empty observer if no shared one has been set.
1355         * loader/ResourceLoadObserver.h:
1356         (WebCore::ResourceLoadObserver::logSubresourceLoadingForTesting):
1357             Test function to seed the web process' observer.
1358         * page/DOMWindow.cpp:
1359         (WebCore::DOMWindow::close):
1360             Now flushes the shared observer.
1361
1362 2019-11-04  Alex Christensen  <achristensen@webkit.org>
1363
1364         Collect all documents before iterating in Page::forEachDocument
1365         https://bugs.webkit.org/show_bug.cgi?id=203811
1366         <rdar://problem/56832747>
1367
1368         Reviewed by Ryosuke Niwa.
1369
1370         Some calls to forEachDocument, notably those introduced in r251930, can mutate the frames and documents as they are being iterated.
1371         This causes problems that can be avoided by iterating, keeping all Documents referenced, then iterating the referenced Documents.
1372
1373         * page/Page.cpp:
1374         (WebCore::Page::forEachDocument):
1375
1376 2019-11-04  Truitt Savell  <tsavell@apple.com>
1377
1378         Unreviewed, rolling out r251993.
1379
1380         Broke platform/mac/media/encrypted-media/fps-
1381         generateRequest.html on Mojave+
1382
1383         Reverted changeset:
1384
1385         "MediaKeySession / WebKitMediaKeySession should not prevent
1386         entering the back/forward cache"
1387         https://bugs.webkit.org/show_bug.cgi?id=203089
1388         https://trac.webkit.org/changeset/251993
1389
1390 2019-11-04  Chris Dumez  <cdumez@apple.com>
1391
1392         Port WebAnimation to the HTML5 event loop
1393         https://bugs.webkit.org/show_bug.cgi?id=203797
1394
1395         Reviewed by Ryosuke Niwa.
1396
1397         * animation/WebAnimation.cpp:
1398         (WebCore::WebAnimation::WebAnimation):
1399         (WebCore::WebAnimation::enqueueAnimationPlaybackEvent):
1400         (WebCore::WebAnimation::stop):
1401         (WebCore::WebAnimation::hasPendingActivity const):
1402         * animation/WebAnimation.h:
1403
1404 2019-11-06  Simon Fraser  <simon.fraser@apple.com>
1405
1406         Box-shadow spread radius does not transition or animate correctly with CSS Transitions & Animations
1407         https://bugs.webkit.org/show_bug.cgi?id=202489
1408
1409         Reviewed by Zalan Bujtas.
1410         
1411         Fix box-shadow offset and spread to support subpixel values, and make the rendering subpixel-aware.
1412         This also makes animation of shadow spread and offset be smoother on Retina displays.
1413
1414         Also make ShadowStyle an enum class.
1415
1416         Test: fast/box-shadow/hidpi-box-shadow.html
1417
1418         * css/CSSComputedStyleDeclaration.cpp:
1419         (WebCore::ComputedStyleExtractor::valueForShadow):
1420         (WebCore::ComputedStyleExtractor::valueForFilter):
1421         * css/CSSPrimitiveValue.cpp:
1422         (WebCore::CSSPrimitiveValue::computeLength const):
1423         * page/animation/CSSPropertyAnimation.cpp:
1424         (WebCore::blendFunc):
1425         (WebCore::shadowForBlending):
1426         * platform/animation/AnimationUtilities.h:
1427         (WebCore::blend):
1428         * platform/graphics/RoundedRect.h:
1429         * rendering/InlineFlowBox.cpp:
1430         (WebCore::InlineFlowBox::paintBoxDecorations):
1431         * rendering/RenderBox.cpp:
1432         (WebCore::RenderBox::paintBoxDecorations):
1433         * rendering/RenderBoxModelObject.cpp:
1434         (WebCore::applyBoxShadowForBackground):
1435         (WebCore::RenderBoxModelObject::boxShadowShouldBeAppliedToBackground const):
1436         (WebCore::areaCastingShadowInHole):
1437         (WebCore::RenderBoxModelObject::paintBoxShadow):
1438         Move the snapping until after we've adjusted rects for offset and spread. The "extraOffset"
1439         computation makes the snapping a little more complex; we have to snap before and after applying
1440         shadowOffset, and give to GraphicsContext the delta between the snapped values.
1441         * rendering/RenderTable.cpp:
1442         (WebCore::RenderTable::paintBoxDecorations):
1443         * rendering/RenderTableCell.cpp:
1444         (WebCore::RenderTableCell::paintBoxDecorations):
1445         * rendering/style/RenderStyle.cpp:
1446         (WebCore::RenderStyle::setTextShadow):
1447         (WebCore::RenderStyle::getShadowExtent const):
1448         (WebCore::RenderStyle::getShadowInsetExtent const):
1449         (WebCore::RenderStyle::getShadowHorizontalExtent const):
1450         (WebCore::RenderStyle::getShadowVerticalExtent const):
1451         * rendering/style/ShadowData.cpp:
1452         (WebCore::ShadowData::ShadowData):
1453         (WebCore::calculateShadowExtent):
1454         (WebCore::ShadowData::adjustRectForShadow const):
1455         * rendering/style/ShadowData.h:
1456         (WebCore::ShadowData::ShadowData):
1457         (WebCore::ShadowData::x const):
1458         (WebCore::ShadowData::y const):
1459         (WebCore::ShadowData::location const):
1460         (WebCore::ShadowData::paintingExtent const):
1461         (WebCore::ShadowData::spread const):
1462         * style/StyleBuilderCustom.h:
1463         (WebCore::Style::BuilderCustom::applyTextOrBoxShadowValue):
1464
1465 2019-11-04  Chris Dumez  <cdumez@apple.com>
1466
1467         MediaRecorder should not prevent entering the back/forward cache
1468         https://bugs.webkit.org/show_bug.cgi?id=203093
1469         <rdar://problem/56748870>
1470
1471         Reviewed by Eric Carlson.
1472
1473         Let pages using MediaRecorder enter the back/forward cache. On suspension, we
1474         stop recording and we queue an error event which will get dispatched upon
1475         resuming.
1476
1477         Test: fast/history/page-cache-media-recorder.html
1478
1479         * Modules/mediarecorder/MediaRecorder.cpp:
1480         (WebCore::MediaRecorder::document const):
1481         (WebCore::MediaRecorder::suspend):
1482         (WebCore::MediaRecorder::activeDOMObjectName const):
1483         (WebCore::MediaRecorder::scheduleDeferredTask):
1484         (WebCore::MediaRecorder::shouldPreventEnteringBackForwardCache_DEPRECATED const): Deleted.
1485         * Modules/mediarecorder/MediaRecorder.h:
1486
1487 2019-11-04  Alex Christensen  <achristensen@webkit.org>
1488
1489         REGRESSION(r243947) Epson software updater fails to install new version
1490         https://bugs.webkit.org/show_bug.cgi?id=203809
1491         <rdar://problem/56002179>
1492
1493         Reviewed by Brady Eidson.
1494
1495         I manually verified this fixes the issue.  See the radar.
1496
1497         * platform/RuntimeApplicationChecks.h:
1498         * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
1499         (WebCore::MacApplication::isEpsonSoftwareUpdater):
1500
1501 2019-11-04  Ross Kirsling  <ross.kirsling@sony.com>
1502
1503         Unreviewed WinCairo build fix for r251934.
1504
1505         * workers/service/ServiceWorkerContainer.cpp:
1506         (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
1507
1508 2019-11-04  Chris Dumez  <cdumez@apple.com>
1509
1510         MediaKeySession / WebKitMediaKeySession should not prevent entering the back/forward cache
1511         https://bugs.webkit.org/show_bug.cgi?id=203089
1512
1513         Reviewed by Youenn Fablet.
1514
1515         Port MediaKeySession / WebKitMediaKeySession to the HTML5 event loop instead of using its
1516         own GenericEventQueue / GenericTaskQueue. Because the HTML5 event loop plays nicely with
1517         the back/forward cache, we can now let pages using MediaKeySession / WebKitMediaKeySession
1518         into the back/forward cache.
1519
1520         Test: http/tests/navigation/page-cache-mediakeysession.html
1521
1522         * Modules/encryptedmedia/MediaKeySession.cpp:
1523         (WebCore::MediaKeySession::MediaKeySession):
1524         (WebCore::MediaKeySession::generateRequest):
1525         (WebCore::MediaKeySession::load):
1526         (WebCore::MediaKeySession::update):
1527         (WebCore::MediaKeySession::close):
1528         (WebCore::MediaKeySession::remove):
1529         (WebCore::MediaKeySession::enqueueMessage):
1530         (WebCore::MediaKeySession::updateKeyStatuses):
1531         (WebCore::MediaKeySession::hasPendingActivity const):
1532         (WebCore::MediaKeySession::activeDOMObjectName const):
1533         (WebCore::MediaKeySession::enqueueTask):
1534         (WebCore::MediaKeySession::enqueueEvent):
1535         (WebCore::MediaKeySession::shouldPreventEnteringBackForwardCache_DEPRECATED const): Deleted.
1536         (WebCore::MediaKeySession::stop): Deleted.
1537         * Modules/encryptedmedia/MediaKeySession.h:
1538         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
1539         (WebCore::WebKitMediaKeySession::WebKitMediaKeySession):
1540         (WebCore::WebKitMediaKeySession::~WebKitMediaKeySession):
1541         (WebCore::WebKitMediaKeySession::addKeyTimerFired):
1542         (WebCore::WebKitMediaKeySession::sendMessage):
1543         (WebCore::WebKitMediaKeySession::sendError):
1544         (WebCore::WebKitMediaKeySession::hasPendingActivity const):
1545         (WebCore::WebKitMediaKeySession::enqueueEvent):
1546         (WebCore::WebKitMediaKeySession::shouldPreventEnteringBackForwardCache_DEPRECATED const): Deleted.
1547         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.h:
1548
1549 2019-11-04  Eric Carlson  <eric.carlson@apple.com>
1550
1551         enumerateDevices() doesn't return correct list of devices after device was changed by user in a system preferences
1552         https://bugs.webkit.org/show_bug.cgi?id=203407
1553         <rdar://problem/56648063>
1554
1555         Reviewed by Youenn Fablet.
1556
1557         Tested manually as this doesn't reproduce with mock capture devices.
1558
1559         * platform/mediastream/mac/CoreAudioCaptureDeviceManager.cpp:
1560         (WebCore::CoreAudioCaptureDeviceManager::coreAudioCaptureDevices): Refresh the list of capture
1561         devices when the default input device changes.
1562         (WebCore::CoreAudioCaptureDeviceManager::refreshAudioCaptureDevices): Assert if not called
1563         on the main thread.
1564
1565 2019-11-04  Andy Estes  <aestes@apple.com>
1566
1567         REGRESSION (r251623): When downloading a QuickLook file, the web view navigates to a "The URL can't be shown" error page instead of staying on the current page
1568         https://bugs.webkit.org/show_bug.cgi?id=203790
1569         <rdar://problem/56795440>
1570
1571         Reviewed by Alex Christensen.
1572
1573         When a PreviewConverter fails updating due to a call to PreviewConverter::failedUpdating(),
1574         we should not dispatch previewConverterDidFailUpdating. LegacyPreviewLoader handles that
1575         callback by calling ResourceLoader::didFail() with a WebKitErrorCannotShowURL error code,
1576         but when downloading or cancelling we must fail with a
1577         WebKitErrorFrameLoadInterruptedByPolicyChange error code instead.
1578
1579         This patch teaches PreviewConverter to distinguish between internal updating errors and
1580         external calls to failedUpdating(), only dispatching previewConverterDidFailUpdating in the
1581         former case.
1582
1583         Updated QuickLook API tests.
1584
1585         * platform/PreviewConverter.cpp:
1586         (WebCore::PreviewConverter::updateMainResource):
1587         (WebCore::PreviewConverter::failedUpdating):
1588         (WebCore::PreviewConverter::didFailUpdating):
1589         * platform/PreviewConverter.h:
1590
1591 2019-11-04  youenn fablet  <youenn@apple.com>
1592
1593         RealtimeOutgoingAudioSource/RealtimeOutgoingVideoSource should unobserve before destruction time
1594         https://bugs.webkit.org/show_bug.cgi?id=203802
1595
1596         Reviewed by Eric Carlson.
1597
1598         These classes are used by LibWebRTCRtpSenderBackend.
1599         When the backend is destroyed, notify the sources to unobserve before unrefing them.
1600         Add debug assertions to ensure this is done correctly.
1601         Covered by existing tests.
1602
1603         * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp:
1604         (WebCore::LibWebRTCRtpSenderBackend::~LibWebRTCRtpSenderBackend):
1605         * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h:
1606         Fixed Variant Move issue.
1607         * platform/mediastream/MediaStreamTrackPrivate.h:
1608         (WebCore::MediaStreamTrackPrivate::hasObserver const):
1609         * platform/mediastream/RealtimeOutgoingAudioSource.cpp:
1610         (WebCore::RealtimeOutgoingAudioSource::~RealtimeOutgoingAudioSource):
1611         * platform/mediastream/RealtimeOutgoingVideoSource.cpp:
1612         (WebCore::RealtimeOutgoingVideoSource::~RealtimeOutgoingVideoSource):
1613
1614 2019-11-04  Cathie Chen  <cathiechen@igalia.com>
1615
1616         Build error: redefinition of `TransferFunction`
1617         https://bugs.webkit.org/show_bug.cgi?id=203742
1618
1619         Reviewed by Jer Noble.
1620
1621         `TransferFunction` defined in both VideoTextureCopierCV.cpp and TransferFunction.h.
1622         Renamed `TransferFunction` in VideoTextureCopierCV.cpp to `TransferFunctionCV`.
1623
1624         * platform/graphics/cv/VideoTextureCopierCV.cpp:
1625         (WebCore::transferFunctionFromString):
1626         (WebCore::YCbCrToRGBMatrixForRangeAndTransferFunction):
1627
1628 2019-11-04  youenn fablet  <youenn@apple.com>
1629
1630         Order of postMessage and fetch events should be preserved when going from client to service worker
1631         https://bugs.webkit.org/show_bug.cgi?id=203236
1632
1633         Reviewed by Chris Dumez.
1634
1635         Now that post message is going through network process, we can make the order predictable.
1636         Remove unnecessary task posting when firing events in service worker context and when posting message from a client.
1637         Test: http/wpt/service-workers/service-worker/postMessage-fetch-order.https.html
1638
1639         * workers/service/ServiceWorker.cpp:
1640         (WebCore::ServiceWorker::swConnection):
1641         (WebCore::ServiceWorker::postMessage):
1642         * workers/service/ServiceWorker.h:
1643         * workers/service/context/ServiceWorkerThread.cpp:
1644         (WebCore::ServiceWorkerThread::postFetchTask):
1645         (WebCore::ServiceWorkerThread::fireInstallEvent):
1646         (WebCore::ServiceWorkerThread::fireActivateEvent):
1647
1648 2019-11-03  Zalan Bujtas  <zalan@apple.com>
1649
1650         [LFC][Verification] Forced line break display runs don't have TextContext
1651         https://bugs.webkit.org/show_bug.cgi?id=203779
1652         <rdar://problem/56839710>
1653
1654         Reviewed by Antti Koivisto.
1655
1656         Display::Run's optional TextContext is not available for forced line breaks (since they are not text runs).
1657
1658         * layout/Verification.cpp:
1659         (WebCore::Layout::checkForMatchingTextRuns):
1660
1661 2019-11-03  Ryosuke Niwa  <rniwa@webkit.org>
1662
1663         Add a helper function to schedule a task to dispatch an event to ActiveDOMObject
1664         https://bugs.webkit.org/show_bug.cgi?id=203714
1665
1666         Reviewed by Chris Dumez.
1667
1668         Added two helper static member functions queueTaskKeepingObjectAlive and queueTaskToDispatchEvent
1669         to ActiveDOMObject and deployed them in ServiceWorkerContainer.
1670
1671         No new tests since there should be no behavioral changes.
1672
1673         * Headers.cmake:
1674         * WebCore.xcodeproj/project.pbxproj:
1675         * dom/AbstractEventLoop.h:
1676         * dom/ActiveDOMObject.cpp:
1677         (WebCore::ActiveDOMObject::queueTaskInEventLoop): Added.
1678         * dom/ActiveDOMObject.h:
1679         (WebCore::ActiveDOMObject::queueTaskKeepingObjectAlive): Added.
1680         (WebCore::ActiveDOMObject::queueTaskToDispatchEvent): Added.
1681         * dom/TaskSource.h: Added.
1682         * workers/service/ServiceWorkerContainer.cpp:
1683         (WebCore::ServiceWorkerContainer::ready):
1684         (WebCore::ServiceWorkerContainer::getRegistration):
1685         (WebCore::ServiceWorkerContainer::getRegistrations):
1686         (WebCore::ServiceWorkerContainer::jobFailedWithException):
1687         (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
1688         (WebCore::ServiceWorkerContainer::jobResolvedWithUnregistrationResult):
1689         (WebCore::ServiceWorkerContainer::jobFailedLoadingScript):
1690         (WebCore::ServiceWorkerContainer::fireControllerChangeEvent):
1691         (WebCore::ServiceWorkerContainer::enqueueTask): Deleted.
1692         * workers/service/ServiceWorkerContainer.h:
1693
1694 2019-11-03  Andres Gonzalez  <andresg_22@apple.com>
1695
1696         Make AXIsolatedTreeNode a subclass of AXCoreObject.
1697         https://bugs.webkit.org/show_bug.cgi?id=203717
1698
1699         Reviewed by Chris Fleizach.
1700
1701         No new tests needed, no new functionality.
1702
1703         - AXIsolatedTreeNOde derives from AXCoreObject.
1704         - AccessibilityObjectWrapper can now have a single pointer to a AXCoreObject instead of one for the live object and one for the isolated object.
1705         - Simplified wrapper code by making it agnostic of the nature of the underlying AXCoreObject.
1706
1707         * accessibility/AXObjectCache.cpp:
1708         (WebCore::AXObjectCache::characterOffsetForPoint):
1709         (WebCore::AXObjectCache::characterOffsetForIndex):
1710         (WebCore::AXObjectCache::createIsolatedAccessibilityTreeHierarchy):
1711         (WebCore::AXObjectCache::generateIsolatedAccessibilityTree):
1712         * accessibility/AXObjectCache.h:
1713         * accessibility/atk/AXObjectCacheAtk.cpp:
1714         (WebCore::AXObjectCache::attachWrapper):
1715         * accessibility/ios/AXObjectCacheIOS.mm:
1716         (WebCore::AXObjectCache::attachWrapper):
1717         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1718         (AccessibilityUnignoredAncestor):
1719         (-[WebAccessibilityTextMarker initWithData:accessibilityObject:]):
1720         (-[WebAccessibilityObjectWrapper initWithAccessibilityObject:]):
1721         (-[WebAccessibilityObjectWrapper _accessibilityTreeAncestor]):
1722         (-[WebAccessibilityObjectWrapper _accessibilityListAncestor]):
1723         (-[WebAccessibilityObjectWrapper _accessibilityArticleAncestor]):
1724         (-[WebAccessibilityObjectWrapper _accessibilityLandmarkAncestor]):
1725         (-[WebAccessibilityObjectWrapper _accessibilityTableAncestor]):
1726         (-[WebAccessibilityObjectWrapper _accessibilityIsInTableCell]):
1727         (-[WebAccessibilityObjectWrapper _accessibilityFieldsetAncestor]):
1728         (-[WebAccessibilityObjectWrapper _accessibilityFrameAncestor]):
1729         (-[WebAccessibilityObjectWrapper _accessibilityTraitsFromAncestors]):
1730         (-[WebAccessibilityObjectWrapper tableCellParent]):
1731         (-[WebAccessibilityObjectWrapper tableParent]):
1732         (-[WebAccessibilityObjectWrapper accessibilityTitleElement]):
1733         (-[WebAccessibilityObjectWrapper accessibilityDatetimeValue]):
1734         (-[WebAccessibilityObjectWrapper detailParentForSummaryObject:]):
1735         (-[WebAccessibilityObjectWrapper detailParentForObject:]):
1736         (-[WebAccessibilityObjectWrapper treeItemParentForObject:]):
1737         (AXAttributeStringSetStyle):
1738         (-[WebAccessibilityObjectWrapper arrayOfTextForTextMarkers:attributed:]):
1739         (-[WebAccessibilityObjectWrapper accessibilitySupportsARIAExpanded]):
1740         (-[WebAccessibilityObjectWrapper accessibilityIsExpanded]):
1741         * accessibility/isolatedtree/AXIsolatedTree.cpp:
1742         (WebCore::AXIsolatedTree::setRoot):
1743         (WebCore::AXIsolatedTree::applyPendingChanges):
1744         (WebCore::AXIsolatedTree::setRootNodeID): Deleted.
1745         * accessibility/isolatedtree/AXIsolatedTree.h:
1746         * accessibility/isolatedtree/AXIsolatedTreeNode.cpp:
1747         (WebCore::AXIsolatedTreeNode::AXIsolatedTreeNode):
1748         (WebCore::AXIsolatedTreeNode::create):
1749         (WebCore::AXIsolatedTreeNode::initializeAttributeData):
1750         (WebCore::AXIsolatedTreeNode::appendChild):
1751         (WebCore::AXIsolatedTreeNode::children):
1752         (WebCore::AXIsolatedTreeNode::parentObjectUnignored const):
1753         (WebCore::AXIsolatedTreeNode::accessibilityHitTest const):
1754         (WebCore::AXIsolatedTreeNode::updateBackingStore):
1755         (WebCore::AXIsolatedTreeNode::parentObjectInterfaceUnignored const): Deleted.
1756         * accessibility/isolatedtree/AXIsolatedTreeNode.h:
1757         * accessibility/mac/AXObjectCacheMac.mm:
1758         (WebCore::AXObjectCache::attachWrapper):
1759         (WebCore::AXObjectCache::associateIsolatedTreeNode): Deleted.
1760         * accessibility/mac/WebAccessibilityObjectWrapperBase.h:
1761         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
1762         (convertToNSArray):
1763         (-[WebAccessibilityObjectWrapperBase initWithAccessibilityObject:]):
1764         (-[WebAccessibilityObjectWrapperBase detach]):
1765         (-[WebAccessibilityObjectWrapperBase updateObjectBackingStore]):
1766         (-[WebAccessibilityObjectWrapperBase accessibilityObject]):
1767         (-[WebAccessibilityObjectWrapperBase axBackingObject]):
1768         (accessibilitySearchCriteriaForSearchPredicateParameterizedAttribute):
1769         (-[WebAccessibilityObjectWrapperBase isolatedTreeNode]): Deleted.
1770         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1771         (-[WebAccessibilityObjectWrapper doAXAttributedStringForTextMarkerRange:spellCheck:]):
1772         (convertToVector):
1773         (-[WebAccessibilityObjectWrapper childrenVectorSize]):
1774         (-[WebAccessibilityObjectWrapper childrenVectorArray]):
1775         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
1776         (-[WebAccessibilityObjectWrapper accessibilityShowContextMenu]):
1777         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
1778         * accessibility/win/AXObjectCacheWin.cpp:
1779         (WebCore::AXObjectCache::attachWrapper):
1780
1781 2019-11-03  Zalan Bujtas  <zalan@apple.com>
1782
1783         [LFC][IFC] Runs collapsed to zero advanced width are not always whitespace collapsed
1784         https://bugs.webkit.org/show_bug.cgi?id=203778
1785         <rdar://problem/56839642>
1786
1787         Reviewed by Antti Koivisto.
1788
1789         Just because a run collapses to zero advanced width, it does not necessarily mean it is a collapsed run (in whitespace collapsing sense)
1790         e.g. trimmed trailing whitespace (m_collapsedToZeroAdvanceWidth should probably be renamed to something other than "collapsed" to avoid confusion).
1791
1792         * layout/inlineformatting/InlineLine.cpp:
1793         (WebCore::Layout::Line::close):
1794         (WebCore::Layout::Line::appendTextContent):
1795         * layout/inlineformatting/InlineLine.h:
1796         (WebCore::Layout::Line::Run::setCollapsesToZeroAdvanceWidth):
1797
1798 2019-11-03  Zalan Bujtas  <zalan@apple.com>
1799
1800         [LFC][IFC] Pre-wrap: Overflown whitespace should stay on the current line
1801         https://bugs.webkit.org/show_bug.cgi?id=203780
1802         <rdar://problem/56839822>
1803
1804         Reviewed by Antti Koivisto.
1805
1806         white-space: pre-wrap needs clarification. According to CSS Text Module Level 3, content wrapping is as 'normal'
1807         but apparently we need to keep the overlapping whitespace on the line (and hang it I'd assume).
1808
1809         * layout/inlineformatting/InlineLineBreaker.cpp:
1810         (WebCore::Layout::isTrailingWhitespaceWithPreWrap):
1811         (WebCore::Layout::LineBreaker::breakingContextForInlineContent):
1812
1813 2019-11-02  Chris Dumez  <cdumez@apple.com>
1814
1815         Port DOMCache / DOMCacheStorage to the HTML5 event loop
1816         https://bugs.webkit.org/show_bug.cgi?id=203772
1817
1818         Reviewed by Sam Weinig.
1819
1820         * Modules/cache/DOMCache.cpp:
1821         (WebCore::DOMCache::DOMCache):
1822         (WebCore::DOMCache::match):
1823         (WebCore::DOMCache::matchAll):
1824         (WebCore::DOMCache::addAll):
1825         (WebCore::DOMCache::putWithResponseData):
1826         (WebCore::DOMCache::put):
1827         (WebCore::DOMCache::remove):
1828         (WebCore::DOMCache::keys):
1829         (WebCore::DOMCache::enqueueTask):
1830         (WebCore::DOMCache::hasPendingActivity const): Deleted.
1831         * Modules/cache/DOMCache.h:
1832         * Modules/cache/DOMCacheStorage.cpp:
1833         (WebCore::DOMCacheStorage::DOMCacheStorage):
1834         (WebCore::DOMCacheStorage::doSequentialMatch):
1835         (WebCore::DOMCacheStorage::match):
1836         (WebCore::DOMCacheStorage::has):
1837         (WebCore::DOMCacheStorage::open):
1838         (WebCore::DOMCacheStorage::doOpen):
1839         (WebCore::DOMCacheStorage::remove):
1840         (WebCore::DOMCacheStorage::doRemove):
1841         (WebCore::DOMCacheStorage::keys):
1842         (WebCore::DOMCacheStorage::enqueueTask):
1843         (WebCore::DOMCacheStorage::hasPendingActivity const): Deleted.
1844         * Modules/cache/DOMCacheStorage.h:
1845
1846 2019-11-02  Oriol Brufau  <obrufau@igalia.com>
1847
1848         [css-grid] Fix line name positions after auto repeat with no line names
1849         https://bugs.webkit.org/show_bug.cgi?id=203670
1850
1851         Reviewed by Manuel Rego Casasnovas.
1852
1853         When serializing grid-template-rows/columns of a grid container, we need
1854         to handle auto repeat() specially in order to insert the line names at
1855         the correct places.
1856
1857         Before this patch, this was skipped for indices before the insertion
1858         point of the auto repeat, and in case the auto repeat had no line name.
1859         The latter logic was wrong, if there is an auto repeat we still need the
1860         special code after the insertion point, even if it has no line names.
1861         The proper condition to check is whether there is no auto repeat.
1862
1863         The patch also avoids a 2nd call to gridAutoRepeatRows/Columns since we
1864         already have the value in a variable.
1865
1866         Tests: imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-columns-computed.html
1867                imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-columns-computed-nogrid.html
1868                imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-columns-computed-withcontent.html
1869                imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-rows-computed.html
1870                imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-rows-computed-nogrid.html
1871                imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-rows-computed-withcontent.html
1872
1873         * css/CSSComputedStyleDeclaration.cpp:
1874         (WebCore::OrderedNamedLinesCollectorInGridLayout::OrderedNamedLinesCollectorInGridLayout):
1875         (WebCore::OrderedNamedLinesCollectorInGridLayout::collectLineNamesForIndex const):
1876         (WebCore::valueForGridTrackList):
1877
1878 2019-11-02  Devin Rousso  <drousso@apple.com>
1879
1880         Web Inspector: Add diagnostic logging for frontend feature usage
1881         https://bugs.webkit.org/show_bug.cgi?id=203579
1882         <rdar://problem/56717410>
1883
1884         Reviewed by Brian Burg.
1885
1886         Add `InspectorFrontendHost` API for logging diagnostic events from the
1887         Web Inspector UI. An event consists of a message string, such as "TabActivity"
1888         or "SettingChanged", and a dictionary payload encoded as a JSON string.
1889
1890         Original patch by Matt Baker.
1891
1892         * inspector/InspectorFrontendHost.idl:
1893         * inspector/InspectorFrontendHost.h:
1894         * inspector/InspectorFrontendHost.cpp:
1895         (WebCore::InspectorFrontendHost::supportsDiagnosticLogging): Added.
1896         (WebCore::valuePayloadFromJSONValue): Added.
1897         (WebCore::InspectorFrontendHost::logDiagnosticEvent): Added.
1898
1899         * inspector/InspectorFrontendClient.h:
1900         (WebCore::InspectorFrontendClient::supportsDiagnosticLogging): Added.
1901         (WebCore::InspectorFrontendClient::logDiagnosticEvent): Added.
1902
1903         * Configurations/FeatureDefines.xcconfig:
1904         Add `ENABLE_INSPECTOR_TELEMETRY`, which is only enabled for macOS.
1905
1906 2019-11-01  Chris Fleizach  <cfleizach@apple.com>
1907
1908         AX: Restrict WebSpeech voices to built-in voices only
1909         https://bugs.webkit.org/show_bug.cgi?id=203689
1910
1911         Reviewed by Per Arne Vollan.
1912
1913         Only show built-in voices when requesting through WebKit to reduce fingerprinting surface area. 
1914
1915         * platform/ios/PlatformSpeechSynthesizerIOS.mm:
1916         (WebCore::PlatformSpeechSynthesizer::initializeVoiceList):
1917
1918 2019-11-01  Devin Rousso  <drousso@apple.com>
1919
1920         Web Inspector: Timelines: add a timeline that shows information about any recorded CSS animation/transition
1921         https://bugs.webkit.org/show_bug.cgi?id=203651
1922         <rdar://problem/56128726>
1923
1924         Reviewed by Brian Burg.
1925
1926         Unlike all other forms of Web Animations, CSS animations/transitions, are _not_ created by
1927         JavaScript, and therefore can seemingly appear out of nowhere. This patch expands the Media
1928         timeline to be the Media & Animations timeline, which tracks when CSS animations/transitions
1929         are created, started, delayed, iterated, canceled, or finished.
1930
1931         Test: inspector/animation/tracking.html
1932
1933         * animation/KeyframeEffect.cpp:
1934         (WebCore::KeyframeEffect::apply):
1935         * animation/WebAnimation.h:
1936         * animation/WebAnimation.cpp:
1937         (WebCore::WebAnimation::~WebAnimation):
1938         (WebCore::WebAnimation::contextDestroyed): Added.
1939         (WebCore::WebAnimation::setEffectInternal):
1940         * inspector/InspectorInstrumentation.h:
1941         (WebCore::InspectorInstrumentation::willApplyKeyframeEffect): Added.
1942         (WebCore::InspectorInstrumentation::didChangeWebAnimationEffect): Added.
1943         (WebCore::InspectorInstrumentation::willDestroyWebAnimation): Added.
1944         * inspector/InspectorInstrumentation.cpp:
1945         (WebCore::InspectorInstrumentation::willApplyKeyframeEffectImpl): Added.
1946         (WebCore::InspectorInstrumentation::didChangeWebAnimationEffectImpl): Added.
1947         (WebCore::InspectorInstrumentation::willDestroyWebAnimationImpl): Added.
1948         Add instrumentation points for CSS animations/transitions.
1949
1950         * inspector/agents/InspectorAnimationAgent.h: Added.
1951         * inspector/agents/InspectorAnimationAgent.cpp: Added.
1952         (WebCore::InspectorAnimationAgent::InspectorAnimationAgent):
1953         (WebCore::InspectorAnimationAgent::didCreateFrontendAndBackend):
1954         (WebCore::InspectorAnimationAgent::willDestroyFrontendAndBackend):
1955         (WebCore::InspectorAnimationAgent::startTracking):
1956         (WebCore::InspectorAnimationAgent::stopTracking):
1957         (WebCore::isDelayed):
1958         (WebCore::InspectorAnimationAgent::willApplyKeyframeEffect):
1959         (WebCore::InspectorAnimationAgent::didChangeWebAnimationEffect):
1960         (WebCore::InspectorAnimationAgent::willDestroyWebAnimation):
1961         (WebCore::InspectorAnimationAgent::stopTrackingDeclarativeAnimation):
1962         * inspector/InstrumentingAgents.h:
1963         (WebCore::InstrumentingAgents::persistentInspectorAnimationAgent const): Added.
1964         (WebCore::InstrumentingAgents::setPersistentInspectorAnimationAgent): Added.
1965         (WebCore::InstrumentingAgents::trackingInspectorAnimationAgent const): Added.
1966         (WebCore::InstrumentingAgents::setTrackingInspectorAnimationAgent): Added.
1967         * inspector/InstrumentingAgents.cpp:
1968         (WebCore::InstrumentingAgents::reset):
1969         * inspector/InspectorController.cpp:
1970         (WebCore::InspectorController::createLazyAgents):
1971         Add an Animation domain for handling the tracking of CSS Web Animations.
1972
1973         * inspector/agents/InspectorTimelineAgent.h:
1974         * inspector/agents/InspectorTimelineAgent.cpp:
1975         (WebCore::InspectorTimelineAgent::toggleInstruments):
1976         (WebCore::InspectorTimelineAgent::toggleAnimationInstrument): Added.
1977
1978         * Sources.txt:
1979         * WebCore.xcodeproj/project.pbxproj:
1980
1981 2019-11-01  Said Abou-Hallawa  <sabouhallawa@apple.com>
1982
1983         SVG pair properties must be detached from their owner before it's deleted
1984         https://bugs.webkit.org/show_bug.cgi?id=203545
1985
1986         Reviewed by Simon Fraser.
1987
1988         SVGAnimatedPropertyPairAccessor needs to override its detach() method so
1989         each of its pair properties detaches itself from the owner.
1990         SVGPointerMemberAccessor does the same thing but for a single property
1991         which covers all the list properties as well.
1992
1993         Test: svg/custom/pair-properties-detach.html
1994
1995         * svg/properties/SVGAnimatedPropertyPairAccessor.h:
1996
1997 2019-11-01  Benjamin Nham  <nham@apple.com>
1998
1999         Mark VeryLow priority requests using a request dictionary key
2000         https://bugs.webkit.org/show_bug.cgi?id=203594
2001
2002         Reviewed by Alex Christensen.
2003
2004         Mark very-low-pri beacon/ping loads using a request dictionary key. PLT currently ignores
2005         these loads by checking if a request's CFURLRequestPriority is 0, but that won't work
2006         anymore once I make VeryLow and Low pri requests both have a priority of 0 for
2007         https://bugs.webkit.org/show_bug.cgi?id=203423.
2008
2009         * platform/network/cf/ResourceRequestCFNet.cpp:
2010         (WebCore::ResourceRequest::doUpdatePlatformRequest):
2011         * platform/network/cocoa/ResourceRequestCocoa.mm:
2012         (WebCore::ResourceRequest::doUpdatePlatformRequest):
2013
2014 2019-11-01  Chris Dumez  <cdumez@apple.com>
2015
2016         Port FileReader to the HTML5 event loop
2017         https://bugs.webkit.org/show_bug.cgi?id=203749
2018
2019         Reviewed by Ryosuke Niwa.
2020
2021         * dom/AbstractEventLoop.h:
2022         * fileapi/FileReader.cpp:
2023         (WebCore::FileReader::FileReader):
2024         (WebCore::FileReader::stop):
2025         (WebCore::FileReader::hasPendingActivity const):
2026         (WebCore::FileReader::abort):
2027         (WebCore::FileReader::didStartLoading):
2028         (WebCore::FileReader::didReceiveData):
2029         (WebCore::FileReader::didFinishLoading):
2030         (WebCore::FileReader::didFail):
2031         (WebCore::FileReader::enqueueTask):
2032         * fileapi/FileReader.h:
2033
2034 2019-11-01  Eric Carlson  <eric.carlson@apple.com>
2035
2036         Add experimental TextTrackCue API
2037         https://bugs.webkit.org/show_bug.cgi?id=203649
2038         <rdar://problem/55675172>
2039
2040         Reviewed by Jer Noble.
2041
2042         Tests: media/track/texttrackcue/texttrackcue-addcue.html
2043                media/track/texttrackcue/texttrackcue-constructor.html
2044                media/track/texttrackcue/texttrackcue-displaycue.html
2045
2046         * Modules/mediacontrols/MediaControlsHost.cpp:
2047         (WebCore::MediaControlsHost::updateCaptionDisplaySizes):
2048         * Modules/mediacontrols/MediaControlsHost.h:
2049         * bindings/js/JSTextTrackCueCustom.cpp:
2050         (WebCore::toJSNewlyCreated):
2051         * bindings/js/WebCoreBuiltinNames.h:
2052         * bindings/scripts/CodeGeneratorJS.pm:
2053         (NeedsRuntimeCheck):
2054         (GenerateRuntimeEnableConditionalString):
2055         * bindings/scripts/IDLAttributes.json:
2056         * bindings/scripts/preprocess-idls.pl:
2057         (GenerateConstructorAttributes):
2058         * dom/DocumentFragment.idl:
2059         * html/HTMLMediaElement.cpp:
2060         (WebCore::HTMLMediaElement::updateRenderer):
2061         (WebCore::HTMLMediaElement::updateActiveTextTrackCues):
2062         (WebCore::HTMLMediaElement::textTrackRemoveCue):
2063         (WebCore::HTMLMediaElement::configureTextTrackDisplay):
2064         (WebCore::HTMLMediaElement::captionPreferencesChanged):
2065         * html/shadow/MediaControlElements.cpp:
2066         (WebCore::MediaControlTextTrackContainerElement::updateDisplay):
2067         (WebCore::MediaControlTextTrackContainerElement::processActiveVTTCue):
2068         (WebCore::MediaControlTextTrackContainerElement::updateActiveCuesFontSize):
2069         (WebCore::MediaControlTextTrackContainerElement::updateTimerFired):
2070         (WebCore::MediaControlTextTrackContainerElement::updateStyleForTextTrackRepresentation):
2071         * html/shadow/MediaControlElements.h:
2072         * html/track/TextTrack.cpp:
2073         (WebCore::TextTrack::setMode):
2074         * html/track/TextTrackCue.cpp:
2075         (WebCore::TextTrackCue::cueBoxShadowPseudoId):
2076         (WebCore::TextTrackCue::cueBackdropShadowPseudoId):
2077         (WebCore::cueAttributName):
2078         (WebCore::cueBackgroundAttributName):
2079         (WebCore::TextTrackCueBox::TextTrackCueBox):
2080         (WebCore::TextTrackCueBox::getCue const):
2081         (WebCore::isLegalNode):
2082         (WebCore::invalidNodeException):
2083         (WebCore::checkForInvalidNodeTypes):
2084         (WebCore::tagPseudoObjects):
2085         (WebCore::removePseudoAttributes):
2086         (WebCore::TextTrackCue::create):
2087         (WebCore::TextTrackCue::TextTrackCue):
2088         (WebCore::TextTrackCue::didChange):
2089         (WebCore::TextTrackCue::setIsActive):
2090         (WebCore::TextTrackCue::toJSON const):
2091         (WebCore::TextTrackCue::debugString const):
2092         (WebCore::TextTrackCue::getCueAsHTML):
2093         (WebCore::TextTrackCue::isRenderable const):
2094         (WebCore::TextTrackCue::getDisplayTree):
2095         (WebCore::TextTrackCue::removeDisplayTree):
2096         (WebCore::TextTrackCue::setFontSize):
2097         (WebCore::TextTrackCue::rebuildDisplayTree):
2098         * html/track/TextTrackCue.h:
2099         (WebCore::TextTrackCueBox::create):
2100         (WebCore::TextTrackCueBox::applyCSSProperties):
2101         (WebCore::TextTrackCueBox::~TextTrackCueBox):
2102         (WebCore::TextTrackCue::cueType const):
2103         (WebCore::TextTrackCue::recalculateStyles):
2104         (WebCore::TextTrackCue::updateDisplayTree):
2105         (WebCore::TextTrackCue::isRenderable const): Deleted.
2106         * html/track/TextTrackCue.idl:
2107         * html/track/TextTrackCueGeneric.cpp:
2108         (WebCore::TextTrackCueGeneric::isEqual const):
2109         (WebCore::TextTrackCueGeneric::isOrderedBefore const):
2110         (WebCore::TextTrackCueGeneric::isPositionedAbove const):
2111         * html/track/TextTrackCueGeneric.h:
2112         (isType):
2113         * html/track/VTTCue.cpp:
2114         (WebCore::VTTCueBox::VTTCueBox):
2115         (WebCore::VTTCueBox::applyCSSProperties):
2116         (WebCore::VTTCue::getDisplayTree):
2117         (WebCore::VTTCue::removeDisplayTree):
2118         (WebCore::VTTCue::setFontSize):
2119         (WebCore::toVTTCue):
2120         (WebCore::VTTCueBox::create): Deleted.
2121         (WebCore::VTTCueBox::getCue const): Deleted.
2122         (WebCore::VTTCueBox::vttCueBoxShadowPseudoId): Deleted.
2123         (WebCore::VTTCue::cueBackdropShadowPseudoId): Deleted.
2124         * html/track/VTTCue.h:
2125         (WebCore::VTTCueBox::create):
2126         (isType):
2127         * html/track/VTTRegion.cpp:
2128         (WebCore::VTTRegion::appendTextTrackCueBox):
2129         (WebCore::VTTRegion::getDisplayTree):
2130         (WebCore::VTTRegion::prepareRegionDisplayTree):
2131         * html/track/VTTRegion.h:
2132         * page/CaptionUserPreferencesMediaAF.cpp:
2133         (WebCore::CaptionUserPreferencesMediaAF::captionsStyleSheetOverride const):
2134         * page/Settings.yaml:
2135         * rendering/RenderVTTCue.cpp:
2136         (WebCore::RenderVTTCue::RenderVTTCue):
2137
2138 2019-11-01  Chris Dumez  <cdumez@apple.com>
2139
2140         Port ServiceWorkerContainer to the HTML5 event loop
2141         https://bugs.webkit.org/show_bug.cgi?id=203680
2142
2143         Reviewed by Ryosuke Niwa.
2144
2145         * dom/AbstractEventLoop.h:
2146         * workers/service/ServiceWorkerContainer.cpp:
2147         (WebCore::ServiceWorkerContainer::ServiceWorkerContainer):
2148         (WebCore::ServiceWorkerContainer::ready):
2149         (WebCore::ServiceWorkerContainer::getRegistration):
2150         (WebCore::ServiceWorkerContainer::getRegistrations):
2151         (WebCore::ServiceWorkerContainer::jobFailedWithException):
2152         (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
2153         (WebCore::ServiceWorkerContainer::jobResolvedWithUnregistrationResult):
2154         (WebCore::ServiceWorkerContainer::jobFailedLoadingScript):
2155         (WebCore::ServiceWorkerContainer::enqueueTask):
2156         * workers/service/ServiceWorkerContainer.h:
2157
2158 2019-11-01  Ryosuke Niwa  <rniwa@webkit.org>
2159
2160         Integrate media query evaluation into HTML5 event loop
2161         https://bugs.webkit.org/show_bug.cgi?id=203134
2162         <rdar://problem/56396316>
2163
2164         Reviewed by Antti Koivisto.
2165
2166         Moved the code to call media query listeners to HTML5 event loop's step to update the rendering:
2167         https://html.spec.whatwg.org/multipage/webappapis.html#update-the-rendering
2168
2169         Tests: fast/media/mq-inverted-colors-live-update-for-listener.html
2170                fast/media/mq-prefers-reduced-motion-live-update-for-listener.html
2171
2172         * css/MediaQueryMatcher.cpp:
2173         (WebCore::MediaQueryMatcher::evaluateAll): Renamed from styleResolverChanged.
2174         * css/MediaQueryMatcher.h:
2175         * dom/Document.cpp:
2176         (WebCore::Document::updateElementsAffectedByMediaQueries): Split from evaluateMediaQueryList.
2177         This function is still called right after each layout update so that picture element may start
2178         requesting newly selected image resources without having to wait for a rendering update.
2179         But this function will no longer execute arbitrary scripts.
2180         (WebCore::Document::evaluateMediaQueriesAndReportChanges): Split from evaluateMediaQueryList.
2181         Evaluates media query listeners.
2182         * dom/Document.h:
2183         * inspector/agents/InspectorPageAgent.cpp:
2184         (WebCore::InspectorPageAgent::setEmulatedMedia): Force the evaluation of media queries for now
2185         but this code should really be scheduling a rendering update instead so added a FIXME.
2186         * page/Frame.cpp:
2187         (WebCore::Frame::setPrinting): Evaluate media queries. We should consider invoking the full
2188         algorithm to update the rendering here. e.g. intersection observer may add more contents.
2189         * page/Page.cpp:
2190         (WebCore::Page::updateStyleAfterChangeInEnvironment): Schedule a rendering update after
2191         accessibility settings have changed.
2192         (WebCore::Page::updateRendering): Call evaluateMediaQueriesAndReportChanges.
2193         (WebCore::Page::accessibilitySettingsDidChange): Schedule a rendering update after accessibility
2194         settings have changed.
2195         (WebCore::Page::appearanceDidChange): Ditto.
2196
2197 2019-11-01  Tim Horton  <timothy_horton@apple.com>
2198
2199         Fix the watchOS build after r251896
2200
2201         * Configurations/WebCore.xcconfig:
2202         Whoops.
2203
2204 2019-11-01  Peng Liu  <peng.liu6@apple.com>
2205
2206         Turn on the Picture-in-Picture API feature by default
2207         https://bugs.webkit.org/show_bug.cgi?id=203725
2208
2209         Reviewed by Jer Noble.
2210
2211         No new tests are required.
2212
2213         * page/Settings.yaml:
2214
2215 2019-11-01  Ryosuke Niwa  <rniwa@webkit.org>
2216
2217         Don't leak documents with a pending requestIdleCallback
2218         https://bugs.webkit.org/show_bug.cgi?id=203708
2219
2220         Reviewed by Simon Fraser.
2221
2222         Remove all tasks associated with a stopped document right away instead of waiting for
2223         WindowEventLoop::run to execute so that even when author scripts synchronously add and remove
2224         multiple documents, we don't end up leaking all of them until we yield to the run loop.
2225
2226         Also moved the code to suspend & resume event loops from CachedFrame to Document's
2227         ActiveDOMObjects related functions for consistency.
2228
2229         Test: requestidlecallback/requestidlecallback-document-gc.html
2230
2231         * dom/Document.cpp:
2232         (WebCore::Document::suspendActiveDOMObjects): Moved the code from CachedFrameBase::restore.
2233         (WebCore::Document::resumeActiveDOMObjects): Ditto from CachedFrame.
2234         (WebCore::Document::stopActiveDOMObjects): Remove all tasks associated with this document.
2235         * dom/Document.h:
2236         (WebCore::Document::eventLoopIfExists): Deleted.
2237         * dom/WindowEventLoop.cpp:
2238         (WebCore::WindowEventLoop::stop):
2239         (WebCore::WindowEventLoop::run):
2240         * dom/WindowEventLoop.h:
2241         * history/CachedFrame.cpp:
2242         (WebCore::CachedFrameBase::restore):
2243         (WebCore::CachedFrame::CachedFrame):
2244
2245 2019-11-01  Peng Liu  <peng.liu6@apple.com>
2246
2247         Picture-in-Picture layout test cases interfere with each other
2248         https://bugs.webkit.org/show_bug.cgi?id=203614
2249
2250         Reviewed by Eric Carlson.
2251
2252         Fix test running issues, no new test is needed.
2253
2254         Add a member variable m_pictureInPictureAPITestEnabled to the HTMLVideoElement class.
2255         When this variable is true, HTMLVideoElement::setFullscreenMode() will mock the
2256         behavior of the Picture-in-Picture mode changing without the AVKit/CoreMedia involvement.
2257         So we can run multiple layout test cases for Picture-in-Picture API simultaneously.
2258         Note: this solution only tests the code for the Picture-in-Picture API implementation!
2259         We still need to use the API tests to test the Picture-in-Picture implementation end-to-end.
2260
2261         * html/HTMLVideoElement.cpp:
2262         (WebCore::HTMLVideoElement::setFullscreenMode):
2263         (WebCore::HTMLVideoElement::setPictureInPictureAPITestEnabled):
2264         * html/HTMLVideoElement.h:
2265         * html/HTMLVideoElement.idl:
2266         * testing/Internals.cpp:
2267         (WebCore::Internals::setPictureInPictureAPITestEnabled):
2268         * testing/Internals.h:
2269         * testing/Internals.idl:
2270
2271 2019-11-01  Zalan Bujtas  <zalan@apple.com>
2272
2273         [LFC][IFC] Add support for text-align: justify
2274         https://bugs.webkit.org/show_bug.cgi?id=203715
2275         <rdar://problem/56804607>
2276
2277         Reviewed by Antti Koivisto.
2278
2279         Add basic support for text-align: justify. Register expansion opportunities as the text content is being
2280         appended to the line (Line::appendTextContent) and distribute the extra space when the line is being closed (Line::close).
2281         Now LFC rendering of OpenSource/PerformanceTests/Layout/line-layout-simple.html visually matches trunk rendering.
2282
2283         * layout/displaytree/DisplayPainter.cpp:
2284         (WebCore::Display::paintInlineContent):
2285         * layout/displaytree/DisplayRun.h:
2286         (WebCore::Display::Run::TextContext::resetExpansion):
2287         * layout/inlineformatting/InlineLine.cpp:
2288         (WebCore::Layout::Line::Run::expand):
2289         (WebCore::Layout::Line::close):
2290         (WebCore::Layout::Line::justifyRuns):
2291         (WebCore::Layout::Line::alignContentHorizontally):
2292         (WebCore::Layout::Line::appendTextContent):
2293         * layout/inlineformatting/InlineLine.h:
2294         (WebCore::Layout::Line::isTextAlignJustify const):
2295         (WebCore::Layout::Line::Run::setCollapsesToZeroAdvanceWidth):
2296         (WebCore::Layout::Line::Run::adjustExpansionBehavior):
2297         (WebCore::Layout::Line::Run::expand): Deleted.
2298         * layout/inlineformatting/InlineLineLayout.cpp:
2299         (WebCore::Layout::LineLayout::close):
2300
2301 2019-11-01  Antti Koivisto  <antti@apple.com>
2302
2303         Style::Builder should not depend on StyleResolver
2304         https://bugs.webkit.org/show_bug.cgi?id=203729
2305
2306         Reviewed by Zalan Bujtas.
2307
2308         With all style building state in builder, we can remove the back-reference to style resolver.
2309
2310         * css/CSSFilterImageValue.cpp:
2311         (WebCore::CSSFilterImageValue::createFilterOperations):
2312         * css/CSSFilterImageValue.h:
2313         * css/CSSGradientValue.cpp:
2314         (WebCore::CSSGradientValue::gradientWithStylesResolved):
2315         (WebCore::CSSGradientValue::resolveRGBColors):
2316
2317         Add helper for resolving basic colors without style builder.
2318
2319         * css/CSSGradientValue.h:
2320         * css/StyleResolver.cpp:
2321         (WebCore::StyleResolver::State::clear):
2322         (WebCore::StyleResolver::State::State):
2323         (WebCore::StyleResolver::State::setStyle):
2324         (WebCore::StyleResolver::applyMatchedProperties):
2325
2326         Register content attributes encountered during style building.
2327
2328         (WebCore::StyleResolver::State::updateConversionData): Deleted.
2329
2330         This is now created by BuilderState constructor.
2331
2332         (WebCore::StyleResolver::styleImage): Deleted.
2333         (WebCore::StyleResolver::colorFromPrimitiveValueIsDerivedFromElement): Deleted.
2334         (WebCore::StyleResolver::colorFromPrimitiveValue const): Deleted.
2335         (WebCore::filterOperationForType): Deleted.
2336         (WebCore::StyleResolver::createFilterOperations): Deleted.
2337
2338         Move image mapping functions to BuilderState.
2339
2340         * css/StyleResolver.h:
2341         (WebCore::StyleResolver::State::cssToLengthConversionData const): Deleted.
2342         * html/HTMLInputElement.cpp:
2343         (WebCore::autoFillStrongPasswordMaskImage):
2344         (WebCore::HTMLInputElement::createInnerTextStyle):
2345
2346         Create mask image without requiring style resolver.
2347
2348         * style/StyleBuilder.cpp:
2349         (WebCore::Style::Builder::Builder):
2350         * style/StyleBuilderCustom.h:
2351         (WebCore::Style::BuilderCustom::applyValueZoom):
2352         (WebCore::Style::BuilderCustom::applyValueContent):
2353         (WebCore::Style::BuilderCustom::applyValueFontSize):
2354         (WebCore::Style::BuilderCustom::applyValueAlt):
2355         * style/StyleBuilderState.cpp:
2356         (WebCore::Style::BuilderState::BuilderState):
2357
2358         No more m_styleResolver.
2359
2360         (WebCore::Style::BuilderState::createStyleImage):
2361         (WebCore::Style::filterOperationForType):
2362         (WebCore::Style::BuilderState::createFilterOperations):
2363         (WebCore::Style::BuilderState::isColorFromPrimitiveValueDerivedFromElement):
2364         (WebCore::Style::BuilderState::colorFromPrimitiveValue const):
2365         (WebCore::Style::BuilderState::registerContentAttribute):
2366
2367         Collect content attributes so they can be applied later by StyleResolver.
2368
2369         * style/StyleBuilderState.h:
2370         (WebCore::Style::BuilderState::builder):
2371         (WebCore::Style::BuilderState::rootElementStyle const):
2372
2373         Restore this to be nullable for simplicity.
2374
2375         (WebCore::Style::BuilderState::registeredContentAttributes const):
2376         (WebCore::Style::BuilderState::styleResolver): Deleted.
2377
2378 2019-11-01  Zan Dobersek  <zdobersek@igalia.com>  and  Chris Lord  <clord@igalia.com>
2379
2380         CanvasRenderingContext2DBase: use CanvasBase more extensively
2381         https://bugs.webkit.org/show_bug.cgi?id=182685
2382
2383         Reviewed by Adrian Perez de Castro.
2384
2385         In CanvasRenderingContext2DBase, stop downcasting the CanvasBase object
2386         to HTMLCanvasElement where not necessary, and where necessary, do so
2387         after testing that the CanvasBase object is indeed a HTMLCanvasElement.
2388
2389         All the functionality that previously required downcasting has now moved
2390         into the CanvasBase class. Combined with these changes, this will allow
2391         OffscreenCanvas to leverage CanvasRenderingContext2DBase for 2D
2392         rasterization.
2393
2394         CanvasStyle is similarly modified to work on CanvasBase objects, only
2395         retrieving current color value from the inline style only in case of
2396         an HTMLCanvasElement derivative.
2397
2398         No new tests -- no change in behavior.
2399
2400         * html/canvas/CanvasRenderingContext2DBase.cpp:
2401         (WebCore::CanvasRenderingContext2DBase::setStrokeStyle):
2402         (WebCore::CanvasRenderingContext2DBase::setFillStyle):
2403         (WebCore::CanvasRenderingContext2DBase::setShadowColor):
2404         (WebCore::CanvasRenderingContext2DBase::setShadow):
2405         (WebCore::CanvasRenderingContext2DBase::didDraw):
2406         (WebCore::CanvasRenderingContext2DBase::getImageData const):
2407         (WebCore::CanvasRenderingContext2DBase::putImageData):
2408         (WebCore::CanvasRenderingContext2DBase::platformLayer const):
2409         * html/canvas/CanvasStyle.cpp:
2410         (WebCore::currentColor):
2411         (WebCore::parseColorOrCurrentColor):
2412         * html/canvas/CanvasStyle.h:
2413
2414 2019-10-31  Fujii Hironori  <Hironori.Fujii@sony.com>
2415
2416         [WinCairo][Clang] Unreviewed build fix
2417         https://bugs.webkit.org/show_bug.cgi?id=203663
2418
2419         ServiceWorkerThreadProxy::notifyNetworkStateChange was not
2420         exported from WebKit.dll even though it's marked with
2421         WEBCORE_TESTSUPPORT_EXPORT because any symbols in the object file of
2422         ServiceWorkerThreadProxy.cpp is not referred by WebKit.dll.
2423
2424         > WebCoreTestSupport.lib(ServiceWorkerInternals.cpp.obj) : error LNK2019: unresolved external symbol
2425         >   "__declspec(dllimport) public: void __cdecl WebCore::ServiceWorkerThreadProxy::notifyNetworkStateChange(bool)"
2426         >   (__imp_?notifyNetworkStateChange@ServiceWorkerThreadProxy@WebCore@@QEAAX_N@Z) referenced in function
2427         >   "public: <auto> __cdecl `public: void __cdecl WebCore::ServiceWorkerInternals::setOnline(bool)'::`1'::<lambda_0>::operator()(void)const "
2428         >   (??R<lambda_0>@?0??setOnline@ServiceWorkerInternals@WebCore@@QEAAX_N@Z@QEBA?A?<auto>@@XZ)
2429
2430         Uninline ServiceWorkerThreadProxy::identifier temporarily.
2431         I will revert this change after fixing this issue properly in Bug 203663.
2432
2433         No behavioral changes.
2434
2435         * workers/service/context/ServiceWorkerThreadProxy.cpp:
2436         (WebCore::ServiceWorkerThreadProxy::identifier const):
2437         * workers/service/context/ServiceWorkerThreadProxy.h:
2438
2439 2019-10-31  Brent Fulgham  <bfulgham@apple.com>
2440
2441         [FTW] Adopt DirectWrite in place of Uniscribe
2442         https://bugs.webkit.org/show_bug.cgi?id=203548
2443         <rdar://problem/56695130>
2444
2445         Reviewed by Fujii Hironori.
2446
2447         This patch switches from the Uniscribe text controller to a
2448         DirectWrite based ComplexTextController.
2449
2450         * PlatformFTW.cmake:
2451         * platform/graphics/ComplexTextController.cpp:
2452         (WebCore::ComplexTextController::ComplexTextController): Treat Windows
2453         like any other ComplexTextController platform.
2454         * platform/graphics/Font.cpp:
2455         (WebCore::Font::platformGlyphInit): Add hack for DirectWrite
2456         zero-width space handling.
2457         * platform/graphics/FontCascade.cpp:
2458         (WebCore::FontCascade::widthOfTextRange const): Don't use Uniscribe.
2459         * platform/graphics/FontPlatformData.h:
2460         (WebCore::FontPlatformData::dwFontCollection const):
2461         (WebCore::FontPlatformData::faceName const):
2462         * platform/graphics/win/ComplexTextControllerDirectWrite.cpp:
2463         (WebCore::shape): Added,
2464         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
2465         Added.
2466         * platform/graphics/win/DirectWriteUtilities.cpp:
2467         (WebCore::DirectWrite::createWithPlatformFont): Modify to return a
2468         pair of font and font collection.
2469         (WebCore::DirectWrite::fontWeight): Added stub.
2470         (WebCore::DirectWrite::fontStyle): Ditto.
2471         (WebCore::DirectWrite::fontStretch): Ditto.
2472         * platform/graphics/win/DirectWriteUtilities.h:
2473         * platform/graphics/win/FontCustomPlatformData.cpp:
2474         (WebCore::FontCustomPlatformData::fontPlatformData): Add more
2475         information to help DirectWrite handle font styles.
2476         * platform/graphics/win/FontPlatformDataDirect2D.cpp:
2477         (WebCore::FontPlatformData::platformDataInit):
2478         (WebCore::FontPlatformData::FontPlatformData):
2479         (WebCore::FontPlatformData::createFallbackFont): Deleted.
2480         * platform/graphics/win/FontWin.cpp:
2481         * platform/graphics/win/GlyphPageTreeNodeDirect2D.cpp:
2482         (WebCore::GlyphPage::fill): Update to handle multiple runs in a
2483         given string.
2484         * platform/graphics/win/TextAnalyzerHelper.cpp:
2485         (WebCore::TextAnalyzerHelper::TextAnalyzerHelper): Update to handle
2486         analysis of strings with multiple runs.
2487         (WebCore::TextAnalyzerHelper::SetScriptAnalysis): Ditto.
2488         * platform/graphics/win/TextAnalyzerHelper.h:
2489
2490 2019-10-31  Tim Horton  <timothy_horton@apple.com>
2491
2492         Turn on IOSurface support in the iOS Simulator
2493         https://bugs.webkit.org/show_bug.cgi?id=203026
2494         <rdar://problem/56320993>
2495
2496         Reviewed by Simon Fraser.
2497
2498         * Configurations/WebCore.xcconfig:
2499         Always link IOSurface now that we always have it. We continue to only link
2500         IOSurfaceAccelerator on iOS hardware, since it's only available there.
2501
2502         * platform/graphics/cocoa/IOSurface.h:
2503         Turn off RGB10 in the Simulator.
2504
2505         * rendering/RenderThemeIOS.mm:
2506         (WebCore::RenderThemeIOS::paintSystemPreviewBadge):
2507         Disable CoreImage rendering via IOSurface for the system preview badge,
2508         since it does not seem to work in the simulator.
2509
2510 2019-10-31  Jer Noble  <jer.noble@apple.com>
2511
2512         [EME] Batch multiple key requests into one request and response
2513         https://bugs.webkit.org/show_bug.cgi?id=203580
2514         <rdar://problem/54853345>
2515
2516         Reviewed by Eric Carlson.
2517
2518         Test: platform/mac/media/encrypted-media/fps-multiple-pssh.html
2519
2520         Add a path for -didProvideRequests: giving an NSArray of AVContentKeyRequests to result in
2521         an EME message containing a JSON object containing keyIDs and licence request payloads.
2522
2523         - CDMInstanceSessionFairPlayStreamingAVFObjC now defines a "Request" as a Vector of
2524           AVContentKeyRequests.
2525         - When we receive an NSArray of AVContentKeyRequests, we store that as a single "Request"
2526           in m_currentRequest and m_requests, or in m_pendingRequests.
2527         - Generating a key request message from such a vector will result in a JSON object in the format
2528           of [{ keyID: ..., payload: ...}, ...].
2529         - Clients can update these all at once with a matching JSON object in the same format, or alternatively
2530           of the format [{ keyID: ..., error: ...}, ...] to indicate to the CDN that there was an error
2531           encountered while completing the key request.
2532         - There are a couple of helper classes that facilitate collecting delegate callbacks and completion handlers
2533           into a single final callback: UpdateResponseCollector and CallbackAggregator.
2534
2535         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h:
2536         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
2537         (-[WebCoreFPSContentKeySessionDelegate contentKeySession:didProvideContentKeyRequests:forInitializationData:]):
2538         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::UpdateResponseCollector::UpdateResponseCollector):
2539         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::UpdateResponseCollector::addSuccessfulResponse):
2540         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::UpdateResponseCollector::addErrorResponse):
2541         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::UpdateResponseCollector::fail):
2542         (WebCore::parseJSONValue):
2543         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::sessionForKeyIDs const):
2544         (WebCore::keyIDsForRequest):
2545         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::keyIDs):
2546         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::updateLicense):
2547         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::closeSession):
2548         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRequest):
2549         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRequests):
2550         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRenewingRequest):
2551         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didFailToProvideRequest):
2552         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::requestDidSucceed):
2553         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::nextRequest):
2554         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::lastKeyRequest const):
2555         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::keyStatuses const):
2556
2557 2019-10-31  Alex Christensen  <achristensen@apple.com>
2558
2559         Enable more features in Mac CMake build
2560         https://bugs.webkit.org/show_bug.cgi?id=203699
2561
2562         Rubber-stamped by Tim Horton.
2563
2564         * Modules/pictureinpicture/PictureInPictureWindow.h:
2565         * PlatformMac.cmake:
2566         * layout/inlineformatting/InlineFormattingContext.cpp:
2567         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
2568
2569 2019-10-31  Russell Epstein  <repstein@apple.com>
2570
2571         Unreviewed, rolling out r251861.
2572
2573         Caused 50+ Layout Test Crashes
2574
2575         Reverted changeset:
2576
2577         "Use SecurityOriginData in NetworkProcess where possible
2578         without other changes"
2579         https://bugs.webkit.org/show_bug.cgi?id=203615
2580         https://trac.webkit.org/changeset/251861
2581
2582 2019-10-31  Said Abou-Hallawa  <sabouhallawa@apple.com>
2583
2584         SVGGeometryElement.getPointAtLength should clamp its argument to [0, length]
2585         https://bugs.webkit.org/show_bug.cgi?id=203687
2586
2587         Reviewed by Simon Fraser.
2588
2589         The spec link is:
2590             https://svgwg.org/svg2-draft/types.html#__svg__SVGGeometryElement__getPointAtLength
2591
2592         -- Fix the SVGGeometryElement.idl to match the specs.
2593         -- Fix the path utility functions to return zeros in case of an error.
2594            The callers never used the return values.
2595
2596         * rendering/svg/RenderSVGShape.cpp:
2597         (WebCore::RenderSVGShape::getPointAtLength const):
2598         * rendering/svg/RenderSVGShape.h:
2599         * svg/SVGGeometryElement.cpp:
2600         (WebCore::SVGGeometryElement::getPointAtLength const):
2601         * svg/SVGGeometryElement.h:
2602         * svg/SVGGeometryElement.idl:
2603         * svg/SVGPathElement.cpp:
2604         (WebCore::SVGPathElement::getTotalLength const):
2605         (WebCore::SVGPathElement::getPointAtLength const):
2606         (WebCore::SVGPathElement::getPathSegAtLength const):
2607         * svg/SVGPathElement.h:
2608         * svg/SVGPathUtilities.cpp:
2609         (WebCore::getSVGPathSegAtLengthFromSVGPathByteStream):
2610         (WebCore::getTotalLengthOfSVGPathByteStream):
2611         (WebCore::getPointAtLengthOfSVGPathByteStream):
2612         * svg/SVGPathUtilities.h:
2613
2614 2019-10-31  Zan Dobersek  <zdobersek@igalia.com>  and  Chris Lord  <clord@igalia.com>
2615
2616         Move ImageBuffer-related functionality from HTMLCanvasElement to CanvasBase
2617         https://bugs.webkit.org/show_bug.cgi?id=182503
2618
2619         Reviewed by Ryosuke Niwa.
2620
2621         Move the ImageBuffer member variable, other related member variables and
2622         majority of methods that operate on these from the HTMLCanvasElement
2623         class up to the CanvasBase class. This will make it possible for the
2624         OffscreenCanvas implementation to leverage the same code when using 2D
2625         contexts for painting.
2626
2627         Most of the moved methods are public, while the setImageBuffer() method
2628         is made protected so that it's still accessible from the inheriting
2629         class.
2630
2631         Along with setImageBuffer(), the active pixel memory counter is moved
2632         into the CanvasBase class. It's still using static storage, but is now
2633         a member of the class with protected access. The storage has been made
2634         atomic so as to allow its consistency to be maintained when accessed
2635         from multiple threads (which may happen in the future).
2636
2637         The m_size member variable is also moved up into the CanvasBase class.
2638         Constructor is changed so that the passed-in IntSize argument is used
2639         to initialize it. Canvas implementations are still the owners of their
2640         respective canvas contexts and are responsible for the destruction of
2641         both the context and the ImageBuffer, in that order.
2642
2643         HTMLCanvasElement destructor still has to invoke
2644         CanvasBase::notifyObserversCanvasDestroyed() since some CanvasObserver
2645         derivatives perform virtual method calls on the CanvasBase object for
2646         typecasting purposes in their canvasDestroyed() implementation.
2647         Calling virtual methods on an object that's being destroyed is normally
2648         discouraged and should be fixed separately, but it works as long as
2649         invocations are done before the HTMLCanvasElement object is destroyed
2650         completely (as has been the case so far).
2651
2652         CanvasRenderingContext2DBase is already changed in unwindStateStack()
2653         to call CanvasBase::existingDrawingContext() and not downcast the
2654         CanvasBase object to HTMLCanvasElement. This is done now due to
2655         unwindStateStack() being called from the destructor, which is now
2656         invoked from the CanvasBase destructor and not the HTMLCanvasElement
2657         destructor, avoiding virtual method calls on the CanvasBase object as
2658         it's being destroyed.
2659
2660         This patch doesn't address various methods using const qualifier and
2661         then working around that by requiring member variables to be mutable.
2662         This should be amended as much as possible in a separate patch.
2663
2664         No new tests -- no change in functionality, only refactoring.
2665
2666         * html/CanvasBase.cpp:
2667         (WebCore::CanvasBase::CanvasBase):
2668         (WebCore::CanvasBase::~CanvasBase):
2669         (WebCore::CanvasBase::drawingContext const):
2670         (WebCore::CanvasBase::existingDrawingContext const):
2671         (WebCore::CanvasBase::buffer const):
2672         (WebCore::CanvasBase::baseTransform const):
2673         (WebCore::CanvasBase::makeRenderingResultsAvailable):
2674         (WebCore::CanvasBase::memoryCost const):
2675         (WebCore::CanvasBase::externalMemoryCost const):
2676         (WebCore::CanvasBase::callTracingActive const):
2677         (WebCore::CanvasBase::setImageBuffer const):
2678         (WebCore::CanvasBase::activePixelMemory):
2679         (WebCore::CanvasBase::resetGraphicsContextState const):
2680         * html/CanvasBase.h:
2681         (WebCore::CanvasBase::width const):
2682         (WebCore::CanvasBase::height const):
2683         (WebCore::CanvasBase::size const):
2684         (WebCore::CanvasBase::setSize):
2685         (WebCore::CanvasBase::hasCreatedImageBuffer const):
2686         (WebCore::CanvasBase::createImageBuffer const):
2687         * html/CustomPaintCanvas.cpp:
2688         (WebCore::CustomPaintCanvas::CustomPaintCanvas):
2689         (WebCore::CustomPaintCanvas::~CustomPaintCanvas):
2690         * html/CustomPaintCanvas.h:
2691         * html/HTMLCanvasElement.cpp:
2692         (WebCore::HTMLCanvasElement::HTMLCanvasElement):
2693         (WebCore::HTMLCanvasElement::~HTMLCanvasElement):
2694         (WebCore::HTMLCanvasElement::setSize):
2695         (WebCore::HTMLCanvasElement::createContext2d):
2696         (WebCore::HTMLCanvasElement::reset):
2697         (WebCore::HTMLCanvasElement::setSurfaceSize):
2698         (WebCore::HTMLCanvasElement::toDataURL):
2699         (WebCore::HTMLCanvasElement::toBlob):
2700         (WebCore::HTMLCanvasElement::createImageBuffer const):
2701         (WebCore::HTMLCanvasElement::setImageBufferAndMarkDirty):
2702         * html/HTMLCanvasElement.h:
2703         * html/OffscreenCanvas.cpp:
2704         (WebCore::OffscreenCanvas::OffscreenCanvas):
2705         (WebCore::OffscreenCanvas::~OffscreenCanvas):
2706         (WebCore::OffscreenCanvas::setWidth):
2707         (WebCore::OffscreenCanvas::setHeight):
2708         (WebCore::OffscreenCanvas::transferToImageBitmap):
2709         (WebCore::OffscreenCanvas::createImageBuffer const):
2710         * html/OffscreenCanvas.h:
2711
2712 2019-10-31  Devin Rousso  <drousso@apple.com>
2713
2714         Web Inspector: DOMDebugger: Node Removed breakpoints should fire whenever the node is removed from the main DOM tree, not just when it's removed from it's parent
2715         https://bugs.webkit.org/show_bug.cgi?id=203349
2716
2717         Reviewed by Matt Baker.
2718
2719         Test: inspector/dom-debugger/dom-breakpoints.html
2720
2721         Replace `targetNode` (which was a `Runtime.RemoteObject`) with a `targetNodeId` (which is a
2722         `DOM.NodeId`) when dispatching `DOMDebugger` pauses. Additionally, include the ancestor's
2723         `DOM.NodeId` as the `targetNodeId` whenever an ancestor is removed that has a descendant
2724         with a node removed DOM breakpoint.
2725
2726         * inspector/agents/page/PageDOMDebuggerAgent.h:
2727         * inspector/agents/page/PageDOMDebuggerAgent.cpp:
2728         (WebCore::PageDOMDebuggerAgent::willRemoveDOMNode):
2729         (WebCore::PageDOMDebuggerAgent::descriptionForDOMEvent):
2730
2731         * inspector/agents/InspectorDOMAgent.h:
2732         * inspector/agents/InspectorDOMAgent.cpp:
2733         (WebCore::InspectorDOMAgent::pushNodeToFrontend): Added.
2734
2735 2019-10-31  Andres Gonzalez  <andresg_22@apple.com>
2736
2737         Rename AccessibilityObject::matchedParent as Accessibility::findAncestor and re-implement in a generic way so that can be used with both AccessibilityObjects and AXIsolatedTreeNodes.
2738         https://bugs.webkit.org/show_bug.cgi?id=203654
2739
2740         Reviewed by Chris Fleizach.
2741
2742         No new tests necessary since this does not change functionality.
2743
2744         - Deleted AccessibilityObject::matchedParent and replaced with Accessibility::findAncestor.
2745         - Accessibility::findAncestor is a template function that can be used with both AccessibilityObjects and AXIsolatedTreeNodes.
2746         - Created the namespace Accessibility for implementation details that need not to be exposed to client code.
2747         * accessibility/AccessibilityNodeObject.cpp:
2748         (WebCore::AccessibilityNodeObject::helpText const):
2749         (WebCore::AccessibilityNodeObject::textUnderElement const):
2750         * accessibility/AccessibilityObject.cpp:
2751         (WebCore::AccessibilityObject::parentObjectUnignored const):
2752         (WebCore::AccessibilityObject::isDescendantOfRole const):
2753         (WebCore::AccessibilityObject::ancestorAccessibilityScrollView const):
2754         (WebCore::AccessibilityObject::headingElementForNode):
2755         (WebCore::AccessibilityObject::isDescendantOfObject const):
2756         (WebCore::AccessibilityObject::liveRegionAncestor const):
2757         (WebCore::AccessibilityObject::isExpanded const):
2758         (WebCore::AccessibilityObject::isAXHidden const):
2759         (WebCore::AccessibilityObject::focusableAncestor):
2760         (WebCore::AccessibilityObject::editableAncestor):
2761         (WebCore::AccessibilityObject::radioGroupAncestor const):
2762         (WebCore::AccessibilityObject::matchedParent): Deleted.
2763         * accessibility/AccessibilityObject.h:
2764         * accessibility/AccessibilityObjectInterface.h:
2765         (WebCore::Accessibility::findAncestor):
2766         * accessibility/AccessibilityRenderObject.cpp:
2767         (WebCore::AccessibilityRenderObject::hasPopup const):
2768         * accessibility/AccessibilitySVGElement.cpp:
2769         (WebCore::AccessibilitySVGElement::computeAccessibilityIsIgnored const):
2770         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2771         (-[WebAccessibilityObjectWrapper _accessibilityTreeAncestor]):
2772         (-[WebAccessibilityObjectWrapper _accessibilityListAncestor]):
2773         (-[WebAccessibilityObjectWrapper _accessibilityArticleAncestor]):
2774         (-[WebAccessibilityObjectWrapper _accessibilityLandmarkAncestor]):
2775         (-[WebAccessibilityObjectWrapper _accessibilityTableAncestor]):
2776         (-[WebAccessibilityObjectWrapper _accessibilityIsInTableCell]):
2777         (-[WebAccessibilityObjectWrapper _accessibilityFieldsetAncestor]):
2778         (-[WebAccessibilityObjectWrapper _accessibilityFrameAncestor]):
2779         (-[WebAccessibilityObjectWrapper tableCellParent]):
2780         (-[WebAccessibilityObjectWrapper tableParent]):
2781         (-[WebAccessibilityObjectWrapper accessibilityDatetimeValue]):
2782         (-[WebAccessibilityObjectWrapper detailParentForSummaryObject:]):
2783         (-[WebAccessibilityObjectWrapper detailParentForObject:]):
2784         (-[WebAccessibilityObjectWrapper treeItemParentForObject:]):
2785         (AXAttributeStringSetStyle):
2786
2787 2019-10-31  Ryosuke Niwa  <rniwa@webkit.org>
2788
2789         Integrate resize event with HTML5 event loop
2790         https://bugs.webkit.org/show_bug.cgi?id=202964
2791
2792         Reviewed by Geoffrey Garen and Simon Fraser.
2793
2794         Dispatch resize events in "run the resize steps" during the "update the rendering":
2795         https://html.spec.whatwg.org/multipage/webappapis.html#update-the-rendering
2796
2797         Existing code in WebCore which was dispatching or scheduling dispatching of resize events now simply sets
2798         a flag on document and schedules a rendering update. In Page::updateRendering, we fire resize events on
2799         any documents with this flag set.
2800
2801         Test: fast/events/resize-subframe-in-rendering-update.html
2802
2803         * css/CSSFontSelector.cpp:
2804         (WebCore::CSSFontSelector::beginLoadTimerFired): Fixed the flakiness in SVG animation tests observed
2805         after this patch was landed previously. The issue was that this code was calling FrameLoader's
2806         checkLoadComplete before checkCompleted. checkCompleted starts SVG animations in Document::implicitClose
2807         whereas checkLoadComplete can cause DumpRenderTree to end the test. As a result, depending on when this
2808         function was called relative to other work being done in the main thread, DumpRenderTree could prematurely
2809         end and dump the test result even though SVG animation would have immediately started in either scenario.
2810         Unfortunately I couldn't come up with a new deterministic test for this issue since the exact condition
2811         under which this problem comes up seems quite racy (which makes sense given this only manifested as flaky
2812         failures in existing tests).
2813         * dom/Document.cpp:
2814         (WebCore::Document::setNeedsDOMWindowResizeEvent): Added.
2815         (WebCore::Document::setNeedsVisualViewportResize): Added.
2816         (WebCore::Document::runResizeSteps): Added. https://drafts.csswg.org/cssom-view/#run-the-resize-steps
2817         * dom/Document.h:
2818         * page/FrameView.cpp:
2819         (WebCore::FrameView::sendResizeEventIfNeeded): Now sets m_needsDOMWindowResizeEvent on Document instead of
2820         enqueuing a resize event.
2821         * page/Page.cpp:
2822         (WebCore::Page::updateRendering): Call runResizeSteps on each document.
2823         (WebCore::Page::collectDocuments): Added.
2824         * page/Page.h:
2825         * page/VisualViewport.cpp:
2826         (WebCore::VisualViewport::enqueueResizeEvent):
2827
2828 2019-10-31  Jer Noble  <jer.noble@apple.com>
2829
2830         Unreviewed build fix; move PictureInPictureSupport.h include outside HAVE(AVKIT) check.
2831
2832         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
2833
2834 2019-10-31  Antti Koivisto  <antti@apple.com>
2835
2836         Introduce Style::Builder
2837         https://bugs.webkit.org/show_bug.cgi?id=203682
2838
2839         Reviewed by Zalan Bujtas.
2840
2841         Encapsulate the style building step into a new Builder class. It owns the cascade and the style building state.
2842
2843         Move tha applying code from StyleResolver and PropertyCascade there.
2844         Move a bunch of font related state from StyleResolver::State to BuilderState.
2845
2846         * DerivedSources-output.xcfilelist:
2847         * Sources.txt:
2848         * WebCore.xcodeproj/project.pbxproj:
2849         * css/CSSVariableReferenceValue.cpp:
2850         (WebCore::resolveVariableReference):
2851         * css/DOMCSSRegisterCustomProperty.cpp:
2852         (WebCore::DOMCSSRegisterCustomProperty::registerProperty):
2853         * css/StyleResolver.cpp:
2854         (WebCore::StyleResolver::styleForKeyframe):
2855         (WebCore::StyleResolver::styleForPage):
2856         (WebCore::StyleResolver::applyMatchedProperties):
2857         (WebCore::StyleResolver::applyPropertyToCurrentStyle):
2858         (WebCore::StyleResolver::initializeFontStyle):
2859         (WebCore::StyleResolver::adjustStyleForInterCharacterRuby): Deleted.
2860         (WebCore::checkForOrientationChange): Deleted.
2861         (WebCore::StyleResolver::updateFont): Deleted.
2862         (WebCore::StyleResolver::useSVGZoomRules const): Deleted.
2863         (WebCore::StyleResolver::useSVGZoomRulesForLength const): Deleted.
2864         (WebCore::StyleResolver::checkForTextSizeAdjust): Deleted.
2865         (WebCore::StyleResolver::checkForZoomChange): Deleted.
2866         (WebCore::StyleResolver::checkForGenericFamilyChange): Deleted.
2867         (WebCore::StyleResolver::setFontSize): Deleted.
2868         * css/StyleResolver.h:
2869         (WebCore::StyleResolver::State::setFontSizeHasViewportUnits): Deleted.
2870         (WebCore::StyleResolver::State::fontSizeHasViewportUnits const): Deleted.
2871         (WebCore::StyleResolver::State::useSVGZoomRules const): Deleted.
2872         * css/parser/CSSParser.cpp:
2873         (WebCore::CSSParser::parseValueWithVariableReferences):
2874         * css/parser/CSSPropertyParser.cpp:
2875         * style/PropertyCascade.cpp:
2876         (WebCore::Style::PropertyCascade::PropertyCascade):
2877         (WebCore::Style::PropertyCascade::set):
2878         (WebCore::Style::PropertyCascade::propertyCascadeForRollback const):
2879         (WebCore::Style::PropertyCascade::resolveDirectionAndWritingMode const):
2880         (WebCore::Style::PropertyCascade::applyDeferredProperties): Deleted.
2881         (WebCore::Style::PropertyCascade::applyProperties): Deleted.
2882         (WebCore::Style::PropertyCascade::applyPropertiesImpl): Deleted.
2883         (WebCore::Style::PropertyCascade::applyCustomProperties): Deleted.
2884         (WebCore::Style::PropertyCascade::applyCustomProperty): Deleted.
2885         (WebCore::Style::PropertyCascade::propertyCascadeForRollback): Deleted.
2886         (WebCore::Style::PropertyCascade::applyProperty): Deleted.
2887         (WebCore::Style::PropertyCascade::resolveValue): Deleted.
2888         (WebCore::Style::PropertyCascade::resolvedVariableValue): Deleted.
2889         (WebCore::Style::PropertyCascade::resolveDirectionAndWritingMode): Deleted.
2890         * style/PropertyCascade.h:
2891         (WebCore::Style::PropertyCascade::deferredProperties const):
2892         (WebCore::Style::PropertyCascade::customProperties const):
2893         (WebCore::Style::PropertyCascade::direction const):
2894         (WebCore::Style::PropertyCascade::builderState): Deleted.
2895         * style/StyleBuilder.cpp: Added.
2896         (WebCore::Style::directionFromStyle):
2897         (WebCore::Style::Builder::Builder):
2898         (WebCore::Style::Builder::applyAllProperties):
2899         (WebCore::Style::Builder::applyHighPriorityProperties):
2900         (WebCore::Style::Builder::applyLowPriorityProperties):
2901         (WebCore::Style::Builder::applyPropertyValue):
2902         (WebCore::Style::Builder::applyDeferredProperties):
2903         (WebCore::Style::Builder::applyProperties):
2904         (WebCore::Style::Builder::applyPropertiesImpl):
2905         (WebCore::Style::Builder::applyCustomProperties):
2906         (WebCore::Style::Builder::applyCustomProperty):
2907         (WebCore::Style::Builder::applyCascadeProperty):
2908         (WebCore::Style::Builder::applyProperty):
2909         (WebCore::Style::Builder::resolveValue):
2910         (WebCore::Style::Builder::resolvedVariableValue):
2911         * style/StyleBuilder.h: Added.
2912         (WebCore::Style::Builder::applyProperty):
2913         (WebCore::Style::Builder::state):
2914         * style/StyleBuilderCustom.h:
2915         (WebCore::Style::BuilderCustom::applyValueFontSize):
2916         * style/StyleBuilderState.cpp:
2917         (WebCore::Style::BuilderState::BuilderState):
2918         (WebCore::Style::BuilderState::useSVGZoomRules const):
2919         (WebCore::Style::BuilderState::useSVGZoomRulesForLength const):
2920         (WebCore::Style::BuilderState::adjustStyleForInterCharacterRuby):
2921         (WebCore::Style::BuilderState::updateFont):
2922         (WebCore::Style::BuilderState::updateFontForTextSizeAdjust):
2923         (WebCore::Style::BuilderState::updateFontForZoomChange):
2924         (WebCore::Style::BuilderState::updateFontForGenericFamilyChange):
2925         (WebCore::Style::BuilderState::updateFontForOrientationChange):
2926         (WebCore::Style::BuilderState::setFontSize):
2927         * style/StyleBuilderState.h:
2928         (WebCore::Style::BuilderState::builder):
2929         (WebCore::Style::BuilderState::setFontDirty):
2930         (WebCore::Style::BuilderState::cascade): Deleted.
2931         (WebCore::Style::BuilderState::clearFontDirty): Deleted.
2932
2933 2019-10-31  Alex Christensen  <achristensen@webkit.org>
2934
2935         Remove unneeded HAVE_TIMINGDATAOPTIONS
2936         https://bugs.webkit.org/show_bug.cgi?id=202990
2937
2938         Reviewed by Brady Eidson.
2939
2940         This macro allowed us to adopt CFNetwork SPI, but now that the SPI is available everywhere we support, we don't need it.
2941
2942         * platform/network/NetworkLoadMetrics.h:
2943         * platform/network/cocoa/NetworkLoadMetrics.mm:
2944         (WebCore::copyTimingData):
2945         (WebCore::setCollectsTimingData): Deleted.
2946         * platform/network/mac/ResourceHandleMac.mm:
2947         (WebCore::ResourceHandle::createNSURLConnection):
2948
2949 2019-10-31  Alex Christensen  <achristensen@webkit.org>
2950
2951         Use SecurityOriginData in NetworkProcess where possible without other changes
2952         https://bugs.webkit.org/show_bug.cgi?id=203615
2953
2954         Reviewed by Brady Eidson.
2955
2956         * page/SecurityOrigin.cpp:
2957         (WebCore::SecurityOrigin::SecurityOrigin):
2958         (WebCore::SecurityOrigin::isolatedCopy const):
2959         * page/SecurityOrigin.h:
2960         * page/SecurityOriginData.h:
2961         (WebCore::SecurityOriginData::encode const):
2962         * page/csp/ContentSecurityPolicy.cpp:
2963         (WebCore::ContentSecurityPolicy::allowFrameAncestors const):
2964         * page/csp/ContentSecurityPolicy.h:
2965         * page/csp/ContentSecurityPolicyDirectiveList.cpp:
2966         (WebCore::urlFromOrigin):
2967         (WebCore::checkFrameAncestors):
2968         (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForFrameAncestorOrigins const):
2969         * page/csp/ContentSecurityPolicyDirectiveList.h:
2970
2971 2019-10-31  Zalan Bujtas  <zalan@apple.com>
2972
2973         [LFC][IFC] Add expansion context to Line::Run
2974         https://bugs.webkit.org/show_bug.cgi?id=203683
2975         <rdar://problem/56785012>
2976
2977         Reviewed by Antti Koivisto.
2978
2979         This is in preparation for adding text-align: justify support.
2980         The temporary Line::Run holds the number of expansion opportunities, while Display::Run holds both the expansion behavior and
2981         the final expansion width.
2982         The number of opportunities is used to compute the final expansion width for each run.
2983
2984         * layout/displaytree/DisplayPainter.cpp:
2985         (WebCore::Display::paintInlineContent):
2986         * layout/displaytree/DisplayRun.h:
2987         (WebCore::Display::Run::TextContext::TextContext):
2988         (WebCore::Display::Run::TextContext::setExpansion):
2989         (WebCore::Display::Run::TextContext::expansion const):
2990         (WebCore::Display::Run::TextContext::expansionBehavior const): Deleted.
2991         * layout/inlineformatting/InlineLine.h:
2992         (WebCore::Layout::Line::Run::hasExpansionOpportunity const):
2993         (WebCore::Layout::Line::Run::expansionOpportunityCount const):
2994         (WebCore::Layout::Line::Run::expansionBehavior const):
2995         (WebCore::Layout::Line::Run::setHasExpansionOpportunity):
2996         (WebCore::Layout::Line::Run::setComputedHorizontalExpansion):
2997
2998 2019-10-31  Zalan Bujtas  <zalan@apple.com>
2999
3000         [LFC][IFC] Line::Run should not hold a reference to InlineItem
3001         https://bugs.webkit.org/show_bug.cgi?id=203660
3002         <rdar://problem/56770286>
3003
3004         Reviewed by Antti Koivisto.
3005
3006         When Line::Runs are merged ([content][   ] -> [content ]) they end up with multiple InlineItems. Let's cache some values from
3007         the InlineItems instead.
3008
3009         * layout/inlineformatting/InlineLine.cpp:
3010         (WebCore::Layout::Line::Run::Run):
3011         (WebCore::Layout::Line::close):
3012         * layout/inlineformatting/InlineLine.h:
3013         (WebCore::Layout::Line::Run::layoutBox const):
3014         (WebCore::Layout::Line::Run::isText const):
3015         (WebCore::Layout::Line::Run::isBox const):
3016         (WebCore::Layout::Line::Run::isForcedLineBreak const):
3017         (WebCore::Layout::Line::Run::isContainerStart const):
3018         (WebCore::Layout::Line::Run::isContainerEnd const):
3019         (WebCore::Layout::Line::Run::isCollapsible const):
3020         (WebCore::Layout::Line::Run::isWhitespace const):
3021         (WebCore::Layout::Line::Run::expand):
3022
3023 2019-10-31  Wenson Hsieh  <wenson_hsieh@apple.com>
3024
3025         Unreviewed, update DerivedSources-output.xcfilelist after r251841
3026
3027         * DerivedSources-output.xcfilelist: Replace StyleBuilder.cpp with StyleBuilderGenerated.cpp.
3028
3029 2019-10-31  Zalan Bujtas  <zalan@apple.com>
3030
3031         [LFC][IFC] Do not merge completely collapsed run with the previous run
3032         https://bugs.webkit.org/show_bug.cgi?id=203658
3033         <rdar://problem/56769334>
3034
3035         Reviewed by Antti Koivisto.
3036
3037         When a whitespace run is completely collapsed (and visually empty), we should not try to merge it with previous text runs.
3038         E.g. [before  \nafter] -> [before][  ][\n][after] -> [before ][][after] -> [before ][after]
3039                 ^content               ^inline items             ^line runs          ^display runs
3040
3041         * layout/inlineformatting/InlineLine.cpp:
3042         (WebCore::Layout::Line::close):
3043         * layout/inlineformatting/InlineLine.h:
3044         (WebCore::Layout::Line::Run::hasTrailingCollapsedContent const):
3045         (WebCore::Layout::Line::Run::canBeExtended const): Deleted.
3046
3047 2019-10-31  Zalan Bujtas  <zalan@apple.com>
3048
3049         [LFC][IFC] Set setIsCollapsed on the line item when its content is actually collapsed
3050         https://bugs.webkit.org/show_bug.cgi?id=203655
3051         <rdar://problem/56767543>
3052
3053         Reviewed by Antti Koivisto.
3054
3055         Do not set the isCollapsed flag on the line run unless we actually collapsed it (changed its length from greated than 1 to 1).
3056
3057         * layout/inlineformatting/InlineLine.cpp:
3058         (WebCore::Layout::Line::appendTextContent):
3059
3060 2019-10-31  Zalan Bujtas  <zalan@apple.com>
3061
3062         [LFC][IFC] Line::appendTextContent::willCollapseCompletely should check for isCollapsible()
3063         https://bugs.webkit.org/show_bug.cgi?id=203653
3064         <rdar://problem/56766949>
3065
3066         Reviewed by Antti Koivisto.
3067
3068         When deciding whether the current collapsible whitespace run collapses completely, we need to check whether the previous
3069         run is collapsible and not whether it is collapsed (it addresses the cases when the previous whitespace length is 1, so it is collapsible but not
3070         collapsed -> " " followed by '\n' <- no preserved segment break.)
3071
3072         * layout/inlineformatting/InlineLine.cpp:
3073         (WebCore::Layout::Line::appendTextContent):
3074
3075 2019-10-31  Zalan Bujtas  <zalan@apple.com>
3076
3077         [LFC][IFC] Add justify expansion information to Display::Runs
3078         https://bugs.webkit.org/show_bug.cgi?id=203535
3079         <rdar://problem/56689268>
3080
3081         Reviewed by Antti Koivisto.
3082
3083         This is in preparation for supporting text-align: justify.
3084
3085         * layout/displaytree/DisplayPainter.cpp:
3086         (WebCore::Display::paintInlineContent):
3087         * layout/displaytree/DisplayRun.h:
3088         (WebCore::Display::Run::TextContext::TextContext):
3089         (WebCore::Display::Run::TextContext::expansionBehavior const):
3090         (WebCore::Display::Run::TextContext::expansion const):
3091
3092 2019-10-31  Zalan Bujtas  <zalan@apple.com>
3093
3094         [LFC][IFC] Preserved segment breaks should produce ForcedLineBreak type of InlineItems
3095         https://bugs.webkit.org/show_bug.cgi?id=203645
3096         <rdar://problem/56763606>
3097
3098         Reviewed by Antti Koivisto.
3099
3100         This patch turns preserved segment breaks (e.g. \n) into a ForcedLineBreak. Non-preserved segments breaks are treated as whitespace characters.
3101         It fixes a small type mismatch of having an InlineTextItem representing a non-text content (line break).
3102
3103         * layout/inlineformatting/InlineFormattingContext.cpp:
3104         (WebCore::Layout::InlineFormattingContext::collectInlineContent):
3105         * layout/inlineformatting/InlineItem.cpp:
3106         (WebCore::Layout::InlineItem::InlineItem):
3107         (WebCore::Layout::InlineItem::isForcedLineBreak const): Deleted.
3108         (WebCore::Layout::InlineItem::isText const): Deleted.
3109         * layout/inlineformatting/InlineItem.h:
3110         (WebCore::Layout::InlineItem::isText const):
3111         (WebCore::Layout::InlineItem::isForcedLineBreak const):
3112         (WebCore::Layout::InlineItem::InlineItem): Deleted.
3113         * layout/inlineformatting/InlineTextItem.cpp:
3114         (WebCore::Layout::InlineTextItem::createAndAppendTextItems):
3115         (WebCore::Layout::InlineTextItem::left const):
3116         (WebCore::Layout::InlineTextItem::right const):
3117         (WebCore::Layout::InlineTextItem::isWhitespace const): Deleted.
3118         * layout/inlineformatting/InlineTextItem.h:
3119         (WebCore::Layout::InlineTextItem::isWhitespace const):
3120
3121 2019-10-31  Antti Koivisto  <antti@apple.com>
3122
3123         Rename StyleBuilder to Style::BuilderGenerated
3124         https://bugs.webkit.org/show_bug.cgi?id=203673
3125
3126         Reviewed by Antoine Quint.
3127
3128         Also rename the related StykeBuilderCustom and StyleBuilderConverter classes
3129         and move them to the Style namespace and directory.
3130
3131         * Sources.txt:
3132         * WebCore.xcodeproj/project.pbxproj:
3133         * css/CSSFontFace.cpp:
3134         (WebCore::calculateWeightRange):
3135         (WebCore::calculateStretchRange):
3136         (WebCore::calculateItalicRange):
3137         * css/CSSFontFaceSet.cpp:
3138         (WebCore::computeFontSelectionRequest):
3139         * css/CSSToStyleMap.cpp:
3140         (WebCore::CSSToStyleMap::mapFillXPosition):
3141         (WebCore::CSSToStyleMap::mapFillYPosition):
3142         * css/StyleBuilder.h: Removed.
3143         * css/makeprop.pl:
3144         (getScopeForFunction):
3145         (generateInitialValueSetter):
3146         (generateInheritValueSetter):
3147         (generateValueSetter):
3148         * css/parser/CSSPropertyParser.cpp:
3149         (WebCore::CSSPropertyParser::parseTypedCustomPropertyValue):
3150         * style/PropertyCascade.cpp:
3151         (WebCore::Style::PropertyCascade::applyProperty):
3152         * style/StyleBuilderConverter.h: Renamed from Source/WebCore/css/StyleBuilderConverter.h.
3153         (WebCore::Style::BuilderConverter::convertLength):
3154         (WebCore::Style::BuilderConverter::convertLengthOrAuto):
3155         (WebCore::Style::BuilderConverter::convertLengthSizing):
3156         (WebCore::Style::BuilderConverter::convertLengthMaxSizing):
3157         (WebCore::Style::BuilderConverter::convertTabSize):
3158         (WebCore::Style::BuilderConverter::convertComputedLength):
3159         (WebCore::Style::BuilderConverter::convertLineWidth):
3160         (WebCore::Style::BuilderConverter::convertSpacing):
3161         (WebCore::Style::BuilderConverter::convertToRadiusLength):
3162         (WebCore::Style::BuilderConverter::convertRadius):
3163         (WebCore::Style::BuilderConverter::convertTo100PercentMinusLength):
3164         (WebCore::Style::BuilderConverter::convertPositionComponentX):
3165         (WebCore::Style::BuilderConverter::convertPositionComponentY):
3166         (WebCore::Style::BuilderConverter::convertPositionComponent):
3167         (WebCore::Style::BuilderConverter::convertObjectPosition):
3168         (WebCore::Style::BuilderConverter::convertTextDecoration):
3169         (WebCore::Style::BuilderConverter::convertNumber):
3170         (WebCore::Style::BuilderConverter::convertNumberOrAuto):
3171         (WebCore::Style::BuilderConverter::convertWebkitHyphenateLimitLines):
3172         (WebCore::Style::BuilderConverter::convertBorderImage):
3173         (WebCore::Style::BuilderConverter::convertBorderMask):
3174         (WebCore::Style::BuilderConverter::convertStyleImage):
3175         (WebCore::Style::BuilderConverter::convertTransform):
3176         (WebCore::Style::BuilderConverter::updateColorScheme):
3177         (WebCore::Style::BuilderConverter::convertColorScheme):
3178         (WebCore::Style::BuilderConverter::convertString):
3179         (WebCore::Style::BuilderConverter::convertStringOrAuto):
3180         (WebCore::Style::BuilderConverter::convertStringOrNone):
3181         (WebCore::Style::BuilderConverter::valueToEmphasisPosition):
3182         (WebCore::Style::BuilderConverter::convertTextEmphasisPosition):
3183         (WebCore::Style::BuilderConverter::convertTextAlign):
3184         (WebCore::Style::BuilderConverter::convertClipPath):
3185         (WebCore::Style::BuilderConverter::convertResize):
3186         (WebCore::Style::BuilderConverter::convertMarqueeRepetition):
3187         (WebCore::Style::BuilderConverter::convertMarqueeSpeed):
3188         (WebCore::Style::BuilderConverter::convertQuotes):
3189         (WebCore::Style::BuilderConverter::convertTextUnderlinePosition):
3190         (WebCore::Style::BuilderConverter::convertTextUnderlineOffset):
3191         (WebCore::Style::BuilderConverter::convertTextDecorationThickness):
3192         (WebCore::Style::BuilderConverter::convertReflection):
3193         (WebCore::Style::BuilderConverter::convertInitialLetter):
3194         (WebCore::Style::BuilderConverter::convertTextStrokeWidth):
3195         (WebCore::Style::BuilderConverter::convertLineBoxContain):
3196         (WebCore::Style::BuilderConverter::valueToDecorationSkip):
3197         (WebCore::Style::BuilderConverter::convertTextDecorationSkip):
3198         (WebCore::Style::BuilderConverter::convertShapeValue):
3199         (WebCore::Style::BuilderConverter::convertScrollSnapType):
3200         (WebCore::Style::BuilderConverter::convertScrollSnapAlign):
3201         (WebCore::Style::BuilderConverter::createGridTrackBreadth):
3202         (WebCore::Style::BuilderConverter::createGridTrackSize):
3203         (WebCore::Style::BuilderConverter::createGridTrackList):
3204         (WebCore::Style::BuilderConverter::createGridPosition):
3205         (WebCore::Style::BuilderConverter::createImplicitNamedGridLinesFromGridArea):
3206         (WebCore::Style::BuilderConverter::convertGridTrackSizeList):
3207         (WebCore::Style::BuilderConverter::convertGridTrackSize):
3208         (WebCore::Style::BuilderConverter::convertGridPosition):
3209         (WebCore::Style::BuilderConverter::convertGridAutoFlow):
3210         (WebCore::Style::BuilderConverter::csstoLengthConversionDataWithTextZoomFactor):
3211         (WebCore::Style::BuilderConverter::convertWordSpacing):
3212         (WebCore::Style::BuilderConverter::convertPerspective):
3213         (WebCore::Style::BuilderConverter::convertMarqueeIncrement):
3214         (WebCore::Style::BuilderConverter::convertFilterOperations):
3215         (WebCore::Style::BuilderConverter::convertFontFeatureSettings):
3216         (WebCore::Style::BuilderConverter::convertFontWeightFromValue):
3217         (WebCore::Style::BuilderConverter::convertFontStretchFromValue):
3218         (WebCore::Style::BuilderConverter::convertFontStyleFromValue):
3219         (WebCore::Style::BuilderConverter::convertFontWeight):
3220         (WebCore::Style::BuilderConverter::convertFontStretch):
3221         (WebCore::Style::BuilderConverter::convertFontVariationSettings):
3222         (WebCore::Style::BuilderConverter::convertTouchCallout):
3223         (WebCore::Style::BuilderConverter::convertTapHighlightColor):
3224         (WebCore::Style::BuilderConverter::convertTouchAction):
3225         (WebCore::Style::BuilderConverter::convertOverflowScrolling):
3226         (WebCore::Style::BuilderConverter::convertSVGLengthValue):
3227         (WebCore::Style::BuilderConverter::convertSVGLengthVector):
3228         (WebCore::Style::BuilderConverter::convertStrokeDashArray):
3229         (WebCore::Style::BuilderConverter::convertPaintOrder):
3230         (WebCore::Style::BuilderConverter::convertOpacity):
3231         (WebCore::Style::BuilderConverter::convertSVGURIReference):
3232         (WebCore::Style::BuilderConverter::convertSVGColor):
3233         (WebCore::Style::BuilderConverter::convertSelfOrDefaultAlignmentData):
3234         (WebCore::Style::BuilderConverter::convertContentAlignmentData):
3235         (WebCore::Style::BuilderConverter::convertGlyphOrientation):
3236         (WebCore::Style::BuilderConverter::convertGlyphOrientationOrAuto):
3237         (WebCore::Style::BuilderConverter::convertLineHeight):
3238         (WebCore::Style::BuilderConverter::convertFontSynthesis):
3239         (WebCore::Style::BuilderConverter::convertSpeakAs):
3240         (WebCore::Style::BuilderConverter::convertHangingPunctuation):
3241         (WebCore::Style::BuilderConverter::convertGapLength):
3242         * style/StyleBuilderCustom.h: Renamed from Source/WebCore/css/StyleBuilderCustom.h.
3243         (WebCore::Style::BuilderCustom::applyInitialWebkitMaskImage):
3244         (WebCore::Style::BuilderCustom::applyInheritWebkitMaskImage):
3245         (WebCore::Style::BuilderCustom::applyInitialFontFeatureSettings):
3246         (WebCore::Style::BuilderCustom::applyInheritFontFeatureSettings):
3247         (WebCore::Style::BuilderCustom::applyInitialFontVariationSettings):
3248         (WebCore::Style::BuilderCustom::applyInheritFontVariationSettings):
3249         (WebCore::Style::BuilderCustom::applyValueDirection):
3250         (WebCore::Style::BuilderCustom::applyInitialTextAlign):
3251         (WebCore::Style::BuilderCustom::applyValueTextAlign):
3252         (WebCore::Style::BuilderCustom::resetEffectiveZoom):
3253         (WebCore::Style::BuilderCustom::applyInitialZoom):
3254         (WebCore::Style::BuilderCustom::applyInheritZoom):
3255         (WebCore::Style::BuilderCustom::applyValueZoom):
3256         (WebCore::Style::BuilderCustom::mmLength):
3257         (WebCore::Style::BuilderCustom::inchLength):
3258         (WebCore::Style::BuilderCustom::getPageSizeFromName):
3259         (WebCore::Style::BuilderCustom::applyValueVerticalAlign):
3260         (WebCore::Style::BuilderCustom::applyInheritImageResolution):
3261         (WebCore::Style::BuilderCustom::applyInitialImageResolution):
3262         (WebCore::Style::BuilderCustom::applyValueImageResolution):
3263         (WebCore::Style::BuilderCustom::applyInheritSize):
3264         (WebCore::Style::BuilderCustom::applyInitialSize):
3265         (WebCore::Style::BuilderCustom::applyValueSize):
3266         (WebCore::Style::BuilderCustom::applyInheritTextIndent):
3267         (WebCore::Style::BuilderCustom::applyInitialTextIndent):
3268         (WebCore::Style::BuilderCustom::applyValueTextIndent):
3269         (WebCore::Style::ApplyPropertyBorderImageModifier::applyInheritValue):
3270         (WebCore::Style::ApplyPropertyBorderImageModifier::applyInitialValue):
3271         (WebCore::Style::ApplyPropertyBorderImageModifier::applyValue):
3272         (WebCore::Style::BuilderCustom::applyInheritLineHeight):
3273         (WebCore::Style::BuilderCustom::applyInitialLineHeight):
3274         (WebCore::Style::BuilderCustom::applyValueLineHeight):
3275         (WebCore::Style::BuilderCustom::applyInheritOutlineStyle):
3276         (WebCore::Style::BuilderCustom::applyInitialOutlineStyle):
3277         (WebCore::Style::BuilderCustom::applyValueOutlineStyle):
3278         (WebCore::Style::BuilderCustom::applyInitialClip):
3279         (WebCore::Style::BuilderCustom::applyInheritClip):
3280         (WebCore::Style::BuilderCustom::applyValueClip):
3281         (WebCore::Style::BuilderCustom::applyValueWebkitLocale):
3282         (WebCore::Style::BuilderCustom::applyValueWritingMode):
3283         (WebCore::Style::BuilderCustom::applyValueWebkitTextOrientation):
3284         (WebCore::Style::BuilderCustom::applyValueWebkitTextSizeAdjust):
3285         (WebCore::Style::BuilderCustom::applyValueWebkitTextZoom):
3286         (WebCore::Style::BuilderCustom::applyValueColorScheme):
3287         (WebCore::Style::BuilderCustom::applyTextOrBoxShadowValue):
3288         (WebCore::Style::BuilderCustom::applyInitialTextShadow):
3289         (WebCore::Style::BuilderCustom::applyInheritTextShadow):
3290         (WebCore::Style::BuilderCustom::applyValueTextShadow):
3291         (WebCore::Style::BuilderCustom::applyInitialBoxShadow):
3292         (WebCore::Style::BuilderCustom::applyInheritBoxShadow):
3293         (WebCore::Style::BuilderCustom::applyValueBoxShadow):
3294         (WebCore::Style::BuilderCustom::applyInitialWebkitBoxShadow):
3295         (WebCore::Style::BuilderCustom::applyInheritWebkitBoxShadow):
3296         (WebCore::Style::BuilderCustom::applyValueWebkitBoxShadow):
3297         (WebCore::Style::BuilderCustom::applyInitialFontFamily):
3298         (WebCore::Style::BuilderCustom::applyInheritFontFamily):
3299         (WebCore::Style::BuilderCustom::applyValueFontFamily):
3300         (WebCore::Style::BuilderCustom::isValidDisplayValue):
3301         (WebCore::Style::BuilderCustom::applyInheritDisplay):
3302         (WebCore::Style::BuilderCustom::applyValueDisplay):
3303         (WebCore::Style::BuilderCustom::applyValueBaselineShift):
3304         (WebCore::Style::BuilderCustom::applyInitialWebkitAspectRatio):
3305         (WebCore::Style::BuilderCustom::applyInheritWebkitAspectRatio):
3306         (WebCore::Style::BuilderCustom::applyValueWebkitAspectRatio):
3307         (WebCore::Style::BuilderCustom::applyInitialWebkitTextEmphasisStyle):
3308         (WebCore::Style::BuilderCustom::applyInheritWebkitTextEmphasisStyle):
3309         (WebCore::Style::BuilderCustom::applyValueWebkitTextEmphasisStyle):
3310         (WebCore::Style::BuilderCustom::applyInheritCounter):
3311         (WebCore::Style::BuilderCustom::applyValueCounter):
3312         (WebCore::Style::BuilderCustom::applyInitialCounterIncrement):
3313         (WebCore::Style::BuilderCustom::applyInheritCounterIncrement):
3314         (WebCore::Style::BuilderCustom::applyValueCounterIncrement):
3315         (WebCore::Style::BuilderCustom::applyInitialCounterReset):
3316         (WebCore::Style::BuilderCustom::applyInheritCounterReset):
3317         (WebCore::Style::BuilderCustom::applyValueCounterReset):
3318         (WebCore::Style::BuilderCustom::applyInitialCursor):
3319         (WebCore::Style::BuilderCustom::applyInheritCursor):
3320         (WebCore::Style::BuilderCustom::applyValueCursor):
3321         (WebCore::Style::BuilderCustom::applyInitialFill):
3322         (WebCore::Style::BuilderCustom::applyInheritFill):
3323         (WebCore::Style::BuilderCustom::applyValueFill):
3324         (WebCore::Style::BuilderCustom::applyInitialStroke):
3325         (WebCore::Style::BuilderCustom::applyInheritStroke):
3326         (WebCore::Style::BuilderCustom::applyValueStroke):
3327         (WebCore::Style::BuilderCustom::applyInitialContent):
3328         (WebCore::Style::BuilderCustom::applyInheritContent):
3329         (WebCore::Style::BuilderCustom::applyValueContent):
3330         (WebCore::Style::BuilderCustom::applyInheritFontVariantLigatures):
3331         (WebCore::Style::BuilderCustom::applyInitialFontVariantLigatures):
3332         (WebCore::Style::BuilderCustom::applyValueFontVariantLigatures):
3333         (WebCore::Style::BuilderCustom::applyInheritFontVariantNumeric):
3334         (WebCore::Style::BuilderCustom::applyInitialFontVariantNumeric):
3335         (WebCore::Style::BuilderCustom::applyValueFontVariantNumeric):
3336         (WebCore::Style::BuilderCustom::applyInheritFontVariantEastAsian):
3337         (WebCore::Style::BuilderCustom::applyInitialFontVariantEastAsian):
3338         (WebCore::Style::BuilderCustom::applyValueFontVariantEastAsian):
3339         (WebCore::Style::BuilderCustom::applyInitialFontSize):
3340         (WebCore::Style::BuilderCustom::applyInheritFontSize):
3341         (WebCore::Style::BuilderCustom::largerFontSize):
3342         (WebCore::Style::BuilderCustom::smallerFontSize):
3343         (WebCore::Style::BuilderCustom::determineRubyTextSizeMultiplier):
3344         (WebCore::Style::BuilderCustom::applyInitialFontStyle):
3345         (WebCore::Style::BuilderCustom::applyInheritFontStyle):
3346         (WebCore::Style::BuilderCustom::applyValueFontStyle):
3347         (WebCore::Style::BuilderCustom::applyValueFontSize):
3348         (WebCore::Style::BuilderCustom::applyInitialGridTemplateAreas):
3349         (WebCore::Style::BuilderCustom::applyInheritGridTemplateAreas):
3350         (WebCore::Style::BuilderCustom::applyValueGridTemplateAreas):
3351         (WebCore::Style::BuilderCustom::applyInitialGridTemplateColumns):
3352         (WebCore::Style::BuilderCustom::applyInheritGridTemplateColumns):
3353         (WebCore::Style::BuilderCustom::applyValueGridTemplateColumns):
3354         (WebCore::Style::BuilderCustom::applyInitialGridTemplateRows):
3355         (WebCore::Style::BuilderCustom::applyInheritGridTemplateRows):
3356         (WebCore::Style::BuilderCustom::applyValueGridTemplateRows):
3357         (WebCore::Style::BuilderCustom::applyValueAlt):
3358         (WebCore::Style::BuilderCustom::applyValueWillChange):
3359         (WebCore::Style::BuilderCustom::applyValueStrokeWidth):
3360         (WebCore::Style::BuilderCustom::applyValueStrokeColor):
3361         (WebCore::Style::BuilderCustom::applyInitialCustomProperty):
3362         (WebCore::Style::BuilderCustom::applyInheritCustomProperty):
3363         (WebCore::Style::BuilderCustom::applyValueCustomProperty):
3364         * style/StyleBuilderGenerated.h: Added.
3365
3366 2019-10-31  Antoine Quint  <graouts@apple.com>
3367
3368         [Web Animations] Add support for AnimationEvent.pseudoElement
3369         https://bugs.webkit.org/show_bug.cgi?id=203671
3370
3371         Reviewed by Dean Jackson.
3372
3373         * animation/DeclarativeAnimation.cpp:
3374         (WebCore::DeclarativeAnimation::enqueueDOMEvent):
3375         * dom/AnimationEvent.cpp:
3376         (WebCore::AnimationEvent::AnimationEvent):
3377         (WebCore::AnimationEvent::pseudoElement const):
3378         * dom/AnimationEvent.h:
3379         * dom/AnimationEvent.idl:
3380         * dom/WebKitAnimationEvent.cpp:
3381         (WebCore::WebKitAnimationEvent::WebKitAnimationEvent):
3382         (WebCore::WebKitAnimationEvent::pseudoElement const):
3383         * dom/WebKitAnimationEvent.h:
3384         * dom/WebKitAnimationEvent.idl:
3385         * page/animation/CSSAnimationController.cpp:
3386         (WebCore::CSSAnimationControllerPrivate::fireEventsAndUpdateStyle):
3387
3388 2019-10-31  Antoine Quint  <graouts@apple.com>
3389
3390         [Web Animations] transform property is always "none" for getKeyframes() output of a CSS Animation
3391         https://bugs.webkit.org/show_bug.cgi?id=203669
3392
3393         Reviewed by Dean Jackson.
3394
3395         Calling valueForPropertyInStyle() with CSSPropertyTransform will eventually call into computedTransform()
3396         which requires a renderer. Note that right now we're returning the computed style instead of the parsed
3397         style, this will be addressed in a separate patch.
3398
3399         * animation/KeyframeEffect.cpp: