60774806771fa601e03bc1d160b85fea097f88a5
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2020-03-02  Andres Gonzalez  <andresg_22@apple.com>
2
3         Fix for LayoutTests/accessibility/mac/value-change/value-change-user-info-contenteditable.html in IsolatedTree mode.
4         https://bugs.webkit.org/show_bug.cgi?id=208462
5
6         Reviewed by Chris Fleizach.
7
8         Covered by LayoutTests/accessibility/mac/value-change/value-change-user-info-contenteditable.html.
9
10         - Updates the IsolatedTree on the TextStateChange notification.
11         - Renamed isAccessibilityScrollView to isAccessibilityScrollViewInstance
12         and used isScrollView instead everywhere it's appropriate. This makes
13         code like AXObjectCache::rootWebArea work for both AXObjects and IsolatedObjects.
14         - Moved several utility functions from WebAccessibilityObjectWrapperMac.mm
15         to AXObjectCacheMac.mm where they belong, so that they can be used by
16         AXObjectCache implementation in addition to by the wrapper.
17
18         * accessibility/AXObjectCache.cpp:
19         (WebCore::AXObjectCache::postTextStateChangeNotification):
20         (WebCore::AXObjectCache::rootWebArea):
21         * accessibility/AccessibilityObject.cpp:
22         (WebCore::AccessibilityObject::isOnScreen const):
23         (WebCore::AccessibilityObject::scrollToGlobalPoint const):
24         * accessibility/AccessibilityObject.h:
25         * accessibility/AccessibilityObjectInterface.h:
26         * accessibility/AccessibilityRenderObject.cpp:
27         (WebCore::AccessibilityRenderObject::getScrollableAreaIfScrollable const):
28         * accessibility/AccessibilityScrollView.h:
29         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
30         (-[WebAccessibilityObjectWrapper accessibilityContainer]):
31         * accessibility/isolatedtree/AXIsolatedObject.cpp:
32         (WebCore::AXIsolatedObject::isAccessibilityScrollViewInstance const):
33         (WebCore::AXIsolatedObject::isAccessibilityScrollView const): Renamed.
34         * accessibility/isolatedtree/AXIsolatedObject.h:
35         * accessibility/mac/AXObjectCacheMac.mm:
36         (WebCore::AXObjectCache::postTextStateChangePlatformNotification): Uses
37         TextMarker utilities instead of calling into the wrapper. This fixes
38         the crash caused by the wrapper updating the backingObject that in turn
39         may change the wrapper.
40         (WebCore::AXTextMarkerRange): Moved from WebAccessibilityObjectWrapperMac.mm.
41         (WebCore::textMarkerRangeFromMarkers): Moved from WebAccessibilityObjectWrapperMac.mm.
42         (WebCore::textMarkerForVisiblePosition): Moved from WebAccessibilityObjectWrapperMac.mm.
43         (WebCore::textMarkerRangeFromVisiblePositions): Moved from WebAccessibilityObjectWrapperMac.mm.
44         * accessibility/mac/WebAccessibilityObjectWrapperMac.h:
45         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
46         (AXTextMarkerRange): Moved.
47         (textMarkerForVisiblePosition): Moved.
48         (textMarkerRangeFromMarkers): Moved.
49         (textMarkerRangeFromVisiblePositions): Moved.
50
51 2020-03-02  Devin Rousso  <drousso@apple.com>
52
53         Web Inspector: Items in the toolbar take up to much vertical space
54         https://bugs.webkit.org/show_bug.cgi?id=204627
55         <rdar://problem/59091905>
56
57         Reviewed by Timothy Hatcher.
58
59         Now that there is no toolbar area, there is nothing obstructing the ability for the window
60         to be moved around when dragging via the title bar area. As such, we can remove the unused
61         `InspectorFrontendHost` APIs.
62
63         * inspector/InspectorFrontendHost.idl:
64         * inspector/InspectorFrontendHost.h:
65         * inspector/InspectorFrontendHost.cpp:
66         (WebCore::InspectorFrontendHost::startWindowDrag): Deleted.
67         (WebCore::InspectorFrontendHost::moveWindowBy const): Deleted.
68
69         * inspector/InspectorFrontendClient.h:
70         * inspector/InspectorFrontendClientLocal.h:
71         * inspector/InspectorFrontendClientLocal.cpp:
72         (WebCore::InspectorFrontendClientLocal::moveWindowBy): Deleted.
73
74 2020-03-02  Devin Rousso  <drousso@apple.com>
75
76         Remove the required `LockHolder` when calling `WebAnimation::instances()`
77         https://bugs.webkit.org/show_bug.cgi?id=208493
78
79         Reviewed by Simon Fraser.
80
81         Since `WebAnimation`s are not accessible from `Worker`s (e.g. main thread only), there's no
82         reason to require that a lock be held in order to access `WebAnimation::instances()`.
83
84         * animation/WebAnimation.h:
85         * animation/WebAnimation.cpp:
86         (WebCore::WebAnimation::WebAnimation):
87         (WebCore::WebAnimation::~WebAnimation):
88         (WebCore::WebAnimation::instancesMutex): Deleted.
89
90         * inspector/agents/InspectorAnimationAgent.cpp:
91         (WebCore::InspectorAnimationAgent::enable):
92
93 2020-03-02  Alan Coon  <alancoon@apple.com>
94
95         Add new Mac target numbers
96         https://bugs.webkit.org/show_bug.cgi?id=208398
97
98         Reviewed by Alexey Proskuryakov.
99
100         No new tests: adding target numbers doesn't necessitate any new testing. 
101
102         * Configurations/Base.xcconfig:
103         * Configurations/DebugRelease.xcconfig:
104         * Configurations/Version.xcconfig:
105         * Configurations/WebKitTargetConditionals.xcconfig:
106
107 2020-03-02  Per Arne Vollan  <pvollan@apple.com>
108
109         [Cocoa] Mapping from MIME type to UTI type should be done in the UI process
110         https://bugs.webkit.org/show_bug.cgi?id=208415
111
112         Reviewed by Brent Fulgham.
113
114         This is currently done in the WebContent process, but since this is using a system service which will be closed,
115         this mapping should be moved to the UI process. The UI process will create this mapping for a set of mime types,
116         and send it to the WebContent process.
117
118         API test: WebKit.UTIFromMIMEType
119
120         * platform/network/mac/UTIUtilities.h:
121         * platform/network/mac/UTIUtilities.mm:
122         (WebCore::mapUTIFromMIMEType):
123         (WebCore::UTIFromMIMETypeCachePolicy::createValueForKey):
124         (WebCore::cacheUTIFromMimeType):
125         (WebCore::UTIFromMIMEType):
126         (WebCore::mimeTypes):
127         (WebCore::createUTIFromMIMETypeMap):
128         (WebCore::setUTIFromMIMETypeMap):
129         * testing/Internals.cpp:
130         (WebCore::Internals::getUTIFromMIMEType):
131         * testing/Internals.mm:
132         (WebCore::Internals::getUTIFromMIMEType):
133         * testing/Internals.h:
134         * testing/Internals.idl:
135
136 2020-03-02  Zalan Bujtas  <zalan@apple.com>
137
138         Frame::layerTreeAsText should make sure that all the frames are clean and up-to-date
139         https://bugs.webkit.org/show_bug.cgi?id=208484
140         <rdar://problem/59972433>
141
142         Reviewed by Simon Fraser.
143
144         window.internals.layerTreeAsText() is designed to dump the layer structure of the current page content.
145         It calls updateLayout() on the mainframe's document to make sure we collect the layer information on a clear tree.
146         However Document::updateLayout is scoped to the current document's frame (the mainframe in this case) and
147         leaves all the other frames dirty.
148
149         * page/Frame.cpp:
150         (WebCore::Frame::layerTreeAsText const):
151
152 2020-03-02  Daniel Bates  <dabates@apple.com>
153
154         Annotate editable elements with hit test order
155         https://bugs.webkit.org/show_bug.cgi?id=208463
156         <rdar://problem/59962843>
157
158         Reviewed by Wenson Hsieh.
159
160         Until <rdar://problem/59737118> is fixed, annotate editable elements with their hit test order
161         towards fixing <rdar://problem/59602885>.
162
163         * dom/ElementContext.h:
164         (WebCore::ElementContext::encode const):
165         (WebCore::ElementContext::decode):
166         Encode and decode the optional hit test order.
167
168 2020-03-02  Ross Kirsling  <ross.kirsling@sony.com>
169
170         Unreviewed restabilization of non-unified build.
171
172         * css/parser/CSSSelectorParser.cpp:
173         * css/parser/CSSSelectorParser.h:
174         * layout/blockformatting/PrecomputedBlockMarginCollapse.cpp:
175
176 2020-03-02  Said Abou-Hallawa  <sabouhallawa@apple.com>
177         Implement canvas remote rendering
178         https://bugs.webkit.org/show_bug.cgi?id=204955
179
180         Reviewed by Jon Lee.
181
182         Prepare ConcreteImageBuffer to be created without immediate backend.
183         RemoteImageBuffer, which is a superclass of ConcreteImageBuffer, will be
184         created initially without a backend. It will be created when its twin
185         RemoteImageBufferProxy in the GPUProcess shares its backend.
186
187         * platform/graphics/ConcreteImageBuffer.h:
188         (WebCore::ConcreteImageBuffer::ensureBackendCreated const):
189         (WebCore::ConcreteImageBuffer::ensureBackend const): Deleted.
190
191 2020-03-02  Mark Lam  <mark.lam@apple.com>
192
193         ScriptController::executeIfJavaScriptURL() uses wrong JSGlobalObject.
194         https://bugs.webkit.org/show_bug.cgi?id=208290
195         <rdar://problem/59839476>
196
197         Reviewed by Chris Dumez.
198
199         The call to executeScriptIgnoringException() may have changed the current global
200         object of the window.  We should be using the original global object that produced
201         the result string.
202
203         Also added a missing exception check needed after a potential rope resolution.
204
205         * bindings/js/ScriptController.cpp:
206         (WebCore::ScriptController::executeIfJavaScriptURL):
207
208 2020-03-02  Jacob Uphoff  <jacob_uphoff@apple.com>
209
210         Unreviewed, rolling out r257725.
211
212         This commit caused 10 API tests to fail
213
214         Reverted changeset:
215
216         "[Cocoa] Mapping from MIME type to UTI type should be done in
217         the UI process"
218         https://bugs.webkit.org/show_bug.cgi?id=208415
219         https://trac.webkit.org/changeset/257725
220
221 2020-03-02  Andres Gonzalez  <andresg_22@apple.com>
222
223         Fix for LayoutTests/accessibility/mac/search-text/search-text.html in IsolatedTree mode.
224         https://bugs.webkit.org/show_bug.cgi?id=208434
225
226         Reviewed by Chris Fleizach.
227
228         Covered by LayoutTests/accessibility/mac/search-text/search-text.html
229
230         - Updates IsolatedTree for AXSelectedTextChanged notifications.
231         - Exposes webAreaObject through the AXCoreObject interface.
232         - AXIsolatedObject implementation for hasApplePDFAnnotationAttribute,
233         webAreaObject and stringForRange.
234
235         * accessibility/AXObjectCache.cpp:
236         (WebCore::AXObjectCache::postTextStateChangeNotification):
237         (WebCore::AXObjectCache::updateIsolatedTree):
238         (WebCore::AXObjectCache::rootWebArea):
239         * accessibility/AXObjectCache.h:
240         * accessibility/AccessibilityObject.h:
241         * accessibility/AccessibilityObjectInterface.h:
242         * accessibility/AccessibilityRenderObject.cpp:
243         (WebCore::AccessibilityRenderObject::isLoaded const):
244         (WebCore::AccessibilityRenderObject::accessKey const):
245         * accessibility/AccessibilityScrollView.h:
246         * accessibility/ios/AXObjectCacheIOS.mm:
247         (WebCore::AXObjectCache::postTextStateChangePlatformNotification):
248         (WebCore::AXObjectCache::postTextReplacementPlatformNotification):
249         (WebCore::AXObjectCache::postTextReplacementPlatformNotificationForTextControl):
250         * accessibility/isolatedtree/AXIsolatedObject.cpp:
251         (WebCore::AXIsolatedObject::initializeAttributeData):
252         (WebCore::AXIsolatedObject::stringForRange const):
253         (WebCore::AXIsolatedObject::hasApplePDFAnnotationAttribute const): Deleted.
254         * accessibility/isolatedtree/AXIsolatedObject.h:
255         * accessibility/isolatedtree/AXIsolatedTree.cpp:
256         (WebCore::AXIsolatedTree::removeNode):
257         (WebCore::AXIsolatedTree::applyPendingChanges):
258         * accessibility/mac/AXObjectCacheMac.mm:
259         (WebCore::AXObjectCache::postTextStateChangePlatformNotification):
260         (WebCore::addTextMarkerFor):
261         (WebCore::textReplacementChangeDictionary):
262         (WebCore::postUserInfoForChanges):
263         (WebCore::AXObjectCache::postTextReplacementPlatformNotification):
264         (WebCore::AXObjectCache::postTextReplacementPlatformNotificationForTextControl):
265         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
266         (-[WebAccessibilityObjectWrapper textMarkerRangeFromVisiblePositions:endPosition:]):
267         (-[WebAccessibilityObjectWrapper associatedPluginParent]):
268         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
269         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
270
271 2020-03-02  Wenson Hsieh  <wenson_hsieh@apple.com>
272
273         Make Path::Path(const Path&) and Path::operator=(const Path&) cheap
274         https://bugs.webkit.org/show_bug.cgi?id=208265
275         <rdar://problem/59922452>
276
277         Reviewed by Darin Adler.
278
279         Make WebCore::Path's copy constructor and copy assignment operator cheaper. See below for more details; there
280         should be no observable change in behavior. This gives us approximately 6% back on the canvas lines subtest on
281         MotionMark, when the GPU process is used to render canvases (tested against macOS 10.15.3, on a 10-core iMac).
282
283         * platform/graphics/Path.h:
284         * platform/graphics/cg/PathCG.cpp:
285         (WebCore::Path::~Path):
286         (WebCore::Path::ensurePlatformPath):
287         (WebCore::Path::Path):
288
289         Update move constructors to set m_copyPathBeforeMutation to false on the given (moved) path.
290
291         (WebCore::Path::swap):
292         (WebCore::Path::initializeOrCopyPlatformPathIfNeeded):
293
294         Whenever we need to ensure the platform CGPath (i.e. prior to appending to it), check the new flag to see
295         whether it's necessary to apply the subsequent mutation on a copy of m_path, rather than m_path itself. The
296         exception to this is when m_path only has a retain count of 1, which implies that all other copies of this path
297         have been mutated (and have copied their platform CGPath as a result); this means it's safe to apply changes to
298         m_path, since this path is now the sole owner of the CGPath.
299
300         (WebCore::Path::operator=):
301
302         The copy constructor and copy assignment operators currently call CGPathCreateMutableCopy on the given path's
303         platform CGPath; this is to ensure that if either path is mutated in the future, the mutation won't also affect
304         the other copy of the WebCore::Path.
305
306         However, this call to CGPathCreateMutableCopy isn't needed in the case where a path is copied, but neither of
307         the paths are mutated. To avoid this extra copy, we can instead introduce a dirty bit (m_copyPathBeforeMutation)
308         that is set when a path is copied (either via the constructor, or through assignment) and proceed to simply copy
309         the path pointer to the new path. Only if either path is mutated do we then call CGPathCreateMutableCopy.
310
311         (WebCore::Path::transform):
312         (WebCore::Path::closeSubpath):
313         (WebCore::Path::addArc):
314         (WebCore::Path::addPath):
315         (WebCore::Path::clear):
316
317 2020-03-02  Said Abou-Hallawa  <sabouhallawa@apple.com>
318
319         Implement the remote ImageBuffer
320         https://bugs.webkit.org/show_bug.cgi?id=207221
321
322         Reviewed by Jon Lee.
323
324         * WebCore.xcodeproj/project.pbxproj:
325         * platform/graphics/ConcreteImageBuffer.h:
326         (WebCore::ConcreteImageBuffer::create):
327         ConcreteImageBuffer::create returns the derived class which it creates.
328
329         * platform/graphics/displaylists/DisplayList.h:
330         This using statement gives compilation error when referencing DisplayList
331         from WebKit.
332
333         * platform/graphics/displaylists/DisplayListDrawingContext.h:
334         RemoteImageBuffer inherits DisplayList::ImageBuffer so these methods 
335         need to be exported.
336
337         * platform/graphics/displaylists/DisplayListImageBuffer.h:
338         (WebCore::DisplayList::ImageBuffer::ImageBuffer):
339         Make it possible for RemoteImageBuffer to be created with no backend. It
340         will be created later when RemoteImageBufferProxy shares its backend with
341         RemoteImageBuffer.
342
343 2020-03-02  Rob Buis  <rbuis@igalia.com>
344
345         Fix behavior of pings regarding Origin header
346         https://bugs.webkit.org/show_bug.cgi?id=207102
347
348         Reviewed by Youenn Fablet.
349
350         Fix behavior of pings regarding Origin header by using the
351         "append a request Origin header" algorithm [1]. This patch
352         also sets the origin before calling addExtraFieldsToSubresourceRequest
353         since the latter forces the origin to "null".
354
355         Tests: imported/w3c/web-platform-tests/html/semantics/links/downloading-resources/header-origin-no-referrer-when-downgrade.html
356                imported/w3c/web-platform-tests/html/semantics/links/downloading-resources/header-origin-no-referrer.html
357                imported/w3c/web-platform-tests/html/semantics/links/downloading-resources/header-origin-origin-when-cross-origin.html
358                imported/w3c/web-platform-tests/html/semantics/links/downloading-resources/header-origin-origin.html
359                imported/w3c/web-platform-tests/html/semantics/links/downloading-resources/header-origin-same-origin.html
360                imported/w3c/web-platform-tests/html/semantics/links/downloading-resources/header-origin-strict-origin-when-cross-origin.html
361                imported/w3c/web-platform-tests/html/semantics/links/downloading-resources/header-origin-strict-origin.html
362                imported/w3c/web-platform-tests/html/semantics/links/downloading-resources/header-origin-unsafe-url.html
363                imported/w3c/web-platform-tests/html/semantics/links/downloading-resources/header-origin.html
364
365         [1] https://fetch.spec.whatwg.org/#append-a-request-origin-header
366
367         * loader/PingLoader.cpp:
368         (WebCore::PingLoader::sendPing):
369         * page/SecurityPolicy.cpp:
370         (WebCore::SecurityPolicy::generateOriginHeader):
371         * page/SecurityPolicy.h:
372
373 2020-03-02  Chris Dumez  <cdumez@apple.com>
374
375         Reduce size of PerformanceEntry
376         https://bugs.webkit.org/show_bug.cgi?id=208452
377
378         Reviewed by Devin Rousso.
379
380         Reduce size of PerformanceEntry by leveraging the fact that it is polymorphic.
381
382         * page/PerformanceEntry.cpp:
383         (WebCore::PerformanceEntry::PerformanceEntry):
384         * page/PerformanceEntry.h:
385         (WebCore::PerformanceEntry::name const):
386         (WebCore::PerformanceEntry::isResource const):
387         (WebCore::PerformanceEntry::isMark const):
388         (WebCore::PerformanceEntry::isMeasure const):
389         (WebCore::PerformanceEntry::entryType const): Deleted.
390         (WebCore::PerformanceEntry::type const): Deleted.
391         * page/PerformanceMark.h:
392         * page/PerformanceMeasure.h:
393         * page/PerformanceResourceTiming.cpp:
394         (WebCore::PerformanceResourceTiming::PerformanceResourceTiming):
395         (WebCore::PerformanceResourceTiming::nextHopProtocol const):
396         * page/PerformanceResourceTiming.h:
397
398 2020-03-02  John Wilander  <wilander@apple.com>
399
400         ResourceLoadStatistics: Enable cookie blocking and the Storage Access API in ephemeral sessions
401         https://bugs.webkit.org/show_bug.cgi?id=208399
402         <rdar://problem/24731650>
403
404         Reviewed by Brent Fulgham.
405
406         Tests: http/tests/resourceLoadStatistics/third-party-cookie-blocking-ephemeral-database.html
407                http/tests/resourceLoadStatistics/third-party-cookie-blocking-ephemeral.html
408                http/tests/storageAccess/deny-due-to-no-interaction-under-general-third-party-cookie-blocking-ephemeral.html
409                http/tests/storageAccess/has-storage-access-under-general-third-party-cookie-blocking-with-cookie-ephemeral.html
410                http/tests/storageAccess/has-storage-access-under-general-third-party-cookie-blocking-without-cookie-ephemeral.html
411                http/tests/storageAccess/request-and-grant-access-cross-origin-non-sandboxed-iframe-ephemeral.html
412                http/tests/storageAccess/request-storage-access-cross-origin-sandboxed-iframe-without-user-gesture-ephemeral.html
413
414         * loader/ResourceLoadStatistics.h:
415             Adds a boolean enum IsEphemeral which is used to capture ephemeral state
416             across various classes.
417
418 2020-03-02  Per Arne Vollan  <pvollan@apple.com>
419
420         [Cocoa] Mapping from MIME type to UTI type should be done in the UI process
421         https://bugs.webkit.org/show_bug.cgi?id=208415
422
423         Reviewed by Brent Fulgham.
424
425         This is currently done in the WebContent process, but since this is using a system service which will be closed,
426         this mapping should be moved to the UI process. The UI process will create this mapping for a set of mime types,
427         and send it to the WebContent process.
428
429         API test: WebKit.UTIFromMIMEType
430
431         * platform/network/mac/UTIUtilities.h:
432         * platform/network/mac/UTIUtilities.mm:
433         (WebCore::mapUTIFromMIMEType):
434         (WebCore::UTIFromMIMETypeCachePolicy::createValueForKey):
435         (WebCore::cacheUTIFromMimeType):
436         (WebCore::UTIFromMIMEType):
437         (WebCore::mimeTypes):
438         (WebCore::createUTIFromMIMETypeMap):
439         (WebCore::setUTIFromMIMETypeMap):
440         * testing/Internals.cpp:
441         (WebCore::Internals::getUTIFromMIMEType):
442         * testing/Internals.mm:
443         (WebCore::Internals::getUTIFromMIMEType):
444         * testing/Internals.h:
445         * testing/Internals.idl:
446
447 2020-03-02  Daniel Bates  <dabates@apple.com>
448
449         Page::editableElementsInRect() should find nested editable elements and return found elements in paint order
450         https://bugs.webkit.org/show_bug.cgi?id=208352
451         <rdar://problem/59867815>
452
453         Reviewed by Wenson Hsieh.
454
455         Use the existing rect-based hit testing machinery to collect all the editable elements on
456         the page that a person can hit. This makes it possible to find nested editable elements
457         (e.g. an <input> inside a <div contenteditable="true">), ignore elements with CSS "pointer-events: none",
458         and return elements in paint order (closest to farthest to a person's face). The latter
459         makes it possible for a caller to know what element is frontmost, especially when two
460         editable elements overlap.
461
462         * page/Page.cpp:
463         (WebCore::Page::editableElementsInRect const): Implement in terms of hit testing machinery.
464         * rendering/HitTestLocation.cpp:
465         (WebCore::HitTestLocation::HitTestLocation):
466         * rendering/HitTestLocation.h:
467         * rendering/HitTestResult.cpp:
468         (WebCore::HitTestResult::HitTestResult):
469         * rendering/HitTestResult.h:
470         Added convenience constructors that take a LayoutRect.
471
472 2020-03-02  Doug Kelly  <dougk@apple.com>
473
474         ASSERT(m_column != unsetColumnIndex) in RenderTable::cellBefore
475         https://bugs.webkit.org/show_bug.cgi?id=208397
476
477         Reviewed by Zalan Bujtas.
478
479         When inserting a cell into a table row which is not visible, this can lead to attempting to compute the repaint
480         rects during tree building.  Instead, mark the layer as dirty using dirtyVisibleContentStatus(), and the visibility
481         will be recomputed at a later time.
482
483         Test: fast/table/insert-cell-invisible-parent.html
484
485         * rendering/RenderElement.cpp:
486         (WebCore::RenderElement::insertedIntoTree):
487
488 2020-03-02  Zalan Bujtas  <zalan@apple.com>
489
490         [BFC][MarginCollapsing] Sometimes precomputed margin values are just plain wrong.
491         https://bugs.webkit.org/show_bug.cgi?id=208448
492         <rdar://problem/59950390>
493
494         Reviewed by Antti Koivisto.
495
496         Consider the following content:
497         <div style="float: left"></div>
498         <div style="height: 100px">
499           <div style="float: left"></div>
500           <div>
501             <span style="white-space: pre">  </span>
502           </div>
503           <div style="margin-bottom: 320px;"></div>
504          </div>
505         </div>
506
507         In order to compute the position of the second float we need be able to intersect it with all
508         the other floats in the same floating context. The float positioning starts with the box's static vertical position
509         which is the position the box would be taking if it wasn't floating positioned.
510         This vertical position needs to be in the same coordinate system as all the other floats to be able to intersect properly.
511         The coordinate system is the formatting root's content box.
512         When the second float box is being positioned, we don't yet have final margins for its ancestors, so the box's vertical
513         position at this point is only computed relative to its containing block.
514         In most cases we could just walk the ancestor chain all the way to the formatting root and pre-compute the margin before values.
515         However in some not-so-rare cases, the ancestor margin before value depends on some content after the float box and to be able
516         to figure out the exact margin values, we actually need to lay out the rest of the content.
517         In the example above, the second float's final position depends on whether the <span> has white-space: pre or not (whether the parent
518         div produces empty content or not).
519
520         This patch computes margin before values only for the ancestors ignoring margin collapsing (and margin after values).
521
522         * layout/MarginTypes.h:
523         (WebCore::Layout::PrecomputedMarginBefore::usedValue const):
524         * layout/blockformatting/BlockFormattingContext.cpp:
525         (WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForBoxAndAncestors):
526         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin):
527         (WebCore::Layout::BlockFormattingContext::setPrecomputedMarginBefore): Deleted.
528         (WebCore::Layout::BlockFormattingContext::hasPrecomputedMarginBefore const): Deleted.
529         * layout/blockformatting/BlockFormattingContext.h:
530         * layout/blockformatting/PrecomputedBlockMarginCollapse.cpp:
531         (WebCore::Layout::BlockFormattingContext::MarginCollapse::precomputedPositiveNegativeValues const):
532         (WebCore::Layout::BlockFormattingContext::MarginCollapse::precomputedPositiveNegativeMarginBefore const):
533         (WebCore::Layout::BlockFormattingContext::MarginCollapse::precomputedMarginBefore):
534
535 2020-03-02  Dean Jackson  <dino@apple.com>
536
537         maps.google.com is not loading properly, screen flickers when zooming
538         https://bugs.webkit.org/show_bug.cgi?id=208331
539         <rdar://problem/59790757>
540
541         Reviewed by Antoine Quint.
542
543         When using ANGLE, we don't need the GL_ANGLE_depth_texture extension.
544         We were mistakenly checking for it and deciding to not allow
545         combined depth+stencil framebuffer attachments.
546
547         Test: webgl/1.0.3/conformance/renderbuffers/framebuffer-object-attachment.html
548         (now passes on iOS)
549
550         * html/canvas/WebGLRenderingContextBase.cpp:
551         (WebCore::WebGLRenderingContextBase::setupFlags):
552
553 2020-03-02  Chris Dumez  <cdumez@apple.com>
554
555         Add quirk to disable to back/forward cache on docs.google.com
556         https://bugs.webkit.org/show_bug.cgi?id=208381
557         <rdar://problem/59893415>
558
559         Reviewed by Ryosuke Niwa.
560
561         Google Docs used to bypass the back/forward cache by serving "Cache-Control: no-store"
562         over HTTPS. We started caching such content in r250437 but the Google Docs content
563         unfortunately is not currently compatible because it puts an overlay over the page and
564         starts an animation when navigating away and fails to remove those when coming back from
565         the back/forward cache (e.g. in 'pageshow' event handler).
566
567         * page/Quirks.cpp:
568         (WebCore::Quirks::shouldBypassBackForwardCache const):
569
570 2020-03-02  Jacob Uphoff  <jacob_uphoff@apple.com>
571
572         Unreviewed, rolling out r257687.
573
574         This commit caused debug tests to crash for macOS & iOS
575
576         Reverted changeset:
577
578         "[Cocoa] Mapping from MIME type to UTI type should be done in
579         the UI process"
580         https://bugs.webkit.org/show_bug.cgi?id=208415
581         https://trac.webkit.org/changeset/257687
582
583 2020-03-02  Philippe Normand  <pnormand@igalia.com>
584
585         [GStreamer] Get rid of custom GCD implementation
586         https://bugs.webkit.org/show_bug.cgi?id=208446
587
588         Reviewed by Xabier Rodriguez-Calvar.
589
590         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
591         (WebCore::MediaPlayerPrivateGStreamer::naturalSize const):
592         (WebCore::greatestCommonDivisor): Deleted.
593
594 2020-03-02  Eric Carlson  <eric.carlson@apple.com>
595
596         [GPUP] Plumb through more MediaPlayer methods
597         https://bugs.webkit.org/show_bug.cgi?id=208423
598         <rdar://problem/59924386>
599
600         Reviewed by Youenn Fablet.
601
602         No new tests, unskipped ~1200 existing media tests.
603
604         * html/HTMLMediaElement.cpp:
605         (WebCore::HTMLMediaElement::mediaPlayerPause): Deleted.
606         (WebCore::HTMLMediaElement::mediaPlayerPlay): Deleted.
607         * html/HTMLMediaElement.h:
608
609         * platform/graphics/MediaPlayer.h:
610         (WebCore::MediaPlayerClient::mediaPlayerContentsScale const):
611         (WebCore::MediaPlayerClient::mediaPlayerPause): Deleted.
612         (WebCore::MediaPlayerClient::mediaPlayerPlay): Deleted.
613
614 2020-03-02  Youenn Fablet  <youenn@apple.com>
615
616         LocalSampleBufferDisplayLayer is not computing the correct bounds/position in GPUProcess
617         https://bugs.webkit.org/show_bug.cgi?id=208370
618
619         Reviewed by Eric Carlson.
620
621         When in GPUProcess, we need to update the bounds of the remote LocalSampleBufferDisplayLayer.
622         In case of samples with rotation, the computation was wrong.
623         Move the rotation logic from MediaPLayerPrivateMediaStreamAVFObjC to LocalSampleBufferDisplayLayer.
624         This allows in WebKit2 to send the rotation information with the bounds information.
625         Remove the bounds getter since it is no longer used.
626         Covered by manual tests.
627
628         * platform/graphics/avfoundation/SampleBufferDisplayLayer.h:
629         * platform/graphics/avfoundation/objc/LocalSampleBufferDisplayLayer.h:
630         * platform/graphics/avfoundation/objc/LocalSampleBufferDisplayLayer.mm:
631         (WebCore::LocalSampleBufferDisplayLayer::updateBoundsAndPosition):
632         (WebCore::LocalSampleBufferDisplayLayer::updateRootLayerBoundsAndPosition):
633         (WebCore::LocalSampleBufferDisplayLayer::enqueueSample):
634         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
635         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateDisplayLayer):
636         * platform/mediastream/mac/AVVideoCaptureSource.mm:
637         (WebCore::AVVideoCaptureSource::captureOutputDidOutputSampleBufferFromConnection):
638
639 2020-03-02  Rob Buis  <rbuis@igalia.com>
640
641         Add referrerpolicy attribute support for anchors
642         https://bugs.webkit.org/show_bug.cgi?id=208424
643
644         Reviewed by Darin Adler.
645
646         This patch adds 'referrerpolicy' attribute support for anchor elements.
647         If set, the value is restricted to the ReferrerPolicy enum, and
648         if valid it is used for the script fetch.
649         If not set or invalid, the current behavior is kept.
650
651         Tests: http/tests/referrer-policy-anchor/no-referrer-when-downgrade/cross-origin-http-http.html
652                http/tests/referrer-policy-anchor/no-referrer-when-downgrade/cross-origin-http.https.html
653                http/tests/referrer-policy-anchor/no-referrer-when-downgrade/same-origin.html
654                http/tests/referrer-policy-anchor/no-referrer/cross-origin-http-http.html
655                http/tests/referrer-policy-anchor/no-referrer/cross-origin-http.https.html
656                http/tests/referrer-policy-anchor/no-referrer/same-origin.html
657                http/tests/referrer-policy-anchor/origin-when-cross-origin/cross-origin-http-http.html
658                http/tests/referrer-policy-anchor/origin-when-cross-origin/cross-origin-http.https.html
659                http/tests/referrer-policy-anchor/origin-when-cross-origin/same-origin.html
660                http/tests/referrer-policy-anchor/origin/cross-origin-http-http.html
661                http/tests/referrer-policy-anchor/origin/cross-origin-http.https.html
662                http/tests/referrer-policy-anchor/origin/same-origin.html
663                http/tests/referrer-policy-anchor/same-origin/cross-origin-http-http.html
664                http/tests/referrer-policy-anchor/same-origin/cross-origin-http.https.html
665                http/tests/referrer-policy-anchor/same-origin/same-origin.html
666                http/tests/referrer-policy-anchor/strict-origin-when-cross-origin/cross-origin-http-http.html
667                http/tests/referrer-policy-anchor/strict-origin-when-cross-origin/cross-origin-http.https.html
668                http/tests/referrer-policy-anchor/strict-origin-when-cross-origin/same-origin.html
669                http/tests/referrer-policy-anchor/strict-origin/cross-origin-http-http.html
670                http/tests/referrer-policy-anchor/strict-origin/cross-origin-http.https.html
671                http/tests/referrer-policy-anchor/strict-origin/same-origin.html
672                http/tests/referrer-policy-anchor/unsafe-url/cross-origin-http-http.html
673                http/tests/referrer-policy-anchor/unsafe-url/cross-origin-http.https.html
674                http/tests/referrer-policy-anchor/unsafe-url/same-origin.html
675
676         * html/HTMLAnchorElement.cpp:
677         (WebCore::HTMLAnchorElement::handleClick):
678         (WebCore::HTMLAnchorElement::setReferrerPolicyForBindings):
679         (WebCore::HTMLAnchorElement::referrerPolicyForBindings const):
680         (WebCore::HTMLAnchorElement::referrerPolicy const):
681         * html/HTMLAnchorElement.h:
682         * html/HTMLAnchorElement.idl:
683         * html/HTMLLinkElement.cpp:
684         (WebCore::HTMLLinkElement::handleClick):
685         * inspector/InspectorFrontendClientLocal.cpp:
686         (WebCore::InspectorFrontendClientLocal::openInNewTab):
687         * inspector/agents/InspectorPageAgent.cpp:
688         (WebCore::InspectorPageAgent::navigate):
689         * loader/FrameLoadRequest.cpp:
690         (WebCore::FrameLoadRequest::FrameLoadRequest):
691         * loader/FrameLoadRequest.h:
692         (WebCore::FrameLoadRequest::FrameLoadRequest):
693         (WebCore::FrameLoadRequest::referrerPolicy const):
694         (WebCore::FrameLoadRequest::shouldSendReferrer const): Deleted.
695         * loader/FrameLoader.cpp:
696         (WebCore::FrameLoader::urlSelected):
697         (WebCore::FrameLoader::loadURLIntoChildFrame):
698         (WebCore::FrameLoader::loadFrameRequest):
699         * loader/FrameLoader.h:
700         * loader/FrameLoaderTypes.h:
701         * loader/NavigationScheduler.cpp:
702         (WebCore::NavigationScheduler::scheduleLocationChange):
703         * mathml/MathMLElement.cpp:
704         (WebCore::MathMLElement::defaultEventHandler):
705         * page/ContextMenuController.cpp:
706         (WebCore::openNewWindow):
707         (WebCore::ContextMenuController::contextMenuItemSelected):
708         * page/DOMWindow.cpp:
709         (WebCore::DOMWindow::createWindow):
710         * svg/SVGAElement.cpp:
711         (WebCore::SVGAElement::defaultEventHandler):
712
713 2020-03-02  Carlos Garcia Campos  <cgarcia@igalia.com>
714
715         [GTK][WPE] Stop using mediaControlsBase.js
716         https://bugs.webkit.org/show_bug.cgi?id=208374
717
718         Reviewed by Xabier Rodriguez-Calvar.
719
720         Move the required base functionality to mediaControlsAdwaita.js and use that single file.
721
722         * Modules/mediacontrols/mediaControlsAdwaita.js:
723         (createControls):
724         (Controller):
725         (Controller.prototype.listenFor):
726         (Controller.prototype.stopListeningFor):
727         (Controller.prototype.addVideoListeners):
728         (Controller.prototype.removeVideoListeners):
729         (Controller.prototype.handleEvent):
730         (Controller.prototype.createBase):
731         (Controller.prototype.isAudio):
732         (Controller.prototype.isFullScreen):
733         (Controller.prototype.shouldHaveControls):
734         (Controller.prototype.updateBase):
735         (Controller.prototype.createControls):
736         (Controller.prototype.configureControls):
737         (Controller.prototype.disconnectControls):
738         (Controller.prototype.reconnectControls):
739         (Controller.prototype.showControls):
740         (Controller.prototype.hideControls):
741         (Controller.prototype.resetHideControlsTimer):
742         (Controller.prototype.clearHideControlsTimer):
743         (Controller.prototype.controlsAreAlwaysVisible):
744         (Controller.prototype.controlsAreHidden):
745         (Controller.prototype.addControls):
746         (Controller.prototype.removeControls):
747         (Controller.prototype.updateControls):
748         (Controller.prototype.setIsLive):
749         (Controller.prototype.updateDuration):
750         (Controller.prototype.formatTime):
751         (Controller.prototype.setPlaying):
752         (Controller.prototype.updatePlaying):
753         (Controller.prototype.updateCaptionButton):
754         (Controller.prototype.updateCaptionContainer):
755         (Controller.prototype.updateFullscreenButton):
756         (Controller.prototype.updateVolume):
757         (Controller.prototype.updateHasVideo):
758         (Controller.prototype.handleReadyStateChange):
759         (Controller.prototype.handleTimeUpdate):
760         (Controller.prototype.handleDurationChange):
761         (Controller.prototype.handlePlay):
762         (Controller.prototype.handlePause):
763         (Controller.prototype.handleVolumeChange):
764         (Controller.prototype.handleFullscreenChange):
765         (Controller.prototype.handleTextTrackChange):
766         (Controller.prototype.handleTextTrackAdd):
767         (Controller.prototype.handleTextTrackRemove):
768         (Controller.prototype.handleControlsChange):
769         (Controller.prototype.handleWrapperMouseMove):
770         (Controller.prototype.handleWrapperMouseOut):
771         (Controller.prototype.handleWrapperMouseUp):
772         (Controller.prototype.handlePanelMouseDown):
773         (Controller.prototype.handlePanelTransitionEnd):
774         (Controller.prototype.handlePanelClick):
775         (Controller.prototype.canPlay):
776         (Controller.prototype.handlePlayButtonClicked):
777         (Controller.prototype.handleTimelineChange):
778         (Controller.prototype.handleTimelineMouseUp):
779         (Controller.prototype.handleMuteButtonClicked):
780         (Controller.prototype.handleMuteButtonMouseOver):
781         (Controller.prototype.handleVolumeBoxMouseOut):
782         (Controller.prototype.handleVolumeSliderInput):
783         (Controller.prototype.handleFullscreenButtonClicked):
784         (Controller.prototype.buildCaptionMenu):
785         (Controller.prototype.captionItemSelected):
786         (Controller.prototype.focusSiblingCaptionItem):
787         (Controller.prototype.handleCaptionItemKeyUp):
788         (Controller.prototype.showCaptionMenu):
789         (Controller.prototype.captionMenuTransitionEnd):
790         (Controller.prototype.captionMenuContainsNode):
791         (Controller.prototype.handleCaptionButtonClicked):
792         (Controller.prototype.handleCaptionButtonMouseOver):
793         (Controller.prototype.handleCaptionButtonMouseOut):
794         (Controller.prototype.handleCaptionMenuMouseOut):
795         (ControllerAdwaita): Deleted.
796         (contains): Deleted.
797         (ControllerAdwaita.prototype.createControls): Deleted.
798         (ControllerAdwaita.prototype.configureInlineControls): Deleted.
799         (ControllerAdwaita.prototype.shouldHaveControls): Deleted.
800         (ControllerAdwaita.prototype.reconnectControls): Deleted.
801         (ControllerAdwaita.prototype.setStatusHidden): Deleted.
802         (ControllerAdwaita.prototype.updateTime): Deleted.
803         (ControllerAdwaita.prototype.handleTimeUpdate): Deleted.
804         (ControllerAdwaita.prototype.updateHasAudio): Deleted.
805         (ControllerAdwaita.prototype.handleMuteButtonMouseOver): Deleted.
806         (ControllerAdwaita.prototype.handleVolumeBoxMouseOut): Deleted.
807         (ControllerAdwaita.prototype.removeControls): Deleted.
808         (ControllerAdwaita.prototype.addControls): Deleted.
809         (ControllerAdwaita.prototype.updateFullscreenButton): Deleted.
810         (ControllerAdwaita.prototype.updateReadyState): Deleted.
811         (ControllerAdwaita.prototype.updateDuration): Deleted.
812         (ControllerAdwaita.prototype.setIsLive): Deleted.
813         (ControllerAdwaita.prototype.updatePlaying): Deleted.
814         (ControllerAdwaita.prototype.updateProgress): Deleted.
815         (ControllerAdwaita.prototype.handleCaptionButtonClicked): Deleted.
816         (ControllerAdwaita.prototype.buildCaptionMenu): Deleted.
817         (ControllerAdwaita.prototype.destroyCaptionMenu): Deleted.
818         (ControllerAdwaita.prototype.showCaptionMenu): Deleted.
819         (ControllerAdwaita.prototype.hideCaptionMenu): Deleted.
820         (ControllerAdwaita.prototype.captionMenuTransitionEnd): Deleted.
821         (ControllerAdwaita.prototype.handleCaptionButtonMouseOver): Deleted.
822         (ControllerAdwaita.prototype.handleCaptionButtonShowMenu): Deleted.
823         (ControllerAdwaita.prototype.handleCaptionButtonMouseOut): Deleted.
824         (ControllerAdwaita.prototype.handleCaptionMouseOut): Deleted.
825         * Modules/mediacontrols/mediaControlsBase.js:
826         (Controller.prototype.createControls):
827         * PlatformGTK.cmake:
828         * PlatformWPE.cmake:
829         * rendering/RenderThemeAdwaita.cpp:
830         (WebCore::RenderThemeAdwaita::mediaControlsScript):
831
832 2020-03-01  Zalan Bujtas  <zalan@apple.com>
833
834         Unreviewed build fix for non-unified builds after r257507.
835
836         * layout/blockformatting/BlockFormattingContext.h:
837         * layout/blockformatting/BlockMarginCollapse.cpp:
838         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginValue const):
839         (WebCore::Layout::marginValue): Deleted.
840
841 2020-02-29  Darin Adler  <darin@apple.com>
842
843         Slim down some CSS parsing code
844         https://bugs.webkit.org/show_bug.cgi?id=208418
845
846         Reviewed by Anders Carlsson.
847
848         * css/CSSPrimitiveValue.h: Remove unused createAllowingMarginQuirk function
849         and the FIXME-NEWPARSER that said we wouldn't need it any more and the
850         no-longer-needed isQuirkValue function.
851
852         * css/CSSValue.h: Remove m_isQuirkValue.
853
854         * css/parser/CSSParser.cpp:
855         (WebCore::CSSParser::parseSelector): Call parseCSSSelector instead of
856         CSSSelectorParser::parseSelector, because that's the public function now.
857         * css/parser/CSSParserImpl.cpp:
858         (WebCore::CSSParserImpl::consumeStyleRule): Ditto.
859
860         * css/parser/CSSPropertyParserHelpers.h: Removed a FIXME-NEWPARSER that is
861         now obsolete.
862
863         * css/parser/CSSSelectorParser.cpp: Moved the entire CSSSelectorParser class here from
864         the header, because the only thing used outside this file is the entry point, the
865         now renamed parseCSSSelector function.
866         (WebCore::CSSSelectorParser::DisallowPseudoElementsScope::DisallowPseudoElementsScope):
867         Changed this class to use a reference instead of a pointer.
868         (WebCore::parseCSSSelector): Renamed CSSSelectorParser::parseSelector to this.
869         (WebCore::CSSSelectorParser::consumeComplexSelectorList): Use auto to make some
870         unique_ptr code less verbose.
871         (WebCore::CSSSelectorParser::consumeCompoundSelectorList): Ditto. Removed the check of
872         m_failed. Only the parser entry point function needs that check, and that is the
873         consumeComplexSelectorList function above.
874         (WebCore::extractCompoundFlags): Use static instead of anonymous namespace. Use enum
875         class instead of enum, and use OptionSet instead of unsigned.
876         (WebCore::CSSSelectorParser::consumeComplexSelector): Updated for the above. This
877         refactoring exposed a strangeness in the simple selector loop; for now maintained
878         behavior rather than changing it to do something more logical.
879         (WebCore::isScrollbarPseudoClass): Use static instead of anonymous namespace.
880         (WebCore::isUserActionPseudoClass): Ditto.
881         (WebCore::isPseudoClassValidAfterPseudoElement): Ditto.
882         (WebCore::isSimpleSelectorValidAfterPseudoElement): Ditto.
883         (WebCore::CSSSelectorParser::consumeCompoundSelector): Use auto to make unique_ptr
884         code less verbose. Also inlined the one line applySimpleSelectorToCompound function,
885         because that name didn't document much thus having a function obscured rather than
886         clarifying what was going on. Also use makeUnique instead of new.
887         (WebCore::CSSSelectorParser::consumeId): Use makeUnique instead of new.
888         (WebCore::CSSSelectorParser::consumeClass): Ditto.
889         (WebCore::CSSSelectorParser::consumeAttribute): Ditto.
890         (WebCore::isOnlyPseudoElementFunction): Tweaked a comment.
891         (WebCore::CSSSelectorParser::consumePseudo): Update use of DisallowPseudoElementsScope
892         to use a reference, use auto to make unique_ptr code less verbose, use makeUnique
893         instead of new.
894         (WebCore::consumeANPlusB): Converted to a file-level static function rather than
895         a static member function.
896         (WebCore::CSSSelectorParser::prependTypeSelectorIfNeeded): Changed type from
897         pointer to reference
898         (WebCore::CSSSelectorParser::addSimpleSelectorToCompound): Deleted.
899
900         * css/parser/CSSSelectorParser.h: Removed most of the contents of this file, leaving
901         only the function that is the parser entry point.
902
903         * style/StyleBuilderConverter.h:
904         (WebCore::Style::BuilderConverter::convertLength): This si the one place that sets
905         the quirk on a Length value. It now checks for CSS_QUIRKY_EMS directly rather than
906         using a helper function.
907
908 2020-02-29  Darin Adler  <darin@apple.com>
909
910         Tighten up CSSPendingSubstitutionValue
911         https://bugs.webkit.org/show_bug.cgi?id=208421
912
913         Reviewed by Anders Carlsson.
914
915         * Sources.txt: Removed CSSPendingSubstitutionValue.cpp.
916         * WebCore.xcodeproj/project.pbxproj: Ditto.
917         * css/CSSPendingSubstitutionValue.cpp: Removed.
918
919         * css/CSSPendingSubstitutionValue.h:
920         (WebCore::CSSPendingSubstitutionValue::shorthandValue const): Return a reference
921         instead of a pointer.
922         (WebCore::CSSPendingSubstitutionValue::equals const): Updated since m_shorthandValue
923         is now a Ref instead of RefPtr.
924         (WebCore::CSSPendingSubstitutionValue::customCSSText): Made this a static member
925         function that always returns an empty string.
926
927         * css/StyleProperties.cpp:
928         (WebCore::StyleProperties::getPropertyValue const): Use auto, scoped variables
929         so they don't live until the end of the function. Simplified the code and the
930         comments while retaining as much clarity as possible. Also call getPropertyCSSValue
931         directly instead of calling getPropertyCSSValueInternal.
932         (WebCore::StyleProperties::asText const): Use is<> to make the code simpler.
933         Also updated to use reference instead of pointer from CSSPendingSubstitutionValue.
934
935         * css/StyleProperties.cpp:
936         (WebCore::StyleProperties::borderSpacingValue const): Call getPropertyCSSValue
937         instead of getPropertyCSSValueInternal.
938         (WebCore::StyleProperties::getLayeredShorthandValue const): Ditto.
939         (WebCore::StyleProperties::getShorthandValue const): Ditto.
940         (WebCore::StyleProperties::getCommonValue const): Ditto.
941         (WebCore::StyleProperties::pageBreakPropertyValue const): Ditto. Also added a
942         missing null check.
943         (WebCore::StyleProperties::getPropertyCSSValue const): Merged with the function
944         below since all this did was call getPropertyCSSValueInternal.
945         (WebCore::StyleProperties::getPropertyCSSValueInternal const): Renamed to take
946         away the word internal and merged with the function above.
947         (WebCore::ImmutableStyleProperties::findCustomPropertyIndex const): Removed
948         incorrectly copied and pasted comment.
949         (WebCore::MutableStyleProperties::findCustomPropertyIndex const): Ditto.
950         (WebCore::StyleProperties::copyPropertiesInSet const): Call getPropertyCSSValue
951         instead of getPropertyCSSValueInternal.
952         * css/StyleProperties.h: Removed getPropertyCSSValueInternal.
953
954         * css/parser/CSSParser.cpp:
955         (WebCore::CSSParser::parseValueWithVariableReferences): Use is<> and fewer locals.
956
957         * css/parser/CSSPropertyParser.cpp:
958         (WebCore::CSSPropertyParser::parseValueStart): Removed a local and made this use
959         more Ref and less RefPtr.
960
961 2020-02-29  Darin Adler  <darin@apple.com>
962
963         Move some vectors around instead of heap-allocating them and moving the pointers
964         https://bugs.webkit.org/show_bug.cgi?id=208422
965
966         Reviewed by Sam Weinig.
967
968         * css/CSSKeyframeRule.cpp:
969         (WebCore::StyleRuleKeyframe::StyleRuleKeyframe): Take Vector&& instead of
970         unique_ptr<Vector>.
971         (WebCore::StyleRuleKeyframe::create): Moved these here from the header.
972         Take Vector&& instead of unique_ptr<Vector>.
973         (WebCore::StyleRuleKeyframe::setKeyText): Update since the result is a
974         Vector rather than a unique_ptr<Vector>.
975         * css/CSSKeyframeRule.h: Updated for the above.
976
977         * css/CSSKeyframesRule.cpp:
978         (WebCore::StyleRuleKeyframes::findKeyframeIndex const): Return Optional<size_t>
979         so we don't depend on notFound. This is our better modern pattern, since
980         notFound can work wrong if we mix size_t and unsigned, for example. Also
981         updatd since result of parseKeyFrameKeyList is now a Vector rather than
982         a unique_ptr<Vector>.
983         (WebCore::CSSKeyframesRule::deleteRule): Updated for the above.
984         (WebCore::CSSKeyframesRule::findRule): Ditto.
985         * css/CSSKeyframesRule.h: Updated for the above.
986
987         * css/parser/CSSParser.cpp:
988         (WebCore::CSSParser::parseKeyframeKeyList): Return Vector instead of
989         unique_ptr<Vector>.
990         * css/parser/CSSParser.h: Updated for the above.
991
992         * css/parser/CSSParserImpl.cpp:
993         (WebCore::CSSParserImpl::parseKeyframeKeyList): Return Vector instead of
994         unique_ptr<Vector>.
995         (WebCore::CSSParserImpl::consumeKeyframeStyleRule): Updated for the
996         above change.
997         (WebCore::CSSParserImpl::consumeKeyframeKeyList): Return Vector instead
998         of unique_ptr<Vector>.
999         * css/parser/CSSParserImpl.h: Updated for the above.
1000
1001         * platform/graphics/FloatPolygon.cpp:
1002         (WebCore::FloatPolygon::FloatPolygon): Take Vector&& instead of
1003         unique_ptr<Vector>.
1004         * platform/graphics/FloatPolygon.h: Take Vector&& instead of unique_ptr<Vector>.
1005         Also changed m_vertices to a Vector instead of a unique_ptr<Vector>.
1006
1007         * rendering/shapes/PolygonShape.h: Take Vector&& instead of unique_ptr<Vector>.
1008
1009         * rendering/shapes/Shape.cpp:
1010         (WebCore::createPolygonShape): Take Vector&& instead of unique_ptr<Vector>.
1011         (WebCore::Shape::createShape): Use a Vector instead of a unique_ptr<Vector>.
1012
1013 2020-03-01  Zalan Bujtas  <zalan@apple.com>
1014
1015         [LFC][MarginCollapsing] Do not re-compute PositiveAndNegativeVerticalMargin values
1016         https://bugs.webkit.org/show_bug.cgi?id=208419
1017         <rdar://problem/59923666>
1018
1019         Reviewed by Antti Koivisto.
1020
1021         MarginCollapse::collapsedVerticalValues() already computes the positive/negative before/after pairs.
1022
1023         * layout/MarginTypes.h:
1024         * layout/blockformatting/BlockFormattingContext.cpp:
1025         (WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForBoxAndAncestors):
1026         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin):
1027         * layout/blockformatting/BlockFormattingContext.h:
1028         * layout/blockformatting/BlockFormattingContextQuirks.cpp:
1029         (WebCore::Layout::BlockFormattingContext::Quirks::stretchedInFlowHeight):
1030         * layout/blockformatting/BlockMarginCollapse.cpp:
1031         (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeValues const):
1032         (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedVerticalValues):
1033         (WebCore::Layout::BlockFormattingContext::MarginCollapse::resolvedPositiveNegativeMarginValues): Deleted.
1034
1035 2020-03-01  Simon Fraser  <simon.fraser@apple.com>
1036
1037         Convert m_scrollingNodeToLayerMap to use WeakPtr<RenderLayer>
1038         https://bugs.webkit.org/show_bug.cgi?id=208403
1039
1040         Reviewed by Zalan Bujtas.
1041
1042         Use WeakPtr<> in m_scrollingNodeToLayerMap.
1043
1044         * rendering/RenderLayerCompositor.cpp:
1045         (WebCore::RenderLayerCompositor::attachScrollingNode):
1046         (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayerWithRole):
1047         (WebCore::RenderLayerCompositor::scrollableAreaForScrollLayerID const):
1048         * rendering/RenderLayerCompositor.h:
1049
1050 2020-02-29  Yusuke Suzuki  <ysuzuki@apple.com>
1051
1052         Remove std::lock_guard
1053         https://bugs.webkit.org/show_bug.cgi?id=206451
1054
1055         Reviewed by Anders Carlsson.
1056
1057         * Modules/webaudio/AudioBufferSourceNode.cpp:
1058         (WebCore::AudioBufferSourceNode::setBuffer):
1059         * Modules/webaudio/AudioParamTimeline.cpp:
1060         (WebCore::AudioParamTimeline::insertEvent):
1061         (WebCore::AudioParamTimeline::cancelScheduledValues):
1062         * Modules/webaudio/ConvolverNode.cpp:
1063         (WebCore::ConvolverNode::reset):
1064         (WebCore::ConvolverNode::setBuffer):
1065         * Modules/webaudio/MediaElementAudioSourceNode.cpp:
1066         (WebCore::MediaElementAudioSourceNode::setFormat):
1067         * Modules/webaudio/MediaStreamAudioSourceNode.cpp:
1068         (WebCore::MediaStreamAudioSourceNode::setFormat):
1069         * Modules/webaudio/OscillatorNode.cpp:
1070         (WebCore::OscillatorNode::setPeriodicWave):
1071         * Modules/webaudio/PannerNode.cpp:
1072         (WebCore::PannerNode::setPanningModel):
1073         * Modules/webaudio/WaveShaperProcessor.cpp:
1074         (WebCore::WaveShaperProcessor::setCurve):
1075         (WebCore::WaveShaperProcessor::setOversample):
1076         * Modules/webdatabase/Database.cpp:
1077         (WebCore::Database::Database):
1078         (WebCore::Database::performOpenAndVerify):
1079         (WebCore::Database::closeDatabase):
1080         (WebCore::Database::getCachedVersion const):
1081         (WebCore::Database::setCachedVersion):
1082         * Modules/webdatabase/DatabaseManager.cpp:
1083         (WebCore::DatabaseManager::addProposedDatabase):
1084         (WebCore::DatabaseManager::removeProposedDatabase):
1085         (WebCore::DatabaseManager::fullPathForDatabase):
1086         (WebCore::DatabaseManager::detailsForNameAndOrigin):
1087         * crypto/CryptoAlgorithmRegistry.cpp:
1088         (WebCore::CryptoAlgorithmRegistry::identifier):
1089         (WebCore::CryptoAlgorithmRegistry::name):
1090         (WebCore::CryptoAlgorithmRegistry::create):
1091         (WebCore::CryptoAlgorithmRegistry::registerAlgorithm):
1092         * inspector/agents/WebHeapAgent.cpp:
1093         (WebCore::SendGarbageCollectionEventsTask::addGarbageCollection):
1094         (WebCore::SendGarbageCollectionEventsTask::reset):
1095         (WebCore::SendGarbageCollectionEventsTask::timerFired):
1096         * page/scrolling/ScrollingThread.cpp:
1097         (WebCore::ScrollingThread::dispatch):
1098         (WebCore::ScrollingThread::dispatchFunctionsFromScrollingThread):
1099         * page/scrolling/generic/ScrollingThreadGeneric.cpp:
1100         (WebCore::ScrollingThread::initializeRunLoop):
1101         * page/scrolling/mac/ScrollingThreadMac.mm:
1102         (WebCore::ScrollingThread::initializeRunLoop):
1103         * platform/audio/ReverbConvolver.cpp:
1104         (WebCore::ReverbConvolver::~ReverbConvolver):
1105         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
1106         (WebCore::AudioSourceProviderAVFObjC::~AudioSourceProviderAVFObjC):
1107         (WebCore::AudioSourceProviderAVFObjC::finalizeCallback):
1108         (WebCore::AudioSourceProviderAVFObjC::prepareCallback):
1109         (WebCore::AudioSourceProviderAVFObjC::unprepareCallback):
1110         (WebCore::AudioSourceProviderAVFObjC::processCallback):
1111         * platform/graphics/cocoa/FontCacheCoreText.cpp:
1112         (WebCore::FontDatabase::collectionForFamily):
1113         (WebCore::FontDatabase::clear):
1114         * platform/ios/wak/WebCoreThreadRun.cpp:
1115         * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm:
1116         (WebCore::WebAudioSourceProviderAVFObjC::~WebAudioSourceProviderAVFObjC):
1117         (WebCore::WebAudioSourceProviderAVFObjC::prepare):
1118         (WebCore::WebAudioSourceProviderAVFObjC::unprepare):
1119         * platform/network/cf/LoaderRunLoopCF.cpp:
1120         (WebCore::loaderRunLoop):
1121         * platform/sql/SQLiteDatabase.cpp:
1122         (WebCore::SQLiteDatabase::setIsDatabaseOpeningForbidden):
1123         (WebCore::SQLiteDatabase::open):
1124         * platform/sql/SQLiteDatabaseTracker.cpp:
1125         (WebCore::SQLiteDatabaseTracker::setClient):
1126         (WebCore::SQLiteDatabaseTracker::incrementTransactionInProgressCount):
1127         (WebCore::SQLiteDatabaseTracker::decrementTransactionInProgressCount):
1128         (WebCore::SQLiteDatabaseTracker::hasTransactionInProgress):
1129         * platform/text/TextEncodingRegistry.cpp:
1130         (WebCore::buildBaseTextCodecMaps):
1131         (WebCore::newTextCodec):
1132         (WebCore::atomCanonicalTextEncodingName):
1133
1134 2020-02-29  Per Arne Vollan  <pvollan@apple.com>
1135
1136         [Cocoa] Mapping from MIME type to UTI type should be done in the UI process
1137         https://bugs.webkit.org/show_bug.cgi?id=208415
1138
1139         Reviewed by Brent Fulgham.
1140
1141         This is currently done in the WebContent process, but since this is using a system service which will be closed,
1142         this mapping should be moved to the UI process. The UI process will create this mapping for a set of mime types,
1143         and send it to the WebContent process.
1144
1145         API test: WebKit.UTIFromMIMEType
1146
1147         * platform/network/mac/UTIUtilities.h:
1148         * platform/network/mac/UTIUtilities.mm:
1149         (WebCore::mapUTIFromMIMEType):
1150         (WebCore::UTIFromMIMETypeCachePolicy::createValueForKey):
1151         (WebCore::cacheUTIFromMimeType):
1152         (WebCore::UTIFromMIMEType):
1153         (WebCore::mimeTypes):
1154         (WebCore::createUTIFromMIMETypeMap):
1155         (WebCore::setUTIFromMIMETypeMap):
1156         * testing/Internals.cpp:
1157         (WebCore::Internals::getUTIFromMIMEType):
1158         * testing/Internals.mm:
1159         (WebCore::Internals::getUTIFromMIMEType):
1160         * testing/Internals.h:
1161         * testing/Internals.idl:
1162
1163 2020-02-29  Zalan Bujtas  <zalan@apple.com>
1164
1165         [LFC][BFC] Consolidate precomputeVerticalPositionForAncestors and precomputeVerticalPosition
1166         https://bugs.webkit.org/show_bug.cgi?id=208414
1167         <rdar://problem/59919467>
1168
1169         Reviewed by Antti Koivisto.
1170
1171         BlockFormattingContext::precomputeVerticalPositionForBoxAndAncestors takes care of both the box and its ancestors now.
1172         This is also in preparation for making precompute logic a bit simpler. 
1173
1174         * layout/blockformatting/BlockFormattingContext.cpp:
1175         (WebCore::Layout::BlockFormattingContext::layoutInFlowContent):
1176         (WebCore::Layout::BlockFormattingContext::usedAvailableWidthForFloatAvoider):
1177         (WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForAncestors):
1178         (WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForBoxAndAncestors):
1179         (WebCore::Layout::BlockFormattingContext::precomputeVerticalPosition): Deleted.
1180         (WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForFormattingRoot): Deleted.
1181         * layout/blockformatting/BlockFormattingContext.h:
1182
1183 2020-02-29  Zalan Bujtas  <zalan@apple.com>
1184
1185         [LFC][Floats] FloatingState::top should return topmost logical vertical position
1186         https://bugs.webkit.org/show_bug.cgi?id=208412
1187         <rdar://problem/59918798>
1188
1189         Reviewed by Antti Koivisto.
1190
1191         Test: fast/layoutformattingcontext/block-only/block-root-top-should-start-from-float-top.html
1192
1193         When computing the used height for an auto: height formatting root block level container, we have to take both the non-floating and floating
1194         in-flow boxes into account. This patch ensures that in case of multiple floats, we use the topmost float's logical top position. 
1195
1196         * layout/floats/FloatingState.cpp:
1197         (WebCore::Layout::FloatingState::top const):
1198
1199 2020-02-29  Zalan Bujtas  <zalan@apple.com>
1200
1201         [LFC][Floats] The used available width for float avoider with clear always matches the containing block's constraint
1202         https://bugs.webkit.org/show_bug.cgi?id=208411
1203         <rdar://problem/59918356>
1204
1205         Reviewed by Antti Koivisto.
1206
1207         Test: fast/layoutformattingcontext/block-only/float-clear-with-auto-width.html
1208
1209         Float clear pushes the block level box either below the floats, or just one side below but the other side could overlap.
1210         What it means is that the used available width always matches the containing block's constraint.
1211
1212         * layout/blockformatting/BlockFormattingContext.cpp:
1213         (WebCore::Layout::BlockFormattingContext::usedAvailableWidthForFloatAvoider):
1214         (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear):
1215
1216 2020-02-28  Peng Liu  <peng.liu6@apple.com>
1217
1218         [Media in GPU process] Implement the video fullscreen and Picture-in-Picture support
1219         https://bugs.webkit.org/show_bug.cgi?id=208252
1220
1221         Reviewed by Simon Fraser.
1222
1223         Covered by existing tests.
1224
1225         This patch moves the creation of the CALayer for video fullscreen and picture-in-picture from
1226         VideoFullscreenManager to MediaPlayerPrivate classes. With this change, we can support
1227         video fullscreen and picture-in-picture no matter the "Media in GPU process"
1228         feature is enabled or not. The function createVideoFullscreenLayer() is added to
1229         MediaPlayer and MediaPlayerPrivate for that purpose.
1230
1231         There are duplicated code snippets to create a CALayer in MediaPlayerPrivateAVFoundationObjC,
1232         MediaPlayerPrivateMediaSourceAVFObjC, and MediaPlayerPrivateMediaStreamAVFObjC.
1233         That will be fixed in a future refactoring (webkit.org/b/208342).
1234
1235         * html/HTMLMediaElement.cpp:
1236         (WebCore::HTMLMediaElement::createVideoFullscreenLayer):
1237         * html/HTMLMediaElement.h:
1238         * platform/cocoa/VideoFullscreenModelVideoElement.h:
1239         * platform/cocoa/VideoFullscreenModelVideoElement.mm:
1240         (WebCore::VideoFullscreenModelVideoElement::createVideoFullscreenLayer):
1241         * platform/graphics/MediaPlayer.cpp:
1242         (WebCore::MediaPlayer::createVideoFullscreenLayer):
1243         * platform/graphics/MediaPlayer.h:
1244         * platform/graphics/MediaPlayerPrivate.h:
1245         (WebCore::MediaPlayerPrivateInterface::createVideoFullscreenLayer):
1246         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
1247         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1248         (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoFullscreenLayer):
1249         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
1250         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1251         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::createVideoFullscreenLayer):
1252         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
1253         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
1254         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::createVideoFullscreenLayer):
1255
1256 2020-02-28  Wenson Hsieh  <wenson_hsieh@apple.com>
1257
1258         Add an internal setting to enable or disable canvas rendering in the GPU Process
1259         https://bugs.webkit.org/show_bug.cgi?id=208375
1260
1261         Reviewed by Tim Horton.
1262
1263         Adds an internal setting to enable or disable the GPU process when rendering canvases. To do this, we add a
1264         codepath for creating a new ImageBuffer, given enum types that indicate whether to try and enable acceleration,
1265         and also whether to use display lists.
1266
1267         * html/HTMLCanvasElement.cpp:
1268         (WebCore::HTMLCanvasElement::createImageBuffer const):
1269
1270         Use the new ImageBuffer::create method.
1271
1272         * page/Chrome.cpp:
1273         (WebCore::Chrome::createImageBuffer const):
1274         * page/Chrome.h:
1275         * page/ChromeClient.h:
1276         (WebCore::ChromeClient::createImageBuffer const):
1277         * platform/HostWindow.h:
1278         * platform/graphics/ImageBuffer.cpp:
1279         (WebCore::ImageBuffer::create):
1280
1281         Add a new version of ImageBuffer::create that does not directly take a RenderingMode, but instead takes the
1282         a few pieces of information that the client layer will need to decide what kind of ImageBuffer it should create.
1283
1284         * platform/graphics/ImageBuffer.h:
1285         * platform/graphics/RenderingMode.h:
1286
1287         Add some new enum types to represent hints provided by WebCore when it asks the client layer for a new
1288         ImageBuffer.
1289
1290 2020-02-28  Chris Dumez  <cdumez@apple.com>
1291
1292         Garbage collection prevents FontFace.loaded promise from getting resolved
1293         https://bugs.webkit.org/show_bug.cgi?id=208382
1294
1295         Reviewed by Ryosuke Niwa.
1296
1297         Make sure the FontFace JS wrapper stays alive long enough to resolve the
1298         loaded promise when it is observable by the page's script.
1299
1300         Test: fast/text/font-promises-gc.html
1301
1302         * css/CSSFontFace.cpp:
1303         (WebCore::CSSFontFace::document const):
1304         * css/CSSFontFace.h:
1305         * css/FontFace.cpp:
1306         (WebCore::FontFace::FontFace):
1307         (WebCore::FontFace::fontStateChanged):
1308         (WebCore::FontFace::loadForBindings):
1309         (WebCore::FontFace::loadedForBindings):
1310         (WebCore::FontFace::activeDOMObjectName const):
1311         (WebCore::FontFace::hasPendingActivity const):
1312         (WebCore::FontFace::load): Deleted.
1313         * css/FontFace.h:
1314         * css/FontFace.idl:
1315
1316 2020-02-28  Jer Noble  <jer.noble@apple.com>
1317
1318         [GPUP] Implement Modern EME API in the GPU Process
1319         https://bugs.webkit.org/show_bug.cgi?id=208090
1320
1321         Reviewed by Eric Carlson.
1322
1323         To enable caching of certain CDM properties, allow them to be fetched rather than queries. As such,
1324         CDMPrivate::supportsInitDataType -> supportedInitDataTypes, supportsRobustness -> supportedRobustnesses.
1325
1326         To enable CDM types to be passed across XPC, add explicit sizes to the enumerations, and add encode and
1327         decode templates to the data types.
1328
1329         To enable async messaging form the GPU process's MediaPlayer, send the MediaPlayer the information it
1330         needs when both legacy- and modern-EME APIs are both enabled, rather than allow the MediaPlayerPrivate
1331         to query the MediaPlayer.
1332
1333         Move most of the algorithimic implementation from CDM into CDMPrivate, allowing it to be run from within
1334         the GPU process. Similmarly, make most of the synchronous methods in CDMInstance instead take a callback
1335         parameter, allowing them to be implemented in a remote process.
1336
1337         * Headers.cmake:
1338         * Modules/encryptedmedia/CDM.cpp:
1339         (WebCore::CDM::getSupportedConfiguration):
1340         (WebCore::CDM::supportsInitDataType const):
1341         * Modules/encryptedmedia/CDM.h:
1342         * Modules/encryptedmedia/MediaKeySession.cpp:
1343         (WebCore::MediaKeySession::update):
1344         * Modules/encryptedmedia/MediaKeySystemAccess.cpp:
1345         (WebCore::MediaKeySystemAccess::createMediaKeys):
1346         * Modules/encryptedmedia/MediaKeys.cpp:
1347         (WebCore::MediaKeys::setServerCertificate):
1348         * Modules/encryptedmedia/MediaKeys.h:
1349         * Modules/encryptedmedia/MediaKeys.idl:
1350         * Sources.txt:
1351         * WebCore.xcodeproj/project.pbxproj:
1352         * html/HTMLMediaElement.cpp:
1353         (WebCore::HTMLMediaElement::updateShouldContinueAfterNeedKey):
1354         (WebCore::HTMLMediaElement::mediaPlayerKeyNeeded):
1355         (WebCore::HTMLMediaElement::mediaEngineWasUpdated):
1356         (WebCore::HTMLMediaElement::addEventListener):
1357         (WebCore::HTMLMediaElement::removeEventListener):
1358         * html/HTMLMediaElement.h:
1359         * platform/encryptedmedia/CDMEncryptionScheme.h:
1360         * platform/encryptedmedia/CDMFactory.cpp:
1361         (WebCore::CDMFactory::resetFactories):
1362         * platform/encryptedmedia/CDMFactory.h:
1363         * platform/encryptedmedia/CDMInstance.h:
1364         * platform/encryptedmedia/CDMInstanceSession.h:
1365         * platform/encryptedmedia/CDMKeyStatus.h:
1366         * platform/encryptedmedia/CDMKeySystemConfiguration.h:
1367         (WebCore::CDMKeySystemConfiguration::encode const):
1368         (WebCore::CDMKeySystemConfiguration::decode):
1369         * platform/encryptedmedia/CDMMediaCapability.h:
1370         (WebCore::CDMMediaCapability::encode const):
1371         (WebCore::CDMMediaCapability::decode):
1372         * platform/encryptedmedia/CDMMessageType.h:
1373         * platform/encryptedmedia/CDMPrivate.cpp:
1374         (WebCore::CDMPrivate::getSupportedConfiguration):
1375         (WebCore::CDMPrivate::doSupportedConfigurationStep):
1376         (WebCore::CDMPrivate::isPersistentType):
1377         (WebCore::CDMPrivate::getSupportedCapabilitiesForAudioVideoType):
1378         (WebCore::CDMPrivate::getConsentStatus):
1379         * platform/encryptedmedia/CDMPrivate.h:
1380         * platform/encryptedmedia/CDMRequirement.h:
1381         * platform/encryptedmedia/CDMRestrictions.h:
1382         (WebCore::CDMRestrictions::encode const):
1383         (WebCore::CDMRestrictions::decode):
1384         * platform/encryptedmedia/CDMSessionType.h:
1385         * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
1386         (WebCore::CDMPrivateClearKey::supportedInitDataTypes const):
1387         (WebCore::CDMPrivateClearKey::supportsSessionTypeWithConfiguration const):
1388         (WebCore::CDMPrivateClearKey::supportedRobustnesses const):
1389         (WebCore::CDMInstanceClearKey::initializeWithConfiguration):
1390         (WebCore::CDMInstanceClearKey::setServerCertificate):
1391         (WebCore::CDMInstanceClearKey::setStorageDirectory):
1392         (WebCore::CDMInstanceSessionClearKey::updateLicense):
1393         * platform/encryptedmedia/clearkey/CDMClearKey.h:
1394         * platform/graphics/MediaPlayer.cpp:
1395         (WebCore::MediaPlayer::setShouldContinueAfterKeyNeeded):
1396         (WebCore::MediaPlayer::keyNeeded):
1397         * platform/graphics/MediaPlayer.h:
1398         (WebCore::MediaPlayerClient::mediaPlayerKeyNeeded):
1399         * platform/graphics/MediaPlayerPrivate.h:
1400         (WebCore::MediaPlayerPrivateInterface::setShouldContinueAfterKeyNeeded):
1401         * platform/graphics/avfoundation/CDMFairPlayStreaming.cpp:
1402         (WebCore::CDMPrivateFairPlayStreaming::supportedInitDataTypes const):
1403         (WebCore::CDMPrivateFairPlayStreaming::supportsSessionTypeWithConfiguration const):
1404         (WebCore::CDMPrivateFairPlayStreaming::supportedRobustnesses const):
1405         (WebCore::CDMPrivateFairPlayStreaming::supportsInitData const):
1406         * platform/graphics/avfoundation/CDMFairPlayStreaming.h:
1407         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
1408         (WebCore::AVFWrapper::shouldWaitForLoadingOfResource):
1409         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h:
1410         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
1411         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::initializeWithConfiguration):
1412         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::setServerCertificate):
1413         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::setStorageDirectory):
1414         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::updateLicense):
1415         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::sessionIdentifierChanged):
1416         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1417         (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource):
1418         * testing/MockCDMFactory.cpp:
1419         (WebCore::MockCDMFactory::setSupportedRobustness):
1420         (WebCore::MockCDM::supportedInitDataTypes const):
1421         (WebCore::MockCDM::supportedRobustnesses const):
1422         (WebCore::MockCDM::supportsSessionTypeWithConfiguration const):
1423         (WebCore::MockCDM::supportsInitData const):
1424         (WebCore::MockCDMInstance::initializeWithConfiguration):
1425         (WebCore::MockCDMInstance::setServerCertificate):
1426         (WebCore::MockCDMInstance::setStorageDirectory):
1427         (WebCore::MockCDMInstanceSession::updateLicense):
1428         * testing/MockCDMFactory.h:
1429         (WebCore::MockCDMFactory::supportedRobustness const):
1430
1431 2020-02-28  Chris Dumez  <cdumez@apple.com> and Yusuke Suzuki  <ysuzuki@apple.com>
1432
1433         Clear FontDatabase when low-memory-warning happens
1434         https://bugs.webkit.org/show_bug.cgi?id=208389
1435
1436         Reviewed by Chris Dumez.
1437
1438         FontDatabase can monotonically increase. We should clear it when low-memory-warning happens.
1439
1440         * platform/graphics/cocoa/FontCacheCoreText.cpp:
1441         (WebCore::FontCache::platformPurgeInactiveFontData):
1442
1443 2020-02-28  Takashi Komori  <Takashi.Komori@sony.com>
1444
1445         [Curl] Add TLS debugging feature to log encryption keys
1446         https://bugs.webkit.org/show_bug.cgi?id=208192
1447
1448         Reviewed by Fujii Hironori.
1449
1450         This patch enables recording encryption keys on curl port.
1451         When you set key log file path to environment variable SSLKEYLOGFILE on curl port, network process writes encryption keys into the path.
1452         The key log file follows the NSS key log format and this feature is as same as Chrome and Firefox have.
1453
1454         See also: https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/Key_Log_Format
1455
1456         Test: No tests for this debugging feature. We have to check manually if the log file is generate.
1457
1458         * platform/network/curl/CurlContext.cpp:
1459         (WebCore::CurlContext::CurlContext):
1460         * platform/network/curl/CurlContext.h:
1461         (WebCore::CurlContext::shouldLogTLSKey const):
1462         (WebCore::CurlContext::tlsKeyLogFilePath const):
1463         * platform/network/curl/CurlSSLVerifier.cpp:
1464         (WebCore::CurlSSLVerifier::CurlSSLVerifier):
1465         (WebCore::CurlSSLVerifier::infoCallback):
1466         (WebCore::CurlSSLVerifier::logTLSKey):
1467         * platform/network/curl/CurlSSLVerifier.h:
1468
1469 2020-02-28  Chris Dumez  <cdumez@apple.com>
1470
1471         MediaResourceLoader leaks resource responses
1472         https://bugs.webkit.org/show_bug.cgi?id=208267
1473
1474         Reviewed by Eric Carlson.
1475
1476         MediaResourceLoader leaks resource responses when browsing in Safari, even though these responses are
1477         only used for testing. AVAssetCustomURLBridgeForNSURLSession holds on to the WebCoreNSURLSession, which
1478         keeps the MediaResourceLoader alive, even if there is no media on the current page. In turn, the
1479         MediaResourceLoader always keeps in memory the last 5 HTTP responses.
1480
1481         To address the issue, we now only record these responses when running the tests.
1482
1483         * loader/MediaResourceLoader.cpp:
1484         (WebCore::MediaResourceLoader::recordResponsesForTesting):
1485         (WebCore::MediaResourceLoader::addResponseForTesting):
1486         * loader/MediaResourceLoader.h:
1487         * testing/Internals.cpp:
1488         (WebCore::Internals::resetToConsistentState):
1489
1490 2020-02-28  Keith Rollin  <krollin@apple.com>
1491
1492         Convert frame address in logging statements to pageID+frameID
1493         https://bugs.webkit.org/show_bug.cgi?id=208325
1494         <rdar://problem/59850768>
1495
1496         Reviewed by Alex Christensen.
1497
1498         Some old logging prints the address of the associated frame object.
1499         Annotating logging statements this way makes it difficult to match up
1500         that logging with other logging that uses pageID+frameID. Update the
1501         logging to consistently use the latter format.
1502
1503         No new tests -- no new or changed functionality.
1504
1505         * loader/DocumentLoader.cpp:
1506         (WebCore::DocumentLoader::setRequest):
1507         (WebCore::DocumentLoader::setMainDocumentError):
1508         (WebCore::DocumentLoader::mainReceivedError):
1509         (WebCore::DocumentLoader::stopLoading):
1510         (WebCore::DocumentLoader::notifyFinished):
1511         (WebCore::DocumentLoader::willSendRequest):
1512         (WebCore::DocumentLoader::tryLoadingSubstituteData):
1513         (WebCore::DocumentLoader::disallowDataRequest const):
1514         (WebCore::DocumentLoader::continueAfterContentPolicy):
1515         (WebCore::DocumentLoader::startLoadingMainResource):
1516         (WebCore::DocumentLoader::loadMainResource):
1517         (WebCore::DocumentLoader::cancelMainResourceLoad):
1518         * loader/FrameLoader.cpp:
1519         (WebCore::FrameLoader::pageID const):
1520         (WebCore::FrameLoader::frameID const):
1521         (WebCore::FrameLoader::retryAfterFailedCacheOnlyMainResourceLoad):
1522         * loader/FrameLoader.h:
1523         * loader/ResourceLoader.cpp:
1524         * loader/SubresourceLoader.cpp:
1525         * loader/cache/CachedResource.cpp:
1526         (WebCore::CachedResource::load):
1527         * loader/cache/CachedResourceLoader.cpp:
1528         (WebCore::CachedResourceLoader::requestResource):
1529         * page/Frame.cpp:
1530         (WebCore::Frame::pageID const):
1531         (WebCore::Frame::frameID const):
1532         * page/Frame.h:
1533         * page/FrameView.cpp:
1534
1535 2020-02-28  Eric Carlson  <eric.carlson@apple.com>
1536
1537         No port uses USE_NATIVE_FULLSCREEN_VIDEO, remove it
1538         https://bugs.webkit.org/show_bug.cgi?id=208378
1539         <rdar://problem/59892497>
1540
1541         Reviewed by Jer Noble.
1542
1543         No new tests, unused code removed.
1544
1545         * dom/FullscreenManager.cpp:
1546         (WebCore::FullscreenManager::willEnterFullscreen):
1547         * platform/graphics/MediaPlayer.cpp:
1548         (WebCore::MediaPlayer::enterFullscreen): Deleted.
1549         (WebCore::MediaPlayer::exitFullscreen): Deleted.
1550         (WebCore::MediaPlayer::canEnterFullscreen const): Deleted.
1551         * platform/graphics/MediaPlayer.h:
1552         * platform/graphics/MediaPlayerPrivate.h:
1553         (WebCore::MediaPlayerPrivateInterface::enterFullscreen): Deleted.
1554         (WebCore::MediaPlayerPrivateInterface::exitFullscreen): Deleted.
1555         (WebCore::MediaPlayerPrivateInterface::canEnterFullscreen const): Deleted.
1556
1557 2020-02-28  Eric Carlson  <eric.carlson@apple.com>
1558
1559         Regression r257612: Windows build broken
1560         https://bugs.webkit.org/show_bug.cgi?id=208372
1561         <rdar://problem/59885001>
1562
1563         Unreviewed Windows build fix.
1564
1565         * platform/graphics/InbandGenericCue.cpp:
1566         (WebCore::InbandGenericCue::toJSONString const):
1567
1568 2020-02-28  Dean Jackson  <dino@apple.com>
1569
1570         updateCSSTransitionsForElementAndProperty should clone RenderStyles
1571         https://bugs.webkit.org/show_bug.cgi?id=208356
1572         rdar://59869560
1573
1574         Reviewed by Antti Koivisto.
1575
1576         Make ownership of the local variable clear by cloning the RenderStyles
1577         used in updateCSSTransitionsForElementAndProperty rather than referencing
1578         different versions.
1579
1580         * animation/AnimationTimeline.cpp:
1581         (WebCore::AnimationTimeline::updateCSSTransitionsForElementAndProperty):
1582
1583 2020-02-28  Chris Dumez  <cdumez@apple.com>
1584
1585         Retain cycle between CSSFontSelector -> CSSFontFaceSet -> CSSFontFace -> CSSFontSelector
1586         https://bugs.webkit.org/show_bug.cgi?id=196437
1587         <rdar://problem/46598332>
1588
1589         Reviewed by Alex Christensen.
1590
1591         Break the reference cycle using a WeakPtr. The leak was reproducible by browsing CNN.com
1592         and then navigating to about:blank (those objects would stay around, even after memory
1593         pressure signal).
1594
1595         * css/CSSFontFace.cpp:
1596         (WebCore::CSSFontFace::CSSFontFace):
1597         (WebCore::CSSFontFace::fontLoadEventOccurred):
1598         * css/CSSFontFace.h:
1599
1600 2020-02-28  Alberto Garcia  <berto@igalia.com>
1601
1602         [SOUP] Unreviewed. Fix unused parameter warning
1603
1604         * platform/network/soup/NetworkStorageSessionSoup.cpp:
1605         (WebCore::NetworkStorageSession::getRawCookies const):
1606
1607 2020-02-28  Yusuke Suzuki  <ysuzuki@apple.com>
1608
1609         Shrink-to-fit Display::LineBox/Display::Run vectors.
1610         https://bugs.webkit.org/show_bug.cgi?id=208343
1611
1612         Reviewed by Antti Koivisto.
1613
1614         From the collected data in PLT5, 95% of Runs / LineBoxes are <= 4, while we are having 10 and 5 inlineCapacity.
1615         We adjust this inlineCapacity to 4 based on this number. It also covers almost all of Speedometer2.0 content (in it, 99.9% is 1).
1616         We also call `shrinkToFit` to make it the exact size after baking Display::InlineContent. It should be no-op in 95% cases.
1617
1618         * layout/displaytree/DisplayInlineContent.h:
1619         * layout/inlineformatting/InlineFormattingState.h:
1620         (WebCore::Layout::InlineFormattingState::shrinkDisplayInlineContent):
1621         * layout/integration/LayoutIntegrationLineLayout.cpp:
1622         (WebCore::LayoutIntegration::LineLayout::layout):
1623
1624 2020-02-28  Alberto Garcia  <berto@igalia.com>
1625
1626         [GStreamer] Unreviewed. Fix build warning.
1627
1628         queueSize is of type size_t so it should use the proper format
1629         specifier.
1630
1631         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
1632         (restartLoaderIfNeeded):
1633         (stopLoaderIfNeeded):
1634
1635 2020-02-28  Youenn Fablet  <youenn@apple.com>
1636
1637         Conversion between MediaSample and RemoteVideoSample should preserve the rotation information
1638         https://bugs.webkit.org/show_bug.cgi?id=208240
1639
1640         Reviewed by Eric Carlson.
1641
1642         Update RemoteVideoSample to have surface getter be const.
1643         Add a new routine to convert a RemoteVideoSample in a MediaSample, with proper rotation and mirrored information.
1644         Covered by manual testing.
1645
1646         * platform/graphics/RemoteVideoSample.cpp:
1647         (WebCore::RemoteVideoSample::surface const):
1648         * platform/graphics/RemoteVideoSample.h:
1649         (WebCore::RemoteVideoSample::mirrored const):
1650         * platform/graphics/cv/ImageTransferSessionVT.h:
1651         * platform/graphics/cv/ImageTransferSessionVT.mm:
1652         (WebCore::ImageTransferSessionVT::createMediaSample):
1653
1654 2020-02-28  Carlos Garcia Campos  <cgarcia@igalia.com>
1655
1656         REGRESSION(r257299): [GTK] Test imported/w3c/web-platform-tests/css/css-sizing/button-min-width.html is failing since r257299
1657         https://bugs.webkit.org/show_bug.cgi?id=208296
1658
1659         Reviewed by Adrian Perez de Castro.
1660
1661         We are no longer honoring the style min width/height of buttons.
1662
1663         * platform/Theme.cpp:
1664         (WebCore::Theme::minimumControlSize const): Add zoomedSize parameter.
1665         * platform/Theme.h:
1666         * platform/adwaita/ThemeAdwaita.cpp:
1667         (WebCore::ThemeAdwaita::minimumControlSize const): Use the style min size unless it's intrinsic or auto.
1668         * platform/adwaita/ThemeAdwaita.h:
1669         * platform/mac/ThemeMac.h:
1670         * platform/mac/ThemeMac.mm:
1671         (WebCore::ThemeMac::minimumControlSize const): Add zoomedSize parameter.
1672         * rendering/RenderTheme.cpp:
1673         (WebCore::RenderTheme::adjustStyle): Pass style min size to Theme::minimumControlSize().
1674
1675 2020-02-28  Carlos Garcia Campos  <cgarcia@igalia.com>
1676
1677         REGRESSION(r257299): [GTK] Check and radio buttons don't keep the aspect ratio
1678         https://bugs.webkit.org/show_bug.cgi?id=208302
1679
1680         Reviewed by Adrian Perez de Castro.
1681
1682         When different width and height is used, we should use the lower value and render the button centered.
1683
1684         * platform/adwaita/ThemeAdwaita.cpp:
1685         (WebCore::ThemeAdwaita::paintCheckbox):
1686         (WebCore::ThemeAdwaita::paintRadio):
1687
1688 2020-02-28  Carlos Garcia Campos  <cgarcia@igalia.com>
1689
1690         REGRESSION(r257299): [GTK] Test fast/replaced/table-percent-height.html is failing since r257299
1691         https://bugs.webkit.org/show_bug.cgi?id=208295
1692
1693         Reviewed by Adrian Perez de Castro.
1694
1695         We are now hardcoding the size of check and radio buttons, except when width and height are both specified.
1696
1697         * platform/adwaita/ThemeAdwaita.cpp:
1698         (WebCore::ThemeAdwaita::controlSize const): Only set width and height of check and radio buttons when they are
1699         intrinsic or auto.
1700
1701 2020-02-28  Carlos Garcia Campos  <cgarcia@igalia.com>
1702
1703         REGRESSION(r257299): [GTK] Test fast/forms/menulist-restrict-line-height.html is failing since r257299
1704         https://bugs.webkit.org/show_bug.cgi?id=208241
1705
1706         Reviewed by Adrian Perez de Castro.
1707
1708         We should not honor line-height for styled combo buttons.
1709
1710         * rendering/RenderThemeAdwaita.cpp:
1711         (WebCore::RenderThemeAdwaita::adjustMenuListStyle const):
1712         (WebCore::RenderThemeAdwaita::adjustMenuListButtonStyle const):
1713         * rendering/RenderThemeAdwaita.h:
1714
1715 2020-02-28  Carlos Garcia Campos  <cgarcia@igalia.com>
1716
1717         REGRESSION(r257299): [GTK] box shadow is no longer ignored for search field decorations
1718         https://bugs.webkit.org/show_bug.cgi?id=208239
1719
1720         Reviewed by Adrian Perez de Castro.
1721
1722         Since we no longer use RenderTheme to paint the search field decorations we need to ensure a box shadow isn't
1723         used for them in the CSS.
1724
1725         * css/themeAdwaita.css:
1726         (input[type="search"]::-webkit-search-results-button,): Add -webkit-box-shadow: none !important;
1727         (input[type="search"]::-webkit-search-cancel-button): Ditto.
1728         (body[dir="rtl"] input[type="search"]::-webkit-search-cancel-button): Ditto.
1729
1730 2020-02-28  Carlos Garcia Campos  <cgarcia@igalia.com>
1731
1732         REGRESSION(r257299): Test fast/css/button-height.html is failing since r257299
1733         https://bugs.webkit.org/show_bug.cgi?id=208237
1734
1735         Reviewed by Adrian Perez de Castro.
1736
1737         The new theming code doesn't use the same border size for button and input[type="button"].
1738
1739         * platform/adwaita/ThemeAdwaita.cpp:
1740         (WebCore::ThemeAdwaita::controlBorder const): Use the same border for all buttons.
1741         * platform/adwaita/ThemeAdwaita.h:
1742
1743 2020-02-28  Carlos Garcia Campos  <cgarcia@igalia.com>
1744
1745         Unreviewed. Fix hover effects broken for GTK port after r257592
1746
1747         Add missing braces to if that now has two lines in the body. This was causing all mouse events to be considered
1748         read only when building with TOUCH_EVENTS enabled.
1749
1750         * page/EventHandler.cpp:
1751         (WebCore::EventHandler::handleMouseMoveEvent):
1752
1753 2020-02-28  Carlos Garcia Campos  <cgarcia@igalia.com>
1754
1755         Test imported/blink/fast/forms/datalist/slider-appearance-with-ticks-crash.html fails
1756         https://bugs.webkit.org/show_bug.cgi?id=190613
1757
1758         Reviewed by Wenson Hsieh.
1759
1760         Check the input is a range control before trying to paint slider ticks.
1761
1762         * rendering/RenderTheme.cpp:
1763         (WebCore::RenderTheme::paintSliderTicks):
1764
1765 2020-02-27  Devin Rousso  <drousso@apple.com>
1766
1767         Web Inspector: allow use of dark mode theme independently from system-wide theme
1768         https://bugs.webkit.org/show_bug.cgi?id=186308
1769         <rdar://problem/40785895>
1770
1771         Reviewed by Timothy Hatcher.
1772
1773         * inspector/InspectorFrontendHost.idl:
1774         * inspector/InspectorFrontendHost.h:
1775         * inspector/InspectorFrontendHost.cpp:
1776         (WebCore::InspectorFrontendHost::setForcedAppearance): Added.
1777         Expose a way to call `Page::setUseDarkAppearanceOverride` from the Web Inspector frontend.
1778
1779 2020-02-27  Don Olmstead  <don.olmstead@sony.com>
1780
1781         Fix WebCore export macros for declspec
1782         https://bugs.webkit.org/show_bug.cgi?id=208363
1783
1784         Reviewed by Konstantin Tokarev.
1785
1786         Modified the PlatformExportMacros to match the other export macros. Originally
1787         Windows ports were treated differently and they had to set their own export macros.
1788         This isn't ideal because how WebCore is built is really dependent on the CMake
1789         definition of the library type.
1790
1791         * CMakeLists.txt:
1792         * WebCorePrefix.h:
1793         * platform/PlatformExportMacros.h:
1794         * testing/js/WebCoreTestSupportPrefix.h:
1795
1796 2020-02-27  Dean Jackson  <dino@apple.com>
1797
1798         MemoryRelease logging uses a unique_ptr with unclear lifetime
1799         https://bugs.webkit.org/show_bug.cgi?id=208361
1800
1801         Reviewed by Alex Christensen.
1802
1803         The logging here was getting a unique_ptr inside the loop, which
1804         causes newer versions of clang to complain with an error:
1805         object backing the pointer will be destroyed at the end of the full-expression [-Werror,-Wdangling-gsl]
1806
1807         Using a temporary local variable fixes the problem.
1808
1809         * page/MemoryRelease.cpp:
1810         (WebCore::logMemoryStatisticsAtTimeOfDeath):
1811
1812 2020-02-27  Doug Kelly  <dougk@apple.com>
1813
1814         Hit test with clipPath referencing parent element causes infinite recursion
1815         https://bugs.webkit.org/show_bug.cgi?id=208279
1816
1817         Reviewed by Ryosuke Niwa.
1818
1819         Add an early return for SVG hit tests which have a child element referencing a  parent clipPath.
1820         This change breaks the cycle, although it unfortunately runs on every hit test, for each node which
1821         is a child of the clipPath element. 
1822
1823         Test: svg/hittest/svg-clip-path-child-element.html
1824
1825         * rendering/svg/RenderSVGResourceClipper.cpp:
1826         (WebCore::RenderSVGResourceClipper::hitTestClipContent):
1827
1828 2020-02-27  Ryosuke Niwa  <rniwa@webkit.org>
1829
1830         TextManipulationController should not generate a new item for content in manipulated paragraphs
1831         https://bugs.webkit.org/show_bug.cgi?id=208286
1832
1833         Reviewed by Wenson Hsieh.
1834
1835         This patch makes TextManipulationController to ignore any content change in previously manipulated paragraphs.
1836
1837         Added an early exist to observeParagraphs when the observed content has an element that has already been manipulated
1838         as an ancestor. Note that the only case in which this logic matters is when it's called by scheduleObservartionUpdate,
1839         which calls this function on each paragraph separately, unlike startObservingParagraphs which calls it on
1840         the entire document, we can simply exit early instead of ignoring just the current paragraph.
1841
1842         Renamed TextManipulationController's m_recentlyInsertedElements to m_manipulatedElements and made it persist
1843         forever so that we can track any element that has already been manipulated. Als renamed m_mutatedElements
1844         to m_elementsWithNewRenderer for clarity.
1845
1846         Test: TestWebKitAPI.TextManipulation.InsertingContentIntoAlreadyManipulatedContentDoesNotCreateTextManipulationItem
1847
1848         * editing/TextManipulationController.cpp:
1849         (WebCore::TextManipulationController::isInManipulatedElement): Added. Has a fast path for when
1850         m_manipulatedElements's capacity is 0, which happens when observeParagraphs is called by startObservingParagraphs.
1851         (WebCore::TextManipulationController::observeParagraphs): Added an early exit when there is a content that has
1852         already been manipulated.
1853         (WebCore::TextManipulationController::didCreateRendererForElement): Added the same check to fail early.
1854         (WebCore::TextManipulationController::scheduleObservartionUpdate):
1855         (WebCore::TextManipulationController::replace): Removed the code to clear m_recentlyInsertedElements.
1856         * editing/TextManipulationController.h:
1857
1858 2020-02-27  Eric Carlson  <eric.carlson@apple.com>
1859
1860         Support in-band generic cues when loading media in the GPU Process
1861         https://bugs.webkit.org/show_bug.cgi?id=208080
1862         <rdar://problem/59687943>
1863
1864         Reviewed by Youenn Fablet.
1865
1866         No new tests, existing tests enabled for GPU process.
1867
1868         * Headers.cmake:
1869         * WebCore.xcodeproj/project.pbxproj:
1870         * html/track/InbandGenericTextTrack.cpp:
1871         (WebCore::GenericTextTrackCueMap::add):
1872         (WebCore::GenericTextTrackCueMap::findIndexOfPair):
1873         (WebCore::GenericTextTrackCueMap::find):
1874         (WebCore::GenericTextTrackCueMap::remove):
1875         (WebCore::InbandGenericTextTrack::updateCueFromCueData):
1876         (WebCore::InbandGenericTextTrack::addGenericCue):
1877         (WebCore::InbandGenericTextTrack::updateGenericCue):
1878         (WebCore::InbandGenericTextTrack::removeGenericCue):
1879         * html/track/InbandGenericTextTrack.h:
1880         * html/track/InbandTextTrack.h:
1881         * html/track/TextTrackCueGeneric.h:
1882         * platform/graphics/InbandGenericCue.h: Added.
1883         (WebCore::GenericCueData::decode):
1884         (WebCore::GenericCueData::encode const):
1885         (WebCore::InbandGenericCue::create):
1886         (WebCore::InbandGenericCue::startTime const):
1887         (WebCore::InbandGenericCue::setStartTime):
1888         (WebCore::InbandGenericCue::endTime const):
1889         (WebCore::InbandGenericCue::setEndTime):
1890         (WebCore::InbandGenericCue::id const):
1891         (WebCore::InbandGenericCue::setId):
1892         (WebCore::InbandGenericCue::content const):
1893         (WebCore::InbandGenericCue::setContent):
1894         (WebCore::InbandGenericCue::line const):
1895         (WebCore::InbandGenericCue::setLine):
1896         (WebCore::InbandGenericCue::position const):
1897         (WebCore::InbandGenericCue::setPosition):
1898         (WebCore::InbandGenericCue::size const):
1899         (WebCore::InbandGenericCue::setSize):
1900         (WebCore::InbandGenericCue::align const):
1901         (WebCore::InbandGenericCue::setAlign):
1902         (WebCore::InbandGenericCue::fontName const):
1903         (WebCore::InbandGenericCue::setFontName):
1904         (WebCore::InbandGenericCue::baseFontSize const):
1905         (WebCore::InbandGenericCue::setBaseFontSize):
1906         (WebCore::InbandGenericCue::relativeFontSize const):
1907         (WebCore::InbandGenericCue::setRelativeFontSize):
1908         (WebCore::InbandGenericCue::foregroundColor const):
1909         (WebCore::InbandGenericCue::setForegroundColor):
1910         (WebCore::InbandGenericCue::backgroundColor const):
1911         (WebCore::InbandGenericCue::setBackgroundColor):
1912         (WebCore::InbandGenericCue::highlightColor const):
1913         (WebCore::InbandGenericCue::setHighlightColor):
1914         (WebCore::InbandGenericCue::status):
1915         (WebCore::InbandGenericCue::setStatus):
1916         (WebCore::InbandGenericCue::cueData const):
1917         (WebCore::InbandGenericCue::InbandGenericCue):
1918         (WebCore::InbandGenericCue::toJSONString const):
1919         (WebCore::InbandGenericCue::doesExtendCueData const):
1920         (WTF::LogArgument<WebCore::InbandGenericCue>::toString):
1921         * platform/graphics/InbandTextTrackPrivateClient.h:
1922         (WebCore::GenericCueData::create): Deleted.
1923         (WebCore::GenericCueData::startTime const): Deleted.
1924         (WebCore::GenericCueData::setStartTime): Deleted.
1925         (WebCore::GenericCueData::endTime const): Deleted.
1926         (WebCore::GenericCueData::setEndTime): Deleted.
1927         (WebCore::GenericCueData::id const): Deleted.
1928         (WebCore::GenericCueData::setId): Deleted.
1929         (WebCore::GenericCueData::content const): Deleted.
1930         (WebCore::GenericCueData::setContent): Deleted.
1931         (WebCore::GenericCueData::line const): Deleted.
1932         (WebCore::GenericCueData::setLine): Deleted.
1933         (WebCore::GenericCueData::position const): Deleted.
1934         (WebCore::GenericCueData::setPosition): Deleted.
1935         (WebCore::GenericCueData::size const): Deleted.
1936         (WebCore::GenericCueData::setSize): Deleted.
1937         (): Deleted.
1938         (WebCore::GenericCueData::align const): Deleted.
1939         (WebCore::GenericCueData::setAlign): Deleted.
1940         (WebCore::GenericCueData::fontName const): Deleted.
1941         (WebCore::GenericCueData::setFontName): Deleted.
1942         (WebCore::GenericCueData::baseFontSize const): Deleted.
1943         (WebCore::GenericCueData::setBaseFontSize): Deleted.
1944         (WebCore::GenericCueData::relativeFontSize const): Deleted.
1945         (WebCore::GenericCueData::setRelativeFontSize): Deleted.
1946         (WebCore::GenericCueData::foregroundColor const): Deleted.
1947         (WebCore::GenericCueData::setForegroundColor): Deleted.
1948         (WebCore::GenericCueData::backgroundColor const): Deleted.
1949         (WebCore::GenericCueData::setBackgroundColor): Deleted.
1950         (WebCore::GenericCueData::highlightColor const): Deleted.
1951         (WebCore::GenericCueData::setHighlightColor): Deleted.
1952         (WebCore::GenericCueData::status): Deleted.
1953         (WebCore::GenericCueData::setStatus): Deleted.
1954         (WebCore::GenericCueData::toJSONString const): Deleted.
1955         (WebCore::GenericCueData::doesExtendCueData const): Deleted.
1956         (WTF::LogArgument<WebCore::GenericCueData>::toString): Deleted.
1957         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
1958         (WebCore::InbandTextTrackPrivateAVF::processCueAttributes):
1959         (WebCore::InbandTextTrackPrivateAVF::processAttributedStrings):
1960         (WebCore::InbandTextTrackPrivateAVF::removeCompletedCues):
1961         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.h:
1962         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
1963
1964 2020-02-27  Said Abou-Hallawa  <sabouhallawa@apple.com>
1965
1966         Implement ImageBuffer shareable backends
1967         https://bugs.webkit.org/show_bug.cgi?id=207233
1968
1969         Reviewed by Simon Fraser.
1970
1971         * Headers.cmake:
1972         * WebCore.xcodeproj/project.pbxproj:
1973         * platform/graphics/PlatformImageBufferBackend.h: Added.
1974         Define the base ImageBufferBackend for each platform.
1975         ImageBufferShareableBitmapBackend in WebKit needs to have access to basic
1976         ImageBufferBackend functionalities specific to the platform.
1977
1978         * platform/graphics/cg/ImageBufferIOSurfaceBackend.cpp:
1979         (WebCore::ImageBufferIOSurfaceBackend::create):
1980         * platform/graphics/cg/ImageBufferIOSurfaceBackend.h:
1981         Use WTF::makeUnique and make the constructor public.
1982
1983 2020-02-27  Daniel Bates  <dabates@apple.com>
1984
1985         Change HitTestRequestType to an OptionSet
1986         https://bugs.webkit.org/show_bug.cgi?id=208334
1987
1988         Reviewed by Wenson Hsieh.
1989
1990         The majority of this change is replacing usage of HitTestRequestType with an OptionSet<HitTestRequest::RequestType>.
1991         Though I was tempted and did in some circumstances modernize code around HitTestRequestType call sites.
1992         I've annotated important changes below.
1993
1994         * accessibility/AccessibilityObject.cpp:
1995         (WebCore::AccessibilityObject::press):
1996         * accessibility/AccessibilityRenderObject.cpp:
1997         (WebCore::AccessibilityRenderObject::visiblePositionForPoint const): Updated code as needed.
1998         Added FIXME comment: the code should be written without a loop and instead use HitTestRequest::AllowVisibleChildFrameContentOnly
1999         to achieve the goal.
2000         (WebCore::AccessibilityRenderObject::accessibilityHitTest const):
2001         * dom/TreeScope.cpp:
2002         (WebCore::TreeScope::elementsFromPoint):
2003         * html/HTMLPlugInElement.cpp:
2004         (WebCore::HTMLPlugInElement::isReplacementObscured): Update code as needed. Use IntRect::center()
2005         convenience function instead of computing the center point manually.
2006         * html/MediaElementSession.cpp:
2007         (WebCore::isElementMainContentForPurposesOfAutoplay): Update code as needed. Move check for whether
2008         the main frame has a document earlier in the function to avoid unncessary work. In practice, this
2009         check will never fail because the main frame always has a document. Though to be precise the main
2010         frame may not have a document during frame initialization. However, it does not make sense for this
2011         code to ever be called then.
2012         * page/AutoscrollController.cpp:
2013         (WebCore::AutoscrollController::updateAutoscrollRenderer):
2014         * page/ContextMenuController.cpp:
2015         (WebCore::ContextMenuController::maybeCreateContextMenu):
2016         * page/DragController.cpp:
2017         (WebCore::DragController::canProcessDrag):
2018         (WebCore::DragController::startDrag):
2019         * page/EventHandler.cpp:
2020         (WebCore::EventHandler::eventMayStartDrag const):
2021         (WebCore::EventHandler::updateSelectionForMouseDrag):
2022         (WebCore::EventHandler::hitTestResultAtPoint const):
2023         (WebCore::EventHandler::updateCursor):
2024         (WebCore::EventHandler::handleMousePressEvent):
2025         (WebCore::EventHandler::handleMouseDoubleClickEvent):
2026         (WebCore::EventHandler::handleMouseMoveEvent):
2027         (WebCore::EventHandler::handleMouseReleaseEvent):
2028         (WebCore::EventHandler::handleMouseForceEvent):
2029         (WebCore::EventHandler::updateDragAndDrop):
2030         (WebCore::EventHandler::isInsideScrollbar const):
2031         (WebCore::EventHandler::sendContextMenuEvent):
2032         (WebCore::EventHandler::sendContextMenuEventForKey):
2033         (WebCore::EventHandler::hoverTimerFired):
2034         (WebCore::EventHandler::dragSourceEndedAt):
2035         (WebCore::EventHandler::handleDrag):
2036         (WebCore::hitTestResultInFrame):
2037         (WebCore::EventHandler::handleTouchEvent):
2038         (WebCore::EventHandler::dispatchSyntheticTouchEventIfEnabled):
2039         * page/EventHandler.h:
2040         * page/FocusController.cpp:
2041         (WebCore::updateFocusCandidateIfNeeded):
2042         * page/Frame.cpp:
2043         (WebCore::Frame::visiblePositionForPoint const):
2044         (WebCore::Frame::documentAtPoint):
2045         * page/PointerCaptureController.cpp:
2046         (WebCore::PointerCaptureController::cancelPointer): Added FIXME about correctness issue.
2047         The local variable named target will always be nullptr even after calling hitTestResultAtPoint().
2048         * page/ios/EventHandlerIOS.mm:
2049         (WebCore::EventHandler::tryToBeginDragAtPoint):
2050         * page/ios/FrameIOS.mm:
2051         (WebCore::Frame::renderRectForPoint const):
2052         (WebCore::Frame::betterApproximateNode):
2053         (WebCore::Frame::hitTestResultAtViewportLocation):
2054         (WebCore::Frame::qualifyingNodeAtViewportLocation):
2055         * rendering/HitTestRequest.h:
2056         (WebCore::HitTestRequest::HitTestRequest):
2057         (WebCore::HitTestRequest::readOnly const):
2058         (WebCore::HitTestRequest::active const):
2059         (WebCore::HitTestRequest::move const):
2060         (WebCore::HitTestRequest::release const):
2061         (WebCore::HitTestRequest::ignoreClipping const):
2062         (WebCore::HitTestRequest::svgClipContent const):
2063         (WebCore::HitTestRequest::touchEvent const):
2064         (WebCore::HitTestRequest::disallowsUserAgentShadowContent const):
2065         (WebCore::HitTestRequest::allowsFrameScrollbars const):
2066         (WebCore::HitTestRequest::allowsChildFrameContent const):
2067         (WebCore::HitTestRequest::allowsVisibleChildFrameContent const):
2068         (WebCore::HitTestRequest::isChildFrameHitTest const):
2069         (WebCore::HitTestRequest::resultIsElementList const):
2070         (WebCore::HitTestRequest::includesAllElementsUnderPoint const):
2071         (WebCore::HitTestRequest::type const):
2072         * rendering/svg/RenderSVGResourceClipper.cpp:
2073         (WebCore::RenderSVGResourceClipper::hitTestClipContent):
2074         * testing/Internals.cpp:
2075         (WebCore::Internals::nodesFromRect const):
2076         * testing/Internals.mm:
2077         (WebCore::Internals::rangeForDictionaryLookupAtLocation):
2078
2079 2020-02-27  Andres Gonzalez  <andresg_22@apple.com>
2080
2081         AXIsolatedObject support for table rows and ARIA tree/grid rows.
2082         https://bugs.webkit.org/show_bug.cgi?id=208335
2083
2084         Reviewed by Chris Fleizach.
2085
2086         Covered by existing tests.
2087
2088         - Exposes the AccessibilityTableRow and AccessibilityARIAGridRow
2089         interfaces through AXCoreObject.
2090         - Eliminates the need of downcasting in the platform wrapper code, so
2091         that it now works for both AXObjects and AXIsolatedObjects.
2092         - Implements the above mentioned interfaces in AXIsolatedObject.
2093
2094         * accessibility/AccessibilityARIAGridRow.cpp:
2095         (WebCore::AccessibilityARIAGridRow::disclosedRows):
2096         * accessibility/AccessibilityARIAGridRow.h:
2097         * accessibility/AccessibilityObject.cpp:
2098         (WebCore::AccessibilityObject::disclosedRows):
2099         (WebCore::AccessibilityObject::ariaTreeItemDisclosedRows): Became disclosedRows.
2100         * accessibility/AccessibilityObject.h:
2101         * accessibility/AccessibilityObjectInterface.h:
2102         * accessibility/AccessibilityTableRow.h:
2103         (WebCore::AccessibilityTableRow::setRowIndex):
2104         (WebCore::AccessibilityTableRow::rowIndex const): Deleted.
2105         * accessibility/isolatedtree/AXIsolatedObject.cpp:
2106         (WebCore::AXIsolatedObject::initializeAttributeData):
2107         * accessibility/isolatedtree/AXIsolatedObject.h:
2108         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2109         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
2110
2111 2020-02-27  Don Olmstead  <don.olmstead@sony.com>
2112
2113         [CMake] Add WebKit::PAL target
2114         https://bugs.webkit.org/show_bug.cgi?id=198493
2115
2116         Reviewed by Michael Catanzaro.
2117
2118         Use WebKit::PAL target.
2119
2120         * CMakeLists.txt:
2121
2122 2020-02-27  Peng Liu  <peng.liu6@apple.com>
2123
2124         MediaResourceLoader objects are leaking on reddit.com
2125         https://bugs.webkit.org/show_bug.cgi?id=208273
2126
2127         Reviewed by Jer Noble.
2128
2129         We retain the WebCoreNSURLSession delegate. There will be a retain cycle
2130         if that delegate retains the session. This patch fixes the retain cycle problem
2131         by referencing the delegate with a weak pointer.
2132
2133         Manually tested.
2134
2135         * platform/network/cocoa/WebCoreNSURLSession.h:
2136         * platform/network/cocoa/WebCoreNSURLSession.mm:
2137         (-[WebCoreNSURLSession delegate]):
2138
2139 2020-02-28  Simon Fraser  <simon.fraser@apple.com>
2140
2141         Stop using -[CALayer setValue:forKey:] to store back pointers to PlatformCALayer*
2142         https://bugs.webkit.org/show_bug.cgi?id=208358
2143
2144         Reviewed by Tim Horton.
2145
2146         We used -[CAlayer setValue:forKey:@"WKPlatformCALayer"] to store associate PlatformCALayer*
2147         with CALayers. However, this has some performance cost, and won't work for a near-future world
2148         where the scrolling thread needs to get at PlatformCALayers.
2149
2150         Replace with a static HashMap<> of CALayer* to PlatformCALayer*. Also rename platformCALayer()
2151         to platformCALayerForLayer() so it's easier to find.
2152
2153         * platform/graphics/ca/GraphicsLayerCA.cpp:
2154         (WebCore::GraphicsLayerCA::setContentsToPlatformLayer):
2155         * platform/graphics/ca/PlatformCALayer.h:
2156         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
2157         (WebCore::layerToPlatformLayerMap):
2158         (WebCore::PlatformCALayer::platformCALayerForLayer):
2159         (WebCore::PlatformCALayerCocoa::create):
2160         (WebCore::PlatformCALayerCocoa::commonInit):
2161         (WebCore::PlatformCALayerCocoa::~PlatformCALayerCocoa):
2162         (WebCore::PlatformCALayerCocoa::superlayer const):
2163         (WebCore::PlatformCALayer::platformCALayer): Deleted.
2164         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
2165         (PlatformCALayer::platformCALayerForLayer):
2166         (layoutSublayersProc):
2167         (PlatformCALayerWin::superlayer const):
2168         (PlatformCALayer::platformCALayer): Deleted.
2169         * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
2170         (PlatformCALayerWinInternal::getSublayers const):
2171         (PlatformCALayerWinInternal::sublayerAtIndex const):
2172         * platform/graphics/cocoa/WebGLLayer.mm:
2173         (-[WebGLLayer display]):
2174         * platform/graphics/mac/WebLayer.mm:
2175         (-[WebLayer drawInContext:]):
2176         (-[WebSimpleLayer setNeedsDisplay]):
2177         (-[WebSimpleLayer setNeedsDisplayInRect:]):
2178         (-[WebSimpleLayer display]):
2179         (-[WebSimpleLayer drawInContext:]):
2180
2181 2020-02-27  Rob Buis  <rbuis@igalia.com>
2182
2183         Add referrerpolicy attribute support for images
2184         https://bugs.webkit.org/show_bug.cgi?id=207901
2185
2186         Reviewed by Darin Adler.
2187
2188         This patch adds 'referrerpolicy' attribute support for img elements.
2189         If set, the value is restricted to the ReferrerPolicy enum, and
2190         if valid it is used for the script fetch.
2191         If not set or invalid, the current behavior is kept.
2192
2193         Tests: http/tests/referrer-policy-img/no-referrer-when-downgrade/cross-origin-http-http.html
2194                http/tests/referrer-policy-img/no-referrer-when-downgrade/cross-origin-http.https.html
2195                http/tests/referrer-policy-img/no-referrer-when-downgrade/same-origin.html
2196                http/tests/referrer-policy-img/no-referrer/cross-origin-http-http.html
2197                http/tests/referrer-policy-img/no-referrer/cross-origin-http.https.html
2198                http/tests/referrer-policy-img/no-referrer/same-origin.html
2199                http/tests/referrer-policy-img/origin-when-cross-origin/cross-origin-http-http.html
2200                http/tests/referrer-policy-img/origin-when-cross-origin/cross-origin-http.https.html
2201                http/tests/referrer-policy-img/origin-when-cross-origin/same-origin.html
2202                http/tests/referrer-policy-img/origin/cross-origin-http-http.html
2203                http/tests/referrer-policy-img/origin/cross-origin-http.https.html
2204                http/tests/referrer-policy-img/origin/same-origin.html
2205                http/tests/referrer-policy-img/same-origin/cross-origin-http-http.html
2206                http/tests/referrer-policy-img/same-origin/cross-origin-http.https.html
2207                http/tests/referrer-policy-img/same-origin/same-origin.html
2208                http/tests/referrer-policy-img/strict-origin-when-cross-origin/cross-origin-http-http.html
2209                http/tests/referrer-policy-img/strict-origin-when-cross-origin/cross-origin-http.https.html
2210                http/tests/referrer-policy-img/strict-origin-when-cross-origin/same-origin.html
2211                http/tests/referrer-policy-img/strict-origin/cross-origin-http-http.html
2212                http/tests/referrer-policy-img/strict-origin/cross-origin-http.https.html
2213                http/tests/referrer-policy-img/strict-origin/same-origin.html
2214                http/tests/referrer-policy-img/unsafe-url/cross-origin-http-http.html
2215                http/tests/referrer-policy-img/unsafe-url/cross-origin-http.https.html
2216                http/tests/referrer-policy-img/unsafe-url/same-origin.html
2217
2218         * html/HTMLImageElement.cpp:
2219         (WebCore::HTMLImageElement::setReferrerPolicyForBindings):
2220         (WebCore::HTMLImageElement::referrerPolicyForBindings const):
2221         (WebCore::HTMLImageElement::referrerPolicy const):
2222         * html/HTMLImageElement.h:
2223         * html/HTMLImageElement.idl:
2224         * loader/ImageLoader.cpp:
2225         (WebCore::ImageLoader::updateFromElement):
2226
2227 2020-02-27  Daniel Bates  <dabates@apple.com>
2228
2229         Cleanup HitTestResult.{h, cpp}
2230         https://bugs.webkit.org/show_bug.cgi?id=208269
2231         <rdar://problem/59824186>
2232
2233         Reviewed by Alex Christensen.
2234
2235         Use modern C++ features to remove duplicate code.
2236
2237         * rendering/HitTestLocation.cpp:
2238         (WebCore::HitTestLocation::HitTestLocation):
2239         * rendering/HitTestLocation.h:
2240         * rendering/HitTestResult.cpp: Remove unnecessary #includes.
2241         * rendering/HitTestResult.h: Remove unnecessary #includes. 
2242         (WebCore::HitTestResult::setIsOverWidget):
2243
2244 2020-02-27  Zalan Bujtas  <zalan@apple.com>
2245
2246         Unreviewed build fix for non-unified builds after r257507.
2247
2248         * layout/blockformatting/BlockFormattingContext.h:
2249         * layout/blockformatting/BlockMarginCollapse.cpp:
2250         (WebCore::Layout::BlockFormattingContext::MarginCollapse::computedPositiveAndNegativeMargin const):
2251         (WebCore::Layout::BlockFormattingContext::MarginCollapse::updateMarginAfterForPreviousSibling):
2252         (WebCore::Layout::computedPositiveAndNegativeMargin): Deleted.
2253
2254 2020-02-27  Antti Koivisto  <antti@apple.com>
2255
2256         Load async scripts with low priority
2257         https://bugs.webkit.org/show_bug.cgi?id=208298
2258
2259         Reviewed by Anders Carlsson.
2260
2261         They are assumed to be non-critical and don't delay DOMContentLoaded.
2262
2263         This matches other browsers. See https://addyosmani.com/blog/script-priorities/ for Chrome behavior.
2264
2265         * bindings/js/CachedScriptFetcher.cpp:
2266         (WebCore::CachedScriptFetcher::requestModuleScript const):
2267         (WebCore::CachedScriptFetcher::requestScriptWithCache const)
2268
2269         Pass around the priority.
2270
2271         * bindings/js/CachedScriptFetcher.h:
2272         * dom/LoadableClassicScript.cpp:
2273         (WebCore::LoadableClassicScript::create):
2274         (WebCore::LoadableClassicScript::load):
2275
2276         Deprioritize async script load.
2277
2278         * dom/LoadableClassicScript.h:
2279         * dom/ScriptElement.cpp:
2280         (WebCore::ScriptElement::requestClassicScript):
2281
2282         Pass around the information that this is an async script.
2283
2284         * dom/ScriptElementCachedScriptFetcher.cpp:
2285         (WebCore::ScriptElementCachedScriptFetcher::requestModuleScript const):
2286         * html/parser/HTMLPreloadScanner.cpp:
2287         (WebCore::TokenPreloadScanner::StartTagScanner::createPreloadRequest):
2288         (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):
2289
2290         Parse async attribute in preload scanner.
2291
2292         * html/parser/HTMLResourcePreloader.cpp:
2293         (WebCore::PreloadRequest::resourceRequest):
2294
2295         Deprioritize async script preload.
2296
2297         * html/parser/HTMLResourcePreloader.h:
2298         (WebCore::PreloadRequest::setScriptIsAsync):
2299
2300 2020-02-26  Ryosuke Niwa  <rniwa@webkit.org>
2301
2302         Create AudioDestination in the GPU process
2303         https://bugs.webkit.org/show_bug.cgi?id=208179
2304
2305         Reviewed by Jer Noble.
2306
2307         Add an abstraction around the creation of AudioDestination using newly introduced mediaStrategy.
2308
2309         * Headers.cmake:
2310         * Modules/webaudio/DefaultAudioDestinationNode.cpp:
2311         (WebCore::DefaultAudioDestinationNode::createDestination): Use MediaStrategy::createAudioDestination
2312         * WebCore.xcodeproj/project.pbxproj:
2313         * platform/MediaStrategy.h: Added.
2314         (WebCore::MediaStrategy): Added.
2315         * platform/PlatformStrategies.h:
2316         (WebCore::PlatformStrategies::mediaStrategy): Added.
2317         * platform/audio/AudioBus.h:
2318         * platform/audio/AudioDestination.h:
2319
2320 2020-02-26  Myles C. Maxfield  <mmaxfield@apple.com>
2321
2322         [iPadOS] REGRESSION(r247667): Autosizing style changes don't invalidate RenderText's preferred logical widths
2323         https://bugs.webkit.org/show_bug.cgi?id=208084
2324         <rdar://problem/59463898>
2325
2326         Reviewed by Darin Adler.
2327
2328         Just use RenderElement::setStyle(), which handles all the invalidations, instead of RenderElement::setNeedsLayout().
2329
2330         Do a little refactoring so we don't clone RenderStyles unless we need to.
2331
2332         Test: fast/text-autosizing/ios/idempotentmode/viewport-change-relayout.html
2333
2334         * page/Page.cpp:
2335         (WebCore::Page::recomputeTextAutoSizingInAllFrames):
2336         * rendering/style/RenderStyle.cpp:
2337         (WebCore::RenderStyle::isIdempotentTextAutosizingCandidate const):
2338         * rendering/style/RenderStyle.h:
2339         * rendering/style/TextSizeAdjustment.cpp:
2340         (WebCore::AutosizeStatus::computeStatus):
2341         (WebCore::AutosizeStatus::updateStatus):
2342         * rendering/style/TextSizeAdjustment.h:
2343         (WebCore::AutosizeStatus::operator== const):
2344         (WebCore::AutosizeStatus::operator!= const):
2345         * style/StyleAdjuster.cpp:
2346         (WebCore::Style::Adjuster::adjustmentForTextAutosizing):
2347         (WebCore::Style::Adjuster::adjustForTextAutosizing):
2348         * style/StyleAdjuster.h:
2349         (WebCore::Style::Adjuster::AdjustmentForTextAutosizing::operator bool const):
2350
2351 2020-02-26  Zalan Bujtas  <zalan@apple.com>
2352
2353         REGRESSION (r257507): [ macOS ] ASSERTION FAILED: blockFormattingState.hasPositiveAndNegativeVerticalMargin(layoutBox)
2354         https://bugs.webkit.org/show_bug.cgi?id=208278
2355         <rdar://problem/59828533>
2356
2357         Fix mismatching call after r257507.
2358
2359         * layout/blockformatting/PrecomputedBlockMarginCollapse.cpp:
2360         (WebCore::Layout::BlockFormattingContext::MarginCollapse::precomputedPositiveNegativeValues const):
2361
2362 2020-02-26  Andres Gonzalez  <andresg_22@apple.com>
2363
2364         AXIsolatedObject support for table cells.
2365         https://bugs.webkit.org/show_bug.cgi?id=208263
2366
2367         Reviewed by Chris Fleizach.
2368
2369         Covered by existing tests.
2370
2371         - Exposed the AccessibilityTableCell interface through AXCoreObject.
2372         - This way there is no need to downcast in client code and the same
2373         platform wrapper code works for AccessibilityObjects and
2374         AXIsolatedObjects.
2375         - Completed caching of table cell properties in AXIsolatedObject.
2376
2377         * accessibility/AccessibilityARIAGridCell.cpp:
2378         (WebCore::AccessibilityARIAGridCell::rowIndexRange const):
2379         (WebCore::AccessibilityARIAGridCell::axRowSpanWithRowIndex const):
2380         (WebCore::AccessibilityARIAGridCell::columnIndexRange const):
2381         * accessibility/AccessibilityARIAGridCell.h:
2382         * accessibility/AccessibilityObject.h:
2383         * accessibility/AccessibilityObjectInterface.h:
2384         * accessibility/AccessibilityTable.cpp:
2385         (WebCore::AccessibilityTable::cellForColumnAndRow):
2386         * accessibility/AccessibilityTableCell.cpp:
2387         (WebCore::AccessibilityTableCell::isColumnHeaderCell const):
2388         (WebCore::AccessibilityTableCell::isRowHeaderCell const):
2389         (WebCore::AccessibilityTableCell::isTableCellInSameColGroup):
2390         (WebCore::AccessibilityTableCell::columnHeaders):
2391         (WebCore::AccessibilityTableCell::rowHeaders):
2392         (WebCore::AccessibilityTableCell::rowIndexRange const):
2393         (WebCore::AccessibilityTableCell::columnIndexRange const):
2394         * accessibility/AccessibilityTableCell.h:
2395         * accessibility/AccessibilityTableRow.h:
2396         * accessibility/atk/WebKitAccessibleInterfaceTableCell.cpp:
2397         (webkitAccessibleTableCellGetColumnSpan):
2398         (webkitAccessibleTableCellGetRowSpan):
2399         (webkitAccessibleTableCellGetPosition):
2400         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2401         (-[WebAccessibilityObjectWrapper accessibilityHeaderElements]):
2402         (-[WebAccessibilityObjectWrapper accessibilityRowRange]):
2403         (-[WebAccessibilityObjectWrapper accessibilityColumnRange]):
2404         * accessibility/isolatedtree/AXIsolatedObject.cpp:
2405         (WebCore::AXIsolatedObject::initializeAttributeData):
2406         (WebCore::AXIsolatedObject::pairAttributeValue const):
2407         * accessibility/isolatedtree/AXIsolatedObject.h:
2408         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2409         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
2410
2411 2020-02-26  Said Abou-Hallawa  <sabouhallawa@apple.com>
2412
2413         Implement the remote RenderingBackend
2414         https://bugs.webkit.org/show_bug.cgi?id=207198
2415
2416         Reviewed by Simon Fraser.
2417
2418         * html/HTMLCanvasElement.cpp:
2419         (WebCore::HTMLCanvasElement::createImageBuffer const):
2420         Make HTMLCanvasElement be able to create a remote ImageBuffer.
2421
2422 2020-02-27  Simon Fraser  <simon.fraser@apple.com>
2423
2424         Add ENABLE(SCROLLING_THREAD) and use it to turn off some code we don't need for iOS
2425         https://bugs.webkit.org/show_bug.cgi?id=208282
2426
2427         Reviewed by Tim Horton.
2428
2429         Protect ThreadedScrollingTree and ScrollingCoordinatorMac with ENABLE(SCROLLING_THREAD).
2430
2431         * page/scrolling/ThreadedScrollingTree.cpp:
2432         * page/scrolling/ThreadedScrollingTree.h:
2433         * page/scrolling/mac/ScrollingCoordinatorMac.h:
2434         * page/scrolling/mac/ScrollingCoordinatorMac.mm:
2435         * page/scrolling/mac/ScrollingTreeMac.cpp:
2436         * page/scrolling/mac/ScrollingTreeMac.h:
2437
2438 2020-02-26  Fujii Hironori  <Hironori.Fujii@sony.com>
2439
2440         Unreviewed unified source builds fix.
2441
2442         > layout\FormattingContextGeometry.cpp(564): error C2027: use of undefined type 'WebCore::Layout::ReplacedBox
2443         > Modules\websockets\WebSocket.cpp(335): error C2027: use of undefined type 'WebCore::WorkerThread'
2444         > layout\integration\LayoutIntegrationBoxTree.cpp(63): error C2039: 'InlineTextBox': is not a member of 'WebCore::Layout'
2445         > workers\service\context\ServiceWorkerFetch.cpp(143): error C2027: use of undefined type 'WebCore::ServiceWorkerThread'
2446
2447         * Modules/websockets/WebSocket.cpp:
2448         * layout/FormattingContextGeometry.cpp:
2449         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
2450         * layout/integration/LayoutIntegrationBoxTree.cpp:
2451         * workers/service/context/ServiceWorkerFetch.cpp:
2452
2453 2020-02-26  Jack Lee  <shihchieh_lee@apple.com>
2454
2455         Nullptr crash in WebCore::canHaveChildrenForEditing via CompositeEditCommand::insertNode
2456         https://bugs.webkit.org/show_bug.cgi?id=208115
2457         <rdar://problem/56685655>
2458
2459         Reviewed by Ryosuke Niwa.
2460
2461         When inserting a list at an element with a non-list-item child, if the element is uneditable, skip creating list item for the child. 
2462
2463         Test: fast/lists/insert-list-uneditable-element-with-non-li-child.html
2464
2465         * editing/InsertListCommand.cpp:
2466         (WebCore::InsertListCommand::listifyParagraph):
2467
2468 2020-02-26  Don Olmstead  <don.olmstead@sony.com>
2469
2470         Allow setting of stack sizes for threads
2471         https://bugs.webkit.org/show_bug.cgi?id=208223
2472
2473         Reviewed by Yusuke Suzuki.
2474
2475         Specify ThreadType at the Thread::create callsite.
2476
2477         * Modules/webaudio/AsyncAudioDecoder.cpp:
2478         (WebCore::AsyncAudioDecoder::AsyncAudioDecoder):
2479         * Modules/webaudio/OfflineAudioDestinationNode.cpp:
2480         (WebCore::OfflineAudioDestinationNode::startRendering):
2481         * bindings/js/GCController.cpp:
2482         (WebCore::GCController::garbageCollectOnAlternateThreadForDebugging):
2483         * platform/audio/ReverbConvolver.cpp:
2484         (WebCore::ReverbConvolver::ReverbConvolver):
2485         * platform/network/cf/LoaderRunLoopCF.cpp:
2486         (WebCore::loaderRunLoop):
2487         * platform/network/cf/ResourceHandleCFNet.cpp:
2488         (WebCore::ResourceHandle::platformLoadResourceSynchronously):
2489         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
2490         (WebCore::getRunLoop):
2491         * platform/network/curl/CurlRequestScheduler.cpp:
2492         (WebCore::CurlRequestScheduler::startThreadIfNeeded):
2493         * platform/network/curl/CurlStreamScheduler.cpp:
2494         (WebCore::CurlStreamScheduler::startThreadIfNeeded):
2495         * workers/WorkerThread.cpp:
2496         (WebCore::WorkerThread::start):
2497
2498 2020-02-26  Zalan Bujtas  <zalan@apple.com>
2499
2500         [LFC][BFC][MarginCollapsing] Decouple regular and pre-computed margin collapsing logic
2501         https://bugs.webkit.org/show_bug.cgi?id=208247
2502         <rdar://problem/59808951>
2503
2504         Reviewed by Antti Koivisto.
2505
2506         The pre-computed path is so peculiar it deserves a dedicated file.
2507
2508         This is in preparation for fixing a flaw in the pre-computed logic where we end up
2509         accessing a not-yet-computed horizontal constraint. No change in functionality at this point.
2510
2511         * Sources.txt:
2512         * WebCore.xcodeproj/project.pbxproj:
2513         * layout/blockformatting/BlockFormattingContext.h:
2514         * layout/blockformatting/BlockMarginCollapse.cpp:
2515         (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeValues const):
2516         (WebCore::Layout::BlockFormattingContext::MarginCollapse::precomputedMarginBefore): Deleted.
2517         * layout/blockformatting/PrecomputedBlockMarginCollapse.cpp: Added.
2518         (WebCore::Layout::BlockFormattingContext::MarginCollapse::precomputedPositiveNegativeValues const):
2519         (WebCore::Layout::BlockFormattingContext::MarginCollapse::precomputedPositiveNegativeMarginBefore const):
2520         (WebCore::Layout::BlockFormattingContext::MarginCollapse::precomputedMarginBefore):
2521         * layout/integration/LayoutIntegrationBoxTree.cpp:
2522
2523 2020-02-26  Keith Rollin  <krollin@apple.com>
2524
2525         Add logging to help diagnose redirect issue
2526         https://bugs.webkit.org/show_bug.cgi?id=207916
2527         <rdar://problem/59567875>
2528
2529         Reviewed by Chris Dumez.
2530
2531         We're seeing an issue where communication between the WebContent
2532         process and the Network process seems to come to a stop between
2533         NetworkResourceLoader::continueWillSendRedirectedRequest and
2534         NetworkResourceLoader::continueWillSendRequest. We do see a
2535         WebResourceLoader::willSendRequest log line between those two
2536         NetworkResourceLoader logging lines, but nothing else. Add a bunch of
2537         logging in this area to help determine what's happening.
2538
2539         No new tests -- no new or changed functionality.
2540
2541         * loader/PolicyChecker.cpp:
2542         (WebCore::PolicyChecker::checkNavigationPolicy):
2543         * loader/ResourceLoader.cpp:
2544         (WebCore::ResourceLoader::loadDataURL):
2545         (WebCore::ResourceLoader::willSendRequestInternal):
2546         (WebCore::ResourceLoader::didFinishLoading):
2547         (WebCore::ResourceLoader::didFail):
2548         (WebCore::ResourceLoader::willSendRequestAsync):
2549         (WebCore::ResourceLoader::wasBlocked):
2550         (WebCore::ResourceLoader::cannotShowURL):
2551         * loader/SubresourceLoader.cpp:
2552         (WebCore::SubresourceLoader::init):
2553         (WebCore::SubresourceLoader::willSendRequestInternal):
2554         (WebCore::SubresourceLoader::didReceiveResponse):
2555         (WebCore::SubresourceLoader::didFinishLoading):
2556         (WebCore::SubresourceLoader::didFail):
2557         (WebCore::SubresourceLoader::willCancel):
2558         * loader/cache/CachedRawResource.cpp:
2559         (WebCore::CachedRawResource::redirectReceived):
2560         * loader/cache/CachedResource.cpp:
2561         (WebCore::CachedResource::redirectReceived):
2562         * loader/cache/CachedResourceLoader.cpp:
2563         (WebCore::CachedResourceLoader::canRequestAfterRedirection const):
2564
2565 2020-02-26  Daniel Bates  <dabates@apple.com>
2566
2567         Clean up HitTestLocation.h
2568         https://bugs.webkit.org/show_bug.cgi?id=208254
2569         <rdar://problem/59815136>
2570
2571         Reviewed by Jer Noble.
2572
2573         Use modern C++ features to remove duplicate code.
2574
2575         * rendering/HitTestLocation.cpp:
2576         (WebCore::HitTestLocation::HitTestLocation):
2577         * rendering/HitTestLocation.h:
2578         * rendering/HitTestResult.cpp:
2579         (WebCore::HitTestResult::HitTestResult):
2580         * rendering/HitTestResult.h: Remove unnecessary #includes. This file only needs
2581         to include RoundedRect.h: RoundedRect.h includes FloatQuad.h and LayoutRect.h
2582         and FloatQuad.h will include FloatRect.h. We do not make use of have declarations
2583         in <wtf/Forward.h> so remove that as well.
2584
2585 2020-02-26  Jacob Uphoff  <jacob_uphoff@apple.com>
2586
2587         Unreviewed, rolling out r257373.
2588
2589         This commit introduced one test that is a flaky failure on ios
2590         bots and broke another test
2591
2592         Reverted changeset:
2593
2594         "[iPadOS] REGRESSION(r247667): Autosizing style changes don't
2595         invalidate RenderText's preferred logical widths"
2596         https://bugs.webkit.org/show_bug.cgi?id=208084
2597         https://trac.webkit.org/changeset/257373
2598
2599 2020-02-26  Jacob Uphoff  <jacob_uphoff@apple.com>
2600
2601         Unreviewed, rolling out r257470.
2602
2603         This broke the build for tvOS and watchOS
2604
2605         Reverted changeset:
2606
2607         "Conversion between MediaSample and RemoteVideoSample should
2608         preserve the rotation information"
2609         https://bugs.webkit.org/show_bug.cgi?id=208240
2610         https://trac.webkit.org/changeset/257470
2611
2612 2020-02-26  Adrian Perez de Castro  <aperez@igalia.com>
2613
2614         Unreviewed build fix for non-unified builds with assertions enabled.
2615
2616         * css/CSSImageSetValue.cpp: Add missing include.
2617
2618 2020-02-26  Andres Gonzalez  <andresg_22@apple.com>
2619
2620         AXIsolatedObject support for table column objects.
2621         https://bugs.webkit.org/show_bug.cgi?id=208215
2622
2623         Reviewed by Chris Fleizach.
2624
2625         Covered by existing tests.
2626
2627         - AccessibilityTableColumn interface is now exposed through
2628         AXCoreObject.
2629         - Separated isTableColumn from isAccessibilityTableColumnInstance.
2630         - This eliminates to need to downcast in the wrapper code, and hence
2631         makes it possible that the same code works for both AccessibilityObjects
2632         and AXIsolatedObjects.
2633         - Completed the caching of table column properties in AXIsolatedObject.
2634         - Some minor code cleanup.
2635
2636         * accessibility/AccessibilityARIAGrid.cpp:
2637         (WebCore::AccessibilityARIAGrid::addChildren): Removed unnecessary cast.
2638         * accessibility/AccessibilityObject.h:
2639         * accessibility/AccessibilityObjectInterface.h:
2640         * accessibility/AccessibilityTable.cpp:
2641         (WebCore::AccessibilityTable::addChildren): Removed unnecessary cast.
2642         (WebCore::AccessibilityTable::columnHeaders):
2643         * accessibility/AccessibilityTableColumn.cpp:
2644         (WebCore::AccessibilityTableColumn::columnHeader):
2645         (WebCore::AccessibilityTableColumn::headerObject): Renamed columnHeader.
2646         * accessibility/AccessibilityTableColumn.h:
2647         * accessibility/isolatedtree/AXIsolatedObject.cpp:
2648         (WebCore::AXIsolatedObject::initializeAttributeData):
2649         (WebCore::AXIsolatedObject::isAccessibilityTableColumnInstance const):
2650         * accessibility/isolatedtree/AXIsolatedObject.h:
2651         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2652         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
2653
2654 2020-02-26  Youenn Fablet  <youenn@apple.com>
2655
2656         Conversion between MediaSample and RemoteVideoSample should preserve the rotation information
2657         https://bugs.webkit.org/show_bug.cgi?id=208240
2658
2659         Reviewed by Eric Carlson.
2660
2661         Update RemoteVideoSample to have surface getter be const.
2662         Add a new routine to convert a RemoteVideoSample in a MediaSample, with proper rotation and mirrored information.
2663         Covered by manual testing.
2664
2665         * platform/graphics/RemoteVideoSample.cpp:
2666         (WebCore::RemoteVideoSample::surface const):
2667         * platform/graphics/RemoteVideoSample.h:
2668         (WebCore::RemoteVideoSample::mirrored const):
2669         * platform/graphics/cv/ImageTransferSessionVT.h:
2670         * platform/graphics/cv/ImageTransferSessionVT.mm:
2671         (WebCore::ImageTransferSessionVT::createMediaSample):
2672
2673 2020-02-26  Zalan Bujtas  <zalan@apple.com>
2674
2675         [LFC][IFC][Floats] ASSERT(committedInlineItemCount || line.hasIntrusiveFloat()) in LineLayoutContext::close
2676         https://bugs.webkit.org/show_bug.cgi?id=208230
2677         <rdar://problem/59791249>
2678
2679         Reviewed by Antti Koivisto.
2680
2681         Test: fast/layoutformattingcontext/float-and-br-inline-content-only.html
2682
2683         Expand the ASSERT to include all the valid cases
2684         1. Inline content is added to the line
2685         2. Only float(s) got processed (no inline content)
2686         3. Neither floats not inline content got processed due to intrusive floats.
2687         (This patch slightly rearranges the body of LineLayoutContext::commitFloats and also fixes an off-by-1 error in LineLayoutContext::close.)
2688
2689         * layout/inlineformatting/LineLayoutContext.cpp:
2690         (WebCore::Layout::LineLayoutContext::close):
2691         (WebCore::Layout::LineLayoutContext::commitFloats):
2692
2693 2020-02-26  Alicia Boya García  <aboya@igalia.com>
2694
2695         [GStreamer] Correctly remove webvttenc on WebKitTextCombiner pad release
2696         https://bugs.webkit.org/show_bug.cgi?id=208234
2697
2698         Reviewed by Xabier Rodriguez-Calvar.
2699
2700         The implementation of webkitTextCombinerReleasePad() was wrong in that
2701         it was checking the peer pad of webkittextcombinerpad to check if it
2702         belonged a webvttenc element and remove it... But since this is a
2703         ghostpad, the peer is upstream, not downstream. When the release pad
2704         function is called, upstream is already disconnected, so the branch
2705         was never hit.
2706
2707         To actually remove the webvttenc element we must check the target pad
2708         instead of the peer pad, which corresponds to the element downstream.
2709         Also, we need to set the element state to NULL before removing it,
2710         which the previous code didn't.
2711
2712         * platform/graphics/gstreamer/TextCombinerGStreamer.cpp:
2713         (webkitTextCombinerReleasePad):
2714
2715 2020-02-26  Antti Koivisto  <antti@apple.com>
2716
2717         Remove throttling code from RenderLayerCompositor
2718         https://bugs.webkit.org/show_bug.cgi?id=208135
2719         <rdar://problem/59765410>
2720
2721         Unreviewed partial revert.
2722
2723         Keep using the "flush" naming in GraphicsLayerClient.
2724
2725         * page/PageOverlayController.cpp:
2726         (WebCore::PageOverlayController::notifyFlushRequired):
2727         (WebCore::PageOverlayController::notifyRenderingUpdateRequired): Deleted.
2728         * page/PageOverlayController.h:
2729         * page/linux/ResourceUsageOverlayLinux.cpp:
2730         * page/mac/ServicesOverlayController.h:
2731         * page/mac/ServicesOverlayController.mm:
2732         (WebCore::ServicesOverlayController::Highlight::notifyFlushRequired):
2733         (WebCore::ServicesOverlayController::Highlight::notifyRenderingUpdateRequired): Deleted.
2734         * platform/graphics/GraphicsLayerClient.h:
2735         (WebCore::GraphicsLayerClient::notifyFlushRequired):
2736         (WebCore::GraphicsLayerClient::notifyRenderingUpdateRequired): Deleted.
2737         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
2738         (WebCore::CoordinatedGraphicsLayer::notifyFlushRequired):
2739         * rendering/RenderLayerBacking.cpp:
2740         (WebCore::RenderLayerBacking::notifyFlushRequired):
2741         (WebCore::RenderLayerBacking::notifyRenderingUpdateRequired): Deleted.
2742         * rendering/RenderLayerBacking.h:
2743         * rendering/RenderLayerCompositor.cpp:
2744         (WebCore::RenderLayerCompositor::notifyFlushRequired):
2745         (WebCore::RenderLayerCompositor::notifyRenderingUpdateRequired): Deleted.
2746         * rendering/RenderLayerCompositor.h:
2747
2748 2020-02-26  Víctor Manuel Jáquez Leal  <vjaquez@igalia.com>
2749
2750         [GL][GStreamer] Instantiate GstGLContext when the shared GLContext is created
2751         https://bugs.webkit.org/show_bug.cgi?id=200626
2752
2753         Reviewed by Carlos Garcia Campos.
2754
2755         This patch adds GstGLContext and GstGLDisplay as part of
2756         PlatformDisplay.
2757
2758         Right now one GstGLContext is created per video tag, which is a
2759         wrapper of the GL shared context. Every time this wrapper is
2760         created the GL context has to be current in order to initialize
2761         the wrapper's internal state.
2762
2763         A better approach would be to have a single GstGLContext per GL
2764         context, to instantiate it when the GL context is created and
2765         current. This GstGLContext would be used for all media players.
2766
2767         GstGLContext and GstGLDisplay are instantiated as singletons by
2768         PlatformDisplay. When the media player request for the
2769         GstGLContext a GL context is instantiated, if it wasn't before,
2770         and wraps it. PlatformDisplay adds two getters, one for
2771         GstGLContext object, and other for GstGLDisplay. Both are used to
2772         configure the internal GStreamer GL context in the multimedia
2773         pipeline.
2774
2775         No new tests are needed.
2776
2777         * platform/GStreamer.cmake:
2778         * platform/graphics/PlatformDisplay.cpp:
2779         (WebCore::PlatformDisplay::terminateEGLDisplay):
2780         * platform/graphics/PlatformDisplay.h:
2781         * platform/graphics/gstreamer/GLVideoSinkGStreamer.cpp:
2782         (requestGLContext):
2783         (webKitGLVideoSinkChangeState):
2784         (webKitGLVideoSinkProbePlatform):
2785         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
2786         * platform/graphics/gstreamer/PlatformDisplayGStreamer.cpp: Added.
2787         (createGstGLDisplay):
2788         (PlatformDisplay::tryEnsureGstGLContext):
2789         (PlatformDisplay::gstGLDisplay const):
2790         (PlatformDisplay::gstGLContext const):
2791
2792 2020-02-26  Chris Dumez  <cdumez@apple.com>
2793
2794         DocumentTimeline / CSSTransition objects are leaking on CNN.com
2795         https://bugs.webkit.org/show_bug.cgi?id=208069
2796         <rdar://problem/59680143>
2797
2798         Reviewed by Antoine Quint.
2799
2800         Break reference cycle between DocumentTimeline and WebAnimation by using WeakPtr.
2801
2802         * animation/AnimationTimeline.h:
2803         * animation/DocumentTimeline.h:
2804         * animation/WebAnimation.cpp:
2805         (WebCore::WebAnimation::timeline const):
2806         (WebCore::WebAnimation::setTimeline):
2807         (WebCore::WebAnimation::setTimelineInternal):
2808         (WebCore::WebAnimation::enqueueAnimationEvent):
2809         (WebCore::WebAnimation::acceleratedStateDidChange):
2810         * animation/WebAnimation.h:
2811         (WebCore::WebAnimation::timeline const): Deleted.
2812
2813 2020-02-26  Adrian Perez de Castro  <aperez@igalia.com>
2814
2815         Unreviewed build fix for non-unified builds.
2816
2817         * bindings/js/JSAnimationTimelineCustom.cpp: Add missing header include.
2818
2819 2020-02-26  Mark Lam  <mark.lam@apple.com>
2820
2821         Custom element caching should be aware of different worlds.
2822         https://bugs.webkit.org/show_bug.cgi?id=208228
2823         <rdar://problem/57881013>
2824
2825         Reviewed by Ryosuke Niwa.
2826
2827         Even though a custom element is cached in one world, we should return an unknown
2828         HTMl element in a different world.
2829
2830         Test to be added in https://bugs.webkit.org/show_bug.cgi?id=208229.
2831
2832         * bindings/js/JSElementCustom.cpp:
2833         (WebCore::toJSNewlyCreated):
2834
2835 2020-02-25  Fujii Hironori  <Hironori.Fujii@sony.com>
2836
2837         [WinCairo] Unreviewed build fix for unified source builds
2838
2839         > Modules\websockets\WebSocket.cpp(334): error C2065: 'WorkerGlobalScope': undeclared identifier
2840         > Modules\websockets\WebSocket.cpp(334): error C2672: 'downcast': no matching overloaded function found
2841         > Modules\websockets\WebSocket.cpp(334): error C2974: 'WTF::downcast': invalid template argument for 'Target', type expected
2842
2843         * Modules/websockets/WebSocket.cpp: Added #include "WorkerGlobalScope.h".
2844
2845 2020-02-25  Devin Rousso  <drousso@apple.com>
2846
2847         Web Inspector: safari app extension isolated worlds and injected files use the extension's identifier instead of its name
2848         https://bugs.webkit.org/show_bug.cgi?id=206911
2849         <rdar://problem/58026635>
2850
2851         Reviewed by Brian Burg.
2852
2853         * Modules/webauthn/AuthenticationExtensionsClientOutputs.h:
2854         Drive-by: add missing include.
2855
2856 2020-02-25  Jer Noble  <jer.noble@apple.com>
2857
2858         Unreviewed tvOS build fix; fix the compiler guards broken by r257189.
2859
2860         * platform/ios/PlaybackSessionInterfaceAVKit.h:
2861         * platform/ios/PlaybackSessionInterfaceAVKit.mm:
2862         * platform/ios/WebAVPlayerController.h:
2863         * platform/ios/WebAVPlayerController.mm:
2864
2865 2020-02-25  Jack Lee  <shihchieh_lee@apple.com>
2866
2867         ASSERTION FAILURE in AppendNodeCommand::AppendNodeCommand when inserting list with read-only user-modify
2868         https://bugs.webkit.org/show_bug.cgi?id=208045
2869         <rdar://problem/39023383>
2870
2871         Reviewed by Ryosuke Niwa.
2872
2873         When inserting a list (InsertListCommand) around enclosed list items, if new list is not editable, skip moving list items in function doApplyForSingleParagraph.
2874
2875         Test: fast/lists/insert-list-user-modify-read-only-enclosed-li.html
2876
2877         * editing/InsertListCommand.cpp:
2878         (WebCore::InsertListCommand::doApplyForSingleParagraph):
2879
2880 2020-02-25  Jack Lee  <shihchieh_lee@apple.com>
2881
2882         Nullptr crash in CompositeEditCommand::splitTreeToNode
2883         https://bugs.webkit.org/show_bug.cgi?id=208039
2884         <rdar://problem/52011355>
2885
2886         Reviewed by Ryosuke Niwa.
2887
2888         When inserting a list (InsertListCommand) around orphaned list items, if unordered list is not editable, skip moving list items in function fixOrphanedListChild. 
2889
2890         Test: fast/lists/insert-list-user-modify-read-only-orphaned-li.html
2891
2892         * editing/InsertListCommand.cpp:
2893         (WebCore::InsertListCommand::fixOrphanedListChild):
2894         (WebCore::InsertListCommand::doApplyForSingleParagraph):
2895         * editing/InsertListCommand.h:
2896
2897 2020-02-25  Justin Michaud  <justin_michaud@apple.com>
2898
2899         Inline Cache delete by id/val
2900         https://bugs.webkit.org/show_bug.cgi?id=207522
2901
2902         Reviewed by Keith Miller and Filip Pizlo.
2903
2904         * bindings/js/JSDOMWindowCustom.cpp:
2905         (WebCore::JSDOMWindow::deleteProperty):
2906         * bindings/js/JSLocationCustom.cpp:
2907         (WebCore::JSLocation::deleteProperty):
2908         * bindings/js/JSRemoteDOMWindowCustom.cpp:
2909         (WebCore::JSRemoteDOMWindow::deleteProperty):
2910         * bindings/scripts/CodeGeneratorJS.pm:
2911         (GenerateDeleteProperty):
2912         (GenerateHeader):
2913         (GenerateImplementation):
2914         (GenerateConstructorHelperMethods):
2915         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
2916         (WebCore::JSTestEnabledBySettingPrototype::finishCreation):
2917         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
2918         (WebCore::JSTestGenerateIsReachablePrototype::finishCreation):
2919         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
2920         (WebCore::JSTestNamedDeleterNoIdentifier::deleteProperty):
2921         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.h:
2922         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
2923         (WebCore::JSTestNamedDeleterThrowingException::deleteProperty):
2924         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.h:
2925         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
2926         (WebCore::JSTestNamedDeleterWithIdentifier::deleteProperty):
2927         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.h:
2928         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
2929         (WebCore::JSTestNamedDeleterWithIndexedGetter::deleteProperty):
2930         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.h:
2931         * bindings/scripts/test/JS/JSTestNode.cpp:
2932         (WebCore::JSTestNodePrototype::finishCreation):
2933         * bindings/scripts/test/JS/JSTestObj.cpp:
2934         (WebCore::JSTestObjConstructor::initializeProperties):
2935         (WebCore::JSTestObjPrototype::finishCreation):
2936         * bridge/NP_jsobject.cpp:
2937         * bridge/objc/WebScriptObject.mm:
2938         (-[WebScriptObject removeWebScriptKey:]):
2939         * bridge/objc/objc_runtime.h:
2940         * bridge/objc/objc_runtime.mm:
2941         (JSC::Bindings::ObjcFallbackObjectImp::deleteProperty):
2942         * bridge/runtime_array.cpp:
2943         (JSC::RuntimeArray::deleteProperty):
2944         * bridge/runtime_array.h:
2945         * bridge/runtime_object.cpp:
2946         (JSC::Bindings::RuntimeObject::deleteProperty):
2947         * bridge/runtime_object.h:
2948
2949 2020-02-25  Ben Nham  <nham@apple.com>
2950
2951         Remove render update throttling
2952         https://bugs.webkit.org/show_bug.cgi?id=208168
2953
2954         Reviewed by Zalan Bujtas.
2955
2956         Currently, we disable render updates after the first paint for 500 ms while the page is
2957         actively loading. However, oftentimes our first paint heuristic selects a first paint that
2958         isn't particularly interesting (mostly background colors) and this paint throttler just
2959         makes the user look at a nearly empty page for 500 ms. Antti and Simon both think we should
2960         remove the throttler to fix this so this patch does that.
2961
2962         * Headers.cmake:
2963         * WebCore.xcodeproj/project.pbxproj:
2964         * dom/Document.cpp:
2965         (WebCore::Document::scheduleStyleRecalc):
2966         (WebCore::Document::shouldScheduleLayout):
2967         * editing/AlternativeTextController.cpp:
2968         (WebCore::AlternativeTextController::insertDictatedText):
2969         * page/ChromeClient.h:
2970         (WebCore::ChromeClient::layerTreeStateIsFrozen const):
2971         (WebCore::ChromeClient::renderingUpdateThrottlingIsActive const): Deleted.
2972         (WebCore::ChromeClient::adjustRenderingUpdateThrottling): Deleted.
2973         * page/EventHandler.cpp:
2974         (WebCore::EventHandler::dispatchDragEvent):
2975         (WebCore::EventHandler::dispatchMouseEvent):
2976         (WebCore::EventHandler::internalKeyEvent):
2977         (WebCore::EventHandler::handleTextInputEvent):
2978         * page/FrameView.cpp:
2979         (WebCore::FrameView::loadProgressingStatusChanged):
2980         (WebCore::FrameView::setWasScrolledByUser):
2981         (WebCore::determineLayerFlushThrottleState): Deleted.
2982         (WebCore::FrameView::disableLayerFlushThrottlingTemporarilyForInteraction): Deleted.
2983         (WebCore::FrameView::updateLayerFlushThrottling): Deleted.
2984         * page/FrameView.h:
2985
2986 2020-02-25  Myles C. Maxfield  <mmaxfield@apple.com>
2987
2988         [iPadOS] REGRESSION(r247667): Autosizing style changes don't invalidate RenderText's preferred logical widths
2989         https://bugs.webkit.org/show_bug.cgi?id=208084
2990         <rdar://problem/59463898>
2991
2992         Reviewed by Darin Adler.
2993
2994         Just use RenderElement::setStyle(), which handles all the invalidations, instead of RenderElement::setNeedsLayout().
2995
2996         Do a little refactoring so we don't clone RenderStyles unless we need to.
2997
2998         Test: fast/text-autosizing/ios/idempotentmode/viewport-change-relayout.html
2999
3000         * page/Page.cpp:
3001         (WebCore::Page::recomputeTextAutoSizingInAllFrames):
3002         * style/StyleAdjuster.cpp:
3003         (WebCore::Style::Adjuster::adjustmentForTextAutosizing):
3004         (WebCore::Style::Adjuster::adjustForTextAutosizing):
3005         * style/StyleAdjuster.h:
3006         (WebCore::Style::Adjuster::AdjustmentForTextAutosizing::operator bool const):
3007
3008 2020-02-25  Zalan Bujtas  <zalan@apple.com>
3009
3010         [LFC][TFC] Do not create a formatting context for empty subtree in TableFormattingContext::computePreferredWidthForColumns
3011         https://bugs.webkit.org/show_bug.cgi?id=208205
3012         <rdar://problem/59766702>
3013
3014         Reviewed by Antti Koivisto.
3015
3016         Test: fast/layoutformattingcontext/simple-table-with-empty-td.html
3017
3018         * layout/tableformatting/TableFormattingContext.cpp:
3019         (WebCore::Layout::TableFormattingContext::computePreferredWidthForColumns):
3020
3021 2020-02-25  Don Olmstead  <don.olmstead@sony.com>
3022
3023         [WinCairo] Fix build after revisions 257357 and 257354
3024         https://bugs.webkit.org/show_bug.cgi?id=208210
3025
3026         Unreviewed build fix.
3027
3028         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
3029         (WebCore::GraphicsLayerTextureMapper::notifyChange):
3030         * platform/network/curl/CookieJarDB.cpp:
3031         (WebCore::CookieJarDB::setCookie):
3032
3033 2020-02-25  Said Abou-Hallawa  <sabouhallawa@apple.com>
3034
3035         Make HostWindow be the creator of the remote ImageBuffer
3036         https://bugs.webkit.org/show_bug.cgi?id=207134
3037
3038         Reviewed by Darin Adler.
3039
3040         ImageBuffer is responsible of creating all the in-process ImageBuffers.
3041         HostWindow will be responsible of creating the remote ImageBuffers.
3042
3043         HostWindow adds the virtual function createImageBuffer(). Chrome forward
3044         this to the virtual function createImageBuffer() on the ChromeClient.
3045
3046         * page/Chrome.cpp:
3047         (WebCore::Chrome::createImageBuffer const):
3048         * page/Chrome.h:
3049         * page/ChromeClient.h:
3050         (WebCore::ChromeClient::createImageBuffer const):
3051         * platform/HostWindow.h:
3052         * platform/graphics/ImageBuffer.cpp:
3053         (WebCore::ImageBuffer::create):
3054         * platform/graphics/RenderingMode.h:
3055
3056 2020-02-25  Sihui Liu  <sihui_liu@apple.com>
3057
3058         Assertion failed: currentSchema == createV1ObjectStoreInfoSchema(objectStoreInfoTableName) || currentSchema == createV1ObjectStoreInfoSchema(objectStoreInfoTableNameAlternate)
3059         https://bugs.webkit.org/show_bug.cgi?id=208144
3060
3061         Reviewed by Ryosuke Niwa.
3062
3063         Change a release assertion to release error log to gather information about bug. This is also the pattern of 
3064         handling error during schema update in SQLiteIDBBackingStore.  
3065
3066         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
3067         (WebCore::IDBServer::SQLiteIDBBackingStore::ensureValidObjectStoreInfoTable):
3068
3069 2020-02-25  Zalan Bujtas  <zalan@apple.com>
3070
3071         [LFC][OutOfFlow] Out-of-flow positioned line breaks can generate display boxes
3072         https://bugs.webkit.org/show_bug.cgi?id=208198
3073         <rdar://problem/59764787>
3074
3075         Reviewed by Antti Koivisto.
3076
3077         Test: fast/layoutformattingcontext/out-of-flow-positioned-line-breaks.html
3078
3079         This assert should take the positioning into account when checking againts line breaks.
3080         (In practice those display boxes are empty and they don't really contribute to rendering but
3081         they are still valid content.) 
3082
3083         * layout/FormattingState.cpp:
3084         (WebCore::Layout::FormattingState::displayBox):
3085
3086 2020-02-25  Antti Koivisto  <antti@apple.com>
3087
3088         Remove throttling code from RenderLayerCompositor
3089         https://bugs.webkit.org/show_bug.cgi?id=208135
3090
3091         Reviewed by Zalan Bujtas.
3092
3093         It is only used on WK1, adds lots of complexity and is not very effective or correct.
3094
3095         Also do some "layer flush" -> "rendering update" renaming.
3096
3097         * page/FrameView.cpp:
3098         (WebCore::FrameView::disableLayerFlushThrottlingTemporarilyForInteraction):
3099         (WebCore::FrameView::updateLayerFlushThrottling):
3100         (WebCore::FrameView::setViewExposedRect):
3101         (WebCore::FrameView::scheduleLayerFlushAllowingThrottling): Deleted.
3102         * page/FrameView.h:
3103         * page/PageOverlayController.cpp:
3104         (WebCore::PageOverlayController::notifyRenderingUpdateRequired):
3105         (WebCore::PageOverlayController::notifyFlushRequired): Deleted.
3106         * page/PageOverlayController.h:
3107         * page/mac/ServicesOverlayController.h:
3108         * page/mac/ServicesOverlayController.mm:
3109         (WebCore::ServicesOverlayController::Highlight::notifyRenderingUpdateRequired):
3110         (WebCore::ServicesOverlayController::Highlight::notifyFlushRequired): Deleted.
3111         * platform/graphics/GraphicsLayer.h:
3112         (WebCore::GraphicsLayer::canThrottleLayerFlush const): Deleted.
3113         * platform/graphics/GraphicsLayerClient.h:
3114         (WebCore::GraphicsLayerClient::notifyRenderingUpdateRequired):
3115         (WebCore::GraphicsLayerClient::notifyFlushRequired): Deleted.
3116         * platform/graphics/ca/GraphicsLayerCA.cpp:
3117         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
3118         * platform/graphics/ca/GraphicsLayerCA.h:
3119         * platform/ios/LegacyTileCache.h:
3120         * platform/ios/LegacyTileCache.mm:
3121         (WebCore::LegacyTileCache::scheduleRenderingUpdateForPendingRepaint):
3122         (WebCore::LegacyTileCache::setNeedsDisplayInRect):
3123         (WebCore::LegacyTileCache::updateTilingMode):
3124         (WebCore::LegacyTileCache::scheduleLayerFlushForPendingRepaint): Deleted.
3125         * rendering/RenderLayerBacking.cpp:
3126         (WebCore::RenderLayerBacking::notifyRenderingUpdateRequired):
3127         (WebCore::RenderLayerBacking::notifyFlushRequired): Deleted.
3128         * rendering/RenderLayerBacking.h:
3129         * rendering/RenderLayerCompositor.cpp:
3130         (WebCore::RenderLayerCompositor::RenderLayerCompositor):
3131         (WebCore::RenderLayerCompositor::notifyRenderingUpdateRequired):
3132         (WebCore::RenderLayerCompositor::scheduleRenderingUpdate):
3133         (WebCore::RenderLayerCompositor::flushPendingLayerChanges):
3134         (WebCore::RenderLayerCompositor::didChangeVisibleRect):
3135         (WebCore::RenderLayerCompositor::flushLayersSoon):
3136         (WebCore::RenderLayerCompositor::frameViewDidScroll):
3137         (WebCore::RenderLayerCompositor::ensureRootLayer):
3138         (WebCore::RenderLayerCompositor::attachRootLayer):
3139         (WebCore::RenderLayerCompositor::notifyFlushRequired): Deleted.
3140         (WebCore::RenderLayerCompositor::scheduleLayerFlush): Deleted.
3141         (WebCore::RenderLayerCompositor::setLayerFlushThrottlingEnabled): Deleted.
3142         (WebCore::RenderLayerCompositor::disableLayerFlushThrottlingTemporarilyForInteraction): Deleted.
3143         (WebCore::RenderLayerCompositor::isThrottlingLayerFlushes const): Deleted.
3144         (WebCore::RenderLayerCompositor::startLayerFlushTimerIfNeeded): Deleted.
3145         (WebCore::RenderLayerCompositor::startInitialLayerFlushTimerIfNeeded): Deleted.
3146         (WebCore::RenderLayerCompositor::layerFlushTimerFired): Deleted.
3147         * rendering/RenderLayerCompositor.h:
3148
3149 2020-02-25  Andres Gonzalez  <andresg_22@apple.com>
3150
3151         IsolatedObject support for ProgressIndicator and Meter.
3152         https://bugs.webkit.org/show_bug.cgi?id=208175
3153
3154         Reviewed by Chris Fleizach.
3155
3156         - Eliminated the need to downcast to an AccessibilityProgressIndicator
3157         by including gaugeRegionValueDescription in the valueDescription
3158         method.
3159         - Separated isAccessibilityProgressIndicatorInstance from
3160         isProgressIndicator, so that the latter now works for both
3161         AccessibilityObjects and AXIsolatedObjects.
3162         - Completed implementation of isMeter in AXIsolatedObject.
3163
3164         * accessibility/AccessibilityObject.h:
3165         * accessibility/AccessibilityObjectInterface.h:
3166         * accessibility/AccessibilityProgressIndicator.cpp:
3167         (WebCore::AccessibilityProgressIndicator::valueDescription const):
3168         * accessibility/AccessibilityProgressIndicator.h:
3169         * accessibility/isolatedtree/AXIsolatedObject.cpp:
3170         (WebCore::AXIsolatedObject::initializeAttributeData): Sets the isMeter property.
3171         (WebCore::AXIsolatedObject::isAccessibilityProgressIndicatorInstance const):
3172         * accessibility/isolatedtree/AXIsolatedObject.h:
3173         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3174         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
3175         (-[WebAccessibilityObjectWrapper valueDescriptionForMeter]): Deleted, no needed any longer.
3176
3177 2020-02-25  Zalan Bujtas  <zalan@apple.com>
3178
3179         [LFC] Invalidate layout states on style mutation
3180         https://bugs.webkit.org/show_bug.cgi?id=208195
3181         <rdar://problem/59764089>
3182
3183         Reviewed by Antti Koivisto.
3184
3185         Let's just do a blanket invalidation for now (since we don't have the invalidation figured out yet).
3186
3187         * page/FrameViewLayoutContext.cpp:
3188         (WebCore::FrameViewLayoutContext::invalidateLayoutState):
3189         * page/FrameViewLayoutContext.h:
3190         * rendering/updating/RenderTreeUpdater.cpp:
3191         (WebCore::RenderTreeUpdater::updateRendererStyle):
3192
3193 2020-02-25  Chris Dumez  <cdumez@apple.com>
3194
3195         Regression(CookieCache) Hang and very high CPU usage on nytimes.com
3196         https://bugs.webkit.org/show_bug.cgi?id=208166
3197         <rdar://problem/59739735>
3198
3199         Reviewed by Alex Christensen.
3200
3201         The Cookie class which the cookie cache implementation relies on for IPC of cookie had a bug
3202         in its implementation to convert the Cookie into a NSHTTPCookie. In particular, if the expiry
3203         was in the past, it would drop it and the cookie would end up with no expiration date. We would
3204         end up with a cookie that lives for duration of the session, instead of a cookie with an
3205         expiration in the past (which is how sites delete cookies).
3206
3207         Test: http/tests/cookies/document-cookie-set-expired-cookie.html
3208
3209         * platform/network/cocoa/CookieCocoa.mm:
3210         (WebCore::Cookie::operator NSHTTPCookie * _Nullable  const):
3211
3212 2020-02-25  Carlos Garcia Campos  <cgarcia@igalia.com>
3213
3214         [GTK] Add support for rendering slider ticks
3215         https://bugs.webkit.org/show_bug.cgi?id=208132
3216
3217         Reviewed by Adrian Perez de Castro.
3218
3219         * rendering/RenderThemeAdwaita.cpp:
3220         (WebCore::RenderThemeAdwaita::paintSliderTrack):
3221         (WebCore::RenderThemeAdwaita::sliderTickSize const):
3222         (WebCore::RenderThemeAdwaita::sliderTickOffsetFromTrackCenter const):
3223
3224 2020-02-25  Carlos Garcia Campos  <cgarcia@igalia.com>
3225
3226         [GTK] Stop using gtk foreign drawing API to style form controls
3227         https://bugs.webkit.org/show_bug.cgi?id=208129
3228
3229         Reviewed by Adrian Perez de Castro.
3230
3231         It causes layout issues in some websites, it doesn't really work with all GTK themes and it won't be possible
3232         with GTK4 because foreign drawing APIs have been removed. Instead, we can use the new custom style used by WPE
3233         port, which is based on adwaita, but simplified to avoid the huge minimum control sizes, the usage of gradients
3234         and transparencies, etc. We can still use the GTK API to get the selection colors, to keep some consistency with
3235         the actual GTK theme, but that won't be possible with GTK4 either. This also means we won't be rendering
3236         directly to the cairo context anymore (which was required by GTK foreign drawing), so we can use things like
3237         threaded rendering in the GTK port now. This patch renames ScrollbarThemeWPE, RenderThemeWPE and ThemeWPE as
3238         ScrollbarThemeAdwaita, RenderThemeAdwaita and ThemeAdwaita and adds ThemeGtk. GTK media controls CSS and
3239         JavaScript files have been removed in favor of using the adwaita ones.
3240
3241         * Modules/mediacontrols/mediaControlsGtk.js: Removed.
3242         * PlatformGTK.cmake:
3243         * PlatformWPE.cmake:
3244         * SourcesGTK.txt:
3245         * SourcesWPE.txt:
3246         * css/mediaControlsGtk.css: Removed.
3247         * platform/adwaita/ScrollbarThemeAdwaita.cpp: Renamed from Source/WebCore/platform/wpe/ScrollbarThemeWPE.cpp.
3248         (WebCore::ScrollbarThemeAdwaita::usesOverlayScrollbars const):
3249         (WebCore::ScrollbarThemeAdwaita::scrollbarThickness):
3250         (WebCore::ScrollbarThemeAdwaita::minimumThumbLength):
3251         (WebCore::ScrollbarThemeAdwaita::hasButtons):
3252         (WebCore::ScrollbarThemeAdwaita::hasThumb):
3253         (WebCore::ScrollbarThemeAdwaita::backButtonRect):
3254         (WebCore::ScrollbarThemeAdwaita::forwardButtonRect):
3255         (WebCore::ScrollbarThemeAdwaita::trackRect):
3256         (WebCore::ScrollbarThemeAdwaita::paint):
3257         (WebCore::ScrollbarThemeAdwaita::handleMousePressEvent):
3258         (WebCore::ScrollbarTheme::nativeTheme):
3259         * platform/adwaita/ScrollbarThemeAdwaita.h: Copied from Source/WebCore/platform/wpe/ScrollbarThemeWPE.h.
3260         * platform/adwaita/ThemeAdwaita.cpp: Renamed from Source/WebCore/platform/wpe/ThemeWPE.cpp.
3261         (WebCore::Theme::singleton):
3262         (WebCore::ThemeAdwaita::activeSelectionForegroundColor const):
3263         (WebCore::ThemeAdwaita::activeSelectionBackgroundColor const):
3264         (WebCore::ThemeAdwaita::inactiveSelectionForegroundColor const):
3265         (WebCore::ThemeAdwaita::inactiveSelectionBackgroundColor const):
3266         (WebCore::ThemeAdwaita::focusColor):
3267         (WebCore::ThemeAdwaita::paintFocus):
3268         (WebCore::ThemeAdwaita::paintArrow):
3269         (WebCore::ThemeAdwaita::controlSize const):
3270         (WebCore::ThemeAdwaita::paint):
3271         (WebCore::ThemeAdwaita::paintCheckbox):
3272         (WebCore::ThemeAdwaita::paintRadio):
3273         (WebCore::ThemeAdwaita::paintButton):
3274         (WebCore::ThemeAdwaita::paintSpinButton):
3275         * platform/adwaita/ThemeAdwaita.h: Renamed from Source/WebCore/platform/wpe/ThemeWPE.h.
3276         (WebCore::ThemeAdwaita::platformColorsDidChange):
3277         * platform/graphics/cairo/CairoOperations.cpp:
3278         (WebCore::Cairo::drawFocusRing):
3279         * platform/graphics/cairo/GraphicsContextCairo.cpp:
3280         (WebCore::GraphicsContext::drawFocusRing):
3281         * platform/gtk/RenderThemeGadget.cpp: Removed.
3282         * platform/gtk/RenderThemeGadget.h: Removed.
3283         * platform/gtk/RenderThemeWidget.cpp: Removed.
3284         * platform/gtk/RenderThemeWidget.h: Removed.
3285         * platform/gtk/ScrollbarThemeGtk.cpp: Removed.
3286         * platform/gtk/ScrollbarThemeGtk.h: Removed.
3287         * platform/gtk/ThemeGtk.cpp: Added.
3288         (WebCore::Theme::singleton):
3289         (WebCore::ThemeGtk::ensurePlatformColors const):
3290         (WebCore::ThemeGtk::platformColorsDidChange):
3291         (WebCore::ThemeGtk::activeSelectionForegroundColor const):
3292         (WebCore::ThemeGtk::activeSelectionBackgroundColor const):
3293         (WebCore::ThemeGtk::inactiveSelectionForegroundColor const):
3294         (WebCore::ThemeGtk::inactiveSelectionBackgroundColor const):
3295         * platform/gtk/ThemeGtk.h: Renamed from Source/WebCore/platform/wpe/ScrollbarThemeWPE.h.
3296         * rendering/RenderThemeAdwaita.cpp: Renamed from Source/WebCore/platform/wpe/RenderThemeWPE.cpp.
3297         (WebCore::RenderTheme::singleton):
3298         (WebCore::RenderThemeAdwaita::supportsFocusRing const):
3299         (WebCore::RenderThemeAdwaita::shouldHaveCapsLockIndicator const):
3300         (WebCore::RenderThemeAdwaita::platformActiveSelectionBackgroundColor const):
3301         (WebCore::RenderThemeAdwaita::platformInactiveSelectionBackgroundColor const):
3302         (WebCore::RenderThemeAdwaita::platformActiveSelectionForegroundColor const):
3303         (WebCore::RenderThemeAdwaita::platformInactiveSelectionForegroundColor const):
3304         (WebCore::RenderThemeAdwaita::platformActiveListBoxSelectionBackgroundColor const):
3305         (WebCore::RenderThemeAdwaita::platformInactiveListBoxSelectionBackgroundColor const):
3306         (WebCore::RenderThemeAdwaita::platformActiveListBoxSelectionForegroundColor const):
3307         (WebCore::RenderThemeAdwaita::platformInactiveListBoxSelectionForegroundColor const):
3308         (WebCore::RenderThemeAdwaita::platformFocusRingColor const):
3309         (WebCore::RenderThemeAdwaita::platformColorsDidChange):
3310         (WebCore::RenderThemeAdwaita::extraDefaultStyleSheet):
3311         (WebCore::RenderThemeAdwaita::extraMediaControlsStyleSheet):
3312         (WebCore::RenderThemeAdwaita::mediaControlsScript):
3313         (WebCore::RenderThemeAdwaita::paintTextField):
3314         (WebCore::RenderThemeAdwaita::paintTextArea):
3315         (WebCore::RenderThemeAdwaita::paintSearchField):
3316         (WebCore::RenderThemeAdwaita::popupInternalPaddingBox const):
3317         (WebCore::RenderThemeAdwaita::paintMenuList):
3318         (WebCore::RenderThemeAdwaita::paintMenuListButtonDecorations):
3319         (WebCore::RenderThemeAdwaita::animationRepeatIntervalForProgressBar const):
3320         (WebCore::RenderThemeAdwaita::animationDurationForProgressBar const):
3321         (WebCore::RenderThemeAdwaita::progressBarRectForBounds const):
3322         (WebCore::RenderThemeAdwaita::paintProgressBar):
3323         (WebCore::RenderThemeAdwaita::paintSliderTrack):
3324         (WebCore::RenderThemeAdwaita::adjustSliderThumbSize const):
3325         (WebCore::RenderThemeAdwaita::paintSliderThumb):
3326         (WebCore::RenderThemeAdwaita::paintMediaSliderTrack):
3327         (WebCore::RenderThemeAdwaita::paintMediaVolumeSliderTrack):
3328         (WebCore::RenderThemeAdwaita::sliderTickSize const):
3329         (WebCore::RenderThemeAdwaita::sliderTickOffsetFromTrackCenter const):
3330         (WebCore::RenderThemeAdwaita::adjustListButtonStyle const):
3331         * rendering/RenderThemeAdwaita.h: Renamed from Source/WebCore/platform/wpe/RenderThemeWPE.h.
3332         * rendering/RenderThemeGtk.cpp:
3333         (WebCore::RenderThemeGtk::updateCachedSystemFontDescription const):
3334         (WebCore::RenderThemeGtk::caretBlinkInterval const):
3335         * rendering/RenderThemeGtk.h:
3336
3337 2020-02-24  Fujii Hironori  <Hironori.Fujii@sony.com>
3338
3339         Unreviewed build fix for WinCairo port
3340         https://bugs.webkit.org/show_bug.cgi?id=208112
3341         <rdar://problem/59709701>
3342
3343         > WebCore\layout/inlineformatting/LineLayoutContext.cpp(337): error C2397: conversion from 'size_t' to 'WTF::Optional<unsigned int>' requires a narrowing conversion
3344         > WebCore\layout/inlineformatting/LineLayoutContext.cpp(361): error C2397: conversion from 'size_t' to 'WTF::Optional<unsigned int>' requires a narrowing conversion
3345
3346         * layout/inlineformatting/LineLayoutContext.cpp:
3347         (WebCore::Layout::LineLayoutContext::close): Changed the type of 'trailingInlineItemIndex' from 'auto' to 'unsigned'.
3348
3349 2020-02-23  Darin Adler  <darin@apple.com>
3350
3351         Refactor TextTrackCue to use more traditional design patterns
3352         https://bugs.webkit.org/show_bug.cgi?id=208114
3353
3354         Reviewed by Alex Christensen.
3355
3356         - Fixed is<VTTCue> to accurately match the class hierarchy. Before, TextTrackCueGeneric
3357           derived from VTTCue, but is<VTTCue> would return false. Normalizing this lets us use
3358           is<VTTCue> and downcast<VTTCue> in the conventional way.
3359         - Made the TextTrackCue::isEqual function a non-virtual function that calls a virtual
3360           function TextTrackCue::cueContentsMatch. Before there was a mix of overridding both
3361           functions in derived classes, achieving the same thing in multiple ways with
3362           unneccessary additional virtual function call overhead.
3363         - Made the TextTrackCue::toJSONString function a non-virtual function that calls a
3364           virtual funtion TextTrackCue::toJSON. Before there were two virtual functions and
3365           inconsistent patterns for which one was overridden.
3366
3367         * html/HTMLMediaElement.cpp:
3368         (WebCore::HTMLMediaElement::textTrackRemoveCue): Use downcast instead of toVTTCue.
3369
3370         * html/HTMLMediaElement.h: Removed some unneeded includes.
3371
3372         * html/shadow/MediaControlElements.cpp:
3373         (WebCore::MediaControlTextTrackContainerElement::updateDisplay): Use downcast
3374         instead of toVTTCue.
3375         (WebCore::MediaControlTextTrackContainerElement::processActiveVTTCue): Removed
3376         an assertion that no longer makes sense; guaranteed at runtime.
3377
3378         * html/shadow/MediaControls.h: Removed an unneeded include.
3379
3380         * html/track/DataCue.cpp:
3381         (WebCore::toDataCue): Deleted. No need for this function since we can use
3382         downcast<DataCue> instead.
3383         (WebCore::DataCue::cueContentsMatch const): Removed unnecessary check of cueType.
3384         The isEqual function checks cueType and only calls this function if it matches.
3385         Use downcast instead of toDataCue.
3386         (WebCore::DataCue::isEqual const): Deleted. Base class now handles this.
3387         (WebCore::DataCue::doesExtendCue const): Deleted. Was never being called.
3388         (WebCore::DataCue::toJSONString const): Deleted. Override toJSON instead.
3389         (WebCore::DataCue::toJSON const): Moved the code here that used to be in toJSONString.
3390
3391         * html/track/DataCue.h: Reduced includes. Made overridden functions private
3392         and final. Removed functions as mmentioned above. Changed WTF::LogArgument implementation
3393         to just forward to TextTrackCue instead of reimplementing here.
3394
3395         * html/track/InbandDataTextTrack.cpp:
3396         (WebCore::InbandDataTextTrack::removeCue): Use downcast instead of toDataCue.
3397
3398         * html/track/InbandGenericTextTrack.cpp: Removed an unneeded include.
3399
3400         * html/track/LoadableTextTrack.cpp:
3401         (WebCore::LoadableTextTrack::LoadableTextTrack): Removed unneeded initialization of
3402         m_isDefault, which is initialized in the class definition.
3403         (WebCore::LoadableTextTrack::newCuesAvailable): Removed unneeded call to toVTTCue,
3404         taking advantage of the better interface of getNewCues, which now returns
3405         Vector<Ref<VTTCue>>, making the type explicit.
3406
3407         * html/track/TextTrack.cpp:
3408         (WebCore::TextTrack::addCue): Use is<DataCue> instead of checking cueType.
3409
3410         * html/track/TextTrackCue.cpp:
3411         (WebCore::TextTrackCue::create): Fixed confusing naming that called the fragment the
3412         cue is contained in "cueDocument"; call it cueFragment instead. This constructor
3413         already required that the ScriptExecutionContext be a Document. Did the type cast
3414         for that up front. In the future would be good to change the argument type to Document.
3415         Also fixed how the newly-created fragment is passed to the constructor. The old code
3416         tried to use DocumentFragment&& to pass ownership, but since this is a reference-counted
3417         object it needs to be Ref<DocumentFragment>&&.
3418         (WebCore::TextTrackCue::TextTrackCue):
3419         (WebCore::TextTrackCue::scriptExecutionContext const): Moved this here from the header
3420         file so we can compile without TextTrackCue.h including Document.h.
3421         (WebCore::TextTrackCue::cueContentsMatch const): Removed the code that checks cueType.
3422         It's now isEqual that is responsible for checking that the cueType matches, and
3423         cueContentsMatch is only called when the types are the same.
3424         (WebCore::TextTrackCue::isEqual const): Reordered the boolean checks a bit so it's
3425         easier to see the logic; no need for a cascade of if statements.
3426         (WebCore::TextTrackCue::doesExtendCue const): Deleted. Was never being called.
3427         (WebCore::operator<<): Use downcast instead of toVTTCue.
3428
3429         * html/track/TextTrackCue.h: Made isEqual no longer virtual. The per-class behavior
3430         is now all in the virtual cueContentsMatch function, only called by isEqual.
3431         Removed uncalled doesExtendCue function. Added some argument names in cases where
3432         the type alone did not make their purpose clear. Made some things more private.
3433         Replaced m_scriptExecutionContext with m_document.
3434
3435         * html/track/TextTrackCueGeneric.cpp:
3436         (WebCore::TextTrackCueGeneric::create): Moved this function here from the header.
3437         (WebCore::TextTrackCueGeneric::TextTrackCueGeneric): Initialized data members in the
3438         class definition so they don't also need to be initialized here.
3439         (WebCore::TextTrackCueGeneric::cueContentsMatch const): Rewrote using && rather than
3440         castcading if statements, making the function shorter andd easier to read.
3441         (WebCore::TextTrackCueGeneric::isEqual const): Deleted. Base class now handes this.
3442         The old version had confusing logic to deal with checking cue type; can now do this
3443         in a more straightforward way.
3444         (WebCore::TextTrackCueGeneric::doesExtendCue const): Deleted. Was never called.
3445         (WebCore::TextTrackCueGeneric::isOrderedBefore const): Use is<TextTrackCueGeneric>
3446         and downcast<TextTrackCueGeneric>.
3447         (WebCore::TextTrackCueGeneric::isPositionedAbove const): Ditto. Also merged two
3448         if statements so there is less repeated logic.
3449         (WebCore::TextTrackCueGeneric::toJSONString const): Deleted.
3450         (WebCore::TextTrackCueGeneric::toJSON const): Moved code here that was in toJSONString.
3451
3452         * html/track/TextTrackCueGeneric.h: Made things more private. Changed WTF::LogArgument
3453         implementation to just forward to TextTrackCue instead of reimplementing here.
3454
3455         * html/track/TextTrackCueList.cpp:
3456         (WebCore::TextTrackCueList::create): Moved here from header.
3457         * html/track/TextTrackCueList.h: Ditto.
3458
3459         * html/track/VTTCue.cpp: Moved undefinedPosition to be a private static constexpr
3460         data member so it can be used in initialization.
3461         (WebCore::VTTCueBox::applyCSSProperties): Use is<VTTCue> and downcast<VTTCue>.
3462         (WebCore::VTTCue::create): Moved more overloads of this function here from the
3463         header file.
3464         (WebCore::VTTCue::VTTCue): Take Document instead of ScriptExecutionContext.
3465         Also took the ScriptExecutionContext argument away from the initialize function.
3466         (WebCore::VTTCue::initialize): Do less initialization here. This function is
3467         only called in constructors, so it doesn't need to initialize anything that
3468         is initialized in all constructors or initialized in the class definition.
3469         What remains are things that require a little code to initialize and the
3470         bitfields, which can't be initialized in the class definition.
3471         (WebCore::VTTCue::setPosition): Rearranged the code a tiny bit.
3472         (WebCore::copyWebVTTNodeToDOMTree): Made this a non-member function. Also changed
3473         the argument types to use references.
3474         (WebCore::VTTCue::getCueAsHTML): Updated for changes to copyWebVTTNodeToDOMTree.
3475         (WebCore::VTTCue::removeDisplayTree): Check m_displayTree directly instead
3476         of calling a hasDisplayTree function, since that's more a more straightforward
3477         way to guard a subsequent line of code that then uses m_displayTree.
3478         (WebCore::VTTCue::setCueSettings): Merged two if statements into one.
3479         (WebCore::VTTCue::cueContentsMatch const): Rewrote using && rather than
3480         castcading if statements, making the function shorter andd easier to read.
3481         (WebCore::VTTCue::isEqual const): Deleted. Base class now handles this.
3482         (WebCore::VTTCue::doesExtendCue const): Deleted. Was never called.
3483         (WebCore::toVTTCue): Deleted.
3484         (WebCore::VTTCue::toJSONString const): Deleted. Base class now handles this.
3485         (WebCore::VTTCue::toJSON const): Added a comment.
3486
3487         * html/track/VTTCue.h: Moved create functions out of header, made some things
3488         more private and final, initialized more data members in the class definition.
3489         Removed toVTTCue. Changed WTF::LogArgument implementation to just forward to
3490         TextTrackCue instead of reimplementing here. Corrected the isType function so
3491         it knows about both cue types that result in a VTTCue object. This allows us
3492         to use is<VTTCue> and downcast<VTTCue> in the normal way. Removed the FIXME
3493         saying we should do that.
3494
3495         * loader/TextTrackLoader.cpp:
3496         (WebCore::TextTrackLoader::getNewCues): Changed to return a Vector<Ref<VTTCue>>.
3497         In modern C++ return value is better than an out argument for a function like
3498         this, and the more-specific type helps us at the call sites.
3499
3500         * loader/TextTrackLoader.h: Updated for the above.
3501
3502         * page/CaptionUserPreferencesMediaAF.cpp: Removed unneeded include.
3503
3504         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
3505         Use #pragma once and removed some unneded includes and forward declarations.
3506
3507         * rendering/RenderVTTCue.cpp:
3508         (WebCore::RenderVTTCue::RenderVTTCue): Use downcast<VTTCue>.
3509         (WebCore::RenderVTTCue::layout): Removed unneeded call to toVTTCue.
3510         (WebCore::RenderVTTCue::repositionGenericCue): Use downcast instead of
3511         static_cast for TextTrackCueGeneric.
3512
3513         * style/RuleSet.cpp: Removed unneeded include.
3514
3515 2020-02-24  Chris Fleizach  <cfleizach@apple.com>
3516
3517         AX: Support relative frames for isolated trees correctly
3518         https://bugs.webkit.org/show_bug.cgi?id=208169
3519         <rdar://problem/59746529>
3520
3521         Reviewed by Zalan Bujtas.
3522
3523         To support relative frames correctly for accessibility, we should:
3524           1) Only expose for isolated tree clients.
3525           2) Support FloatRects in the attribute variants.
3526           
3527         This patch also fixes an issue where we weren't reserving capacity before using.
3528
3529         * accessibility/isolatedtree/AXIsolatedObject.cpp:
3530         (WebCore::AXIsolatedObject::setObjectVectorProperty):
3531         * accessibility/isolatedtree/AXIsolatedObject.h:
3532         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3533         (-[WebAccessibilityObjectWrapper additionalAccessibilityAttributeNames]):
3534         (-[WebAccessibilityObjectWrapper ALLOW_DEPRECATED_IMPLEMENTATIONS_END]):
3535
3536 2020-02-24  ChangSeok Oh  <changseok@webkit.org>
3537
3538         PS-2019-006: [GTK] WebKit - AXObjectCache - m_deferredFocusedNodeChange - UaF
3539         https://bugs.webkit.org/show_bug.cgi?id=204342
3540
3541         Reviewed by Carlos Garcia Campos.
3542
3543         m_deferredFocusedNodeChange keeps pairs of a old node and a new one
3544         to update a focused node later. When a node is removed in the document,
3545         it is also removed from the pair vector. The problem is only comparing
3546         the new node in each pair with a removed node decides the removal.
3547         In the case where the removed node lives in m_deferredFocusedNodeChange
3548         as an old node, a crash happens while we get a renderer of the removed node
3549         to handle focused elements. To fix this, we find all entries of which old node
3550         is matched to the removed node, and set their first value null.
3551
3552         No new tests since no functionality changed.
3553
3554         * accessibility/AXObjectCache.cpp:
3555         (WebCore::AXObjectCache::remove):
3556
3557 2020-02-24  Zalan Bujtas  <zalan@apple.com>
3558
3559         [LFC][IFC][Floats] Fix float boxes embedded to unbreakable inline runs.
3560         https://bugs.webkit.org/show_bug.cgi?id=208112
3561         <rdar://problem/59709701>
3562
3563         Reviewed by Antti Koivisto.
3564
3565         This patch fixes the cases when the float is embedded to otherwise unbreakable inline content.
3566         e.g. "text_<div style="float: left"></div>_content"
3567
3568         The logic goes like this:
3569         1. collect the floats inside the unbreakable candidate content
3570         2. mark them intrusive if they potentially influence the current line
3571         3. at handleFloatsAndInlineContent(), adjust available width with the intrusive floats first
3572         4. feed the inline content to the LineBreaker
3573         6. commit the float content based on the line breaking result (commit none, partially, all).
3574         (Note that this algorithm produces a different layout compared to WebKit trunk. It mostly matches FireFox though.)
3575
3576         * layout/inlineformatting/InlineFormattingContext.cpp:
3577         (WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthForConstraint const):
3578         (WebCore::Layout::InlineFormattingContext::setDisplayBoxesForLine):
3579         * layout/inlineformatting/InlineLineBuilder.cpp:
3580         (WebCore::Layout::LineBuilder::moveLogicalLeft):
3581         (WebCore::Layout::LineBuilder::moveLogicalRight):
3582         * layout/inlineformatting/LineLayoutContext.cpp:
3583         (WebCore::Layout::isAtSoftWrapOpportunity):
3584         (WebCore::Layout::nextWrapOpportunity):
3585         (WebCore::Layout::LineCandidate::FloatContent::append):
3586         (WebCore::Layout::LineLayoutContext::layoutLine):
3587         (WebCore::Layout::LineLayoutContext::close):
3588         (WebCore::Layout::LineLayoutContext::nextContentForLine):
3589         (WebCore::Layout::LineLayoutContext::addIntrusiveFloats):
3590         (WebCore::Layout::LineLayoutContext::revertIntrusiveFloats):
3591         (WebCore::Layout::LineLayoutContext::handleFloatsAndInlineContent):
3592         (WebCore::Layout::isLineConsideredEmpty): Deleted.
3593         (WebCore::Layout::LineLayoutContext::tryAddingFloatContent): Deleted.
3594         (WebCore::Layout::LineLayoutContext::tryAddingInlineItems): Deleted.
3595         * layout/inlineformatting/LineLayoutContext.h:
3596
3597 2020-02-24  Nikos Mouchtaris  <nmouchtaris@apple.com>
3598
3599         Add canShare function for Web Share API v2
3600         https://bugs.webkit.org/show_bug.cgi?id=207491
3601
3602         Reviewed by Tim Horton.
3603
3604         Added files member to share data and canShare function to
3605         navigator.cpp. Can share function should always be used 
3606         before call to share, and can be used to check if file 
3607         sharing is implemented by passing a share data object with
3608         only files.
3609
3610         Imported new Web Platform Tests to test new function.
3611
3612         * page/Navigator.cpp:
3613         (WebCore::Navigator::canShare): Will currently return false for 
3614         only file share data objects, since file sharing is currently 
3615         not implemented.
3616         (WebCore::Navigator::share): Changed to use canShare to 
3617         determine if data is shareable.
3618         * page/Navigator.h:
3619         * page/NavigatorShare.idl:
3620         * page/ShareData.h:
3621         * page/ShareData.idl:
3622
3623 2020-02-24  Yusuke Suzuki  <ysuzuki@apple.com>
3624
3625         [WTF] Attach WARN_UNUSED_RETURN to makeScopeExit and fix existing wrong usage
3626         https://bugs.webkit.org/show_bug.cgi?id=208162
3627
3628         Reviewed by Robin Morisset.
3629
3630         * html/HTMLLinkElement.cpp:
3631         (WebCore::HTMLLinkElement::process):
3632
3633 2020-02-24  Jiewen Tan  <jiewen_tan@apple.com>
3634
3635         [WebAuthn] Implement SPI for the platform authenticator
3636         https://bugs.webkit.org/show_bug.cgi?id=208087
3637         <rdar://problem/59369305>
3638
3639         Reviewed by Brent Fulgham.
3640
3641         Enhances AuthenticatorAssertionResponse to accommondate responses
3642         returned from the platform authenticator.
3643
3644         Covered by API tests.
3645
3646         * Modules/webauthn/AuthenticatorAssertionResponse.cpp:
3647         (WebCore::AuthenticatorAssertionResponse::create):
3648         (WebCore::AuthenticatorAssertionResponse::setAuthenticatorData):
3649         (WebCore::AuthenticatorAssertionResponse::AuthenticatorAssertionResponse):
3650         * Modules/webauthn/AuthenticatorAssertionResponse.h:
3651         (WebCore::AuthenticatorAssertionResponse::authenticatorData const):
3652         (WebCore::AuthenticatorAssertionResponse::signature const):
3653         (WebCore::AuthenticatorAssertionResponse::name const):
3654         (WebCore::AuthenticatorAssertionResponse::displayName const):
3655         (WebCore::AuthenticatorAssertionResponse::numberOfCredentials const):
3656         (WebCore::AuthenticatorAssertionResponse::accessControl const):
3657         (WebCore::AuthenticatorAssertionResponse::setSignature):
3658         (WebCore::AuthenticatorAssertionResponse::setName):
3659         (WebCore::AuthenticatorAssertionResponse::setDisplayName):
3660         (WebCore::AuthenticatorAssertionResponse::setNumberOfCredentials):
3661
3662 2020-02-24  Simon Fraser  <simon.fraser@apple.com>
3663
3664         Rename the clashing WebOverlayLayer classes
3665         https://bugs.webkit.org/show_bug.cgi?id=208156
3666         rdar://problem/59739250
3667
3668         Reviewed by Tim Horton.
3669
3670         The name WebOverlayLayer was used in two places. Rename them both to more specific names.
3671
3672         * page/cocoa/ResourceUsageOverlayCocoa.mm:
3673         (-[WebResourceUsageOverlayLayer initWithResourceUsageOverlay:]):
3674         (WebCore::ResourceUsageOverlay::platformInitialize):
3675         (-[WebOverlayLayer initWithResourceUsageOverlay:]): Deleted.
3676         (-[WebOverlayLayer drawInContext:]): Deleted.
3677
3678 2020-02-24  Andres Gonzalez  <andresg_22@apple.com>
3679
3680         [WebAccessibilityObjectWrapper updateObjectBackingStore] should return the backing object.
3681         https://bugs.webkit.org/show_bug.cgi?id=208153
3682
3683         Reviewed by Chris Fleizach.
3684
3685         Covered by existing tests.
3686
3687         Currently in many WebAccessibilityObjectWrapper's methods we call
3688         updateObjectBackingStore followed by one or more calls to
3689         axBackingObject. This patch eliminates this unnecessary call by making
3690         updateObjectBackingStore return the backing object. It also cleans up
3691         other unnecessary calls to axBackingObject and does some minor code
3692         cleanup.
3693
3694         * accessibility/mac/WebAccessibilityObjectWrapperBase.h:
3695         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
3696         (-[WebAccessibilityObjectWrapperBase updateObjectBackingStore]):
3697         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3698         (-[WebAccessibilityObjectWrapper ALLOW_DEPRECATED_IMPLEMENTATIONS_END]):
3699         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
3700         (-[WebAccessibilityObjectWrapper accessibilityFocusedUIElement]):
3701         (-[WebAccessibilityObjectWrapper accessibilityHitTest:]):
3702         (-[WebAccessibilityObjectWrapper accessibilityIsAttributeSettable:]):
3703         (-[WebAccessibilityObjectWrapper _accessibilityPerformPressAction]):
3704         (-[WebAccessibilityObjectWrapper _accessibilityPerformIncrementAction]):
3705         (-[WebAccessibilityObjectWrapper _accessibilityPerformDecrementAction]):
3706         (-[WebAccessibilityObjectWrapper accessibilityPerformAction:]):
3707         (-[WebAccessibilityObjectWrapper accessibilityReplaceRange:withText:]):
3708         (-[WebAccessibilityObjectWrapper accessibilityInsertText:]):
3709         (-[WebAccessibilityObjectWrapper _accessibilitySetValue:forAttribute:]):
3710         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
3711         (-[WebAccessibilityObjectWrapper accessibilityIndexOfChild:]):
3712         (-[WebAccessibilityObjectWrapper accessibilityArrayAttributeCount:]):
3713         (-[WebAccessibilityObjectWrapper accessibilityArrayAttributeValues:index:maxCount:]):
3714
3715 2020-02-24  Zalan Bujtas  <zalan@apple.com>
3716
3717         [LFC][IFC][Floats] Fix float box handling inside unbreakable content
3718         https://bugs.webkit.org/show_bug.cgi?id=208109
3719         <rdar://problem/59708646>
3720
3721         Reviewed by Antti Koivisto.
3722
3723         We've been handling float boxes and other inline items as mutually exclusive content (in the context of unbreakable candidate runs).
3724         While this works in most cases, when the unbreakable content includes float boxes, the layout
3725         ends up being incorrect.
3726         This patch is in preparation for making sure we process the inline content and the associated float boxes as one entity.
3727         (e.g "text_<div style="float: left"></div>_content" produces an unbreakable inline content of [text_][_content] and an associated float box)
3728
3729         * layout/inlineformatting/LineLayoutContext.cpp:
3730         (WebCore::Layout::isAtSoftWrapOpportunity):
3731         (WebCore::Layout::LineCandidate::FloatContent::append):
3732         (WebCore::Layout::LineCandidate::FloatContent::list const):
3733         (WebCore::Layout::LineCandidate::FloatContent::reset):
3734         (WebCore::Layout::LineCandidate::reset):
3735         (WebCore::Layout::LineLayoutContext::layoutLine):
3736         (WebCore::Layout::LineLayoutContext::nextContentForLine):
3737         (WebCore::Layout::LineLayoutContext::tryAddingFloatContent):
3738         (WebCore::Layout::LineLayoutContext::tryAddingFloatItem): Deleted.
3739         * layout/inlineformatting/LineLayoutContext.h:
3740
3741 2020-02-24  Chris Dumez  <cdumez@apple.com>
3742
3743         Document / DOMWindow objects get leaked on CNN.com due to CSSTransitions
3744         https://bugs.webkit.org/show_bug.cgi?id=208145
3745
3746         Reviewed by Antoine Quint.
3747
3748         Break reference cycles using WeakPtr so that CSSTransitions can no longer cause whole document / DOM trees to
3749         get leaked.
3750
3751         * animation/DocumentTimeline.cpp:
3752         (WebCore::DocumentTimeline::DocumentTimeline):
3753         * animation/DocumentTimeline.h:
3754         * animation/KeyframeEffect.cpp:
3755         (WebCore::KeyframeEffect::KeyframeEffect):
3756         (WebCore::KeyframeEffect::setTarget):
3757         * animation/KeyframeEffect.h:
3758
3759 2020-02-24  Youenn Fablet  <youenn@apple.com>
3760
3761         Add a runtime flag dedicated to WebRTC codecs in GPUProcess
3762         https://bugs.webkit.org/show_bug.cgi?id=208136
3763
3764         Reviewed by Alex Christensen.
3765
3766         Add a runtime flag for WebRTC codecs in GPUProcess.
3767         Enable the flag by default for MacOS.
3768
3769         * page/RuntimeEnabledFeatures.h:
3770         (WebCore::RuntimeEnabledFeatures::webRTCPlatformCodecsInGPUProcessEnabled const):
3771         (WebCore::RuntimeEnabledFeatures::setWebRTCPlatformCodecsInGPUProcessEnabled):
3772         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
3773         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
3774         * testing/Internals.cpp:
3775         (WebCore::Internals::resetToConsistentState):
3776         (WebCore::Internals::setUseGPUProcessForWebRTC):
3777
3778 2020-02-24  Simon Fraser  <simon.fraser@apple.com>
3779
3780         Remove geometry information from the scrolling tree
3781         https://bugs.webkit.org/show_bug.cgi?id=208085
3782
3783         Reviewed by Sam Weinig.
3784
3785         The scrolling tree doesn't have enough information to do hit-testing because it has
3786         no representation of layers that overlap scrollers. We'll have to do hit-testing another
3787         way, so remove hit-testing-geometry data from the scrolling tree.
3788
3789         * page/scrolling/AsyncScrollingCoordinator.cpp:
3790         (WebCore::AsyncScrollingCoordinator::setRectRelativeToParentNode): Deleted.
3791         * page/scrolling/AsyncScrollingCoordinator.h:
3792         * page/scrolling/ScrollingCoordinator.h:
3793         (WebCore::ScrollingCoordinator::setRectRelativeToParentNode): Deleted.
3794         * page/scrolling/ScrollingStateFrameHostingNode.cpp:
3795         (WebCore::ScrollingStateFrameHostingNode::ScrollingStateFrameHostingNode):
3796         (WebCore::ScrollingStateFrameHostingNode::dumpProperties const):
3797         (WebCore::ScrollingStateFrameHostingNode::setPropertyChangedBitsAfterReattach): Deleted.
3798         (WebCore::ScrollingStateFrameHostingNode::setParentRelativeScrollableRect): Deleted.
3799         * page/scrolling/ScrollingStateFrameHostingNode.h:
3800         * page/scrolling/ScrollingStateScrollingNode.cpp:
3801         (WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode):
3802         (WebCore::ScrollingStateScrollingNode::setPropertyChangedBitsAfterReattach):
3803         (WebCore::ScrollingStateScrollingNode::dumpProperties const):
3804         (WebCore::ScrollingStateScrollingNode::setParentRelativeScrollableRect): Deleted.
3805         * page/scrolling/ScrollingStateScrollingNode.h:
3806         (WebCore::ScrollingStateScrollingNode::parentRelativeScrollableRect const): Deleted.
3807         * page/scrolling/ScrollingTree.cpp:
3808         (WebCore::ScrollingTree::handleWheelEvent):
3809         (WebCore::ScrollingTree::scrollingNodeForPoint):
3810         * page/scrolling/ScrollingTree.h:
3811         * page/scrolling/ScrollingTreeFrameHostingNode.cpp:
3812         (WebCore::ScrollingTreeFrameHostingNode::commitStateBeforeChildren):
3813         (WebCore::ScrollingTreeFrameHostingNode::dumpProperties const):
3814         (WebCore::ScrollingTreeFrameHostingNode::parentToLocalPoint const): Deleted.
3815         * page/scrolling/ScrollingTreeFrameHostingNode.h:
3816         (WebCore::ScrollingTreeFrameHostingNode::parentRelativeScrollableRect const): Deleted.
3817         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
3818         (WebCore::ScrollingTreeFrameScrollingNode::parentToLocalPoint const): Deleted.
3819         (WebCore::ScrollingTreeFrameScrollingNode::localToContentsPoint const): Deleted.
3820         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
3821         * page/scrolling/ScrollingTreeNode.cpp:
3822         (WebCore::ScrollingTreeNode::ScrollingTreeNode):
3823         (WebCore::ScrollingTreeNode::scrollingNodeForPoint const): Deleted.
3824         * page/scrolling/ScrollingTreeNode.h:
3825         (WebCore::ScrollingTreeNode::parentToLocalPoint const): Deleted.
3826         (WebCore::ScrollingTreeNode::localToContentsPoint const): Deleted.
3827         * page/scrolling/ScrollingTreeScrollingNode.cpp:
3828         (WebCore::ScrollingTreeScrollingNode::commitStateBeforeChildren):
3829         (WebCore::ScrollingTreeScrollingNode::dumpProperties const):
3830         (WebCore::ScrollingTreeScrollingNode::parentToLocalPoint const): Deleted.
3831         (WebCore::ScrollingTreeScrollingNode::localToContentsPoint const): Deleted.
3832         (WebCore::ScrollingTreeScrollingNode::scrollingNodeForPoint const): Deleted.
3833         * page/scrolling/ScrollingTreeScrollingNode.h:
3834         * rendering/RenderLayerCompositor.cpp:
3835         (WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingRole):
3836         (WebCore::RenderLayerCompositor::updateScrollingNodeForFrameHostingRole):
3837         (WebCore::RenderLayerCompositor::rootParentRelativeScrollableRect const): Deleted.
3838         * rendering/RenderLayerCompositor.h:
3839
3840 2020-02-24  Alex Christensen  <achristensen@webkit.org>
3841
3842         WKWebViewConfiguration._corsDisablingPatterns should also disable CORS for non-DocumentThreadableLoader loading
3843         https://bugs.webkit.org/show_bug.cgi?id=208035
3844         <rdar://problem/58011337>
3845
3846         Reviewed by Tim Hatcher.
3847
3848         Covered by an API test.
3849
3850         * loader/CrossOriginAccessControl.cpp:
3851         (WebCore::createPotentialAccessControlRequest):
3852
3853 2020-02-24  Zalan Bujtas  <zalan@apple.com>
3854
3855         [LFC][IFC] Remove redundant trailing line break handling.
3856         https://bugs.webkit.org/show_bug.cgi?id=208108
3857         <rdar://problem/59708620>
3858
3859         Reviewed by Antti Koivisto.
3860
3861         LineLayoutContext::layoutLine should be able to handle both cases of trailing line breaks.
3862         (This patch also makes tryAddingInlineItems return explicit IsEndOfLine values.)
3863
3864         * layout/inlineformatting/LineLayoutContext.cpp:
3865         (WebCore::Layout::LineLayoutContext::layoutLine):
3866         (WebCore::Layout::LineLayoutContext::tryAddingInlineItems):
3867
3868 2020-02-24  Zalan Bujtas  <zalan@apple.com>
3869
3870         [LFC][IFC][Floats] Move float handling out of LineBreaker
3871         https://bugs.webkit.org/show_bug.cgi?id=208107
3872         <rdar://problem/59708575>
3873
3874         Reviewed by Antti Koivisto.
3875
3876         LineBreaker should only deal with inline content.
3877
3878         * layout/inlineformatting/InlineLineBreaker.cpp:
3879         (WebCore::Layout::LineBreaker::shouldWrapFloatBox): Deleted.
3880         * layout/inlineformatting/InlineLineBreaker.h:
3881         * layout/inlineformatting/LineLayoutContext.cpp:
3882         (WebCore::Layout::LineLayoutContext::tryAddingFloatItem):
3883
3884 2020-02-24  Antoine Quint  <graouts@webkit.org>
3885
3886         RenderLayerBacking::notifyAnimationStarted calls directly into the old animation controller
3887         https://bugs.webkit.org/show_bug.cgi?id=207979
3888
3889         Reviewed by Simon Fraser.
3890
3891         Only call into CSSAnimationController if the "Web Animations for CSS Animations" flag is disabled.
3892
3893         * rendering/RenderLayerBacking.cpp:
3894         (WebCore::RenderLayerBacking::notifyAnimationStarted):
3895
3896 2020-02-24  Rob Buis  <rbuis@igalia.com>
3897
3898         Handle page closure for stale-while-revalidate revalidations
3899         https://bugs.webkit.org/show_bug.cgi?id=204147
3900
3901         Reviewed by Youenn Fablet.
3902
3903         Add a new hook to LoaderStrategy to signal browsing context removal
3904         and call it when the main frame stops all loaders.
3905
3906         Test: imported/w3c/web-platform-tests/fetch/stale-while-revalidate/frame-removal.html
3907
3908         * loader/FrameLoader.cpp:
3909         (WebCore::FrameLoader::stopAllLoaders):
3910         * loader/LoaderStrategy.h:
3911         * loader/cache/CachedResource.cpp:
3912         (WebCore::CachedResource::canUseCacheValidator const):
3913
3914 2020-02-24  Andres Gonzalez  <andresg_22@apple.com>
3915
3916         Fix for build: follow up to bug 208074.
3917         https://bugs.webkit.org/show_bug.cgi?id=208133
3918
3919         Unreviewed build fix.
3920
3921         No new tests needed.
3922
3923         * accessibility/isolatedtree/AXIsolatedObject.cpp:
3924         (WebCore::AXIsolatedObject::cellForColumnAndRow):
3925
3926 2020-02-24  Philippe Normand  <pnormand@igalia.com>
3927
3928         [GStreamer][WPE] Add GstGLMemoryEGL support for the video-plane-display
3929         https://bugs.webkit.org/show_bug.cgi?id=208046
3930
3931         Reviewed by Žan Doberšek.
3932
3933         The glupload element might fill EGL memories in some cases, so for
3934         the video sink we can then directly access the corresponding
3935         EGLImage and export it to DMABuf, instead of using the more
3936         general GLMemory code path.
3937
3938         With this patch we also ensure that both DMABuf FD and stride are valid.
3939
3940         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3941         (WebCore::GstVideoFrameHolder::GstVideoFrameHolder):
3942         (WebCore::GstVideoFrameHolder::handoffVideoDmaBuf):
3943
3944 2020-02-23  Andres Gonzalez  <andresg_22@apple.com>
3945
3946         AXIsolatedObject support for tables.
3947         https://bugs.webkit.org/show_bug.cgi?id=208074
3948
3949         Reviewed by Chris Fleizach.
3950
3951         Covered by existing tests.
3952
3953         AccessibilityObjectWrapper code and some utility functions in
3954         AccessibilityObject.cpp assume that AX objects can be downcast to a
3955         specialized subclass like AccessibilityTable. That is not true for
3956         AXIsolatedObjects, and the reason why tables don’t work in IsolatedTree
3957         mode.
3958
3959         To solve this problem, this patch exposes the AccessibilityTable
3960         interface as part of