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