WebCore: Guard uneven corners in rounded rectangles
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2020-01-28  Jonathan Bedard  <jbedard@apple.com>
2
3         WebCore: Guard uneven corners in rounded rectangles
4         https://bugs.webkit.org/show_bug.cgi?id=206838
5
6         Reviewed by Darin Adler.
7
8         No functional changes, covered by existing tests.
9
10         * platform/graphics/cg/PathCG.cpp:
11         (WebCore::Path::platformAddPathForRoundedRect):
12
13 2020-01-28  Commit Queue  <commit-queue@webkit.org>
14
15         Unreviewed, rolling out r255237.
16         https://bugs.webkit.org/show_bug.cgi?id=206889
17
18         it is breaking Win build (Requested by youenn on #webkit).
19
20         Reverted changeset:
21
22         "Blob media loading does not work with GPUProcess"
23         https://bugs.webkit.org/show_bug.cgi?id=206824
24         https://trac.webkit.org/changeset/255237
25
26 2020-01-28  Jack Lee  <shihchieh_lee@apple.com>
27
28         Nullptr crash in WebCore::findPlaceForCounter with display: contents sibling
29         https://bugs.webkit.org/show_bug.cgi?id=206107
30
31         Reviewed by Antti Koivisto.
32
33         Test: fast/css/counters/findPlaceForCounter-display-content-sibling-crash.html
34
35         * rendering/RenderCounter.cpp:
36         (WebCore::parentOrPseudoHostElement):
37         (WebCore::previousSiblingOrParentElement):
38         (WebCore::previousSiblingOrParent):
39
40 2020-01-24  Sergio Villar Senin  <svillar@igalia.com>
41
42         Remove WebVR from the tree
43         https://bugs.webkit.org/show_bug.cgi?id=206739
44
45         Reviewed by Darin Adler.
46
47         WebVR 1.1 was never completely implemented, it was just included as build option of
48         WebKitGTK and WPE, and it was never released by any WebKit port either. There are no plans
49         to work on it as it has been replaced by the WebXR specification.
50
51         * CMakeLists.txt:
52         * DerivedSources-input.xcfilelist:
53         * DerivedSources-output.xcfilelist:
54         * DerivedSources.make:
55         * Modules/webvr/DOMWindowWebVR.idl: Removed.
56         * Modules/webvr/GamepadWebVR.cpp: Removed.
57         * Modules/webvr/GamepadWebVR.h: Removed.
58         * Modules/webvr/GamepadWebVR.idl: Removed.
59         * Modules/webvr/NavigatorWebVR.cpp: Removed.
60         * Modules/webvr/NavigatorWebVR.h: Removed.
61         * Modules/webvr/NavigatorWebVR.idl: Removed.
62         * Modules/webvr/VRDisplay.cpp: Removed.
63         * Modules/webvr/VRDisplay.h: Removed.
64         * Modules/webvr/VRDisplay.idl: Removed.
65         * Modules/webvr/VRDisplayCapabilities.h: Removed.
66         * Modules/webvr/VRDisplayCapabilities.idl: Removed.
67         * Modules/webvr/VRDisplayEvent.cpp: Removed.
68         * Modules/webvr/VRDisplayEvent.h: Removed.
69         * Modules/webvr/VRDisplayEvent.idl: Removed.
70         * Modules/webvr/VRDisplayEventReason.h: Removed.
71         * Modules/webvr/VRDisplayEventReason.idl: Removed.
72         * Modules/webvr/VREye.h: Removed.
73         * Modules/webvr/VREye.idl: Removed.
74         * Modules/webvr/VREyeParameters.cpp: Removed.
75         * Modules/webvr/VREyeParameters.h: Removed.
76         * Modules/webvr/VREyeParameters.idl: Removed.
77         * Modules/webvr/VRFieldOfView.h: Removed.
78         * Modules/webvr/VRFieldOfView.idl: Removed.
79         * Modules/webvr/VRFrameData.cpp: Removed.
80         * Modules/webvr/VRFrameData.h: Removed.
81         * Modules/webvr/VRFrameData.idl: Removed.
82         * Modules/webvr/VRLayerInit.h: Removed.
83         * Modules/webvr/VRLayerInit.idl: Removed.
84         * Modules/webvr/VRPose.cpp: Removed.
85         * Modules/webvr/VRPose.h: Removed.
86         * Modules/webvr/VRPose.idl: Removed.
87         * Modules/webvr/VRStageParameters.cpp: Removed.
88         * Modules/webvr/VRStageParameters.h: Removed.
89         * Modules/webvr/VRStageParameters.idl: Removed.
90         * Sources.txt:
91         * WebCore.xcodeproj/project.pbxproj:
92         * bindings/js/WebCoreBuiltinNames.h:
93         * dom/EventNames.in:
94         * dom/EventTargetFactory.in:
95         * features.json:
96         * page/RuntimeEnabledFeatures.h:
97         (WebCore::RuntimeEnabledFeatures::setWebVREnabled): Deleted.
98         (WebCore::RuntimeEnabledFeatures::webVREnabled const): Deleted.
99         * platform/vr/VRManager.cpp: Removed.
100         * platform/vr/VRManager.h: Removed.
101         * platform/vr/VRPlatformDisplay.cpp: Removed.
102         * platform/vr/VRPlatformDisplay.h: Removed.
103         * platform/vr/VRPlatformDisplayClient.h: Removed.
104         * platform/vr/VRPlatformManager.h: Removed.
105         * platform/vr/openvr/VRPlatformDisplayOpenVR.cpp: Removed.
106         * platform/vr/openvr/VRPlatformDisplayOpenVR.h: Removed.
107         * platform/vr/openvr/VRPlatformManagerOpenVR.cpp: Removed.
108         * platform/vr/openvr/VRPlatformManagerOpenVR.h: Removed.
109         * testing/InternalSettings.cpp:
110         (WebCore::InternalSettings::Backup::Backup):
111         (WebCore::InternalSettings::Backup::restoreTo):
112         (WebCore::InternalSettings::setWebVREnabled): Deleted.
113         * testing/InternalSettings.h:
114         * testing/InternalSettings.idl:
115
116 2020-01-28  youenn fablet  <youenn@apple.com>
117
118         Blob media loading does not work with GPUProcess
119         https://bugs.webkit.org/show_bug.cgi?id=206824
120         <rdar://problem/58917596>
121
122         Reviewed by Eric Carlson.
123
124         GPU process is using WebCoreAVFResourceLoader for various loads, including blob loads.
125         In GPU process, loads will fail since this loader expects a CachedResource, which only WebProcess can have.
126         For that reason, move the CachedResource loader part of WebCoreAVFResourceLoader to a dedicated class CachedResourceMediaLoader.
127         If load cannot happen with a CachedResource, use a new class PlatformResourceMediaLoader, which uses a loader from MediaPlayer::createResourceLoader.
128         This allows using the loading path in GPUProcess used for HTTP loads, which works for blob loads as well.
129
130         Covered by existing and enabled tests.
131
132         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.h:
133         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
134         (WebCore::CachedResourceMediaLoader::~CachedResourceMediaLoader):
135         (WebCore::CachedResourceMediaLoader::create):
136         (WebCore::CachedResourceMediaLoader::CachedResourceMediaLoader):
137         (WebCore::CachedResourceMediaLoader::stop):
138         (WebCore::CachedResourceMediaLoader::responseReceived):
139         (WebCore::CachedResourceMediaLoader::notifyFinished):
140         (WebCore::CachedResourceMediaLoader::dataReceived):
141         (WebCore::PlatformResourceMediaLoader::~PlatformResourceMediaLoader):
142         (WebCore::PlatformResourceMediaLoader::create):
143         (WebCore::PlatformResourceMediaLoader::PlatformResourceMediaLoader):
144         (WebCore::PlatformResourceMediaLoader::stop):
145         (WebCore::PlatformResourceMediaLoader::responseReceived):
146         (WebCore::PlatformResourceMediaLoader::loadFailed):
147         (WebCore::PlatformResourceMediaLoader::loadFinished):
148         (WebCore::PlatformResourceMediaLoader::dataReceived):
149         (WebCore::WebCoreAVFResourceLoader::startLoading):
150         (WebCore::WebCoreAVFResourceLoader::stopLoading):
151         (WebCore::WebCoreAVFResourceLoader::responseReceived):
152         (WebCore::WebCoreAVFResourceLoader::loadFailed):
153         (WebCore::WebCoreAVFResourceLoader::loadFinished):
154         (WebCore::WebCoreAVFResourceLoader::newDataStoredInSharedBuffer):
155
156 2020-01-27  Antoine Quint  <graouts@apple.com>
157
158         [Web Animations] Make Animation.timeline read-write only if a runtime flag is enabled
159         https://bugs.webkit.org/show_bug.cgi?id=206173
160         <rdar://problem/58527432>
161
162         Reviewed by Dean Jackson.
163
164         Make the timeline property of Animation read-write only if the new WebAnimationsMutableTimelines runtime flag is enabled.
165
166         * animation/WebAnimation.idl: Make the "timeline" property conditionally read-write if WebAnimationsMutableTimelines is enabled.
167         * bindings/js/WebCoreBuiltinNames.h: With the new RuntimeConditionallyReadWrite property used in WebAnimation.idl, it is necessary
168         to declare the name of the affected property, in this case "timeline", in WebCoreBuiltinNames.
169         * page/RuntimeEnabledFeatures.h:
170         (WebCore::RuntimeEnabledFeatures::setWebAnimationsMutableTimelinesEnabled):
171         (WebCore::RuntimeEnabledFeatures::webAnimationsMutableTimelinesEnabled const):
172
173 2020-01-27  Noam Rosenthal  <noam@webkit.org>
174
175         -webkit-image-set should support resolution units other than 'x'
176         https://bugs.webkit.org/show_bug.cgi?id=100120
177
178         Reviewed by Darin Adler.
179
180         Leveraged previous work on image-resolution to enable dpi/dppx/dpcm in CSS image-set.
181         Now the second value of every entry in the image-set is parsed like any resolution,
182         allowing "x" as a synonim for "dppx.
183
184         This changes computed style behavior for image-set - "x" resolution values will be converted
185         to "dppx". This is in line with the spirit of computed values, though it's not spec'ed particularly.
186
187         Tests: fast/hidpi/image-set-units.html
188
189         * css/CSSImageSetValue.cpp:
190         (WebCore::CSSImageSetValue::fillImageSet):
191         (WebCore::CSSImageSetValue::updateDeviceScaleFactor):
192         (WebCore::CSSImageSetValue::customCSSText const):
193                 Convert values to dppx before sorting them the image set.
194                 Use given CSS units in computed styles instead of hardcoding "x" 
195
196         * css/CSSPrimitiveValue.cpp:
197         (WebCore::isValidCSSUnitTypeForDoubleConversion):
198         (WebCore::CSSPrimitiveValue::conversionToCanonicalUnitsScaleFactor):
199                 Allow conversion of dpi/dppx/dpcm to canonical (dppx).
200
201         * css/parser/CSSPropertyParserHelpers.cpp:
202         (WebCore::CSSPropertyParserHelpers::consumeResolution):
203         (WebCore::CSSPropertyParserHelpers::consumeImageSet):
204         * css/parser/CSSPropertyParserHelpers.h:
205                 Consume any resolution when parsing image-set.
206
207 2020-01-27  Antti Koivisto  <antti@apple.com>
208
209         Correct VTT Cue Style handling to match the specification
210         https://bugs.webkit.org/show_bug.cgi?id=201086
211
212         Unreviewed followup based on a review comment.
213
214         * html/track/WebVTTParser.cpp:
215         (WebCore::WebVTTParser::checkAndStoreStyleSheet):
216
217 2020-01-27  Simon Fraser  <simon.fraser@apple.com>
218
219         REGRESSION (r253634): cricbuzz.com media controls vanish depending on page scale
220         https://bugs.webkit.org/show_bug.cgi?id=206788
221         rdar://problem/58780584
222
223         Reviewed by Tim Horton.
224         
225         r253634 changed "delegatesPageScaling"'" to a flag on ScrollView. However, this changed behavior
226         for subframes; Settings are propagated down, but only the main ScrollView had delegatesPageScaling
227         set on it.
228         
229         "delegatesPageScaling" is a page-level thing (subframes don't independently zoom), so it
230         should live on Page. Move it there.
231         
232         The bug was triggered by incorrectly taking page scale into account for rects in the compositing
233         overlap map (see RenderLayerCompositor::addToOverlapMap()) in subframes, and those rects
234         changing on zoom.
235
236         Test: compositing/backing/page-scale-overlap-in-iframe.html
237
238         * page/Frame.cpp:
239         (WebCore::Frame::frameScaleFactor const):
240         * page/FrameSnapshotting.cpp:
241         (WebCore::snapshotFrameRectWithClip):
242         * page/FrameView.cpp:
243         (WebCore::FrameView::visibleContentScaleFactor const):
244         * page/Page.cpp:
245         (WebCore::Page::setPageScaleFactor):
246         (WebCore::Page::setDelegatesScaling):
247         * page/Page.h:
248         (WebCore::Page::delegatesScaling const):
249         * platform/ScrollView.cpp:
250         (WebCore::ScrollView::setDelegatesPageScaling): Deleted.
251         * platform/ScrollView.h:
252         (WebCore::ScrollView::delegatesPageScaling const): Deleted.
253         * rendering/RenderLayerCompositor.cpp:
254         (WebCore::RenderLayerCompositor::addToOverlapMap const):
255
256 2020-01-27  Sam Weinig  <weinig@apple.com>
257
258         Need a way to mark a DOM attribute as runtime conditionally read-write
259         https://bugs.webkit.org/show_bug.cgi?id=206836
260
261         Reviewed by Chris Dumez.
262
263         Adds a new IDL extended attribute, RuntimeConditionallyReadWrite, that works
264         like EnableAtRuntime, but instead allows the associated attribute to be
265         converted from read-only to read-write based on the value of a RuntimeEnabledFeature.
266
267         * bindings/scripts/CodeGeneratorJS.pm:
268         (GeneratePropertiesHashTable): 
269         Add check that both runtime enabling and runtime conditional read-write aren't
270         both specified. For now, that is not supported.
271
272         (GenerateRuntimeEnableConditionalString):
273         Add support for generating the conditional string for RuntimeConditionallyReadWrite.
274
275         (GenerateImplementation):
276         Implement the feature by piggy-backing off the existing runtime enabling, which
277         deletes the property if the feature is not enabled. For this, if the feature isn't
278         enabled, we delete the property, and then add it back readonly. In the future, we
279         should move off of this add-then-delete model, but that is tracked via http://webkit.org/b/206837.
280         
281         * bindings/scripts/IDLAttributes.json:
282         Add new extended attribute.
283
284         * bindings/scripts/test/JS/JSTestObj.cpp:
285         (WebCore::JSTestObjPrototype::finishCreation):
286         (WebCore::jsTestObjRuntimeConditionallyReadWriteAttributeGetter):
287         (WebCore::jsTestObjRuntimeConditionallyReadWriteAttribute):
288         (WebCore::setJSTestObjRuntimeConditionallyReadWriteAttributeSetter):
289         (WebCore::setJSTestObjRuntimeConditionallyReadWriteAttribute):
290         * bindings/scripts/test/TestObj.idl:
291         Add new test with result.
292
293 2020-01-27  Devin Rousso  <drousso@apple.com>
294
295         Unreviewed, speculative win build fix after r255191
296
297         * bindings/js/ScriptController.h:
298         * testing/Internals.cpp:
299         (WebCore::Internals::evaluateInWorldIgnoringException):
300         Don't use the `ScriptSourceCode` so we don't have to export its symbol.
301
302 2020-01-27  Jonathan Bedard  <jbedard@apple.com>
303
304         WebCore: Remove iOS 11 macros from RenderThemeIOS.mm
305         https://bugs.webkit.org/show_bug.cgi?id=206787
306
307         Reviewed by Darin Adler.
308
309         No functional changes, covered by existing tests.
310
311         * rendering/RenderThemeIOS.mm:
312         (WebCore::RenderThemeIOS::cachedSystemFontDescription const):
313         (WebCore::RenderThemeIOS::updateCachedSystemFontDescription const):
314
315 2020-01-27  Devin Rousso  <drousso@apple.com>
316
317         Unreviewed, speculative win build fix after r255191
318
319         * inspector/agents/page/PageRuntimeAgent.cpp:
320         Add missing include.
321
322 2020-01-27  Chris Dumez  <cdumez@apple.com>
323
324         Unreviewed build fix after r255167.
325
326         * accessibility/isolatedtree/AXIsolatedObject.cpp:
327         (WebCore::AXIsolatedObject::detachRemoteParts):
328
329 2020-01-27  Devin Rousso  <drousso@apple.com>
330
331         Web Inspector: unable to evaluate in the isolated world of content scripts injected by safari app extensions
332         https://bugs.webkit.org/show_bug.cgi?id=206110
333         <rdar://problem/16945643>
334
335         Reviewed by Timothy Hatcher, Joseph Pecoraro, and Brian Burg.
336
337         In addition to evaluating in subframe execution contexts, add the ability for Web Inspector
338         to evaluate in non-normal isolated worlds.
339
340         Test: inspector/runtime/executionContextCreated-isolated-world.html
341
342         * bindings/js/DOMWrapperWorld.h:
343         (WebCore::DOMWrapperWorld::create):
344         (WebCore::DOMWrapperWorld::type const): Added.
345         (WebCore::DOMWrapperWorld::isNormal const):
346         (WebCore::DOMWrapperWorld::name const): Added.
347         * bindings/js/DOMWrapperWorld.cpp:
348         (WebCore::DOMWrapperWorld::DOMWrapperWorld):
349         * bindings/js/ScriptController.h:
350         * bindings/js/ScriptController.cpp:
351         (WebCore::ScriptController::createWorld):
352         * bindings/js/WebCoreJSClientData.cpp:
353         (WebCore::JSVMClientData::initNormalWorld):
354         Require that a name is specified when creating an isolated world (except the normal world)
355         so that Web Inspector has something to show in the execution context picker.
356
357         * inspector/InspectorInstrumentation.cpp:
358         (WebCore::InspectorInstrumentation::didClearWindowObjectInWorldImpl):
359         * inspector/agents/InspectorPageAgent.h:
360         * inspector/agents/InspectorPageAgent.cpp:
361         (WebCore::InspectorPageAgent::didClearWindowObjectInWorld):
362         * inspector/agents/page/PageDebuggerAgent.h:
363         * inspector/agents/page/PageDebuggerAgent.cpp:
364         (WebCore::PageDebuggerAgent::didClearWindowObjectInWorld):
365         * inspector/agents/page/PageRuntimeAgent.h:
366         * inspector/agents/page/PageRuntimeAgent.cpp:
367         (WebCore::PageRuntimeAgent::didClearWindowObjectInWorld):
368         (WebCore::PageRuntimeAgent::reportExecutionContextCreation):
369         (WebCore::toProtocol): Added.
370         (WebCore::PageRuntimeAgent::notifyContextCreated):
371         Allow this instrumentation call to pass through to the agents for non-`Normal` worlds.
372
373         * html/HTMLMediaElement.cpp:
374         (WebCore::HTMLMediaElement::ensureIsolatedWorld):
375         * html/HTMLPlugInImageElement.cpp:
376         (WebCore::plugInImageElementIsolatedWorld):
377         * Modules/plugins/QuickTimePluginReplacement.mm:
378         (WebCore::QuickTimePluginReplacement::isolatedWorld):
379         Mark these worlds as `Internal`.
380
381         * testing/Internals.idl:
382         * testing/Internals.h:
383         * testing/Internals.cpp:
384         (WebCore::Internals::evaluateInWorldIgnoringException): Added.
385
386 2020-01-27  Peng Liu  <peng.liu6@apple.com>
387
388         Crash in WebCore::HTMLMediaElement::detachMediaSource()
389         https://bugs.webkit.org/show_bug.cgi?id=206766
390
391         Reviewed by Jer Noble.
392
393         Use WeakPtr<HTMLMediaElement> in MediaSource instead of a raw pointer.
394         In addition, we need to detach a MediaSource from an HTMLMediaElement before the HTMLMediaElement forgets the reference to the MediaSource.
395
396         * Modules/mediasource/MediaSource.cpp:
397         (WebCore::MediaSource::attachToElement):
398         * Modules/mediasource/MediaSource.h:
399         * html/HTMLMediaElement.cpp:
400         (WebCore::HTMLMediaElement::loadResource):
401
402 2020-01-27  Andres Gonzalez  <andresg_22@apple.com>
403
404         Crash in AXIsolatedObject destruction.
405         https://bugs.webkit.org/show_bug.cgi?id=206828
406
407         Reviewed by Chris Fleizach.
408
409         - The previous AXCoreObject::detach method became detachRemoteParts,
410         since this method detaches all references to and from other objects.
411         - The new AXCoreObject::detach method performs three distinctive
412         operations:
413         1. Detaches the platform wrapper.
414         2. Detaches all remote references to and from other objects.
415         3. Sets the object ID to InvalidAXID.
416         - The detachPlatformWrapper method allows for platform-specific
417         customizations.
418         - Added accessibility/isolatedtree/mac/AXIsolatedobject.mm.
419
420         * PlatformMac.cmake:
421         * SourcesCocoa.txt:
422         * WebCore.xcodeproj/project.pbxproj:
423         * accessibility/AXObjectCache.cpp:
424         (WebCore::AXObjectCache::~AXObjectCache):
425         (WebCore::AXObjectCache::remove):
426         * accessibility/AXObjectCache.h:
427         * accessibility/AccessibilityNodeObject.cpp:
428         (WebCore::AccessibilityNodeObject::detachRemoteParts):
429         (WebCore::AccessibilityNodeObject::detach): Became detachRemoteParts.
430         * accessibility/AccessibilityNodeObject.h:
431         * accessibility/AccessibilityObject.cpp:
432         (WebCore::AccessibilityObject::detachRemoteParts):
433         (WebCore::AccessibilityObject::detach): Became detachRemoteParts.
434         * accessibility/AccessibilityObject.h:
435         * accessibility/AccessibilityObjectInterface.h:
436         (WebCore::AXCoreObject::detachWrapper):
437         (WebCore::AXCoreObject::detach):
438         * accessibility/AccessibilityRenderObject.cpp:
439         (WebCore::AccessibilityRenderObject::detachRemoteParts):
440         (WebCore::AccessibilityRenderObject::detach): Became detachRemoteParts.
441         * accessibility/AccessibilityRenderObject.h:
442         * accessibility/AccessibilityScrollView.cpp:
443         (WebCore::AccessibilityScrollView::detachRemoteParts):
444         (WebCore::AccessibilityScrollView::detach): Became detachRemoteParts.
445         * accessibility/AccessibilityScrollView.h:
446         * accessibility/atk/AccessibilityObjectAtk.cpp:
447         (WebCore::AccessibilityObject::detachPlatformWrapper):
448         * accessibility/ios/AXObjectCacheIOS.mm:
449         (WebCore::AXObjectCache::detachWrapper): Deleted, no longer used in COCOA platforms.
450         * accessibility/ios/AccessibilityObjectIOS.mm:
451         (WebCore::AccessibilityObject::detachPlatformWrapper):
452         * accessibility/isolatedtree/AXIsolatedObject.cpp:
453         (WebCore::AXIsolatedObject::detachRemoteParts):
454         (WebCore::AXIsolatedObject::detach): Became detachRemoteParts.
455         (WebCore::AXIsolatedObject::disconnect): Replaced with AXCoreObject::detach.
456         * accessibility/isolatedtree/AXIsolatedObject.h:
457         * accessibility/isolatedtree/AXIsolatedTree.cpp:
458         (WebCore::AXIsolatedTree::removeTreeForPageID):
459         (WebCore::AXIsolatedTree::applyPendingChanges):
460         * accessibility/isolatedtree/mac/AXIsolatedObjectMac.mm:
461         (WebCore::AXIsolatedObject::detachPlatformWrapper):
462         * accessibility/mac/AXObjectCacheMac.mm:
463         (WebCore::AXObjectCache::detachWrapper): Deleted, no longer used in COCOA platforms.
464         * accessibility/mac/AccessibilityObjectMac.mm:
465         (WebCore::AccessibilityObject::detachPlatformWrapper):
466         * accessibility/win/AccessibilityObjectWin.cpp:
467         (WebCore::AccessibilityObject::detachPlatformWrapper):
468
469 2020-01-27  Ryan Haddad  <ryanhaddad@apple.com>
470
471         Unreviewed, rolling out r255161.
472
473         Broke the watchOS build.
474
475         Reverted changeset:
476
477         "Crash in WebCore::HTMLMediaElement::detachMediaSource()"
478         https://bugs.webkit.org/show_bug.cgi?id=206766
479         https://trac.webkit.org/changeset/255161
480
481 2020-01-27  Jer Noble  <jer.noble@apple.com>
482
483         Support 'allow="fullscreen"' feature policy
484         https://bugs.webkit.org/show_bug.cgi?id=206806
485         <rdar://problem/55640448>
486
487         Reviewed by Youenn Fablet.
488
489         Test: http/tests/fullscreen/fullscreen-feature-policy.html
490
491         The unprefixed version of the Fullscreen API has deprecated the 'allowfullscreen' iframe
492         attribute in favor of the 'allow="fullscreen"' style attribute used by Feature Policy.
493         Add support for such, including the specified handling for the legacy 'allowfullscreen'
494         attribute.
495
496         Note: this patch will (intentionally) change the default behavior of <iframe>s. Previously
497         any <iframe> without the "allowfullscreen" attribute would not be allowed to enter fullscreen
498         mode. After this patch, <iframes> without the legacy attribute or an explicit fullscreen
499         Feature Policy will be allowed to enter fullscreen so long as their origin is the same as
500         the top document (and that all parent iframes are also allowed to enter fullscreen).
501
502         * dom/FullscreenManager.cpp:
503         (WebCore::FullscreenManager::requestFullscreenForElement):
504         (WebCore::FullscreenManager::isFullscreenEnabled const):
505         (WebCore::isAttributeOnAllOwners): Deleted.
506         (WebCore::FullscreenManager::fullscreenIsAllowedForElement const): Deleted.
507         * dom/FullscreenManager.h:
508         * html/FeaturePolicy.cpp:
509         (WebCore::isFeaturePolicyAllowedByDocumentAndAllOwners):
510         (WebCore::FeaturePolicy::parse):
511         (WebCore::FeaturePolicy::allows const):
512         * html/FeaturePolicy.h:
513         * html/HTMLIFrameElement.cpp:
514         (WebCore::HTMLIFrameElement::parseAttribute):
515         (WebCore::HTMLIFrameElement::featurePolicy const):
516         * xml/XMLHttpRequest.cpp:
517         (WebCore::XMLHttpRequest::createRequest):
518         (WebCore::isSyncXHRAllowedByFeaturePolicy): Deleted.
519
520 2020-01-27  Peng Liu  <peng.liu6@apple.com>
521
522         Crash in WebCore::HTMLMediaElement::detachMediaSource()
523         https://bugs.webkit.org/show_bug.cgi?id=206766
524
525         Reviewed by Jer Noble.
526
527         Use WeakPtr<HTMLMediaElement> in MediaSource instead of a raw pointer.
528         In addition, we need to detach a MediaSource from an HTMLMediaElement before the HTMLMediaElement forgets the reference to the MediaSource.
529
530         * Modules/mediasource/MediaSource.cpp:
531         (WebCore::MediaSource::attachToElement):
532         * Modules/mediasource/MediaSource.h:
533         * html/HTMLMediaElement.cpp:
534         (WebCore::HTMLMediaElement::loadResource):
535
536 2020-01-27  Said Abou-Hallawa  <sabouhallawa@apple.com>
537
538         Throttling requestAnimationFrame should be controlled by RenderingUpdateScheduler
539         https://bugs.webkit.org/show_bug.cgi?id=204713
540
541         Reviewed by Simon Fraser.
542
543         Test: fast/animation/request-animation-frame-throttling-outside-viewport.html
544
545         requestAnimationFrame is throttled by a timer although its callback are
546         serviced by the page RenderingUpdate. This led to excessive rAF firing
547         which makes it more than the preferred frame per seconds.
548
549         The solution is to have two throttling types:
550
551         1) Page throttling (or full throttling) which slows down all the steps of
552            RenderingUpdate for the main document and all the sub-documents.
553         2) Document throttling (or partial throttling) which only slows down the
554            rAF of a certain document.
555
556         * Headers.cmake:
557         * WebCore.xcodeproj/project.pbxproj:
558
559         * animation/DocumentTimeline.cpp:
560         (WebCore::DocumentTimeline::animationInterval const):
561         (WebCore::DocumentTimeline::updateThrottlingState): Deleted.
562         * animation/DocumentTimeline.h:
563         There is no need to have DocumentTimeline throttling. It is already 
564         throttled when the page RenderingUpdate is throttled.
565
566         * dom/Document.cpp:
567         (WebCore::Document::requestAnimationFrame):
568         (WebCore::Document::updateLastHandledUserGestureTimestamp):
569         LowPowerMode throttling is now handled by the page. So remove its handling
570         in the Document side.
571
572         * dom/ScriptedAnimationController.cpp:
573         (WebCore::ScriptedAnimationController::ScriptedAnimationController):
574         (WebCore::ScriptedAnimationController::page const):
575         (WebCore::ScriptedAnimationController::preferredScriptedAnimationInterval const):
576         (WebCore::ScriptedAnimationController::interval const):
577         (WebCore::ScriptedAnimationController::isThrottled const):
578         (WebCore::ScriptedAnimationController::isThrottledRelativeToPage const):
579         (WebCore::ScriptedAnimationController::shouldRescheduleRequestAnimationFrame const):
580         (WebCore::ScriptedAnimationController::registerCallback):
581         (WebCore::ScriptedAnimationController::cancelCallback):
582         (WebCore::ScriptedAnimationController::serviceRequestAnimationFrameCallbacks):
583         (WebCore::ScriptedAnimationController::scheduleAnimation):
584         (WebCore::throttlingReasonToString): Deleted.
585         (WebCore::throttlingReasonsToString): Deleted.
586         (WebCore::ScriptedAnimationController::addThrottlingReason): Deleted.
587         (WebCore::ScriptedAnimationController::removeThrottlingReason): Deleted.
588         (WebCore::ScriptedAnimationController::animationTimerFired): Deleted.
589         * dom/ScriptedAnimationController.h:
590         (WebCore::ScriptedAnimationController::addThrottlingReason):
591         (WebCore::ScriptedAnimationController::removeThrottlingReason):
592         Get rid of the rAF throttling timer. Service the rAF callback only when
593         the period from the current time stamp till the last service time stamp
594         is greater than the preferred rAF interval .
595
596         * page/FrameView.cpp:
597         (WebCore::FrameView::updateScriptedAnimationsAndTimersThrottlingState):
598         ThrottlingReason is now defined outside ScriptedAnimationController.
599
600         * page/Page.cpp:
601         (WebCore::Page::renderingUpdateThrottlingEnabled const):
602         (WebCore::Page::renderingUpdateThrottlingEnabledChanged):
603         (WebCore::Page::isRenderingUpdateThrottled const):
604
605         (WebCore::Page::preferredRenderingUpdateInterval const):
606         Calculate the preferred RenderingUpdate interval from the throttling
607         reasons.
608
609         (WebCore::Page::setIsVisuallyIdleInternal):
610         (WebCore::Page::handleLowModePowerChange):
611         Call adjustRenderingUpdateFrequency() when isLowPowerModeEnabled or 
612         IsVisuallyIdle is toggled.
613
614         (WebCore::updateScriptedAnimationsThrottlingReason): Deleted.
615         * page/Page.h:
616
617         * page/RenderingUpdateScheduler.cpp:
618         (WebCore::RenderingUpdateScheduler::adjustFramesPerSecond):
619         (WebCore::RenderingUpdateScheduler::adjustRenderingUpdateFrequency):
620         Change the preferredFramesPerSecond of the DisplayRefreshMonitor if the
621         throttling is not aggressive e.g. 10_s. Otherwise use the timer.
622
623         (WebCore::RenderingUpdateScheduler::scheduleTimedRenderingUpdate):
624         Call adjustFramesPerSecond() when DisplayRefreshMonitor is created.
625
626         (WebCore::RenderingUpdateScheduler::startTimer):
627         * page/RenderingUpdateScheduler.h:
628
629         * page/Settings.yaml:
630         * page/SettingsBase.cpp:
631         (WebCore::SettingsBase::renderingUpdateThrottlingEnabledChanged):
632         * page/SettingsBase.h:
633         Add a setting to enable/disable RenderingUpdateThrottling.
634
635         * platform/graphics/AnimationFrameRate.h: Added.
636         (WebCore::preferredFrameInterval):
637         (WebCore::preferredFramesPerSecond):
638
639         * platform/graphics/DisplayRefreshMonitor.h:
640         (WebCore::DisplayRefreshMonitor::setPreferredFramesPerSecond):
641         * platform/graphics/DisplayRefreshMonitorManager.cpp:
642         (WebCore::DisplayRefreshMonitorManager::monitorForClient):
643         Rename createMonitorForClient() to monitorForClient() since it may return
644         a cached DisplayRefreshMonitor.
645
646         (WebCore::DisplayRefreshMonitorManager::setPreferredFramesPerSecond):
647         (WebCore::DisplayRefreshMonitorManager::scheduleAnimation):
648         (WebCore::DisplayRefreshMonitorManager::windowScreenDidChange):
649         No need to call registerClient(). This function was just ensuring the
650         DisplayRefreshMonitor is created. scheduleAnimation() does the same thing.
651
652         (WebCore::DisplayRefreshMonitorManager::createMonitorForClient): Deleted.
653         (WebCore::DisplayRefreshMonitorManager::registerClient): Deleted.
654         * platform/graphics/DisplayRefreshMonitorManager.h:
655         (WebCore::DisplayRefreshMonitorManager::DisplayRefreshMonitorManager): Deleted.
656
657         * platform/graphics/GraphicsLayerUpdater.cpp:
658         (WebCore::GraphicsLayerUpdater::GraphicsLayerUpdater):
659         * platform/graphics/ios/DisplayRefreshMonitorIOS.mm:
660         (-[WebDisplayLinkHandler setPreferredFramesPerSecond:]):
661         Set the preferredFramesPerSecond of the CADisplayLink.
662
663 2020-01-27  Antti Koivisto  <antti@apple.com>
664
665         Correct VTT Cue Style handling to match the specification
666         https://bugs.webkit.org/show_bug.cgi?id=201086
667         <rdar://problem/54658121>
668
669         Reviewed by Brent Fulgham.
670
671         The VTT specification requires that only data-URLs are permitted in STYLE blocks.
672
673         * css/CSSSelector.cpp:
674         (WebCore::CSSSelector::selectorText const):
675
676         Fix selectorText for function version of ::cue().
677
678         * css/parser/CSSParserContext.cpp:
679         (WebCore::CSSParserContext::completeURL const):
680
681         Don't allow non-data URLs in WebVTT parser mode.
682
683         * css/parser/CSSParserContext.h:
684         (WebCore::CSSParserContext::completeURL const): Deleted.
685         * css/parser/CSSParserMode.h:
686         (WebCore::isStrictParserMode):
687         * html/track/WebVTTParser.cpp:
688         (WebCore::WebVTTParser::collectStyleSheet):
689         (WebCore::WebVTTParser::checkAndStoreStyleSheet):
690
691         Instead of simply validating the original stylesheet, build a new sanitized stylesheet text
692         from the stylesheet parsed in WebVTT mode. This sanitized stylesheet is then used as the
693         input for the style system.
694
695         * html/track/WebVTTParser.h:
696
697 2020-01-27  Ryan Haddad  <ryanhaddad@apple.com>
698
699         Unreviewed, rolling out r255131.
700
701         Caused assertion failures on iOS debug bots.
702
703         Reverted changeset:
704
705         "Throttling requestAnimationFrame should be controlled by
706         RenderingUpdateScheduler"
707         https://bugs.webkit.org/show_bug.cgi?id=204713
708         https://trac.webkit.org/changeset/255131
709
710 2020-01-27  Antoine Quint  <graouts@apple.com>
711
712         [Web Animations] Add support for the options parameter to getAnimations()
713         https://bugs.webkit.org/show_bug.cgi?id=202191
714         <rdar://problem/55697751>
715
716         Reviewed by Antti Koivisto.
717
718         Add support for the GetAnimationsOptions dictionary as a parameter to Animatable.getAnimations(). When it is provided
719         and has its sole "subtree" property set to "true", we call Document.getAnimations() and filter out animations that are
720         not targeting elements that are either this element, one of its descendants, one of its pseudo-elements or one of its
721         descendants' pseudo-elements.
722
723         * CMakeLists.txt:
724         * DerivedSources-input.xcfilelist:
725         * DerivedSources-output.xcfilelist:
726         * DerivedSources.make:
727         * Headers.cmake:
728         * Sources.txt:
729         * WebCore.xcodeproj/project.pbxproj:
730         * animation/Animatable.idl:
731         * animation/GetAnimationsOptions.h: Added.
732         * animation/GetAnimationsOptions.idl: Added.
733         * dom/Element.cpp:
734         (WebCore::Element::getAnimations):
735         * dom/Element.h:
736
737 2020-01-27  Jonathan Bedard  <jbedard@apple.com>
738
739         WebCore: Remove iOS 11 macros from NetworkStorageSessionCocoa.mm
740         https://bugs.webkit.org/show_bug.cgi?id=206786
741
742         Reviewed by Darin Adler.
743
744         No functional changes, covered by existing tests.
745
746         * platform/network/cocoa/NetworkStorageSessionCocoa.mm:
747         (WebCore::cookiesForURL): 
748         (WebCore::setHTTPCookiesForURL):
749
750 2020-01-27  Jonathan Bedard  <jbedard@apple.com>
751
752         WebCore: Remove iOS 11 macros from WebItemProviderPasteboard.h
753         https://bugs.webkit.org/show_bug.cgi?id=206719
754
755         Reviewed by Tim Horton.
756
757         No functional changes, covered by existing tests.
758
759         * platform/ios/WebItemProviderPasteboard.h:
760
761 2020-01-27  Zalan Bujtas  <zalan@apple.com>
762
763         [LFC][IFC] Display::Run has physical geometry only.
764         https://bugs.webkit.org/show_bug.cgi?id=206810
765         <rdar://problem/58905455>
766
767         Reviewed by Antti Koivisto.
768
769         Since in LFC the Display::Runs are used for painting and hittesting but never for layout,
770         the geometry is always physical.
771
772         * layout/Verification.cpp:
773         (WebCore::Layout::outputMismatchingSimpleLineInformationIfNeeded):
774         (WebCore::Layout::checkForMatchingNonTextRuns):
775         (WebCore::Layout::checkForMatchingTextRuns):
776         (WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
777         * layout/displaytree/DisplayPainter.cpp:
778         (WebCore::Display::paintInlineContent):
779         * layout/displaytree/DisplayRun.h:
780         (WebCore::Display::Run::rect const):
781         (WebCore::Display::Run::topLeft const):
782         (WebCore::Display::Run::left const):
783         (WebCore::Display::Run::right const):
784         (WebCore::Display::Run::top const):
785         (WebCore::Display::Run::bottom const):
786         (WebCore::Display::Run::width const):
787         (WebCore::Display::Run::height const):
788         (WebCore::Display::Run::setWidth):
789         (WebCore::Display::Run::setTop):
790         (WebCore::Display::Run::setlLeft):
791         (WebCore::Display::Run::moveVertically):
792         (WebCore::Display::Run::moveHorizontally):
793         (WebCore::Display::Run::expandVertically):
794         (WebCore::Display::Run::expandHorizontally):
795         (WebCore::Display::Run::Run):
796         (WebCore::Display::Run::logicalRect const): Deleted.
797         (WebCore::Display::Run::logicalTopLeft const): Deleted.
798         (WebCore::Display::Run::logicalLeft const): Deleted.
799         (WebCore::Display::Run::logicalRight const): Deleted.
800         (WebCore::Display::Run::logicalTop const): Deleted.
801         (WebCore::Display::Run::logicalBottom const): Deleted.
802         (WebCore::Display::Run::logicalWidth const): Deleted.
803         (WebCore::Display::Run::logicalHeight const): Deleted.
804         (WebCore::Display::Run::setLogicalWidth): Deleted.
805         (WebCore::Display::Run::setLogicalTop): Deleted.
806         (WebCore::Display::Run::setLogicalLeft): Deleted.
807         * layout/integration/LayoutIntegrationLineLayout.cpp:
808         (WebCore::LayoutIntegration::LineLayout::paint):
809         (WebCore::LayoutIntegration::LineLayout::hitTest):
810         * layout/layouttree/LayoutTreeBuilder.cpp:
811         (WebCore::Layout::outputInlineRuns):
812         * rendering/RenderTreeAsText.cpp:
813         (WebCore::writeTextBox):
814         * rendering/line/LineLayoutTraversal.h:
815         (WebCore::LineLayoutTraversal::Box::logicalRect const): Deleted.
816         * rendering/line/LineLayoutTraversalDisplayRunPath.h:
817         (WebCore::LineLayoutTraversal::linePosition):
818         (WebCore::LineLayoutTraversal::DisplayRunPath::rect const):
819         (WebCore::LineLayoutTraversal::DisplayRunPath::logicalRect const): Deleted.
820
821 2020-01-26  Antoine Quint  <graouts@apple.com>
822
823         [Web Animations] Update all DocumentTimeline objects when updating animations
824         https://bugs.webkit.org/show_bug.cgi?id=206819
825
826         Reviewed by Antti Koivisto.
827
828         Developers can create additional DocumentTimeline objects in JavaScript using that class's constructor, and an animation can be
829         assigned to that timeline after its creation. Until now we would only update an timeline created by a Document when that document's
830         animations were updated. Now we keep track of all DocumentTimeline objects that are created for a given Document as a vector of weak
831         references, and we update all of them when updating a document's animations.
832
833         * animation/DocumentTimeline.cpp:
834         (WebCore::DocumentTimeline::DocumentTimeline):
835         (WebCore::DocumentTimeline::~DocumentTimeline):
836         * animation/DocumentTimeline.h:
837         * dom/Document.cpp:
838         (WebCore::Document::updateAnimationsAndSendEvents):
839         (WebCore::Document::addTimeline):
840         (WebCore::Document::removeTimeline):
841         * dom/Document.h:
842
843 2020-01-26  Darin Adler  <darin@apple.com>
844
845         Move DOMCacheEngine::errorToException back out of header and into .cpp file
846         https://bugs.webkit.org/show_bug.cgi?id=206815
847
848         Reviewed by Mark Lam.
849
850         This is a follow-up to a recent build fix that moved a function, errorToException,
851         out of a .cpp file and into a header file. This reverses that since we don't need
852         this function to be inlined.
853
854         * Modules/cache/DOMCacheEngine.cpp:
855         (WebCore::DOMCacheEngine::convertToException): Moved this function from the header
856         and renamed it from errorToException to match the other function more closely. Also
857         use the pattern where the switch statement has no default, so we get a warning if
858         we don't cover all the enum values.
859         (WebCore::DOMCacheEngine::convertToExceptionAndLog): Updated for new function name.
860
861         * Modules/cache/DOMCacheEngine.h: Removed the definition of errorToException and
862         replaced it with the declaration of it under its new name, convertToException.
863
864         * Modules/cache/DOMCacheStorage.cpp:
865         (WebCore::DOMCacheStorage::retrieveCaches): Updated for new function name.
866
867 2020-01-26  youenn fablet  <youenn@apple.com>
868
869         Use ObjectIdentifier for remote RealtimeMediaSource
870         https://bugs.webkit.org/show_bug.cgi?id=206808
871         <rdar://problem/58705405>
872
873         Reviewed by Eric Carlson.
874
875         No change of behavior.
876
877         * WebCore.xcodeproj/project.pbxproj:
878         * platform/mediastream/RealtimeMediaSourceIdentifier.h: Added.
879
880 2020-01-26  Said Abou-Hallawa  <said@apple.com>
881
882         Throttling requestAnimationFrame should be controlled by RenderingUpdateScheduler
883         https://bugs.webkit.org/show_bug.cgi?id=204713
884
885         Reviewed by Simon Fraser.
886
887         Test: fast/animation/request-animation-frame-throttling-outside-viewport.html
888
889         requestAnimationFrame is throttled by a timer although its callback are
890         serviced by the page RenderingUpdate. This led to excessive rAF firing
891         which makes it more than the preferred frame per seconds.
892
893         The solution is to have two throttling types:
894
895         1) Page throttling (or full throttling) which slows down all the steps of
896            RenderingUpdate for the main document and all the sub-documents.
897         2) Document throttling (or partial throttling) which only slows down the
898            rAF of a certain document.
899
900         * Headers.cmake:
901         * WebCore.xcodeproj/project.pbxproj:
902
903         * animation/DocumentTimeline.cpp:
904         (WebCore::DocumentTimeline::animationInterval const):
905         (WebCore::DocumentTimeline::updateThrottlingState): Deleted.
906         * animation/DocumentTimeline.h:
907         There is no need to have DocumentTimeline throttling. It is already 
908         throttled when the page RenderingUpdate is throttled.
909
910         * dom/Document.cpp:
911         (WebCore::Document::requestAnimationFrame):
912         (WebCore::Document::updateLastHandledUserGestureTimestamp):
913         LowPowerMode throttling is now handled by the page. So remove its handling
914         in the Document side.
915
916         * dom/ScriptedAnimationController.cpp:
917         (WebCore::ScriptedAnimationController::ScriptedAnimationController):
918         (WebCore::ScriptedAnimationController::page const):
919         (WebCore::ScriptedAnimationController::preferredScriptedAnimationInterval const):
920         (WebCore::ScriptedAnimationController::interval const):
921         (WebCore::ScriptedAnimationController::isThrottled const):
922         (WebCore::ScriptedAnimationController::isThrottledRelativeToPage const):
923         (WebCore::ScriptedAnimationController::shouldRescheduleRequestAnimationFrame const):
924         (WebCore::ScriptedAnimationController::registerCallback):
925         (WebCore::ScriptedAnimationController::cancelCallback):
926         (WebCore::ScriptedAnimationController::serviceRequestAnimationFrameCallbacks):
927         (WebCore::ScriptedAnimationController::scheduleAnimation):
928         (WebCore::throttlingReasonToString): Deleted.
929         (WebCore::throttlingReasonsToString): Deleted.
930         (WebCore::ScriptedAnimationController::addThrottlingReason): Deleted.
931         (WebCore::ScriptedAnimationController::removeThrottlingReason): Deleted.
932         (WebCore::ScriptedAnimationController::animationTimerFired): Deleted.
933         * dom/ScriptedAnimationController.h:
934         (WebCore::ScriptedAnimationController::addThrottlingReason):
935         (WebCore::ScriptedAnimationController::removeThrottlingReason):
936         Get rid of the rAF throttling timer. Service the rAF callback only when
937         the period from the current time stamp till the last service time stamp
938         is greater than the preferred rAF interval .
939
940         * page/FrameView.cpp:
941         (WebCore::FrameView::updateScriptedAnimationsAndTimersThrottlingState):
942         ThrottlingReason is now defined outside ScriptedAnimationController.
943
944         * page/Page.cpp:
945         (WebCore::Page::renderingUpdateThrottlingEnabled const):
946         (WebCore::Page::renderingUpdateThrottlingEnabledChanged):
947         (WebCore::Page::isRenderingUpdateThrottled const):
948
949         (WebCore::Page::preferredRenderingUpdateInterval const):
950         Calculate the preferred RenderingUpdate interval from the throttling
951         reasons.
952
953         (WebCore::Page::setIsVisuallyIdleInternal):
954         (WebCore::Page::handleLowModePowerChange):
955         Call adjustRenderingUpdateFrequency() when isLowPowerModeEnabled or 
956         IsVisuallyIdle is toggled.
957
958         (WebCore::updateScriptedAnimationsThrottlingReason): Deleted.
959         * page/Page.h:
960
961         * page/RenderingUpdateScheduler.cpp:
962         (WebCore::RenderingUpdateScheduler::adjustFramesPerSecond):
963         (WebCore::RenderingUpdateScheduler::adjustRenderingUpdateFrequency):
964         Change the preferredFramesPerSecond of the DisplayRefreshMonitor if the
965         throttling is not aggressive e.g. 10_s. Otherwise use the timer.
966
967         (WebCore::RenderingUpdateScheduler::scheduleTimedRenderingUpdate):
968         Call adjustFramesPerSecond() when DisplayRefreshMonitor is created.
969
970         (WebCore::RenderingUpdateScheduler::startTimer):
971         * page/RenderingUpdateScheduler.h:
972
973         * page/Settings.yaml:
974         * page/SettingsBase.cpp:
975         (WebCore::SettingsBase::renderingUpdateThrottlingEnabledChanged):
976         * page/SettingsBase.h:
977         Add a setting to enable/disable RenderingUpdateThrottling.
978
979         * platform/graphics/AnimationFrameRate.h: Added.
980         (WebCore::preferredFrameInterval):
981         (WebCore::preferredFramesPerSecond):
982
983         * platform/graphics/DisplayRefreshMonitor.h:
984         (WebCore::DisplayRefreshMonitor::setPreferredFramesPerSecond):
985         * platform/graphics/DisplayRefreshMonitorManager.cpp:
986         (WebCore::DisplayRefreshMonitorManager::monitorForClient):
987         Rename createMonitorForClient() to monitorForClient() since it may return
988         a cached DisplayRefreshMonitor.
989
990         (WebCore::DisplayRefreshMonitorManager::setPreferredFramesPerSecond):
991         (WebCore::DisplayRefreshMonitorManager::scheduleAnimation):
992         (WebCore::DisplayRefreshMonitorManager::windowScreenDidChange):
993         No need to call registerClient(). This function was just ensuring the
994         DisplayRefreshMonitor is created. scheduleAnimation() does the same thing.
995
996         (WebCore::DisplayRefreshMonitorManager::createMonitorForClient): Deleted.
997         (WebCore::DisplayRefreshMonitorManager::registerClient): Deleted.
998         * platform/graphics/DisplayRefreshMonitorManager.h:
999         (WebCore::DisplayRefreshMonitorManager::DisplayRefreshMonitorManager): Deleted.
1000
1001         * platform/graphics/GraphicsLayerUpdater.cpp:
1002         (WebCore::GraphicsLayerUpdater::GraphicsLayerUpdater):
1003         * platform/graphics/ios/DisplayRefreshMonitorIOS.mm:
1004         (-[WebDisplayLinkHandler setPreferredFramesPerSecond:]):
1005         Set the preferredFramesPerSecond of the CADisplayLink.
1006
1007         * platform/ios/LowPowerModeNotifierIOS.mm:
1008         (-[WebLowPowerModeObserver initWithNotifier:]):
1009         Set the initial state of the low power mode.
1010
1011 2020-01-26  Rob Buis  <rbuis@igalia.com>
1012
1013         Improve compatibility with hyperlink auditing spec
1014         https://bugs.webkit.org/show_bug.cgi?id=188852
1015
1016         Reviewed by Youenn Fablet.
1017
1018         The hyperlink auditing algorithm indicates the fetch should be done
1019         using no-referrer [1], so remove the code to set the referrer HTTP
1020         header.
1021
1022         Tests: http/tests/navigation/ping-attribute/anchor-cross-origin.html
1023                http/tests/navigation/ping-attribute/area-cross-origin.html
1024
1025         [1] https://html.spec.whatwg.org/multipage/links.html#hyperlink-auditing (Step 3)
1026
1027         * loader/PingLoader.cpp:
1028         (WebCore::PingLoader::sendPing):
1029
1030 2020-01-25  Darin Adler  <darin@apple.com>
1031
1032         Tighten up some of the drag state machine logic
1033         https://bugs.webkit.org/show_bug.cgi?id=206798
1034
1035         Reviewed by Wenson Hsieh.
1036
1037         * page/EventHandler.h: Added shouldDispatchEventsToDragSourceElement function and renamed
1038         the existing dispatchDragSrcEvent function to dispatchEventToDragSourceElement.
1039
1040         * page/EventHandler.cpp:
1041         (WebCore::EventHandler::updateDragAndDrop): Call the renamed dispatchEventToDragSourceElement
1042         unconditionally, since it now has the smarts to only dispatch an event when we are supposed to.
1043         (WebCore::EventHandler::cancelDragAndDrop): Ditto.
1044         (WebCore::EventHandler::dragSourceEndedAt): Call the new shouldDispatchEventsToDragSourceElement
1045         function because of the null check it does for dataTransfer, before calling setDestinationOperation
1046         on the dataTransfer, since there isn't an obvious ironclad guarantee we might be here without an
1047         actual drag fully in process and a dataTransfer object allocated. Also call the renamed
1048         dispatchEventToDragSourceElement by its new name.
1049         (WebCore::EventHandler::shouldDispatchDragSourceEvents): Added. Checks thre three conditions that
1050         affect whether we should dispatch events to the drag source. First that there is a drag source.
1051         Second that there is a dataTransfer object, indicating that we got far enough in the logic to
1052         actually start a drag. Third that shouldDispatchEvents is true, indicating this is the type of
1053         drag that should be visible to the website content and so events should be dispatched.
1054         (WebCore::EventHandler::dispatchEventToDragSourceElement): Call shouldDispatchDragSourceEvents
1055         before dispatching the event, so that callers don't all have to do that check.
1056
1057 2020-01-25  Mark Lam  <mark.lam@apple.com>
1058
1059         Introduce a getVTablePointer() utility function.
1060         https://bugs.webkit.org/show_bug.cgi?id=206804
1061         <rdar://problem/58872290>
1062
1063         Reviewed by Yusuke Suzuki and Oliver Hunt.
1064
1065         Updated CodeGeneratorJS to use getVTablePointer() and rebased test results.
1066
1067         * bindings/scripts/CodeGeneratorJS.pm:
1068         (GenerateImplementation):
1069         * bindings/scripts/test/JS/JSInterfaceName.cpp:
1070         (WebCore::toJSNewlyCreated):
1071         * bindings/scripts/test/JS/JSMapLike.cpp:
1072         (WebCore::toJSNewlyCreated):
1073         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
1074         (WebCore::toJSNewlyCreated):
1075         * bindings/scripts/test/JS/JSReadOnlySetLike.cpp:
1076         (WebCore::toJSNewlyCreated):
1077         * bindings/scripts/test/JS/JSSetLike.cpp:
1078         (WebCore::toJSNewlyCreated):
1079         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
1080         (WebCore::toJSNewlyCreated):
1081         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
1082         (WebCore::toJSNewlyCreated):
1083         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
1084         (WebCore::toJSNewlyCreated):
1085         * bindings/scripts/test/JS/JSTestCallTracer.cpp:
1086         (WebCore::toJSNewlyCreated):
1087         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
1088         (WebCore::toJSNewlyCreated):
1089         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
1090         (WebCore::toJSNewlyCreated):
1091         * bindings/scripts/test/JS/JSTestEnabledForContext.cpp:
1092         (WebCore::toJSNewlyCreated):
1093         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
1094         (WebCore::toJSNewlyCreated):
1095         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
1096         (WebCore::toJSNewlyCreated):
1097         * bindings/scripts/test/JS/JSTestException.cpp:
1098         (WebCore::toJSNewlyCreated):
1099         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
1100         (WebCore::toJSNewlyCreated):
1101         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
1102         (WebCore::toJSNewlyCreated):
1103         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
1104         (WebCore::toJSNewlyCreated):
1105         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
1106         (WebCore::toJSNewlyCreated):
1107         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
1108         (WebCore::toJSNewlyCreated):
1109         * bindings/scripts/test/JS/JSTestIterable.cpp:
1110         (WebCore::toJSNewlyCreated):
1111         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
1112         (WebCore::toJSNewlyCreated):
1113         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
1114         (WebCore::toJSNewlyCreated):
1115         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
1116         (WebCore::toJSNewlyCreated):
1117         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
1118         (WebCore::toJSNewlyCreated):
1119         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
1120         (WebCore::toJSNewlyCreated):
1121         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
1122         (WebCore::toJSNewlyCreated):
1123         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
1124         (WebCore::toJSNewlyCreated):
1125         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
1126         (WebCore::toJSNewlyCreated):
1127         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
1128         (WebCore::toJSNewlyCreated):
1129         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
1130         (WebCore::toJSNewlyCreated):
1131         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
1132         (WebCore::toJSNewlyCreated):
1133         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
1134         (WebCore::toJSNewlyCreated):
1135         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
1136         (WebCore::toJSNewlyCreated):
1137         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
1138         (WebCore::toJSNewlyCreated):
1139         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
1140         (WebCore::toJSNewlyCreated):
1141         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
1142         (WebCore::toJSNewlyCreated):
1143         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
1144         (WebCore::toJSNewlyCreated):
1145         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
1146         (WebCore::toJSNewlyCreated):
1147         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
1148         (WebCore::toJSNewlyCreated):
1149         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
1150         (WebCore::toJSNewlyCreated):
1151         * bindings/scripts/test/JS/JSTestNode.cpp:
1152         (WebCore::toJSNewlyCreated):
1153         * bindings/scripts/test/JS/JSTestObj.cpp:
1154         (WebCore::toJSNewlyCreated):
1155         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
1156         (WebCore::toJSNewlyCreated):
1157         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
1158         (WebCore::toJSNewlyCreated):
1159         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
1160         (WebCore::toJSNewlyCreated):
1161         * bindings/scripts/test/JS/JSTestPluginInterface.cpp:
1162         (WebCore::toJSNewlyCreated):
1163         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
1164         (WebCore::toJSNewlyCreated):
1165         * bindings/scripts/test/JS/JSTestSerialization.cpp:
1166         (WebCore::toJSNewlyCreated):
1167         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
1168         (WebCore::toJSNewlyCreated):
1169         * bindings/scripts/test/JS/JSTestStringifier.cpp:
1170         (WebCore::toJSNewlyCreated):
1171         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
1172         (WebCore::toJSNewlyCreated):
1173         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
1174         (WebCore::toJSNewlyCreated):
1175         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
1176         (WebCore::toJSNewlyCreated):
1177         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
1178         (WebCore::toJSNewlyCreated):
1179         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
1180         (WebCore::toJSNewlyCreated):
1181         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
1182         (WebCore::toJSNewlyCreated):
1183         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
1184         (WebCore::toJSNewlyCreated):
1185
1186 2020-01-25  Per Arne Vollan  <pvollan@apple.com>
1187
1188         [Cocoa] Media mime types map should be created in the UI process
1189         https://bugs.webkit.org/show_bug.cgi?id=206478
1190
1191         Reviewed by Darin Adler.
1192
1193         Creating this map in the WebContent process will access the launch services daemon, which will be blocked.
1194         This patch creates the map in the UI process and sends it to the WebContent process as part of the WebProcess
1195         creation parameters.
1196
1197         API test: WebKit.MimeTypes
1198
1199         * platform/MIMETypeRegistry.cpp:
1200         (WebCore::overriddenMimeTypesMap):
1201         (WebCore::commonMediaTypes):
1202         (WebCore::commonMimeTypesMap):
1203         (WebCore::typesForCommonExtension):
1204         * platform/MIMETypeRegistry.h:
1205         * testing/Internals.cpp:
1206         (WebCore::Internals::mediaMIMETypeForExtension):
1207         * testing/Internals.h:
1208         * testing/Internals.idl:
1209
1210 2020-01-25  Zalan Bujtas  <zalan@apple.com>
1211
1212         [LFC][IFC] Layout logic should be driven by the type of the inline box
1213         https://bugs.webkit.org/show_bug.cgi?id=206792
1214         <rdar://problem/58889080>
1215
1216         Reviewed by Antti Koivisto.
1217
1218         Use the type of the inline box to decide what layout functions to call and not whether the
1219         box has children or it establishes a formatting context.
1220
1221         * layout/inlineformatting/InlineFormattingContext.cpp:
1222         (WebCore::Layout::nextInPreOrder):
1223         (WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthConstraints):
1224         (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingRoot):
1225         * layout/inlineformatting/InlineFormattingContext.h:
1226         * layout/inlineformatting/InlineLineBuilder.cpp:
1227         (WebCore::Layout::LineBuilder::isVisuallyNonEmpty const):
1228
1229 2020-01-25  Antti Koivisto  <antti@apple.com>
1230
1231         [LFC][Integration] Re-enable line layout integration
1232         https://bugs.webkit.org/show_bug.cgi?id=206795
1233         <rdar://problem/58853907>
1234
1235         Reviewed by Zalan Bujtas.
1236
1237         * page/RuntimeEnabledFeatures.h:
1238
1239 2020-01-25  youenn fablet  <youenn@apple.com>
1240
1241         HTMLMediaElement should not remove the media session at DOM suspension time
1242         https://bugs.webkit.org/show_bug.cgi?id=206661
1243         <rdar://problem/58800787>
1244
1245         Reviewed by Eric Carlson.
1246
1247         https://trac.webkit.org/changeset/233560 made it so that, on HTMLMediaElement suspension,
1248         its media session is stopped.
1249         This was done to ensure updateNowPlayingInfo is not called synchronously but asynchronously.
1250         The issue is that, once the media session is stopped, it is removed from the media session vector.
1251         On updating the ready state after suspension, and playing, we try to look into the media session vector and do not find the session.
1252         This triggers the ASSERT.
1253
1254         Partially revert the behavior by calling the same code as clientWillPausePlayback
1255         but make sure updateNowPlayingInfo is calling asynchronously when suspending the media element.
1256         Introduce clientWillBeDOMSuspended for that purpose.
1257
1258         Update mediaPlayerReadyStateChanged to enqueue a task to do the update if the media element is suspended.
1259
1260         Covered by test no longer crashing in debug.
1261
1262         * html/HTMLMediaElement.cpp:
1263         (WebCore::HTMLMediaElement::mediaPlayerReadyStateChanged):
1264         (WebCore::HTMLMediaElement::stopWithoutDestroyingMediaPlayer):
1265         * platform/audio/PlatformMediaSession.cpp:
1266         (WebCore::PlatformMediaSession::processClientWillPausePlayback):
1267         (WebCore::PlatformMediaSession::clientWillPausePlayback):
1268         (WebCore::PlatformMediaSession::clientWillBeDOMSuspended):
1269         * platform/audio/PlatformMediaSession.h:
1270         * platform/audio/PlatformMediaSessionManager.cpp:
1271         (WebCore::PlatformMediaSessionManager::sessionWillEndPlayback):
1272         * platform/audio/PlatformMediaSessionManager.h:
1273         * platform/audio/cocoa/MediaSessionManagerCocoa.h:
1274         * platform/audio/cocoa/MediaSessionManagerCocoa.mm:
1275         (MediaSessionManagerCocoa::sessionWillEndPlayback):
1276         * platform/audio/ios/MediaSessionManagerIOS.h:
1277         * platform/audio/ios/MediaSessionManagerIOS.mm:
1278         (WebCore::MediaSessionManageriOS::sessionWillEndPlayback):
1279
1280 2020-01-24  Jack Lee  <shihchieh_lee@apple.com>
1281
1282         Null Ptr Deref READ @ WebCore::RenderMultiColumnFlow::lastMultiColumnSet const
1283         https://bugs.webkit.org/show_bug.cgi?id=206106
1284
1285         Reviewed by Ryosuke Niwa.
1286
1287         Could not write a reproducible fast test case for this.
1288
1289         * rendering/RenderMultiColumnFlow.cpp:
1290         (WebCore::RenderMultiColumnFlow::lastMultiColumnSet const):
1291         * rendering/updating/RenderTreeBuilderMultiColumn.cpp:
1292         (WebCore::RenderTreeBuilder::MultiColumn::processPossibleSpannerDescendant):
1293
1294 2020-01-24  Wenson Hsieh  <wenson_hsieh@apple.com>
1295
1296         [iOS] Long pressing text inside a selection should update the selection
1297         https://bugs.webkit.org/show_bug.cgi?id=206769
1298         <rdar://problem/58704316>
1299
1300         Reviewed by Tim Horton.
1301
1302         Remove `hasSelectionAtPosition`, which is no longer needed.
1303
1304         * page/Page.cpp:
1305         (WebCore::Page::hasSelectionAtPosition const): Deleted.
1306         * page/Page.h:
1307
1308 2020-01-24  Zalan Bujtas  <zalan@apple.com>
1309
1310         [LFC][IFC] (Regression) LayoutTests/fast/text/whitespace/029.html fails
1311         https://bugs.webkit.org/show_bug.cgi?id=206773
1312         <rdar://problem/58883388>
1313
1314         Reviewed by Simon Fraser.
1315
1316         While line break is an inline box, it does not have inline content so do not try to cast it to Container.
1317
1318         * layout/inlineformatting/InlineFormattingContext.cpp:
1319         (WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthConstraints):
1320         (WebCore::Layout::InlineFormattingContext::collectInlineContentIfNeeded):
1321
1322 2020-01-24  Jer Noble  <jer.noble@apple.com>
1323
1324         AirPlay placard not visible when AirPlay is entered in fullscreen mode.
1325         https://bugs.webkit.org/show_bug.cgi?id=206772
1326         <rdar://problem/57098851>
1327
1328         Reviewed by Eric Carlson.
1329
1330         Test: media/modern-media-controls/placard-support/placard-support-airplay-fullscreen-no-controls.html
1331
1332         The AirPlay and Picture-in-picture placards should always become visible, regardless of
1333         whether the <video> element uses the native media controls. So "disabling" the PlacardSupport
1334         object should not remove the listeners for presentation mode and route change events. Instead
1335         merely remember whether the object is disabled, so that the "error placard" will only be shown
1336         if controls are enabled, and PiP and AirPlay placards will always be shown.
1337
1338         * Modules/modern-media-controls/media/placard-support.js:
1339         (PlacardSupport.prototype.enable):
1340         (PlacardSupport.prototype.disable):
1341         (PlacardSupport.prototype._updatePlacard):
1342
1343 2020-01-24  Andres Gonzalez  <andresg_22@apple.com>
1344
1345         Crash in AXIsolatedObject::tagName.
1346         https://bugs.webkit.org/show_bug.cgi?id=206765
1347
1348         Reviewed by Chris Fleizach.
1349
1350         Fixes crash in AXIsolatedObject::tagName.
1351
1352         * accessibility/isolatedtree/AXIsolatedObject.cpp:
1353         (WebCore::AXIsolatedObject::initializeAttributeData): Was missing the isolatedCopy when caching the tagName.
1354
1355 2020-01-24  Ryan Haddad  <ryanhaddad@apple.com>
1356
1357         Unreviewed, rolling out r255089.
1358
1359         Breaks tvOS build.
1360
1361         Reverted changeset:
1362
1363         "WebCore: Remove iOS 11 macros from
1364         WebItemProviderPasteboard.h"
1365         https://bugs.webkit.org/show_bug.cgi?id=206719
1366         https://trac.webkit.org/changeset/255089
1367
1368 2020-01-24  Jonathan Bedard  <jbedard@apple.com>
1369
1370         WebCore: Remove iOS 11 macros from WebItemProviderPasteboard.h
1371         https://bugs.webkit.org/show_bug.cgi?id=206719
1372
1373         Reviewed by Tim Horton.
1374
1375         No functional changes, covered by existing tests.
1376
1377         * platform/ios/WebItemProviderPasteboard.h:
1378
1379 2020-01-24  youenn fablet  <youenn@apple.com>
1380
1381         Add support for MediaRecorder.requestData
1382         https://bugs.webkit.org/show_bug.cgi?id=206731
1383
1384         Reviewed by Eric Carlson.
1385
1386         Add support for requestData that fetches any available data.
1387         Expose MediaRecorder stream.
1388         Covered by updated tests.
1389
1390         * Modules/mediarecorder/MediaRecorder.cpp:
1391         (WebCore::MediaRecorder::requestData):
1392         * Modules/mediarecorder/MediaRecorder.h:
1393         * Modules/mediarecorder/MediaRecorder.idl:
1394
1395 2020-01-24  Jack Lee  <shihchieh_lee@apple.com>
1396
1397         Nullptr deref in WebCore::RenderTreeBuilder::Block::attachIgnoringContinuation when an element is inserted before legend under multi-column layout.
1398         https://bugs.webkit.org/show_bug.cgi?id=206109
1399
1400         Reviewed by Antti Koivisto.
1401
1402         Test: fast/forms/fieldset/fieldset-crash-insert-before-legend-under-multicol.html
1403
1404         * rendering/updating/RenderTreeBuilderBlockFlow.cpp:
1405         (WebCore::RenderTreeBuilder::BlockFlow::attach):
1406
1407 2020-01-24  Per Arne Vollan  <pvollan@apple.com>
1408
1409         Unreviewed, rolling out r255050.
1410
1411         Introduced crashes on bots
1412
1413         Reverted changeset:
1414
1415         "[Cocoa] Media mime types map should be created in the UI
1416         process"
1417         https://bugs.webkit.org/show_bug.cgi?id=206478
1418         https://trac.webkit.org/changeset/255050
1419
1420 2020-01-24  Andres Gonzalez  <andresg_22@apple.com>
1421
1422         Implementation of AXIsolatedObject::isStaticText and isLandmark methods.
1423         https://bugs.webkit.org/show_bug.cgi?id=206745
1424
1425         Reviewed by Chris Fleizach.
1426
1427         - isStaticText moved from the AXObject class to the base AXCoreObject so
1428         that it is used by isolated objects as well.
1429         - Implemented isLandmark.
1430         - Ordered alphabetically the setProperty calls for most IsXXX
1431         properties in initializeAttributeData for easier identification.
1432
1433         * accessibility/AccessibilityObject.h:
1434         * accessibility/AccessibilityObjectInterface.h:
1435         (WebCore::AXCoreObject::isStaticText const):
1436         * accessibility/isolatedtree/AXIsolatedObject.cpp:
1437         (WebCore::AXIsolatedObject::initializeAttributeData):
1438         (WebCore::AXIsolatedObject::isLandmark const): Deleted, inline in header file.
1439         (WebCore::AXIsolatedObject::isStaticText const): Deleted, implemented in AXCoreObject.
1440         * accessibility/isolatedtree/AXIsolatedObject.h:
1441
1442 2020-01-23  Antoine Quint  <graouts@apple.com>
1443
1444         [Web Animations] Support multiple CSS Animations with the same name in animation-name
1445         https://bugs.webkit.org/show_bug.cgi?id=206688
1446
1447         Reviewed by Dean Jackson.
1448
1449         AnimationTimeline would keep track of registered CSS Animations by name for a given element in m_elementToCSSAnimationByName which would map one CSSAnimation
1450         per String (the animation-name) for a given Element. However, within the same animation-name property, the name of a given @keyframes rules may appear more
1451         than once, and the CSS Animations specification explains how to handle this scenario.
1452
1453         We now correctly handle this by replacing m_elementToCSSAnimationByName with the new m_elementToCSSAnimationsCreatedByMarkupMap which simply maps an Element
1454         to a ListHashSet of CSSAnimation objects. Removing the string that appeared in animation-name to create this animation requires us to keep the AnimationList
1455         used for the last style update for sorting purposes, since having multiple instances of the same string would not allow disambiguation when sorting the
1456         KeyframeEffectStack.
1457
1458         So we also replace m_cssAnimationNames, a Vector<String>, with m_cssAnimationList, a RefPtr<const AnimationList>, and use this to compare Animation objects
1459         stored in the AnimationList against the backing animation of each CSSAnimation.
1460
1461         Storing the AnimationList on the KeyframeEffectStack also has the benefit of allowing us to use this as the previous state when updating CSS Animations in
1462         AnimationTimeline::updateCSSAnimationsForElement(). We used to rely on the previous RenderStyle provided to that function, but it's possible that this style
1463         is null and we would unnecessarily create additional CSSAnimation objects for animations that actually were retained since the last time CSS Animations were
1464         invalidated. We now use the stored AnimationList on the invalidated element's KeyframeEffectStack and create a new animation list that will replace the old
1465         list stored in the m_elementToCSSAnimationsCreatedByMarkupMap map for that element. We can also compare the old list with the new list to find out which
1466         animations are no longer current.
1467
1468         Finally, we refactor things a bit to have some new aliases AnimationCollection and CSSAnimationCollection instead of using ListHashSet<> in our types.
1469
1470         * animation/AnimationTimeline.cpp:
1471         (WebCore::AnimationTimeline::animationWasAddedToElement): Use the new AnimationCollection alias.
1472         (WebCore::AnimationTimeline::removeDeclarativeAnimationFromListsForOwningElement): We no longer need to do any work for CSSAnimation here since the
1473         m_elementToCSSAnimationByName map is no more and the m_elementToCSSAnimationsCreatedByMarkupMap that replaces it is updated in updateCSSAnimationsForElement()
1474         and elementWasRemoved().
1475         (WebCore::AnimationTimeline::animationsForElement const): Since animations are correctly sorted accounting for their composite order in KeyframeEffectStack,
1476         call KeyframeEffectStack::sortedEffects() when we're called with Ordering::Sorted. 
1477         (WebCore::AnimationTimeline::removeCSSAnimationCreatedByMarkup): New method called by elementWasRemoved() to ensure that when an element is removed, we remove
1478         its CSSAnimation objects from the new m_elementToCSSAnimationsCreatedByMarkupMap and also update the AnimationList on the relevant KeyframeEffectStack.
1479         (WebCore::AnimationTimeline::elementWasRemoved): Call the new removeCSSAnimationCreatedByMarkup() method before canceling a CSSAnimation.
1480         (WebCore::AnimationTimeline::cancelDeclarativeAnimationsForElement): Call the new removeCSSAnimationCreatedByMarkup() method before canceling a CSSAnimation.
1481         (WebCore::AnimationTimeline::updateCSSAnimationsForElement): Use the AnimationList recoreded on the relevant KeyframeEffectStack to determine which CSSAnimation
1482         objects to create, cancel or merely update depending on the AnimationList in the current style. 
1483         * animation/AnimationTimeline.h:
1484         * animation/DocumentTimeline.cpp:
1485         (WebCore::DocumentTimeline::getAnimations const): Use compareAnimationsByCompositeOrder() to correctly sort CSS Animations since they are no longer guaranteed
1486         to be stored in the relevant map in the expected order.
1487         * animation/KeyframeEffectStack.cpp:
1488         (WebCore::KeyframeEffectStack::ensureEffectsAreSorted): Use the new m_cssAnimationList instead of the old m_cssAnimationNames when sorting effects.
1489         (WebCore::KeyframeEffectStack::setCSSAnimationList):
1490         (WebCore::KeyframeEffectStack::setCSSAnimationNames): Deleted.
1491         * animation/KeyframeEffectStack.h:
1492         (WebCore::KeyframeEffectStack::cssAnimationList const):
1493         (WebCore::KeyframeEffectStack::cssAnimationNames const): Deleted.
1494         * animation/WebAnimation.cpp:
1495         (WebCore::WebAnimation::commitStyles): Use the new KeyframeEffectStack::cssAnimationList() instead of the old KeyframeEffectStack::cssAnimationNames().
1496         * animation/WebAnimationUtilities.cpp:
1497         (WebCore::compareAnimationsByCompositeOrder): Update the composite order comparison utility to use an AnimationList rather than a list of animation names.
1498         * animation/WebAnimationUtilities.h:
1499         * platform/animation/AnimationList.h:
1500         (WebCore::AnimationList::copy const):
1501
1502 2020-01-24  Zalan Bujtas  <zalan@apple.com>
1503
1504         [LFC][Painting] Add Display::Run cleanup to TextPainter::clearGlyphDisplayLists
1505         https://bugs.webkit.org/show_bug.cgi?id=206744
1506         <rdar://problem/58867112>
1507
1508         Reviewed by Antti Koivisto.
1509
1510         * rendering/TextPainter.cpp:
1511         (WebCore::TextPainter::clearGlyphDisplayLists):
1512
1513 2020-01-24  Antti Koivisto  <antti@apple.com>
1514
1515         [LFC][Integration] Clear inline item caches on low memory notification
1516         https://bugs.webkit.org/show_bug.cgi?id=206740
1517         <rdar://problem/58773905>
1518
1519         Reviewed by Zalan Bujtas.
1520
1521         Clear inline item caches on low memory notification.
1522
1523         * layout/inlineformatting/InlineFormattingState.h:
1524         * layout/integration/LayoutIntegrationLineLayout.cpp:
1525         (WebCore::LayoutIntegration::LineLayout::releaseCaches):
1526         (WebCore::LayoutIntegration::LineLayout::releaseInlineItemCache):
1527         * layout/integration/LayoutIntegrationLineLayout.h:
1528
1529         Remove inline capacity. It is rarely optimal and we can afford the heap allocation.
1530
1531         * page/MemoryRelease.cpp:
1532         (WebCore::releaseNoncriticalMemory):
1533
1534 2020-01-24  Adrian Perez de Castro  <aperez@igalia.com>
1535
1536         Fix various non-unified build issues introduced since r254751
1537         https://bugs.webkit.org/show_bug.cgi?id=206736
1538
1539         Reviewed by Carlos Garcia Campos.
1540
1541         No new tests needed.
1542
1543         * Modules/cache/DOMCacheEngine.cpp: Move errorToException() function out from the file to
1544         make it usable from DOMCacheStorage.cpp
1545         * Modules/cache/DOMCacheEngine.h:
1546         (WebCore::DOMCacheEngine::errorToException): Added.
1547         * Modules/cache/DOMCacheStorage.cpp:
1548         (WebCore::DOMCacheStorage::retrieveCaches): Adapt to use DOMCacheEngine::errorToException().
1549         * platform/graphics/cairo/ImageBufferUtilitiesCairo.cpp: Add missing RefPtrCairo.h inclusion.
1550
1551 2020-01-24  Zalan Bujtas  <zalan@apple.com>
1552
1553         [LFC][Integration] LineLayout::paint should take advantage of the glyph display list cache
1554         https://bugs.webkit.org/show_bug.cgi?id=206727
1555         <rdar://problem/58809696>
1556
1557         Reviewed by Antti Koivisto.
1558
1559         * layout/displaytree/DisplayInlineContent.cpp:
1560         (WebCore::Display::InlineContent::~InlineContent):
1561         * layout/displaytree/DisplayInlineContent.h:
1562         * layout/integration/LayoutIntegrationLineLayout.cpp:
1563         (WebCore::LayoutIntegration::LineLayout::paint):
1564
1565 2020-01-24  Antti Koivisto  <antti@apple.com>
1566
1567         :matches() doesn't combine correctly with pseudo elements
1568         https://bugs.webkit.org/show_bug.cgi?id=206654
1569
1570         Reviewed by Simon Fraser.
1571
1572         :matches() has been renamed to :is() in the spec (https://www.w3.org/TR/selectors-4/#matches).
1573         Update the :matches implementation to spec behavior regarding pseudo element handling.
1574
1575         "Pseudo-elements cannot be represented by the matches-any pseudo-class; they are not valid within :is()."
1576
1577         Selectors like
1578
1579             ::matches(foo, .parent .child)::first-letter
1580
1581         should work while
1582
1583             ::matches(:first-letter)
1584
1585         shoudn't match anything.
1586
1587         Test: fast/selectors/matches-with-pseudo-element.html
1588
1589         * css/SelectorChecker.cpp:
1590         (WebCore::SelectorChecker::matchRecursively const):
1591         (WebCore::SelectorChecker::checkOne const):
1592
1593         Don't provide pseudoId into ::matches subselectors. Pseudo elements are not suppported inside ::matches.
1594         If one if found, fail that subselector.
1595
1596         * css/SelectorChecker.h:
1597
1598 2020-01-24  youenn fablet  <youenn@apple.com>
1599
1600         Make sure fetch tasks go to network if service worker never gets to activated
1601         https://bugs.webkit.org/show_bug.cgi?id=206648
1602
1603         Reviewed by Chris Dumez.
1604
1605         In case worker context process crashes, the SWServerWorker gets set to NotRunning.
1606         If the SWServerWorker has pending activating completion handlers, they will never be called until the worker is destroyed.
1607         But the worker may never be destroyed until its registration is destroyed.
1608         This may trigger service worker fetch task hangs.
1609
1610         To fix this, make sure to call activating completion handlers whenever the SWServerWorker state is changed to either Terminating or NotRunning.
1611
1612         Covered by updated test.
1613
1614         * workers/service/server/SWServerWorker.cpp:
1615         (WebCore::SWServerWorker::~SWServerWorker):
1616         (WebCore::SWServerWorker::whenActivated):
1617         (WebCore::SWServerWorker::setState):
1618         * workers/service/server/SWServerWorker.h:
1619
1620 2020-01-24  youenn fablet  <youenn@apple.com>
1621
1622         Make sure DOMCacheStorage::retrieveCaches always calls its completionHandler
1623         https://bugs.webkit.org/show_bug.cgi?id=206647
1624
1625         Reviewed by Chris Dumez.
1626
1627         * Modules/cache/DOMCacheStorage.cpp:
1628         (WebCore::DOMCacheStorage::retrieveCaches):
1629         In case of context being stopped, make sure the completion handler is still called.
1630
1631 2020-01-23  Per Arne Vollan  <pvollan@apple.com>
1632
1633         [Cocoa] Media mime types map should be created in the UI process
1634         https://bugs.webkit.org/show_bug.cgi?id=206478
1635
1636         Reviewed by Darin Adler.
1637
1638         Creating this map in the WebContent process will access the launch services daemon, which will be blocked.
1639         This patch creates the map in the UI process and sends it to the WebContent process as part of the WebProcess
1640         creation parameters.
1641
1642         API test: WebKit.MimeTypes
1643
1644         * platform/MIMETypeRegistry.cpp:
1645         (WebCore::overriddenMimeTypesMap):
1646         (WebCore::commonMediaTypes):
1647         (WebCore::commonMimeTypesMap):
1648         (WebCore::typesForCommonExtension):
1649         * platform/MIMETypeRegistry.h:
1650         * testing/Internals.cpp:
1651         (WebCore::Internals::mediaMIMETypeForExtension):
1652         * testing/Internals.h:
1653         * testing/Internals.idl:
1654
1655 2020-01-22  Darin Adler  <darin@apple.com>
1656
1657         Remove some unneeded definitions from Platform.h family headers
1658         https://bugs.webkit.org/show_bug.cgi?id=206642
1659
1660         Reviewed by Eric Carlson.
1661
1662         * platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.h: Removed
1663         checks of HAVE(AVFOUNDATION_MEDIA_SELECTION_GROUP) and
1664         HAVE(AVFOUNDATION_VIDEO_OUTPUT) because both are always 1 on Cocoa platforms,
1665         and this is Cocoa-only source code.
1666         * platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.mm: Ditto.
1667         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h: Ditto.
1668         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: Ditto.
1669
1670 2020-01-23  Tim Horton  <timothy_horton@apple.com>
1671
1672         macCatalyst: I-Beam is too conservative, doesn't show up in editable areas with no text
1673         https://bugs.webkit.org/show_bug.cgi?id=206716
1674         <rdar://problem/58359523>
1675
1676         Reviewed by Simon Fraser.
1677
1678         * editing/VisiblePosition.cpp:
1679         (WebCore::VisiblePosition::absoluteSelectionBoundsForLine const):
1680         * editing/VisiblePosition.h:
1681         Expose the bounds of the possible selection for the line that the given position belongs to.
1682
1683 2020-01-23  Andres Gonzalez  <andresg_22@apple.com>
1684
1685         Use the same AccessibilityObjectWrapper for associated AXObject and AXIsolatedObject.
1686         https://bugs.webkit.org/show_bug.cgi?id=206384
1687
1688         Reviewed by Chris Fleizach.
1689
1690         Associated AXObject and AXIsolatedObject need to share the same
1691         AccessibilityObjectWrapper in order for accessibility clients to work
1692         properly. This change implements Chris Fleizach's original approach to
1693         have both the AXObject and IsolatedObject in the same wrapper. This
1694         approach allows the event notification code to remain the same in
1695         isolated tree mode, and minimizes lock contention between the main and
1696         AX threads.
1697
1698         * accessibility/AXObjectCache.cpp:
1699         (WebCore::AXObjectCache::cacheAndInitializeWrapper): Utility method that encapsulates these operations performed in the getOrCreate methods.
1700         (WebCore::AXObjectCache::getOrCreate):
1701         (WebCore::AXObjectCache::createIsolatedTreeHierarchy): Attaches to the IsolatedObject the same wrapper as its associated AXObject.
1702         * accessibility/AXObjectCache.h:
1703         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: Instead of accessing the backing object directly (m_object) or through the macro _axBackingObject, uses self.axBackingObject.
1704         (AccessibilityUnignoredAncestor):
1705         (-[WebAccessibilityTextMarker initWithData:accessibilityObject:]):
1706         (-[WebAccessibilityObjectWrapper detach]):
1707         (-[WebAccessibilityObjectWrapper dealloc]):
1708         (-[WebAccessibilityObjectWrapper _prepareAccessibilityCall]):
1709         (-[WebAccessibilityObjectWrapper accessibilityCanFuzzyHitTest]):
1710         (-[WebAccessibilityObjectWrapper accessibilityHitTest:]):
1711         (-[WebAccessibilityObjectWrapper enableAttributeCaching]):
1712         (-[WebAccessibilityObjectWrapper disableAttributeCaching]):
1713         (-[WebAccessibilityObjectWrapper accessibilityElementCount]):
1714         (-[WebAccessibilityObjectWrapper accessibilityElementAtIndex:]):
1715         (-[WebAccessibilityObjectWrapper indexOfAccessibilityElement:]):
1716         (-[WebAccessibilityObjectWrapper _accessibilityPath]):
1717         (-[WebAccessibilityObjectWrapper accessibilityHasPopup]):
1718         (-[WebAccessibilityObjectWrapper accessibilityPopupValue]):
1719         (-[WebAccessibilityObjectWrapper accessibilityLanguage]):
1720         (-[WebAccessibilityObjectWrapper accessibilityIsDialog]):
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 accessibilityIsWebInteractiveVideo]):
1731         (-[WebAccessibilityObjectWrapper interactiveVideoDescription]):
1732         (-[WebAccessibilityObjectWrapper accessibilityIsMediaPlaying]):
1733         (-[WebAccessibilityObjectWrapper accessibilityIsMediaMuted]):
1734         (-[WebAccessibilityObjectWrapper accessibilityToggleMuteForMedia]):
1735         (-[WebAccessibilityObjectWrapper accessibilityVideoEnterFullscreen]):
1736         (-[WebAccessibilityObjectWrapper _accessibilityTextEntryTraits]):
1737         (-[WebAccessibilityObjectWrapper accessibilityTraits]):
1738         (-[WebAccessibilityObjectWrapper isSVGGroupElement]):
1739         (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
1740         (-[WebAccessibilityObjectWrapper stringValueShouldBeUsedInLabel]):
1741         (-[WebAccessibilityObjectWrapper _accessibilityHasTouchEventListener]):
1742         (-[WebAccessibilityObjectWrapper _accessibilityValueIsAutofilled]):
1743         (-[WebAccessibilityObjectWrapper _accessibilityIsStrongPasswordField]):
1744         (-[WebAccessibilityObjectWrapper _accessibilityMinValue]):
1745         (-[WebAccessibilityObjectWrapper _accessibilityMaxValue]):
1746         (-[WebAccessibilityObjectWrapper accessibilityRoleDescription]):
1747         (-[WebAccessibilityObjectWrapper accessibilityLabel]):
1748         (-[WebAccessibilityObjectWrapper tableCellParent]):
1749         (-[WebAccessibilityObjectWrapper tableParent]):
1750         (-[WebAccessibilityObjectWrapper accessibilityTitleElement]):
1751         (-[WebAccessibilityObjectWrapper accessibilityRowRange]):
1752         (-[WebAccessibilityObjectWrapper accessibilityBlockquoteLevel]):
1753         (-[WebAccessibilityObjectWrapper accessibilityDatetimeValue]):
1754         (-[WebAccessibilityObjectWrapper accessibilityPlaceholderValue]):
1755         (-[WebAccessibilityObjectWrapper accessibilityColorStringValue]):
1756         (-[WebAccessibilityObjectWrapper accessibilityValue]):
1757         (-[WebAccessibilityObjectWrapper accessibilityIsAttachmentElement]):
1758         (-[WebAccessibilityObjectWrapper accessibilityIsComboBox]):
1759         (-[WebAccessibilityObjectWrapper accessibilityHint]):
1760         (-[WebAccessibilityObjectWrapper accessibilityURL]):
1761         (-[WebAccessibilityObjectWrapper _accessibilityScrollToVisible]):
1762         (-[WebAccessibilityObjectWrapper accessibilityScroll:]):
1763         (-[WebAccessibilityObjectWrapper _accessibilityRelativeFrame]):
1764         (-[WebAccessibilityObjectWrapper accessibilityElementRect]):
1765         (-[WebAccessibilityObjectWrapper accessibilityVisibleContentRect]):
1766         (-[WebAccessibilityObjectWrapper accessibilityActivationPoint]):
1767         (-[WebAccessibilityObjectWrapper accessibilityFrame]):
1768         (-[WebAccessibilityObjectWrapper containsUnnaturallySegmentedChildren]):
1769         (-[WebAccessibilityObjectWrapper accessibilityContainer]):
1770         (-[WebAccessibilityObjectWrapper accessibilityFocusedUIElement]):
1771         (-[WebAccessibilityObjectWrapper _accessibilityWebDocumentView]):
1772         (-[WebAccessibilityObjectWrapper accessibilityCanSetValue]):
1773         (-[WebAccessibilityObjectWrapper accessibilityLinkRelationshipType]):
1774         (-[WebAccessibilityObjectWrapper accessibilityRequired]):
1775         (-[WebAccessibilityObjectWrapper accessibilityFlowToElements]):
1776         (-[WebAccessibilityObjectWrapper accessibilityLinkedElement]):
1777         (-[WebAccessibilityObjectWrapper isAttachment]):
1778         (-[WebAccessibilityObjectWrapper accessibilityTextualContext]):
1779         (-[WebAccessibilityObjectWrapper _accessibilityActivate]):
1780         (-[WebAccessibilityObjectWrapper attachmentView]):
1781         (-[WebAccessibilityObjectWrapper _accessibilityScrollPosition]):
1782         (-[WebAccessibilityObjectWrapper _accessibilityScrollSize]):
1783         (-[WebAccessibilityObjectWrapper _accessibilityScrollVisibleRect]):
1784         (-[WebAccessibilityObjectWrapper accessibilityFindMatchingObjects:]):
1785         (-[WebAccessibilityObjectWrapper accessibilityModifySelection:increase:]):
1786         (-[WebAccessibilityObjectWrapper accessibilityMoveSelectionToMarker:]):
1787         (-[WebAccessibilityObjectWrapper accessibilityIncrement]):
1788         (-[WebAccessibilityObjectWrapper accessibilityDecrement]):
1789         (-[WebAccessibilityObjectWrapper _accessibilitySetValue:]):
1790         (-[WebAccessibilityObjectWrapper stringForTextMarkers:]):
1791         (-[WebAccessibilityObjectWrapper arrayOfTextForTextMarkers:attributed:]):
1792         (-[WebAccessibilityObjectWrapper _convertToNSRange:]):
1793         (-[WebAccessibilityObjectWrapper _convertToDOMRange:]):
1794         (-[WebAccessibilityObjectWrapper positionForTextMarker:]):
1795         (-[WebAccessibilityObjectWrapper textMarkerRange]):
1796         (-[WebAccessibilityObjectWrapper textMarkerRangeForSelection]):
1797         (-[WebAccessibilityObjectWrapper textMarkerForPosition:]):
1798         (-[WebAccessibilityObjectWrapper stringForRange:]):
1799         (-[WebAccessibilityObjectWrapper _accessibilitySelectedTextRange]):
1800         (-[WebAccessibilityObjectWrapper _accessibilitySetSelectedTextRange:]):
1801         (-[WebAccessibilityObjectWrapper accessibilityReplaceRange:withText:]):
1802         (-[WebAccessibilityObjectWrapper accessibilityInsertText:]):
1803         (-[WebAccessibilityObjectWrapper selectedTextMarker]):
1804         (-[WebAccessibilityObjectWrapper lineEndMarkerForMarker:]):
1805         (-[WebAccessibilityObjectWrapper lineStartMarkerForMarker:]):
1806         (-[WebAccessibilityObjectWrapper misspellingTextMarkerRange:forward:]):
1807         (-[WebAccessibilityObjectWrapper frameForTextMarkers:]):
1808         (-[WebAccessibilityObjectWrapper rangeFromMarkers:withText:]):
1809         (-[WebAccessibilityObjectWrapper textMarkerForPoint:]):
1810         (-[WebAccessibilityObjectWrapper nextMarkerForCharacterOffset:]):
1811         (-[WebAccessibilityObjectWrapper previousMarkerForCharacterOffset:]):
1812         (-[WebAccessibilityObjectWrapper rangeForTextMarkers:]):
1813         (-[WebAccessibilityObjectWrapper startOrEndTextMarkerForTextMarkers:isStart:]):
1814         (-[WebAccessibilityObjectWrapper textMarkersForRange:]):
1815         (-[WebAccessibilityObjectWrapper accessibilityExpandedTextValue]):
1816         (-[WebAccessibilityObjectWrapper accessibilityIdentifier]):
1817         (-[WebAccessibilityObjectWrapper accessibilityARIAIsBusy]):
1818         (-[WebAccessibilityObjectWrapper accessibilityARIALiveRegionStatus]):
1819         (-[WebAccessibilityObjectWrapper accessibilityARIARelevantStatus]):
1820         (-[WebAccessibilityObjectWrapper accessibilityARIALiveRegionIsAtomic]):
1821         (-[WebAccessibilityObjectWrapper accessibilitySupportsARIAPressed]):
1822         (-[WebAccessibilityObjectWrapper accessibilityIsPressed]):
1823         (-[WebAccessibilityObjectWrapper accessibilitySupportsARIAExpanded]):
1824         (-[WebAccessibilityObjectWrapper accessibilityIsExpanded]):
1825         (-[WebAccessibilityObjectWrapper accessibilityIsShowingValidationMessage]):
1826         (-[WebAccessibilityObjectWrapper accessibilityInvalidStatus]):
1827         (-[WebAccessibilityObjectWrapper accessibilityARIACurrentStatus]):
1828         (-[WebAccessibilityObjectWrapper accessibilitySortDirection]):
1829         (-[WebAccessibilityObjectWrapper accessibilityMathRootIndexObject]):
1830         (-[WebAccessibilityObjectWrapper accessibilityMathRadicandObject]):
1831         (-[WebAccessibilityObjectWrapper accessibilityMathNumeratorObject]):
1832         (-[WebAccessibilityObjectWrapper accessibilityMathDenominatorObject]):
1833         (-[WebAccessibilityObjectWrapper accessibilityMathBaseObject]):
1834         (-[WebAccessibilityObjectWrapper accessibilityMathSubscriptObject]):
1835         (-[WebAccessibilityObjectWrapper accessibilityMathSuperscriptObject]):
1836         (-[WebAccessibilityObjectWrapper accessibilityMathUnderObject]):
1837         (-[WebAccessibilityObjectWrapper accessibilityMathOverObject]):
1838         (-[WebAccessibilityObjectWrapper accessibilityMathFencedOpenString]):
1839         (-[WebAccessibilityObjectWrapper accessibilityMathFencedCloseString]):
1840         (-[WebAccessibilityObjectWrapper accessibilityIsMathTopObject]):
1841         (-[WebAccessibilityObjectWrapper accessibilityMathLineThickness]):
1842         (-[WebAccessibilityObjectWrapper accessibilityMathType]):
1843         (-[WebAccessibilityObjectWrapper accessibilityClickPoint]):
1844         * accessibility/mac/AXObjectCacheMac.mm:
1845         (WebCore::AXObjectCache::attachWrapper): Attaches the given IsolatedObject and wrapper.
1846         * accessibility/mac/WebAccessibilityObjectWrapperBase.h:
1847         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
1848         (-[WebAccessibilityObjectWrapperBase initWithAccessibilityObject:]):
1849         (-[WebAccessibilityObjectWrapperBase attachAXObject:]):
1850         (-[WebAccessibilityObjectWrapperBase attachIsolatedObject:]):
1851         (-[WebAccessibilityObjectWrapperBase detach]):
1852         (-[WebAccessibilityObjectWrapperBase updateObjectBackingStore]):
1853         (-[WebAccessibilityObjectWrapperBase baseAccessibilityTitle]):
1854         (-[WebAccessibilityObjectWrapperBase axBackingObject]):
1855         (-[WebAccessibilityObjectWrapperBase baseAccessibilityDescription]):
1856         (-[WebAccessibilityObjectWrapperBase baseAccessibilitySpeechHint]):
1857         (-[WebAccessibilityObjectWrapperBase baseAccessibilityHelpText]):
1858         (-[WebAccessibilityObjectWrapperBase convertRectToSpace:space:]):
1859         (-[WebAccessibilityObjectWrapperBase ariaLandmarkRoleDescription]):
1860         (-[WebAccessibilityObjectWrapperBase baseAccessibilitySetFocus:]):
1861         (-[WebAccessibilityObjectWrapperBase accessibilityMathPostscriptPairs]):
1862         (-[WebAccessibilityObjectWrapperBase accessibilityMathPrescriptPairs]):
1863         (accessibilitySearchCriteriaForSearchPredicateParameterizedAttribute):
1864         (-[WebAccessibilityObjectWrapperBase accessibilityObject]): Deleted, axBackingObject should be used instead.
1865         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: Instead of accessing the backing object directly (m_object) or through the macro _axBackingObject, uses self.axBackingObject.
1866         (-[WebAccessibilityObjectWrapper attachmentView]):
1867         (-[WebAccessibilityObjectWrapper screenToContents:]):
1868         (-[WebAccessibilityObjectWrapper accessibilityObjectForTextMarker:]):
1869         (-[WebAccessibilityObjectWrapper textMarkerRangeFromRange:]):
1870         (-[WebAccessibilityObjectWrapper startOrEndTextMarkerForRange:isStart:]):
1871         (-[WebAccessibilityObjectWrapper nextTextMarkerForCharacterOffset:]):
1872         (-[WebAccessibilityObjectWrapper previousTextMarkerForCharacterOffset:]):
1873         (-[WebAccessibilityObjectWrapper textMarkerForCharacterOffset:]):
1874         (-[WebAccessibilityObjectWrapper rangeForTextMarkerRange:]):
1875         (-[WebAccessibilityObjectWrapper characterOffsetForTextMarker:]):
1876         (-[WebAccessibilityObjectWrapper textMarkerForVisiblePosition:]):
1877         (-[WebAccessibilityObjectWrapper textMarkerForFirstPositionInTextControl:]):
1878         (-[WebAccessibilityObjectWrapper visiblePositionForTextMarker:]):
1879         (-[WebAccessibilityObjectWrapper doAXAttributedStringForTextMarkerRange:spellCheck:]):
1880         (-[WebAccessibilityObjectWrapper textMarkerRangeFromVisiblePositions:endPosition:]):
1881         (-[WebAccessibilityObjectWrapper ALLOW_DEPRECATED_IMPLEMENTATIONS_END]):
1882         (-[WebAccessibilityObjectWrapper additionalAccessibilityAttributeNames]):
1883         (-[WebAccessibilityObjectWrapper visiblePositionRangeForTextMarkerRange:]):
1884         (-[WebAccessibilityObjectWrapper renderWidgetChildren]):
1885         (-[WebAccessibilityObjectWrapper remoteAccessibilityParentObject]):
1886         (convertToVector):
1887         (-[WebAccessibilityObjectWrapper textMarkerRangeForSelection]):
1888         (-[WebAccessibilityObjectWrapper associatedPluginParent]):
1889         (-[WebAccessibilityObjectWrapper path]):
1890         (-[WebAccessibilityObjectWrapper childrenVectorSize]):
1891         (-[WebAccessibilityObjectWrapper childrenVectorArray]):
1892         (-[WebAccessibilityObjectWrapper position]):
1893         (-[WebAccessibilityObjectWrapper role]):
1894         (-[WebAccessibilityObjectWrapper subrole]):
1895         (-[WebAccessibilityObjectWrapper roleDescription]):
1896         (-[WebAccessibilityObjectWrapper computedRoleString]):
1897         (-[WebAccessibilityObjectWrapper scrollViewParent]):
1898         (-[WebAccessibilityObjectWrapper valueDescriptionForMeter]):
1899         (-[WebAccessibilityObjectWrapper windowElement:]):
1900         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
1901         (-[WebAccessibilityObjectWrapper accessibilityFocusedUIElement]):
1902         (-[WebAccessibilityObjectWrapper accessibilityHitTest:]):
1903         (-[WebAccessibilityObjectWrapper accessibilityIsAttributeSettable:]):
1904         (-[WebAccessibilityObjectWrapper _accessibilityPerformPressAction]):
1905         (-[WebAccessibilityObjectWrapper _accessibilityPerformIncrementAction]):
1906         (-[WebAccessibilityObjectWrapper _accessibilityPerformDecrementAction]):
1907         (-[WebAccessibilityObjectWrapper accessibilityPerformShowMenuAction]):
1908         (-[WebAccessibilityObjectWrapper _accessibilityShowContextMenu]):
1909         (-[WebAccessibilityObjectWrapper accessibilityScrollToVisible]):
1910         (-[WebAccessibilityObjectWrapper _accessibilityScrollToMakeVisibleWithSubFocus:]):
1911         (-[WebAccessibilityObjectWrapper _accessibilityScrollToGlobalPoint:]):
1912         (-[WebAccessibilityObjectWrapper accessibilityReplaceRange:withText:]):
1913         (-[WebAccessibilityObjectWrapper accessibilityInsertText:]):
1914         (-[WebAccessibilityObjectWrapper _accessibilitySetValue:forAttribute:]):
1915         (-[WebAccessibilityObjectWrapper doAXAttributedStringForRange:]):
1916         (-[WebAccessibilityObjectWrapper _convertToNSRange:]):
1917         (-[WebAccessibilityObjectWrapper _indexForTextMarker:]):
1918         (-[WebAccessibilityObjectWrapper _textMarkerForIndex:]):
1919         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
1920         (-[WebAccessibilityObjectWrapper accessibilityIndexOfChild:]):
1921         (-[WebAccessibilityObjectWrapper accessibilityArrayAttributeCount:]):
1922         (-[WebAccessibilityObjectWrapper accessibilityArrayAttributeValues:index:maxCount:]):
1923
1924 2020-01-23  Jer Noble  <jer.noble@apple.com>
1925
1926         [EME] Key renewal fails when using AVContentKeyReportGroup
1927         https://bugs.webkit.org/show_bug.cgi?id=206694
1928         <rdar://problem/58628345>
1929
1930         Reviewed by Eric Carlson.
1931
1932         When a CDMInstanceSession has a AVContentKeyReportGroup, it doesn't have an AVContentKeySession; it has
1933         to get the session from it's parent CDMInstance to request key renewal.
1934
1935         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
1936         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::updateLicense):
1937
1938 2020-01-23  David Kilzer  <ddkilzer@apple.com>
1939
1940         Enable -Wconditional-uninitialized in WebCore project
1941         <https://webkit.org/b/206508>
1942
1943         Reviewed by Darin Adler.
1944
1945         * Configurations/Base.xcconfig:
1946         (WARNING_CFLAGS): Add -Wconditional-uninitialized switch.
1947
1948         * Modules/webgpu/WHLSL/WHLSLIntrinsics.cpp:
1949         (WebCore::WHLSL::Intrinsics::addFullTexture):
1950         - Initialize `vectorLength` to zero and add release assert that
1951           it is in a valid range [1-4] to prevent buffer out-of-bounds
1952           reads.
1953         - Change ASSERT() to ASSERT_WITH_SECURITY_IMPLICATION() since
1954           they all have security implications.
1955
1956         * Modules/webgpu/WHLSL/WHLSLParser.cpp:
1957         (WebCore::WHLSL::Parser::parseResourceSemantic):
1958         - Add default case to switch statement with release assert since
1959           `mode` is not set for all possible character values.
1960
1961         * accessibility/AXObjectCache.cpp:
1962         (WebCore::characterForCharacterOffset):
1963         - Ignore -Wconditional-warning for U16_NEXT() macro. Fix must be
1964           in compiler or in ICU header.
1965
1966         * bindings/js/SerializedScriptValue.cpp:
1967         (WebCore::CloneDeserializer::readRSAKey):
1968         - Initialize `hash` to CryptoAlgorithmIdentifier::SHA_1.  SHA_1
1969           was chosen since Optional<CryptoAlgorithmIdentifier>
1970           parameters use that as a default vaule in
1971           crypto/keys/CryptoKeyRSA.cpp.
1972
1973         * contentextensions/DFABytecodeCompiler.cpp:
1974         (WebCore::ContentExtensions::DFABytecodeCompiler::transitions):
1975         - Initialize `rangeMin` to 0.
1976
1977         * css/parser/CSSSupportsParser.cpp:
1978         (WebCore::CSSSupportsParser::consumeCondition):
1979         - Initialize `result` to false.
1980
1981         * cssjit/SelectorCompiler.cpp:
1982         (WebCore::SelectorCompiler::SelectorCodeGenerator::modulo):
1983         - Initialize `inputDividendCopy` to JSC::InvalidGPRReg.
1984
1985         * dom/Document.cpp:
1986         (WebCore::Document::processHttpEquiv):
1987         - Initialize `delay` to zero.
1988
1989         * rendering/svg/RenderSVGResourceGradient.cpp:
1990         (WebCore::RenderSVGResourceGradient::applyResource):
1991         - Initialize `gradientData` to nullptr.  This false positive is
1992           tracked by <rdar://problem/58615489>.
1993
1994 2020-01-23  Per Arne Vollan  <pvollan@apple.com>
1995
1996         [Cocoa] Broker access to the PowerManagement API
1997         https://bugs.webkit.org/show_bug.cgi?id=206373
1998
1999         Reviewed by Darin Adler.
2000
2001         Code to determine if device has battery should be executed in the UI process.
2002
2003         API test: WebKit.SystemHasBattery
2004
2005         * WebCore.xcodeproj/project.pbxproj:
2006         * platform/cocoa/SystemBattery.h: Added.
2007         * platform/cocoa/SystemBattery.mm: Added.
2008         (WebCore::setSystemHasBattery):
2009         (WebCore::systemHasBattery):
2010         * platform/graphics/avfoundation/objc/AVAssetTrackUtilities.mm:
2011         (WebCore::systemHasBattery): Deleted.
2012         * testing/Internals.cpp:
2013         (WebCore::Internals::systemHasBattery const):
2014         * testing/Internals.h:
2015         * testing/Internals.idl:
2016
2017 2020-01-23  Antoine Quint  <graouts@apple.com>
2018
2019         [Web Animations] Make AnimationList ref-counted
2020         https://bugs.webkit.org/show_bug.cgi?id=206664
2021
2022         Reviewed by Antti Koivisto.
2023
2024         * platform/animation/AnimationList.cpp:
2025         * platform/animation/AnimationList.h:
2026         (WebCore::AnimationList::create):
2027         (WebCore::AnimationList::copy):
2028         (WebCore::AnimationList::AnimationList): Deleted.
2029         * rendering/style/RenderStyle.cpp:
2030         (WebCore::RenderStyle::ensureAnimations):
2031         (WebCore::RenderStyle::ensureTransitions):
2032         * rendering/style/StyleRareNonInheritedData.cpp:
2033         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
2034         * rendering/style/StyleRareNonInheritedData.h:
2035
2036 2020-01-23  Alex Christensen  <achristensen@webkit.org>
2037
2038         ContentFilter should access DocumentLoader through an interface
2039         https://bugs.webkit.org/show_bug.cgi?id=206564
2040
2041         Reviewed by Andy Estes.
2042
2043         This will make it easier to move, like to the NetworkProcess where there are no DocumentLoaders.
2044         Also use WTF::Function instead of std::function and UniqueRef instead of std::unique_ptr.
2045         No change in behavior.
2046
2047         * WebCore.xcodeproj/project.pbxproj:
2048         * loader/ContentFilter.cpp:
2049         (WebCore::ContentFilter::types):
2050         (WebCore::ContentFilter::create):
2051         (WebCore::ContentFilter::ContentFilter):
2052         (WebCore::ContentFilter::continueAfterWillSendRequest):
2053         (WebCore::ContentFilter::continueAfterResponseReceived):
2054         (WebCore::ContentFilter::continueAfterDataReceived):
2055         (WebCore::ContentFilter::continueAfterNotifyFinished):
2056         (WebCore::ContentFilter::forEachContentFilterUntilBlocked):
2057         (WebCore::ContentFilter::didDecide):
2058         (WebCore::ContentFilter::deliverResourceData):
2059         (WebCore::ContentFilter::handleProvisionalLoadFailure):
2060         (): Deleted.
2061         * loader/ContentFilter.h:
2062         * loader/ContentFilterClient.h: Added.
2063         (WebCore::ContentFilterClient::~ContentFilterClient):
2064         * loader/DocumentLoader.cpp:
2065         (WebCore::DocumentLoader::handleProvisionalLoadFailure):
2066         (WebCore::DocumentLoader::didBlock):
2067         * loader/DocumentLoader.h:
2068         * platform/cocoa/NetworkExtensionContentFilter.h:
2069         * platform/cocoa/NetworkExtensionContentFilter.mm:
2070         (WebCore::NetworkExtensionContentFilter::create):
2071         * platform/cocoa/ParentalControlsContentFilter.h:
2072         * platform/cocoa/ParentalControlsContentFilter.mm:
2073         (WebCore::ParentalControlsContentFilter::create):
2074
2075 2020-01-23  Zalan Bujtas  <zalan@apple.com>
2076
2077         [LFC][IFC] Do not special case formatting root layout
2078         https://bugs.webkit.org/show_bug.cgi?id=206641
2079         <rdar://problem/58823548>
2080
2081         Reviewed by Antti Koivisto.
2082
2083         Let's move out all the formatting context layout logic from layoutFormattingContextRoot.
2084
2085         * layout/inlineformatting/InlineFormattingContext.cpp:
2086         (WebCore::Layout::InlineFormattingContext::layoutInFlowContent):
2087         (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot): Deleted.
2088         (WebCore::Layout::InlineFormattingContext::computeHorizontalAndVerticalGeometry): Deleted.
2089         (WebCore::Layout::InlineFormattingContext::computeWidthAndHeightForReplacedInlineBox): Deleted.
2090         * layout/inlineformatting/InlineFormattingContext.h:
2091         * layout/layouttree/LayoutBox.cpp:
2092         (WebCore::Layout::Box::isInlineTableBox const):
2093         (WebCore::Layout::Box::isInlineLevelBox const):
2094         * layout/layouttree/LayoutBox.h:
2095
2096 2020-01-23  Antti Koivisto  <antti@apple.com>
2097
2098         fast/css/first-letter-and-float-crash.html asserts under ComplexLineLayout::createLineBoxes
2099         https://bugs.webkit.org/show_bug.cgi?id=206651
2100         <rdar://problem/54889982>
2101
2102         Reviewed by Anders Carlsson.
2103
2104         Take care that the first-letter style has the correct styleType set even when getCachedPseudoStyle failed.
2105         This is used for checking if there is an existing first letter renderer.
2106
2107         * rendering/updating/RenderTreeBuilderFirstLetter.cpp:
2108         (WebCore::styleForFirstLetter):
2109
2110 2020-01-23  Takashi Komori  <Takashi.Komori@sony.com>
2111
2112         KeyedDecoderGeneric crashes when it accesses a data with empty string key.
2113         https://bugs.webkit.org/show_bug.cgi?id=206572
2114
2115         Reviewed by Fujii Hironori.
2116
2117         Changed null string which was used for HasMap key to empty string.
2118
2119         Test: TestWebKitAPI/Tests/WebCore/KeyedCoding.cpp
2120
2121         * platform/generic/KeyedDecoderGeneric.cpp:
2122         (WebCore::readString):
2123
2124 2020-01-23  Yusuke Suzuki  <ysuzuki@apple.com>
2125
2126         nomodule scripts are fetched in some cases (with empty cache or in new tab)
2127         https://bugs.webkit.org/show_bug.cgi?id=194337
2128         <rdar://problem/49700924>
2129
2130         Reviewed by Ryosuke Niwa.
2131
2132         The preloader attempt to preload "src" of script tags. However, script tag attributed with "nomodule"
2133         will never be executed by WebKit since it already supports modules. Avoid loading this content in
2134         the preloader.
2135
2136         Test: http/wpt/preload/classic-script-with-nomodule.html
2137
2138         * html/parser/HTMLPreloadScanner.cpp:
2139         (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):
2140         (WebCore::TokenPreloadScanner::StartTagScanner::shouldPreload):
2141
2142 2020-01-22  Fujii Hironori  <Hironori.Fujii@sony.com>
2143
2144         [WinCairo] Some of combining family glyphs are replaced by space glyphs
2145         https://bugs.webkit.org/show_bug.cgi?id=205485
2146
2147         Reviewed by Myles C. Maxfield.
2148
2149         Although ComplexTextControllerUniscribe requires
2150         glyph-to-character mapping (stringIndices), Uniscribe returns
2151         character-to-glyph mapping (clusters). So, we are converting it.
2152         And, this is not simple task due to the following reasons.
2153
2154         1. ComplexTextControllerUniscribe replaces glyphs, which are
2155         corresponding to space characters, with space glyphs.
2156
2157         For example, 👨‍👦 (man+boy, U+1F468 ZWJ U+1F466) consists of a 5
2158         length UTF-16 string.
2159
2160         Uniscribe returns:
2161
2162         glyphs: [6368 6318] (father and boy glyphs)
2163         clusters:  [0 0 1 1 1]
2164
2165         This means U+1F468 is mapping to the father glyph, and ZWJ U+1F466
2166         are mapping to the boy glyph. If one simply converts this to
2167         glyph-to-character mapping, it would be [0 2]. This means the
2168         father glyph is mapping to U+1F468, and the boy glyph is mapping
2169         to ZWJ. As the result, ComplexTextControllerUniscribe replaces the
2170         boy glyph with a space glyph because it is mapped to ZWJ. So, by
2171         somehow skipping space characters, we need to convert the clusters
2172         to a glyph-to-character mapping [0 3].
2173
2174         2. Uniscribe returns the rightmost glyphs for combining glyphs in
2175         RTL text even though it returns the leftmost one for LTR.
2176
2177         For example, if a string "abc" are generating combining glyphs "AB",
2178         Uniscribe returns clusters [0 0] for LTR text, but [1 1] for RTL text.
2179
2180         Test: fast/text/emoji-single-parent-family-3.html
2181
2182         * platform/graphics/win/ComplexTextControllerUniscribe.cpp:
2183         (WebCore::BidiRange::BidiRange): Added.
2184         (WebCore::BidiRange::Iterator::Iterator):
2185         (WebCore::BidiRange::Iterator::operator++):
2186         (WebCore::BidiRange::Iterator::operator*):
2187         (WebCore::BidiRange::Iterator::operator==):
2188         (WebCore::BidiRange::Iterator::operator!=):
2189         (WebCore::BidiRange::Iterator::index):
2190         (WebCore::BidiRange::begin const):
2191         (WebCore::BidiRange::end const):
2192         (WebCore::stringIndicesFromClusters): Added.
2193         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
2194
2195 2020-01-22  Jon Lee  <jonlee@apple.com>
2196
2197         [Media in GPU process] Pipe more MediaPlayerPrivate and client methods
2198         https://bugs.webkit.org/show_bug.cgi?id=206468
2199
2200         Reviewed by Eric Carlson.
2201
2202         * html/HTMLMediaElement.cpp:
2203         (WebCore::HTMLMediaElement::mediaPlayerCurrentPlaybackTargetIsWirelessChanged):
2204         * html/HTMLMediaElement.h:
2205         * platform/graphics/MediaPlayer.cpp:
2206         (WebCore::MediaPlayer::currentPlaybackTargetIsWirelessChanged):
2207         * platform/graphics/MediaPlayer.h: Add resourceNotSupported() to call up to the client.
2208         (WebCore::MediaPlayerClient::mediaPlayerCurrentPlaybackTargetIsWirelessChanged):
2209         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
2210         (WebCore::MediaPlayerPrivateAVFoundation::playbackTargetIsWirelessChanged):
2211         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2212         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setShouldPlayToPlaybackTarget):
2213
2214 2020-01-22  Zalan Bujtas  <zalan@apple.com>
2215
2216         [LFC][IFC] Use "inline box" or "atomic inline level box" instead of inline container
2217         https://bugs.webkit.org/show_bug.cgi?id=206592
2218         <rdar://problem/58799970>
2219
2220         Reviewed by Antti Koivisto.
2221
2222         Inline container is not a spec term.
2223
2224         * layout/inlineformatting/InlineFormattingContext.cpp:
2225         (WebCore::Layout::InlineFormattingContext::computeHorizontalAndVerticalGeometry):
2226         (WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthConstraints):
2227         (WebCore::Layout::InlineFormattingContext::collectInlineContentIfNeeded):
2228         * layout/layouttree/LayoutBox.cpp:
2229         (WebCore::Layout::Box::isInlineBox const):
2230         (WebCore::Layout::Box::isAtomicInlineLevelBox const):
2231         * layout/layouttree/LayoutBox.h:
2232         (WebCore::Layout::Box::isContainer const):
2233         (WebCore::Layout::Box::isBlockContainer const): Deleted.
2234         (WebCore::Layout::Box::isInlineContainer const): Deleted.
2235         * layout/layouttree/LayoutTreeBuilder.cpp:
2236         (WebCore::Layout::outputLayoutBox):
2237
2238 2020-01-22  Don Olmstead  <don.olmstead@sony.com>
2239
2240         [OpenSSL] Add stubs and build for Web Crypto
2241         https://bugs.webkit.org/show_bug.cgi?id=206449
2242
2243         Reviewed by Jiewen Tan.
2244
2245         Add stubs for an OpenSSL implementation of Web Crypto. Add the associated CMake
2246         files for OpenSSL platforms and reference them on the platforms using OpenSSL.
2247
2248         Tests will be enabled as functionality lands.
2249
2250         * PlatformFTW.cmake:
2251         * PlatformPlayStation.cmake:
2252         * PlatformWinCairo.cmake:
2253         * crypto/keys/CryptoKeyEC.h:
2254         * crypto/keys/CryptoKeyRSA.h:
2255         * crypto/openssl/CryptoAlgorithmAES_CBCOpenSSL.cpp: Added.
2256         (WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
2257         (WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
2258         * crypto/openssl/CryptoAlgorithmAES_CFBOpenSSL.cpp: Added.
2259         (WebCore::CryptoAlgorithmAES_CFB::platformEncrypt):
2260         (WebCore::CryptoAlgorithmAES_CFB::platformDecrypt):
2261         * crypto/openssl/CryptoAlgorithmAES_CTROpenSSL.cpp: Added.
2262         (WebCore::CryptoAlgorithmAES_CTR::platformEncrypt):
2263         (WebCore::CryptoAlgorithmAES_CTR::platformDecrypt):
2264         * crypto/openssl/CryptoAlgorithmAES_GCMOpenSSL.cpp: Added.
2265         (WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
2266         (WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
2267         * crypto/openssl/CryptoAlgorithmAES_KWOpenSSL.cpp: Added.
2268         (WebCore::CryptoAlgorithmAES_KW::platformWrapKey):
2269         (WebCore::CryptoAlgorithmAES_KW::platformUnwrapKey):
2270         * crypto/openssl/CryptoAlgorithmECDHOpenSSL.cpp: Added.
2271         (WebCore::CryptoAlgorithmECDH::platformDeriveBits):
2272         * crypto/openssl/CryptoAlgorithmECDSAOpenSSL.cpp: Added.
2273         (WebCore::CryptoAlgorithmECDSA::platformSign):
2274         (WebCore::CryptoAlgorithmECDSA::platformVerify):
2275         * crypto/openssl/CryptoAlgorithmHKDFOpenSSL.cpp: Added.
2276         (WebCore::CryptoAlgorithmHKDF::platformDeriveBits):
2277         * crypto/openssl/CryptoAlgorithmHMACOpenSSL.cpp: Added.
2278         (WebCore::CryptoAlgorithmHMAC::platformSign):
2279         (WebCore::CryptoAlgorithmHMAC::platformVerify):
2280         * crypto/openssl/CryptoAlgorithmPBKDF2OpenSSL.cpp: Added.
2281         (WebCore::CryptoAlgorithmPBKDF2::platformDeriveBits):
2282         * crypto/openssl/CryptoAlgorithmRSAES_PKCS1_v1_5OpenSSL.cpp: Added.
2283         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformEncrypt):
2284         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformDecrypt):
2285         * crypto/openssl/CryptoAlgorithmRSASSA_PKCS1_v1_5OpenSSL.cpp: Added.
2286         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformSign):
2287         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformVerify):
2288         * crypto/openssl/CryptoAlgorithmRSA_OAEPOpenSSL.cpp: Added.
2289         (WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt):
2290         (WebCore::CryptoAlgorithmRSA_OAEP::platformDecrypt):
2291         * crypto/openssl/CryptoAlgorithmRSA_PSSOpenSSL.cpp: Added.
2292         (WebCore::CryptoAlgorithmRSA_PSS::platformSign):
2293         (WebCore::CryptoAlgorithmRSA_PSS::platformVerify):
2294         * crypto/openssl/CryptoAlgorithmRegistryOpenSSL.cpp: Added.
2295         (WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms):
2296         * crypto/openssl/CryptoKeyECOpenSSL.cpp: Added.
2297         (WebCore::CryptoKeyEC::keySizeInBits const):
2298         (WebCore::CryptoKeyEC::platformSupportedCurve):
2299         (WebCore::CryptoKeyEC::platformGeneratePair):
2300         (WebCore::CryptoKeyEC::platformImportRaw):
2301         (WebCore::CryptoKeyEC::platformImportJWKPublic):
2302         (WebCore::CryptoKeyEC::platformImportJWKPrivate):
2303         (WebCore::CryptoKeyEC::platformImportSpki):
2304         (WebCore::CryptoKeyEC::platformImportPkcs8):
2305         (WebCore::CryptoKeyEC::platformExportRaw const):
2306         (WebCore::CryptoKeyEC::platformAddFieldElements const):
2307         (WebCore::CryptoKeyEC::platformExportSpki const):
2308         (WebCore::CryptoKeyEC::platformExportPkcs8 const):
2309         * crypto/openssl/CryptoKeyRSAOpenSSL.cpp: Added.
2310         (WebCore::CryptoKeyRSA::create):
2311         (WebCore::CryptoKeyRSA::isRestrictedToHash const):
2312         (WebCore::CryptoKeyRSA::keySizeInBits const):
2313         (WebCore::CryptoKeyRSA::generatePair):
2314         (WebCore::CryptoKeyRSA::importSpki):
2315         (WebCore::CryptoKeyRSA::importPkcs8):
2316         (WebCore::CryptoKeyRSA::exportSpki const):
2317         (WebCore::CryptoKeyRSA::exportPkcs8 const):
2318         (WebCore::CryptoKeyRSA::exportData const):
2319         * crypto/openssl/SerializedCryptoKeyWrapOpenSSL.cpp: Added.
2320         (WebCore::getDefaultWebCryptoMasterKey):
2321         (WebCore::wrapSerializedCryptoKey):
2322         (WebCore::unwrapSerializedCryptoKey):
2323         * platform/OpenSSL.cmake: Added.
2324
2325 2020-01-22  Fujii Hironori  <Hironori.Fujii@sony.com>
2326
2327         preprocess-idls.pl: CygwinPathIfNeeded should use Cygwin::win_to_posix_path instead of invoking cygpath
2328         https://bugs.webkit.org/show_bug.cgi?id=206407
2329
2330         Reviewed by Chris Dumez.
2331
2332         preprocess-idls.pl was invoking cygpath command for all input IDL
2333         files. Use Cygwin::win_to_posix_path function instead.
2334
2335         * bindings/scripts/preprocess-idls.pl: Changed the way to load idlFilesList as well as generate-bindings-all.pl does.
2336         (CygwinPathIfNeeded): Copied from CygwinPathIfNeeded of generate-bindings-all.pl.
2337
2338 2020-01-21  Ryosuke Niwa  <rniwa@webkit.org>
2339
2340         Make a Ref to WindowEventLoop when the timer to run tasks fires
2341         https://bugs.webkit.org/show_bug.cgi?id=206568
2342
2343         Reviewed by Antti Koivisto.
2344
2345         Keep WindowEventLoop alive explicitly while invoking EventLoop::run.
2346
2347         * dom/WindowEventLoop.cpp:
2348         (WebCore::WindowEventLoop::WindowEventLoop):
2349         (WebCore::WindowEventLoop::didReachTimeToRun):
2350         * dom/WindowEventLoop.h:
2351
2352 2020-01-22  Brady Eidson  <beidson@apple.com>
2353
2354         REGRESSION (r253519): [WKWebView evaluateJavaScript:completionHandler:] gives a non-nil, non-Error result even when JavaScript cannot be evaluated
2355         <rdar://problem/58544942> and https://bugs.webkit.org/show_bug.cgi?id=206608
2356
2357         Reviewed by Alex Christensen.
2358
2359         Covered by new API test.
2360
2361         * bindings/js/ScriptController.cpp:
2362         (WebCore::ScriptController::executeScriptInWorld): Address a FIXME added in 253519 which had predicted this problem.
2363
2364 2020-01-22  Chris Dumez  <cdumez@apple.com>
2365
2366         Unreviewed, fix build with recent SDKs.
2367
2368         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
2369         (WebCore::MediaPlaybackTargetPickerMac::externalOutputDeviceAvailable):
2370         (WebCore::MediaPlaybackTargetPickerMac::devicePicker):
2371         (WebCore::MediaPlaybackTargetPickerMac::showPlaybackTargetPicker):
2372
2373 2020-01-22  Nikos Mouchtaris  <nmouchtaris@apple.com>
2374
2375         Automatic link replacement via "Smart links" should emit "insertLink" input events
2376         https://bugs.webkit.org/show_bug.cgi?id=191306
2377         <rdar://problem/58491514>
2378
2379         Reviewed by Wenson Hsieh.
2380
2381         Added support for outputting "insertLink" for input type and the url for the 
2382         data of the input event when smart link is used.
2383
2384         Test: fast/events/input-event-insert-link.html
2385
2386         * editing/CreateLinkCommand.h:
2387         * editing/EditCommand.cpp:
2388         (WebCore::inputTypeNameForEditingAction):
2389
2390 2020-01-22  Said Abou-Hallawa  <sabouhallawa@apple.com>
2391
2392         Remove ImageBuffer::sizeForDestinationSize()
2393         https://bugs.webkit.org/show_bug.cgi?id=206541
2394
2395         Reviewed by Tim Horton.
2396
2397         -- Remove ImageBuffer::sizeForDestinationSize() since it is currently
2398            doing nothing. For CG and D2D ports, it scales a rect by the ratio
2399            backingStoreSize / internalSize which is always 1. The constructor
2400            ImageBuffer::ImageBuffer() sets m_size and m_data.backingStoreSize
2401            to the same value always.
2402
2403         -- Remove ImageBuffer::isCompatibleWithContext() since it is not used.
2404
2405         -- Remove ImageBuffer::fastCopyImageMode() since it returns 
2406            DontCopyBackingStore on all ports.
2407
2408         * html/CustomPaintCanvas.cpp:
2409         (WebCore::CustomPaintCanvas::copiedImage const):
2410         * html/canvas/WebGLRenderingContextBase.cpp:
2411         (WebCore::WebGLRenderingContextBase::texSubImage2D):
2412         (WebCore::WebGLRenderingContextBase::texImage2D):
2413         (WebCore::WebGLRenderingContextBase::drawImageIntoBuffer):
2414         * platform/graphics/ImageBuffer.cpp:
2415         (WebCore::ImageBuffer::sizeForDestinationSize const): Deleted.
2416         (WebCore::ImageBuffer::isCompatibleWithContext const): Deleted.
2417         * platform/graphics/ImageBuffer.h:
2418         (WebCore::ImageBuffer::logicalSize const):
2419         * platform/graphics/cairo/ImageBufferCairo.cpp:
2420         (WebCore::ImageBuffer::fastCopyImageMode): Deleted.
2421         * platform/graphics/cg/GraphicsContextCG.cpp:
2422         (WebCore::GraphicsContext::clipToImageBuffer):
2423         * platform/graphics/cg/ImageBufferCG.cpp:
2424         (WebCore::ImageBuffer::ImageBuffer):
2425         (WebCore::createBitmapImageAfterScalingIfNeeded):
2426         (WebCore::ImageBuffer::copyImage const):
2427         (WebCore::ImageBuffer::sinkIntoImage):
2428         (WebCore::ImageBuffer::toCFData const):
2429         (WebCore::scaleSizeToUserSpace): Deleted.
2430         (WebCore::ImageBuffer::sizeForDestinationSize const): Deleted.
2431         (WebCore::ImageBuffer::fastCopyImageMode): Deleted.
2432         * platform/graphics/win/ImageBufferDirect2D.cpp:
2433         (WebCore::scaleSizeToUserSpace): Deleted.
2434         (WebCore::ImageBuffer::sizeForDestinationSize const): Deleted.
2435         (WebCore::ImageBuffer::fastCopyImageMode): Deleted.
2436
2437 2020-01-22  Zalan Bujtas  <zalan@apple.com>
2438
2439         [LFC] Do not create a FormattingContext to compute intrinsic width unless there's some content.
2440         https://bugs.webkit.org/show_bug.cgi?id=206581
2441         <rdar://problem/58798593>
2442
2443         Reviewed by Antti Koivisto.
2444
2445         We should only construct a formatting context when it has some content.
2446
2447         * layout/FormattingContext.cpp:
2448         (WebCore::Layout::FormattingContext::FormattingContext):
2449         * layout/FormattingContextGeometry.cpp:
2450         (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
2451         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2452         (WebCore::Layout::BlockFormattingContext::Geometry::intrinsicWidthConstraints):
2453         * layout/inlineformatting/InlineFormattingContext.cpp:
2454         (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingRoot):
2455
2456 2020-01-22  Chris Dumez  <cdumez@apple.com>
2457
2458         Frequent NetworkConnectionToWebProcess::CookiesEnabled sync IPC when browsing reddit.com
2459         https://bugs.webkit.org/show_bug.cgi?id=206450
2460
2461         Reviewed by Darin Adler.
2462
2463         Move HTTPCookieAcceptPolicy.h header from WebKit to WebCore so that the HTTPCookieAcceptPolicy enum
2464         can be used in NetworkStorageSession. Replace NetworkStorageSession::cookiesEnabled() with a more
2465         detailed NetworkStorageSession::cookieAcceptPolicy() method.
2466
2467         * WebCore.xcodeproj/project.pbxproj:
2468         * loader/CookieJar.cpp:
2469         (WebCore::CookieJar::cookiesEnabled const):
2470         * platform/network/HTTPCookieAcceptPolicy.h: Renamed from Source/WebKit/Shared/HTTPCookieAcceptPolicy.h.
2471         * platform/network/NetworkStorageSession.cpp:
2472         * platform/network/NetworkStorageSession.h:
2473         * platform/network/cf/NetworkStorageSessionCFNetWin.cpp:
2474         (WebCore::NetworkStorageSession::cookieAcceptPolicy const):
2475         * platform/network/cocoa/NetworkStorageSessionCocoa.mm:
2476         (WebCore::NetworkStorageSession::cookieAcceptPolicy const):
2477         * platform/network/curl/NetworkStorageSessionCurl.cpp:
2478         (WebCore::NetworkStorageSession::cookieAcceptPolicy const):
2479         * platform/network/soup/NetworkStorageSessionSoup.cpp:
2480         (WebCore::NetworkStorageSession::cookieAcceptPolicy const):
2481
2482 2020-01-22  Chris Dumez  <cdumez@apple.com>
2483
2484         Stop doing synchronous DecidePolicyForNavigationActionSync IPCs for initially empty document loads
2485         https://bugs.webkit.org/show_bug.cgi?id=206458
2486
2487         Reviewed by Alex Christensen.
2488
2489         Stop doing synchronous DecidePolicyForNavigationActionSync IPCs for initially empty document loads. Instead, we
2490         now do regular asynchronous DecidePolicyForNavigationAction IPCs for such loads and we ignore the response from
2491         the client, allowing WebCore to proceed with the load synchronously.
2492
2493         * loader/PolicyChecker.cpp:
2494         (WebCore::PolicyChecker::checkNavigationPolicy):
2495
2496 2020-01-22  Zalan Bujtas  <zalan@apple.com>
2497
2498         [LFC] Do not create a FormattingContext unless there's content to layout.
2499         https://bugs.webkit.org/show_bug.cgi?id=206570
2500         <rdar://problem/58785735>
2501
2502         Reviewed by Antti Koivisto.
2503
2504         We still construct "no-op" FormattingContexts through the computeIntrinsicWidth* codepath (see webkit.org/b/206581).
2505
2506         * layout/FormattingContext.cpp:
2507         (WebCore::Layout::FormattingContext::FormattingContext):
2508         (WebCore::Layout::FormattingContext::layoutOutOfFlowContent):
2509         * layout/blockformatting/BlockFormattingContext.cpp:
2510         (WebCore::Layout::BlockFormattingContext::layoutInFlowContent):
2511         * layout/inlineformatting/InlineFormattingContext.cpp:
2512         (WebCore::Layout::InlineFormattingContext::layoutInFlowContent):
2513         (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot):
2514         * layout/tableformatting/TableFormattingContext.cpp:
2515         (WebCore::Layout::TableFormattingContext::layoutTableCellBox):
2516
2517 2020-01-22  Antti Koivisto  <antti@apple.com>
2518
2519         [LFC][Integration] Disable integration to see performance impact
2520         https://bugs.webkit.org/show_bug.cgi?id=206576
2521         <rdar://problem/58562185>
2522
2523         Reviewed by Zalan Bujtas.
2524
2525         Disable by default for now to get a clearer picture of the performance impact.
2526
2527         * page/RuntimeEnabledFeatures.h:
2528
2529 2020-01-22  Zalan Bujtas  <zalan@apple.com>
2530
2531         [LFC][BFC] No need to special case formatting context root layout
2532         https://bugs.webkit.org/show_bug.cgi?id=206569
2533         <rdar://problem/58784767>
2534
2535         Reviewed by Antti Koivisto.
2536
2537         Let's move out all the formatting context layout logic from layoutFormattingContextRoot.
2538
2539         * layout/blockformatting/BlockFormattingContext.cpp:
2540         (WebCore::Layout::BlockFormattingContext::layoutInFlowContent):
2541         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot): Deleted.
2542         * layout/blockformatting/BlockFormattingContext.h:
2543
2544 2020-01-22  Zalan Bujtas  <zalan@apple.com>
2545
2546         [LFC][BFC] Move float avoider special available width handling to BlockFormattingContext::computeWidthAndMargin
2547         https://bugs.webkit.org/show_bug.cgi?id=206567
2548         <rdar://problem/58783979>
2549
2550         Reviewed by Antti Koivisto.
2551
2552         Now we can move the compute* functions from layoutFormattingContextRoot to the main loop in layoutInFlowContent.
2553
2554         * layout/blockformatting/BlockFormattingContext.cpp:
2555         (WebCore::Layout::BlockFormattingContext::layoutInFlowContent):
2556         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot):
2557         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin):
2558         * layout/blockformatting/BlockFormattingContext.h:
2559
2560 2020-01-22  youenn fablet  <youenn@apple.com>
2561
2562         Add logging of the source of a response used to respond a fetch event
2563         https://bugs.webkit.org/show_bug.cgi?id=206426
2564
2565         Reviewed by Darin Adler.
2566
2567         Add a DOMCache response source value.
2568         This is set on responses created by DOMCache.
2569         Update code that checks the source to handle this new value similary to ApplicationCache.
2570         No change of behavior.
2571
2572         Add an internal test to verify a fetch response grabbed from DOM cache has the right source.
2573
2574         * Modules/cache/DOMCache.cpp:
2575         (WebCore::DOMCache::updateRecords):
2576         * inspector/agents/InspectorNetworkAgent.cpp:
2577         (WebCore::responseSource):
2578         * loader/ResourceLoader.cpp:
2579         (WebCore::logResourceResponseSource):
2580         * platform/network/ResourceResponseBase.h:
2581         * testing/Internals.cpp:
2582         (WebCore::responseSourceToString):
2583         * workers/service/context/ServiceWorkerFetch.cpp:
2584         (WebCore::ServiceWorkerFetch::processResponse):
2585         Remove setting of the source to service worker, this is done in NetworkProcess
2586         just before sending the response to the WebProcess.
2587
2588 2020-01-22  David Kilzer  <ddkilzer@apple.com>
2589
2590         REGRESSION (r254893): Apple Win 10 Debug build failure
2591
2592         Introduced by:
2593             Make RenderingMode and AlphaPremultiplication enum classes and move them to separate headers
2594             https://bugs.webkit.org/show_bug.cgi?id=206516
2595
2596         * platform/graphics/cg/ImageBufferCG.cpp:
2597         (WebCore::ImageBuffer::ImageBuffer): Use RenderingMode::Unaccelerated.
2598
2599 2020-01-21  Said Abou-Hallawa  <sabouhallawa@apple.com>
2600
2601         Move ImageBuffer utilities function to separate files
2602         https://bugs.webkit.org/show_bug.cgi?id=206519
2603
2604         Reviewed by Tim Horton.
2605
2606         These utilities function are merely related to the ImageData.
2607
2608         * SourcesGTK.txt:
2609         * html/HTMLCanvasElement.cpp:
2610         * platform/SourcesCairo.txt:
2611         * platform/graphics/ImageBuffer.h:
2612         * platform/graphics/cairo/ImageBufferCairo.cpp:
2613         (WebCore::ImageBuffer::toData const):
2614         (WebCore::writeFunction): Deleted.
2615         (WebCore::encodeImage): Deleted.
2616         * platform/graphics/cairo/ImageBufferUtilitiesCairo.cpp: Added.
2617         (WebCore::writeFunction):
2618         (WebCore::encodeImage):
2619         (WebCore::data):
2620         * platform/graphics/cairo/ImageBufferUtilitiesCairo.h: Added.
2621         * platform/graphics/cg/ImageBufferCG.cpp:
2622         (WebCore::jpegUTI): Deleted.
2623         (WebCore::utiFromImageBufferMIMEType): Deleted.
2624         (WebCore::encodeImage): Deleted.
2625         (WebCore::dataURL): Deleted.
2626         (WebCore::dataVector): Deleted.
2627         (WebCore::cfData): Deleted.
2628         (WebCore::data): Deleted.
2629         * platform/graphics/cg/ImageBufferDataCG.h:
2630         * platform/graphics/cg/ImageBufferUtilitiesCG.cpp:
2631         (WebCore::jpegUTI):
2632         (WebCore::utiFromImageBufferMIMEType):
2633         (WebCore::encodeImage):
2634         (WebCore::cfData):
2635         (WebCore::dataURL):
2636         (WebCore::dataVector):
2637         (WebCore::data):
2638         * platform/graphics/cg/ImageBufferUtilitiesCG.h:
2639         * platform/graphics/gtk/ImageBufferGtk.cpp: Removed.
2640
2641 2020-01-21  Fujii Hironori  <Hironori.Fujii@sony.com>
2642
2643         A partially selected RTL text is placed at a wrong vertical position if it has a vertical initial advance
2644         https://bugs.webkit.org/show_bug.cgi?id=205990
2645
2646         Reviewed by Darin Adler.
2647
2648         FontCascade::getGlyphsAndAdvancesForComplexText returned only X
2649         position of the first glyph, but Y position.
2650
2651         Because GlyphBuffer is using glyph advances instead glyph
2652         positions, it's not simple to get the first glyph position of the
2653         part of a RTL texts.
2654         FontCascade::getGlyphsAndAdvancesForComplexText is calculating the
2655         X position of it by subtracting right side part width from the
2656         total width. It should do same for Y position.
2657
2658         macOS and iOS ports don't use the code to draw selected texts.
2659
2660         Test: fast/text/initial-advance-selected-text.html
2661
2662         * platform/graphics/ComplexTextController.cpp:
2663         (WebCore::ComplexTextController::offsetForPosition):
2664         (WebCore::ComplexTextController::adjustGlyphsAndAdvances):
2665         * platform/graphics/ComplexTextController.h: Replaced m_totalWidth with m_totalAdvance.
2666         (WebCore::ComplexTextController::totalWidth const): Removed.
2667         (WebCore::ComplexTextController::totalAdvance const): Added.
2668         * platform/graphics/FontCascade.cpp:
2669         (WebCore::FontCascade::glyphBufferForTextRun const): Changed the return type from float to FloatSize.
2670         (WebCore::FontCascade::drawText const):
2671         (WebCore::FontCascade::displayListForTextRun const):
2672         (WebCore::FontCascade::getGlyphsAndAdvancesForComplexText const): Changed the return type from float to FloatSize.
2673         (WebCore::FontCascade::drawGlyphBuffer const):
2674         (WebCore::FontCascade::floatWidthForComplexText const):
2675         (WebCore::FontCascade::adjustSelectionRectForComplexText const):
2676         (WebCore::FontCascade::drawEmphasisMarksForComplexText const):
2677         (WebCore::FontCascade::dashesForIntersectionsWithRect const):
2678         * platform/graphics/FontCascade.h:
2679         * platform/graphics/GlyphBuffer.h:
2680         (WebCore::toFloatSize): Added.
2681
2682 2020-01-21  Jer Noble  <jer.noble@apple.com>
2683
2684         [EME] Only emit an array of persistent-usage-records when we discover > 1
2685         https://bugs.webkit.org/show_bug.cgi?id=206205
2686         <rdar://problem/58691769>
2687
2688         Reviewed by Eric Carlson.
2689
2690         The persistent-usage-record cache should never have more than one record per sessionId, but
2691         that assumption is not enforced in the file format. To not break clients that aren't
2692         expecting a serialized plist array, only emit an array when more than one matching data item
2693         is found.
2694
2695         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
2696         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::removeSessionData):
2697
2698 2020-01-21  Alex Christensen  <achristensen@webkit.org>
2699
2700         Add missing NS_NOESCAPE to CFNetwork SPI
2701         https://bugs.webkit.org/show_bug.cgi?id=206561
2702         <rdar://problem/58774422>
2703
2704         Reviewed by Joe Pecoraro.
2705
2706         * platform/network/cocoa/NetworkStorageSessionCocoa.mm:
2707
2708 2020-01-21  Said Abou-Hallawa  <sabouhallawa@apple.com>
2709
2710         Make RenderingMode and AlphaPremultiplication enum classes and move them to separate headers
2711         https://bugs.webkit.org/show_bug.cgi?id=206516
2712
2713         Reviewed by Tim Horton.
2714
2715         RenderingMode and AlphaPremultiplication need to be encoded and decoded
2716         when they are sent from the WebProcess to the GPUProcess.
2717
2718         * Headers.cmake:
2719         * Modules/async-clipboard/ClipboardItemBindingsDataSource.cpp:
2720         (WebCore::ClipboardItemBindingsDataSource::ClipboardItemTypeLoader::sanitizeDataIfNeeded):
2721         * WebCore.xcodeproj/project.pbxproj:
2722         * bindings/js/SerializedScriptValue.cpp:
2723         (WebCore::CloneDeserializer::readImageBitmap):
2724         * css/CSSFilterImageValue.cpp:
2725         (WebCore::CSSFilterImageValue::image):
2726         * html/CustomPaintCanvas.cpp:
2727         (WebCore::CustomPaintCanvas::copiedImage const):
2728         * html/HTMLCanvasElement.cpp:
2729         (WebCore::HTMLCanvasElement::createImageBuffer const):
2730         * html/ImageBitmap.cpp:
2731         * html/OffscreenCanvas.cpp:
2732         (WebCore::OffscreenCanvas::transferToImageBitmap):
2733         (WebCore::OffscreenCanvas::createImageBuffer const):
2734         (WebCore::OffscreenCanvas::takeImageBuffer const):
2735         * html/canvas/CanvasRenderingContext2DBase.cpp:
2736         (WebCore::CanvasRenderingContext2DBase::createCompositingBuffer):
2737         (WebCore::CanvasRenderingContext2DBase::createPattern):
2738         * html/canvas/ImageBitmapRenderingContext.cpp:
2739         (WebCore::ImageBitmapRenderingContext::isAccelerated const):
2740         * html/canvas/WebGLRenderingContextBase.cpp:
2741         (WebCore::WebGLRenderingContextBase::LRUImageBufferCache::imageBuffer):
2742         * html/shadow/MediaControlElements.cpp:
2743         (WebCore::MediaControlTextTrackContainerElement::createTextTrackRepresentationImage):
2744         * page/FrameSnapshotting.cpp:
2745         (WebCore::snapshotFrameRectWithClip):
2746         * platform/graphics/AlphaPremultiplication.h: Added.
2747         * platform/graphics/BitmapImage.cpp:
2748         (WebCore::BitmapImage::nativeImageForCurrentFrameRespectingOrientation):
2749         * platform/graphics/GraphicsContext.h:
2750         (WebCore::GraphicsContext::renderingMode const):
2751         * platform/graphics/GraphicsTypes.cpp:
2752         * platform/graphics/GraphicsTypes.h:
2753         * platform/graphics/ImageBuffer.h:
2754         * platform/graphics/RenderingMode.h: Added.
2755         * platform/graphics/ShadowBlur.cpp:
2756         (WebCore::ScratchBuffer::getScratchBuffer):
2757         (WebCore::ShadowBlur::drawRectShadowWithoutTiling):
2758         (WebCore::ShadowBlur::drawInsetShadowWithoutTiling):
2759         (WebCore::ShadowBlur::drawRectShadowWithTiling):
2760         (WebCore::ShadowBlur::drawInsetShadowWithTiling):
2761         (WebCore::ShadowBlur::drawShadowLayer):
2762         * platform/graphics/cairo/ImageBufferCairo.cpp:
2763         (WebCore::ImageBufferData::~ImageBufferData):
2764         (WebCore::ImageBuffer::ImageBuffer):
2765         * platform/graphics/cg/ImageBufferCG.cpp:
2766         (WebCore::ImageBuffer::ImageBuffer):
2767         * platform/graphics/cg/ImageBufferDataCG.h:
2768         * platform/graphics/filters/Filter.h:
2769         * platform/graphics/texmap/BitmapTexture.cpp:
2770         (WebCore::BitmapTexture::updateContents):
2771         * platform/graphics/win/ImageBufferDirect2D.cpp:
2772         (WebCore::ImageBuffer::ImageBuffer):
2773         * platform/mock/MockRealtimeVideoSource.cpp:
2774         (WebCore::MockRealtimeVideoSource::imageBuffer const):
2775         * rendering/RenderLayer.cpp:
2776         (WebCore::RenderLayer::calculateClipRects const):
2777         * rendering/shapes/Shape.cpp:
2778         (WebCore::Shape::createRasterShape):
2779         * rendering/svg/RenderSVGResourceClipper.cpp:
2780         (WebCore::RenderSVGResourceClipper::applyClippingToContext):
2781         * rendering/svg/RenderSVGResourceFilter.cpp:
2782         (WebCore::RenderSVGResourceFilter::applyResource):
2783         * rendering/svg/RenderSVGResourceMasker.cpp:
2784         (WebCore::RenderSVGResourceMasker::applyResource):
2785         * svg/graphics/SVGImage.cpp:
2786         (WebCore::SVGImage::nativeImageForCurrentFrame):
2787
2788 2020-01-22  Simon Fraser  <simon.fraser@apple.com>
2789
2790         Fixed elements no longer stay fixed with elastic overscroll
2791         https://bugs.webkit.org/show_bug.cgi?id=206227
2792         rdar://problem/58707084
2793
2794         Reviewed by Antti Koivisto.
2795         
2796         Intended behavior on iOS and macOS is for position:fixed and sticky elements to maintain
2797         their position relative to the view bounds when rubber-banding ("overscrolling"). This broke
2798         some time back. This change restores the correct behavior with the call to layoutViewportRespectingRubberBanding()
2799         in ScrollingTreeFixedNode::applyLayerPositions() and ScrollingTreeStickyNode::computeLayerPosition().
2800         layoutViewportRespectingRubberBanding() computes a layout viewport without clamping.
2801
2802         The rest of the changes are to support testing. internals.unconstrainedScrollTo()
2803         didn't work for main frame scrolling because of scroll position clamping in various places,
2804         so propagate ScrollClamping in more places (and replace the redundant ScrollPositionClamp with ScrollClamping).
2805
2806         "requested scroll position" updates now carry along both clamping and "is programmatic" data, wrapped in a struct
2807         which is passed around the scrolling tree. This allows us to not clamp the scroll position (for testing) in more places.
2808         
2809         Internals::unconstrainedScrollTo() needs one weird hack to trigger a layout (and thus a scrolling tree commit),
2810         because the layout is normally triggered by a layout viewport change, but when rubber-banding we clamp the layoutViewport
2811         used for layout, so those layouts are never triggered.
2812
2813         Tests: tiled-drawing/scrolling/fixed/fixed-during-rubberband.html
2814                tiled-drawing/scrolling/sticky/sticky-during-rubberband.html
2815
2816         * Sources.txt:
2817         * WebCore.xcodeproj/project.pbxproj:
2818         * dom/Element.cpp:
2819         (WebCore::Element::scrollTo):
2820         * page/DOMWindow.cpp:
2821         (WebCore::DOMWindow::scrollTo const):
2822         * page/FrameView.cpp:
2823         (WebCore::FrameView::setScrollPosition):
2824         (WebCore::FrameView::requestScrollPositionUpdate):
2825         * page/FrameView.h:
2826         * page/scrolling/AsyncScrollingCoordinator.cpp:
2827         (WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate):
2828         * page/scrolling/AsyncScrollingCoordinator.h:
2829         * page/scrolling/ScrollingCoordinator.cpp:
2830         * page/scrolling/ScrollingCoordinator.h:
2831         (WebCore::ScrollingCoordinator::requestScrollPositionUpdate):
2832         * page/scrolling/ScrollingStateScrollingNode.cpp:
2833         (WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode):
2834         (WebCore::ScrollingStateScrollingNode::setRequestedScrollData):
2835         (WebCore::ScrollingStateScrollingNode::dumpProperties const):
2836         (WebCore::ScrollingStateScrollingNode::setRequestedScrollPosition): Deleted.
2837         * page/scrolling/ScrollingStateScrollingNode.h:
2838         (WebCore::RequestedScrollData::operator== const):
2839         (WebCore::ScrollingStateScrollingNode::requestedScrollData const):
2840         (WebCore::ScrollingStateScrollingNode::requestedScrollPosition const): Deleted.
2841         (WebCore::ScrollingStateScrollingNode::requestedScrollPositionRepresentsProgrammaticScroll const): Deleted.
2842         * page/scrolling/ScrollingTree.h:
2843         (WebCore::ScrollingTree::scrollingTreeNodeRequestsScroll):
2844         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
2845         (WebCore::ScrollingTreeFrameScrollingNode::layoutViewportForScrollPosition const):
2846         (WebCore::ScrollingTreeFrameScrollingNode::layoutViewportRespectingRubberBanding const):
2847         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
2848         * page/scrolling/ScrollingTreeScrollingNode.cpp:
2849         (WebCore::ScrollingTreeScrollingNode::commitStateAfterChildren):
2850         (WebCore::ScrollingTreeScrollingNode::adjustedScrollPosition const):
2851         (WebCore::ScrollingTreeScrollingNode::scrollBy):
2852         (WebCore::ScrollingTreeScrollingNode::scrollTo):
2853         (WebCore::ScrollingTreeScrollingNode::wasScrolledByDelegatedScrolling):
2854         * page/scrolling/ScrollingTreeScrollingNode.h:
2855         * page/scrolling/cocoa/ScrollingTreeFixedNode.mm:
2856         (WebCore::ScrollingTreeFixedNode::applyLayerPositions):
2857         * page/scrolling/cocoa/ScrollingTreeStickyNode.mm:
2858         (WebCore::ScrollingTreeStickyNode::computeLayerPosition const):
2859         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
2860         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
2861         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateAfterChildren):
2862         (WebCore::ScrollingTreeFrameScrollingNodeMac::adjustedScrollPosition const):
2863         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h:
2864         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
2865         (WebCore::ScrollingTreeOverflowScrollingNodeMac::commitStateAfterChildren):
2866         (WebCore::ScrollingTreeOverflowScrollingNodeMac::adjustedScrollPosition const):
2867         * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
2868         (WebCore::ScrollingTreeScrollingNodeDelegateMac::immediateScrollByWithoutContentEdgeConstraints):
2869         * platform/ScrollTypes.cpp: Added.
2870         (WebCore::operator<<):
2871         * platform/ScrollTypes.h:
2872         * platform/ScrollView.cpp:
2873         (WebCore::ScrollView::setContentsScrollPosition):
2874         (WebCore::ScrollView::setScrollPosition):
2875         * platform/ScrollView.h:
2876         * platform/ScrollableArea.cpp:
2877         (WebCore::ScrollableArea::setScrollOffsetFromAnimation):
2878         * platform/ScrollableArea.h:
2879         (WebCore::ScrollableArea::requestScrollPositionUpdate):
2880         * rendering/RenderLayer.cpp:
2881         (WebCore::RenderLayer::scrollToOffset):
2882         * testing/Internals.cpp:
2883         (WebCore::Internals::unconstrainedScrollTo):
2884
2885 2020-01-21  Commit Queue  <commit-queue@webkit.org>
2886
2887         Unreviewed, rolling out r254807 and r254849.
2888         https://bugs.webkit.org/show_bug.cgi?id=206559
2889
2890         Broke page up/page down on macOS (Requested by smfr on
2891         #webkit).
2892
2893         Reverted changesets:
2894
2895         "Add support for scroll behavior relies on ScrollAnimation of
2896         the Web process"
2897         https://bugs.webkit.org/show_bug.cgi?id=204882
2898         https://trac.webkit.org/changeset/254807
2899
2900         "Add support for scroll behavior relies on ScrollAnimation of
2901         the Web process"
2902         https://bugs.webkit.org/show_bug.cgi?id=204882
2903         https://trac.webkit.org/changeset/254849
2904
2905 2020-01-21  Alex Christensen  <achristensen@webkit.org>
2906
2907         Build fix.
2908
2909         * rendering/updating/RenderTreeBuilderInline.cpp:
2910         Add missing include.
2911
2912 2020-01-21  Daniel Bates  <dabates@apple.com>
2913
2914         Add Legacy WebKit SPI and WebKit IPI to show and hide placeholder
2915         https://bugs.webkit.org/show_bug.cgi?id=206459
2916         <rdar://problem/58700534>
2917
2918         Reviewed by Wenson Hsieh.
2919
2920         Adds setter and getter to update whether the placeholder can be shown.
2921
2922         Test: fast/forms/placeholder-show-and-hide-via-setCanShowPlaceholder.html
2923
2924         * html/HTMLTextFormControlElement.cpp:
2925         (WebCore::HTMLTextFormControlElement::HTMLTextFormControlElement): Initialize state. Default to can show
2926         the placeholder to keep the behavior we have currently.
2927         (WebCore::HTMLTextFormControlElement::placeholderShouldBeVisible const): Modified to account for m_canShowPlaceholder.
2928         (WebCore::HTMLTextFormControlElement::setCanShowPlaceholder): Added. Update state and invalidate style.
2929         * html/HTMLTextFormControlElement.h:
2930         (WebCore::HTMLTextFormControlElement::canShowPlaceholder const): Added.
2931         * testing/Internals.cpp:
2932         (WebCore::Internals::setCanShowPlaceholder): Added. For testing purposes.
2933         * testing/Internals.h:
2934         * testing/Internals.idl:
2935
2936 2020-01-21  Rob Buis  <rbuis@igalia.com>
2937
2938         Add build flag for stale-while-revalidate
2939         https://bugs.webkit.org/show_bug.cgi?id=204169
2940
2941         Reviewed by Youenn Fablet.
2942
2943         * Configurations/FeatureDefines.xcconfig:
2944
2945 2020-01-21  Yusuke Suzuki  <ysuzuki@apple.com>
2946
2947         [WTF] AtomStringTable should be small
2948         https://bugs.webkit.org/show_bug.cgi?id=206400
2949
2950         Reviewed by Sam Weinig.
2951
2952         * dom/GCReachableRef.h:
2953         (WebCore::GCReachableRef::GCReachableRef):
2954         * dom/QualifiedName.h:
2955         (WebCore::QualifiedName::hashTableDeletedValue):
2956
2957 2020-01-21  Jer Noble  <jer.noble@apple.com>
2958
2959         [iPad] YouTube does not automatically AirPlay when a route is selected from Control Center
2960         https://bugs.webkit.org/show_bug.cgi?id=206539
2961
2962         Reviewed by Eric Carlson.
2963
2964         No new tests; change affects an interaction with two platform features (local AirPlay
2965         route picking and actual remote playback over AirPlay routes) that is not testable in
2966         an automated fashion.
2967
2968         The underlying source of the bug is the difference in how the platform communitcates that an
2969         AirPlay route was picked between iOS and macOS. On iOS, route changes are global and are
2970         generally pushed up from AVPlayer notifications. On macOS, route changes are local to the
2971         app and are pushed down from the UIProcess. But when MSE playback was enabled on iPadOS,
2972         there was now a limbo where media playback was no longer using an AVPlayer, but at the same
2973         time, route changes could be initiated globally. The end result is that MSE-based media
2974         elements are never notified that they "should play to playback target", and no remote
2975         playback events are ever fired.
2976
2977         To re-create the same macOS behavior when MSE-backed media elements are used on iPadOS,
2978         re-use the existing route change detection logic in MediaSessionManageriOS to query whether
2979         the newly established route supports AirPlay Video, and if so, send a message to the "now
2980         playing" media element that it should begin AirPlaying, which will fail, but will trigger
2981         the YouTube player to switch to a HLS-backed media element.
2982
2983         This requires renaming MediaPlaybackTargetMac -> MediaPlaybackTargetCocoa.
2984
2985         * SourcesCocoa.txt:
2986         * PlatformMac.cmake:
2987         * WebCore.xcodeproj/project.pbxproj:
2988         * platform/audio/ios/MediaSessionManagerIOS.h:
2989         * platform/audio/ios/MediaSessionManagerIOS.mm:
2990         (WebCore::MediaSessionManageriOS::activeVideoRouteDidChange):
2991         (-[WebMediaSessionHelper activeAudioRouteDidChange:]):
2992         * platform/graphics/avfoundation/MediaPlaybackTargetCocoa.h: Renamed from Source/WebCore/platform/graphics/avfoundation/MediaPlaybackTargetMac.h.
2993         (WebCore::MediaPlaybackTargetCocoa::outputContext const):
2994         * platform/graphics/avfoundation/MediaPlaybackTargetCocoa.mm: Renamed from Source/WebCore/platform/graphics/avfoundation/MediaPlaybackTargetMac.mm.
2995         (WebCore::MediaPlaybackTargetCocoa::create):
2996         (WebCore::MediaPlaybackTargetCocoa::MediaPlaybackTargetCocoa):
2997         (WebCore::MediaPlaybackTargetCocoa::~MediaPlaybackTargetCocoa):
2998         (WebCore::MediaPlaybackTargetCocoa::targetContext const):
2999         (WebCore::MediaPlaybackTargetCocoa::hasActiveRoute const):
3000         (WebCore::MediaPlaybackTargetCocoa::deviceName const):
3001         (WebCore::toMediaPlaybackTargetCocoa):
3002         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
3003         (WebCore::MediaPlaybackTargetPickerMac::playbackTarget):
3004         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3005         (WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessPlaybackTarget):
3006
3007 2020-01-21  Antti Koivisto  <antti@apple.com>
3008
3009         [LFC] Typed accessors for formatting states
3010         https://bugs.webkit.org/show_bug.cgi?id=206538
3011
3012         Reviewed by Zalan Bujtas.
3013
3014         Almost all clients know what sort of formatting state they want and immediately cast it.
3015
3016         * layout/FormattingContextGeometry.cpp:
3017         (WebCore::Layout::FormattingContext::Geometry::contentHeightForFormattingContextRoot const):
3018         (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
3019         * layout/LayoutContext.cpp:
3020         (WebCore::Layout::LayoutContext::createFormattingContext):
3021         * layout/LayoutState.cpp:
3022         (WebCore::Layout::LayoutState::formattingStateForBox const):
3023         (WebCore::Layout::LayoutState::establishedFormattingState const):
3024         (WebCore::Layout::LayoutState::establishedInlineFormattingState const):
3025         (WebCore::Layout::LayoutState::establishedBlockFormattingState const):
3026         (WebCore::Layout::LayoutState::establishedTableFormattingState const):
3027
3028         Typed function for getting established states.
3029
3030         (WebCore::Layout::LayoutState::ensureFormattingState):
3031         (WebCore::Layout::LayoutState::ensureInlineFormattingState):
3032
3033         Also add a fast path for integrated layout.
3034
3035         (WebCore::Layout::LayoutState::ensureBlockFormattingState):
3036         (WebCore::Layout::LayoutState::ensureTableFormattingState):
3037
3038         Typed function for creating states.
3039
3040         (WebCore::Layout::LayoutState::createFormattingStateForFormattingRootIfNeeded): Deleted.
3041         * layout/LayoutState.h:
3042         (WebCore::Layout::LayoutState::hasInlineFormattingState const):
3043         (WebCore::Layout::LayoutState::hasFormattingState const): Deleted.
3044         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
3045         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
3046         * layout/blockformatting/BlockMarginCollapse.cpp:
3047         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginsCollapseThrough const):
3048         * layout/displaytree/DisplayPainter.cpp:
3049         (WebCore::Display::paintSubtree):
3050         (WebCore::Display::Painter::paintInlineFlow):
3051         * layout/inlineformatting/InlineFormattingContextQuirks.cpp:
3052         (WebCore::Layout::InlineFormattingContext::Quirks::lineDescentNeedsCollapsing const):
3053         * layout/inlineformatting/InlineLineBuilder.cpp:
3054         (WebCore::Layout::LineBuilder::alignContentVertically):
3055         (WebCore::Layout::LineBuilder::adjustBaselineAndLineHeight):
3056         * layout/integration/LayoutIntegrationLineLayout.cpp:
3057         (WebCore::LayoutIntegration::LineLayout::LineLayout):
3058         * layout/layouttree/LayoutTreeBuilder.cpp:
3059         (WebCore::Layout::outputInlineRuns):
3060
3061 2020-01-21  Justin Fan  <justin_fan@apple.com>
3062
3063         [WebGL2] Sampler objects
3064         https://bugs.webkit.org/show_bug.cgi?id=126941
3065         <rdar://problem/15002402>
3066
3067         Implement enough of Samplers to pass the "samplers" conformance tests with ANGLE enabled.
3068
3069         Reviewed by Dean Jackson.
3070
3071         Covered by webgl/2.0.0/conformance2/samplers directory of tests.
3072
3073         * bindings/js/JSDOMConvertWebGL.cpp:
3074         (WebCore::convertToJSValue):
3075         * html/canvas/WebGL2RenderingContext.cpp:
3076         (WebCore::WebGL2RenderingContext::WebGL2RenderingContext):
3077         (WebCore::WebGL2RenderingContext::initializeSamplerCache):
3078         (WebCore::WebGL2RenderingContext::createSampler):
3079         (WebCore::WebGL2RenderingContext::deleteSampler):
3080         (WebCore::WebGL2RenderingContext::isSampler):
3081         (WebCore::WebGL2RenderingContext::bindSampler):
3082         (WebCore::WebGL2RenderingContext::samplerParameteri):
3083         (WebCore::WebGL2RenderingContext::samplerParameterf):
3084         (WebCore::WebGL2RenderingContext::getSamplerParameter):
3085         (WebCore::WebGL2RenderingContext::bindTransformFeedback):
3086         (WebCore::WebGL2RenderingContext::getParameter):
3087         * html/canvas/WebGL2RenderingContext.h:
3088         * html/canvas/WebGLAny.h:
3089         * html/canvas/WebGLSampler.cpp:
3090         (WebCore::WebGLSampler::WebGLSampler):
3091         (WebCore::WebGLSampler::deleteObjectImpl):
3092         * platform/graphics/angle/GraphicsContextGLANGLE.cpp:
3093         (WebCore::GraphicsContextGLOpenGL::createSampler):
3094         (WebCore::GraphicsContextGLOpenGL::deleteSampler):
3095         (WebCore::GraphicsContextGLOpenGL::isSampler):
3096         (WebCore::GraphicsContextGLOpenGL::bindSampler):
3097         (WebCore::GraphicsContextGLOpenGL::samplerParameteri):
3098         (WebCore::GraphicsContextGLOpenGL::samplerParameterf):
3099         (WebCore::GraphicsContextGLOpenGL::getSamplerParameterfv):
3100         (WebCore::GraphicsContextGLOpenGL::getSamplerParameteriv):
3101
3102 2020-01-21  Sunny He  <sunny_he@apple.com>
3103
3104         Disallow setting SVGElement currentScale to non-finite values
3105         https://bugs.webkit.org/show_bug.cgi?id=206019
3106
3107         Align SVGElement currentScale definition to SVG2 section 5.14.2
3108         (https://www.w3.org/TR/SVG2/struct.html#InterfaceSVGSVGElement)
3109
3110         Reviewed by Darin Adler.
3111
3112         Test: svg/dom/set-currentScale-nonfinite.html
3113
3114         * svg/SVGSVGElement.idl:
3115
3116 2020-01-21  Noam Rosenthal  <noam@webkit.org>
3117
3118         -webkit-image-set should support all the image functions WebKit supports, not just url()
3119         https://bugs.webkit.org/show_bug.cgi?id=81941
3120
3121         Reviewed by Darin Adler.
3122
3123         Separate StyleCachedImage to 4 classes:
3124         - StyleCachedImage: for single images only
3125         - StyleMultiImage: for values that can contain multiple images: like cursor/image-set
3126         - StyleImageSet
3127         - StyleCursorImage
3128
3129         The new classes only deal with their own value type. Before, ImageSet and cursor were resolved
3130         as a StyleCachedImage, which is no longer a valid assumption if image-set can contain generated images.
3131         Though cursors still can only contain cached images, it was cleaner to refactor it out as well.
3132
3133         Refactored best-fit image selection from loading. Now StyleCachedImage is in charge of loading
3134         the actual image, and StyleImageSet/StyleCursorImage perform the source selection.
3135
3136         Also, added the necessary logic in the CSS parser to consume generated images inside image-sets, excluding
3137         when the image-set is a cursor value.
3138
3139         Tests: fast/css/image-set-parsing-generated.html
3140                fast/hidpi/image-set-cross-fade.html
3141                fast/hidpi/image-set-gradient-multi.html
3142                fast/hidpi/image-set-gradient-single.html
3143                fast/hidpi/image-set-gradient.html
3144
3145         * Sources.txt:
3146         * WebCore.xcodeproj/project.pbxproj:
3147                 Added new files
3148
3149         * css/CSSCursorImageValue.cpp:
3150         (WebCore::CSSCursorImageValue::selectBestFitImage):
3151         (WebCore::CSSCursorImageValue::loadImage): Deleted.
3152         * css/CSSCursorImageValue.h:
3153                 Instead of cursor loading the image, it selects an image CSS value
3154
3155         * css/CSSImageSetValue.cpp:
3156         (WebCore::CSSImageSetValue::CSSImageSetValue):
3157         (WebCore::CSSImageSetValue::fillImageSet):
3158         (WebCore::CSSImageSetValue::cachedImage const):
3159         (WebCore::CSSImageSetValue::selectBestFitImage):
3160         (WebCore::CSSImageSetValue::updateDeviceScaleFactor):
3161         (WebCore::CSSImageSetValue::imageSetWithStylesResolved):
3162         (WebCore::CSSImageSetValue::traverseSubresources const):
3163         (WebCore::CSSImageSetValue::loadBestFitImage): Deleted.
3164         * css/CSSImageSetValue.h:
3165                 Refactor CSSImageSetValue to include non-cachedImage images
3166
3167         * css/parser/CSSPropertyParser.cpp:
3168         (WebCore::consumeCursor):
3169         * css/parser/CSSPropertyParserHelpers.cpp:
3170         (WebCore::CSSPropertyParserHelpers::consumeImageSet):
3171         (WebCore::CSSPropertyParserHelpers::consumeImage):
3172         (WebCore::CSSPropertyParserHelpers::consumeUrlOrStringAsStringView): Deleted.
3173         * css/parser/CSSPropertyParserHelpers.h:
3174                 
3175         * page/animation/CSSPropertyAnimation.cpp:
3176         (WebCore::blendFunc):
3177                 When blending two images, get the selected images in case it is an image-set
3178
3179         * rendering/RenderBoxModelObject.cpp:
3180         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
3181         * rendering/RenderImageResourceStyleImage.cpp:
3182         (WebCore::RenderImageResourceStyleImage::initialize):
3183         * rendering/RenderLayerBacking.cpp:
3184         (WebCore::canDirectlyCompositeBackgroundBackgroundImage):
3185         * rendering/style/ShapeValue.cpp:
3186         (WebCore::ShapeValue::isImageValid const):
3187                 Use hasCachedImage() instead of isCachedImage() as a StyleImageSet is no longer an isCachedImage()
3188
3189         * rendering/style/StyleCachedImage.cpp:
3190         (WebCore::StyleCachedImage::StyleCachedImage):
3191         (WebCore::StyleCachedImage::imageURL):
3192         (WebCore::StyleCachedImage::load):
3193         * rendering/style/StyleCachedImage.h:
3194         * rendering/style/StyleCursorImage.h:
3195         * rendering/style/StyleCursorImage.cpp:
3196         * rendering/style/StyleMultiImage.h:
3197         * rendering/style/StyleMultiImage.cpp:
3198         * rendering/style/StyleImageSet.h:
3199         * rendering/style/StyleImageSet.cpp:
3200         * rendering/style/StyleImage.h:
3201         (WebCore::StyleImage::selectedImage):
3202         (WebCore::StyleImage::selectedImage const):
3203         (WebCore::StyleImage::isCursorImage const):
3204         (WebCore::StyleImage::isImageSet const):
3205         (WebCore::StyleImage::hasCachedImage const):
3206         (WebCore::StyleImage::StyleImage):
3207                 Separate cursor/image-set related stuff away from StyleCachedImage.
3208
3209         * style/StyleBuilderCustom.h:
3210         (WebCore::Style::BuilderCustom::applyValueContent):
3211         * style/StyleBuilderState.cpp:
3212         (WebCore::Style::BuilderState::resolveImageStyles):
3213         (WebCore::Style::BuilderState::createStyleImage):
3214         * style/StyleBuilderState.h:
3215                 Match the CSS values with the correct Style class. Also, ensure image-sets resolve their 
3216                 images' styles as they may contain gradients and other context-aware values.
3217
3218 2020-01-21  Chris Dumez  <cdumez@apple.com>
3219
3220         Minor improvements to StorageAreaMap
3221         https://bugs.webkit.org/show_bug.cgi?id=206433
3222
3223         Reviewed by Darin Adler.
3224
3225         Use inline initialization for some of StorageMap's data member.
3226         Also specify uint8_t as underlying type of StorageType enum class for better packing.
3227
3228         * inspector/InspectorInstrumentation.h:
3229         * storage/StorageArea.h:
3230         * storage/StorageMap.cpp:
3231         (WebCore::StorageMap::StorageMap):
3232         * storage/StorageMap.h:
3233         * storage/StorageType.h:
3234
3235 2020-01-21  Chris Dumez  <cdumez@apple.com>
3236
3237         Unreviewed, add comment to make it clearer that the code restored in r254857 is not dead
3238
3239         * page/DOMWindow.cpp:
3240         (WebCore::DOMWindow::prewarmLocalStorageIfNecessary):
3241
3242 2020-01-21  Chris Dumez  <cdumez@apple.com>
3243
3244         Unreviewed, rolling out r254753.
3245
3246         It turns out this is not dead code
3247
3248         Reverted changeset:
3249
3250         "Drop dead code related to local storage prewarming"
3251         https://bugs.webkit.org/show_bug.cgi?id=206418
3252         https://trac.webkit.org/changeset/254753
3253
3254 2020-01-21  Sihui Liu  <sihui_liu@apple.com>
3255
3256         Disable WebSQL everywhere by default except in tests
3257         https://bugs.webkit.org/show_bug.cgi?id=204907
3258
3259         Reviewed by Ryosuke Niwa.
3260
3261         No new tests. All WebSQL tests are enabled for now.
3262
3263         * page/RuntimeEnabledFeatures.h:
3264
3265 2020-01-21  Antti Koivisto  <antti@apple.com>
3266
3267         [LFC][Integration] Use InlineFormattingContext directly
3268         https://bugs.webkit.org/show_bug.cgi?id=206526
3269
3270         Reviewed by Zalan Bujtas.
3271
3272         Stop using LayoutContext (which is more of a full tree layout thing) and use InlineFormattingContext directly instead.
3273         This has a side benefit of not needing to setup a root display box.
3274
3275         * layout/LayoutContext.cpp:
3276         (WebCore::Layout::LayoutContext::layoutFormattingContextSubtree):
3277         * layout/blockformatting/BlockFormattingContext.h:
3278         * layout/inlineformatting/InlineFormattingContext.h:
3279         * layout/integration/LayoutIntegrationLineLayout.cpp:
3280         (WebCore::LayoutIntegration::LineLayout::LineLayout):
3281         (WebCore::LayoutIntegration::LineLayout::layout):
3282         (WebCore::LayoutIntegration::LineLayout::displayInlineContent const):
3283         (WebCore::LayoutIntegration::LineLayout::prepareRootGeometryForLayout): Deleted.
3284         * layout/integration/LayoutIntegrationLineLayout.h:
3285         * layout/tableformatting/TableFormattingContext.h:
3286
3287 2020-01-21  Cathie Chen  <cathiechen@igalia.com>
3288
3289         Add support for scroll behavior relies on ScrollAnimation of the Web process
3290         https://bugs.webkit.org/show_bug.cgi?id=204882
3291
3292         Reviewed by Frédéric Wang
3293
3294         Based on the patch by Frédéric Wang.
3295
3296         This patch introduces a programmatic smooth scrolling in WebKit from the CSSOM View
3297         specification [1]. To use this effect, web developers can pass a behavior parameter (auto,
3298         smooth, or instant) to Element.scroll, Element.scrollTo, Element.scrollBy,
3299         Element.scrollIntoView, Window.scroll, Window.scrollTo or Window.scrollBy [2]. When behavior
3300         is auto, the instant/smooth characteristic is actually taken from the value of a new CSS
3301         scroll-behavior property [3]. Both the new CSS and DOM behavior are protected by a runtime
3302         flag.
3303
3304         [1] https://drafts.csswg.org/cssom-view
3305         [2] https://drafts.csswg.org/cssom-view/#dictdef-scrolloptions
3306         [3] https://drafts.csswg.org/cssom-view/#propdef-scroll-behavior
3307
3308         Tests: imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-default-css.html
3309                imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-element.html
3310                imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-main-frame-root.html
3311                imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-main-frame-window.html
3312                imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-scrollintoview-nested.html
3313                imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-smooth-positions.html
3314                imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-subframe-root.html
3315                imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-subframe-window.html
3316         * Sources.txt: Build ScrollAnimationSmooth.cpp on all platforms.
3317         * SourcesGTK.txt: Remove ScrollAnimationSmooth.cpp since it is built on all platforms now.
3318         * dom/Element.cpp:
3319         (WebCore::Element::scrollIntoView): Pass scroll behavior, if any.
3320         (WebCore::Element::scrollBy):
3321         (WebCore::Element::scrollTo): Handle the case when scroll behavior is smooth.
3322         (WebCore::Element::setScrollLeft): Handle the case when scroll behavior is smooth.
3323         (WebCore::Element::setScrollTop): Handle the case when scroll behavior is smooth.
3324         * page/DOMWindow.cpp:
3325         (WebCore::DOMWindow::scrollBy const):
3326         (WebCore::DOMWindow::scrollTo const): Handle the case when scroll behavior is smooth.
3327         The optimization of cancel (0, 0) scrolling is skipped if an animated scroll is in progress.
3328         Otherwise, the previous scroll won't be stopped by a follow-up scroll.
3329         * page/FrameView.cpp:
3330         (WebCore::FrameView::setScrollPosition):
3331         (WebCore::FrameView::scrollToOffsetWithAnimation): Start an animated scroll.
3332         * page/FrameView.h:
3333         * page/scrolling/AsyncScrollingCoordinator.cpp:
3334         (WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate):
3335         * platform/ScrollAnimation.h:
3336         (WebCore::ScrollAnimation::scroll): Function to animate scrolling to a specified position.
3337         * platform/ScrollAnimationSmooth.cpp: Build this file on all platforms. Add a
3338         smoothFactorForProgrammaticScroll parameter to slow down the smooth scrolling.
3339         (WebCore::ScrollAnimationSmooth::scroll):
3340         (WebCore::ScrollAnimationSmooth::updatePerAxisData): Scale the time parameters of the
3341         animation so that it looks smoother.
3342         * platform/ScrollAnimationSmooth.h: Declare the class on all platforms.
3343         * platform/ScrollAnimator.cpp:
3344         (WebCore::ScrollAnimator::ScrollAnimator): Initialize animation member for programmatic scrolling.
3345         (WebCore::ScrollAnimator::scrollToOffset): Animate scrolling to the specified position.
3346         (WebCore::ScrollAnimator::cancelAnimations): Copy logic from ScrollAnimationSmooth.cpp.
3347         (WebCore::ScrollAnimator::serviceScrollAnimations): Ditto.
3348         (WebCore::ScrollAnimator::willEndLiveResize): Ditto.
3349         (WebCore::ScrollAnimator::didAddVerticalScrollbar): Ditto.
3350         (WebCore::ScrollAnimator::didAddHorizontalScrollbar): Ditto.
3351         * platform/ScrollAnimator.h: New animation member for smooth programmatic scrolling.
3352         (WebCore::ScrollAnimator::ScrollAnimator::cancelAnimations): Deleted.
3353         (WebCore::ScrollAnimator::ScrollAnimator::serviceScrollAnimations): Deleted.
3354         (WebCore::ScrollAnimator::ScrollAnimator::willEndLiveResize): Deleted.
3355         (WebCore::ScrollAnimator::ScrollAnimator::didAddVerticalScrollbar): Deleted.
3356         (WebCore::ScrollAnimator::ScrollAnimator::didAddHorizontalScrollbar): Deleted.
3357         * platform/ScrollTypes.h: Add ScrollBehaviorStatus to indicate the status of scrolling.
3358         * platform/ScrollView.cpp:
3359         (WebCore::ScrollView::setScrollPosition): Follow the CSSOM View spec: If a scroll is in
3360         progress, we interrupt it and continue the scroll call (even when we are at the final position).
3361         * platform/ScrollView.h:
3362         * platform/ScrollableArea.cpp:
3363         (WebCore::ScrollableArea::scrollToOffsetWithAnimation):
3364         (WebCore::ScrollableArea::setScrollOffsetFromInternals):
3365         (WebCore::ScrollableArea::setScrollOffsetFromAnimation): To avoid iterate calling,
3366         move the requestScrollPositionUpdate(position) checking out of setScrollOffsetFromAnimation().
3367         * platform/ScrollableArea.h:
3368         (WebCore::ScrollableArea::currentScrollBehaviorStatus const): Maintain currentScrollBehaviorStatus.
3369         (WebCore::ScrollableArea::setScrollBehaviorStatus):
3370         * platform/generic/ScrollAnimatorGeneric.cpp:
3371         (WebCore::ScrollAnimatorGeneric::updatePosition):
3372         * platform/mac/ScrollAnimatorMac.mm:
3373         (WebCore::ScrollAnimatorMac::cancelAnimations): Call parent member to handle programmatic scrolling.
3374         * rendering/RenderBox.cpp:
3375         (WebCore::RenderBox::setScrollLeft): Add flag to indicate animated or not.
3376         (WebCore::RenderBox::setScrollTop): Ditto.
3377         (WebCore::RenderBox::setScrollPosition):
3378         * rendering/RenderBox.h:
3379         * rendering/RenderLayer.cpp:
3380         (WebCore::RenderLayer::scrollToXPosition): Ditto.
3381         (WebCore::RenderLayer::scrollToYPosition): Ditto.
3382         (WebCore::RenderLayer::scrollToPosition):
3383         (WebCore::RenderLayer::scrollToOffset): Follow the CSSOM View spec: If a scroll is in
3384         progress, we interrupt it and continue the scroll call (even when we are at the final
3385         position). It's ScrollBehaviorType::Instant scroll.
3386         (WebCore::RenderLayer::requestScrollPositionUpdate):
3387         (WebCore::RenderLayer::scrollToOffsetWithAnimation): Ditto. This is similar to scrollToOffset
3388         but animates the scroll. It's ScrollBehaviorType::Smooth scroll.
3389         (WebCore::RenderLayer::scrollTo):
3390         (WebCore::RenderLayer::scrollRectToVisible): Again don't do an early return if scroll is in
3391         progress. We call scrollToOffsetWithAnimation instead of scrollToOffset when appropriate.
3392         Note that this function may not work well for several nested scroll boxes with at least one