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