d4c6f713a6f409cbf1f603e4d74fc5e3095d8a2a
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2020-02-27  Don Olmstead  <don.olmstead@sony.com>
2
3         [CMake] Add WebKit::PAL target
4         https://bugs.webkit.org/show_bug.cgi?id=198493
5
6         Reviewed by Michael Catanzaro.
7
8         Use WebKit::PAL target.
9
10         * CMakeLists.txt:
11
12 2020-02-27  Peng Liu  <peng.liu6@apple.com>
13
14         MediaResourceLoader objects are leaking on reddit.com
15         https://bugs.webkit.org/show_bug.cgi?id=208273
16
17         Reviewed by Jer Noble.
18
19         We retain the WebCoreNSURLSession delegate. There will be a retain cycle
20         if that delegate retains the session. This patch fixes the retain cycle problem
21         by referencing the delegate with a weak pointer.
22
23         Manually tested.
24
25         * platform/network/cocoa/WebCoreNSURLSession.h:
26         * platform/network/cocoa/WebCoreNSURLSession.mm:
27         (-[WebCoreNSURLSession delegate]):
28
29 2020-02-27  Rob Buis  <rbuis@igalia.com>
30
31         Add referrerpolicy attribute support for images
32         https://bugs.webkit.org/show_bug.cgi?id=207901
33
34         Reviewed by Darin Adler.
35
36         This patch adds 'referrerpolicy' attribute support for img elements.
37         If set, the value is restricted to the ReferrerPolicy enum, and
38         if valid it is used for the script fetch.
39         If not set or invalid, the current behavior is kept.
40
41         Tests: http/tests/referrer-policy-img/no-referrer-when-downgrade/cross-origin-http-http.html
42                http/tests/referrer-policy-img/no-referrer-when-downgrade/cross-origin-http.https.html
43                http/tests/referrer-policy-img/no-referrer-when-downgrade/same-origin.html
44                http/tests/referrer-policy-img/no-referrer/cross-origin-http-http.html
45                http/tests/referrer-policy-img/no-referrer/cross-origin-http.https.html
46                http/tests/referrer-policy-img/no-referrer/same-origin.html
47                http/tests/referrer-policy-img/origin-when-cross-origin/cross-origin-http-http.html
48                http/tests/referrer-policy-img/origin-when-cross-origin/cross-origin-http.https.html
49                http/tests/referrer-policy-img/origin-when-cross-origin/same-origin.html
50                http/tests/referrer-policy-img/origin/cross-origin-http-http.html
51                http/tests/referrer-policy-img/origin/cross-origin-http.https.html
52                http/tests/referrer-policy-img/origin/same-origin.html
53                http/tests/referrer-policy-img/same-origin/cross-origin-http-http.html
54                http/tests/referrer-policy-img/same-origin/cross-origin-http.https.html
55                http/tests/referrer-policy-img/same-origin/same-origin.html
56                http/tests/referrer-policy-img/strict-origin-when-cross-origin/cross-origin-http-http.html
57                http/tests/referrer-policy-img/strict-origin-when-cross-origin/cross-origin-http.https.html
58                http/tests/referrer-policy-img/strict-origin-when-cross-origin/same-origin.html
59                http/tests/referrer-policy-img/strict-origin/cross-origin-http-http.html
60                http/tests/referrer-policy-img/strict-origin/cross-origin-http.https.html
61                http/tests/referrer-policy-img/strict-origin/same-origin.html
62                http/tests/referrer-policy-img/unsafe-url/cross-origin-http-http.html
63                http/tests/referrer-policy-img/unsafe-url/cross-origin-http.https.html
64                http/tests/referrer-policy-img/unsafe-url/same-origin.html
65
66         * html/HTMLImageElement.cpp:
67         (WebCore::HTMLImageElement::setReferrerPolicyForBindings):
68         (WebCore::HTMLImageElement::referrerPolicyForBindings const):
69         (WebCore::HTMLImageElement::referrerPolicy const):
70         * html/HTMLImageElement.h:
71         * html/HTMLImageElement.idl:
72         * loader/ImageLoader.cpp:
73         (WebCore::ImageLoader::updateFromElement):
74
75 2020-02-27  Daniel Bates  <dabates@apple.com>
76
77         Cleanup HitTestResult.{h, cpp}
78         https://bugs.webkit.org/show_bug.cgi?id=208269
79         <rdar://problem/59824186>
80
81         Reviewed by Alex Christensen.
82
83         Use modern C++ features to remove duplicate code.
84
85         * rendering/HitTestLocation.cpp:
86         (WebCore::HitTestLocation::HitTestLocation):
87         * rendering/HitTestLocation.h:
88         * rendering/HitTestResult.cpp: Remove unnecessary #includes.
89         * rendering/HitTestResult.h: Remove unnecessary #includes. 
90         (WebCore::HitTestResult::setIsOverWidget):
91
92 2020-02-27  Zalan Bujtas  <zalan@apple.com>
93
94         Unreviewed build fix for non-unified builds after r257507.
95
96         * layout/blockformatting/BlockFormattingContext.h:
97         * layout/blockformatting/BlockMarginCollapse.cpp:
98         (WebCore::Layout::BlockFormattingContext::MarginCollapse::computedPositiveAndNegativeMargin const):
99         (WebCore::Layout::BlockFormattingContext::MarginCollapse::updateMarginAfterForPreviousSibling):
100         (WebCore::Layout::computedPositiveAndNegativeMargin): Deleted.
101
102 2020-02-27  Antti Koivisto  <antti@apple.com>
103
104         Load async scripts with low priority
105         https://bugs.webkit.org/show_bug.cgi?id=208298
106
107         Reviewed by Anders Carlsson.
108
109         They are assumed to be non-critical and don't delay DOMContentLoaded.
110
111         This matches other browsers. See https://addyosmani.com/blog/script-priorities/ for Chrome behavior.
112
113         * bindings/js/CachedScriptFetcher.cpp:
114         (WebCore::CachedScriptFetcher::requestModuleScript const):
115         (WebCore::CachedScriptFetcher::requestScriptWithCache const)
116
117         Pass around the priority.
118
119         * bindings/js/CachedScriptFetcher.h:
120         * dom/LoadableClassicScript.cpp:
121         (WebCore::LoadableClassicScript::create):
122         (WebCore::LoadableClassicScript::load):
123
124         Deprioritize async script load.
125
126         * dom/LoadableClassicScript.h:
127         * dom/ScriptElement.cpp:
128         (WebCore::ScriptElement::requestClassicScript):
129
130         Pass around the information that this is an async script.
131
132         * dom/ScriptElementCachedScriptFetcher.cpp:
133         (WebCore::ScriptElementCachedScriptFetcher::requestModuleScript const):
134         * html/parser/HTMLPreloadScanner.cpp:
135         (WebCore::TokenPreloadScanner::StartTagScanner::createPreloadRequest):
136         (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):
137
138         Parse async attribute in preload scanner.
139
140         * html/parser/HTMLResourcePreloader.cpp:
141         (WebCore::PreloadRequest::resourceRequest):
142
143         Deprioritize async script preload.
144
145         * html/parser/HTMLResourcePreloader.h:
146         (WebCore::PreloadRequest::setScriptIsAsync):
147
148 2020-02-26  Ryosuke Niwa  <rniwa@webkit.org>
149
150         Create AudioDestination in the GPU process
151         https://bugs.webkit.org/show_bug.cgi?id=208179
152
153         Reviewed by Jer Noble.
154
155         Add an abstraction around the creation of AudioDestination using newly introduced mediaStrategy.
156
157         * Headers.cmake:
158         * Modules/webaudio/DefaultAudioDestinationNode.cpp:
159         (WebCore::DefaultAudioDestinationNode::createDestination): Use MediaStrategy::createAudioDestination
160         * WebCore.xcodeproj/project.pbxproj:
161         * platform/MediaStrategy.h: Added.
162         (WebCore::MediaStrategy): Added.
163         * platform/PlatformStrategies.h:
164         (WebCore::PlatformStrategies::mediaStrategy): Added.
165         * platform/audio/AudioBus.h:
166         * platform/audio/AudioDestination.h:
167
168 2020-02-26  Myles C. Maxfield  <mmaxfield@apple.com>
169
170         [iPadOS] REGRESSION(r247667): Autosizing style changes don't invalidate RenderText's preferred logical widths
171         https://bugs.webkit.org/show_bug.cgi?id=208084
172         <rdar://problem/59463898>
173
174         Reviewed by Darin Adler.
175
176         Just use RenderElement::setStyle(), which handles all the invalidations, instead of RenderElement::setNeedsLayout().
177
178         Do a little refactoring so we don't clone RenderStyles unless we need to.
179
180         Test: fast/text-autosizing/ios/idempotentmode/viewport-change-relayout.html
181
182         * page/Page.cpp:
183         (WebCore::Page::recomputeTextAutoSizingInAllFrames):
184         * rendering/style/RenderStyle.cpp:
185         (WebCore::RenderStyle::isIdempotentTextAutosizingCandidate const):
186         * rendering/style/RenderStyle.h:
187         * rendering/style/TextSizeAdjustment.cpp:
188         (WebCore::AutosizeStatus::computeStatus):
189         (WebCore::AutosizeStatus::updateStatus):
190         * rendering/style/TextSizeAdjustment.h:
191         (WebCore::AutosizeStatus::operator== const):
192         (WebCore::AutosizeStatus::operator!= const):
193         * style/StyleAdjuster.cpp:
194         (WebCore::Style::Adjuster::adjustmentForTextAutosizing):
195         (WebCore::Style::Adjuster::adjustForTextAutosizing):
196         * style/StyleAdjuster.h:
197         (WebCore::Style::Adjuster::AdjustmentForTextAutosizing::operator bool const):
198
199 2020-02-26  Zalan Bujtas  <zalan@apple.com>
200
201         REGRESSION (r257507): [ macOS ] ASSERTION FAILED: blockFormattingState.hasPositiveAndNegativeVerticalMargin(layoutBox)
202         https://bugs.webkit.org/show_bug.cgi?id=208278
203         <rdar://problem/59828533>
204
205         Fix mismatching call after r257507.
206
207         * layout/blockformatting/PrecomputedBlockMarginCollapse.cpp:
208         (WebCore::Layout::BlockFormattingContext::MarginCollapse::precomputedPositiveNegativeValues const):
209
210 2020-02-26  Andres Gonzalez  <andresg_22@apple.com>
211
212         AXIsolatedObject support for table cells.
213         https://bugs.webkit.org/show_bug.cgi?id=208263
214
215         Reviewed by Chris Fleizach.
216
217         Covered by existing tests.
218
219         - Exposed the AccessibilityTableCell interface through AXCoreObject.
220         - This way there is no need to downcast in client code and the same
221         platform wrapper code works for AccessibilityObjects and
222         AXIsolatedObjects.
223         - Completed caching of table cell properties in AXIsolatedObject.
224
225         * accessibility/AccessibilityARIAGridCell.cpp:
226         (WebCore::AccessibilityARIAGridCell::rowIndexRange const):
227         (WebCore::AccessibilityARIAGridCell::axRowSpanWithRowIndex const):
228         (WebCore::AccessibilityARIAGridCell::columnIndexRange const):
229         * accessibility/AccessibilityARIAGridCell.h:
230         * accessibility/AccessibilityObject.h:
231         * accessibility/AccessibilityObjectInterface.h:
232         * accessibility/AccessibilityTable.cpp:
233         (WebCore::AccessibilityTable::cellForColumnAndRow):
234         * accessibility/AccessibilityTableCell.cpp:
235         (WebCore::AccessibilityTableCell::isColumnHeaderCell const):
236         (WebCore::AccessibilityTableCell::isRowHeaderCell const):
237         (WebCore::AccessibilityTableCell::isTableCellInSameColGroup):
238         (WebCore::AccessibilityTableCell::columnHeaders):
239         (WebCore::AccessibilityTableCell::rowHeaders):
240         (WebCore::AccessibilityTableCell::rowIndexRange const):
241         (WebCore::AccessibilityTableCell::columnIndexRange const):
242         * accessibility/AccessibilityTableCell.h:
243         * accessibility/AccessibilityTableRow.h:
244         * accessibility/atk/WebKitAccessibleInterfaceTableCell.cpp:
245         (webkitAccessibleTableCellGetColumnSpan):
246         (webkitAccessibleTableCellGetRowSpan):
247         (webkitAccessibleTableCellGetPosition):
248         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
249         (-[WebAccessibilityObjectWrapper accessibilityHeaderElements]):
250         (-[WebAccessibilityObjectWrapper accessibilityRowRange]):
251         (-[WebAccessibilityObjectWrapper accessibilityColumnRange]):
252         * accessibility/isolatedtree/AXIsolatedObject.cpp:
253         (WebCore::AXIsolatedObject::initializeAttributeData):
254         (WebCore::AXIsolatedObject::pairAttributeValue const):
255         * accessibility/isolatedtree/AXIsolatedObject.h:
256         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
257         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
258
259 2020-02-26  Said Abou-Hallawa  <sabouhallawa@apple.com>
260
261         Implement the remote RenderingBackend
262         https://bugs.webkit.org/show_bug.cgi?id=207198
263
264         Reviewed by Simon Fraser.
265
266         * html/HTMLCanvasElement.cpp:
267         (WebCore::HTMLCanvasElement::createImageBuffer const):
268         Make HTMLCanvasElement be able to create a remote ImageBuffer.
269
270 2020-02-27  Simon Fraser  <simon.fraser@apple.com>
271
272         Add ENABLE(SCROLLING_THREAD) and use it to turn off some code we don't need for iOS
273         https://bugs.webkit.org/show_bug.cgi?id=208282
274
275         Reviewed by Tim Horton.
276
277         Protect ThreadedScrollingTree and ScrollingCoordinatorMac with ENABLE(SCROLLING_THREAD).
278
279         * page/scrolling/ThreadedScrollingTree.cpp:
280         * page/scrolling/ThreadedScrollingTree.h:
281         * page/scrolling/mac/ScrollingCoordinatorMac.h:
282         * page/scrolling/mac/ScrollingCoordinatorMac.mm:
283         * page/scrolling/mac/ScrollingTreeMac.cpp:
284         * page/scrolling/mac/ScrollingTreeMac.h:
285
286 2020-02-26  Fujii Hironori  <Hironori.Fujii@sony.com>
287
288         Unreviewed unified source builds fix.
289
290         > layout\FormattingContextGeometry.cpp(564): error C2027: use of undefined type 'WebCore::Layout::ReplacedBox
291         > Modules\websockets\WebSocket.cpp(335): error C2027: use of undefined type 'WebCore::WorkerThread'
292         > layout\integration\LayoutIntegrationBoxTree.cpp(63): error C2039: 'InlineTextBox': is not a member of 'WebCore::Layout'
293         > workers\service\context\ServiceWorkerFetch.cpp(143): error C2027: use of undefined type 'WebCore::ServiceWorkerThread'
294
295         * Modules/websockets/WebSocket.cpp:
296         * layout/FormattingContextGeometry.cpp:
297         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
298         * layout/integration/LayoutIntegrationBoxTree.cpp:
299         * workers/service/context/ServiceWorkerFetch.cpp:
300
301 2020-02-26  Jack Lee  <shihchieh_lee@apple.com>
302
303         Nullptr crash in WebCore::canHaveChildrenForEditing via CompositeEditCommand::insertNode
304         https://bugs.webkit.org/show_bug.cgi?id=208115
305         <rdar://problem/56685655>
306
307         Reviewed by Ryosuke Niwa.
308
309         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. 
310
311         Test: fast/lists/insert-list-uneditable-element-with-non-li-child.html
312
313         * editing/InsertListCommand.cpp:
314         (WebCore::InsertListCommand::listifyParagraph):
315
316 2020-02-26  Don Olmstead  <don.olmstead@sony.com>
317
318         Allow setting of stack sizes for threads
319         https://bugs.webkit.org/show_bug.cgi?id=208223
320
321         Reviewed by Yusuke Suzuki.
322
323         Specify ThreadType at the Thread::create callsite.
324
325         * Modules/webaudio/AsyncAudioDecoder.cpp:
326         (WebCore::AsyncAudioDecoder::AsyncAudioDecoder):
327         * Modules/webaudio/OfflineAudioDestinationNode.cpp:
328         (WebCore::OfflineAudioDestinationNode::startRendering):
329         * bindings/js/GCController.cpp:
330         (WebCore::GCController::garbageCollectOnAlternateThreadForDebugging):
331         * platform/audio/ReverbConvolver.cpp:
332         (WebCore::ReverbConvolver::ReverbConvolver):
333         * platform/network/cf/LoaderRunLoopCF.cpp:
334         (WebCore::loaderRunLoop):
335         * platform/network/cf/ResourceHandleCFNet.cpp:
336         (WebCore::ResourceHandle::platformLoadResourceSynchronously):
337         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
338         (WebCore::getRunLoop):
339         * platform/network/curl/CurlRequestScheduler.cpp:
340         (WebCore::CurlRequestScheduler::startThreadIfNeeded):
341         * platform/network/curl/CurlStreamScheduler.cpp:
342         (WebCore::CurlStreamScheduler::startThreadIfNeeded):
343         * workers/WorkerThread.cpp:
344         (WebCore::WorkerThread::start):
345
346 2020-02-26  Zalan Bujtas  <zalan@apple.com>
347
348         [LFC][BFC][MarginCollapsing] Decouple regular and pre-computed margin collapsing logic
349         https://bugs.webkit.org/show_bug.cgi?id=208247
350         <rdar://problem/59808951>
351
352         Reviewed by Antti Koivisto.
353
354         The pre-computed path is so peculiar it deserves a dedicated file.
355
356         This is in preparation for fixing a flaw in the pre-computed logic where we end up
357         accessing a not-yet-computed horizontal constraint. No change in functionality at this point.
358
359         * Sources.txt:
360         * WebCore.xcodeproj/project.pbxproj:
361         * layout/blockformatting/BlockFormattingContext.h:
362         * layout/blockformatting/BlockMarginCollapse.cpp:
363         (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeValues const):
364         (WebCore::Layout::BlockFormattingContext::MarginCollapse::precomputedMarginBefore): Deleted.
365         * layout/blockformatting/PrecomputedBlockMarginCollapse.cpp: Added.
366         (WebCore::Layout::BlockFormattingContext::MarginCollapse::precomputedPositiveNegativeValues const):
367         (WebCore::Layout::BlockFormattingContext::MarginCollapse::precomputedPositiveNegativeMarginBefore const):
368         (WebCore::Layout::BlockFormattingContext::MarginCollapse::precomputedMarginBefore):
369         * layout/integration/LayoutIntegrationBoxTree.cpp:
370
371 2020-02-26  Keith Rollin  <krollin@apple.com>
372
373         Add logging to help diagnose redirect issue
374         https://bugs.webkit.org/show_bug.cgi?id=207916
375         <rdar://problem/59567875>
376
377         Reviewed by Chris Dumez.
378
379         We're seeing an issue where communication between the WebContent
380         process and the Network process seems to come to a stop between
381         NetworkResourceLoader::continueWillSendRedirectedRequest and
382         NetworkResourceLoader::continueWillSendRequest. We do see a
383         WebResourceLoader::willSendRequest log line between those two
384         NetworkResourceLoader logging lines, but nothing else. Add a bunch of
385         logging in this area to help determine what's happening.
386
387         No new tests -- no new or changed functionality.
388
389         * loader/PolicyChecker.cpp:
390         (WebCore::PolicyChecker::checkNavigationPolicy):
391         * loader/ResourceLoader.cpp:
392         (WebCore::ResourceLoader::loadDataURL):
393         (WebCore::ResourceLoader::willSendRequestInternal):
394         (WebCore::ResourceLoader::didFinishLoading):
395         (WebCore::ResourceLoader::didFail):
396         (WebCore::ResourceLoader::willSendRequestAsync):
397         (WebCore::ResourceLoader::wasBlocked):
398         (WebCore::ResourceLoader::cannotShowURL):
399         * loader/SubresourceLoader.cpp:
400         (WebCore::SubresourceLoader::init):
401         (WebCore::SubresourceLoader::willSendRequestInternal):
402         (WebCore::SubresourceLoader::didReceiveResponse):
403         (WebCore::SubresourceLoader::didFinishLoading):
404         (WebCore::SubresourceLoader::didFail):
405         (WebCore::SubresourceLoader::willCancel):
406         * loader/cache/CachedRawResource.cpp:
407         (WebCore::CachedRawResource::redirectReceived):
408         * loader/cache/CachedResource.cpp:
409         (WebCore::CachedResource::redirectReceived):
410         * loader/cache/CachedResourceLoader.cpp:
411         (WebCore::CachedResourceLoader::canRequestAfterRedirection const):
412
413 2020-02-26  Daniel Bates  <dabates@apple.com>
414
415         Clean up HitTestLocation.h
416         https://bugs.webkit.org/show_bug.cgi?id=208254
417         <rdar://problem/59815136>
418
419         Reviewed by Jer Noble.
420
421         Use modern C++ features to remove duplicate code.
422
423         * rendering/HitTestLocation.cpp:
424         (WebCore::HitTestLocation::HitTestLocation):
425         * rendering/HitTestLocation.h:
426         * rendering/HitTestResult.cpp:
427         (WebCore::HitTestResult::HitTestResult):
428         * rendering/HitTestResult.h: Remove unnecessary #includes. This file only needs
429         to include RoundedRect.h: RoundedRect.h includes FloatQuad.h and LayoutRect.h
430         and FloatQuad.h will include FloatRect.h. We do not make use of have declarations
431         in <wtf/Forward.h> so remove that as well.
432
433 2020-02-26  Jacob Uphoff  <jacob_uphoff@apple.com>
434
435         Unreviewed, rolling out r257373.
436
437         This commit introduced one test that is a flaky failure on ios
438         bots and broke another test
439
440         Reverted changeset:
441
442         "[iPadOS] REGRESSION(r247667): Autosizing style changes don't
443         invalidate RenderText's preferred logical widths"
444         https://bugs.webkit.org/show_bug.cgi?id=208084
445         https://trac.webkit.org/changeset/257373
446
447 2020-02-26  Jacob Uphoff  <jacob_uphoff@apple.com>
448
449         Unreviewed, rolling out r257470.
450
451         This broke the build for tvOS and watchOS
452
453         Reverted changeset:
454
455         "Conversion between MediaSample and RemoteVideoSample should
456         preserve the rotation information"
457         https://bugs.webkit.org/show_bug.cgi?id=208240
458         https://trac.webkit.org/changeset/257470
459
460 2020-02-26  Adrian Perez de Castro  <aperez@igalia.com>
461
462         Unreviewed build fix for non-unified builds with assertions enabled.
463
464         * css/CSSImageSetValue.cpp: Add missing include.
465
466 2020-02-26  Andres Gonzalez  <andresg_22@apple.com>
467
468         AXIsolatedObject support for table column objects.
469         https://bugs.webkit.org/show_bug.cgi?id=208215
470
471         Reviewed by Chris Fleizach.
472
473         Covered by existing tests.
474
475         - AccessibilityTableColumn interface is now exposed through
476         AXCoreObject.
477         - Separated isTableColumn from isAccessibilityTableColumnInstance.
478         - This eliminates to need to downcast in the wrapper code, and hence
479         makes it possible that the same code works for both AccessibilityObjects
480         and AXIsolatedObjects.
481         - Completed the caching of table column properties in AXIsolatedObject.
482         - Some minor code cleanup.
483
484         * accessibility/AccessibilityARIAGrid.cpp:
485         (WebCore::AccessibilityARIAGrid::addChildren): Removed unnecessary cast.
486         * accessibility/AccessibilityObject.h:
487         * accessibility/AccessibilityObjectInterface.h:
488         * accessibility/AccessibilityTable.cpp:
489         (WebCore::AccessibilityTable::addChildren): Removed unnecessary cast.
490         (WebCore::AccessibilityTable::columnHeaders):
491         * accessibility/AccessibilityTableColumn.cpp:
492         (WebCore::AccessibilityTableColumn::columnHeader):
493         (WebCore::AccessibilityTableColumn::headerObject): Renamed columnHeader.
494         * accessibility/AccessibilityTableColumn.h:
495         * accessibility/isolatedtree/AXIsolatedObject.cpp:
496         (WebCore::AXIsolatedObject::initializeAttributeData):
497         (WebCore::AXIsolatedObject::isAccessibilityTableColumnInstance const):
498         * accessibility/isolatedtree/AXIsolatedObject.h:
499         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
500         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
501
502 2020-02-26  Youenn Fablet  <youenn@apple.com>
503
504         Conversion between MediaSample and RemoteVideoSample should preserve the rotation information
505         https://bugs.webkit.org/show_bug.cgi?id=208240
506
507         Reviewed by Eric Carlson.
508
509         Update RemoteVideoSample to have surface getter be const.
510         Add a new routine to convert a RemoteVideoSample in a MediaSample, with proper rotation and mirrored information.
511         Covered by manual testing.
512
513         * platform/graphics/RemoteVideoSample.cpp:
514         (WebCore::RemoteVideoSample::surface const):
515         * platform/graphics/RemoteVideoSample.h:
516         (WebCore::RemoteVideoSample::mirrored const):
517         * platform/graphics/cv/ImageTransferSessionVT.h:
518         * platform/graphics/cv/ImageTransferSessionVT.mm:
519         (WebCore::ImageTransferSessionVT::createMediaSample):
520
521 2020-02-26  Zalan Bujtas  <zalan@apple.com>
522
523         [LFC][IFC][Floats] ASSERT(committedInlineItemCount || line.hasIntrusiveFloat()) in LineLayoutContext::close
524         https://bugs.webkit.org/show_bug.cgi?id=208230
525         <rdar://problem/59791249>
526
527         Reviewed by Antti Koivisto.
528
529         Test: fast/layoutformattingcontext/float-and-br-inline-content-only.html
530
531         Expand the ASSERT to include all the valid cases
532         1. Inline content is added to the line
533         2. Only float(s) got processed (no inline content)
534         3. Neither floats not inline content got processed due to intrusive floats.
535         (This patch slightly rearranges the body of LineLayoutContext::commitFloats and also fixes an off-by-1 error in LineLayoutContext::close.)
536
537         * layout/inlineformatting/LineLayoutContext.cpp:
538         (WebCore::Layout::LineLayoutContext::close):
539         (WebCore::Layout::LineLayoutContext::commitFloats):
540
541 2020-02-26  Alicia Boya García  <aboya@igalia.com>
542
543         [GStreamer] Correctly remove webvttenc on WebKitTextCombiner pad release
544         https://bugs.webkit.org/show_bug.cgi?id=208234
545
546         Reviewed by Xabier Rodriguez-Calvar.
547
548         The implementation of webkitTextCombinerReleasePad() was wrong in that
549         it was checking the peer pad of webkittextcombinerpad to check if it
550         belonged a webvttenc element and remove it... But since this is a
551         ghostpad, the peer is upstream, not downstream. When the release pad
552         function is called, upstream is already disconnected, so the branch
553         was never hit.
554
555         To actually remove the webvttenc element we must check the target pad
556         instead of the peer pad, which corresponds to the element downstream.
557         Also, we need to set the element state to NULL before removing it,
558         which the previous code didn't.
559
560         * platform/graphics/gstreamer/TextCombinerGStreamer.cpp:
561         (webkitTextCombinerReleasePad):
562
563 2020-02-26  Antti Koivisto  <antti@apple.com>
564
565         Remove throttling code from RenderLayerCompositor
566         https://bugs.webkit.org/show_bug.cgi?id=208135
567         <rdar://problem/59765410>
568
569         Unreviewed partial revert.
570
571         Keep using the "flush" naming in GraphicsLayerClient.
572
573         * page/PageOverlayController.cpp:
574         (WebCore::PageOverlayController::notifyFlushRequired):
575         (WebCore::PageOverlayController::notifyRenderingUpdateRequired): Deleted.
576         * page/PageOverlayController.h:
577         * page/linux/ResourceUsageOverlayLinux.cpp:
578         * page/mac/ServicesOverlayController.h:
579         * page/mac/ServicesOverlayController.mm:
580         (WebCore::ServicesOverlayController::Highlight::notifyFlushRequired):
581         (WebCore::ServicesOverlayController::Highlight::notifyRenderingUpdateRequired): Deleted.
582         * platform/graphics/GraphicsLayerClient.h:
583         (WebCore::GraphicsLayerClient::notifyFlushRequired):
584         (WebCore::GraphicsLayerClient::notifyRenderingUpdateRequired): Deleted.
585         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
586         (WebCore::CoordinatedGraphicsLayer::notifyFlushRequired):
587         * rendering/RenderLayerBacking.cpp:
588         (WebCore::RenderLayerBacking::notifyFlushRequired):
589         (WebCore::RenderLayerBacking::notifyRenderingUpdateRequired): Deleted.
590         * rendering/RenderLayerBacking.h:
591         * rendering/RenderLayerCompositor.cpp:
592         (WebCore::RenderLayerCompositor::notifyFlushRequired):
593         (WebCore::RenderLayerCompositor::notifyRenderingUpdateRequired): Deleted.
594         * rendering/RenderLayerCompositor.h:
595
596 2020-02-26  Víctor Manuel Jáquez Leal  <vjaquez@igalia.com>
597
598         [GL][GStreamer] Instantiate GstGLContext when the shared GLContext is created
599         https://bugs.webkit.org/show_bug.cgi?id=200626
600
601         Reviewed by Carlos Garcia Campos.
602
603         This patch adds GstGLContext and GstGLDisplay as part of
604         PlatformDisplay.
605
606         Right now one GstGLContext is created per video tag, which is a
607         wrapper of the GL shared context. Every time this wrapper is
608         created the GL context has to be current in order to initialize
609         the wrapper's internal state.
610
611         A better approach would be to have a single GstGLContext per GL
612         context, to instantiate it when the GL context is created and
613         current. This GstGLContext would be used for all media players.
614
615         GstGLContext and GstGLDisplay are instantiated as singletons by
616         PlatformDisplay. When the media player request for the
617         GstGLContext a GL context is instantiated, if it wasn't before,
618         and wraps it. PlatformDisplay adds two getters, one for
619         GstGLContext object, and other for GstGLDisplay. Both are used to
620         configure the internal GStreamer GL context in the multimedia
621         pipeline.
622
623         No new tests are needed.
624
625         * platform/GStreamer.cmake:
626         * platform/graphics/PlatformDisplay.cpp:
627         (WebCore::PlatformDisplay::terminateEGLDisplay):
628         * platform/graphics/PlatformDisplay.h:
629         * platform/graphics/gstreamer/GLVideoSinkGStreamer.cpp:
630         (requestGLContext):
631         (webKitGLVideoSinkChangeState):
632         (webKitGLVideoSinkProbePlatform):
633         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
634         * platform/graphics/gstreamer/PlatformDisplayGStreamer.cpp: Added.
635         (createGstGLDisplay):
636         (PlatformDisplay::tryEnsureGstGLContext):
637         (PlatformDisplay::gstGLDisplay const):
638         (PlatformDisplay::gstGLContext const):
639
640 2020-02-26  Chris Dumez  <cdumez@apple.com>
641
642         DocumentTimeline / CSSTransition objects are leaking on CNN.com
643         https://bugs.webkit.org/show_bug.cgi?id=208069
644         <rdar://problem/59680143>
645
646         Reviewed by Antoine Quint.
647
648         Break reference cycle between DocumentTimeline and WebAnimation by using WeakPtr.
649
650         * animation/AnimationTimeline.h:
651         * animation/DocumentTimeline.h:
652         * animation/WebAnimation.cpp:
653         (WebCore::WebAnimation::timeline const):
654         (WebCore::WebAnimation::setTimeline):
655         (WebCore::WebAnimation::setTimelineInternal):
656         (WebCore::WebAnimation::enqueueAnimationEvent):
657         (WebCore::WebAnimation::acceleratedStateDidChange):
658         * animation/WebAnimation.h:
659         (WebCore::WebAnimation::timeline const): Deleted.
660
661 2020-02-26  Adrian Perez de Castro  <aperez@igalia.com>
662
663         Unreviewed build fix for non-unified builds.
664
665         * bindings/js/JSAnimationTimelineCustom.cpp: Add missing header include.
666
667 2020-02-26  Mark Lam  <mark.lam@apple.com>
668
669         Custom element caching should be aware of different worlds.
670         https://bugs.webkit.org/show_bug.cgi?id=208228
671         <rdar://problem/57881013>
672
673         Reviewed by Ryosuke Niwa.
674
675         Even though a custom element is cached in one world, we should return an unknown
676         HTMl element in a different world.
677
678         Test to be added in https://bugs.webkit.org/show_bug.cgi?id=208229.
679
680         * bindings/js/JSElementCustom.cpp:
681         (WebCore::toJSNewlyCreated):
682
683 2020-02-25  Fujii Hironori  <Hironori.Fujii@sony.com>
684
685         [WinCairo] Unreviewed build fix for unified source builds
686
687         > Modules\websockets\WebSocket.cpp(334): error C2065: 'WorkerGlobalScope': undeclared identifier
688         > Modules\websockets\WebSocket.cpp(334): error C2672: 'downcast': no matching overloaded function found
689         > Modules\websockets\WebSocket.cpp(334): error C2974: 'WTF::downcast': invalid template argument for 'Target', type expected
690
691         * Modules/websockets/WebSocket.cpp: Added #include "WorkerGlobalScope.h".
692
693 2020-02-25  Devin Rousso  <drousso@apple.com>
694
695         Web Inspector: safari app extension isolated worlds and injected files use the extension's identifier instead of its name
696         https://bugs.webkit.org/show_bug.cgi?id=206911
697         <rdar://problem/58026635>
698
699         Reviewed by Brian Burg.
700
701         * Modules/webauthn/AuthenticationExtensionsClientOutputs.h:
702         Drive-by: add missing include.
703
704 2020-02-25  Jer Noble  <jer.noble@apple.com>
705
706         Unreviewed tvOS build fix; fix the compiler guards broken by r257189.
707
708         * platform/ios/PlaybackSessionInterfaceAVKit.h:
709         * platform/ios/PlaybackSessionInterfaceAVKit.mm:
710         * platform/ios/WebAVPlayerController.h:
711         * platform/ios/WebAVPlayerController.mm:
712
713 2020-02-25  Jack Lee  <shihchieh_lee@apple.com>
714
715         ASSERTION FAILURE in AppendNodeCommand::AppendNodeCommand when inserting list with read-only user-modify
716         https://bugs.webkit.org/show_bug.cgi?id=208045
717         <rdar://problem/39023383>
718
719         Reviewed by Ryosuke Niwa.
720
721         When inserting a list (InsertListCommand) around enclosed list items, if new list is not editable, skip moving list items in function doApplyForSingleParagraph.
722
723         Test: fast/lists/insert-list-user-modify-read-only-enclosed-li.html
724
725         * editing/InsertListCommand.cpp:
726         (WebCore::InsertListCommand::doApplyForSingleParagraph):
727
728 2020-02-25  Jack Lee  <shihchieh_lee@apple.com>
729
730         Nullptr crash in CompositeEditCommand::splitTreeToNode
731         https://bugs.webkit.org/show_bug.cgi?id=208039
732         <rdar://problem/52011355>
733
734         Reviewed by Ryosuke Niwa.
735
736         When inserting a list (InsertListCommand) around orphaned list items, if unordered list is not editable, skip moving list items in function fixOrphanedListChild. 
737
738         Test: fast/lists/insert-list-user-modify-read-only-orphaned-li.html
739
740         * editing/InsertListCommand.cpp:
741         (WebCore::InsertListCommand::fixOrphanedListChild):
742         (WebCore::InsertListCommand::doApplyForSingleParagraph):
743         * editing/InsertListCommand.h:
744
745 2020-02-25  Justin Michaud  <justin_michaud@apple.com>
746
747         Inline Cache delete by id/val
748         https://bugs.webkit.org/show_bug.cgi?id=207522
749
750         Reviewed by Keith Miller and Filip Pizlo.
751
752         * bindings/js/JSDOMWindowCustom.cpp:
753         (WebCore::JSDOMWindow::deleteProperty):
754         * bindings/js/JSLocationCustom.cpp:
755         (WebCore::JSLocation::deleteProperty):
756         * bindings/js/JSRemoteDOMWindowCustom.cpp:
757         (WebCore::JSRemoteDOMWindow::deleteProperty):
758         * bindings/scripts/CodeGeneratorJS.pm:
759         (GenerateDeleteProperty):
760         (GenerateHeader):
761         (GenerateImplementation):
762         (GenerateConstructorHelperMethods):
763         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
764         (WebCore::JSTestEnabledBySettingPrototype::finishCreation):
765         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
766         (WebCore::JSTestGenerateIsReachablePrototype::finishCreation):
767         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
768         (WebCore::JSTestNamedDeleterNoIdentifier::deleteProperty):
769         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.h:
770         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
771         (WebCore::JSTestNamedDeleterThrowingException::deleteProperty):
772         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.h:
773         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
774         (WebCore::JSTestNamedDeleterWithIdentifier::deleteProperty):
775         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.h:
776         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
777         (WebCore::JSTestNamedDeleterWithIndexedGetter::deleteProperty):
778         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.h:
779         * bindings/scripts/test/JS/JSTestNode.cpp:
780         (WebCore::JSTestNodePrototype::finishCreation):
781         * bindings/scripts/test/JS/JSTestObj.cpp:
782         (WebCore::JSTestObjConstructor::initializeProperties):
783         (WebCore::JSTestObjPrototype::finishCreation):
784         * bridge/NP_jsobject.cpp:
785         * bridge/objc/WebScriptObject.mm:
786         (-[WebScriptObject removeWebScriptKey:]):
787         * bridge/objc/objc_runtime.h:
788         * bridge/objc/objc_runtime.mm:
789         (JSC::Bindings::ObjcFallbackObjectImp::deleteProperty):
790         * bridge/runtime_array.cpp:
791         (JSC::RuntimeArray::deleteProperty):
792         * bridge/runtime_array.h:
793         * bridge/runtime_object.cpp:
794         (JSC::Bindings::RuntimeObject::deleteProperty):
795         * bridge/runtime_object.h:
796
797 2020-02-25  Ben Nham  <nham@apple.com>
798
799         Remove render update throttling
800         https://bugs.webkit.org/show_bug.cgi?id=208168
801
802         Reviewed by Zalan Bujtas.
803
804         Currently, we disable render updates after the first paint for 500 ms while the page is
805         actively loading. However, oftentimes our first paint heuristic selects a first paint that
806         isn't particularly interesting (mostly background colors) and this paint throttler just
807         makes the user look at a nearly empty page for 500 ms. Antti and Simon both think we should
808         remove the throttler to fix this so this patch does that.
809
810         * Headers.cmake:
811         * WebCore.xcodeproj/project.pbxproj:
812         * dom/Document.cpp:
813         (WebCore::Document::scheduleStyleRecalc):
814         (WebCore::Document::shouldScheduleLayout):
815         * editing/AlternativeTextController.cpp:
816         (WebCore::AlternativeTextController::insertDictatedText):
817         * page/ChromeClient.h:
818         (WebCore::ChromeClient::layerTreeStateIsFrozen const):
819         (WebCore::ChromeClient::renderingUpdateThrottlingIsActive const): Deleted.
820         (WebCore::ChromeClient::adjustRenderingUpdateThrottling): Deleted.
821         * page/EventHandler.cpp:
822         (WebCore::EventHandler::dispatchDragEvent):
823         (WebCore::EventHandler::dispatchMouseEvent):
824         (WebCore::EventHandler::internalKeyEvent):
825         (WebCore::EventHandler::handleTextInputEvent):
826         * page/FrameView.cpp:
827         (WebCore::FrameView::loadProgressingStatusChanged):
828         (WebCore::FrameView::setWasScrolledByUser):
829         (WebCore::determineLayerFlushThrottleState): Deleted.
830         (WebCore::FrameView::disableLayerFlushThrottlingTemporarilyForInteraction): Deleted.
831         (WebCore::FrameView::updateLayerFlushThrottling): Deleted.
832         * page/FrameView.h:
833
834 2020-02-25  Myles C. Maxfield  <mmaxfield@apple.com>
835
836         [iPadOS] REGRESSION(r247667): Autosizing style changes don't invalidate RenderText's preferred logical widths
837         https://bugs.webkit.org/show_bug.cgi?id=208084
838         <rdar://problem/59463898>
839
840         Reviewed by Darin Adler.
841
842         Just use RenderElement::setStyle(), which handles all the invalidations, instead of RenderElement::setNeedsLayout().
843
844         Do a little refactoring so we don't clone RenderStyles unless we need to.
845
846         Test: fast/text-autosizing/ios/idempotentmode/viewport-change-relayout.html
847
848         * page/Page.cpp:
849         (WebCore::Page::recomputeTextAutoSizingInAllFrames):
850         * style/StyleAdjuster.cpp:
851         (WebCore::Style::Adjuster::adjustmentForTextAutosizing):
852         (WebCore::Style::Adjuster::adjustForTextAutosizing):
853         * style/StyleAdjuster.h:
854         (WebCore::Style::Adjuster::AdjustmentForTextAutosizing::operator bool const):
855
856 2020-02-25  Zalan Bujtas  <zalan@apple.com>
857
858         [LFC][TFC] Do not create a formatting context for empty subtree in TableFormattingContext::computePreferredWidthForColumns
859         https://bugs.webkit.org/show_bug.cgi?id=208205
860         <rdar://problem/59766702>
861
862         Reviewed by Antti Koivisto.
863
864         Test: fast/layoutformattingcontext/simple-table-with-empty-td.html
865
866         * layout/tableformatting/TableFormattingContext.cpp:
867         (WebCore::Layout::TableFormattingContext::computePreferredWidthForColumns):
868
869 2020-02-25  Don Olmstead  <don.olmstead@sony.com>
870
871         [WinCairo] Fix build after revisions 257357 and 257354
872         https://bugs.webkit.org/show_bug.cgi?id=208210
873
874         Unreviewed build fix.
875
876         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
877         (WebCore::GraphicsLayerTextureMapper::notifyChange):
878         * platform/network/curl/CookieJarDB.cpp:
879         (WebCore::CookieJarDB::setCookie):
880
881 2020-02-25  Said Abou-Hallawa  <sabouhallawa@apple.com>
882
883         Make HostWindow be the creator of the remote ImageBuffer
884         https://bugs.webkit.org/show_bug.cgi?id=207134
885
886         Reviewed by Darin Adler.
887
888         ImageBuffer is responsible of creating all the in-process ImageBuffers.
889         HostWindow will be responsible of creating the remote ImageBuffers.
890
891         HostWindow adds the virtual function createImageBuffer(). Chrome forward
892         this to the virtual function createImageBuffer() on the ChromeClient.
893
894         * page/Chrome.cpp:
895         (WebCore::Chrome::createImageBuffer const):
896         * page/Chrome.h:
897         * page/ChromeClient.h:
898         (WebCore::ChromeClient::createImageBuffer const):
899         * platform/HostWindow.h:
900         * platform/graphics/ImageBuffer.cpp:
901         (WebCore::ImageBuffer::create):
902         * platform/graphics/RenderingMode.h:
903
904 2020-02-25  Sihui Liu  <sihui_liu@apple.com>
905
906         Assertion failed: currentSchema == createV1ObjectStoreInfoSchema(objectStoreInfoTableName) || currentSchema == createV1ObjectStoreInfoSchema(objectStoreInfoTableNameAlternate)
907         https://bugs.webkit.org/show_bug.cgi?id=208144
908
909         Reviewed by Ryosuke Niwa.
910
911         Change a release assertion to release error log to gather information about bug. This is also the pattern of 
912         handling error during schema update in SQLiteIDBBackingStore.  
913
914         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
915         (WebCore::IDBServer::SQLiteIDBBackingStore::ensureValidObjectStoreInfoTable):
916
917 2020-02-25  Zalan Bujtas  <zalan@apple.com>
918
919         [LFC][OutOfFlow] Out-of-flow positioned line breaks can generate display boxes
920         https://bugs.webkit.org/show_bug.cgi?id=208198
921         <rdar://problem/59764787>
922
923         Reviewed by Antti Koivisto.
924
925         Test: fast/layoutformattingcontext/out-of-flow-positioned-line-breaks.html
926
927         This assert should take the positioning into account when checking againts line breaks.
928         (In practice those display boxes are empty and they don't really contribute to rendering but
929         they are still valid content.) 
930
931         * layout/FormattingState.cpp:
932         (WebCore::Layout::FormattingState::displayBox):
933
934 2020-02-25  Antti Koivisto  <antti@apple.com>
935
936         Remove throttling code from RenderLayerCompositor
937         https://bugs.webkit.org/show_bug.cgi?id=208135
938
939         Reviewed by Zalan Bujtas.
940
941         It is only used on WK1, adds lots of complexity and is not very effective or correct.
942
943         Also do some "layer flush" -> "rendering update" renaming.
944
945         * page/FrameView.cpp:
946         (WebCore::FrameView::disableLayerFlushThrottlingTemporarilyForInteraction):
947         (WebCore::FrameView::updateLayerFlushThrottling):
948         (WebCore::FrameView::setViewExposedRect):
949         (WebCore::FrameView::scheduleLayerFlushAllowingThrottling): Deleted.
950         * page/FrameView.h:
951         * page/PageOverlayController.cpp:
952         (WebCore::PageOverlayController::notifyRenderingUpdateRequired):
953         (WebCore::PageOverlayController::notifyFlushRequired): Deleted.
954         * page/PageOverlayController.h:
955         * page/mac/ServicesOverlayController.h:
956         * page/mac/ServicesOverlayController.mm:
957         (WebCore::ServicesOverlayController::Highlight::notifyRenderingUpdateRequired):
958         (WebCore::ServicesOverlayController::Highlight::notifyFlushRequired): Deleted.
959         * platform/graphics/GraphicsLayer.h:
960         (WebCore::GraphicsLayer::canThrottleLayerFlush const): Deleted.
961         * platform/graphics/GraphicsLayerClient.h:
962         (WebCore::GraphicsLayerClient::notifyRenderingUpdateRequired):
963         (WebCore::GraphicsLayerClient::notifyFlushRequired): Deleted.
964         * platform/graphics/ca/GraphicsLayerCA.cpp:
965         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
966         * platform/graphics/ca/GraphicsLayerCA.h:
967         * platform/ios/LegacyTileCache.h:
968         * platform/ios/LegacyTileCache.mm:
969         (WebCore::LegacyTileCache::scheduleRenderingUpdateForPendingRepaint):
970         (WebCore::LegacyTileCache::setNeedsDisplayInRect):
971         (WebCore::LegacyTileCache::updateTilingMode):
972         (WebCore::LegacyTileCache::scheduleLayerFlushForPendingRepaint): Deleted.
973         * rendering/RenderLayerBacking.cpp:
974         (WebCore::RenderLayerBacking::notifyRenderingUpdateRequired):
975         (WebCore::RenderLayerBacking::notifyFlushRequired): Deleted.
976         * rendering/RenderLayerBacking.h:
977         * rendering/RenderLayerCompositor.cpp:
978         (WebCore::RenderLayerCompositor::RenderLayerCompositor):
979         (WebCore::RenderLayerCompositor::notifyRenderingUpdateRequired):
980         (WebCore::RenderLayerCompositor::scheduleRenderingUpdate):
981         (WebCore::RenderLayerCompositor::flushPendingLayerChanges):
982         (WebCore::RenderLayerCompositor::didChangeVisibleRect):
983         (WebCore::RenderLayerCompositor::flushLayersSoon):
984         (WebCore::RenderLayerCompositor::frameViewDidScroll):
985         (WebCore::RenderLayerCompositor::ensureRootLayer):
986         (WebCore::RenderLayerCompositor::attachRootLayer):
987         (WebCore::RenderLayerCompositor::notifyFlushRequired): Deleted.
988         (WebCore::RenderLayerCompositor::scheduleLayerFlush): Deleted.
989         (WebCore::RenderLayerCompositor::setLayerFlushThrottlingEnabled): Deleted.
990         (WebCore::RenderLayerCompositor::disableLayerFlushThrottlingTemporarilyForInteraction): Deleted.
991         (WebCore::RenderLayerCompositor::isThrottlingLayerFlushes const): Deleted.
992         (WebCore::RenderLayerCompositor::startLayerFlushTimerIfNeeded): Deleted.
993         (WebCore::RenderLayerCompositor::startInitialLayerFlushTimerIfNeeded): Deleted.
994         (WebCore::RenderLayerCompositor::layerFlushTimerFired): Deleted.
995         * rendering/RenderLayerCompositor.h:
996
997 2020-02-25  Andres Gonzalez  <andresg_22@apple.com>
998
999         IsolatedObject support for ProgressIndicator and Meter.
1000         https://bugs.webkit.org/show_bug.cgi?id=208175
1001
1002         Reviewed by Chris Fleizach.
1003
1004         - Eliminated the need to downcast to an AccessibilityProgressIndicator
1005         by including gaugeRegionValueDescription in the valueDescription
1006         method.
1007         - Separated isAccessibilityProgressIndicatorInstance from
1008         isProgressIndicator, so that the latter now works for both
1009         AccessibilityObjects and AXIsolatedObjects.
1010         - Completed implementation of isMeter in AXIsolatedObject.
1011
1012         * accessibility/AccessibilityObject.h:
1013         * accessibility/AccessibilityObjectInterface.h:
1014         * accessibility/AccessibilityProgressIndicator.cpp:
1015         (WebCore::AccessibilityProgressIndicator::valueDescription const):
1016         * accessibility/AccessibilityProgressIndicator.h:
1017         * accessibility/isolatedtree/AXIsolatedObject.cpp:
1018         (WebCore::AXIsolatedObject::initializeAttributeData): Sets the isMeter property.
1019         (WebCore::AXIsolatedObject::isAccessibilityProgressIndicatorInstance const):
1020         * accessibility/isolatedtree/AXIsolatedObject.h:
1021         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1022         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
1023         (-[WebAccessibilityObjectWrapper valueDescriptionForMeter]): Deleted, no needed any longer.
1024
1025 2020-02-25  Zalan Bujtas  <zalan@apple.com>
1026
1027         [LFC] Invalidate layout states on style mutation
1028         https://bugs.webkit.org/show_bug.cgi?id=208195
1029         <rdar://problem/59764089>
1030
1031         Reviewed by Antti Koivisto.
1032
1033         Let's just do a blanket invalidation for now (since we don't have the invalidation figured out yet).
1034
1035         * page/FrameViewLayoutContext.cpp:
1036         (WebCore::FrameViewLayoutContext::invalidateLayoutState):
1037         * page/FrameViewLayoutContext.h:
1038         * rendering/updating/RenderTreeUpdater.cpp:
1039         (WebCore::RenderTreeUpdater::updateRendererStyle):
1040
1041 2020-02-25  Chris Dumez  <cdumez@apple.com>
1042
1043         Regression(CookieCache) Hang and very high CPU usage on nytimes.com
1044         https://bugs.webkit.org/show_bug.cgi?id=208166
1045         <rdar://problem/59739735>
1046
1047         Reviewed by Alex Christensen.
1048
1049         The Cookie class which the cookie cache implementation relies on for IPC of cookie had a bug
1050         in its implementation to convert the Cookie into a NSHTTPCookie. In particular, if the expiry
1051         was in the past, it would drop it and the cookie would end up with no expiration date. We would
1052         end up with a cookie that lives for duration of the session, instead of a cookie with an
1053         expiration in the past (which is how sites delete cookies).
1054
1055         Test: http/tests/cookies/document-cookie-set-expired-cookie.html
1056
1057         * platform/network/cocoa/CookieCocoa.mm:
1058         (WebCore::Cookie::operator NSHTTPCookie * _Nullable  const):
1059
1060 2020-02-25  Carlos Garcia Campos  <cgarcia@igalia.com>
1061
1062         [GTK] Add support for rendering slider ticks
1063         https://bugs.webkit.org/show_bug.cgi?id=208132
1064
1065         Reviewed by Adrian Perez de Castro.
1066
1067         * rendering/RenderThemeAdwaita.cpp:
1068         (WebCore::RenderThemeAdwaita::paintSliderTrack):
1069         (WebCore::RenderThemeAdwaita::sliderTickSize const):
1070         (WebCore::RenderThemeAdwaita::sliderTickOffsetFromTrackCenter const):
1071
1072 2020-02-25  Carlos Garcia Campos  <cgarcia@igalia.com>
1073
1074         [GTK] Stop using gtk foreign drawing API to style form controls
1075         https://bugs.webkit.org/show_bug.cgi?id=208129
1076
1077         Reviewed by Adrian Perez de Castro.
1078
1079         It causes layout issues in some websites, it doesn't really work with all GTK themes and it won't be possible
1080         with GTK4 because foreign drawing APIs have been removed. Instead, we can use the new custom style used by WPE
1081         port, which is based on adwaita, but simplified to avoid the huge minimum control sizes, the usage of gradients
1082         and transparencies, etc. We can still use the GTK API to get the selection colors, to keep some consistency with
1083         the actual GTK theme, but that won't be possible with GTK4 either. This also means we won't be rendering
1084         directly to the cairo context anymore (which was required by GTK foreign drawing), so we can use things like
1085         threaded rendering in the GTK port now. This patch renames ScrollbarThemeWPE, RenderThemeWPE and ThemeWPE as
1086         ScrollbarThemeAdwaita, RenderThemeAdwaita and ThemeAdwaita and adds ThemeGtk. GTK media controls CSS and
1087         JavaScript files have been removed in favor of using the adwaita ones.
1088
1089         * Modules/mediacontrols/mediaControlsGtk.js: Removed.
1090         * PlatformGTK.cmake:
1091         * PlatformWPE.cmake:
1092         * SourcesGTK.txt:
1093         * SourcesWPE.txt:
1094         * css/mediaControlsGtk.css: Removed.
1095         * platform/adwaita/ScrollbarThemeAdwaita.cpp: Renamed from Source/WebCore/platform/wpe/ScrollbarThemeWPE.cpp.
1096         (WebCore::ScrollbarThemeAdwaita::usesOverlayScrollbars const):
1097         (WebCore::ScrollbarThemeAdwaita::scrollbarThickness):
1098         (WebCore::ScrollbarThemeAdwaita::minimumThumbLength):
1099         (WebCore::ScrollbarThemeAdwaita::hasButtons):
1100         (WebCore::ScrollbarThemeAdwaita::hasThumb):
1101         (WebCore::ScrollbarThemeAdwaita::backButtonRect):
1102         (WebCore::ScrollbarThemeAdwaita::forwardButtonRect):
1103         (WebCore::ScrollbarThemeAdwaita::trackRect):
1104         (WebCore::ScrollbarThemeAdwaita::paint):
1105         (WebCore::ScrollbarThemeAdwaita::handleMousePressEvent):
1106         (WebCore::ScrollbarTheme::nativeTheme):
1107         * platform/adwaita/ScrollbarThemeAdwaita.h: Copied from Source/WebCore/platform/wpe/ScrollbarThemeWPE.h.
1108         * platform/adwaita/ThemeAdwaita.cpp: Renamed from Source/WebCore/platform/wpe/ThemeWPE.cpp.
1109         (WebCore::Theme::singleton):
1110         (WebCore::ThemeAdwaita::activeSelectionForegroundColor const):
1111         (WebCore::ThemeAdwaita::activeSelectionBackgroundColor const):
1112         (WebCore::ThemeAdwaita::inactiveSelectionForegroundColor const):
1113         (WebCore::ThemeAdwaita::inactiveSelectionBackgroundColor const):
1114         (WebCore::ThemeAdwaita::focusColor):
1115         (WebCore::ThemeAdwaita::paintFocus):
1116         (WebCore::ThemeAdwaita::paintArrow):
1117         (WebCore::ThemeAdwaita::controlSize const):
1118         (WebCore::ThemeAdwaita::paint):
1119         (WebCore::ThemeAdwaita::paintCheckbox):
1120         (WebCore::ThemeAdwaita::paintRadio):
1121         (WebCore::ThemeAdwaita::paintButton):
1122         (WebCore::ThemeAdwaita::paintSpinButton):
1123         * platform/adwaita/ThemeAdwaita.h: Renamed from Source/WebCore/platform/wpe/ThemeWPE.h.
1124         (WebCore::ThemeAdwaita::platformColorsDidChange):
1125         * platform/graphics/cairo/CairoOperations.cpp:
1126         (WebCore::Cairo::drawFocusRing):
1127         * platform/graphics/cairo/GraphicsContextCairo.cpp:
1128         (WebCore::GraphicsContext::drawFocusRing):
1129         * platform/gtk/RenderThemeGadget.cpp: Removed.
1130         * platform/gtk/RenderThemeGadget.h: Removed.
1131         * platform/gtk/RenderThemeWidget.cpp: Removed.
1132         * platform/gtk/RenderThemeWidget.h: Removed.
1133         * platform/gtk/ScrollbarThemeGtk.cpp: Removed.
1134         * platform/gtk/ScrollbarThemeGtk.h: Removed.
1135         * platform/gtk/ThemeGtk.cpp: Added.
1136         (WebCore::Theme::singleton):
1137         (WebCore::ThemeGtk::ensurePlatformColors const):
1138         (WebCore::ThemeGtk::platformColorsDidChange):
1139         (WebCore::ThemeGtk::activeSelectionForegroundColor const):
1140         (WebCore::ThemeGtk::activeSelectionBackgroundColor const):
1141         (WebCore::ThemeGtk::inactiveSelectionForegroundColor const):
1142         (WebCore::ThemeGtk::inactiveSelectionBackgroundColor const):
1143         * platform/gtk/ThemeGtk.h: Renamed from Source/WebCore/platform/wpe/ScrollbarThemeWPE.h.
1144         * rendering/RenderThemeAdwaita.cpp: Renamed from Source/WebCore/platform/wpe/RenderThemeWPE.cpp.
1145         (WebCore::RenderTheme::singleton):
1146         (WebCore::RenderThemeAdwaita::supportsFocusRing const):
1147         (WebCore::RenderThemeAdwaita::shouldHaveCapsLockIndicator const):
1148         (WebCore::RenderThemeAdwaita::platformActiveSelectionBackgroundColor const):
1149         (WebCore::RenderThemeAdwaita::platformInactiveSelectionBackgroundColor const):
1150         (WebCore::RenderThemeAdwaita::platformActiveSelectionForegroundColor const):
1151         (WebCore::RenderThemeAdwaita::platformInactiveSelectionForegroundColor const):
1152         (WebCore::RenderThemeAdwaita::platformActiveListBoxSelectionBackgroundColor const):
1153         (WebCore::RenderThemeAdwaita::platformInactiveListBoxSelectionBackgroundColor const):
1154         (WebCore::RenderThemeAdwaita::platformActiveListBoxSelectionForegroundColor const):
1155         (WebCore::RenderThemeAdwaita::platformInactiveListBoxSelectionForegroundColor const):
1156         (WebCore::RenderThemeAdwaita::platformFocusRingColor const):
1157         (WebCore::RenderThemeAdwaita::platformColorsDidChange):
1158         (WebCore::RenderThemeAdwaita::extraDefaultStyleSheet):
1159         (WebCore::RenderThemeAdwaita::extraMediaControlsStyleSheet):
1160         (WebCore::RenderThemeAdwaita::mediaControlsScript):
1161         (WebCore::RenderThemeAdwaita::paintTextField):
1162         (WebCore::RenderThemeAdwaita::paintTextArea):
1163         (WebCore::RenderThemeAdwaita::paintSearchField):
1164         (WebCore::RenderThemeAdwaita::popupInternalPaddingBox const):
1165         (WebCore::RenderThemeAdwaita::paintMenuList):
1166         (WebCore::RenderThemeAdwaita::paintMenuListButtonDecorations):
1167         (WebCore::RenderThemeAdwaita::animationRepeatIntervalForProgressBar const):
1168         (WebCore::RenderThemeAdwaita::animationDurationForProgressBar const):
1169         (WebCore::RenderThemeAdwaita::progressBarRectForBounds const):
1170         (WebCore::RenderThemeAdwaita::paintProgressBar):
1171         (WebCore::RenderThemeAdwaita::paintSliderTrack):
1172         (WebCore::RenderThemeAdwaita::adjustSliderThumbSize const):
1173         (WebCore::RenderThemeAdwaita::paintSliderThumb):
1174         (WebCore::RenderThemeAdwaita::paintMediaSliderTrack):
1175         (WebCore::RenderThemeAdwaita::paintMediaVolumeSliderTrack):
1176         (WebCore::RenderThemeAdwaita::sliderTickSize const):
1177         (WebCore::RenderThemeAdwaita::sliderTickOffsetFromTrackCenter const):
1178         (WebCore::RenderThemeAdwaita::adjustListButtonStyle const):
1179         * rendering/RenderThemeAdwaita.h: Renamed from Source/WebCore/platform/wpe/RenderThemeWPE.h.
1180         * rendering/RenderThemeGtk.cpp:
1181         (WebCore::RenderThemeGtk::updateCachedSystemFontDescription const):
1182         (WebCore::RenderThemeGtk::caretBlinkInterval const):
1183         * rendering/RenderThemeGtk.h:
1184
1185 2020-02-24  Fujii Hironori  <Hironori.Fujii@sony.com>
1186
1187         Unreviewed build fix for WinCairo port
1188         https://bugs.webkit.org/show_bug.cgi?id=208112
1189         <rdar://problem/59709701>
1190
1191         > WebCore\layout/inlineformatting/LineLayoutContext.cpp(337): error C2397: conversion from 'size_t' to 'WTF::Optional<unsigned int>' requires a narrowing conversion
1192         > WebCore\layout/inlineformatting/LineLayoutContext.cpp(361): error C2397: conversion from 'size_t' to 'WTF::Optional<unsigned int>' requires a narrowing conversion
1193
1194         * layout/inlineformatting/LineLayoutContext.cpp:
1195         (WebCore::Layout::LineLayoutContext::close): Changed the type of 'trailingInlineItemIndex' from 'auto' to 'unsigned'.
1196
1197 2020-02-23  Darin Adler  <darin@apple.com>
1198
1199         Refactor TextTrackCue to use more traditional design patterns
1200         https://bugs.webkit.org/show_bug.cgi?id=208114
1201
1202         Reviewed by Alex Christensen.
1203
1204         - Fixed is<VTTCue> to accurately match the class hierarchy. Before, TextTrackCueGeneric
1205           derived from VTTCue, but is<VTTCue> would return false. Normalizing this lets us use
1206           is<VTTCue> and downcast<VTTCue> in the conventional way.
1207         - Made the TextTrackCue::isEqual function a non-virtual function that calls a virtual
1208           function TextTrackCue::cueContentsMatch. Before there was a mix of overridding both
1209           functions in derived classes, achieving the same thing in multiple ways with
1210           unneccessary additional virtual function call overhead.
1211         - Made the TextTrackCue::toJSONString function a non-virtual function that calls a
1212           virtual funtion TextTrackCue::toJSON. Before there were two virtual functions and
1213           inconsistent patterns for which one was overridden.
1214
1215         * html/HTMLMediaElement.cpp:
1216         (WebCore::HTMLMediaElement::textTrackRemoveCue): Use downcast instead of toVTTCue.
1217
1218         * html/HTMLMediaElement.h: Removed some unneeded includes.
1219
1220         * html/shadow/MediaControlElements.cpp:
1221         (WebCore::MediaControlTextTrackContainerElement::updateDisplay): Use downcast
1222         instead of toVTTCue.
1223         (WebCore::MediaControlTextTrackContainerElement::processActiveVTTCue): Removed
1224         an assertion that no longer makes sense; guaranteed at runtime.
1225
1226         * html/shadow/MediaControls.h: Removed an unneeded include.
1227
1228         * html/track/DataCue.cpp:
1229         (WebCore::toDataCue): Deleted. No need for this function since we can use
1230         downcast<DataCue> instead.
1231         (WebCore::DataCue::cueContentsMatch const): Removed unnecessary check of cueType.
1232         The isEqual function checks cueType and only calls this function if it matches.
1233         Use downcast instead of toDataCue.
1234         (WebCore::DataCue::isEqual const): Deleted. Base class now handles this.
1235         (WebCore::DataCue::doesExtendCue const): Deleted. Was never being called.
1236         (WebCore::DataCue::toJSONString const): Deleted. Override toJSON instead.
1237         (WebCore::DataCue::toJSON const): Moved the code here that used to be in toJSONString.
1238
1239         * html/track/DataCue.h: Reduced includes. Made overridden functions private
1240         and final. Removed functions as mmentioned above. Changed WTF::LogArgument implementation
1241         to just forward to TextTrackCue instead of reimplementing here.
1242
1243         * html/track/InbandDataTextTrack.cpp:
1244         (WebCore::InbandDataTextTrack::removeCue): Use downcast instead of toDataCue.
1245
1246         * html/track/InbandGenericTextTrack.cpp: Removed an unneeded include.
1247
1248         * html/track/LoadableTextTrack.cpp:
1249         (WebCore::LoadableTextTrack::LoadableTextTrack): Removed unneeded initialization of
1250         m_isDefault, which is initialized in the class definition.
1251         (WebCore::LoadableTextTrack::newCuesAvailable): Removed unneeded call to toVTTCue,
1252         taking advantage of the better interface of getNewCues, which now returns
1253         Vector<Ref<VTTCue>>, making the type explicit.
1254
1255         * html/track/TextTrack.cpp:
1256         (WebCore::TextTrack::addCue): Use is<DataCue> instead of checking cueType.
1257
1258         * html/track/TextTrackCue.cpp:
1259         (WebCore::TextTrackCue::create): Fixed confusing naming that called the fragment the
1260         cue is contained in "cueDocument"; call it cueFragment instead. This constructor
1261         already required that the ScriptExecutionContext be a Document. Did the type cast
1262         for that up front. In the future would be good to change the argument type to Document.
1263         Also fixed how the newly-created fragment is passed to the constructor. The old code
1264         tried to use DocumentFragment&& to pass ownership, but since this is a reference-counted
1265         object it needs to be Ref<DocumentFragment>&&.
1266         (WebCore::TextTrackCue::TextTrackCue):
1267         (WebCore::TextTrackCue::scriptExecutionContext const): Moved this here from the header
1268         file so we can compile without TextTrackCue.h including Document.h.
1269         (WebCore::TextTrackCue::cueContentsMatch const): Removed the code that checks cueType.
1270         It's now isEqual that is responsible for checking that the cueType matches, and
1271         cueContentsMatch is only called when the types are the same.
1272         (WebCore::TextTrackCue::isEqual const): Reordered the boolean checks a bit so it's
1273         easier to see the logic; no need for a cascade of if statements.
1274         (WebCore::TextTrackCue::doesExtendCue const): Deleted. Was never being called.
1275         (WebCore::operator<<): Use downcast instead of toVTTCue.
1276
1277         * html/track/TextTrackCue.h: Made isEqual no longer virtual. The per-class behavior
1278         is now all in the virtual cueContentsMatch function, only called by isEqual.
1279         Removed uncalled doesExtendCue function. Added some argument names in cases where
1280         the type alone did not make their purpose clear. Made some things more private.
1281         Replaced m_scriptExecutionContext with m_document.
1282
1283         * html/track/TextTrackCueGeneric.cpp:
1284         (WebCore::TextTrackCueGeneric::create): Moved this function here from the header.
1285         (WebCore::TextTrackCueGeneric::TextTrackCueGeneric): Initialized data members in the
1286         class definition so they don't also need to be initialized here.
1287         (WebCore::TextTrackCueGeneric::cueContentsMatch const): Rewrote using && rather than
1288         castcading if statements, making the function shorter andd easier to read.
1289         (WebCore::TextTrackCueGeneric::isEqual const): Deleted. Base class now handes this.
1290         The old version had confusing logic to deal with checking cue type; can now do this
1291         in a more straightforward way.
1292         (WebCore::TextTrackCueGeneric::doesExtendCue const): Deleted. Was never called.
1293         (WebCore::TextTrackCueGeneric::isOrderedBefore const): Use is<TextTrackCueGeneric>
1294         and downcast<TextTrackCueGeneric>.
1295         (WebCore::TextTrackCueGeneric::isPositionedAbove const): Ditto. Also merged two
1296         if statements so there is less repeated logic.
1297         (WebCore::TextTrackCueGeneric::toJSONString const): Deleted.
1298         (WebCore::TextTrackCueGeneric::toJSON const): Moved code here that was in toJSONString.
1299
1300         * html/track/TextTrackCueGeneric.h: Made things more private. Changed WTF::LogArgument
1301         implementation to just forward to TextTrackCue instead of reimplementing here.
1302
1303         * html/track/TextTrackCueList.cpp:
1304         (WebCore::TextTrackCueList::create): Moved here from header.
1305         * html/track/TextTrackCueList.h: Ditto.
1306
1307         * html/track/VTTCue.cpp: Moved undefinedPosition to be a private static constexpr
1308         data member so it can be used in initialization.
1309         (WebCore::VTTCueBox::applyCSSProperties): Use is<VTTCue> and downcast<VTTCue>.
1310         (WebCore::VTTCue::create): Moved more overloads of this function here from the
1311         header file.
1312         (WebCore::VTTCue::VTTCue): Take Document instead of ScriptExecutionContext.
1313         Also took the ScriptExecutionContext argument away from the initialize function.
1314         (WebCore::VTTCue::initialize): Do less initialization here. This function is
1315         only called in constructors, so it doesn't need to initialize anything that
1316         is initialized in all constructors or initialized in the class definition.
1317         What remains are things that require a little code to initialize and the
1318         bitfields, which can't be initialized in the class definition.
1319         (WebCore::VTTCue::setPosition): Rearranged the code a tiny bit.
1320         (WebCore::copyWebVTTNodeToDOMTree): Made this a non-member function. Also changed
1321         the argument types to use references.
1322         (WebCore::VTTCue::getCueAsHTML): Updated for changes to copyWebVTTNodeToDOMTree.
1323         (WebCore::VTTCue::removeDisplayTree): Check m_displayTree directly instead
1324         of calling a hasDisplayTree function, since that's more a more straightforward
1325         way to guard a subsequent line of code that then uses m_displayTree.
1326         (WebCore::VTTCue::setCueSettings): Merged two if statements into one.
1327         (WebCore::VTTCue::cueContentsMatch const): Rewrote using && rather than
1328         castcading if statements, making the function shorter andd easier to read.
1329         (WebCore::VTTCue::isEqual const): Deleted. Base class now handles this.
1330         (WebCore::VTTCue::doesExtendCue const): Deleted. Was never called.
1331         (WebCore::toVTTCue): Deleted.
1332         (WebCore::VTTCue::toJSONString const): Deleted. Base class now handles this.
1333         (WebCore::VTTCue::toJSON const): Added a comment.
1334
1335         * html/track/VTTCue.h: Moved create functions out of header, made some things
1336         more private and final, initialized more data members in the class definition.
1337         Removed toVTTCue. Changed WTF::LogArgument implementation to just forward to
1338         TextTrackCue instead of reimplementing here. Corrected the isType function so
1339         it knows about both cue types that result in a VTTCue object. This allows us
1340         to use is<VTTCue> and downcast<VTTCue> in the normal way. Removed the FIXME
1341         saying we should do that.
1342
1343         * loader/TextTrackLoader.cpp:
1344         (WebCore::TextTrackLoader::getNewCues): Changed to return a Vector<Ref<VTTCue>>.
1345         In modern C++ return value is better than an out argument for a function like
1346         this, and the more-specific type helps us at the call sites.
1347
1348         * loader/TextTrackLoader.h: Updated for the above.
1349
1350         * page/CaptionUserPreferencesMediaAF.cpp: Removed unneeded include.
1351
1352         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
1353         Use #pragma once and removed some unneded includes and forward declarations.
1354
1355         * rendering/RenderVTTCue.cpp:
1356         (WebCore::RenderVTTCue::RenderVTTCue): Use downcast<VTTCue>.
1357         (WebCore::RenderVTTCue::layout): Removed unneeded call to toVTTCue.
1358         (WebCore::RenderVTTCue::repositionGenericCue): Use downcast instead of
1359         static_cast for TextTrackCueGeneric.
1360
1361         * style/RuleSet.cpp: Removed unneeded include.
1362
1363 2020-02-24  Chris Fleizach  <cfleizach@apple.com>
1364
1365         AX: Support relative frames for isolated trees correctly
1366         https://bugs.webkit.org/show_bug.cgi?id=208169
1367         <rdar://problem/59746529>
1368
1369         Reviewed by Zalan Bujtas.
1370
1371         To support relative frames correctly for accessibility, we should:
1372           1) Only expose for isolated tree clients.
1373           2) Support FloatRects in the attribute variants.
1374           
1375         This patch also fixes an issue where we weren't reserving capacity before using.
1376
1377         * accessibility/isolatedtree/AXIsolatedObject.cpp:
1378         (WebCore::AXIsolatedObject::setObjectVectorProperty):
1379         * accessibility/isolatedtree/AXIsolatedObject.h:
1380         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1381         (-[WebAccessibilityObjectWrapper additionalAccessibilityAttributeNames]):
1382         (-[WebAccessibilityObjectWrapper ALLOW_DEPRECATED_IMPLEMENTATIONS_END]):
1383
1384 2020-02-24  ChangSeok Oh  <changseok@webkit.org>
1385
1386         PS-2019-006: [GTK] WebKit - AXObjectCache - m_deferredFocusedNodeChange - UaF
1387         https://bugs.webkit.org/show_bug.cgi?id=204342
1388
1389         Reviewed by Carlos Garcia Campos.
1390
1391         m_deferredFocusedNodeChange keeps pairs of a old node and a new one
1392         to update a focused node later. When a node is removed in the document,
1393         it is also removed from the pair vector. The problem is only comparing
1394         the new node in each pair with a removed node decides the removal.
1395         In the case where the removed node lives in m_deferredFocusedNodeChange
1396         as an old node, a crash happens while we get a renderer of the removed node
1397         to handle focused elements. To fix this, we find all entries of which old node
1398         is matched to the removed node, and set their first value null.
1399
1400         No new tests since no functionality changed.
1401
1402         * accessibility/AXObjectCache.cpp:
1403         (WebCore::AXObjectCache::remove):
1404
1405 2020-02-24  Zalan Bujtas  <zalan@apple.com>
1406
1407         [LFC][IFC][Floats] Fix float boxes embedded to unbreakable inline runs.
1408         https://bugs.webkit.org/show_bug.cgi?id=208112
1409         <rdar://problem/59709701>
1410
1411         Reviewed by Antti Koivisto.
1412
1413         This patch fixes the cases when the float is embedded to otherwise unbreakable inline content.
1414         e.g. "text_<div style="float: left"></div>_content"
1415
1416         The logic goes like this:
1417         1. collect the floats inside the unbreakable candidate content
1418         2. mark them intrusive if they potentially influence the current line
1419         3. at handleFloatsAndInlineContent(), adjust available width with the intrusive floats first
1420         4. feed the inline content to the LineBreaker
1421         6. commit the float content based on the line breaking result (commit none, partially, all).
1422         (Note that this algorithm produces a different layout compared to WebKit trunk. It mostly matches FireFox though.)
1423
1424         * layout/inlineformatting/InlineFormattingContext.cpp:
1425         (WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthForConstraint const):
1426         (WebCore::Layout::InlineFormattingContext::setDisplayBoxesForLine):
1427         * layout/inlineformatting/InlineLineBuilder.cpp:
1428         (WebCore::Layout::LineBuilder::moveLogicalLeft):
1429         (WebCore::Layout::LineBuilder::moveLogicalRight):
1430         * layout/inlineformatting/LineLayoutContext.cpp:
1431         (WebCore::Layout::isAtSoftWrapOpportunity):
1432         (WebCore::Layout::nextWrapOpportunity):
1433         (WebCore::Layout::LineCandidate::FloatContent::append):
1434         (WebCore::Layout::LineLayoutContext::layoutLine):
1435         (WebCore::Layout::LineLayoutContext::close):
1436         (WebCore::Layout::LineLayoutContext::nextContentForLine):
1437         (WebCore::Layout::LineLayoutContext::addIntrusiveFloats):
1438         (WebCore::Layout::LineLayoutContext::revertIntrusiveFloats):
1439         (WebCore::Layout::LineLayoutContext::handleFloatsAndInlineContent):
1440         (WebCore::Layout::isLineConsideredEmpty): Deleted.
1441         (WebCore::Layout::LineLayoutContext::tryAddingFloatContent): Deleted.
1442         (WebCore::Layout::LineLayoutContext::tryAddingInlineItems): Deleted.
1443         * layout/inlineformatting/LineLayoutContext.h:
1444
1445 2020-02-24  Nikos Mouchtaris  <nmouchtaris@apple.com>
1446
1447         Add canShare function for Web Share API v2
1448         https://bugs.webkit.org/show_bug.cgi?id=207491
1449
1450         Reviewed by Tim Horton.
1451
1452         Added files member to share data and canShare function to
1453         navigator.cpp. Can share function should always be used 
1454         before call to share, and can be used to check if file 
1455         sharing is implemented by passing a share data object with
1456         only files.
1457
1458         Imported new Web Platform Tests to test new function.
1459
1460         * page/Navigator.cpp:
1461         (WebCore::Navigator::canShare): Will currently return false for 
1462         only file share data objects, since file sharing is currently 
1463         not implemented.
1464         (WebCore::Navigator::share): Changed to use canShare to 
1465         determine if data is shareable.
1466         * page/Navigator.h:
1467         * page/NavigatorShare.idl:
1468         * page/ShareData.h:
1469         * page/ShareData.idl:
1470
1471 2020-02-24  Yusuke Suzuki  <ysuzuki@apple.com>
1472
1473         [WTF] Attach WARN_UNUSED_RETURN to makeScopeExit and fix existing wrong usage
1474         https://bugs.webkit.org/show_bug.cgi?id=208162
1475
1476         Reviewed by Robin Morisset.
1477
1478         * html/HTMLLinkElement.cpp:
1479         (WebCore::HTMLLinkElement::process):
1480
1481 2020-02-24  Jiewen Tan  <jiewen_tan@apple.com>
1482
1483         [WebAuthn] Implement SPI for the platform authenticator
1484         https://bugs.webkit.org/show_bug.cgi?id=208087
1485         <rdar://problem/59369305>
1486
1487         Reviewed by Brent Fulgham.
1488
1489         Enhances AuthenticatorAssertionResponse to accommondate responses
1490         returned from the platform authenticator.
1491
1492         Covered by API tests.
1493
1494         * Modules/webauthn/AuthenticatorAssertionResponse.cpp:
1495         (WebCore::AuthenticatorAssertionResponse::create):
1496         (WebCore::AuthenticatorAssertionResponse::setAuthenticatorData):
1497         (WebCore::AuthenticatorAssertionResponse::AuthenticatorAssertionResponse):
1498         * Modules/webauthn/AuthenticatorAssertionResponse.h:
1499         (WebCore::AuthenticatorAssertionResponse::authenticatorData const):
1500         (WebCore::AuthenticatorAssertionResponse::signature const):
1501         (WebCore::AuthenticatorAssertionResponse::name const):
1502         (WebCore::AuthenticatorAssertionResponse::displayName const):
1503         (WebCore::AuthenticatorAssertionResponse::numberOfCredentials const):
1504         (WebCore::AuthenticatorAssertionResponse::accessControl const):
1505         (WebCore::AuthenticatorAssertionResponse::setSignature):
1506         (WebCore::AuthenticatorAssertionResponse::setName):
1507         (WebCore::AuthenticatorAssertionResponse::setDisplayName):
1508         (WebCore::AuthenticatorAssertionResponse::setNumberOfCredentials):
1509
1510 2020-02-24  Simon Fraser  <simon.fraser@apple.com>
1511
1512         Rename the clashing WebOverlayLayer classes
1513         https://bugs.webkit.org/show_bug.cgi?id=208156
1514         rdar://problem/59739250
1515
1516         Reviewed by Tim Horton.
1517
1518         The name WebOverlayLayer was used in two places. Rename them both to more specific names.
1519
1520         * page/cocoa/ResourceUsageOverlayCocoa.mm:
1521         (-[WebResourceUsageOverlayLayer initWithResourceUsageOverlay:]):
1522         (WebCore::ResourceUsageOverlay::platformInitialize):
1523         (-[WebOverlayLayer initWithResourceUsageOverlay:]): Deleted.
1524         (-[WebOverlayLayer drawInContext:]): Deleted.
1525
1526 2020-02-24  Andres Gonzalez  <andresg_22@apple.com>
1527
1528         [WebAccessibilityObjectWrapper updateObjectBackingStore] should return the backing object.
1529         https://bugs.webkit.org/show_bug.cgi?id=208153
1530
1531         Reviewed by Chris Fleizach.
1532
1533         Covered by existing tests.
1534
1535         Currently in many WebAccessibilityObjectWrapper's methods we call
1536         updateObjectBackingStore followed by one or more calls to
1537         axBackingObject. This patch eliminates this unnecessary call by making
1538         updateObjectBackingStore return the backing object. It also cleans up
1539         other unnecessary calls to axBackingObject and does some minor code
1540         cleanup.
1541
1542         * accessibility/mac/WebAccessibilityObjectWrapperBase.h:
1543         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
1544         (-[WebAccessibilityObjectWrapperBase updateObjectBackingStore]):
1545         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1546         (-[WebAccessibilityObjectWrapper ALLOW_DEPRECATED_IMPLEMENTATIONS_END]):
1547         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
1548         (-[WebAccessibilityObjectWrapper accessibilityFocusedUIElement]):
1549         (-[WebAccessibilityObjectWrapper accessibilityHitTest:]):
1550         (-[WebAccessibilityObjectWrapper accessibilityIsAttributeSettable:]):
1551         (-[WebAccessibilityObjectWrapper _accessibilityPerformPressAction]):
1552         (-[WebAccessibilityObjectWrapper _accessibilityPerformIncrementAction]):
1553         (-[WebAccessibilityObjectWrapper _accessibilityPerformDecrementAction]):
1554         (-[WebAccessibilityObjectWrapper accessibilityPerformAction:]):
1555         (-[WebAccessibilityObjectWrapper accessibilityReplaceRange:withText:]):
1556         (-[WebAccessibilityObjectWrapper accessibilityInsertText:]):
1557         (-[WebAccessibilityObjectWrapper _accessibilitySetValue:forAttribute:]):
1558         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
1559         (-[WebAccessibilityObjectWrapper accessibilityIndexOfChild:]):
1560         (-[WebAccessibilityObjectWrapper accessibilityArrayAttributeCount:]):
1561         (-[WebAccessibilityObjectWrapper accessibilityArrayAttributeValues:index:maxCount:]):
1562
1563 2020-02-24  Zalan Bujtas  <zalan@apple.com>
1564
1565         [LFC][IFC][Floats] Fix float box handling inside unbreakable content
1566         https://bugs.webkit.org/show_bug.cgi?id=208109
1567         <rdar://problem/59708646>
1568
1569         Reviewed by Antti Koivisto.
1570
1571         We've been handling float boxes and other inline items as mutually exclusive content (in the context of unbreakable candidate runs).
1572         While this works in most cases, when the unbreakable content includes float boxes, the layout
1573         ends up being incorrect.
1574         This patch is in preparation for making sure we process the inline content and the associated float boxes as one entity.
1575         (e.g "text_<div style="float: left"></div>_content" produces an unbreakable inline content of [text_][_content] and an associated float box)
1576
1577         * layout/inlineformatting/LineLayoutContext.cpp:
1578         (WebCore::Layout::isAtSoftWrapOpportunity):
1579         (WebCore::Layout::LineCandidate::FloatContent::append):
1580         (WebCore::Layout::LineCandidate::FloatContent::list const):
1581         (WebCore::Layout::LineCandidate::FloatContent::reset):
1582         (WebCore::Layout::LineCandidate::reset):
1583         (WebCore::Layout::LineLayoutContext::layoutLine):
1584         (WebCore::Layout::LineLayoutContext::nextContentForLine):
1585         (WebCore::Layout::LineLayoutContext::tryAddingFloatContent):
1586         (WebCore::Layout::LineLayoutContext::tryAddingFloatItem): Deleted.
1587         * layout/inlineformatting/LineLayoutContext.h:
1588
1589 2020-02-24  Chris Dumez  <cdumez@apple.com>
1590
1591         Document / DOMWindow objects get leaked on CNN.com due to CSSTransitions
1592         https://bugs.webkit.org/show_bug.cgi?id=208145
1593
1594         Reviewed by Antoine Quint.
1595
1596         Break reference cycles using WeakPtr so that CSSTransitions can no longer cause whole document / DOM trees to
1597         get leaked.
1598
1599         * animation/DocumentTimeline.cpp:
1600         (WebCore::DocumentTimeline::DocumentTimeline):
1601         * animation/DocumentTimeline.h:
1602         * animation/KeyframeEffect.cpp:
1603         (WebCore::KeyframeEffect::KeyframeEffect):
1604         (WebCore::KeyframeEffect::setTarget):
1605         * animation/KeyframeEffect.h:
1606
1607 2020-02-24  Youenn Fablet  <youenn@apple.com>
1608
1609         Add a runtime flag dedicated to WebRTC codecs in GPUProcess
1610         https://bugs.webkit.org/show_bug.cgi?id=208136
1611
1612         Reviewed by Alex Christensen.
1613
1614         Add a runtime flag for WebRTC codecs in GPUProcess.
1615         Enable the flag by default for MacOS.
1616
1617         * page/RuntimeEnabledFeatures.h:
1618         (WebCore::RuntimeEnabledFeatures::webRTCPlatformCodecsInGPUProcessEnabled const):
1619         (WebCore::RuntimeEnabledFeatures::setWebRTCPlatformCodecsInGPUProcessEnabled):
1620         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
1621         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
1622         * testing/Internals.cpp:
1623         (WebCore::Internals::resetToConsistentState):
1624         (WebCore::Internals::setUseGPUProcessForWebRTC):
1625
1626 2020-02-24  Simon Fraser  <simon.fraser@apple.com>
1627
1628         Remove geometry information from the scrolling tree
1629         https://bugs.webkit.org/show_bug.cgi?id=208085
1630
1631         Reviewed by Sam Weinig.
1632
1633         The scrolling tree doesn't have enough information to do hit-testing because it has
1634         no representation of layers that overlap scrollers. We'll have to do hit-testing another
1635         way, so remove hit-testing-geometry data from the scrolling tree.
1636
1637         * page/scrolling/AsyncScrollingCoordinator.cpp:
1638         (WebCore::AsyncScrollingCoordinator::setRectRelativeToParentNode): Deleted.
1639         * page/scrolling/AsyncScrollingCoordinator.h:
1640         * page/scrolling/ScrollingCoordinator.h:
1641         (WebCore::ScrollingCoordinator::setRectRelativeToParentNode): Deleted.
1642         * page/scrolling/ScrollingStateFrameHostingNode.cpp:
1643         (WebCore::ScrollingStateFrameHostingNode::ScrollingStateFrameHostingNode):
1644         (WebCore::ScrollingStateFrameHostingNode::dumpProperties const):
1645         (WebCore::ScrollingStateFrameHostingNode::setPropertyChangedBitsAfterReattach): Deleted.
1646         (WebCore::ScrollingStateFrameHostingNode::setParentRelativeScrollableRect): Deleted.
1647         * page/scrolling/ScrollingStateFrameHostingNode.h:
1648         * page/scrolling/ScrollingStateScrollingNode.cpp:
1649         (WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode):
1650         (WebCore::ScrollingStateScrollingNode::setPropertyChangedBitsAfterReattach):
1651         (WebCore::ScrollingStateScrollingNode::dumpProperties const):
1652         (WebCore::ScrollingStateScrollingNode::setParentRelativeScrollableRect): Deleted.
1653         * page/scrolling/ScrollingStateScrollingNode.h:
1654         (WebCore::ScrollingStateScrollingNode::parentRelativeScrollableRect const): Deleted.
1655         * page/scrolling/ScrollingTree.cpp:
1656         (WebCore::ScrollingTree::handleWheelEvent):
1657         (WebCore::ScrollingTree::scrollingNodeForPoint):
1658         * page/scrolling/ScrollingTree.h:
1659         * page/scrolling/ScrollingTreeFrameHostingNode.cpp:
1660         (WebCore::ScrollingTreeFrameHostingNode::commitStateBeforeChildren):
1661         (WebCore::ScrollingTreeFrameHostingNode::dumpProperties const):
1662         (WebCore::ScrollingTreeFrameHostingNode::parentToLocalPoint const): Deleted.
1663         * page/scrolling/ScrollingTreeFrameHostingNode.h:
1664         (WebCore::ScrollingTreeFrameHostingNode::parentRelativeScrollableRect const): Deleted.
1665         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
1666         (WebCore::ScrollingTreeFrameScrollingNode::parentToLocalPoint const): Deleted.
1667         (WebCore::ScrollingTreeFrameScrollingNode::localToContentsPoint const): Deleted.
1668         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
1669         * page/scrolling/ScrollingTreeNode.cpp:
1670         (WebCore::ScrollingTreeNode::ScrollingTreeNode):
1671         (WebCore::ScrollingTreeNode::scrollingNodeForPoint const): Deleted.
1672         * page/scrolling/ScrollingTreeNode.h:
1673         (WebCore::ScrollingTreeNode::parentToLocalPoint const): Deleted.
1674         (WebCore::ScrollingTreeNode::localToContentsPoint const): Deleted.
1675         * page/scrolling/ScrollingTreeScrollingNode.cpp:
1676         (WebCore::ScrollingTreeScrollingNode::commitStateBeforeChildren):
1677         (WebCore::ScrollingTreeScrollingNode::dumpProperties const):
1678         (WebCore::ScrollingTreeScrollingNode::parentToLocalPoint const): Deleted.
1679         (WebCore::ScrollingTreeScrollingNode::localToContentsPoint const): Deleted.
1680         (WebCore::ScrollingTreeScrollingNode::scrollingNodeForPoint const): Deleted.
1681         * page/scrolling/ScrollingTreeScrollingNode.h:
1682         * rendering/RenderLayerCompositor.cpp:
1683         (WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingRole):
1684         (WebCore::RenderLayerCompositor::updateScrollingNodeForFrameHostingRole):
1685         (WebCore::RenderLayerCompositor::rootParentRelativeScrollableRect const): Deleted.
1686         * rendering/RenderLayerCompositor.h:
1687
1688 2020-02-24  Alex Christensen  <achristensen@webkit.org>
1689
1690         WKWebViewConfiguration._corsDisablingPatterns should also disable CORS for non-DocumentThreadableLoader loading
1691         https://bugs.webkit.org/show_bug.cgi?id=208035
1692         <rdar://problem/58011337>
1693
1694         Reviewed by Tim Hatcher.
1695
1696         Covered by an API test.
1697
1698         * loader/CrossOriginAccessControl.cpp:
1699         (WebCore::createPotentialAccessControlRequest):
1700
1701 2020-02-24  Zalan Bujtas  <zalan@apple.com>
1702
1703         [LFC][IFC] Remove redundant trailing line break handling.
1704         https://bugs.webkit.org/show_bug.cgi?id=208108
1705         <rdar://problem/59708620>
1706
1707         Reviewed by Antti Koivisto.
1708
1709         LineLayoutContext::layoutLine should be able to handle both cases of trailing line breaks.
1710         (This patch also makes tryAddingInlineItems return explicit IsEndOfLine values.)
1711
1712         * layout/inlineformatting/LineLayoutContext.cpp:
1713         (WebCore::Layout::LineLayoutContext::layoutLine):
1714         (WebCore::Layout::LineLayoutContext::tryAddingInlineItems):
1715
1716 2020-02-24  Zalan Bujtas  <zalan@apple.com>
1717
1718         [LFC][IFC][Floats] Move float handling out of LineBreaker
1719         https://bugs.webkit.org/show_bug.cgi?id=208107
1720         <rdar://problem/59708575>
1721
1722         Reviewed by Antti Koivisto.
1723
1724         LineBreaker should only deal with inline content.
1725
1726         * layout/inlineformatting/InlineLineBreaker.cpp:
1727         (WebCore::Layout::LineBreaker::shouldWrapFloatBox): Deleted.
1728         * layout/inlineformatting/InlineLineBreaker.h:
1729         * layout/inlineformatting/LineLayoutContext.cpp:
1730         (WebCore::Layout::LineLayoutContext::tryAddingFloatItem):
1731
1732 2020-02-24  Antoine Quint  <graouts@webkit.org>
1733
1734         RenderLayerBacking::notifyAnimationStarted calls directly into the old animation controller
1735         https://bugs.webkit.org/show_bug.cgi?id=207979
1736
1737         Reviewed by Simon Fraser.
1738
1739         Only call into CSSAnimationController if the "Web Animations for CSS Animations" flag is disabled.
1740
1741         * rendering/RenderLayerBacking.cpp:
1742         (WebCore::RenderLayerBacking::notifyAnimationStarted):
1743
1744 2020-02-24  Rob Buis  <rbuis@igalia.com>
1745
1746         Handle page closure for stale-while-revalidate revalidations
1747         https://bugs.webkit.org/show_bug.cgi?id=204147
1748
1749         Reviewed by Youenn Fablet.
1750
1751         Add a new hook to LoaderStrategy to signal browsing context removal
1752         and call it when the main frame stops all loaders.
1753
1754         Test: imported/w3c/web-platform-tests/fetch/stale-while-revalidate/frame-removal.html
1755
1756         * loader/FrameLoader.cpp:
1757         (WebCore::FrameLoader::stopAllLoaders):
1758         * loader/LoaderStrategy.h:
1759         * loader/cache/CachedResource.cpp:
1760         (WebCore::CachedResource::canUseCacheValidator const):
1761
1762 2020-02-24  Andres Gonzalez  <andresg_22@apple.com>
1763
1764         Fix for build: follow up to bug 208074.
1765         https://bugs.webkit.org/show_bug.cgi?id=208133
1766
1767         Unreviewed build fix.
1768
1769         No new tests needed.
1770
1771         * accessibility/isolatedtree/AXIsolatedObject.cpp:
1772         (WebCore::AXIsolatedObject::cellForColumnAndRow):
1773
1774 2020-02-24  Philippe Normand  <pnormand@igalia.com>
1775
1776         [GStreamer][WPE] Add GstGLMemoryEGL support for the video-plane-display
1777         https://bugs.webkit.org/show_bug.cgi?id=208046
1778
1779         Reviewed by Žan Doberšek.
1780
1781         The glupload element might fill EGL memories in some cases, so for
1782         the video sink we can then directly access the corresponding
1783         EGLImage and export it to DMABuf, instead of using the more
1784         general GLMemory code path.
1785
1786         With this patch we also ensure that both DMABuf FD and stride are valid.
1787
1788         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1789         (WebCore::GstVideoFrameHolder::GstVideoFrameHolder):
1790         (WebCore::GstVideoFrameHolder::handoffVideoDmaBuf):
1791
1792 2020-02-23  Andres Gonzalez  <andresg_22@apple.com>
1793
1794         AXIsolatedObject support for tables.
1795         https://bugs.webkit.org/show_bug.cgi?id=208074
1796
1797         Reviewed by Chris Fleizach.
1798
1799         Covered by existing tests.
1800
1801         AccessibilityObjectWrapper code and some utility functions in
1802         AccessibilityObject.cpp assume that AX objects can be downcast to a
1803         specialized subclass like AccessibilityTable. That is not true for
1804         AXIsolatedObjects, and the reason why tables don’t work in IsolatedTree
1805         mode.
1806
1807         To solve this problem, this patch exposes the AccessibilityTable
1808         interface as part of the AXCoreObject. Thus it eliminates the need to
1809         downcast an AX object to an AccessibilityTable. It also implements the
1810         AccessibilityTable interface in the AXIsolatedObject class. The same
1811         approach will be used in subsequent patches for other specialized
1812         interfaces used by client code.
1813
1814         * accessibility/AccessibilityARIAGrid.cpp:
1815         (WebCore::AccessibilityARIAGrid::addChildren):
1816         * accessibility/AccessibilityARIAGrid.h:
1817         * accessibility/AccessibilityARIAGridCell.cpp:
1818         (WebCore::AccessibilityARIAGridCell::parentTable const):
1819         (WebCore::AccessibilityARIAGridCell::rowIndexRange const):
1820         (WebCore::AccessibilityARIAGridCell::columnIndexRange const):
1821         * accessibility/AccessibilityARIAGridRow.cpp:
1822         (WebCore::AccessibilityARIAGridRow::disclosedRows):
1823         (WebCore::AccessibilityARIAGridRow::disclosedByRow const):
1824         (WebCore::AccessibilityARIAGridRow::parentTable const):
1825         * accessibility/AccessibilityNodeObject.cpp:
1826         (WebCore::shouldUseAccessibilityObjectInnerText):
1827         * accessibility/AccessibilityObject.cpp:
1828         (WebCore::appendChildrenToArray): Use AXCoreObject interface instead of downcasting.
1829         (WebCore::Accessibility::isAccessibilityObjectSearchMatchAtIndex): Use AXCoreObject interface instead of downcasting.
1830         * accessibility/AccessibilityObject.h:
1831         * accessibility/AccessibilityObjectInterface.h: AXCoreObject now exposes the table interface.
1832         * accessibility/AccessibilityRenderObject.cpp:
1833         (WebCore::AccessibilityRenderObject::ariaSelectedRows):
1834         * accessibility/AccessibilityTable.cpp:
1835         (WebCore::AccessibilityTable::AccessibilityTable):
1836         (WebCore::AccessibilityTable::init):
1837         (WebCore::AccessibilityTable::isExposable const):
1838         (WebCore::AccessibilityTable::addChildren):
1839         (WebCore::AccessibilityTable::headerContainer): Returns an AXCoreObject.
1840
1841         The following methods now return a vector of objects instead of taking
1842         and out parameter. RVO guaranties that this does not cause extra copy.
1843         (WebCore::AccessibilityTable::columns):
1844         (WebCore::AccessibilityTable::rows):
1845         (WebCore::AccessibilityTable::columnHeaders):
1846         (WebCore::AccessibilityTable::rowHeaders):
1847         (WebCore::AccessibilityTable::visibleRows):
1848         (WebCore::AccessibilityTable::cells):
1849
1850         (WebCore::AccessibilityTable::tableLevel const):
1851         (WebCore::AccessibilityTable::roleValue const):
1852         (WebCore::AccessibilityTable::computeAccessibilityIsIgnored const):
1853         (WebCore::AccessibilityTable::title const):
1854         (WebCore::AccessibilityTable::isExposableThroughAccessibility const): Renamed to just isExposable.
1855         * accessibility/AccessibilityTable.h:
1856         (WebCore::AccessibilityTable::supportsSelectedRows): Deleted.
1857         * accessibility/AccessibilityTableCell.cpp:
1858         (WebCore::AccessibilityTableCell::parentTable const):
1859         (WebCore::AccessibilityTableCell::isTableCell const):
1860         (WebCore::AccessibilityTableCell::columnHeaders):
1861         (WebCore::AccessibilityTableCell::rowHeaders):
1862         * accessibility/AccessibilityTableCell.h:
1863         * accessibility/AccessibilityTableColumn.cpp:
1864         (WebCore::AccessibilityTableColumn::headerObject):
1865         (WebCore::AccessibilityTableColumn::addChildren):
1866         * accessibility/AccessibilityTableHeaderContainer.cpp:
1867         (WebCore::AccessibilityTableHeaderContainer::addChildren):
1868         * accessibility/AccessibilityTableRow.cpp:
1869         (WebCore::AccessibilityTableRow::isTableRow const):
1870         (WebCore::AccessibilityTableRow::parentTable const):
1871         * accessibility/atk/WebKitAccessible.cpp:
1872         (webkitAccessibleGetAttributes):
1873         * accessibility/atk/WebKitAccessibleInterfaceTable.cpp:
1874         (webkitAccessibleTableGetColumnHeader):
1875         (webkitAccessibleTableGetRowHeader):
1876         * accessibility/atk/WebKitAccessibleInterfaceTableCell.cpp:
1877         (webkitAccessibleTableCellGetColumnHeaderCells):
1878         (webkitAccessibleTableCellGetRowHeaderCells):
1879         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1880         (-[WebAccessibilityObjectWrapper tableParent]):
1881         (-[WebAccessibilityObjectWrapper accessibilityHeaderElements]):
1882         * accessibility/isolatedtree/AXIsolatedObject.cpp:
1883         (WebCore::AXIsolatedObject::initializeAttributeData):
1884         (WebCore::AXIsolatedObject::setObjectVectorProperty):
1885         (WebCore::AXIsolatedObject::cellForColumnAndRow):
1886         (WebCore::AXIsolatedObject::fillChildrenVectorForProperty const):
1887         (WebCore::AXIsolatedObject::isAccessibilityTableInstance const):
1888         (WebCore::AXIsolatedObject::isDataTable const): Deleted.
1889         * accessibility/isolatedtree/AXIsolatedObject.h:
1890         * accessibility/isolatedtree/AXIsolatedTree.cpp:
1891         (WebCore::AXIsolatedTree::nodeForID const):
1892         (WebCore::AXIsolatedTree::objectsForIDs const):
1893         * accessibility/isolatedtree/AXIsolatedTree.h:
1894         * accessibility/mac/AXObjectCacheMac.mm:
1895         (WebCore::AXObjectCache::postPlatformNotification):
1896         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1897         In addition to replacing the downcast to AccessibilityTable, cleaned up
1898         the unnecessary calls to self.axBackingObject. This used to be a macro,
1899         but it is now a method that check for the execution thread and returns
1900         the appropriate AX object.
1901         (-[WebAccessibilityObjectWrapper additionalAccessibilityAttributeNames]):
1902         (-[WebAccessibilityObjectWrapper ALLOW_DEPRECATED_IMPLEMENTATIONS_END]):
1903         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
1904         (-[WebAccessibilityObjectWrapper _accessibilitySetValue:forAttribute:]):
1905         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
1906
1907 2020-02-23  Adrian Perez de Castro  <aperez@igalia.com>
1908
1909         Non-unified build fixes late February 2020 edition
1910         https://bugs.webkit.org/show_bug.cgi?id=208111
1911
1912         Unreviewed build fix.
1913
1914         No new tests needed.
1915
1916         * dom/WindowEventLoop.cpp: Add missing include.
1917         * html/HTMLEmbedElement.cpp: Ditto.
1918         * html/HTMLFrameSetElement.cpp: Ditto.
1919         * html/HTMLOptionElement.cpp: Ditto.
1920         * html/HTMLTablePartElement.cpp: Ditto.
1921         * html/HTMLTextFormControlElement.cpp: Ditto.
1922         * html/RangeInputType.cpp: Ditto.
1923         * inspector/agents/InspectorCSSAgent.cpp: Ditto.
1924         * loader/ImageLoader.h: Add missing forward declration for WebCore::Document.
1925         * platform/graphics/ImageBuffer.cpp: Add missing include.
1926         * platform/graphics/filters/FilterEffect.cpp: Ditto.
1927         * platform/wpe/ThemeWPE.h: Add missing include and forward declaration for WebCore::Path.
1928         * svg/graphics/filters/SVGFilterBuilder.cpp: Add missing include.
1929
1930 2020-02-23  Darin Adler  <darin@apple.com>
1931
1932         Follow up element iterator work by reducing includes and using is<> in a few more places
1933         https://bugs.webkit.org/show_bug.cgi?id=207816
1934
1935         Reviewed by Antti Koivisto.
1936
1937         * accessibility/AccessibilityTableColumn.cpp: Removed unneeded includes.
1938         * bindings/js/JSDOMWindowCustom.cpp: Ditto.
1939         * dom/CustomElementRegistry.cpp: Ditto.
1940         * dom/Node.cpp: Ditto.
1941         * editing/markup.cpp: Ditto.
1942         * html/GenericCachedHTMLCollection.cpp: Ditto.
1943         * html/HTMLCollection.cpp: Ditto.
1944         * html/HTMLFrameSetElement.cpp: Ditto.
1945         * html/track/TextTrackCue.cpp: Ditto.
1946         * page/scrolling/AxisScrollSnapOffsets.cpp: Ditto.
1947
1948         * platform/DataListSuggestionsClient.h: Reduced includes, use forward declarations.
1949
1950         * style/StyleResolver.cpp:
1951         (WebCore::Style::isAtShadowBoundary): Use the is<ShadowRoot> function.
1952
1953         * rendering/svg/RenderSVGResourceClipper.cpp:
1954         (WebCore::RenderSVGResourceClipper::pathOnlyClipping): Use is<RenderSVGText> and
1955         is<SVGGraphicsElement>, tweak coding style a tiny bit, and fix wording of comments.
1956
1957         * svg/SVGAElement.cpp:
1958         (WebCore::SVGAElement::createElementRenderer): Use is<SVGElement>.
1959
1960         * svg/SVGElement.cpp: Removed unneeded includes.
1961         (WebCore::SVGElement::isOutermostSVGSVGElement): Use is<SVGElement> and
1962         is<SVGForeignObjectElement>.
1963         (WebCore::SVGElement::reportAttributeParsingError): Use is<SVGElement>.
1964         (WebCore::SVGElement::updateRelativeLengthsInformation): Use
1965         is<SVGGraphicsElement> and is<SVGElement>, and use an if statement instead of
1966         a while loop since this doesn't loop.
1967
1968 2020-02-22  Darin Adler  <darin@apple.com>
1969
1970         Fix HTMLDataListElement.options to include even options that are not suggestions
1971         https://bugs.webkit.org/show_bug.cgi?id=208102
1972
1973         Reviewed by Antti Koivisto.
1974
1975         * html/ColorInputType.cpp:
1976         (WebCore::ColorInputType::suggestedColors const): Use
1977         HTMLDataListElement::suggestions instead of HTMLCollection, both for efficiency
1978         and for correctness.
1979
1980         * html/GenericCachedHTMLCollection.cpp:
1981         (WebCore::GenericCachedHTMLCollection<traversalType>::elementMatches const):
1982         Removed code to filter out options that are not valid suggestions. This is not
1983         called for in the HTML specification.
1984
1985         * html/HTMLDataListElement.cpp:
1986         (WebCore::HTMLDataListElement::isSuggestion): Added.
1987
1988         * html/HTMLDataListElement.h: Added isSuggestion and suggestions functions so
1989         logic about which datalist options are suggestions can be easily shared. The
1990         suggestions uses the new filteredDescendants function template.
1991
1992         * html/HTMLInputElement.cpp:
1993         (WebCore::HTMLInputElement::setupDateTimeChooserParameters): Use
1994         HTMLDataListElement::suggestions instead of HTMLCollection.
1995
1996         * html/TextFieldInputType.cpp:
1997         (WebCore::TextFieldInputType::suggestions):  Use
1998         HTMLDataListElement::suggestions instead of HTMLCollection. Also added a FIXME
1999         since this implementation uses case-insensitive ASCII but it's for user interface
2000         and the current implementation might be insufficient for some lanagues.
2001
2002         * rendering/RenderTheme.cpp:
2003         (WebCore::RenderTheme::paintSliderTicks): Use
2004         HTMLDataListElement::suggestions instead of HTMLCollection.
2005
2006 2020-02-22  Darin Adler  <darin@apple.com>
2007
2008         Refine the DOM element iterator implementation
2009         https://bugs.webkit.org/show_bug.cgi?id=208100
2010
2011         Reviewed by Antti Koivisto.
2012
2013         - Removed the duplicate descendant iterator, keeping the one that matches
2014           the style of the ancestor and child iterators.
2015         - Removed the non-template elementAncestors, elementChildren, elementDescendants,
2016           and elementLineage functions and changed callers to use xxxOfType<Element> instead.
2017         - Renamed "IteratorAdapter" templates to "Range", choosing that term to match the
2018           upcoming C++20 Ranges library and range-based for loops.
2019         - Changed the iterators to use an actual "nullptr" for end, following the "sentinel"
2020           design pattern from the Ranges library. Still kept a tiny bit of using an iterator
2021           for end around, only so we can use iterator library functions like std::distance
2022           while waiting for std::ranges::distance, which is compatible with sentinels.
2023         - Implemented const correctness by using const types instead of separate "Const"
2024           class templates. This cut down on source code size a lot. These element iterators
2025           don't need whole separate templates to implement the const correctness the way
2026           collection classes like HashMap do.
2027         - Improved some other details, like using more const and constexpr on members.
2028           All the functions on a range are const, because the range itself doesn't ever
2029           get modified, and all functions on an iterator are also const, because only
2030           operations like ++ and -- actually modify the iterator.
2031         - For now at least, removed extra code we don't need in practice. We never need to
2032           compare iterators to each other except when iterating a range, for example, so
2033           kept the != used for range iteration but not ==.
2034         - Simplified the HTMLCollection implementations by taking advantage of the null-
2035           based and sentinel designs. There are various places where we can write
2036           simpler code and pass around fewer arguments.
2037         - Added a new descendantsOfType template that takes a predicate and filters to only
2038           the elements that match that predicate. Similar concept to how we implement HTML
2039           collections, and possibly could be used even more eventually.
2040         - Use std::iterator in ElementIterator so we don't need to do that in derived
2041           classes. Also made more of ElementIterator protected to make it more explicit
2042           that it's an abstract class template and not something to be used directly.
2043
2044         The most unusual clients of the elmeent ranges and iterators are HTMLCollection and
2045         the related caches, and this patch includes changes to those to adopt the new model.
2046
2047         * Headers.cmake: Removed ElementDescendantIterator.h.
2048         * WebCore.xcodeproj/project.pbxproj: Ditto.
2049
2050         * dom/ChildNodeList.cpp:
2051         (WebCore::ChildNodeList::ChildNodeList): Removed initialization of m_indexCache
2052         since the constructor no longer requires arguments.
2053         (WebCore::ChildNodeList::invalidateCache): Removed argument to
2054         CollectionIndexCache::invalidate.
2055         * dom/ChildNodeList.h: Removed collectionEnd, since it's no longer needed.
2056
2057         * dom/CollectionIndexCache.h: Removed the collection argument to the
2058         constructor, hasValidCache, and invalidate functions. Updated algorithms to use
2059         null style termination instead of actually relying on comparing with an end
2060         iterator, since that works for our element iterators.
2061
2062         * dom/ContainerNode.cpp:
2063         (WebCore::ContainerNode::childElementCount const):: Use an empty initializer
2064         list instead of the result of the end function since std::distance requires
2065         both begin and end iterators have the same type.
2066
2067         * dom/ElementAncestorIterator.h: Made the changes mentioned above, plus moved the
2068         declarations of functions to the top of the file, since the classes are
2069         implementation details, used downcast instead of static_cast.
2070
2071         * dom/ElementAndTextDescendantIterator.h: Renamed IteratorAdapter to Range,
2072         mostly didn't make other changes since this is not one of the element iterators.
2073
2074         * dom/ElementChildIterator.h: Made the changes mentioned above, plus moved the
2075         declarations of functions to the top of the file, since the classes are
2076         implementation details.
2077
2078         * dom/ElementDescendantIterator.h: Removed.
2079
2080         * dom/ElementIterator.h: Made the changes mentioned above.
2081
2082         * dom/LiveNodeList.cpp: Removed some unneeded includes, including HTMLCollection.h.
2083         (WebCore::LiveNodeList::LiveNodeList): Simplified a little bit.
2084         (WebCore::LiveNodeList::rootNode): Moved to the header.
2085
2086         * dom/LiveNodeList.h: Updated since CollectionTraversal now uses the
2087         more modern ElementDescendantIterator, not the older one that used a vector of
2088         ancestors to do the iteration. Also use WTF_MAKE_ISO_NONALLOCATABLE since
2089         LiveNodeList is an abstract class, and made some members protected. Removed
2090         CachedLiveNodeList::rootNode since it was identical to LiveNodeList::rootNode,
2091         and made LiveNodeList::rootNode protected so it can be called in
2092         CachedLiveNodeList, and moved it to the header so it will still be inlined.
2093         Simplified CachedListNodeList to use more final, to name long types less by
2094         using "auto" and "using", and to not pass arguments to functions that don't
2095         need them any more.
2096
2097         * dom/NameNodeList.cpp:
2098         (WebCore::NameNodeList::create): Moved here from the header.
2099         * dom/NameNodeList.h: Removed unneeded includes and comment, moved create
2100         function out of the header.
2101
2102         * dom/TypedElementDescendantIterator.h: Made all the change mentioned above.
2103         Also added a new filteredDescendants function, range, and iterator that uses
2104         a filter function. Not used yet in this patch; use comes in a future one.
2105
2106         * html/CachedHTMLCollection.h: Updated includes, shortened type names,
2107         and used auto to simplify the code a bit. Removed unneeded collection arguments
2108         from various CollectionIndexCache functions.
2109
2110         * html/CollectionTraversal.h: Updated to use the new/typed version of
2111         ElementDescendantIterator. Removed end functions. Use shorter type names.
2112         Tweaked algorithms to use null termination for loops instead of end iterators.
2113
2114         * html/HTMLFormControlsCollection.h:
2115         (WebCore::HTMLFormControlsCollection::item const): Removed unneeded class
2116         template arguments.
2117
2118         * html/HTMLFormElement.cpp:
2119         (WebCore::HTMLFormElement::formElementIndex): Changed to use the null check
2120         instead of comparing iterator with end.
2121         * html/HTMLMediaElement.cpp:
2122         (WebCore::HTMLMediaElement::selectNextSourceChild): Ditto.
2123
2124         * html/HTMLTableSectionElement.cpp:
2125         (WebCore::HTMLTableSectionElement::numRows const): Pass a default-constructed
2126         iterator for end to std::distance. When we get C++20 we can clean this up by
2127         using std::ranges::distances instead.
2128
2129         * html/LabelsNodeList.cpp:
2130         (WebCore::LabelsNodeList::create): Moved here from the header.
2131         * html/LabelsNodeList.h: Removed unneeded include, tweaked coding style a bit,
2132         moved create function into the .cpp file.
2133
2134         * html/RadioNodeList.cpp: Removed unneeded include.
2135         (WebCore::RadioNodeList::create): Moved this here from the header.
2136         (WebCore::nonEmptyRadioButton): Renamed from toRadioButtonInputElement to make
2137         a little clearer what the function does.
2138         (WebCore::RadioNodeList::value const): Updated to use nonEmptyRadioButton and
2139         straighten out the loop a tiny bit.
2140         (WebCore::RadioNodeList::setValue): Ditto.
2141         (WebCore::RadioNodeList::checkElementMatchesRadioNodeListFilter const): Deleted.
2142         (WebCore::RadioNodeList::elementMatches const): Merged in the logic from
2143         checkElementMatchesRadioNodeListFilter, since the separate function wasn't helpful.
2144
2145         * html/RadioNodeList.h: Removed unneeded includes. Moved the create function out
2146         of the header. Removed unneeded override of the item function to tighten the
2147         return type; not used in WebCore and not helpful for bindings. Made more private.
2148
2149         * style/StyleInvalidator.cpp:
2150         (WebCore::Style::Invalidator::invalidateStyleForDescendants): Use null checking
2151         style for the loop rather than comparing with end.
2152         (WebCore::Style::Invalidator::invalidateStyleWithMatchElement): Remove an unneeded
2153         local variable and braces.
2154
2155         * svg/SVGUseElement.cpp:
2156         (WebCore::removeDisallowedElementsFromSubtree): Use null checking style rather than
2157         comparing with end.
2158         (WebCore::SVGUseElement::expandUseElementsInShadowTree const): Ditto. Also use
2159         dropAssertions rather than assigning to end with a comment saying it drops assertions.
2160         (WebCore::SVGUseElement::expandSymbolElementsInShadowTree const): Ditto.
2161
2162 2020-02-22  Darin Adler  <darin@apple.com>
2163
2164         Put more of the datalist element implementation inside ENABLE(DATALIST_ELEMENT)
2165         https://bugs.webkit.org/show_bug.cgi?id=208098
2166
2167         Reviewed by Antti Koivisto.
2168
2169         * html/HTMLFormControlElement.cpp:
2170         (WebCore::HTMLFormControlElement::computeWillValidate const): Use
2171         ancestorsOfType instead of a loop. Since this involves using the class
2172         HTMLDataListElement, it's only implemented when ENABLE(DATALIST_ELEMENT)
2173         is true. The old code would always do this validation for elements with
2174         the datalist tag even if the element is not implemented, so this changes
2175         behavior and affects some test results.
2176
2177 2020-02-22  Jer Noble  <jer.noble@apple.com>
2178
2179         Stop using QTKit for rendering WK1 video fullscreen controls
2180         https://bugs.webkit.org/show_bug.cgi?id=207795
2181         <rdar://problem/48894915>
2182
2183         Reviewed by Jon Lee.
2184
2185         Drive-by fixes:
2186
2187         - Don't set the video layer to not-visible when in video fullscreen mode.
2188         - Export previously un-exported methods.
2189         - Make some ios-only classes available on mac.
2190         - Add a couple previously unimplemented properties to WebAVPlayerController needed by AVKit.
2191         - WebCoreFullscreenWindow doesn't depend on FULLSCREEN_API.
2192
2193         * WebCore.xcodeproj/project.pbxproj:
2194         * html/HTMLMediaElement.cpp:
2195         (WebCore::HTMLMediaElement::visibilityStateChanged):
2196         * html/HTMLMediaElement.h:
2197         (WebCore::HTMLMediaElement::setVideoFullscreenLayer):
2198         * platform/ios/PlaybackSessionInterfaceAVKit.h:
2199         * platform/ios/PlaybackSessionInterfaceAVKit.mm:
2200         (WebCore::PlaybackSessionInterfaceAVKit::externalPlaybackChanged):
2201         * platform/ios/WebAVPlayerController.h:
2202         * platform/ios/WebAVPlayerController.mm:
2203         (-[WebAVPlayerController canSeekFrameBackward]):
2204         (-[WebAVPlayerController canSeekFrameForward]):
2205         * platform/mac/WebCoreFullScreenWindow.h:
2206         * platform/mac/WebCoreFullScreenWindow.mm:
2207
2208 2020-02-22  Darin Adler  <darin@apple.com>
2209
2210         Use DOM element iterators more, and more consistently
2211         https://bugs.webkit.org/show_bug.cgi?id=208097
2212
2213         Reviewed by Antti Koivisto.
2214
2215         - Added uses of element iterators in many places that had hand-written loops.
2216         - Eliminated most uses of elementAncestors, elementChildren, elementDescendants,
2217           and elementLineage functions and use ancestorsOfType<Element>,
2218           childrenOfType<Element>, descendantsOfType<Element> and lineageOfType<Element>
2219           instead. In particular, descendantsOfType<Element> uses a better traversal
2220           algorithm than elementDescendants does.
2221
2222         - Unrelated: Omit template arguments in various cases where the C++ language lets
2223           us just give the name of the class template without repeating the arguments.
2224         - Unrelated: Remove some uses of the inefficient Node::nodeType function.
2225
2226         * accessibility/AccessibilityNodeObject.cpp:
2227         (WebCore::AccessibilityNodeObject::mouseButtonListener const): Use
2228         lineageOfType instead of elementLineage.
2229
2230         * accessibility/AccessibilityRenderObject.cpp:
2231         (WebCore::AccessibilityRenderObject::accessibilityImageMapHitTest const):
2232         Use ancestorsOfType instead of a handwritten loop.
2233
2234         * dom/AllDescendantsCollection.h:
2235         (WebCore::AllDescendantsCollection::AllDescendantsCollection): Removed
2236         class template arguments.
2237         * dom/ClassCollection.h:
2238         (WebCore::ClassCollection::ClassCollection): Ditto.
2239
2240         * dom/DocumentFragment.cpp:
2241         (WebCore::DocumentFragment::getElementById const): Use
2242         descendantsOfType insteadof elementDescendants.
2243
2244         * dom/Element.cpp:
2245         (WebCore::Element::computeInheritedLanguage const): Use lineageOfType
2246         instead of a handrwitten loop.
2247
2248         * dom/SelectorQuery.cpp:
2249         (WebCore::SelectorDataList::closest const): Use lineageOfType instead of an
2250         explicit loop.
2251         (WebCore::elementsForLocalName): Use descendantsOfType instead of elementDescendants.
2252         (WebCore::anyElement): Ditto.
2253         (WebCore::SelectorDataList::executeSingleTagNameSelectorData const): Ditto.
2254         (WebCore::SelectorDataList::executeSingleClassNameSelectorData const): Ditto.
2255         (WebCore::SelectorDataList::executeSingleSelectorData const): Ditto.
2256         (WebCore::SelectorDataList::executeSingleMultiSelectorData const): Ditto.
2257         (WebCore::SelectorDataList::executeCompiledSimpleSelectorChecker const): Ditto.
2258         (WebCore::SelectorDataList::executeCompiledSelectorCheckerWithCheckingContext const): Ditto.
2259         (WebCore::SelectorDataList::executeCompiledSingleMultiSelectorData const): Ditto.
2260
2261         * dom/TagCollection.cpp:
2262         (WebCore::TagCollectionNS::TagCollectionNS): Removed class template arguments.
2263         (WebCore::TagCollection::TagCollection): Ditto.
2264         (WebCore::HTMLTagCollection::HTMLTagCollection): Ditto.
2265
2266         * editing/Editor.cpp:
2267         (WebCore::Editor::applyEditingStyleToBodyElement const): Use the function
2268         descendantsOfType<HTMLBodyElement> instead of getElementByTagName(bodyTag).
2269         Also merged applyEditingStyleToElement in here.
2270         (WebCore::Editor::applyEditingStyleToElement const): Deleted.
2271
2272         * editing/Editor.h: Deleted applyEditingStyleToElement.
2273
2274         * editing/FrameSelection.cpp:
2275         (WebCore::scanForForm): Cleaned up descendantsOfType loop so there's no
2276         explicit use of end. Also changed if nesting a little bit.
2277
2278         * editing/TextManipulationController.cpp:
2279         (WebCore::ExclusionRuleMatcher::isExcluded): Use lineageOfType instead of
2280         elementLineage.
2281
2282         * html/HTMLAllCollection.h: Removed class template arguments.
2283
2284         * html/HTMLElement.cpp:
2285         (WebCore::elementAffectsDirectionality): Refactored so we get a more efficient
2286         implementation when the type of the element is known.
2287         (WebCore::HTMLElement::adjustDirectionalityIfNeededAfterChildAttributeChanged):
2288         Use lineageOfType instead of elementLineage.
2289
2290         * html/HTMLElement.h: Removed some uneeeded forward declarations.
2291
2292         * html/HTMLEmbedElement.cpp:
2293         (WebCore::findWidgetRenderer): Use ancestorsOfType instead of a loop.
2294
2295         * html/HTMLFormControlElement.cpp:
2296         (WebCore::HTMLFormControlElement::enclosingFormControlElement): Deleted.
2297
2298         * html/HTMLFormControlElement.h: Deleted unused enclosingFormControlElement.
2299
2300         * html/HTMLFormControlsCollection.cpp:
2301         (WebCore::HTMLFormControlsCollection::HTMLFormControlsCollection): Removed
2302         class template arguments.
2303         (WebCore::HTMLFormControlsCollection::ownerNode const): Ditto.
2304         (WebCore::HTMLFormControlsCollection::invalidateCacheForDocument): Ditto.
2305
2306         * html/HTMLOptGroupElement.cpp:
2307         (WebCore::HTMLOptGroupElement::ownerSelectElement const): Use ancestorsOfType
2308         instead of a hand-written loop.
2309
2310         * html/HTMLOptionElement.cpp:
2311         (WebCore::HTMLOptionElement::parseAttribute): Use ancestorsOfType instead of
2312         calling ownerDataListElement.
2313         (WebCore::HTMLOptionElement::childrenChanged): Ditto.
2314         (WebCore::HTMLOptionElement::ownerDataListElement const): Deleted. Since the
2315         same option element can be used by multiple nested data list elements, the
2316         concept of a single "owner" data list element isn't correct.
2317         (WebCore::HTMLOptionElement::ownerSelectElement const): Use ancestorsOfType
2318         instead of a hand-written loop.
2319
2320         * html/HTMLOptionElement.h: Deleted ownerDataListElement.
2321
2322         * html/HTMLOptionsCollection.cpp:
2323         (WebCore::HTMLOptionsCollection::HTMLOptionsCollection): Removed class
2324         template arguments.
2325
2326         * html/HTMLTableCellElement.cpp:
2327         (WebCore::HTMLTableCellElement::additionalPresentationAttributeStyle const):
2328         Use auto since findParentTable now returns a const table pointer.
2329         * html/HTMLTableColElement.cpp:
2330         (WebCore::HTMLTableColElement::additionalPresentationAttributeStyle const):
2331         Ditto.
2332
2333         * html/HTMLTableElement.cpp:
2334         (WebCore::HTMLTableElement::createSharedCellStyle): Made const.
2335         (WebCore::HTMLTableElement::additionalCellStyle): Ditto.
2336         (WebCore::HTMLTableElement::additionalGroupStyle): Ditto.
2337
2338         * html/HTMLTableElement.h: Made the functions const, and m_sharedCellStyle
2339         mutable.
2340
2341         * html/HTMLTablePartElement.cpp:
2342         (WebCore::HTMLTablePartElement::findParentTable const): Use ancestorsOfType
2343         instead of a hand-written loop. Also revised return type to be const-consistent.
2344
2345         * html/HTMLTablePartElement.h: Updated return type.
2346
2347         * html/HTMLTableRowsCollection.cpp:
2348         (WebCore::HTMLTableRowsCollection::HTMLTableRowsCollection): Removed class
2349         template arguments.
2350
2351         * html/HTMLTextFormControlElement.cpp:
2352         (WebCore::parentHTMLElement): Deleted.
2353         (WebCore::HTMLTextFormControlElement::directionForFormData const): Use
2354         lineageOfType rather than a hand-written loop. Also got rid of the multiple
2355         strings in return paths since the function always returns one of two strings.
2356
2357         * inspector/InspectorAuditAccessibilityObject.cpp:
2358         (WebCore::InspectorAuditAccessibilityObject::getElementsByComputedRole):
2359         Use descendantsOfType instead of elementDescendants.
2360
2361         * inspector/agents/InspectorCSSAgent.cpp:
2362         (WebCore::InspectorCSSAgent::getMatchedStylesForNode): Use ancestorsOfType
2363         instead of a hand-written loop.
2364
2365         * inspector/agents/InspectorDOMAgent.cpp:
2366         (WebCore::InspectorDOMAgent::inspect): Use isElementNode and isDocumentNode
2367         instead of the much slower nodeType.
2368         (WebCore::InspectorDOMAgent::highlightMousedOverNode): Use isTextNode instead of
2369         the much slower nodeType.
2370
2371         * page/DragController.cpp:
2372         (WebCore::containingLinkElement): Added. Uses lineageOfType instead of elementLineage.
2373         (WebCore::DragController::doSystemDrag): Updated for the above.
2374
2375         * rendering/svg/SVGRenderSupport.cpp:
2376         (WebCore::SVGRenderSupport::updateMaskedAncestorShouldIsolateBlending):
2377         Use ancestorsOfType instead of a hand-written loop.
2378
2379         * svg/SVGElement.h: Make computedStyle public so we can use it even after downcasting
2380         to SVGElement or a class derived from it. This arises in the revised version of
2381         SVGRenderSupport::updateMaskedAncestorShouldIsolateBlending, which will now be able
2382         to compile a non-virtual call to the function as a bonus.
2383
2384         * xml/parser/XMLDocumentParser.cpp:
2385         (WebCore::findXMLParsingNamespaces): Factored this function out from
2386         parseDocumentFragment. Use lineageOfType instead of elementLineage. Also add a null
2387         check that seems to have been needed before.
2388         (WebCore::XMLDocumentParser::parseDocumentFragment): Use findXMLParsingNamespaces.
2389
2390 2020-02-22  Darin Adler  <darin@apple.com>
2391
2392         Some small improvements to DOM bindings for HTML collections
2393         https://bugs.webkit.org/show_bug.cgi?id=208092
2394
2395         Reviewed by Antti Koivisto.
2396
2397         * WebCore.xcodeproj/project.pbxproj: Added RadioNodeList.idl.
2398
2399         * html/HTMLAllCollection.idl: Specify [RequiresExistingAtomString] on the
2400         argument to namedItem, and [AtomString] for the argument to item.
2401         * html/HTMLCollection.idl: Ditto.
2402         * html/HTMLFormControlsCollection.idl: Ditto.
2403         * html/HTMLOptionsCollection.idl: Ditto.
2404         * html/HTMLSelectElement.idl: Ditto.
2405
2406         * html/RadioNodeList.idl: Removed unneeded getter; the inherited one from NodeList
2407         works correctly, and this isn't more efficient because of a more specific type.
2408
2409 2020-02-21  Wenson Hsieh  <wenson_hsieh@apple.com>
2410
2411         Remove an unused local variable after r256808
2412         https://bugs.webkit.org/show_bug.cgi?id=208072
2413
2414         Reviewed by Chris Dumez.
2415
2416         Remove scriptsToExecuteSoon.
2417
2418         * dom/ScriptRunner.cpp:
2419         (WebCore::ScriptRunner::timerFired):
2420
2421 2020-02-21  Said Abou-Hallawa  <sabouhallawa@apple.com>
2422
2423         Create a new ImageBuffer type for drawing on a DisplayList
2424         https://bugs.webkit.org/show_bug.cgi?id=207109
2425
2426         Reviewed by Simon Fraser.
2427
2428         DisplayList::ImageBuffer inherits ConcreteImageBuffer and DrawingContext.
2429         The drawing context will be the context of DrawingContext. The operations
2430         of ConcreteImageBuffer will have to ensure the recorded display-list is
2431         replayed back before getting the pixels of the ImageBufferBackend.
2432
2433         * Sources.txt:
2434         * WebCore.xcodeproj/project.pbxproj:
2435
2436         * html/HTMLCanvasElement.cpp:
2437         (WebCore::HTMLCanvasElement::createContext2d):
2438         (WebCore::HTMLCanvasElement::setUsesDisplayListDrawing):
2439         (WebCore::HTMLCanvasElement::setTracksDisplayListReplay):
2440         (WebCore::HTMLCanvasElement::displayListAsText const):
2441         (WebCore::HTMLCanvasElement::replayDisplayListAsText const):
2442         All the DisplayList operations will be routed to the DrawingContext of
2443         the ImageBuffer.
2444
2445         (WebCore::HTMLCanvasElement::createImageBuffer const):
2446         createImageBuffer() can decide the ImageBuffer type based on the settings
2447         and the size of the canvas.
2448
2449         * html/HTMLCanvasElement.h:
2450         * platform/graphics/ConcreteImageBuffer.h:
2451         (WebCore::ConcreteImageBuffer::create):
2452         The type of the ImageBuffer will be passed to this function such that
2453         it can create instances of derived classes.
2454
2455         * platform/graphics/ImageBuffer.cpp:
2456         (WebCore::ImageBuffer::create):
2457         Create ImageBuffers which record the drawing commands to DisplayLists before
2458         committing them to the back-ends.
2459
2460         * platform/graphics/ImageBuffer.h:
2461         (WebCore::ImageBuffer::drawingContext):
2462         (WebCore::ImageBuffer::flushDrawingContext):
2463         Add virtual methods to support DisplayList in ImageBuffer.
2464
2465         * platform/graphics/PlatformImageBuffer.h:
2466         * platform/graphics/RenderingMode.h:
2467         Add DisplayList types to RenderingMode and define platform types for
2468         DisplayList ImageBuffers.
2469
2470         * platform/graphics/displaylists/DisplayListDrawingContext.cpp: Added.
2471         (WebCore::DisplayList::DrawingContext::DrawingContext):
2472         (WebCore::DisplayList::DrawingContext::setTracksDisplayListReplay):
2473         (WebCore::DisplayList::DrawingContext::replayDisplayList):
2474         * platform/graphics/displaylists/DisplayListDrawingContext.h: Added.
2475         (WebCore::DisplayList::DrawingContext::context const):
2476         (WebCore::DisplayList::DrawingContext::displayList):
2477         (WebCore::DisplayList::DrawingContext::displayList const):
2478         (WebCore::DisplayList::DrawingContext::replayedDisplayList const):
2479         DisplayList::DrawingContext holds a recording and an optional replaying 
2480         back DisplayLists. It also provides a recording GraphicsContext.
2481
2482         * platform/graphics/displaylists/DisplayListImageBuffer.h: Added.
2483         (WebCore::DisplayList::ImageBuffer::create):
2484         (WebCore::DisplayList::ImageBuffer::ImageBuffer):
2485         (WebCore::DisplayList::ImageBuffer::~ImageBuffer):
2486         Drawing commands will be recorded first because context() is overridden
2487         to return the GraphicsContext of DrawingContext. These drawing commands
2488         will be flushed before getting the pixels of the back-end because 
2489         flushDrawingContext() is overridden to replay back the recorded DisplayList
2490         to the GraphicsContext of the back-end.
2491
2492 2020-02-21  Wenson Hsieh  <wenson_hsieh@apple.com>
2493
2494         [macOS] Large form controls are rendered at the wrong NSControlSize
2495         https://bugs.webkit.org/show_bug.cgi?id=208043
2496         <rdar://problem/59659134>
2497
2498         Reviewed by Tim Horton.
2499
2500         When painting form controls that are larger than a certain threshold (for the most part, 21px), use
2501         NSControlSizeLarge instead of NSControlSizeRegular. This makes us choose a more appropriate appearance when
2502         painting native large form controls, as long as the system supports it. Note that not all the metrics for
2503         NSControlSizeLarge form controls are finalized, as noted in the per-method comments below.
2504
2505         With this patch alone, there is no change in behavior yet; in the near future, these changes will be covered by
2506         new platform-specific baselines.
2507
2508         * platform/PopupMenuStyle.h: Add a new PopupMenuSizeLarge that corresponds to a popup that has NSControlSizeLarge.
2509         * platform/mac/ThemeMac.h: Add a helper to check (at runtime) whether the new large form control size is enabled.
2510         * platform/mac/ThemeMac.mm:
2511         (WebCore::controlSizeForFont): Add a new font size breakpoint, for which we use NSControlSizeLarge instead of
2512         NSControlSizeRegular.
2513
2514         (WebCore::sizeFromNSControlSize):
2515         (WebCore::sizeFromFont):
2516         (WebCore::controlSizeFromPixelSize):
2517         (WebCore::setControlSize):
2518         (WebCore::checkboxSizes): Reflect the fact that checkboxes with NSControlSizeLarge are 16 by 16.
2519         (WebCore::checkboxMargins): Just match NSControlSizeRegular margins for now. These seem incorrect already, even
2520         for NSControlSizeRegular in macOS 10.15.
2521
2522         (WebCore::radioSizes): Reflect the fact that radio buttons with NSControlSizeLarge are 16 by 16, and
2523         NSControlSizeRegular radio buttons are 14 by 14.
2524
2525         (WebCore::radioMargins): Just match NSControlSizeRegular margins for now. These seem incorrect already, even for
2526         NSControlSizeRegular in macOS 10.15.
2527
2528         (WebCore::buttonSizes): Reflect the fact that buttons with NSControlSizeLarge are 28px tall.
2529         (WebCore::buttonMargins): Just match NSControlSizeRegular margins for now, and add a FIXME about updating them.
2530         (WebCore::setUpButtonCell):
2531         (WebCore::stepperSizes): NSControlSizeLarge matches NSControlSizeRegular at the moment.
2532         (WebCore::stepperControlSizeForFont): Add a new font size breakpoint for using NSControlSizeLarge.
2533         * rendering/RenderThemeMac.mm:
2534         (WebCore::RenderThemeMac::controlSizeForFont const):
2535         (WebCore::RenderThemeMac::controlSizeForCell const):
2536         (WebCore::RenderThemeMac::controlSizeForSystemFont const):
2537         (WebCore::RenderThemeMac::popupButtonMargins const):
2538         (WebCore::RenderThemeMac::popupButtonSizes const):
2539         (WebCore::RenderThemeMac::popupButtonPadding const):
2540
2541         NSControlSizeLarge metrics for popup buttons cannot be determined yet.
2542
2543         (WebCore::RenderThemeMac::progressBarSizes const):
2544         (WebCore::RenderThemeMac::progressBarMargins const):
2545         (WebCore::RenderThemeMac::paintProgressBar):
2546
2547         NSControlSizeLarge matches NSControlSizeRegular at the moment.
2548
2549         (WebCore::menuListButtonSizes):
2550         (WebCore::RenderThemeMac::popupMenuSize const):
2551         (WebCore::RenderThemeMac::menuListSizes const):
2552         (WebCore::RenderThemeMac::searchFieldSizes const):
2553         (WebCore::RenderThemeMac::cancelButtonSizes const):
2554         (WebCore::RenderThemeMac::resultsButtonSizes const):
2555
2556         Search field results and cancel buttons have the same size in NSControlSizeLarge as in NSControlSizeRegular.
2557
2558 2020-02-21  Michael Catanzaro  <mcatanzaro@gnome.org>
2559
2560         [WPE][GTK] googleapis.com is a public suffix, defeating isGoogle() check in UserAgentQuirks.cpp
2561         https://bugs.webkit.org/show_bug.cgi?id=207984
2562
2563         Reviewed by Daniel Bates.
2564
2565         Fix the check for googleapis.com. Since it's now a public suffix, we can no longer check the
2566         URL's base domain here. Instead, we can check endsWith().
2567
2568         I considered switching to endsWith() for all the checks in this file, to make our user agent
2569         quirks robust to future changes in the public suffix list, but checking the base domain is
2570         nicer and it seems unnecessary. We can continue to adjust our quirks in the future as
2571         necessary.
2572
2573         The public suffix list:
2574         https://github.com/publicsuffix/list/blob/7922d7c20e246552be418e8f72e577899fd30d99/public_suffix_list.dat#L11922
2575
2576         * platform/UserAgentQuirks.cpp:
2577         (WebCore::isGoogle):
2578
2579 2020-02-21  Simon Fraser  <simon.fraser@apple.com>
2580
2581         [Web Animations] Repeated animations on pseudo elements will fail to run after a while
2582         https://bugs.webkit.org/show_bug.cgi?id=207993
2583         <rdar://problem/59428472>
2584
2585         Reviewed by Zalan Bujtas.
2586
2587         We failed to clear PseudoElement* from AnimationTimeline's various HashMaps on destruction,
2588         causing animations to fail to run when those pointer addresses were reused.
2589
2590         Make DeclarativeAnimation::owningElement() be a WeakPtr<>.
2591
2592         Test: animations/many-pseudo-animations.html
2593
2594         * animation/AnimationTimeline.cpp:
2595         (WebCore::AnimationTimeline::willDestoryRendererForElement):
2596         (WebCore::AnimationTimeline::elementWasRemoved):
2597         * animation/AnimationTimeline.h:
2598         * animation/DeclarativeAnimation.cpp:
2599         (WebCore::DeclarativeAnimation::DeclarativeAnimation):
2600         (WebCore::DeclarativeAnimation::enqueueDOMEvent):
2601         * animation/DeclarativeAnimation.h:
2602         (WebCore::DeclarativeAnimation::owningElement const):
2603         * dom/Element.cpp:
2604         (WebCore::Element::removedFromAncestor):
2605         * dom/PseudoElement.cpp:
2606         (WebCore::PseudoElement::clearHostElement):
2607         * rendering/updating/RenderTreeUpdater.cpp:
2608         (WebCore::RenderTreeUpdater::tearDownRenderers):
2609
2610 2020-02-21  Lauro Moura  <lmoura@igalia.com>
2611
2612         [GStreamer] TextCombinerGStreamer is failing to compile with Gst1.14
2613         https://bugs.webkit.org/show_bug.cgi?id=208041
2614
2615         Reviewed by Xabier Rodriguez-Calvar.
2616
2617         Replace usage of gst_clear_object and gst_clear_tag_list with previous
2618         *_unref functions. The clear versions were added in 1.16 while Ubuntu
2619         18.04 (current LTS) and Debian stable uses 1.14.
2620
2621         * platform/graphics/gstreamer/TextCombinerGStreamer.cpp:
2622         (webkitTextCombinerPadDispose):
2623
2624 2020-02-21  Carlos Alberto Lopez Perez  <clopez@igalia.com>
2625
2626         Value sanitization for input[type=text] should not truncate a value at a control character
2627         https://bugs.webkit.org/show_bug.cgi?id=207900
2628
2629         Reviewed by Darin Adler.
2630
2631         Stop truncating value at a control character. The new behavior is compatible with Chrome and Firefox.
2632         Inspired on Chromium patch https://codereview.chromium.org/189843008
2633
2634         Covered by existing tests: affected layout tests are modified to reflect the new behaviour.
2635         This improves WPT pass-rate in around 49K new subtest passes for Japanesse encoding tests.
2636
2637         * html/TextFieldInputType.cpp:
2638         (WebCore::limitLength):
2639
2640 2020-02-21  Carlos Garcia Campos  <cgarcia@igalia.com>
2641
2642         [WPE] Use custom theme style for media controls
2643         https://bugs.webkit.org/show_bug.cgi?id=208002
2644
2645         Reviewed by Adrian Perez de Castro.
2646
2647         Add mediaControlsAdwaita.css and mediaControlsAdwaita.js. The style is based on GTK port with a few differences:
2648
2649           - Adwaita icons are included in the css.
2650           - All buttons have effects for hover, pressed and disabled states.
2651           - Mute and fullscreen (only for videos) buttons are always visible, but disabled when not available to avoid
2652             the dancing when they are shown.
2653           - Media duration is always shown too (for non-live streams), being 00:00 and disabled when unknown, for the
2654             same reason.
2655           - Timeline and volume sliders are smaller and their thumbs are circled instead of rounded rectangles.
2656           - Slider thumbs also have effects for hover, pressed and disabled states.
2657
2658         * Modules/mediacontrols/mediaControlsAdwaita.css: Added.
2659         (audio::-webkit-media-controls-panel.hidden,):
2660         (body:-webkit-full-page-media):
2661         (audio):
2662         (audio:-webkit-full-page-media,):
2663         (audio:-webkit-full-page-media::-webkit-media-controls-panel,):
2664         (::-webkit-media-controls):
2665         (audio::-webkit-media-controls-enclosure,):
2666         (video::-webkit-media-controls-enclosure):
2667         (audio::-webkit-media-controls-panel,):
2668         (video::-webkit-media-controls-panel):
2669         (video::-webkit-media-controls-panel div.mute-box,):
2670         (audio::-webkit-media-controls-panel div.mute-box.hidden,):
2671         (audio::-webkit-media-controls-mute-button,):
2672         (audio::-webkit-media-controls-mute-button.muted,):
2673         (audio::-webkit-media-controls-play-button,):
2674         (audio::-webkit-media-controls-play-button.paused,):
2675         (audio::-webkit-media-controls-current-time-display,):
2676         (audio::-webkit-media-controls-current-time-display.no-duration,):
2677         (audio::-webkit-media-controls-current-time-display.hidden,):
2678         (audio::-webkit-media-controls-timeline,):
2679         (input[type="range"][disabled]::-webkit-media-slider-thumb,):
2680         (audio::-webkit-media-controls-timeline.hidden,):
2681         (audio::-webkit-media-controls-volume-slider-container,):
2682         (audio::-webkit-media-controls-volume-slider-container.hiding,):
2683         (audio::-webkit-media-controls-volume-slider-container.down,):
2684         (audio::-webkit-media-controls-panel .hiding.down,):
2685         (audio::-webkit-media-controls-volume-slider,):
2686         (audio::-webkit-media-controls-volume-slider-container input[type="range"]::-webkit-media-slider-container > div,):
2687         (input[type="range"]::-webkit-media-slider-container):
2688         (input[type="range"]::-webkit-media-slider-container > div):
2689         (input[type="range"]::-webkit-media-slider-thumb):
2690         (audio::-webkit-media-controls-toggle-closed-captions-button,):
2691         (audio::-webkit-media-controls-toggle-closed-captions-button.hidden,):
2692         (video::-webkit-media-controls-closed-captions-container):
2693         (video::-webkit-media-controls-closed-captions-container.out):
2694         (video::-webkit-media-controls-closed-captions-container.hidden):
2695         (video::-webkit-media-controls-closed-captions-container h3):
2696         (video::-webkit-media-controls-closed-captions-container ul):
2697         (video::-webkit-media-controls-closed-captions-container li):
2698         (video::-webkit-media-controls-closed-captions-container li.selected):
2699         (audio::-webkit-media-controls-fullscreen-button,):
2700         (audio::-webkit-media-controls-fullscreen-button.hidden,):
2701         (audio::-webkit-media-controls-panel button:hover,):
2702         (audio::-webkit-media-controls-panel button:active,):
2703         (audio::-webkit-media-controls-panel button[disabled],):
2704         * Modules/mediacontrols/mediaControlsAdwaita.js: Added.
2705         (createControls):
2706         (ControllerAdwaita):
2707         (contains):
2708         (ControllerAdwaita.prototype.createControls):
2709         (ControllerAdwaita.prototype.configureInlineControls):
2710         (ControllerAdwaita.prototype.shouldHaveControls):
2711         (ControllerAdwaita.prototype.reconnectControls):
2712         (ControllerAdwaita.prototype.setStatusHidden):
2713         (ControllerAdwaita.prototype.updateTime):
2714         (ControllerAdwaita.prototype.handleTimeUpdate):
2715         (ControllerAdwaita.prototype.updateHasAudio):
2716         (ControllerAdwaita.prototype.handleMuteButtonMouseOver):
2717         (ControllerAdwaita.prototype.handleVolumeBoxMouseOut):
2718         (ControllerAdwaita.prototype.removeControls):
2719         (ControllerAdwaita.prototype.addControls):
2720         (ControllerAdwaita.prototype.updateFullscreenButton):
2721         (ControllerAdwaita.prototype.updateReadyState):
2722         (ControllerAdwaita.prototype.updateDuration):
2723         (ControllerAdwaita.prototype.setIsLive):
2724         (ControllerAdwaita.prototype.updatePlaying):
2725         (ControllerAdwaita.prototype.updateProgress):
2726         (ControllerAdwaita.prototype.handleCaptionButtonClicked):
2727         (ControllerAdwaita.prototype.buildCaptionMenu):
2728         (ControllerAdwaita.prototype.destroyCaptionMenu):
2729         (ControllerAdwaita.prototype.showCaptionMenu):
2730         (ControllerAdwaita.prototype.hideCaptionMenu):
2731         (ControllerAdwaita.prototype.captionMenuTransitionEnd):
2732         (ControllerAdwaita.prototype.handleCaptionButtonMouseOver):
2733         (ControllerAdwaita.prototype.handleCaptionButtonShowMenu):
2734         (ControllerAdwaita.prototype.handleCaptionButtonMouseOut):
2735         (ControllerAdwaita.prototype.handleCaptionMouseOut):
2736         * Modules/mediacontrols/mediaControlsBase.js:
2737         * PlatformWPE.cmake:
2738         * platform/wpe/RenderThemeWPE.cpp:
2739         (WebCore::RenderThemeWPE::extraMediaControlsStyleSheet):
2740         (WebCore::RenderThemeWPE::mediaControlsScript):
2741         (WebCore::RenderThemeWPE::paintMediaSliderTrack):
2742         (WebCore::RenderThemeWPE::paintMediaVolumeSliderTrack):
2743         * platform/wpe/RenderThemeWPE.h:
2744
2745 2020-02-21  Fujii Hironori  <Hironori.Fujii@sony.com>
2746
2747         Unreviewed build fix for Windows ports
2748
2749         > WebKitBuild\Release\WTF\Headers\wtf/RefPtr.h(44): error C2027: use of undefined type 'WebCore::ImageData'
2750
2751         RefPtr<ImageData> is used without defining ImageData.
2752
2753         * platform/graphics/ConcreteImageBuffer.h: Added #include "ImageData.h".
2754
2755 2020-02-21  Jack Lee  <shihchieh_lee@apple.com>
2756
2757         Nullptr crash in RenderStyle::isFlippedBlocksWritingMode when fragment flow gains a new in-flow descendant
2758         https://bugs.webkit.org/show_bug.cgi?id=207296
2759         <rdar://problem/49687828>
2760
2761         Reviewed by Antti Koivisto.
2762
2763         When a multi-column fragment flow gains a new in-flow descendant, we need to call
2764         multiColumnDescendantInserted so RenderMultiColumnSet would be created for the new
2765         descendant.
2766
2767         Test: fast/multicol/fragflow-gains-new-in-flow-descendant-crash.html
2768
2769         * rendering/updating/RenderTreeBuilder.cpp:
2770         (WebCore::RenderTreeBuilder::childFlowStateChangesAndAffectsParentBlock):
2771
2772 2020-02-20  Michael Catanzaro  <mcatanzaro@gnome.org>
2773
2774         [GTK] Improve user agent quirk for Google Docs and Google Drive
2775         https://bugs.webkit.org/show_bug.cgi?id=206506
2776
2777         Reviewed by Carlos Garcia Campos.
2778
2779         Stop using our macOS platform quirk for Google Docs and Google Drive. It is not successfully
2780         suppressing the unsupported browser warnings that it was added to avoid. It is also
2781         responsible for complaints from users who do not like seeing macOS-style shortcuts with
2782         the Command key rather than Ctrl.
2783
2784         Replace it with a new Firefox browser quirk. We can avoid the unsupported browser warning in
2785         Google Docs by using this quirk on accounts.youtube.com. There's no need for any other quirk
2786         specific to Google Docs (although removing the macOS platform quirk means we'll instead
2787         begin using the x86_64 Linux quirk that we send to other Google domains). Google Drive will
2788         also use this new quirk.
2789
2790         Also, remove a stale comment instructing developers to test downloading the Hangouts browser
2791         plugin. We no longer support NPAPI, so Google Hangouts is a lost cause until we get WebRTC
2792         working.
2793
2794         * platform/UserAgentQuirks.cpp:
2795         (WebCore::urlRequiresFirefoxBrowser):
2796         (WebCore::urlRequiresMacintoshPlatform):
2797         (WebCore::urlRequiresLinuxDesktopPlatform):
2798         (WebCore::UserAgentQuirks::quirksForURL):
2799         (WebCore::UserAgentQuirks::stringForQuirk):
2800         * platform/UserAgentQuirks.h:
2801         * platform/glib/UserAgentGLib.cpp:
2802         (WebCore::buildUserAgentString):
2803
2804 2020-02-20  Peng Liu  <peng.liu6@apple.com>
2805
2806         [Media in GPU process] Synchronize the properties of video layers in the GPU process with the hosting layer in the web process
2807         https://bugs.webkit.org/show_bug.cgi?id=206132
2808
2809         Reviewed by Jer Noble.
2810
2811         Update the name (for debugging) of the CALayer created by _web_renderLayerWithContextID (The CALayer will not be only used as video layers).
2812         This patch also fixes the ordering issue related to VideoLayerManagerObjC.h and VideoLayerManagerObjC.mm in the Xcode project file.
2813
2814         * WebCore.xcodeproj/project.pbxproj:
2815         * platform/graphics/cocoa/WebCoreCALayerExtras.mm:
2816         (+[CALayer _web_renderLayerWithContextID:]):
2817
2818 2020-02-20  Zalan Bujtas  <zalan@apple.com>
2819
2820         [First paint] Let optional style recalcs go through while in visually-non-empty state.
2821         https://bugs.webkit.org/show_bug.cgi?id=208020
2822         <rdar://problem/59636549>
2823
2824         Reviewed by Simon Fraser.
2825
2826         This is the final step to ensure we don't end up delaying the qualifiesAsVisuallyNonEmpty check when
2827         the page happens to not trigger synchronous style recalcs.
2828
2829         Here is the optimized flow:
2830         Optional style realc -> FrameView::styleAndRenderTreeDidChange -> qualifiesAsVisuallyNonEmpty -> Document::shouldScheduleLayout true.
2831
2832         This could be a slight regression in certain cases because now we let the optional style recalcs through and
2833         only delay the redundant layouts (as opposed to delay both).
2834
2835         * dom/Document.cpp:
2836         (WebCore::Document::scheduleStyleRecalc):
2837         (WebCore::Document::shouldScheduleLayout):
2838
2839 2020-02-20  Eric Carlson  <eric.carlson@apple.com>
2840
2841         Support in-band metadata cues when loading media in the GPU Process
2842         https://bugs.webkit.org/show_bug.cgi?id=207904
2843         <rdar://problem/59561647>
2844
2845         Reviewed by Dean Jackson.
2846
2847         No new tests, unskipped existing tests.
2848
2849         * WebCore.xcodeproj/project.pbxproj:
2850         * html/HTMLMediaElement.cpp:
2851         (WebCore::HTMLMediaElement::selectMediaResource):
2852         (WebCore::HTMLMediaElement::play):
2853         (WebCore::HTMLMediaElement::mediaEngineWasUpdated):
2854         (WebCore::HTMLMediaElement::mediaPlayerEngineUpdated):
2855         * html/track/InbandDataTextTrack.cpp:
2856         (WebCore::InbandDataTextTrack::addDataCue):
2857         (WebCore::InbandDataTextTrack::findIncompleteCue):
2858         (WebCore::InbandDataTextTrack::updateDataCue):
2859         (WebCore::InbandDataTextTrack::removeDataCue):
2860         (WebCore::InbandDataTextTrack::removeCue):
2861         * html/track/InbandDataTextTrack.h:
2862         * html/track/TextTrack.cpp:
2863         (WebCore::TextTrack::addCue):
2864         * html/track/TextTrack.h:
2865         (WebCore::TextTrack::cuesInternal const):
2866         * html/track/TextTrackCue.cpp:
2867         (WebCore::TextTrackCue::cueIndex const):
2868         * platform/SerializedPlatformDataCue.h:
2869         (WebCore::SerializedPlatformDataCue::deserialize const):
2870         (WebCore::SerializedPlatformDataCue::data const):
2871         (WebCore::SerializedPlatformDataCue::isEqual const):
2872         (WebCore::SerializedPlatformDataCue::platformType const):
2873         (WebCore::SerializedPlatformDataCue::encodingRequiresPlatformData const):
2874         (WebCore::SerializedPlatformDataCue::encodableValue const):
2875         * platform/graphics/MediaPlayer.cpp:
2876         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2877         (WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive):
2878         * platform/mac/SerializedPlatformDataCueMac.h:
2879         * platform/mac/SerializedPlatformDataCueMac.mm:
2880         (WebCore::SerializedPlatformDataCue::create):
2881         (WebCore::SerializedPlatformDataCueMac::SerializedPlatformDataCueMac):
2882         (WebCore::SerializedPlatformDataCueMac::~SerializedPlatformDataCueMac):
2883         (WebCore::SerializedPlatformDataCueMac::isEqual const):
2884         (WebCore::toSerializedPlatformDataCueMac):
2885         (WebCore::SerializedPlatformDataCueMac::allowedClassesForNativeValues):
2886         (WebCore::SerializedPlatformDataCueMac::encodableValue const):
2887         (WebCore::jsValueWithAVMetadataItemInContext):
2888         (WebCore::NSDictionaryWithAVMetadataItem):
2889         (WebCore::SerializedPlatformDataCueMac::create): Deleted.
2890
2891 2020-02-20  Sunny He  <sunny_he@apple.com>
2892
2893         Fix crash in Page::updateRendering when document has no domWindow
2894         https://bugs.webkit.org/show_bug.cgi?id=207975
2895         <rdar://56999099>
2896
2897         Reviewed by Ryosuke Niwa.
2898
2899         When a subframe is navigated, a new document is created and
2900         the window is transfered asynchronously. It is possible to have
2901         a call to updateRendering in the middle of this process, resulting
2902         in an attempt to update a document with no window. Add a check for
2903         this case and skip such documents.
2904
2905         No test, since this crash relies on sensitive timing that cannot be
2906         consistently replicated in a test case.
2907
2908         * page/Page.cpp:
2909         (WebCore::Page::updateRendering):
2910
2911 2020-02-20  Zalan Bujtas  <zalan@apple.com>
2912
2913         [First paint] FrameView::loadProgressingStatusChanged should check m_firstVisuallyNonEmptyLayoutMilestoneIsPending
2914         https://bugs.webkit.org/show_bug.cgi?id=208008
2915         <rdar://problem/59630957>
2916
2917         Reviewed by Antti Koivisto.
2918
2919         If we haven't had a chance to issue a visually-non-empty milestone, we definitely need to check the content again when the load
2920         is finally completed.
2921
2922         * page/FrameView.cpp:
2923         (WebCore::FrameView::loadProgressingStatusChanged):
2924
2925 2020-02-20  Alicia Boya García  <aboya@igalia.com>
2926
2927         [GStreamer] Fix race in TextCombinerGStreamer
2928         https://bugs.webkit.org/show_bug.cgi?id=208001
2929
2930         Reviewed by Xabier Rodriguez-Calvar.
2931
2932         TextCombinerGStreamer uses the CAPS event to determine whether adding
2933         a webvttenc between the text track pad and the funnel element used to
2934         be able to display several subtitles at the same time.
2935
2936         The way this was done previously had a race though: all text track
2937         pads were preemptively linked directly to the funnel, only adding the
2938         webvttenc element later in the middle when receiving the CAPS event.
2939
2940         When two or more text tracks were present, it wasn't infrequent that
2941         one track had its CAPS event processed (causing the webvttenc element
2942         to be added) and propagated (fixating the funnel caps) before another
2943         track attempted caps negotiation. Because the pads were connected to
2944         the funnel preemptively, and because without the webvttenc element the
2945         caps of the text pad don't match the funnel's, this causes a caps
2946         mismatch error, stopping playback completely. The CAPS event is
2947         therefore never sent.
2948
2949         To avoid this race, we must avoid linking elements until we get the
2950         CAPS events, when we actually know where we should link them to,
2951         therefore avoiding early caps negotiation errors.
2952
2953         * platform/graphics/gstreamer/TextCombinerGStreamer.cpp:
2954         (webkitTextCombinerPadDispose):
2955         (webkitTextCombinerPadEvent):
2956         (webkitTextCombinerRequestNewPad):
2957         (webkitTextCombinerReleasePad):
2958         (webkit_text_combiner_class_init):
2959         (webkitTextCombinerPadFinalize): Deleted.
2960
2961 2020-02-20  Zalan Bujtas  <zalan@apple.com>
2962
2963         [First paint] Let's check visually-non-empty state in FrameView::styleAndRenderTreeDidChange
2964         https://bugs.webkit.org/show_bug.cgi?id=208013
2965         <rdar://problem/59633427>
2966
2967         Reviewed by Antti Koivisto.
2968
2969         This patch completely decouples m_contentQualifiesAsVisuallyNonEmpty and m_firstVisuallyNonEmptyLayoutMilestoneIsPending.
2970         Now FrameView can be in the state where m_contentQualifiesAsVisuallyNonEmpty is true while
2971         m_firstVisuallyNonEmptyLayoutMilestoneIsPending is false (which is a perfectly valid state to be in).
2972         This will enable us to delay optional layouts after style recalcs when the content is still visually empty.
2973         (If a FrameView::isVisuallyNonEmpty() caller regresses after this change, it means that the caller is interested in
2974         whether the non-empty milestone has been issued or not and it needs to switch over to a different API.)
2975
2976         * page/FrameView.cpp:
2977         (WebCore::FrameView::styleAndRenderTreeDidChange):
2978         (WebCore::FrameView::loadProgressingStatusChanged):
2979         (WebCore::FrameView::fireLayoutRelatedMilestonesIfNeeded):
2980
2981 2020-02-20  Takashi Komori  <Takashi.Komori@sony.com>
2982
2983         [Curl] Simplify Cookie class.
2984         https://bugs.webkit.org/show_bug.cgi?id=207930
2985
2986         Reviewed by Don Olmstead.
2987
2988         Removed redundant CookieJarCurl.cpp and made NetworkDataTaskCurl access CookieJarDB directly.
2989         CookieJarCurl was used for supporting file based cookie database but now it is no longer used.
2990
2991         No new tests. Covered by existing tests.
2992
2993         * platform/Curl.cmake:
2994         * platform/network/NetworkStorageSession.h:
2995         * platform/network/curl/CookieJarCurl.cpp: Removed.
2996         * platform/network/curl/CookieJarCurl.h: Removed.
2997         * platform/network/curl/CurlResourceHandleDelegate.cpp:
2998         (WebCore::handleCookieHeaders):
2999         * platform/network/curl/NetworkStorageSessionCurl.cpp:
3000         (WebCore::cookiesForSession):
3001         (WebCore::NetworkStorageSession::NetworkStorageSession):
3002         (WebCore::NetworkStorageSession::setCookiesFromDOM const):
3003         (WebCore::NetworkStorageSession::setCookiesFromHTTPResponse const):
3004         (WebCore::NetworkStorageSession::setCookieAcceptPolicy const):
3005         (WebCore::NetworkStorageSession::cookieAcceptPolicy const):
3006         (WebCore::NetworkStorageSession::cookiesForDOM const):
3007         (WebCore::NetworkStorageSession::setCookies):
3008         (WebCore::NetworkStorageSession::setCookie):
3009         (WebCore::NetworkStorageSession::deleteCookie):
3010         (WebCore::NetworkStorageSession::deleteCookie const):
3011         (WebCore::NetworkStorageSession::deleteAllCookies):
3012         (WebCore::NetworkStorageSession::deleteAllCookiesModifiedSince):
3013         (WebCore::NetworkStorageSession::deleteCookiesForHostnames):
3014         (WebCore::NetworkStorageSession::getAllCookies):
3015         (WebCore::NetworkStorageSession::getHostnamesWithCookies):
3016         (WebCore::NetworkStorageSession::getRawCookies const):
3017         (WebCore::NetworkStorageSession::cookieRequestHeaderFieldValue const):
3018         * platform/network/curl/ResourceHandleCurl.cpp:
3019         (WebCore::ResourceHandle::createCurlRequest):
3020
3021 2020-02-20  Youenn Fablet  <youenn@apple.com>
3022
3023         Move system listeners from PlatformMediaSessionManager to MediaSessionManagerCocoa
3024         https://bugs.webkit.org/show_bug.cgi?id=208011
3025
3026         Reviewed by Eric Carlson.
3027
3028         We will want the listeners to be running in GPUProcess.
3029         The plan is to have a generic PlatformMediaSessionManager that is hooked to GPUProcess
3030         through a counterpart session manager in GPUProcess.
3031         Given listeners are only supported in Cocoa ports, it is fine moving them to MediaSessionManagerCocoa.
3032         This way we can decide to instantiate either a MediaSessionManagerCocoa in WebProcess or in GPUProcess.
3033
3034         For this to work, we have to make addSession virtual to be able to create the listeners lazily when adding a session.
3035
3036         No change of behavior.
3037
3038         * platform/audio/PlatformMediaSessionManager.cpp:
3039         (WebCore::PlatformMediaSessionManager::PlatformMediaSessionManager):
3040         (WebCore::PlatformMediaSessionManager::addSession):
3041         (WebCore::PlatformMediaSessionManager::hasNoSession const):
3042         (WebCore::PlatformMediaSessionManager::removeSession):
3043         (WebCore::PlatformMediaSessionManager::setCurrentSession):
3044         (WebCore::PlatformMediaSessionManager::processDidReceiveRemoteControlCommand):
3045         (WebCore::PlatformMediaSessionManager::computeSupportsSeeking const):
3046         (WebCore::PlatformMediaSessionManager::processSystemWillSleep):
3047         (WebCore::PlatformMediaSessionManager::processSystemDidWake):
3048         * platform/audio/PlatformMediaSessionManager.h:
3049         * platform/audio/cocoa/MediaSessionManagerCocoa.h:
3050         * platform/audio/cocoa/MediaSessionManagerCocoa.mm:
3051         (MediaSessionManagerCocoa::MediaSessionManagerCocoa):
3052         (MediaSessionManagerCocoa::updateSessionState):
3053         (MediaSessionManagerCocoa::addSession):
3054         (MediaSessionManagerCocoa::removeSession):
3055         (MediaSessionManagerCocoa::setCurrentSession):
3056         * testing/Internals.cpp:
3057         (WebCore::Internals::postRemoteControlCommand):
3058         (WebCore::Internals::simulateSystemSleep const):
3059         (WebCore::Internals::simulateSystemWake const):
3060
3061 2020-02-19  Justin Fan  <justin_fan@apple.com>
3062
3063         GraphicsContextGLOpenGL::transformFeedbackVaryings passes deallocated memory to gl::TransformFeedbackVaryings
3064         https://bugs.webkit.org/show_bug.cgi?id=207526
3065
3066         Reviewed by Brent Fulgham.
3067
3068         Covered by WebGL2 Transform Feedback tests.
3069
3070         * platform/graphics/angle/GraphicsContextGLANGLE.cpp:
3071         (WebCore::GraphicsContextGLOpenGL::transformFeedbackVaryings):
3072
3073 2020-02-20  Antti Koivisto  <antti@apple.com>
3074
3075         [macOS] Disable RunLoop function dispatch when there is a pending rendering update
3076         https://bugs.webkit.org/show_bug.cgi?id=207931
3077
3078         Reviewed by Geoffrey Garen.
3079
3080         Functions dispatched via RunLoop::dispatch() are executed before the rendering update runloop observer.
3081         This can significantly delay rendering updates as asyncronous IPC is handled via this mechanism.
3082         Most importantly network resources are dispatched to the main thread this way, sometimes triggering expensive
3083         synchronous parsing and script execution.
3084
3085         This patch adds a mechanims for disabling function dispatch temporarily while there is a pending rendering update.
3086
3087         * dom/WindowEventLoop.cpp:
3088         (WebCore::WindowEventLoop::breakToAllowRenderingUpdate):
3089
3090 2020-02-20  Zalan Bujtas  <zalan@apple.com>
3091
3092         [LFC] Sometimes subframes don't even have document elements.
3093         https://bugs.webkit.org/show_bug.cgi?id=208006
3094         <rdar://problem/59629147>
3095
3096         Reviewed by Antti Koivisto.
3097
3098         Test: fast/layoutformattingcontext/subframe-with-display-none-html.html
3099
3100         Do not try to layout a formatting context when it has no content at all.
3101
3102         * layout/LayoutContext.cpp:
3103         (WebCore::Layout::LayoutContext::layoutFormattingContextSubtree):
3104
3105 2020-02-20  Zalan Bujtas  <zalan@apple.com>
3106
3107         [LFC][BFC] Fix geometryForBox::isOkToAccessDisplayBox for EscapeReason::FindFixedHeightAncestorQuirk
3108         https://bugs.webkit.org/show_bug.cgi?id=207983
3109         <rdar://problem/59615246>
3110
3111         Reviewed by Antti Koivisto.
3112
3113         Test: fast/layoutformattingcontext/height-percentage-quirk-to-icb.html
3114
3115         The height percentage quirk walks the ancestor chain and looks for fixed height block level boxes.
3116         It can potentially walk all the way up to the ICB. This patch gives access to the ICB's geometry when
3117         FormattingContext::geometryForBox() has EscapeReason::FindFixedHeightAncestorQuirk. 
3118
3119         * layout/FormattingContext.cpp:
3120         (WebCore::Layout::FormattingContext::geometryForBox const):
3121
3122 2020-02-20  Zalan Bujtas  <zalan@apple.com>
3123
3124         [LFC][Out-of-flow] FormattingContext::Geometry::staticVerticalPositionForOutOfFlowPositioned should ignore inline boxes
3125         https://bugs.webkit.org/show_bug.cgi?id=207994
3126         <rdar://problem/59618280>
3127
3128         Reviewed by Antti Koivisto.
3129
3130         Test: fast/layoutformattingcontext/absolute-positioned-box-with-inline-sibling.html
3131
3132         https://www.w3.org/TR/CSS22/visudet.html#abs-non-replaced-height
3133
3134         "For the purposes of this section and the next, the term "static position" (of an element) refers, roughly,
3135         to the position an element would have had in the normal flow."
3136
3137         This does not seem to be well-defined for sibling inline boxes. Let's just stick with block level boxes for now.
3138
3139         * layout/FormattingContextGeometry.cpp:
3140         (WebCore::Layout::FormattingContext::Geometry::staticVerticalPositionForOutOfFlowPositioned const):
3141
3142 2020-02-20  Don Olmstead  <don.olmstead@sony.com>
3143
3144         [CMake] Add WebP targets
3145         https://bugs.webkit.org/show_bug.cgi?id=207982
3146
3147         Reviewed by Adrian Perez de Castro.
3148
3149         Use the WebP targets.
3150
3151         * platform/ImageDecoders.cmake:
3152
3153 2020-02-20  Rob Buis  <rbuis@igalia.com>
3154
3155         Lazy load images using base url at parse time
3156         https://bugs.webkit.org/show_bug.cgi?id=207902
3157
3158         Reviewed by Darin Adler.
3159
3160         The spec says to use the base url at parse time for request
3161         url, ignoring changes to base url after that [1]. To fix this
3162         add a new state LoadImmediately to LazyImageLoadState where
3163         the parse time url from the initial request is reused.
3164
3165         [1] https://html.spec.whatwg.org/multipage/images.html#update-the-image-data
3166
3167         Tests: imported/web-platform-tests/html/semantics/embedded-content/the-img-element/original-base-url-applied-2.html
3168                imported/web-platform-tests/html/semantics/embedded-content/the-img-element/original-base-url-applied.html
3169
3170         * loader/ImageLoader.cpp:
3171         (WebCore::ImageLoader::updateFromElement):
3172         (WebCore::ImageLoader::loadDeferredImage):
3173         * loader/ImageLoader.h:
3174
3175 2020-02-20  Don Olmstead  <don.olmstead@sony.com>
3176
3177         [CMake] Add WPE::libwpe target
3178         https://bugs.webkit.org/show_bug.cgi?id=207970
3179
3180         Reviewed by Adrian Perez de Castro.
3181
3182         Use the WPE::libwpe target.
3183
3184         * PlatformGTK.cmake:
3185         * PlatformPlayStation.cmake:
3186         * PlatformWPE.cmake:
3187
3188 2020-02-20  Andres Gonzalez  <andresg_22@apple.com>
3189
3190         [WebAccessibilityObjectWrapper doAXAttributedStringForTextMarkerRange] must run on the main thread.
3191         https://bugs.webkit.org/show_bug.cgi?id=207958
3192
3193         Reviewed by Darin Adler.
3194
3195         Covered by existing tests.
3196
3197         [WebAccessibilityObjectWrapper doAXAttributedStringForTextMarkerRange]
3198         calls into TextIterator and Node, thus it must be dispatched to the
3199         main thread.
3200
3201         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3202         (-[WebAccessibilityObjectWrapper doAXAttributedStringForTextMarkerRange:spellCheck:]):
3203
3204 2020-02-20  Carlos Garcia Campos  <cgarcia@igalia.com>
3205
3206         [WPE] Use custom colors for text and listbox selection
3207         https://bugs.webkit.org/show_bug.cgi?id=207836
3208
3209         Reviewed by Adrian Perez de Castro.
3210
3211         * platform/wpe/RenderThemeWPE.cpp:
3212         (WebCore::RenderThemeWPE::platformActiveSelectionBackgroundColor const):
3213         (WebCore::RenderThemeWPE::platformInactiveSelectionBackgroundColor const):
3214         (WebCore::RenderThemeWPE::platformActiveSelectionForegroundColor const):
3215         (WebCore::RenderThemeWPE::platformInactiveSelectionForegroundColor const):
3216         (WebCore::RenderThemeWPE::platformActiveListBoxSelectionBackgroundColor const):
3217         (WebCore::RenderThemeWPE::platformInactiveListBoxSelectionBackgroundColor const):
3218         (WebCore::RenderThemeWPE::platformActiveListBoxSelectionForegroundColor const):
3219         (WebCore::RenderThemeWPE::platformInactiveListBoxSelectionForegroundColor const):
3220         (WebCore::RenderThemeWPE::paintTextField):
3221         * platform/wpe/RenderThemeWPE.h:
3222
3223 2020-02-20  Carlos Garcia Campos  <cgarcia@igalia.com>
3224
3225         [WPE] Use the theme to render the focus ring
3226         https://bugs.webkit.org/show_bug.cgi?id=207758
3227
3228         Reviewed by Adrian Perez de Castro.
3229
3230         This makes form controls consistent with elements having an auto outline.
3231
3232         * PlatformWPE.cmake: Add platform/wpe to include dirs.
3233         * platform/graphics/cairo/GraphicsContextCairo.cpp:
3234         (WebCore::GraphicsContext::drawFocusRing): Use ThemeWPE::focusColor.
3235         * platform/wpe/RenderThemeWPE.cpp:
3236         (WebCore::RenderThemeWPE::platformFocusRingColor const): Implement it to return the focus color used by ThemeWPE.
3237         * platform/wpe/RenderThemeWPE.h:
3238         * platform/wpe/ThemeWPE.cpp:
3239         (WebCore::ThemeWPE::focusColor): Return the focus color.
3240         (WebCore::ThemeWPE::paintFocus): Add new methods receiving a path or list of rectangles and a color.
3241         * platform/wpe/ThemeWPE.h:
3242
3243 2020-02-20  Carlos Garcia Campos  <cgarcia@igalia.com>
3244
3245         [WPE] Add support for rendering sliders for range elements
3246         https://bugs.webkit.org/show_bug.cgi?id=207694
3247
3248         Reviewed by Adrian Perez de Castro.
3249
3250         * platform/wpe/RenderThemeWPE.cpp:
3251         (WebCore::RenderThemeWPE::supportsFocusRing const):
3252         (WebCore::RenderThemeWPE::paintSliderTrack):
3253         (WebCore::RenderThemeWPE::adjustSliderThumbSize const):
3254         (WebCore::RenderThemeWPE::paintSliderThumb):
3255         * platform/wpe/RenderThemeWPE.h:
3256
3257 2020-02-19  Jack Lee  <shihchieh_lee@apple.com>
3258
3259         ASSERTION FAILED: roundedIntPoint(LayoutPoint(rendererMappedResult)) == result in WebCore::RenderGeometryMap::mapToContainer
3260         https://bugs.webkit.org/show_bug.cgi?id=151030
3261         <rdar://problem/27711142>
3262
3263         Reviewed by Darin Adler.
3264
3265         Track if m_accumulatedOffset ever becomes saturated, and if so, do not assert on unexpected rendererMappedResult.
3266
3267         Test: fast/layers/geometry-map-saturated-offset-assert.html
3268
3269         * platform/graphics/LayoutSize.h:
3270         (WebCore::LayoutSize::mightBeSaturated const):
3271         * rendering/RenderGeometryMap.cpp:
3272         (WebCore::RenderGeometryMap::mapToContainer const):
3273         (WebCore::RenderGeometryMap::stepInserted):
3274         (WebCore::RenderGeometryMap::stepRemoved):
3275         * rendering/RenderGeometryMap.h:
3276
3277 2020-02-19  Youenn Fablet  <youenn@apple.com>
3278
3279         Add support for AudioSession handling in GPUProcess for capture
3280         https://bugs.webkit.org/show_bug.cgi?id=207950
3281
3282         Reviewed by Eric Carlson.
3283
3284         Add a dedicated interface for handling audio capture in session manager.
3285         This was previoulsy PlatformMediaSessionClient, but this one is more related to audio/video rendering.
3286         Use this new interface for MediaStreamTrack capture sources.
3287         The session manager now owns a WeakHashSet of capture sources to compute the correct AudioSession category.
3288
3289         Modernize the code, for instance use an enum class for MediaType to remove some debug asserts.
3290         Add a new PlatformMediaSessionManager::create that is used for sharedManager.
3291
3292         Remove the direct use of PlatformMediaSessionManager::sharedManager from classes that can be used outside of WebProcess.
3293         This includes BaseAudioSharedUnit, for which we add a audioUnitWillStart callback
3294         so that we compute the right AudioSession category before starting the capture.
3295
3296         Covered by existing tests and debug assertions to check for AudioSession category computation.
3297
3298         * Modules/mediastream/MediaStreamTrack.cpp:
3299         (WebCore::MediaStreamTrack::MediaStreamTrack):
3300         (WebCore::MediaStreamTrack::~MediaStreamTrack):
3301         (WebCore::MediaStreamTrack::configureTrackRendering):
3302         (WebCore::MediaStreamTrack::isCapturingAudio const):
3303         * Modules/mediastream/MediaStreamTrack.h:
3304         * Modules/webaudio/AudioContext.h:
3305         * html/HTMLAudioElement.h:
3306         * html/HTMLMediaElement.cpp:
3307         (WebCore::HTMLMediaElement::shouldDisableSleep const):
3308         (WebCore::HTMLMediaElement::mediaType const):
3309         (WebCore::HTMLMediaElement::presentationType const):
3310         * html/HTMLVideoElement.h:
3311         * html/MediaElementSession.cpp:
3312         (WebCore::MediaElementSession::canShowControlsManager const):
3313         * html/MediaElementSession.h:
3314         * platform/audio/PlatformMediaSession.cpp:
3315         (WebCore::PlatformMediaSession::PlatformMediaSession):
3316         (WebCore::PlatformMediaSession::activeAudioSessionRequired const):
3317         * platform/audio/PlatformMediaSession.h:
3318         * platform/audio/PlatformMediaSessionManager.cpp:
3319         (WebCore::sharedPlatformMediaSessionManager):
3320         (WebCore::PlatformMediaSessionManager::sharedManager):
3321         (WebCore::PlatformMediaSessionManager::sharedManagerIfExists):
3322         (WebCore::PlatformMediaSessionManager::create):
3323         (WebCore::indexFromMediaType):
3324         (WebCore::PlatformMediaSessionManager::resetRestrictions):
3325         (WebCore::PlatformMediaSessionManager::has const):
3326         (WebCore::PlatformMediaSessionManager::count const):
3327         (WebCore::PlatformMediaSessionManager::countActiveAudioCaptureSources):
3328         (WebCore::PlatformMediaSessionManager::addRestriction):
3329         (WebCore::PlatformMediaSessionManager::removeRestriction):
3330         (WebCore::PlatformMediaSessionManager::restrictions):
3331         (WebCore::PlatformMediaSessionManager::sessionWillBeginPlayback):
3332         (WebCore::PlatformMediaSessionManager::applicationWillBecomeInactive):
3333         (WebCore::PlatformMediaSessionManager::applicationDidBecomeActive):
3334         (WebCore::PlatformMediaSessionManager::applicationDidEnterBackground):
3335         (WebCore::PlatformMediaSessionManager::applicationWillEnterForeground):
3336         (WebCore::PlatformMediaSessionManager::sessionIsPlayingToWirelessPlaybackTargetChanged):
3337         (WebCore::PlatformMediaSessionManager::addAudioCaptureSource):
3338         (WebCore::PlatformMediaSessionManager::removeAudioCaptureSource):
3339         * platform/audio/PlatformMediaSessionManager.h:
3340         * platform/audio/cocoa/MediaSessionManagerCocoa.mm:
3341         (PlatformMediaSessionManager::create):
3342         (MediaSessionManagerCocoa::updateSessionState):
3343         * platform/audio/ios/MediaSessionManagerIOS.mm:
3344         (WebCore::PlatformMediaSessionManager::create):
3345         (WebCore::MediaSessionManageriOS::resetRestrictions):
3346         * platform/mediastream/MediaStreamTrackPrivate.cpp:
3347         (WebCore::MediaStreamTrackPrivate::audioUnitWillStart):
3348         * platform/mediastream/MediaStreamTrackPrivate.h:
3349         * platform/mediastream/RealtimeMediaSource.h:
3350         * platform/mediastream/mac/BaseAudioSharedUnit.cpp:
3351         (WebCore::BaseAudioSharedUnit::startUnit):
3352         * platform/mediastream/mac/BaseAudioSharedUnit.h:
3353         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
3354         (WebCore::CoreAudioCaptureSource::audioUnitWillStart):
3355         * platform/mediastream/mac/CoreAudioCaptureSource.h:
3356         * testing/Internals.cpp:
3357         (WebCore::mediaTypeFromString):
3358         (WebCore::Internals::setMediaSessionRestrictions):
3359         (WebCore::Internals::mediaSessionRestrictions const):
3360
3361 2020-02-19  Sunny He  <sunny_he@apple.com>
3362
3363         Fix crash when Node::normalize() triggers mutation event that modifies child order
3364         https://bugs.webkit.org/show_bug.cgi?id=207875
3365         <rdar://58976682>
3366
3367         Reviewed by Ryosuke Niwa.
3368
3369         When Node::normalize() merges two text nodes, it calls appendData
3370         before textNodesMerged. If there is a mutator event registered, it
3371         will fire on the call to appendData, potentially changing the child
3372         order and causing a nullptr crash due to incorrect sibling pointers.
3373         Reverse the order of these calls to ensure order gets correctly
3374         updated.
3375
3376         Test: fast/dom/Node/normalize-mutation-event.html
3377
3378         * dom/Node.cpp:
3379         (WebCore::Node::normalize):
3380
3381 2020-02-19  Peng Liu  <peng.liu6@apple.com>
3382
3383         Fix check-webkit-style errors related to AVFoundationSPI.h
3384         https://bugs.webkit.org/show_bug.cgi?id=207834
3385
3386         Reviewed by Daniel Bates.
3387
3388         No new tests, no functional change.
3389
3390         Revert the change in r256770 regarding the headers ordering.
3391
3392         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
3393         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
3394
3395 2020-02-19  Zalan Bujtas  <zalan@apple.com>
3396
3397         [LFC][Integration] Do not try to lay out a formatting context unless there's some content in it
3398         https://bugs.webkit.org/show_bug.cgi?id=207956
3399         <rdar://problem/59455700>
3400
3401         Reviewed by Simon Fraser.
3402
3403         LineLayout::layout() normally don't get called when the block level box has not children (canUse() returns false for such cases), but we are probably missing some invalidation here
3404         so we end up with an "empty" formatting context.
3405
3406         * layout/integration/LayoutIntegrationLineLayout.cpp:
3407         (WebCore::LayoutIntegration::LineLayout::layout):
3408
3409 2020-02-19  Zalan Bujtas  <zalan@apple.com>
3410
3411         [First paint] Introduce FrameView::m_firstVisuallyNonEmptyLayoutMilestoneIsPending
3412         https://bugs.webkit.org/show_bug.cgi?id=207966
3413         <rdar://problem/59606528>
3414
3415         Reviewed by Simon Fraser.
3416
3417         This is in preparation for decoupling the "content is qualified as visually non-empty" check and layout, when
3418         the check happens soon after style recalc/render tree building and we need to wait until after layout to
3419         issue the milestone.
3420
3421         * page/FrameView.cpp:
3422         (WebCore::FrameView::resetLayoutMilestones):
3423         (WebCore::FrameView::fireLayoutRelatedMilestonesIfNeeded):
3424         * page/FrameView.h:
3425
3426 2020-02-19  Youenn Fablet  <youenn@apple.com>
3427
3428         [mac debug] Regression: http/tests/websocket/tests/hybi/workers/worker-reload.html is a flaky crash
3429         https://bugs.webkit.org/show_bug.cgi?id=207940
3430         <rdar://problem/59592000>
3431
3432         Reviewed by Chris Dumez.
3433
3434         Covered by debug asserts.
3435
3436         * Modules/websockets/WebSocket.cpp:
3437         (WebCore::WebSocket::connect):
3438         Pass registrable domain instead of URL.
3439         Isolate copy the domain before hopping to main thread for extra protection.
3440
3441 2020-02-19  Youenn Fablet  <youenn@apple.com>
3442
3443         Remove PlatformMediaSession::characteristics()
3444         https://bugs.webkit.org/show_bug.cgi?id=207926
3445
3446         Reviewed by Eric Carlson.
3447
3448         No change of behavior, removing no longer used code.
3449
3450         * Modules/mediastream/MediaStreamTrack.cpp:
3451         (WebCore::MediaStreamTrack::characteristics const): Deleted.
3452         * Modules/mediastream/MediaStreamTrack.h:
3453         * Modules/webaudio/AudioContext.h:
3454         * html/HTMLMediaElement.cpp:
3455         (WebCore::HTMLMediaElement::characteristics const): Deleted.
3456         * html/HTMLMediaElement.h:
3457         * platform/audio/PlatformMediaSession.cpp:
3458         (WebCore::PlatformMediaSession::characteristics const): Deleted.
3459         * platform/audio/PlatformMediaSession.h:
3460         (WebCore::PlatformMediaSessionClient::displayType const):
3461
3462 2020-02-19  Zalan Bujtas  <zalan@apple.com>
3463
3464         [LFC][Floats] FloatingContext::constraints should be able to handle empty candidate ranges (points)
3465         https://bugs.webkit.org/show_bug.cgi?id=207937
3466         <rdar://problem/59591109>
3467
3468         Reviewed by Antti Koivisto.
3469
3470         Test: fast/layoutformattingcontext/floats-shrinking-line-simple.html
3471
3472         Handle the case when the incoming vertical range is empty (line is empty).
3473
3474         * layout/floats/FloatingContext.cpp:
3475         (WebCore::Layout::FloatingContext::constraints const):
3476         * layout/floats/FloatingContext.h:
3477         * layout/inlineformatting/InlineFormattingContext.cpp:
3478         (WebCore::Layout::InlineFormattingContext::lineLayout):
3479
3480 2020-02-19  Brent Fulgham  <bfulgham@apple.com>
3481
3482         Re-disable top-level data URL navigations
3483         https://bugs.webkit.org/show_bug.cgi?id=207917
3484         <rdar://problem/59568037>
3485
3486         Reviewed by Darin Adler.
3487
3488         Calls to WKPage and WKWebView API used to load data and strings directly should be recognized by
3489         the loading code as being from client API calls. This brings these API behaviors into alignment
3490         with similar API for loading URLs and URLRequests directly. This change also allows us to enforce
3491         stricter handling of Data URLs, and to remove the need to explicitly permit top-level data URL
3492         navigation when client APIs are used.
3493
3494         Tested by TestWebKitAPI Navigation tests.
3495
3496         * page/Settings.yaml:
3497
3498 2020-02-19  Zalan Bujtas  <zalan@apple.com>
3499
3500         [LFC][IFC] Anonymous inline text box container is not the only type of anonymous containers
3501         https://bugs.webkit.org/show_bug.cgi?id=207945
3502         <rdar://problem/59592411>
3503
3504         Reviewed by Antti Koivisto.
3505
3506         Test: fast/layoutformattingcontext/anonymous-inline-container-simple.html
3507
3508         We construct anonymous inline containers for certain features like first-letter.
3509
3510         * layout/inlineformatting/InlineFormattingContext.cpp:
3511         (WebCore::Layout::nextInlineLevelBoxToLayout):
3512         (WebCore::Layout::InlineFormattingContext::layoutInFlowContent):
3513         (WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthConstraints):
3514         (WebCore::Layout::InlineFormattingContext::collectInlineContentIfNeeded):
3515
3516 2020-02-19  Megan Gardner  <megan_gardner@apple.com>
3517
3518         Ensure that contenteditable carets on macCatalyst are the right color, especially in Dark Mode
3519         https://bugs.webkit.org/show_bug.cgi?id=207789
3520         <rdar://problem/59429715>
3521
3522         Reviewed by Tim Horton.
3523
3524         Factor out caret color calculation to be used in WebPageIOS.
3525
3526         Fixes EditorStateTests.CaretColorInContentEditable.
3527
3528         * editing/FrameSelection.cpp:
3529         (WebCore::CaretBase::computeCaretColor):
3530         (WebCore::CaretBase::paintCaret const):
3531         * editing/FrameSelection.h:
3532
3533 2020-02-19  Chris Dumez  <cdumez@apple.com>
3534
3535         Unreviewed, fix assertions in storage access API layout tests after r256882.
3536
3537         * dom/DocumentStorageAccess.idl:
3538         Only expose the storage access API operations to the Web when the corresponding setting is
3539         enabled instead of relying on an assertion.
3540
3541         * testing/Internals.cpp:
3542         (WebCore::Internals::resetToConsistentState):
3543         Stop disabling the storage access API since the API is enabled by default.
3544
3545 2020-02-18  Zalan Bujtas  <zalan@apple.com>
3546
3547         Rename ScrollView::styleDidChange to styleAndRenderTreeDidChange
3548         https://bugs.webkit.org/show_bug.cgi?id=207921
3549
3550         Reviewed by Simon Fraser.
3551
3552         When ScrollView::styleDidChange is called we actually finished updating the render tree as well.
3553
3554         * dom/Document.cpp:
3555         (WebCore::Document::resolveStyle):
3556         * page/FrameView.cpp:
3557         (WebCore::FrameView::styleAndRenderTreeDidChange):
3558         (WebCore::FrameView::styleDidChange): Deleted.
3559         * page/FrameView.h:
3560         * platform/ScrollView.cpp:
3561         (WebCore::ScrollView::styleAndRenderTreeDidChange):
3562         (WebCore::ScrollView::styleDidChange): Deleted.
3563         * platform/ScrollView.h:
3564         * rendering/RenderView.cpp: FrameView::styleDidChange gets called by the Document.
3565         (WebCore::RenderView::styleDidChange): Deleted.
3566         * rendering/RenderView.h:
3567
3568 2020-02-18  Jack Lee  <shihchieh_lee@apple.com>
3569
3570         ASSERTION FAILED: !m_embeddedObjectsToUpdate->contains(nullptr) in WebCore::FrameView::updateEmbeddedObjects
3571         https://bugs.webkit.org/show_bug.cgi?id=191532
3572         <rdar://problem/46151555>
3573
3574         Reviewed by Darin Adler.
3575
3576         Add reentrancy protection for FrameView::updateEmbeddedObjects().
3577         Move the common code in renderWidgetLoadingPlugin() to inherited class, HTMLPlugInElement.
3578
3579         Test: fast/text/textCombine-update-embeddedObj-assert.html
3580
3581         * html/HTMLAppletElement.cpp:
3582         (WebCore::HTMLAppletElement::renderWidgetLoadingPlugin const):
3583         * html/HTMLEmbedElement.cpp:
3584         (WebCore::HTMLEmbedElement::renderWidgetLoadingPlugin const):
3585         * html/HTMLObjectElement.cpp:
3586         (WebCore::HTMLObjectElement::renderWidgetLoadingPlugin const): Deleted.
3587         * html/HTMLObjectElement.h:
3588         * html/HTMLPlugInElement.cpp:
3589         (WebCore::HTMLPlugInElement::renderWidgetLoadingPlugin const):
3590         * html/HTMLPlugInElement.h:
3591         * page/FrameView.cpp:
3592         (WebCore::FrameView::updateEmbeddedObjects):
3593         * page/FrameView.h:
3594
3595 2020-02-18  Youenn Fablet  <youenn@apple.com>
3596
3597         Reduce use of PlatformMediaSessionManager::sharedManager()
3598         https://bugs.webkit.org/show_bug.cgi?id=207924
3599
3600         Reviewed by Eric Carlson.
3601
3602         The plan is to be able to have PlatformMediaSession in GPU process which might have different managers,
3603         typically a manager per connection to web process.
3604         For that reason, reduce the use of the sharedManager to classes that can only live in WebProcess.
3605         No change of behavior.
3606
3607         * Modules/mediastream/MediaStreamTrack.cpp:
3608         (WebCore::MediaStreamTrack::MediaStreamTrack):
3609         * Modules/webaudio/AudioContext.cpp:
3610         (WebCore::AudioContext::AudioContext):
3611         * html/MediaElementSession.cpp:
3612         (WebCore::MediaElementSession::MediaElementSession):
3613         (WebCore::MediaElementSession::clientDataBufferingTimerFired):
3614         (WebCore::MediaElementSession::setHasPlaybackTargetAvailabilityListeners):
3615         * platform/audio/PlatformMediaSession.cpp:
3616         (WebCore::PlatformMediaSession::create):
3617         (WebCore::PlatformMediaSession::PlatformMediaSession):
3618         (WebCore::PlatformMediaSession::~PlatformMediaSession):
3619         (WebCore::PlatformMediaSession::setState):
3620         (WebCore::PlatformMediaSession::clientWillBeginPlayback):
3621         (WebCore::PlatformMediaSession::processClientWillPausePlayback):
3622         (WebCore::PlatformMediaSession::stopSession):
3623         (WebCore::PlatformMediaSession::isPlayingToWirelessPlaybackTargetChanged):
3624         (WebCore::PlatformMediaSession::canProduceAudioChanged):
3625         (WebCore::PlatformMediaSession::clientCharacteristicsChanged):
3626         (WebCore::PlatformMediaSession::manager):
3627         * platform/audio/PlatformMediaSession.h:
3628         * platform/audio/PlatformMediaSessionManager.h:
3629
3630 2020-02-18  Wenson Hsieh  <wenson_hsieh@apple.com>
3631
3632         REGRESSION (r256093): fast/events/touch/ios/block-without-overflow-scroll.html is failing
3633         https://bugs.webkit.org/show_bug.cgi?id=207919
3634         <rdar://problem/59565344>
3635
3636         Reviewed by Tim Horton.
3637
3638         Three iOS-specific layout tests began to fail after r256093, since they currently depend on a particular
3639         ordering when iterating over elements in a hash map. Instead of just rebaselining these tests, we can make them
3640         more robust against similar changes in the future by forcing a deterministic order when printing out synchronous
3641         touch event regions for testing.
3642
3643         I arbitrarily chose to sort the keys (which are touch event type names) in alphabetical order.
3644
3645         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
3646         (WebCore::ScrollingStateFrameScrollingNode::dumpProperties const):
3647
3648 2020-02-18  Youenn Fablet  <youenn@apple.com>
3649
3650         PlatformMediaSessionClient::processingUserGestureForMedia is not needed
3651         https://bugs.webkit.org/show_bug.cgi?id=207922
3652
3653         Reviewed by Eric Carlson.
3654
3655         All code relies on the document and the virtual method is never used so remove it.
3656         No change of behavior.
3657
3658         * Modules/mediastream/MediaStreamTrack.cpp:
3659         (WebCore::MediaStreamTrack::processingUserGestureForMedia const): Deleted.
3660         * Modules/mediastream/MediaStreamTrack.h:
3661         * Modules/webaudio/AudioContext.cpp:
3662         (WebCore::AudioContext::processingUserGestureForMedia const): Deleted.
3663         * Modules/webaudio/AudioContext.h:
3664         * html/HTMLMediaElement.h:
3665         * platform/audio/PlatformMediaSession.h:
3666
3667 2020-02-18  Youenn Fablet  <youenn@apple.com>
3668
3669         SWServer::claim should check for the service worker to be active
3670         https://bugs.webkit.org/show_bug.cgi?id=207739
3671         <rdar://problem/45441129>
3672
3673         Reviewed by Alex Christensen.
3674
3675         claim is only working for service workers that are active.
3676         But there might be a time when a service worker is active in its web process but redundant in networking process.
3677         Thus, we need to move the check from WebProcess to NetworkProcess.
3678
3679         * workers/service/ServiceWorkerClients.cpp:
3680         (WebCore::ServiceWorkerClients::claim):
3681         * workers/service/context/SWContextManager.h:
3682         * workers/service/server/SWServer.cpp:
3683         (WebCore::SWServer::claim):
3684         * workers/service/server/SWServer.h:
3685         * workers/service/server/SWServerToContextConnection.cpp:
3686         (WebCore::SWServerToContextConnection::claim):
3687         * workers/service/server/SWServerToContextConnection.h:
3688         * workers/service/server/SWServerWorker.cpp:
3689         (WebCore::SWServerWorker::claim): Deleted.
3690         * workers/service/server/SWServerWorker.h:
3691         (WebCore::SWServerWorker::isActive const):
3692
3693 2020-02-18  Zalan Bujtas  <zalan@apple.com>
3694
3695         [LFC][IFC] Replaced elements can also establish formatting contexts.
3696         https://bugs.webkit.org/show_bug.cgi?id=207923
3697         <rdar://problem/59571203>
3698
3699         Reviewed by Simon Fraser.
3700
3701         While replaced boxes (leaf boxes) can also establish formatting contexts (e.g. style="inline-block"), we
3702         only need to construct formatting context objects for the root's descendants (and not for the root itself). 
3703
3704         Test: fast/layoutformattingcontext/block-only/replaced-as-inline-block-simple.html
3705
3706         * layout/inlineformatting/InlineFormattingContext.cpp:
3707         (WebCore::Layout::InlineFormattingContext::layoutInFlowContent):
3708
3709 2020-02-18  Said Abou-Hallawa  <sabouhallawa@apple.com>
3710
3711         Allow different back-ends for ImageBuffer
3712         https://bugs.webkit.org/show_bug.cgi?id=207048
3713
3714         Reviewed by Tim Horton.
3715
3716         ImageBuffer will be re-factored to decouple the platform specifics and
3717         the back-end details from the interface "ImageBuffer".
3718
3719         A class hierarchy for the ImageBufferBackend will added to allow code
3720         sharing and to split the code according to the platform and the back-end
3721         details.
3722
3723         ImageBuffer will be kept interface with the rest of the code but different
3724         back-ends will be created. ConcreteImageBuffer is a template class which
3725         inherits ImageBuffer and will  act as a bridge to the concrete
3726         ImageBufferBackend.
3727
3728         Based on the RenderingMode, a ConcreteImageBuffer<BackendType> will
3729         be created. Instead of checking the renderingMode in many places of the
3730         code and instead of and using preprocessor directives, all these decisions
3731         will be made in the concrete ImageBufferBackend.
3732
3733         This re-factoring will allow creating new types of ImageBuffers backed by
3734         new ImageBufferBackends. These new ImageBufferBackends will implement
3735         DisplayList drawing and synchronize remote rendering.
3736
3737         * Headers.cmake:
3738         * PlatformAppleWin.cmake:
3739         * PlatformFTW.cmake:
3740         * PlatformMac.cmake:
3741         * PlatformWin.cmake:
3742         * Sources.txt:
3743         * SourcesCocoa.txt:
3744         * WebCore.xcodeproj/project.pbxproj:
3745         * html/CanvasBase.cpp:
3746         (WebCore::CanvasBase::setImageBuffer const):
3747         * platform/Cairo.cmake:
3748         * platform/SourcesCairo.txt:
3749         * platform/graphics/BitmapImage.cpp:
3750         (WebCore::BitmapImage::nativeImageForCurrentFrameRespectingOrientation):
3751         * platform/graphics/ConcreteImageBuffer.h: Added.
3752         (WebCore::ConcreteImageBuffer::create):
3753         (WebCore::ConcreteImageBuffer::ConcreteImageBuffer):
3754         (WebCore::ConcreteImageBuffer::ensureBackend const):
3755         (WebCore::ConcreteImageBuffer::putImageData):
3756         * platform/graphics/ImageBuffer.cpp:
3757         (WebCore::ImageBuffer::create):
3758         (WebCore::ImageBuffer::createCompatibleBuffer):
3759         (WebCore::ImageBuffer::sizeNeedsClamping):
3760         (WebCore::ImageBuffer::compatibleBufferSize):
3761         (WebCore::ImageBuffer::sinkIntoNativeImage):
3762         (WebCore::ImageBuffer::sinkIntoImage):
3763         (WebCore::ImageBuffer::drawConsuming):
3764         (WebCore::ImageBuffer::toBGRAData const): Deleted.
3765         (WebCore::ImageBuffer::transformColorSpace): Deleted.
3766         (WebCore::ImageBuffer::genericConvertToLuminanceMask): Deleted.
3767         (WebCore::ImageBuffer::convertToLuminanceMask): Deleted.
3768         (WebCore::ImageBuffer::platformLayer const): Deleted.
3769         (WebCore::ImageBuffer::copyToPlatformTexture): Deleted.
3770         (WebCore::ImageBuffer::memoryCost const): Deleted.
3771         (WebCore::ImageBuffer::externalMemoryCost const): Deleted.
3772         * platform/graphics/ImageBuffer.h:
3773         (WebCore::ImageBuffer::draw):
3774         (WebCore::ImageBuffer::drawPattern):
3775         (WebCore::ImageBuffer::drawConsuming):
3776         (WebCore::ImageBuffer::putImageData):
3777         (): Deleted.
3778         (WebCore::ImageBuffer::internalSize const): Deleted.
3779         (WebCore::ImageBuffer::logicalSize const): Deleted.
3780         (WebCore::ImageBuffer::resolutionScale const): Deleted.
3781         (WebCore::ImageBuffer::baseTransform const): Deleted.
3782         * platform/graphics/ImageBufferBackend.cpp: Added.
3783         (WebCore::ImageBufferBackend::ImageBufferBackend):
3784         (WebCore::ImageBufferBackend::calculateBackendSize):
3785         (WebCore::ImageBufferBackend::sinkIntoNativeImage):
3786         (WebCore::ImageBufferBackend::sinkIntoImage):
3787         (WebCore::ImageBufferBackend::drawConsuming):
3788         (WebCore::ImageBufferBackend::convertToLuminanceMask):
3789         (WebCore::ImageBufferBackend::toBGRAData const):
3790         (WebCore::copyPremultipliedToPremultiplied):
3791         (WebCore::copyPremultipliedToUnpremultiplied):
3792         (WebCore::copyUnpremultipliedToPremultiplied):
3793         (WebCore::copyFunctor):
3794         (WebCore::ImageBufferBackend::copyImagePixels const):
3795         (WebCore::ImageBufferBackend::getImageData const):
3796         (WebCore::ImageBufferBackend::putImageData):
3797         * platform/graphics/ImageBufferBackend.h: Added.
3798         (WebCore::ImageBufferBackend::flushContext):
3799         (WebCore::ImageBufferBackend::logicalSize const):
3800         (WebCore::ImageBufferBackend::backendSize const):
3801         (WebCore::ImageBufferBackend::resolutionScale const):
3802         (WebCore::ImageBufferBackend::colorSpace const):
3803         (WebCore::ImageBufferBackend::baseTransform const):
3804         (WebCore::ImageBufferBackend::memoryCost const):
3805         (WebCore::ImageBufferBackend::externalMemoryCost const):
3806         (WebCore::ImageBufferBackend::transformColorSpace):
3807         (WebCore::ImageBufferBackend::platformLayer const):
3808         (WebCore::ImageBufferBackend::copyToPlatformTexture const):
3809         (WebCore::ImageBufferBackend::bytesPerRow const):
3810         (WebCore::ImageBufferBackend::backendColorFormat const):
3811         (WebCore::ImageBufferBackend::toBackendCoordinates const):
3812         (WebCore::ImageBufferBackend::logicalRect const):
3813         (WebCore::ImageBufferBackend::backendRect const):
3814         * platform/graphics/PlatformImageBuffer.h: Added.
3815         * platform/graphics/ShadowBlur.cpp:
3816         (WebCore::ShadowBlur::drawShadowBuffer):
3817         * platform/graphics/cairo/CairoOperations.cpp:
3818         (WebCore::Cairo::drawShadowLayerBuffer):
3819         (WebCore::Cairo::drawShadowImage):
3820         (WebCore::Cairo::fillShadowBuffer):
3821         * platform/graphics/cairo/GraphicsContextCairo.cpp:
3822         (WebCore::GraphicsContext::clipToImageBuffer):
3823         * platform/graphics/cairo/GraphicsContextImplCairo.cpp:
3824         (WebCore::GraphicsContextImplCairo::clipToImageBuffer):
3825         * platform/graphics/cairo/ImageBufferCairo.cpp: Removed.
3826         * platform/graphics/cairo/ImageBufferCairoBackend.cpp: Added.
3827         (WebCore::ImageBufferCairoBackend::copyImage const):
3828         (WebCore::ImageBufferCairoBackend::draw):
3829         (WebCore::ImageBufferCairoBackend::drawPattern):
3830         (WebCore::ImageBufferCairoBackend::transformColorSpace):
3831         (WebCore::ImageBufferCairoBackend::toDataURL const):
3832         (WebCore::ImageBufferCairoBackend::toData const):
3833         * platform/graphics/cairo/ImageBufferCairoBackend.h: Added.
3834         (WebCore::ImageBufferCairoBackend::platformTransformColorSpace):
3835         * platform/graphics/cairo/ImageBufferCairoGLSurfaceBackend.cpp: Added.
3836         (WebCore::clearSurface):
3837         (WebCore::ImageBufferCairoGLSurfaceBackend::create):
3838         (WebCore::ImageBufferCairoGLSurfaceBackend::ImageBufferCairoGLSurfaceBackend):
3839         (WebCore::ImageBufferCairoGLSurfaceBackend::~ImageBufferCairoGLSurfaceBackend):
3840         (WebCore::ImageBuffer::platformLayer const):
3841         (WebCore::ImageBufferCairoGLSurfaceBackend::copyToPlatformTexture):
3842         (WebCore::ImageBufferCairoGLSurfaceBackend::createCompositorBuffer):
3843         (WebCore::ImageBufferCairoGLSurfaceBackend::swapBuffersIfNeeded):
3844         (WebCore::ImageBufferCairoGLSurfaceBackend::paintToTextureMapper):
3845         * platform/graphics/cairo/ImageBufferCairoGLSurfaceBackend.h: Added.
3846         * platform/graphics/cairo/ImageBufferCairoImageSurfaceBackend.cpp: Added.
3847         (WebCore::ImageBufferCairoImageSurfaceBackend::create):
3848         (WebCore::ImageBufferCairoImageSurfaceBackend::ImageBufferCairoImageSurfaceBackend):
3849         (WebCore::ImageBufferCairoImageSurfaceBackend::platformTransformColorSpace):
3850         * platform/graphics/cairo/ImageBufferCairoImageSurfaceBackend.h: Added.
3851         * platform/graphics/cairo/ImageBufferCairoSurfaceBackend.cpp: Added.
3852         (WebCore::ImageBufferCairoSurfaceBackend::ImageBufferCairoSurfaceBackend):
3853         (WebCore::ImageBufferCairoSurfaceBackend::context const):
3854         (WebCore::ImageBufferCairoSurfaceBackend::bytesPerRow const):
3855         (WebCore::ImageBufferCairoSurfaceBackend::copyNativeImage const):
3856         (WebCore::ImageBufferCairoSurfaceBackend::cairoSurfaceCoerceToImage const):
3857         (WebCore::ImageBufferCairoSurfaceBackend::toBGRAData const):
3858         (WebCore::ImageBufferCairoSurfaceBackend::getImageData const):
3859         (WebCore::ImageBufferCairoSurfaceBackend::putImageData):
3860         * platform/graphics/cairo/ImageBufferCairoSurfaceBackend.h: Added.
3861         * platform/graphics/cg/ImageBufferCG.cpp: Removed.
3862         * platform/graphics/cg/ImageBufferCGBackend.cpp: Added.
3863         (WebCore::ImageBufferCGBackend::contextColorSpace):
3864         (WebCore::ImageBufferCGBackend::setupContext):
3865         (WebCore::createCroppedImageIfNecessary):
3866         (WebCore::createBitmapImageAfterScalingIfNeeded):
3867         (WebCore::ImageBufferCGBackend::copyImage const):
3868         (WebCore::ImageBufferCGBackend::sinkIntoImage):
3869         (WebCore::ImageBufferCGBackend::draw):
3870         (WebCore::ImageBufferCGBackend::drawPattern):
3871         (WebCore::ImageBufferCGBackend::baseTransform const):
3872         (WebCore::ImageBufferCGBackend::toCFData const):
3873         (WebCore::ImageBufferCGBackend::toData const):
3874         (WebCore::ImageBufferCGBackend::toDataURL const):
3875         (WebCore::makeVImageBuffer):
3876         (WebCore::copyImagePixelsAccelerated):
3877         (WebCore::ImageBufferCGBackend::copyImagePixels const):
3878         * platform/graphics/cg/ImageBufferCGBackend.h: Added.
3879         * platform/graphics/cg/ImageBufferCGBitmapBackend.cpp: Added.
3880         (WebCore::ImageBufferCGBitmapBackend::create):
3881         (WebCore::ImageBufferCGBitmapBackend::ImageBufferCGBitmapBackend):
3882         (WebCore::ImageBufferCGBitmapBackend::context const):
3883         (WebCore::ImageBufferCGBitmapBackend::copyNativeImage const):
3884         (WebCore::ImageBufferCGBitmapBackend::toBGRAData const):
3885         (WebCore::ImageBufferCGBitmapBackend::getImageData const):
3886         (WebCore::ImageBufferCGBitmapBackend::putImageData):
3887         * platform/graphics/cg/ImageBufferCGBitmapBackend.h: Added.
3888         * platform/graphics/cg/ImageBufferDataCG.cpp: Removed.
3889         * platform/graphics/cg/ImageBufferIOSurfaceBackend.cpp: Added.
3890         (WebCore::ImageBufferIOSurfaceBackend::calculateBackendSize):
3891         (WebCore::ImageBufferIOSurfaceBackend::contextColorSpace):
3892         (WebCore::ImageBufferIOSurfaceBackend::create):
3893         (WebCore::ImageBufferIOSurfaceBackend::ImageBufferIOSurfaceBackend):
3894         (WebCore::ImageBufferIOSurfaceBackend::context const):
3895         (WebCore::ImageBufferIOSurfaceBackend::flushContext):
3896         (WebCore::ImageBufferIOSurfaceBackend::memoryCost const):
3897         (WebCore::ImageBufferIOSurfaceBackend::externalMemoryCost const):
3898         (WebCore::ImageBufferIOSurfaceBackend::bytesPerRow const):
3899         (WebCore::ImageBufferIOSurfaceBackend::backendColorFormat const):
3900         (WebCore::ImageBufferIOSurfaceBackend::copyNativeImage const):
3901         (WebCore::ImageBufferIOSurfaceBackend::sinkIntoNativeImage):
3902         (WebCore::ImageBufferIOSurfaceBackend::drawConsuming):
3903         (WebCore::ImageBufferIOSurfaceBackend::toBGRAData const):
3904         (WebCore::ImageBufferIOSurfaceBackend::getImageData const):
3905         (WebCore::ImageBufferIOSurfaceBackend::putImageData):
3906         * platform/graphics/cg/ImageBufferIOSurfaceBackend.h: Added.
3907         * platform/graphics/cg/PDFDocumentImage.cpp:
3908         (WebCore::PDFDocumentImage::updateCachedImageIfNeeded):
3909         * platform/graphics/cocoa/IOSurface.mm:
3910         (WebCore::IOSurface::createFromImageBuffer): Deleted.
3911         * platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp:
3912         (WebCore::GraphicsContextGLOpenGL::paintRenderingResultsToCanvas):
3913         * platform/graphics/win/ImageBufferDataDirect2D.cpp: Removed.
3914         * platform/graphics/win/ImageBufferDataDirect2D.h: Removed.
3915         * platform/graphics/win/ImageBufferDirect2D.cpp: Removed.
3916         * platform/graphics/win/ImageBufferDirect2DBackend.cpp: Added.
3917         (WebCore::ImageBufferDirect2DBackend::create):
3918         (WebCore::ImageBufferDirect2DBackend::ImageBufferDirect2DBackend):
3919         (WebCore::ImageBufferDirect2DBackend::context const):
3920         (WebCore::ImageBufferDirect2DBackend::flushContext):
3921         (WebCore::ImageBufferDirect2DBackend::copyNativeImage const):
3922         (WebCore::createCroppedImageIfNecessary):
3923         (WebCore::createBitmapImageAfterScalingIfNeeded):
3924         (WebCore::ImageBufferDirect2DBackend::copyImage const):
3925         (WebCore::ImageBufferDirect2DBackend::sinkIntoImage):
3926         (WebCore::ImageBufferDirect2DBackend::compatibleBitmap):
3927         (WebCore::ImageBufferDirect2DBackend::draw):
3928         (WebCore::ImageBufferDirect2DBackend::drawPattern):
3929         (WebCore::ImageBufferDirect2DBackend::toDataURL const):
3930         (WebCore::ImageBufferDirect2DBackend::toData const):
3931         (WebCore::ImageBufferDirect2DBackend::toBGRAData const):
3932         (WebCore::ImageBufferDirect2DBackend::getImageData const):
3933         (WebCore::ImageBufferDirect2DBackend::putImageData):
3934         * platform/graphics/win/ImageBufferDirect2DBackend.h: Added.
3935         * platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.cpp:
3936         (WebCore::WrappedMockRealtimeVideoSource::updateSampleBuffer):
3937         * rendering/svg/SVGRenderingContext.cpp:
3938         (WebCore::SVGRenderingContext::bufferForeground):
3939
3940 2020-02-18  Zalan Bujtas  <zalan@apple.com>
3941
3942         [First paint] Remove elementOverflowRectIsLargerThanThreshold check in qualifiesAsVisuallyNonEmpty
3943         https://bugs.webkit.org/show_bug.cgi?id=207907
3944         <rdar://problem/59562169>
3945
3946         Reviewed by Geoffrey Garen.
3947
3948         This is in preparation for being able to qualify for visually non-empty content without looking at geometry.
3949         This check was added long ago, initially with a 200px value which got reduced to 48px to reduce painting laten