[Curl] Add TLS debugging feature to log encryption keys
[WebKit.git] / Source / WebCore / ChangeLog
1 2020-02-28  Takashi Komori  <Takashi.Komori@sony.com>
2
3         [Curl] Add TLS debugging feature to log encryption keys
4         https://bugs.webkit.org/show_bug.cgi?id=208192
5
6         Reviewed by Fujii Hironori.
7
8         This patch enables recording encryption keys on curl port.
9         When you set key log file path to environment variable SSLKEYLOGFILE on curl port, network process writes encryption keys into the path.
10         The key log file follows the NSS key log format and this feature is as same as Chrome and Firefox have.
11
12         See also: https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/Key_Log_Format
13
14         Test: No tests for this debugging feature. We have to check manually if the log file is generate.
15
16         * platform/network/curl/CurlContext.cpp:
17         (WebCore::CurlContext::CurlContext):
18         * platform/network/curl/CurlContext.h:
19         (WebCore::CurlContext::shouldLogTLSKey const):
20         (WebCore::CurlContext::tlsKeyLogFilePath const):
21         * platform/network/curl/CurlSSLVerifier.cpp:
22         (WebCore::CurlSSLVerifier::CurlSSLVerifier):
23         (WebCore::CurlSSLVerifier::infoCallback):
24         (WebCore::CurlSSLVerifier::logTLSKey):
25         * platform/network/curl/CurlSSLVerifier.h:
26
27 2020-02-28  Chris Dumez  <cdumez@apple.com>
28
29         MediaResourceLoader leaks resource responses
30         https://bugs.webkit.org/show_bug.cgi?id=208267
31
32         Reviewed by Eric Carlson.
33
34         MediaResourceLoader leaks resource responses when browsing in Safari, even though these responses are
35         only used for testing. AVAssetCustomURLBridgeForNSURLSession holds on to the WebCoreNSURLSession, which
36         keeps the MediaResourceLoader alive, even if there is no media on the current page. In turn, the
37         MediaResourceLoader always keeps in memory the last 5 HTTP responses.
38
39         To address the issue, we now only record these responses when running the tests.
40
41         * loader/MediaResourceLoader.cpp:
42         (WebCore::MediaResourceLoader::recordResponsesForTesting):
43         (WebCore::MediaResourceLoader::addResponseForTesting):
44         * loader/MediaResourceLoader.h:
45         * testing/Internals.cpp:
46         (WebCore::Internals::resetToConsistentState):
47
48 2020-02-28  Keith Rollin  <krollin@apple.com>
49
50         Convert frame address in logging statements to pageID+frameID
51         https://bugs.webkit.org/show_bug.cgi?id=208325
52         <rdar://problem/59850768>
53
54         Reviewed by Alex Christensen.
55
56         Some old logging prints the address of the associated frame object.
57         Annotating logging statements this way makes it difficult to match up
58         that logging with other logging that uses pageID+frameID. Update the
59         logging to consistently use the latter format.
60
61         No new tests -- no new or changed functionality.
62
63         * loader/DocumentLoader.cpp:
64         (WebCore::DocumentLoader::setRequest):
65         (WebCore::DocumentLoader::setMainDocumentError):
66         (WebCore::DocumentLoader::mainReceivedError):
67         (WebCore::DocumentLoader::stopLoading):
68         (WebCore::DocumentLoader::notifyFinished):
69         (WebCore::DocumentLoader::willSendRequest):
70         (WebCore::DocumentLoader::tryLoadingSubstituteData):
71         (WebCore::DocumentLoader::disallowDataRequest const):
72         (WebCore::DocumentLoader::continueAfterContentPolicy):
73         (WebCore::DocumentLoader::startLoadingMainResource):
74         (WebCore::DocumentLoader::loadMainResource):
75         (WebCore::DocumentLoader::cancelMainResourceLoad):
76         * loader/FrameLoader.cpp:
77         (WebCore::FrameLoader::pageID const):
78         (WebCore::FrameLoader::frameID const):
79         (WebCore::FrameLoader::retryAfterFailedCacheOnlyMainResourceLoad):
80         * loader/FrameLoader.h:
81         * loader/ResourceLoader.cpp:
82         * loader/SubresourceLoader.cpp:
83         * loader/cache/CachedResource.cpp:
84         (WebCore::CachedResource::load):
85         * loader/cache/CachedResourceLoader.cpp:
86         (WebCore::CachedResourceLoader::requestResource):
87         * page/Frame.cpp:
88         (WebCore::Frame::pageID const):
89         (WebCore::Frame::frameID const):
90         * page/Frame.h:
91         * page/FrameView.cpp:
92
93 2020-02-28  Eric Carlson  <eric.carlson@apple.com>
94
95         No port uses USE_NATIVE_FULLSCREEN_VIDEO, remove it
96         https://bugs.webkit.org/show_bug.cgi?id=208378
97         <rdar://problem/59892497>
98
99         Reviewed by Jer Noble.
100
101         No new tests, unused code removed.
102
103         * dom/FullscreenManager.cpp:
104         (WebCore::FullscreenManager::willEnterFullscreen):
105         * platform/graphics/MediaPlayer.cpp:
106         (WebCore::MediaPlayer::enterFullscreen): Deleted.
107         (WebCore::MediaPlayer::exitFullscreen): Deleted.
108         (WebCore::MediaPlayer::canEnterFullscreen const): Deleted.
109         * platform/graphics/MediaPlayer.h:
110         * platform/graphics/MediaPlayerPrivate.h:
111         (WebCore::MediaPlayerPrivateInterface::enterFullscreen): Deleted.
112         (WebCore::MediaPlayerPrivateInterface::exitFullscreen): Deleted.
113         (WebCore::MediaPlayerPrivateInterface::canEnterFullscreen const): Deleted.
114
115 2020-02-28  Eric Carlson  <eric.carlson@apple.com>
116
117         Regression r257612: Windows build broken
118         https://bugs.webkit.org/show_bug.cgi?id=208372
119         <rdar://problem/59885001>
120
121         Unreviewed Windows build fix.
122
123         * platform/graphics/InbandGenericCue.cpp:
124         (WebCore::InbandGenericCue::toJSONString const):
125
126 2020-02-28  Dean Jackson  <dino@apple.com>
127
128         updateCSSTransitionsForElementAndProperty should clone RenderStyles
129         https://bugs.webkit.org/show_bug.cgi?id=208356
130         rdar://59869560
131
132         Reviewed by Antti Koivisto.
133
134         Make ownership of the local variable clear by cloning the RenderStyles
135         used in updateCSSTransitionsForElementAndProperty rather than referencing
136         different versions.
137
138         * animation/AnimationTimeline.cpp:
139         (WebCore::AnimationTimeline::updateCSSTransitionsForElementAndProperty):
140
141 2020-02-28  Chris Dumez  <cdumez@apple.com>
142
143         Retain cycle between CSSFontSelector -> CSSFontFaceSet -> CSSFontFace -> CSSFontSelector
144         https://bugs.webkit.org/show_bug.cgi?id=196437
145         <rdar://problem/46598332>
146
147         Reviewed by Alex Christensen.
148
149         Break the reference cycle using a WeakPtr. The leak was reproducible by browsing CNN.com
150         and then navigating to about:blank (those objects would stay around, even after memory
151         pressure signal).
152
153         * css/CSSFontFace.cpp:
154         (WebCore::CSSFontFace::CSSFontFace):
155         (WebCore::CSSFontFace::fontLoadEventOccurred):
156         * css/CSSFontFace.h:
157
158 2020-02-28  Alberto Garcia  <berto@igalia.com>
159
160         [SOUP] Unreviewed. Fix unused parameter warning
161
162         * platform/network/soup/NetworkStorageSessionSoup.cpp:
163         (WebCore::NetworkStorageSession::getRawCookies const):
164
165 2020-02-28  Yusuke Suzuki  <ysuzuki@apple.com>
166
167         Shrink-to-fit Display::LineBox/Display::Run vectors.
168         https://bugs.webkit.org/show_bug.cgi?id=208343
169
170         Reviewed by Antti Koivisto.
171
172         From the collected data in PLT5, 95% of Runs / LineBoxes are <= 4, while we are having 10 and 5 inlineCapacity.
173         We adjust this inlineCapacity to 4 based on this number. It also covers almost all of Speedometer2.0 content (in it, 99.9% is 1).
174         We also call `shrinkToFit` to make it the exact size after baking Display::InlineContent. It should be no-op in 95% cases.
175
176         * layout/displaytree/DisplayInlineContent.h:
177         * layout/inlineformatting/InlineFormattingState.h:
178         (WebCore::Layout::InlineFormattingState::shrinkDisplayInlineContent):
179         * layout/integration/LayoutIntegrationLineLayout.cpp:
180         (WebCore::LayoutIntegration::LineLayout::layout):
181
182 2020-02-28  Alberto Garcia  <berto@igalia.com>
183
184         [GStreamer] Unreviewed. Fix build warning.
185
186         queueSize is of type size_t so it should use the proper format
187         specifier.
188
189         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
190         (restartLoaderIfNeeded):
191         (stopLoaderIfNeeded):
192
193 2020-02-28  Youenn Fablet  <youenn@apple.com>
194
195         Conversion between MediaSample and RemoteVideoSample should preserve the rotation information
196         https://bugs.webkit.org/show_bug.cgi?id=208240
197
198         Reviewed by Eric Carlson.
199
200         Update RemoteVideoSample to have surface getter be const.
201         Add a new routine to convert a RemoteVideoSample in a MediaSample, with proper rotation and mirrored information.
202         Covered by manual testing.
203
204         * platform/graphics/RemoteVideoSample.cpp:
205         (WebCore::RemoteVideoSample::surface const):
206         * platform/graphics/RemoteVideoSample.h:
207         (WebCore::RemoteVideoSample::mirrored const):
208         * platform/graphics/cv/ImageTransferSessionVT.h:
209         * platform/graphics/cv/ImageTransferSessionVT.mm:
210         (WebCore::ImageTransferSessionVT::createMediaSample):
211
212 2020-02-28  Carlos Garcia Campos  <cgarcia@igalia.com>
213
214         REGRESSION(r257299): [GTK] Test imported/w3c/web-platform-tests/css/css-sizing/button-min-width.html is failing since r257299
215         https://bugs.webkit.org/show_bug.cgi?id=208296
216
217         Reviewed by Adrian Perez de Castro.
218
219         We are no longer honoring the style min width/height of buttons.
220
221         * platform/Theme.cpp:
222         (WebCore::Theme::minimumControlSize const): Add zoomedSize parameter.
223         * platform/Theme.h:
224         * platform/adwaita/ThemeAdwaita.cpp:
225         (WebCore::ThemeAdwaita::minimumControlSize const): Use the style min size unless it's intrinsic or auto.
226         * platform/adwaita/ThemeAdwaita.h:
227         * platform/mac/ThemeMac.h:
228         * platform/mac/ThemeMac.mm:
229         (WebCore::ThemeMac::minimumControlSize const): Add zoomedSize parameter.
230         * rendering/RenderTheme.cpp:
231         (WebCore::RenderTheme::adjustStyle): Pass style min size to Theme::minimumControlSize().
232
233 2020-02-28  Carlos Garcia Campos  <cgarcia@igalia.com>
234
235         REGRESSION(r257299): [GTK] Check and radio buttons don't keep the aspect ratio
236         https://bugs.webkit.org/show_bug.cgi?id=208302
237
238         Reviewed by Adrian Perez de Castro.
239
240         When different width and height is used, we should use the lower value and render the button centered.
241
242         * platform/adwaita/ThemeAdwaita.cpp:
243         (WebCore::ThemeAdwaita::paintCheckbox):
244         (WebCore::ThemeAdwaita::paintRadio):
245
246 2020-02-28  Carlos Garcia Campos  <cgarcia@igalia.com>
247
248         REGRESSION(r257299): [GTK] Test fast/replaced/table-percent-height.html is failing since r257299
249         https://bugs.webkit.org/show_bug.cgi?id=208295
250
251         Reviewed by Adrian Perez de Castro.
252
253         We are now hardcoding the size of check and radio buttons, except when width and height are both specified.
254
255         * platform/adwaita/ThemeAdwaita.cpp:
256         (WebCore::ThemeAdwaita::controlSize const): Only set width and height of check and radio buttons when they are
257         intrinsic or auto.
258
259 2020-02-28  Carlos Garcia Campos  <cgarcia@igalia.com>
260
261         REGRESSION(r257299): [GTK] Test fast/forms/menulist-restrict-line-height.html is failing since r257299
262         https://bugs.webkit.org/show_bug.cgi?id=208241
263
264         Reviewed by Adrian Perez de Castro.
265
266         We should not honor line-height for styled combo buttons.
267
268         * rendering/RenderThemeAdwaita.cpp:
269         (WebCore::RenderThemeAdwaita::adjustMenuListStyle const):
270         (WebCore::RenderThemeAdwaita::adjustMenuListButtonStyle const):
271         * rendering/RenderThemeAdwaita.h:
272
273 2020-02-28  Carlos Garcia Campos  <cgarcia@igalia.com>
274
275         REGRESSION(r257299): [GTK] box shadow is no longer ignored for search field decorations
276         https://bugs.webkit.org/show_bug.cgi?id=208239
277
278         Reviewed by Adrian Perez de Castro.
279
280         Since we no longer use RenderTheme to paint the search field decorations we need to ensure a box shadow isn't
281         used for them in the CSS.
282
283         * css/themeAdwaita.css:
284         (input[type="search"]::-webkit-search-results-button,): Add -webkit-box-shadow: none !important;
285         (input[type="search"]::-webkit-search-cancel-button): Ditto.
286         (body[dir="rtl"] input[type="search"]::-webkit-search-cancel-button): Ditto.
287
288 2020-02-28  Carlos Garcia Campos  <cgarcia@igalia.com>
289
290         REGRESSION(r257299): Test fast/css/button-height.html is failing since r257299
291         https://bugs.webkit.org/show_bug.cgi?id=208237
292
293         Reviewed by Adrian Perez de Castro.
294
295         The new theming code doesn't use the same border size for button and input[type="button"].
296
297         * platform/adwaita/ThemeAdwaita.cpp:
298         (WebCore::ThemeAdwaita::controlBorder const): Use the same border for all buttons.
299         * platform/adwaita/ThemeAdwaita.h:
300
301 2020-02-28  Carlos Garcia Campos  <cgarcia@igalia.com>
302
303         Unreviewed. Fix hover effects broken for GTK port after r257592
304
305         Add missing braces to if that now has two lines in the body. This was causing all mouse events to be considered
306         read only when building with TOUCH_EVENTS enabled.
307
308         * page/EventHandler.cpp:
309         (WebCore::EventHandler::handleMouseMoveEvent):
310
311 2020-02-28  Carlos Garcia Campos  <cgarcia@igalia.com>
312
313         Test imported/blink/fast/forms/datalist/slider-appearance-with-ticks-crash.html fails
314         https://bugs.webkit.org/show_bug.cgi?id=190613
315
316         Reviewed by Wenson Hsieh.
317
318         Check the input is a range control before trying to paint slider ticks.
319
320         * rendering/RenderTheme.cpp:
321         (WebCore::RenderTheme::paintSliderTicks):
322
323 2020-02-27  Devin Rousso  <drousso@apple.com>
324
325         Web Inspector: allow use of dark mode theme independently from system-wide theme
326         https://bugs.webkit.org/show_bug.cgi?id=186308
327         <rdar://problem/40785895>
328
329         Reviewed by Timothy Hatcher.
330
331         * inspector/InspectorFrontendHost.idl:
332         * inspector/InspectorFrontendHost.h:
333         * inspector/InspectorFrontendHost.cpp:
334         (WebCore::InspectorFrontendHost::setForcedAppearance): Added.
335         Expose a way to call `Page::setUseDarkAppearanceOverride` from the Web Inspector frontend.
336
337 2020-02-27  Don Olmstead  <don.olmstead@sony.com>
338
339         Fix WebCore export macros for declspec
340         https://bugs.webkit.org/show_bug.cgi?id=208363
341
342         Reviewed by Konstantin Tokarev.
343
344         Modified the PlatformExportMacros to match the other export macros. Originally
345         Windows ports were treated differently and they had to set their own export macros.
346         This isn't ideal because how WebCore is built is really dependent on the CMake
347         definition of the library type.
348
349         * CMakeLists.txt:
350         * WebCorePrefix.h:
351         * platform/PlatformExportMacros.h:
352         * testing/js/WebCoreTestSupportPrefix.h:
353
354 2020-02-27  Dean Jackson  <dino@apple.com>
355
356         MemoryRelease logging uses a unique_ptr with unclear lifetime
357         https://bugs.webkit.org/show_bug.cgi?id=208361
358
359         Reviewed by Alex Christensen.
360
361         The logging here was getting a unique_ptr inside the loop, which
362         causes newer versions of clang to complain with an error:
363         object backing the pointer will be destroyed at the end of the full-expression [-Werror,-Wdangling-gsl]
364
365         Using a temporary local variable fixes the problem.
366
367         * page/MemoryRelease.cpp:
368         (WebCore::logMemoryStatisticsAtTimeOfDeath):
369
370 2020-02-27  Doug Kelly  <dougk@apple.com>
371
372         Hit test with clipPath referencing parent element causes infinite recursion
373         https://bugs.webkit.org/show_bug.cgi?id=208279
374
375         Reviewed by Ryosuke Niwa.
376
377         Add an early return for SVG hit tests which have a child element referencing a  parent clipPath.
378         This change breaks the cycle, although it unfortunately runs on every hit test, for each node which
379         is a child of the clipPath element. 
380
381         Test: svg/hittest/svg-clip-path-child-element.html
382
383         * rendering/svg/RenderSVGResourceClipper.cpp:
384         (WebCore::RenderSVGResourceClipper::hitTestClipContent):
385
386 2020-02-27  Ryosuke Niwa  <rniwa@webkit.org>
387
388         TextManipulationController should not generate a new item for content in manipulated paragraphs
389         https://bugs.webkit.org/show_bug.cgi?id=208286
390
391         Reviewed by Wenson Hsieh.
392
393         This patch makes TextManipulationController to ignore any content change in previously manipulated paragraphs.
394
395         Added an early exist to observeParagraphs when the observed content has an element that has already been manipulated
396         as an ancestor. Note that the only case in which this logic matters is when it's called by scheduleObservartionUpdate,
397         which calls this function on each paragraph separately, unlike startObservingParagraphs which calls it on
398         the entire document, we can simply exit early instead of ignoring just the current paragraph.
399
400         Renamed TextManipulationController's m_recentlyInsertedElements to m_manipulatedElements and made it persist
401         forever so that we can track any element that has already been manipulated. Als renamed m_mutatedElements
402         to m_elementsWithNewRenderer for clarity.
403
404         Test: TestWebKitAPI.TextManipulation.InsertingContentIntoAlreadyManipulatedContentDoesNotCreateTextManipulationItem
405
406         * editing/TextManipulationController.cpp:
407         (WebCore::TextManipulationController::isInManipulatedElement): Added. Has a fast path for when
408         m_manipulatedElements's capacity is 0, which happens when observeParagraphs is called by startObservingParagraphs.
409         (WebCore::TextManipulationController::observeParagraphs): Added an early exit when there is a content that has
410         already been manipulated.
411         (WebCore::TextManipulationController::didCreateRendererForElement): Added the same check to fail early.
412         (WebCore::TextManipulationController::scheduleObservartionUpdate):
413         (WebCore::TextManipulationController::replace): Removed the code to clear m_recentlyInsertedElements.
414         * editing/TextManipulationController.h:
415
416 2020-02-27  Eric Carlson  <eric.carlson@apple.com>
417
418         Support in-band generic cues when loading media in the GPU Process
419         https://bugs.webkit.org/show_bug.cgi?id=208080
420         <rdar://problem/59687943>
421
422         Reviewed by Youenn Fablet.
423
424         No new tests, existing tests enabled for GPU process.
425
426         * Headers.cmake:
427         * WebCore.xcodeproj/project.pbxproj:
428         * html/track/InbandGenericTextTrack.cpp:
429         (WebCore::GenericTextTrackCueMap::add):
430         (WebCore::GenericTextTrackCueMap::findIndexOfPair):
431         (WebCore::GenericTextTrackCueMap::find):
432         (WebCore::GenericTextTrackCueMap::remove):
433         (WebCore::InbandGenericTextTrack::updateCueFromCueData):
434         (WebCore::InbandGenericTextTrack::addGenericCue):
435         (WebCore::InbandGenericTextTrack::updateGenericCue):
436         (WebCore::InbandGenericTextTrack::removeGenericCue):
437         * html/track/InbandGenericTextTrack.h:
438         * html/track/InbandTextTrack.h:
439         * html/track/TextTrackCueGeneric.h:
440         * platform/graphics/InbandGenericCue.h: Added.
441         (WebCore::GenericCueData::decode):
442         (WebCore::GenericCueData::encode const):
443         (WebCore::InbandGenericCue::create):
444         (WebCore::InbandGenericCue::startTime const):
445         (WebCore::InbandGenericCue::setStartTime):
446         (WebCore::InbandGenericCue::endTime const):
447         (WebCore::InbandGenericCue::setEndTime):
448         (WebCore::InbandGenericCue::id const):
449         (WebCore::InbandGenericCue::setId):
450         (WebCore::InbandGenericCue::content const):
451         (WebCore::InbandGenericCue::setContent):
452         (WebCore::InbandGenericCue::line const):
453         (WebCore::InbandGenericCue::setLine):
454         (WebCore::InbandGenericCue::position const):
455         (WebCore::InbandGenericCue::setPosition):
456         (WebCore::InbandGenericCue::size const):
457         (WebCore::InbandGenericCue::setSize):
458         (WebCore::InbandGenericCue::align const):
459         (WebCore::InbandGenericCue::setAlign):
460         (WebCore::InbandGenericCue::fontName const):
461         (WebCore::InbandGenericCue::setFontName):
462         (WebCore::InbandGenericCue::baseFontSize const):
463         (WebCore::InbandGenericCue::setBaseFontSize):
464         (WebCore::InbandGenericCue::relativeFontSize const):
465         (WebCore::InbandGenericCue::setRelativeFontSize):
466         (WebCore::InbandGenericCue::foregroundColor const):
467         (WebCore::InbandGenericCue::setForegroundColor):
468         (WebCore::InbandGenericCue::backgroundColor const):
469         (WebCore::InbandGenericCue::setBackgroundColor):
470         (WebCore::InbandGenericCue::highlightColor const):
471         (WebCore::InbandGenericCue::setHighlightColor):
472         (WebCore::InbandGenericCue::status):
473         (WebCore::InbandGenericCue::setStatus):
474         (WebCore::InbandGenericCue::cueData const):
475         (WebCore::InbandGenericCue::InbandGenericCue):
476         (WebCore::InbandGenericCue::toJSONString const):
477         (WebCore::InbandGenericCue::doesExtendCueData const):
478         (WTF::LogArgument<WebCore::InbandGenericCue>::toString):
479         * platform/graphics/InbandTextTrackPrivateClient.h:
480         (WebCore::GenericCueData::create): Deleted.
481         (WebCore::GenericCueData::startTime const): Deleted.
482         (WebCore::GenericCueData::setStartTime): Deleted.
483         (WebCore::GenericCueData::endTime const): Deleted.
484         (WebCore::GenericCueData::setEndTime): Deleted.
485         (WebCore::GenericCueData::id const): Deleted.
486         (WebCore::GenericCueData::setId): Deleted.
487         (WebCore::GenericCueData::content const): Deleted.
488         (WebCore::GenericCueData::setContent): Deleted.
489         (WebCore::GenericCueData::line const): Deleted.
490         (WebCore::GenericCueData::setLine): Deleted.
491         (WebCore::GenericCueData::position const): Deleted.
492         (WebCore::GenericCueData::setPosition): Deleted.
493         (WebCore::GenericCueData::size const): Deleted.
494         (WebCore::GenericCueData::setSize): Deleted.
495         (): Deleted.
496         (WebCore::GenericCueData::align const): Deleted.
497         (WebCore::GenericCueData::setAlign): Deleted.
498         (WebCore::GenericCueData::fontName const): Deleted.
499         (WebCore::GenericCueData::setFontName): Deleted.
500         (WebCore::GenericCueData::baseFontSize const): Deleted.
501         (WebCore::GenericCueData::setBaseFontSize): Deleted.
502         (WebCore::GenericCueData::relativeFontSize const): Deleted.
503         (WebCore::GenericCueData::setRelativeFontSize): Deleted.
504         (WebCore::GenericCueData::foregroundColor const): Deleted.
505         (WebCore::GenericCueData::setForegroundColor): Deleted.
506         (WebCore::GenericCueData::backgroundColor const): Deleted.
507         (WebCore::GenericCueData::setBackgroundColor): Deleted.
508         (WebCore::GenericCueData::highlightColor const): Deleted.
509         (WebCore::GenericCueData::setHighlightColor): Deleted.
510         (WebCore::GenericCueData::status): Deleted.
511         (WebCore::GenericCueData::setStatus): Deleted.
512         (WebCore::GenericCueData::toJSONString const): Deleted.
513         (WebCore::GenericCueData::doesExtendCueData const): Deleted.
514         (WTF::LogArgument<WebCore::GenericCueData>::toString): Deleted.
515         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
516         (WebCore::InbandTextTrackPrivateAVF::processCueAttributes):
517         (WebCore::InbandTextTrackPrivateAVF::processAttributedStrings):
518         (WebCore::InbandTextTrackPrivateAVF::removeCompletedCues):
519         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.h:
520         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
521
522 2020-02-27  Said Abou-Hallawa  <sabouhallawa@apple.com>
523
524         Implement ImageBuffer shareable backends
525         https://bugs.webkit.org/show_bug.cgi?id=207233
526
527         Reviewed by Simon Fraser.
528
529         * Headers.cmake:
530         * WebCore.xcodeproj/project.pbxproj:
531         * platform/graphics/PlatformImageBufferBackend.h: Added.
532         Define the base ImageBufferBackend for each platform.
533         ImageBufferShareableBitmapBackend in WebKit needs to have access to basic
534         ImageBufferBackend functionalities specific to the platform.
535
536         * platform/graphics/cg/ImageBufferIOSurfaceBackend.cpp:
537         (WebCore::ImageBufferIOSurfaceBackend::create):
538         * platform/graphics/cg/ImageBufferIOSurfaceBackend.h:
539         Use WTF::makeUnique and make the constructor public.
540
541 2020-02-27  Daniel Bates  <dabates@apple.com>
542
543         Change HitTestRequestType to an OptionSet
544         https://bugs.webkit.org/show_bug.cgi?id=208334
545
546         Reviewed by Wenson Hsieh.
547
548         The majority of this change is replacing usage of HitTestRequestType with an OptionSet<HitTestRequest::RequestType>.
549         Though I was tempted and did in some circumstances modernize code around HitTestRequestType call sites.
550         I've annotated important changes below.
551
552         * accessibility/AccessibilityObject.cpp:
553         (WebCore::AccessibilityObject::press):
554         * accessibility/AccessibilityRenderObject.cpp:
555         (WebCore::AccessibilityRenderObject::visiblePositionForPoint const): Updated code as needed.
556         Added FIXME comment: the code should be written without a loop and instead use HitTestRequest::AllowVisibleChildFrameContentOnly
557         to achieve the goal.
558         (WebCore::AccessibilityRenderObject::accessibilityHitTest const):
559         * dom/TreeScope.cpp:
560         (WebCore::TreeScope::elementsFromPoint):
561         * html/HTMLPlugInElement.cpp:
562         (WebCore::HTMLPlugInElement::isReplacementObscured): Update code as needed. Use IntRect::center()
563         convenience function instead of computing the center point manually.
564         * html/MediaElementSession.cpp:
565         (WebCore::isElementMainContentForPurposesOfAutoplay): Update code as needed. Move check for whether
566         the main frame has a document earlier in the function to avoid unncessary work. In practice, this
567         check will never fail because the main frame always has a document. Though to be precise the main
568         frame may not have a document during frame initialization. However, it does not make sense for this
569         code to ever be called then.
570         * page/AutoscrollController.cpp:
571         (WebCore::AutoscrollController::updateAutoscrollRenderer):
572         * page/ContextMenuController.cpp:
573         (WebCore::ContextMenuController::maybeCreateContextMenu):
574         * page/DragController.cpp:
575         (WebCore::DragController::canProcessDrag):
576         (WebCore::DragController::startDrag):
577         * page/EventHandler.cpp:
578         (WebCore::EventHandler::eventMayStartDrag const):
579         (WebCore::EventHandler::updateSelectionForMouseDrag):
580         (WebCore::EventHandler::hitTestResultAtPoint const):
581         (WebCore::EventHandler::updateCursor):
582         (WebCore::EventHandler::handleMousePressEvent):
583         (WebCore::EventHandler::handleMouseDoubleClickEvent):
584         (WebCore::EventHandler::handleMouseMoveEvent):
585         (WebCore::EventHandler::handleMouseReleaseEvent):
586         (WebCore::EventHandler::handleMouseForceEvent):
587         (WebCore::EventHandler::updateDragAndDrop):
588         (WebCore::EventHandler::isInsideScrollbar const):
589         (WebCore::EventHandler::sendContextMenuEvent):
590         (WebCore::EventHandler::sendContextMenuEventForKey):
591         (WebCore::EventHandler::hoverTimerFired):
592         (WebCore::EventHandler::dragSourceEndedAt):
593         (WebCore::EventHandler::handleDrag):
594         (WebCore::hitTestResultInFrame):
595         (WebCore::EventHandler::handleTouchEvent):
596         (WebCore::EventHandler::dispatchSyntheticTouchEventIfEnabled):
597         * page/EventHandler.h:
598         * page/FocusController.cpp:
599         (WebCore::updateFocusCandidateIfNeeded):
600         * page/Frame.cpp:
601         (WebCore::Frame::visiblePositionForPoint const):
602         (WebCore::Frame::documentAtPoint):
603         * page/PointerCaptureController.cpp:
604         (WebCore::PointerCaptureController::cancelPointer): Added FIXME about correctness issue.
605         The local variable named target will always be nullptr even after calling hitTestResultAtPoint().
606         * page/ios/EventHandlerIOS.mm:
607         (WebCore::EventHandler::tryToBeginDragAtPoint):
608         * page/ios/FrameIOS.mm:
609         (WebCore::Frame::renderRectForPoint const):
610         (WebCore::Frame::betterApproximateNode):
611         (WebCore::Frame::hitTestResultAtViewportLocation):
612         (WebCore::Frame::qualifyingNodeAtViewportLocation):
613         * rendering/HitTestRequest.h:
614         (WebCore::HitTestRequest::HitTestRequest):
615         (WebCore::HitTestRequest::readOnly const):
616         (WebCore::HitTestRequest::active const):
617         (WebCore::HitTestRequest::move const):
618         (WebCore::HitTestRequest::release const):
619         (WebCore::HitTestRequest::ignoreClipping const):
620         (WebCore::HitTestRequest::svgClipContent const):
621         (WebCore::HitTestRequest::touchEvent const):
622         (WebCore::HitTestRequest::disallowsUserAgentShadowContent const):
623         (WebCore::HitTestRequest::allowsFrameScrollbars const):
624         (WebCore::HitTestRequest::allowsChildFrameContent const):
625         (WebCore::HitTestRequest::allowsVisibleChildFrameContent const):
626         (WebCore::HitTestRequest::isChildFrameHitTest const):
627         (WebCore::HitTestRequest::resultIsElementList const):
628         (WebCore::HitTestRequest::includesAllElementsUnderPoint const):
629         (WebCore::HitTestRequest::type const):
630         * rendering/svg/RenderSVGResourceClipper.cpp:
631         (WebCore::RenderSVGResourceClipper::hitTestClipContent):
632         * testing/Internals.cpp:
633         (WebCore::Internals::nodesFromRect const):
634         * testing/Internals.mm:
635         (WebCore::Internals::rangeForDictionaryLookupAtLocation):
636
637 2020-02-27  Andres Gonzalez  <andresg_22@apple.com>
638
639         AXIsolatedObject support for table rows and ARIA tree/grid rows.
640         https://bugs.webkit.org/show_bug.cgi?id=208335
641
642         Reviewed by Chris Fleizach.
643
644         Covered by existing tests.
645
646         - Exposes the AccessibilityTableRow and AccessibilityARIAGridRow
647         interfaces through AXCoreObject.
648         - Eliminates the need of downcasting in the platform wrapper code, so
649         that it now works for both AXObjects and AXIsolatedObjects.
650         - Implements the above mentioned interfaces in AXIsolatedObject.
651
652         * accessibility/AccessibilityARIAGridRow.cpp:
653         (WebCore::AccessibilityARIAGridRow::disclosedRows):
654         * accessibility/AccessibilityARIAGridRow.h:
655         * accessibility/AccessibilityObject.cpp:
656         (WebCore::AccessibilityObject::disclosedRows):
657         (WebCore::AccessibilityObject::ariaTreeItemDisclosedRows): Became disclosedRows.
658         * accessibility/AccessibilityObject.h:
659         * accessibility/AccessibilityObjectInterface.h:
660         * accessibility/AccessibilityTableRow.h:
661         (WebCore::AccessibilityTableRow::setRowIndex):
662         (WebCore::AccessibilityTableRow::rowIndex const): Deleted.
663         * accessibility/isolatedtree/AXIsolatedObject.cpp:
664         (WebCore::AXIsolatedObject::initializeAttributeData):
665         * accessibility/isolatedtree/AXIsolatedObject.h:
666         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
667         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
668
669 2020-02-27  Don Olmstead  <don.olmstead@sony.com>
670
671         [CMake] Add WebKit::PAL target
672         https://bugs.webkit.org/show_bug.cgi?id=198493
673
674         Reviewed by Michael Catanzaro.
675
676         Use WebKit::PAL target.
677
678         * CMakeLists.txt:
679
680 2020-02-27  Peng Liu  <peng.liu6@apple.com>
681
682         MediaResourceLoader objects are leaking on reddit.com
683         https://bugs.webkit.org/show_bug.cgi?id=208273
684
685         Reviewed by Jer Noble.
686
687         We retain the WebCoreNSURLSession delegate. There will be a retain cycle
688         if that delegate retains the session. This patch fixes the retain cycle problem
689         by referencing the delegate with a weak pointer.
690
691         Manually tested.
692
693         * platform/network/cocoa/WebCoreNSURLSession.h:
694         * platform/network/cocoa/WebCoreNSURLSession.mm:
695         (-[WebCoreNSURLSession delegate]):
696
697 2020-02-28  Simon Fraser  <simon.fraser@apple.com>
698
699         Stop using -[CALayer setValue:forKey:] to store back pointers to PlatformCALayer*
700         https://bugs.webkit.org/show_bug.cgi?id=208358
701
702         Reviewed by Tim Horton.
703
704         We used -[CAlayer setValue:forKey:@"WKPlatformCALayer"] to store associate PlatformCALayer*
705         with CALayers. However, this has some performance cost, and won't work for a near-future world
706         where the scrolling thread needs to get at PlatformCALayers.
707
708         Replace with a static HashMap<> of CALayer* to PlatformCALayer*. Also rename platformCALayer()
709         to platformCALayerForLayer() so it's easier to find.
710
711         * platform/graphics/ca/GraphicsLayerCA.cpp:
712         (WebCore::GraphicsLayerCA::setContentsToPlatformLayer):
713         * platform/graphics/ca/PlatformCALayer.h:
714         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
715         (WebCore::layerToPlatformLayerMap):
716         (WebCore::PlatformCALayer::platformCALayerForLayer):
717         (WebCore::PlatformCALayerCocoa::create):
718         (WebCore::PlatformCALayerCocoa::commonInit):
719         (WebCore::PlatformCALayerCocoa::~PlatformCALayerCocoa):
720         (WebCore::PlatformCALayerCocoa::superlayer const):
721         (WebCore::PlatformCALayer::platformCALayer): Deleted.
722         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
723         (PlatformCALayer::platformCALayerForLayer):
724         (layoutSublayersProc):
725         (PlatformCALayerWin::superlayer const):
726         (PlatformCALayer::platformCALayer): Deleted.
727         * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
728         (PlatformCALayerWinInternal::getSublayers const):
729         (PlatformCALayerWinInternal::sublayerAtIndex const):
730         * platform/graphics/cocoa/WebGLLayer.mm:
731         (-[WebGLLayer display]):
732         * platform/graphics/mac/WebLayer.mm:
733         (-[WebLayer drawInContext:]):
734         (-[WebSimpleLayer setNeedsDisplay]):
735         (-[WebSimpleLayer setNeedsDisplayInRect:]):
736         (-[WebSimpleLayer display]):
737         (-[WebSimpleLayer drawInContext:]):
738
739 2020-02-27  Rob Buis  <rbuis@igalia.com>
740
741         Add referrerpolicy attribute support for images
742         https://bugs.webkit.org/show_bug.cgi?id=207901
743
744         Reviewed by Darin Adler.
745
746         This patch adds 'referrerpolicy' attribute support for img elements.
747         If set, the value is restricted to the ReferrerPolicy enum, and
748         if valid it is used for the script fetch.
749         If not set or invalid, the current behavior is kept.
750
751         Tests: http/tests/referrer-policy-img/no-referrer-when-downgrade/cross-origin-http-http.html
752                http/tests/referrer-policy-img/no-referrer-when-downgrade/cross-origin-http.https.html
753                http/tests/referrer-policy-img/no-referrer-when-downgrade/same-origin.html
754                http/tests/referrer-policy-img/no-referrer/cross-origin-http-http.html
755                http/tests/referrer-policy-img/no-referrer/cross-origin-http.https.html
756                http/tests/referrer-policy-img/no-referrer/same-origin.html
757                http/tests/referrer-policy-img/origin-when-cross-origin/cross-origin-http-http.html
758                http/tests/referrer-policy-img/origin-when-cross-origin/cross-origin-http.https.html
759                http/tests/referrer-policy-img/origin-when-cross-origin/same-origin.html
760                http/tests/referrer-policy-img/origin/cross-origin-http-http.html
761                http/tests/referrer-policy-img/origin/cross-origin-http.https.html
762                http/tests/referrer-policy-img/origin/same-origin.html
763                http/tests/referrer-policy-img/same-origin/cross-origin-http-http.html
764                http/tests/referrer-policy-img/same-origin/cross-origin-http.https.html
765                http/tests/referrer-policy-img/same-origin/same-origin.html
766                http/tests/referrer-policy-img/strict-origin-when-cross-origin/cross-origin-http-http.html
767                http/tests/referrer-policy-img/strict-origin-when-cross-origin/cross-origin-http.https.html
768                http/tests/referrer-policy-img/strict-origin-when-cross-origin/same-origin.html
769                http/tests/referrer-policy-img/strict-origin/cross-origin-http-http.html
770                http/tests/referrer-policy-img/strict-origin/cross-origin-http.https.html
771                http/tests/referrer-policy-img/strict-origin/same-origin.html
772                http/tests/referrer-policy-img/unsafe-url/cross-origin-http-http.html
773                http/tests/referrer-policy-img/unsafe-url/cross-origin-http.https.html
774                http/tests/referrer-policy-img/unsafe-url/same-origin.html
775
776         * html/HTMLImageElement.cpp:
777         (WebCore::HTMLImageElement::setReferrerPolicyForBindings):
778         (WebCore::HTMLImageElement::referrerPolicyForBindings const):
779         (WebCore::HTMLImageElement::referrerPolicy const):
780         * html/HTMLImageElement.h:
781         * html/HTMLImageElement.idl:
782         * loader/ImageLoader.cpp:
783         (WebCore::ImageLoader::updateFromElement):
784
785 2020-02-27  Daniel Bates  <dabates@apple.com>
786
787         Cleanup HitTestResult.{h, cpp}
788         https://bugs.webkit.org/show_bug.cgi?id=208269
789         <rdar://problem/59824186>
790
791         Reviewed by Alex Christensen.
792
793         Use modern C++ features to remove duplicate code.
794
795         * rendering/HitTestLocation.cpp:
796         (WebCore::HitTestLocation::HitTestLocation):
797         * rendering/HitTestLocation.h:
798         * rendering/HitTestResult.cpp: Remove unnecessary #includes.
799         * rendering/HitTestResult.h: Remove unnecessary #includes. 
800         (WebCore::HitTestResult::setIsOverWidget):
801
802 2020-02-27  Zalan Bujtas  <zalan@apple.com>
803
804         Unreviewed build fix for non-unified builds after r257507.
805
806         * layout/blockformatting/BlockFormattingContext.h:
807         * layout/blockformatting/BlockMarginCollapse.cpp:
808         (WebCore::Layout::BlockFormattingContext::MarginCollapse::computedPositiveAndNegativeMargin const):
809         (WebCore::Layout::BlockFormattingContext::MarginCollapse::updateMarginAfterForPreviousSibling):
810         (WebCore::Layout::computedPositiveAndNegativeMargin): Deleted.
811
812 2020-02-27  Antti Koivisto  <antti@apple.com>
813
814         Load async scripts with low priority
815         https://bugs.webkit.org/show_bug.cgi?id=208298
816
817         Reviewed by Anders Carlsson.
818
819         They are assumed to be non-critical and don't delay DOMContentLoaded.
820
821         This matches other browsers. See https://addyosmani.com/blog/script-priorities/ for Chrome behavior.
822
823         * bindings/js/CachedScriptFetcher.cpp:
824         (WebCore::CachedScriptFetcher::requestModuleScript const):
825         (WebCore::CachedScriptFetcher::requestScriptWithCache const)
826
827         Pass around the priority.
828
829         * bindings/js/CachedScriptFetcher.h:
830         * dom/LoadableClassicScript.cpp:
831         (WebCore::LoadableClassicScript::create):
832         (WebCore::LoadableClassicScript::load):
833
834         Deprioritize async script load.
835
836         * dom/LoadableClassicScript.h:
837         * dom/ScriptElement.cpp:
838         (WebCore::ScriptElement::requestClassicScript):
839
840         Pass around the information that this is an async script.
841
842         * dom/ScriptElementCachedScriptFetcher.cpp:
843         (WebCore::ScriptElementCachedScriptFetcher::requestModuleScript const):
844         * html/parser/HTMLPreloadScanner.cpp:
845         (WebCore::TokenPreloadScanner::StartTagScanner::createPreloadRequest):
846         (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):
847
848         Parse async attribute in preload scanner.
849
850         * html/parser/HTMLResourcePreloader.cpp:
851         (WebCore::PreloadRequest::resourceRequest):
852
853         Deprioritize async script preload.
854
855         * html/parser/HTMLResourcePreloader.h:
856         (WebCore::PreloadRequest::setScriptIsAsync):
857
858 2020-02-26  Ryosuke Niwa  <rniwa@webkit.org>
859
860         Create AudioDestination in the GPU process
861         https://bugs.webkit.org/show_bug.cgi?id=208179
862
863         Reviewed by Jer Noble.
864
865         Add an abstraction around the creation of AudioDestination using newly introduced mediaStrategy.
866
867         * Headers.cmake:
868         * Modules/webaudio/DefaultAudioDestinationNode.cpp:
869         (WebCore::DefaultAudioDestinationNode::createDestination): Use MediaStrategy::createAudioDestination
870         * WebCore.xcodeproj/project.pbxproj:
871         * platform/MediaStrategy.h: Added.
872         (WebCore::MediaStrategy): Added.
873         * platform/PlatformStrategies.h:
874         (WebCore::PlatformStrategies::mediaStrategy): Added.
875         * platform/audio/AudioBus.h:
876         * platform/audio/AudioDestination.h:
877
878 2020-02-26  Myles C. Maxfield  <mmaxfield@apple.com>
879
880         [iPadOS] REGRESSION(r247667): Autosizing style changes don't invalidate RenderText's preferred logical widths
881         https://bugs.webkit.org/show_bug.cgi?id=208084
882         <rdar://problem/59463898>
883
884         Reviewed by Darin Adler.
885
886         Just use RenderElement::setStyle(), which handles all the invalidations, instead of RenderElement::setNeedsLayout().
887
888         Do a little refactoring so we don't clone RenderStyles unless we need to.
889
890         Test: fast/text-autosizing/ios/idempotentmode/viewport-change-relayout.html
891
892         * page/Page.cpp:
893         (WebCore::Page::recomputeTextAutoSizingInAllFrames):
894         * rendering/style/RenderStyle.cpp:
895         (WebCore::RenderStyle::isIdempotentTextAutosizingCandidate const):
896         * rendering/style/RenderStyle.h:
897         * rendering/style/TextSizeAdjustment.cpp:
898         (WebCore::AutosizeStatus::computeStatus):
899         (WebCore::AutosizeStatus::updateStatus):
900         * rendering/style/TextSizeAdjustment.h:
901         (WebCore::AutosizeStatus::operator== const):
902         (WebCore::AutosizeStatus::operator!= const):
903         * style/StyleAdjuster.cpp:
904         (WebCore::Style::Adjuster::adjustmentForTextAutosizing):
905         (WebCore::Style::Adjuster::adjustForTextAutosizing):
906         * style/StyleAdjuster.h:
907         (WebCore::Style::Adjuster::AdjustmentForTextAutosizing::operator bool const):
908
909 2020-02-26  Zalan Bujtas  <zalan@apple.com>
910
911         REGRESSION (r257507): [ macOS ] ASSERTION FAILED: blockFormattingState.hasPositiveAndNegativeVerticalMargin(layoutBox)
912         https://bugs.webkit.org/show_bug.cgi?id=208278
913         <rdar://problem/59828533>
914
915         Fix mismatching call after r257507.
916
917         * layout/blockformatting/PrecomputedBlockMarginCollapse.cpp:
918         (WebCore::Layout::BlockFormattingContext::MarginCollapse::precomputedPositiveNegativeValues const):
919
920 2020-02-26  Andres Gonzalez  <andresg_22@apple.com>
921
922         AXIsolatedObject support for table cells.
923         https://bugs.webkit.org/show_bug.cgi?id=208263
924
925         Reviewed by Chris Fleizach.
926
927         Covered by existing tests.
928
929         - Exposed the AccessibilityTableCell interface through AXCoreObject.
930         - This way there is no need to downcast in client code and the same
931         platform wrapper code works for AccessibilityObjects and
932         AXIsolatedObjects.
933         - Completed caching of table cell properties in AXIsolatedObject.
934
935         * accessibility/AccessibilityARIAGridCell.cpp:
936         (WebCore::AccessibilityARIAGridCell::rowIndexRange const):
937         (WebCore::AccessibilityARIAGridCell::axRowSpanWithRowIndex const):
938         (WebCore::AccessibilityARIAGridCell::columnIndexRange const):
939         * accessibility/AccessibilityARIAGridCell.h:
940         * accessibility/AccessibilityObject.h:
941         * accessibility/AccessibilityObjectInterface.h:
942         * accessibility/AccessibilityTable.cpp:
943         (WebCore::AccessibilityTable::cellForColumnAndRow):
944         * accessibility/AccessibilityTableCell.cpp:
945         (WebCore::AccessibilityTableCell::isColumnHeaderCell const):
946         (WebCore::AccessibilityTableCell::isRowHeaderCell const):
947         (WebCore::AccessibilityTableCell::isTableCellInSameColGroup):
948         (WebCore::AccessibilityTableCell::columnHeaders):
949         (WebCore::AccessibilityTableCell::rowHeaders):
950         (WebCore::AccessibilityTableCell::rowIndexRange const):
951         (WebCore::AccessibilityTableCell::columnIndexRange const):
952         * accessibility/AccessibilityTableCell.h:
953         * accessibility/AccessibilityTableRow.h:
954         * accessibility/atk/WebKitAccessibleInterfaceTableCell.cpp:
955         (webkitAccessibleTableCellGetColumnSpan):
956         (webkitAccessibleTableCellGetRowSpan):
957         (webkitAccessibleTableCellGetPosition):
958         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
959         (-[WebAccessibilityObjectWrapper accessibilityHeaderElements]):
960         (-[WebAccessibilityObjectWrapper accessibilityRowRange]):
961         (-[WebAccessibilityObjectWrapper accessibilityColumnRange]):
962         * accessibility/isolatedtree/AXIsolatedObject.cpp:
963         (WebCore::AXIsolatedObject::initializeAttributeData):
964         (WebCore::AXIsolatedObject::pairAttributeValue const):
965         * accessibility/isolatedtree/AXIsolatedObject.h:
966         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
967         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
968
969 2020-02-26  Said Abou-Hallawa  <sabouhallawa@apple.com>
970
971         Implement the remote RenderingBackend
972         https://bugs.webkit.org/show_bug.cgi?id=207198
973
974         Reviewed by Simon Fraser.
975
976         * html/HTMLCanvasElement.cpp:
977         (WebCore::HTMLCanvasElement::createImageBuffer const):
978         Make HTMLCanvasElement be able to create a remote ImageBuffer.
979
980 2020-02-27  Simon Fraser  <simon.fraser@apple.com>
981
982         Add ENABLE(SCROLLING_THREAD) and use it to turn off some code we don't need for iOS
983         https://bugs.webkit.org/show_bug.cgi?id=208282
984
985         Reviewed by Tim Horton.
986
987         Protect ThreadedScrollingTree and ScrollingCoordinatorMac with ENABLE(SCROLLING_THREAD).
988
989         * page/scrolling/ThreadedScrollingTree.cpp:
990         * page/scrolling/ThreadedScrollingTree.h:
991         * page/scrolling/mac/ScrollingCoordinatorMac.h:
992         * page/scrolling/mac/ScrollingCoordinatorMac.mm:
993         * page/scrolling/mac/ScrollingTreeMac.cpp:
994         * page/scrolling/mac/ScrollingTreeMac.h:
995
996 2020-02-26  Fujii Hironori  <Hironori.Fujii@sony.com>
997
998         Unreviewed unified source builds fix.
999
1000         > layout\FormattingContextGeometry.cpp(564): error C2027: use of undefined type 'WebCore::Layout::ReplacedBox
1001         > Modules\websockets\WebSocket.cpp(335): error C2027: use of undefined type 'WebCore::WorkerThread'
1002         > layout\integration\LayoutIntegrationBoxTree.cpp(63): error C2039: 'InlineTextBox': is not a member of 'WebCore::Layout'
1003         > workers\service\context\ServiceWorkerFetch.cpp(143): error C2027: use of undefined type 'WebCore::ServiceWorkerThread'
1004
1005         * Modules/websockets/WebSocket.cpp:
1006         * layout/FormattingContextGeometry.cpp:
1007         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
1008         * layout/integration/LayoutIntegrationBoxTree.cpp:
1009         * workers/service/context/ServiceWorkerFetch.cpp:
1010
1011 2020-02-26  Jack Lee  <shihchieh_lee@apple.com>
1012
1013         Nullptr crash in WebCore::canHaveChildrenForEditing via CompositeEditCommand::insertNode
1014         https://bugs.webkit.org/show_bug.cgi?id=208115
1015         <rdar://problem/56685655>
1016
1017         Reviewed by Ryosuke Niwa.
1018
1019         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. 
1020
1021         Test: fast/lists/insert-list-uneditable-element-with-non-li-child.html
1022
1023         * editing/InsertListCommand.cpp:
1024         (WebCore::InsertListCommand::listifyParagraph):
1025
1026 2020-02-26  Don Olmstead  <don.olmstead@sony.com>
1027
1028         Allow setting of stack sizes for threads
1029         https://bugs.webkit.org/show_bug.cgi?id=208223
1030
1031         Reviewed by Yusuke Suzuki.
1032
1033         Specify ThreadType at the Thread::create callsite.
1034
1035         * Modules/webaudio/AsyncAudioDecoder.cpp:
1036         (WebCore::AsyncAudioDecoder::AsyncAudioDecoder):
1037         * Modules/webaudio/OfflineAudioDestinationNode.cpp:
1038         (WebCore::OfflineAudioDestinationNode::startRendering):
1039         * bindings/js/GCController.cpp:
1040         (WebCore::GCController::garbageCollectOnAlternateThreadForDebugging):
1041         * platform/audio/ReverbConvolver.cpp:
1042         (WebCore::ReverbConvolver::ReverbConvolver):
1043         * platform/network/cf/LoaderRunLoopCF.cpp:
1044         (WebCore::loaderRunLoop):
1045         * platform/network/cf/ResourceHandleCFNet.cpp:
1046         (WebCore::ResourceHandle::platformLoadResourceSynchronously):
1047         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
1048         (WebCore::getRunLoop):
1049         * platform/network/curl/CurlRequestScheduler.cpp:
1050         (WebCore::CurlRequestScheduler::startThreadIfNeeded):
1051         * platform/network/curl/CurlStreamScheduler.cpp:
1052         (WebCore::CurlStreamScheduler::startThreadIfNeeded):
1053         * workers/WorkerThread.cpp:
1054         (WebCore::WorkerThread::start):
1055
1056 2020-02-26  Zalan Bujtas  <zalan@apple.com>
1057
1058         [LFC][BFC][MarginCollapsing] Decouple regular and pre-computed margin collapsing logic
1059         https://bugs.webkit.org/show_bug.cgi?id=208247
1060         <rdar://problem/59808951>
1061
1062         Reviewed by Antti Koivisto.
1063
1064         The pre-computed path is so peculiar it deserves a dedicated file.
1065
1066         This is in preparation for fixing a flaw in the pre-computed logic where we end up
1067         accessing a not-yet-computed horizontal constraint. No change in functionality at this point.
1068
1069         * Sources.txt:
1070         * WebCore.xcodeproj/project.pbxproj:
1071         * layout/blockformatting/BlockFormattingContext.h:
1072         * layout/blockformatting/BlockMarginCollapse.cpp:
1073         (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeValues const):
1074         (WebCore::Layout::BlockFormattingContext::MarginCollapse::precomputedMarginBefore): Deleted.
1075         * layout/blockformatting/PrecomputedBlockMarginCollapse.cpp: Added.
1076         (WebCore::Layout::BlockFormattingContext::MarginCollapse::precomputedPositiveNegativeValues const):
1077         (WebCore::Layout::BlockFormattingContext::MarginCollapse::precomputedPositiveNegativeMarginBefore const):
1078         (WebCore::Layout::BlockFormattingContext::MarginCollapse::precomputedMarginBefore):
1079         * layout/integration/LayoutIntegrationBoxTree.cpp:
1080
1081 2020-02-26  Keith Rollin  <krollin@apple.com>
1082
1083         Add logging to help diagnose redirect issue
1084         https://bugs.webkit.org/show_bug.cgi?id=207916
1085         <rdar://problem/59567875>
1086
1087         Reviewed by Chris Dumez.
1088
1089         We're seeing an issue where communication between the WebContent
1090         process and the Network process seems to come to a stop between
1091         NetworkResourceLoader::continueWillSendRedirectedRequest and
1092         NetworkResourceLoader::continueWillSendRequest. We do see a
1093         WebResourceLoader::willSendRequest log line between those two
1094         NetworkResourceLoader logging lines, but nothing else. Add a bunch of
1095         logging in this area to help determine what's happening.
1096
1097         No new tests -- no new or changed functionality.
1098
1099         * loader/PolicyChecker.cpp:
1100         (WebCore::PolicyChecker::checkNavigationPolicy):
1101         * loader/ResourceLoader.cpp:
1102         (WebCore::ResourceLoader::loadDataURL):
1103         (WebCore::ResourceLoader::willSendRequestInternal):
1104         (WebCore::ResourceLoader::didFinishLoading):
1105         (WebCore::ResourceLoader::didFail):
1106         (WebCore::ResourceLoader::willSendRequestAsync):
1107         (WebCore::ResourceLoader::wasBlocked):
1108         (WebCore::ResourceLoader::cannotShowURL):
1109         * loader/SubresourceLoader.cpp:
1110         (WebCore::SubresourceLoader::init):
1111         (WebCore::SubresourceLoader::willSendRequestInternal):
1112         (WebCore::SubresourceLoader::didReceiveResponse):
1113         (WebCore::SubresourceLoader::didFinishLoading):
1114         (WebCore::SubresourceLoader::didFail):
1115         (WebCore::SubresourceLoader::willCancel):
1116         * loader/cache/CachedRawResource.cpp:
1117         (WebCore::CachedRawResource::redirectReceived):
1118         * loader/cache/CachedResource.cpp:
1119         (WebCore::CachedResource::redirectReceived):
1120         * loader/cache/CachedResourceLoader.cpp:
1121         (WebCore::CachedResourceLoader::canRequestAfterRedirection const):
1122
1123 2020-02-26  Daniel Bates  <dabates@apple.com>
1124
1125         Clean up HitTestLocation.h
1126         https://bugs.webkit.org/show_bug.cgi?id=208254
1127         <rdar://problem/59815136>
1128
1129         Reviewed by Jer Noble.
1130
1131         Use modern C++ features to remove duplicate code.
1132
1133         * rendering/HitTestLocation.cpp:
1134         (WebCore::HitTestLocation::HitTestLocation):
1135         * rendering/HitTestLocation.h:
1136         * rendering/HitTestResult.cpp:
1137         (WebCore::HitTestResult::HitTestResult):
1138         * rendering/HitTestResult.h: Remove unnecessary #includes. This file only needs
1139         to include RoundedRect.h: RoundedRect.h includes FloatQuad.h and LayoutRect.h
1140         and FloatQuad.h will include FloatRect.h. We do not make use of have declarations
1141         in <wtf/Forward.h> so remove that as well.
1142
1143 2020-02-26  Jacob Uphoff  <jacob_uphoff@apple.com>
1144
1145         Unreviewed, rolling out r257373.
1146
1147         This commit introduced one test that is a flaky failure on ios
1148         bots and broke another test
1149
1150         Reverted changeset:
1151
1152         "[iPadOS] REGRESSION(r247667): Autosizing style changes don't
1153         invalidate RenderText's preferred logical widths"
1154         https://bugs.webkit.org/show_bug.cgi?id=208084
1155         https://trac.webkit.org/changeset/257373
1156
1157 2020-02-26  Jacob Uphoff  <jacob_uphoff@apple.com>
1158
1159         Unreviewed, rolling out r257470.
1160
1161         This broke the build for tvOS and watchOS
1162
1163         Reverted changeset:
1164
1165         "Conversion between MediaSample and RemoteVideoSample should
1166         preserve the rotation information"
1167         https://bugs.webkit.org/show_bug.cgi?id=208240
1168         https://trac.webkit.org/changeset/257470
1169
1170 2020-02-26  Adrian Perez de Castro  <aperez@igalia.com>
1171
1172         Unreviewed build fix for non-unified builds with assertions enabled.
1173
1174         * css/CSSImageSetValue.cpp: Add missing include.
1175
1176 2020-02-26  Andres Gonzalez  <andresg_22@apple.com>
1177
1178         AXIsolatedObject support for table column objects.
1179         https://bugs.webkit.org/show_bug.cgi?id=208215
1180
1181         Reviewed by Chris Fleizach.
1182
1183         Covered by existing tests.
1184
1185         - AccessibilityTableColumn interface is now exposed through
1186         AXCoreObject.
1187         - Separated isTableColumn from isAccessibilityTableColumnInstance.
1188         - This eliminates to need to downcast in the wrapper code, and hence
1189         makes it possible that the same code works for both AccessibilityObjects
1190         and AXIsolatedObjects.
1191         - Completed the caching of table column properties in AXIsolatedObject.
1192         - Some minor code cleanup.
1193
1194         * accessibility/AccessibilityARIAGrid.cpp:
1195         (WebCore::AccessibilityARIAGrid::addChildren): Removed unnecessary cast.
1196         * accessibility/AccessibilityObject.h:
1197         * accessibility/AccessibilityObjectInterface.h:
1198         * accessibility/AccessibilityTable.cpp:
1199         (WebCore::AccessibilityTable::addChildren): Removed unnecessary cast.
1200         (WebCore::AccessibilityTable::columnHeaders):
1201         * accessibility/AccessibilityTableColumn.cpp:
1202         (WebCore::AccessibilityTableColumn::columnHeader):
1203         (WebCore::AccessibilityTableColumn::headerObject): Renamed columnHeader.
1204         * accessibility/AccessibilityTableColumn.h:
1205         * accessibility/isolatedtree/AXIsolatedObject.cpp:
1206         (WebCore::AXIsolatedObject::initializeAttributeData):
1207         (WebCore::AXIsolatedObject::isAccessibilityTableColumnInstance const):
1208         * accessibility/isolatedtree/AXIsolatedObject.h:
1209         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1210         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
1211
1212 2020-02-26  Youenn Fablet  <youenn@apple.com>
1213
1214         Conversion between MediaSample and RemoteVideoSample should preserve the rotation information
1215         https://bugs.webkit.org/show_bug.cgi?id=208240
1216
1217         Reviewed by Eric Carlson.
1218
1219         Update RemoteVideoSample to have surface getter be const.
1220         Add a new routine to convert a RemoteVideoSample in a MediaSample, with proper rotation and mirrored information.
1221         Covered by manual testing.
1222
1223         * platform/graphics/RemoteVideoSample.cpp:
1224         (WebCore::RemoteVideoSample::surface const):
1225         * platform/graphics/RemoteVideoSample.h:
1226         (WebCore::RemoteVideoSample::mirrored const):
1227         * platform/graphics/cv/ImageTransferSessionVT.h:
1228         * platform/graphics/cv/ImageTransferSessionVT.mm:
1229         (WebCore::ImageTransferSessionVT::createMediaSample):
1230
1231 2020-02-26  Zalan Bujtas  <zalan@apple.com>
1232
1233         [LFC][IFC][Floats] ASSERT(committedInlineItemCount || line.hasIntrusiveFloat()) in LineLayoutContext::close
1234         https://bugs.webkit.org/show_bug.cgi?id=208230
1235         <rdar://problem/59791249>
1236
1237         Reviewed by Antti Koivisto.
1238
1239         Test: fast/layoutformattingcontext/float-and-br-inline-content-only.html
1240
1241         Expand the ASSERT to include all the valid cases
1242         1. Inline content is added to the line
1243         2. Only float(s) got processed (no inline content)
1244         3. Neither floats not inline content got processed due to intrusive floats.
1245         (This patch slightly rearranges the body of LineLayoutContext::commitFloats and also fixes an off-by-1 error in LineLayoutContext::close.)
1246
1247         * layout/inlineformatting/LineLayoutContext.cpp:
1248         (WebCore::Layout::LineLayoutContext::close):
1249         (WebCore::Layout::LineLayoutContext::commitFloats):
1250
1251 2020-02-26  Alicia Boya García  <aboya@igalia.com>
1252
1253         [GStreamer] Correctly remove webvttenc on WebKitTextCombiner pad release
1254         https://bugs.webkit.org/show_bug.cgi?id=208234
1255
1256         Reviewed by Xabier Rodriguez-Calvar.
1257
1258         The implementation of webkitTextCombinerReleasePad() was wrong in that
1259         it was checking the peer pad of webkittextcombinerpad to check if it
1260         belonged a webvttenc element and remove it... But since this is a
1261         ghostpad, the peer is upstream, not downstream. When the release pad
1262         function is called, upstream is already disconnected, so the branch
1263         was never hit.
1264
1265         To actually remove the webvttenc element we must check the target pad
1266         instead of the peer pad, which corresponds to the element downstream.
1267         Also, we need to set the element state to NULL before removing it,
1268         which the previous code didn't.
1269
1270         * platform/graphics/gstreamer/TextCombinerGStreamer.cpp:
1271         (webkitTextCombinerReleasePad):
1272
1273 2020-02-26  Antti Koivisto  <antti@apple.com>
1274
1275         Remove throttling code from RenderLayerCompositor
1276         https://bugs.webkit.org/show_bug.cgi?id=208135
1277         <rdar://problem/59765410>
1278
1279         Unreviewed partial revert.
1280
1281         Keep using the "flush" naming in GraphicsLayerClient.
1282
1283         * page/PageOverlayController.cpp:
1284         (WebCore::PageOverlayController::notifyFlushRequired):
1285         (WebCore::PageOverlayController::notifyRenderingUpdateRequired): Deleted.
1286         * page/PageOverlayController.h:
1287         * page/linux/ResourceUsageOverlayLinux.cpp:
1288         * page/mac/ServicesOverlayController.h:
1289         * page/mac/ServicesOverlayController.mm:
1290         (WebCore::ServicesOverlayController::Highlight::notifyFlushRequired):
1291         (WebCore::ServicesOverlayController::Highlight::notifyRenderingUpdateRequired): Deleted.
1292         * platform/graphics/GraphicsLayerClient.h:
1293         (WebCore::GraphicsLayerClient::notifyFlushRequired):
1294         (WebCore::GraphicsLayerClient::notifyRenderingUpdateRequired): Deleted.
1295         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
1296         (WebCore::CoordinatedGraphicsLayer::notifyFlushRequired):
1297         * rendering/RenderLayerBacking.cpp:
1298         (WebCore::RenderLayerBacking::notifyFlushRequired):
1299         (WebCore::RenderLayerBacking::notifyRenderingUpdateRequired): Deleted.
1300         * rendering/RenderLayerBacking.h:
1301         * rendering/RenderLayerCompositor.cpp:
1302         (WebCore::RenderLayerCompositor::notifyFlushRequired):
1303         (WebCore::RenderLayerCompositor::notifyRenderingUpdateRequired): Deleted.
1304         * rendering/RenderLayerCompositor.h:
1305
1306 2020-02-26  Víctor Manuel Jáquez Leal  <vjaquez@igalia.com>
1307
1308         [GL][GStreamer] Instantiate GstGLContext when the shared GLContext is created
1309         https://bugs.webkit.org/show_bug.cgi?id=200626
1310
1311         Reviewed by Carlos Garcia Campos.
1312
1313         This patch adds GstGLContext and GstGLDisplay as part of
1314         PlatformDisplay.
1315
1316         Right now one GstGLContext is created per video tag, which is a
1317         wrapper of the GL shared context. Every time this wrapper is
1318         created the GL context has to be current in order to initialize
1319         the wrapper's internal state.
1320
1321         A better approach would be to have a single GstGLContext per GL
1322         context, to instantiate it when the GL context is created and
1323         current. This GstGLContext would be used for all media players.
1324
1325         GstGLContext and GstGLDisplay are instantiated as singletons by
1326         PlatformDisplay. When the media player request for the
1327         GstGLContext a GL context is instantiated, if it wasn't before,
1328         and wraps it. PlatformDisplay adds two getters, one for
1329         GstGLContext object, and other for GstGLDisplay. Both are used to
1330         configure the internal GStreamer GL context in the multimedia
1331         pipeline.
1332
1333         No new tests are needed.
1334
1335         * platform/GStreamer.cmake:
1336         * platform/graphics/PlatformDisplay.cpp:
1337         (WebCore::PlatformDisplay::terminateEGLDisplay):
1338         * platform/graphics/PlatformDisplay.h:
1339         * platform/graphics/gstreamer/GLVideoSinkGStreamer.cpp:
1340         (requestGLContext):
1341         (webKitGLVideoSinkChangeState):
1342         (webKitGLVideoSinkProbePlatform):
1343         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
1344         * platform/graphics/gstreamer/PlatformDisplayGStreamer.cpp: Added.
1345         (createGstGLDisplay):
1346         (PlatformDisplay::tryEnsureGstGLContext):
1347         (PlatformDisplay::gstGLDisplay const):
1348         (PlatformDisplay::gstGLContext const):
1349
1350 2020-02-26  Chris Dumez  <cdumez@apple.com>
1351
1352         DocumentTimeline / CSSTransition objects are leaking on CNN.com
1353         https://bugs.webkit.org/show_bug.cgi?id=208069
1354         <rdar://problem/59680143>
1355
1356         Reviewed by Antoine Quint.
1357
1358         Break reference cycle between DocumentTimeline and WebAnimation by using WeakPtr.
1359
1360         * animation/AnimationTimeline.h:
1361         * animation/DocumentTimeline.h:
1362         * animation/WebAnimation.cpp:
1363         (WebCore::WebAnimation::timeline const):
1364         (WebCore::WebAnimation::setTimeline):
1365         (WebCore::WebAnimation::setTimelineInternal):
1366         (WebCore::WebAnimation::enqueueAnimationEvent):
1367         (WebCore::WebAnimation::acceleratedStateDidChange):
1368         * animation/WebAnimation.h:
1369         (WebCore::WebAnimation::timeline const): Deleted.
1370
1371 2020-02-26  Adrian Perez de Castro  <aperez@igalia.com>
1372
1373         Unreviewed build fix for non-unified builds.
1374
1375         * bindings/js/JSAnimationTimelineCustom.cpp: Add missing header include.
1376
1377 2020-02-26  Mark Lam  <mark.lam@apple.com>
1378
1379         Custom element caching should be aware of different worlds.
1380         https://bugs.webkit.org/show_bug.cgi?id=208228
1381         <rdar://problem/57881013>
1382
1383         Reviewed by Ryosuke Niwa.
1384
1385         Even though a custom element is cached in one world, we should return an unknown
1386         HTMl element in a different world.
1387
1388         Test to be added in https://bugs.webkit.org/show_bug.cgi?id=208229.
1389
1390         * bindings/js/JSElementCustom.cpp:
1391         (WebCore::toJSNewlyCreated):
1392
1393 2020-02-25  Fujii Hironori  <Hironori.Fujii@sony.com>
1394
1395         [WinCairo] Unreviewed build fix for unified source builds
1396
1397         > Modules\websockets\WebSocket.cpp(334): error C2065: 'WorkerGlobalScope': undeclared identifier
1398         > Modules\websockets\WebSocket.cpp(334): error C2672: 'downcast': no matching overloaded function found
1399         > Modules\websockets\WebSocket.cpp(334): error C2974: 'WTF::downcast': invalid template argument for 'Target', type expected
1400
1401         * Modules/websockets/WebSocket.cpp: Added #include "WorkerGlobalScope.h".
1402
1403 2020-02-25  Devin Rousso  <drousso@apple.com>
1404
1405         Web Inspector: safari app extension isolated worlds and injected files use the extension's identifier instead of its name
1406         https://bugs.webkit.org/show_bug.cgi?id=206911
1407         <rdar://problem/58026635>
1408
1409         Reviewed by Brian Burg.
1410
1411         * Modules/webauthn/AuthenticationExtensionsClientOutputs.h:
1412         Drive-by: add missing include.
1413
1414 2020-02-25  Jer Noble  <jer.noble@apple.com>
1415
1416         Unreviewed tvOS build fix; fix the compiler guards broken by r257189.
1417
1418         * platform/ios/PlaybackSessionInterfaceAVKit.h:
1419         * platform/ios/PlaybackSessionInterfaceAVKit.mm:
1420         * platform/ios/WebAVPlayerController.h:
1421         * platform/ios/WebAVPlayerController.mm:
1422
1423 2020-02-25  Jack Lee  <shihchieh_lee@apple.com>
1424
1425         ASSERTION FAILURE in AppendNodeCommand::AppendNodeCommand when inserting list with read-only user-modify
1426         https://bugs.webkit.org/show_bug.cgi?id=208045
1427         <rdar://problem/39023383>
1428
1429         Reviewed by Ryosuke Niwa.
1430
1431         When inserting a list (InsertListCommand) around enclosed list items, if new list is not editable, skip moving list items in function doApplyForSingleParagraph.
1432
1433         Test: fast/lists/insert-list-user-modify-read-only-enclosed-li.html
1434
1435         * editing/InsertListCommand.cpp:
1436         (WebCore::InsertListCommand::doApplyForSingleParagraph):
1437
1438 2020-02-25  Jack Lee  <shihchieh_lee@apple.com>
1439
1440         Nullptr crash in CompositeEditCommand::splitTreeToNode
1441         https://bugs.webkit.org/show_bug.cgi?id=208039
1442         <rdar://problem/52011355>
1443
1444         Reviewed by Ryosuke Niwa.
1445
1446         When inserting a list (InsertListCommand) around orphaned list items, if unordered list is not editable, skip moving list items in function fixOrphanedListChild. 
1447
1448         Test: fast/lists/insert-list-user-modify-read-only-orphaned-li.html
1449
1450         * editing/InsertListCommand.cpp:
1451         (WebCore::InsertListCommand::fixOrphanedListChild):
1452         (WebCore::InsertListCommand::doApplyForSingleParagraph):
1453         * editing/InsertListCommand.h:
1454
1455 2020-02-25  Justin Michaud  <justin_michaud@apple.com>
1456
1457         Inline Cache delete by id/val
1458         https://bugs.webkit.org/show_bug.cgi?id=207522
1459
1460         Reviewed by Keith Miller and Filip Pizlo.
1461
1462         * bindings/js/JSDOMWindowCustom.cpp:
1463         (WebCore::JSDOMWindow::deleteProperty):
1464         * bindings/js/JSLocationCustom.cpp:
1465         (WebCore::JSLocation::deleteProperty):
1466         * bindings/js/JSRemoteDOMWindowCustom.cpp:
1467         (WebCore::JSRemoteDOMWindow::deleteProperty):
1468         * bindings/scripts/CodeGeneratorJS.pm:
1469         (GenerateDeleteProperty):
1470         (GenerateHeader):
1471         (GenerateImplementation):
1472         (GenerateConstructorHelperMethods):
1473         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
1474         (WebCore::JSTestEnabledBySettingPrototype::finishCreation):
1475         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
1476         (WebCore::JSTestGenerateIsReachablePrototype::finishCreation):
1477         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
1478         (WebCore::JSTestNamedDeleterNoIdentifier::deleteProperty):
1479         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.h:
1480         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
1481         (WebCore::JSTestNamedDeleterThrowingException::deleteProperty):
1482         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.h:
1483         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
1484         (WebCore::JSTestNamedDeleterWithIdentifier::deleteProperty):
1485         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.h:
1486         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
1487         (WebCore::JSTestNamedDeleterWithIndexedGetter::deleteProperty):
1488         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.h:
1489         * bindings/scripts/test/JS/JSTestNode.cpp:
1490         (WebCore::JSTestNodePrototype::finishCreation):
1491         * bindings/scripts/test/JS/JSTestObj.cpp:
1492         (WebCore::JSTestObjConstructor::initializeProperties):
1493         (WebCore::JSTestObjPrototype::finishCreation):
1494         * bridge/NP_jsobject.cpp:
1495         * bridge/objc/WebScriptObject.mm:
1496         (-[WebScriptObject removeWebScriptKey:]):
1497         * bridge/objc/objc_runtime.h:
1498         * bridge/objc/objc_runtime.mm:
1499         (JSC::Bindings::ObjcFallbackObjectImp::deleteProperty):
1500         * bridge/runtime_array.cpp:
1501         (JSC::RuntimeArray::deleteProperty):
1502         * bridge/runtime_array.h:
1503         * bridge/runtime_object.cpp:
1504         (JSC::Bindings::RuntimeObject::deleteProperty):
1505         * bridge/runtime_object.h:
1506
1507 2020-02-25  Ben Nham  <nham@apple.com>
1508
1509         Remove render update throttling
1510         https://bugs.webkit.org/show_bug.cgi?id=208168
1511
1512         Reviewed by Zalan Bujtas.
1513
1514         Currently, we disable render updates after the first paint for 500 ms while the page is
1515         actively loading. However, oftentimes our first paint heuristic selects a first paint that
1516         isn't particularly interesting (mostly background colors) and this paint throttler just
1517         makes the user look at a nearly empty page for 500 ms. Antti and Simon both think we should
1518         remove the throttler to fix this so this patch does that.
1519
1520         * Headers.cmake:
1521         * WebCore.xcodeproj/project.pbxproj:
1522         * dom/Document.cpp:
1523         (WebCore::Document::scheduleStyleRecalc):
1524         (WebCore::Document::shouldScheduleLayout):
1525         * editing/AlternativeTextController.cpp:
1526         (WebCore::AlternativeTextController::insertDictatedText):
1527         * page/ChromeClient.h:
1528         (WebCore::ChromeClient::layerTreeStateIsFrozen const):
1529         (WebCore::ChromeClient::renderingUpdateThrottlingIsActive const): Deleted.
1530         (WebCore::ChromeClient::adjustRenderingUpdateThrottling): Deleted.
1531         * page/EventHandler.cpp:
1532         (WebCore::EventHandler::dispatchDragEvent):
1533         (WebCore::EventHandler::dispatchMouseEvent):
1534         (WebCore::EventHandler::internalKeyEvent):
1535         (WebCore::EventHandler::handleTextInputEvent):
1536         * page/FrameView.cpp:
1537         (WebCore::FrameView::loadProgressingStatusChanged):
1538         (WebCore::FrameView::setWasScrolledByUser):
1539         (WebCore::determineLayerFlushThrottleState): Deleted.
1540         (WebCore::FrameView::disableLayerFlushThrottlingTemporarilyForInteraction): Deleted.
1541         (WebCore::FrameView::updateLayerFlushThrottling): Deleted.
1542         * page/FrameView.h:
1543
1544 2020-02-25  Myles C. Maxfield  <mmaxfield@apple.com>
1545
1546         [iPadOS] REGRESSION(r247667): Autosizing style changes don't invalidate RenderText's preferred logical widths
1547         https://bugs.webkit.org/show_bug.cgi?id=208084
1548         <rdar://problem/59463898>
1549
1550         Reviewed by Darin Adler.
1551
1552         Just use RenderElement::setStyle(), which handles all the invalidations, instead of RenderElement::setNeedsLayout().
1553
1554         Do a little refactoring so we don't clone RenderStyles unless we need to.
1555
1556         Test: fast/text-autosizing/ios/idempotentmode/viewport-change-relayout.html
1557
1558         * page/Page.cpp:
1559         (WebCore::Page::recomputeTextAutoSizingInAllFrames):
1560         * style/StyleAdjuster.cpp:
1561         (WebCore::Style::Adjuster::adjustmentForTextAutosizing):
1562         (WebCore::Style::Adjuster::adjustForTextAutosizing):
1563         * style/StyleAdjuster.h:
1564         (WebCore::Style::Adjuster::AdjustmentForTextAutosizing::operator bool const):
1565
1566 2020-02-25  Zalan Bujtas  <zalan@apple.com>
1567
1568         [LFC][TFC] Do not create a formatting context for empty subtree in TableFormattingContext::computePreferredWidthForColumns
1569         https://bugs.webkit.org/show_bug.cgi?id=208205
1570         <rdar://problem/59766702>
1571
1572         Reviewed by Antti Koivisto.
1573
1574         Test: fast/layoutformattingcontext/simple-table-with-empty-td.html
1575
1576         * layout/tableformatting/TableFormattingContext.cpp:
1577         (WebCore::Layout::TableFormattingContext::computePreferredWidthForColumns):
1578
1579 2020-02-25  Don Olmstead  <don.olmstead@sony.com>
1580
1581         [WinCairo] Fix build after revisions 257357 and 257354
1582         https://bugs.webkit.org/show_bug.cgi?id=208210
1583
1584         Unreviewed build fix.
1585
1586         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
1587         (WebCore::GraphicsLayerTextureMapper::notifyChange):
1588         * platform/network/curl/CookieJarDB.cpp:
1589         (WebCore::CookieJarDB::setCookie):
1590
1591 2020-02-25  Said Abou-Hallawa  <sabouhallawa@apple.com>
1592
1593         Make HostWindow be the creator of the remote ImageBuffer
1594         https://bugs.webkit.org/show_bug.cgi?id=207134
1595
1596         Reviewed by Darin Adler.
1597
1598         ImageBuffer is responsible of creating all the in-process ImageBuffers.
1599         HostWindow will be responsible of creating the remote ImageBuffers.
1600
1601         HostWindow adds the virtual function createImageBuffer(). Chrome forward
1602         this to the virtual function createImageBuffer() on the ChromeClient.
1603
1604         * page/Chrome.cpp:
1605         (WebCore::Chrome::createImageBuffer const):
1606         * page/Chrome.h:
1607         * page/ChromeClient.h:
1608         (WebCore::ChromeClient::createImageBuffer const):
1609         * platform/HostWindow.h:
1610         * platform/graphics/ImageBuffer.cpp:
1611         (WebCore::ImageBuffer::create):
1612         * platform/graphics/RenderingMode.h:
1613
1614 2020-02-25  Sihui Liu  <sihui_liu@apple.com>
1615
1616         Assertion failed: currentSchema == createV1ObjectStoreInfoSchema(objectStoreInfoTableName) || currentSchema == createV1ObjectStoreInfoSchema(objectStoreInfoTableNameAlternate)
1617         https://bugs.webkit.org/show_bug.cgi?id=208144
1618
1619         Reviewed by Ryosuke Niwa.
1620
1621         Change a release assertion to release error log to gather information about bug. This is also the pattern of 
1622         handling error during schema update in SQLiteIDBBackingStore.  
1623
1624         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
1625         (WebCore::IDBServer::SQLiteIDBBackingStore::ensureValidObjectStoreInfoTable):
1626
1627 2020-02-25  Zalan Bujtas  <zalan@apple.com>
1628
1629         [LFC][OutOfFlow] Out-of-flow positioned line breaks can generate display boxes
1630         https://bugs.webkit.org/show_bug.cgi?id=208198
1631         <rdar://problem/59764787>
1632
1633         Reviewed by Antti Koivisto.
1634
1635         Test: fast/layoutformattingcontext/out-of-flow-positioned-line-breaks.html
1636
1637         This assert should take the positioning into account when checking againts line breaks.
1638         (In practice those display boxes are empty and they don't really contribute to rendering but
1639         they are still valid content.) 
1640
1641         * layout/FormattingState.cpp:
1642         (WebCore::Layout::FormattingState::displayBox):
1643
1644 2020-02-25  Antti Koivisto  <antti@apple.com>
1645
1646         Remove throttling code from RenderLayerCompositor
1647         https://bugs.webkit.org/show_bug.cgi?id=208135
1648
1649         Reviewed by Zalan Bujtas.
1650
1651         It is only used on WK1, adds lots of complexity and is not very effective or correct.
1652
1653         Also do some "layer flush" -> "rendering update" renaming.
1654
1655         * page/FrameView.cpp:
1656         (WebCore::FrameView::disableLayerFlushThrottlingTemporarilyForInteraction):
1657         (WebCore::FrameView::updateLayerFlushThrottling):
1658         (WebCore::FrameView::setViewExposedRect):
1659         (WebCore::FrameView::scheduleLayerFlushAllowingThrottling): Deleted.
1660         * page/FrameView.h:
1661         * page/PageOverlayController.cpp:
1662         (WebCore::PageOverlayController::notifyRenderingUpdateRequired):
1663         (WebCore::PageOverlayController::notifyFlushRequired): Deleted.
1664         * page/PageOverlayController.h:
1665         * page/mac/ServicesOverlayController.h:
1666         * page/mac/ServicesOverlayController.mm:
1667         (WebCore::ServicesOverlayController::Highlight::notifyRenderingUpdateRequired):
1668         (WebCore::ServicesOverlayController::Highlight::notifyFlushRequired): Deleted.
1669         * platform/graphics/GraphicsLayer.h:
1670         (WebCore::GraphicsLayer::canThrottleLayerFlush const): Deleted.
1671         * platform/graphics/GraphicsLayerClient.h:
1672         (WebCore::GraphicsLayerClient::notifyRenderingUpdateRequired):
1673         (WebCore::GraphicsLayerClient::notifyFlushRequired): Deleted.
1674         * platform/graphics/ca/GraphicsLayerCA.cpp:
1675         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
1676         * platform/graphics/ca/GraphicsLayerCA.h:
1677         * platform/ios/LegacyTileCache.h:
1678         * platform/ios/LegacyTileCache.mm:
1679         (WebCore::LegacyTileCache::scheduleRenderingUpdateForPendingRepaint):
1680         (WebCore::LegacyTileCache::setNeedsDisplayInRect):
1681         (WebCore::LegacyTileCache::updateTilingMode):
1682         (WebCore::LegacyTileCache::scheduleLayerFlushForPendingRepaint): Deleted.
1683         * rendering/RenderLayerBacking.cpp:
1684         (WebCore::RenderLayerBacking::notifyRenderingUpdateRequired):
1685         (WebCore::RenderLayerBacking::notifyFlushRequired): Deleted.
1686         * rendering/RenderLayerBacking.h:
1687         * rendering/RenderLayerCompositor.cpp:
1688         (WebCore::RenderLayerCompositor::RenderLayerCompositor):
1689         (WebCore::RenderLayerCompositor::notifyRenderingUpdateRequired):
1690         (WebCore::RenderLayerCompositor::scheduleRenderingUpdate):
1691         (WebCore::RenderLayerCompositor::flushPendingLayerChanges):
1692         (WebCore::RenderLayerCompositor::didChangeVisibleRect):
1693         (WebCore::RenderLayerCompositor::flushLayersSoon):
1694         (WebCore::RenderLayerCompositor::frameViewDidScroll):
1695         (WebCore::RenderLayerCompositor::ensureRootLayer):
1696         (WebCore::RenderLayerCompositor::attachRootLayer):
1697         (WebCore::RenderLayerCompositor::notifyFlushRequired): Deleted.
1698         (WebCore::RenderLayerCompositor::scheduleLayerFlush): Deleted.
1699         (WebCore::RenderLayerCompositor::setLayerFlushThrottlingEnabled): Deleted.
1700         (WebCore::RenderLayerCompositor::disableLayerFlushThrottlingTemporarilyForInteraction): Deleted.
1701         (WebCore::RenderLayerCompositor::isThrottlingLayerFlushes const): Deleted.
1702         (WebCore::RenderLayerCompositor::startLayerFlushTimerIfNeeded): Deleted.
1703         (WebCore::RenderLayerCompositor::startInitialLayerFlushTimerIfNeeded): Deleted.
1704         (WebCore::RenderLayerCompositor::layerFlushTimerFired): Deleted.
1705         * rendering/RenderLayerCompositor.h:
1706
1707 2020-02-25  Andres Gonzalez  <andresg_22@apple.com>
1708
1709         IsolatedObject support for ProgressIndicator and Meter.
1710         https://bugs.webkit.org/show_bug.cgi?id=208175
1711
1712         Reviewed by Chris Fleizach.
1713
1714         - Eliminated the need to downcast to an AccessibilityProgressIndicator
1715         by including gaugeRegionValueDescription in the valueDescription
1716         method.
1717         - Separated isAccessibilityProgressIndicatorInstance from
1718         isProgressIndicator, so that the latter now works for both
1719         AccessibilityObjects and AXIsolatedObjects.
1720         - Completed implementation of isMeter in AXIsolatedObject.
1721
1722         * accessibility/AccessibilityObject.h:
1723         * accessibility/AccessibilityObjectInterface.h:
1724         * accessibility/AccessibilityProgressIndicator.cpp:
1725         (WebCore::AccessibilityProgressIndicator::valueDescription const):
1726         * accessibility/AccessibilityProgressIndicator.h:
1727         * accessibility/isolatedtree/AXIsolatedObject.cpp:
1728         (WebCore::AXIsolatedObject::initializeAttributeData): Sets the isMeter property.
1729         (WebCore::AXIsolatedObject::isAccessibilityProgressIndicatorInstance const):
1730         * accessibility/isolatedtree/AXIsolatedObject.h:
1731         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1732         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
1733         (-[WebAccessibilityObjectWrapper valueDescriptionForMeter]): Deleted, no needed any longer.
1734
1735 2020-02-25  Zalan Bujtas  <zalan@apple.com>
1736
1737         [LFC] Invalidate layout states on style mutation
1738         https://bugs.webkit.org/show_bug.cgi?id=208195
1739         <rdar://problem/59764089>
1740
1741         Reviewed by Antti Koivisto.
1742
1743         Let's just do a blanket invalidation for now (since we don't have the invalidation figured out yet).
1744
1745         * page/FrameViewLayoutContext.cpp:
1746         (WebCore::FrameViewLayoutContext::invalidateLayoutState):
1747         * page/FrameViewLayoutContext.h:
1748         * rendering/updating/RenderTreeUpdater.cpp:
1749         (WebCore::RenderTreeUpdater::updateRendererStyle):
1750
1751 2020-02-25  Chris Dumez  <cdumez@apple.com>
1752
1753         Regression(CookieCache) Hang and very high CPU usage on nytimes.com
1754         https://bugs.webkit.org/show_bug.cgi?id=208166
1755         <rdar://problem/59739735>
1756
1757         Reviewed by Alex Christensen.
1758
1759         The Cookie class which the cookie cache implementation relies on for IPC of cookie had a bug
1760         in its implementation to convert the Cookie into a NSHTTPCookie. In particular, if the expiry
1761         was in the past, it would drop it and the cookie would end up with no expiration date. We would
1762         end up with a cookie that lives for duration of the session, instead of a cookie with an
1763         expiration in the past (which is how sites delete cookies).
1764
1765         Test: http/tests/cookies/document-cookie-set-expired-cookie.html
1766
1767         * platform/network/cocoa/CookieCocoa.mm:
1768         (WebCore::Cookie::operator NSHTTPCookie * _Nullable  const):
1769
1770 2020-02-25  Carlos Garcia Campos  <cgarcia@igalia.com>
1771
1772         [GTK] Add support for rendering slider ticks
1773         https://bugs.webkit.org/show_bug.cgi?id=208132
1774
1775         Reviewed by Adrian Perez de Castro.
1776
1777         * rendering/RenderThemeAdwaita.cpp:
1778         (WebCore::RenderThemeAdwaita::paintSliderTrack):
1779         (WebCore::RenderThemeAdwaita::sliderTickSize const):
1780         (WebCore::RenderThemeAdwaita::sliderTickOffsetFromTrackCenter const):
1781
1782 2020-02-25  Carlos Garcia Campos  <cgarcia@igalia.com>
1783
1784         [GTK] Stop using gtk foreign drawing API to style form controls
1785         https://bugs.webkit.org/show_bug.cgi?id=208129
1786
1787         Reviewed by Adrian Perez de Castro.
1788
1789         It causes layout issues in some websites, it doesn't really work with all GTK themes and it won't be possible
1790         with GTK4 because foreign drawing APIs have been removed. Instead, we can use the new custom style used by WPE
1791         port, which is based on adwaita, but simplified to avoid the huge minimum control sizes, the usage of gradients
1792         and transparencies, etc. We can still use the GTK API to get the selection colors, to keep some consistency with
1793         the actual GTK theme, but that won't be possible with GTK4 either. This also means we won't be rendering
1794         directly to the cairo context anymore (which was required by GTK foreign drawing), so we can use things like
1795         threaded rendering in the GTK port now. This patch renames ScrollbarThemeWPE, RenderThemeWPE and ThemeWPE as
1796         ScrollbarThemeAdwaita, RenderThemeAdwaita and ThemeAdwaita and adds ThemeGtk. GTK media controls CSS and
1797         JavaScript files have been removed in favor of using the adwaita ones.
1798
1799         * Modules/mediacontrols/mediaControlsGtk.js: Removed.
1800         * PlatformGTK.cmake:
1801         * PlatformWPE.cmake:
1802         * SourcesGTK.txt:
1803         * SourcesWPE.txt:
1804         * css/mediaControlsGtk.css: Removed.
1805         * platform/adwaita/ScrollbarThemeAdwaita.cpp: Renamed from Source/WebCore/platform/wpe/ScrollbarThemeWPE.cpp.
1806         (WebCore::ScrollbarThemeAdwaita::usesOverlayScrollbars const):
1807         (WebCore::ScrollbarThemeAdwaita::scrollbarThickness):
1808         (WebCore::ScrollbarThemeAdwaita::minimumThumbLength):
1809         (WebCore::ScrollbarThemeAdwaita::hasButtons):
1810         (WebCore::ScrollbarThemeAdwaita::hasThumb):
1811         (WebCore::ScrollbarThemeAdwaita::backButtonRect):
1812         (WebCore::ScrollbarThemeAdwaita::forwardButtonRect):
1813         (WebCore::ScrollbarThemeAdwaita::trackRect):
1814         (WebCore::ScrollbarThemeAdwaita::paint):
1815         (WebCore::ScrollbarThemeAdwaita::handleMousePressEvent):
1816         (WebCore::ScrollbarTheme::nativeTheme):
1817         * platform/adwaita/ScrollbarThemeAdwaita.h: Copied from Source/WebCore/platform/wpe/ScrollbarThemeWPE.h.
1818         * platform/adwaita/ThemeAdwaita.cpp: Renamed from Source/WebCore/platform/wpe/ThemeWPE.cpp.
1819         (WebCore::Theme::singleton):
1820         (WebCore::ThemeAdwaita::activeSelectionForegroundColor const):
1821         (WebCore::ThemeAdwaita::activeSelectionBackgroundColor const):
1822         (WebCore::ThemeAdwaita::inactiveSelectionForegroundColor const):
1823         (WebCore::ThemeAdwaita::inactiveSelectionBackgroundColor const):
1824         (WebCore::ThemeAdwaita::focusColor):
1825         (WebCore::ThemeAdwaita::paintFocus):
1826         (WebCore::ThemeAdwaita::paintArrow):
1827         (WebCore::ThemeAdwaita::controlSize const):
1828         (WebCore::ThemeAdwaita::paint):
1829         (WebCore::ThemeAdwaita::paintCheckbox):
1830         (WebCore::ThemeAdwaita::paintRadio):
1831         (WebCore::ThemeAdwaita::paintButton):
1832         (WebCore::ThemeAdwaita::paintSpinButton):
1833         * platform/adwaita/ThemeAdwaita.h: Renamed from Source/WebCore/platform/wpe/ThemeWPE.h.
1834         (WebCore::ThemeAdwaita::platformColorsDidChange):
1835         * platform/graphics/cairo/CairoOperations.cpp:
1836         (WebCore::Cairo::drawFocusRing):
1837         * platform/graphics/cairo/GraphicsContextCairo.cpp:
1838         (WebCore::GraphicsContext::drawFocusRing):
1839         * platform/gtk/RenderThemeGadget.cpp: Removed.
1840         * platform/gtk/RenderThemeGadget.h: Removed.
1841         * platform/gtk/RenderThemeWidget.cpp: Removed.
1842         * platform/gtk/RenderThemeWidget.h: Removed.
1843         * platform/gtk/ScrollbarThemeGtk.cpp: Removed.
1844         * platform/gtk/ScrollbarThemeGtk.h: Removed.
1845         * platform/gtk/ThemeGtk.cpp: Added.
1846         (WebCore::Theme::singleton):
1847         (WebCore::ThemeGtk::ensurePlatformColors const):
1848         (WebCore::ThemeGtk::platformColorsDidChange):
1849         (WebCore::ThemeGtk::activeSelectionForegroundColor const):
1850         (WebCore::ThemeGtk::activeSelectionBackgroundColor const):
1851         (WebCore::ThemeGtk::inactiveSelectionForegroundColor const):
1852         (WebCore::ThemeGtk::inactiveSelectionBackgroundColor const):
1853         * platform/gtk/ThemeGtk.h: Renamed from Source/WebCore/platform/wpe/ScrollbarThemeWPE.h.
1854         * rendering/RenderThemeAdwaita.cpp: Renamed from Source/WebCore/platform/wpe/RenderThemeWPE.cpp.
1855         (WebCore::RenderTheme::singleton):
1856         (WebCore::RenderThemeAdwaita::supportsFocusRing const):
1857         (WebCore::RenderThemeAdwaita::shouldHaveCapsLockIndicator const):
1858         (WebCore::RenderThemeAdwaita::platformActiveSelectionBackgroundColor const):
1859         (WebCore::RenderThemeAdwaita::platformInactiveSelectionBackgroundColor const):
1860         (WebCore::RenderThemeAdwaita::platformActiveSelectionForegroundColor const):
1861         (WebCore::RenderThemeAdwaita::platformInactiveSelectionForegroundColor const):
1862         (WebCore::RenderThemeAdwaita::platformActiveListBoxSelectionBackgroundColor const):
1863         (WebCore::RenderThemeAdwaita::platformInactiveListBoxSelectionBackgroundColor const):
1864         (WebCore::RenderThemeAdwaita::platformActiveListBoxSelectionForegroundColor const):
1865         (WebCore::RenderThemeAdwaita::platformInactiveListBoxSelectionForegroundColor const):
1866         (WebCore::RenderThemeAdwaita::platformFocusRingColor const):
1867         (WebCore::RenderThemeAdwaita::platformColorsDidChange):
1868         (WebCore::RenderThemeAdwaita::extraDefaultStyleSheet):
1869         (WebCore::RenderThemeAdwaita::extraMediaControlsStyleSheet):
1870         (WebCore::RenderThemeAdwaita::mediaControlsScript):
1871         (WebCore::RenderThemeAdwaita::paintTextField):
1872         (WebCore::RenderThemeAdwaita::paintTextArea):
1873         (WebCore::RenderThemeAdwaita::paintSearchField):
1874         (WebCore::RenderThemeAdwaita::popupInternalPaddingBox const):
1875         (WebCore::RenderThemeAdwaita::paintMenuList):
1876         (WebCore::RenderThemeAdwaita::paintMenuListButtonDecorations):
1877         (WebCore::RenderThemeAdwaita::animationRepeatIntervalForProgressBar const):
1878         (WebCore::RenderThemeAdwaita::animationDurationForProgressBar const):
1879         (WebCore::RenderThemeAdwaita::progressBarRectForBounds const):
1880         (WebCore::RenderThemeAdwaita::paintProgressBar):
1881         (WebCore::RenderThemeAdwaita::paintSliderTrack):
1882         (WebCore::RenderThemeAdwaita::adjustSliderThumbSize const):
1883         (WebCore::RenderThemeAdwaita::paintSliderThumb):
1884         (WebCore::RenderThemeAdwaita::paintMediaSliderTrack):
1885         (WebCore::RenderThemeAdwaita::paintMediaVolumeSliderTrack):
1886         (WebCore::RenderThemeAdwaita::sliderTickSize const):
1887         (WebCore::RenderThemeAdwaita::sliderTickOffsetFromTrackCenter const):
1888         (WebCore::RenderThemeAdwaita::adjustListButtonStyle const):
1889         * rendering/RenderThemeAdwaita.h: Renamed from Source/WebCore/platform/wpe/RenderThemeWPE.h.
1890         * rendering/RenderThemeGtk.cpp:
1891         (WebCore::RenderThemeGtk::updateCachedSystemFontDescription const):
1892         (WebCore::RenderThemeGtk::caretBlinkInterval const):
1893         * rendering/RenderThemeGtk.h:
1894
1895 2020-02-24  Fujii Hironori  <Hironori.Fujii@sony.com>
1896
1897         Unreviewed build fix for WinCairo port
1898         https://bugs.webkit.org/show_bug.cgi?id=208112
1899         <rdar://problem/59709701>
1900
1901         > WebCore\layout/inlineformatting/LineLayoutContext.cpp(337): error C2397: conversion from 'size_t' to 'WTF::Optional<unsigned int>' requires a narrowing conversion
1902         > WebCore\layout/inlineformatting/LineLayoutContext.cpp(361): error C2397: conversion from 'size_t' to 'WTF::Optional<unsigned int>' requires a narrowing conversion
1903
1904         * layout/inlineformatting/LineLayoutContext.cpp:
1905         (WebCore::Layout::LineLayoutContext::close): Changed the type of 'trailingInlineItemIndex' from 'auto' to 'unsigned'.
1906
1907 2020-02-23  Darin Adler  <darin@apple.com>
1908
1909         Refactor TextTrackCue to use more traditional design patterns
1910         https://bugs.webkit.org/show_bug.cgi?id=208114
1911
1912         Reviewed by Alex Christensen.
1913
1914         - Fixed is<VTTCue> to accurately match the class hierarchy. Before, TextTrackCueGeneric
1915           derived from VTTCue, but is<VTTCue> would return false. Normalizing this lets us use
1916           is<VTTCue> and downcast<VTTCue> in the conventional way.
1917         - Made the TextTrackCue::isEqual function a non-virtual function that calls a virtual
1918           function TextTrackCue::cueContentsMatch. Before there was a mix of overridding both
1919           functions in derived classes, achieving the same thing in multiple ways with
1920           unneccessary additional virtual function call overhead.
1921         - Made the TextTrackCue::toJSONString function a non-virtual function that calls a
1922           virtual funtion TextTrackCue::toJSON. Before there were two virtual functions and
1923           inconsistent patterns for which one was overridden.
1924
1925         * html/HTMLMediaElement.cpp:
1926         (WebCore::HTMLMediaElement::textTrackRemoveCue): Use downcast instead of toVTTCue.
1927
1928         * html/HTMLMediaElement.h: Removed some unneeded includes.
1929
1930         * html/shadow/MediaControlElements.cpp:
1931         (WebCore::MediaControlTextTrackContainerElement::updateDisplay): Use downcast
1932         instead of toVTTCue.
1933         (WebCore::MediaControlTextTrackContainerElement::processActiveVTTCue): Removed
1934         an assertion that no longer makes sense; guaranteed at runtime.
1935
1936         * html/shadow/MediaControls.h: Removed an unneeded include.
1937
1938         * html/track/DataCue.cpp:
1939         (WebCore::toDataCue): Deleted. No need for this function since we can use
1940         downcast<DataCue> instead.
1941         (WebCore::DataCue::cueContentsMatch const): Removed unnecessary check of cueType.
1942         The isEqual function checks cueType and only calls this function if it matches.
1943         Use downcast instead of toDataCue.
1944         (WebCore::DataCue::isEqual const): Deleted. Base class now handles this.
1945         (WebCore::DataCue::doesExtendCue const): Deleted. Was never being called.
1946         (WebCore::DataCue::toJSONString const): Deleted. Override toJSON instead.
1947         (WebCore::DataCue::toJSON const): Moved the code here that used to be in toJSONString.
1948
1949         * html/track/DataCue.h: Reduced includes. Made overridden functions private
1950         and final. Removed functions as mmentioned above. Changed WTF::LogArgument implementation
1951         to just forward to TextTrackCue instead of reimplementing here.
1952
1953         * html/track/InbandDataTextTrack.cpp:
1954         (WebCore::InbandDataTextTrack::removeCue): Use downcast instead of toDataCue.
1955
1956         * html/track/InbandGenericTextTrack.cpp: Removed an unneeded include.
1957
1958         * html/track/LoadableTextTrack.cpp:
1959         (WebCore::LoadableTextTrack::LoadableTextTrack): Removed unneeded initialization of
1960         m_isDefault, which is initialized in the class definition.
1961         (WebCore::LoadableTextTrack::newCuesAvailable): Removed unneeded call to toVTTCue,
1962         taking advantage of the better interface of getNewCues, which now returns
1963         Vector<Ref<VTTCue>>, making the type explicit.
1964
1965         * html/track/TextTrack.cpp:
1966         (WebCore::TextTrack::addCue): Use is<DataCue> instead of checking cueType.
1967
1968         * html/track/TextTrackCue.cpp:
1969         (WebCore::TextTrackCue::create): Fixed confusing naming that called the fragment the
1970         cue is contained in "cueDocument"; call it cueFragment instead. This constructor
1971         already required that the ScriptExecutionContext be a Document. Did the type cast
1972         for that up front. In the future would be good to change the argument type to Document.
1973         Also fixed how the newly-created fragment is passed to the constructor. The old code
1974         tried to use DocumentFragment&& to pass ownership, but since this is a reference-counted
1975         object it needs to be Ref<DocumentFragment>&&.
1976         (WebCore::TextTrackCue::TextTrackCue):
1977         (WebCore::TextTrackCue::scriptExecutionContext const): Moved this here from the header
1978         file so we can compile without TextTrackCue.h including Document.h.
1979         (WebCore::TextTrackCue::cueContentsMatch const): Removed the code that checks cueType.
1980         It's now isEqual that is responsible for checking that the cueType matches, and
1981         cueContentsMatch is only called when the types are the same.
1982         (WebCore::TextTrackCue::isEqual const): Reordered the boolean checks a bit so it's
1983         easier to see the logic; no need for a cascade of if statements.
1984         (WebCore::TextTrackCue::doesExtendCue const): Deleted. Was never being called.
1985         (WebCore::operator<<): Use downcast instead of toVTTCue.
1986
1987         * html/track/TextTrackCue.h: Made isEqual no longer virtual. The per-class behavior
1988         is now all in the virtual cueContentsMatch function, only called by isEqual.
1989         Removed uncalled doesExtendCue function. Added some argument names in cases where
1990         the type alone did not make their purpose clear. Made some things more private.
1991         Replaced m_scriptExecutionContext with m_document.
1992
1993         * html/track/TextTrackCueGeneric.cpp:
1994         (WebCore::TextTrackCueGeneric::create): Moved this function here from the header.
1995         (WebCore::TextTrackCueGeneric::TextTrackCueGeneric): Initialized data members in the
1996         class definition so they don't also need to be initialized here.
1997         (WebCore::TextTrackCueGeneric::cueContentsMatch const): Rewrote using && rather than
1998         castcading if statements, making the function shorter andd easier to read.
1999         (WebCore::TextTrackCueGeneric::isEqual const): Deleted. Base class now handes this.
2000         The old version had confusing logic to deal with checking cue type; can now do this
2001         in a more straightforward way.
2002         (WebCore::TextTrackCueGeneric::doesExtendCue const): Deleted. Was never called.
2003         (WebCore::TextTrackCueGeneric::isOrderedBefore const): Use is<TextTrackCueGeneric>
2004         and downcast<TextTrackCueGeneric>.
2005         (WebCore::TextTrackCueGeneric::isPositionedAbove const): Ditto. Also merged two
2006         if statements so there is less repeated logic.
2007         (WebCore::TextTrackCueGeneric::toJSONString const): Deleted.
2008         (WebCore::TextTrackCueGeneric::toJSON const): Moved code here that was in toJSONString.
2009
2010         * html/track/TextTrackCueGeneric.h: Made things more private. Changed WTF::LogArgument
2011         implementation to just forward to TextTrackCue instead of reimplementing here.
2012
2013         * html/track/TextTrackCueList.cpp:
2014         (WebCore::TextTrackCueList::create): Moved here from header.
2015         * html/track/TextTrackCueList.h: Ditto.
2016
2017         * html/track/VTTCue.cpp: Moved undefinedPosition to be a private static constexpr
2018         data member so it can be used in initialization.
2019         (WebCore::VTTCueBox::applyCSSProperties): Use is<VTTCue> and downcast<VTTCue>.
2020         (WebCore::VTTCue::create): Moved more overloads of this function here from the
2021         header file.
2022         (WebCore::VTTCue::VTTCue): Take Document instead of ScriptExecutionContext.
2023         Also took the ScriptExecutionContext argument away from the initialize function.
2024         (WebCore::VTTCue::initialize): Do less initialization here. This function is
2025         only called in constructors, so it doesn't need to initialize anything that
2026         is initialized in all constructors or initialized in the class definition.
2027         What remains are things that require a little code to initialize and the
2028         bitfields, which can't be initialized in the class definition.
2029         (WebCore::VTTCue::setPosition): Rearranged the code a tiny bit.
2030         (WebCore::copyWebVTTNodeToDOMTree): Made this a non-member function. Also changed
2031         the argument types to use references.
2032         (WebCore::VTTCue::getCueAsHTML): Updated for changes to copyWebVTTNodeToDOMTree.
2033         (WebCore::VTTCue::removeDisplayTree): Check m_displayTree directly instead
2034         of calling a hasDisplayTree function, since that's more a more straightforward
2035         way to guard a subsequent line of code that then uses m_displayTree.
2036         (WebCore::VTTCue::setCueSettings): Merged two if statements into one.
2037         (WebCore::VTTCue::cueContentsMatch const): Rewrote using && rather than
2038         castcading if statements, making the function shorter andd easier to read.
2039         (WebCore::VTTCue::isEqual const): Deleted. Base class now handles this.
2040         (WebCore::VTTCue::doesExtendCue const): Deleted. Was never called.
2041         (WebCore::toVTTCue): Deleted.
2042         (WebCore::VTTCue::toJSONString const): Deleted. Base class now handles this.
2043         (WebCore::VTTCue::toJSON const): Added a comment.
2044
2045         * html/track/VTTCue.h: Moved create functions out of header, made some things
2046         more private and final, initialized more data members in the class definition.
2047         Removed toVTTCue. Changed WTF::LogArgument implementation to just forward to
2048         TextTrackCue instead of reimplementing here. Corrected the isType function so
2049         it knows about both cue types that result in a VTTCue object. This allows us
2050         to use is<VTTCue> and downcast<VTTCue> in the normal way. Removed the FIXME
2051         saying we should do that.
2052
2053         * loader/TextTrackLoader.cpp:
2054         (WebCore::TextTrackLoader::getNewCues): Changed to return a Vector<Ref<VTTCue>>.
2055         In modern C++ return value is better than an out argument for a function like
2056         this, and the more-specific type helps us at the call sites.
2057
2058         * loader/TextTrackLoader.h: Updated for the above.
2059
2060         * page/CaptionUserPreferencesMediaAF.cpp: Removed unneeded include.
2061
2062         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
2063         Use #pragma once and removed some unneded includes and forward declarations.
2064
2065         * rendering/RenderVTTCue.cpp:
2066         (WebCore::RenderVTTCue::RenderVTTCue): Use downcast<VTTCue>.
2067         (WebCore::RenderVTTCue::layout): Removed unneeded call to toVTTCue.
2068         (WebCore::RenderVTTCue::repositionGenericCue): Use downcast instead of
2069         static_cast for TextTrackCueGeneric.
2070
2071         * style/RuleSet.cpp: Removed unneeded include.
2072
2073 2020-02-24  Chris Fleizach  <cfleizach@apple.com>
2074
2075         AX: Support relative frames for isolated trees correctly
2076         https://bugs.webkit.org/show_bug.cgi?id=208169
2077         <rdar://problem/59746529>
2078
2079         Reviewed by Zalan Bujtas.
2080
2081         To support relative frames correctly for accessibility, we should:
2082           1) Only expose for isolated tree clients.
2083           2) Support FloatRects in the attribute variants.
2084           
2085         This patch also fixes an issue where we weren't reserving capacity before using.
2086
2087         * accessibility/isolatedtree/AXIsolatedObject.cpp:
2088         (WebCore::AXIsolatedObject::setObjectVectorProperty):
2089         * accessibility/isolatedtree/AXIsolatedObject.h:
2090         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2091         (-[WebAccessibilityObjectWrapper additionalAccessibilityAttributeNames]):
2092         (-[WebAccessibilityObjectWrapper ALLOW_DEPRECATED_IMPLEMENTATIONS_END]):
2093
2094 2020-02-24  ChangSeok Oh  <changseok@webkit.org>
2095
2096         PS-2019-006: [GTK] WebKit - AXObjectCache - m_deferredFocusedNodeChange - UaF
2097         https://bugs.webkit.org/show_bug.cgi?id=204342
2098
2099         Reviewed by Carlos Garcia Campos.
2100
2101         m_deferredFocusedNodeChange keeps pairs of a old node and a new one
2102         to update a focused node later. When a node is removed in the document,
2103         it is also removed from the pair vector. The problem is only comparing
2104         the new node in each pair with a removed node decides the removal.
2105         In the case where the removed node lives in m_deferredFocusedNodeChange
2106         as an old node, a crash happens while we get a renderer of the removed node
2107         to handle focused elements. To fix this, we find all entries of which old node
2108         is matched to the removed node, and set their first value null.
2109
2110         No new tests since no functionality changed.
2111
2112         * accessibility/AXObjectCache.cpp:
2113         (WebCore::AXObjectCache::remove):
2114
2115 2020-02-24  Zalan Bujtas  <zalan@apple.com>
2116
2117         [LFC][IFC][Floats] Fix float boxes embedded to unbreakable inline runs.
2118         https://bugs.webkit.org/show_bug.cgi?id=208112
2119         <rdar://problem/59709701>
2120
2121         Reviewed by Antti Koivisto.
2122
2123         This patch fixes the cases when the float is embedded to otherwise unbreakable inline content.
2124         e.g. "text_<div style="float: left"></div>_content"
2125
2126         The logic goes like this:
2127         1. collect the floats inside the unbreakable candidate content
2128         2. mark them intrusive if they potentially influence the current line
2129         3. at handleFloatsAndInlineContent(), adjust available width with the intrusive floats first
2130         4. feed the inline content to the LineBreaker
2131         6. commit the float content based on the line breaking result (commit none, partially, all).
2132         (Note that this algorithm produces a different layout compared to WebKit trunk. It mostly matches FireFox though.)
2133
2134         * layout/inlineformatting/InlineFormattingContext.cpp:
2135         (WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthForConstraint const):
2136         (WebCore::Layout::InlineFormattingContext::setDisplayBoxesForLine):
2137         * layout/inlineformatting/InlineLineBuilder.cpp:
2138         (WebCore::Layout::LineBuilder::moveLogicalLeft):
2139         (WebCore::Layout::LineBuilder::moveLogicalRight):
2140         * layout/inlineformatting/LineLayoutContext.cpp:
2141         (WebCore::Layout::isAtSoftWrapOpportunity):
2142         (WebCore::Layout::nextWrapOpportunity):
2143         (WebCore::Layout::LineCandidate::FloatContent::append):
2144         (WebCore::Layout::LineLayoutContext::layoutLine):
2145         (WebCore::Layout::LineLayoutContext::close):
2146         (WebCore::Layout::LineLayoutContext::nextContentForLine):
2147         (WebCore::Layout::LineLayoutContext::addIntrusiveFloats):
2148         (WebCore::Layout::LineLayoutContext::revertIntrusiveFloats):
2149         (WebCore::Layout::LineLayoutContext::handleFloatsAndInlineContent):
2150         (WebCore::Layout::isLineConsideredEmpty): Deleted.
2151         (WebCore::Layout::LineLayoutContext::tryAddingFloatContent): Deleted.
2152         (WebCore::Layout::LineLayoutContext::tryAddingInlineItems): Deleted.
2153         * layout/inlineformatting/LineLayoutContext.h:
2154
2155 2020-02-24  Nikos Mouchtaris  <nmouchtaris@apple.com>
2156
2157         Add canShare function for Web Share API v2
2158         https://bugs.webkit.org/show_bug.cgi?id=207491
2159
2160         Reviewed by Tim Horton.
2161
2162         Added files member to share data and canShare function to
2163         navigator.cpp. Can share function should always be used 
2164         before call to share, and can be used to check if file 
2165         sharing is implemented by passing a share data object with
2166         only files.
2167
2168         Imported new Web Platform Tests to test new function.
2169
2170         * page/Navigator.cpp:
2171         (WebCore::Navigator::canShare): Will currently return false for 
2172         only file share data objects, since file sharing is currently 
2173         not implemented.
2174         (WebCore::Navigator::share): Changed to use canShare to 
2175         determine if data is shareable.
2176         * page/Navigator.h:
2177         * page/NavigatorShare.idl:
2178         * page/ShareData.h:
2179         * page/ShareData.idl:
2180
2181 2020-02-24  Yusuke Suzuki  <ysuzuki@apple.com>
2182
2183         [WTF] Attach WARN_UNUSED_RETURN to makeScopeExit and fix existing wrong usage
2184         https://bugs.webkit.org/show_bug.cgi?id=208162
2185
2186         Reviewed by Robin Morisset.
2187
2188         * html/HTMLLinkElement.cpp:
2189         (WebCore::HTMLLinkElement::process):
2190
2191 2020-02-24  Jiewen Tan  <jiewen_tan@apple.com>
2192
2193         [WebAuthn] Implement SPI for the platform authenticator
2194         https://bugs.webkit.org/show_bug.cgi?id=208087
2195         <rdar://problem/59369305>
2196
2197         Reviewed by Brent Fulgham.
2198
2199         Enhances AuthenticatorAssertionResponse to accommondate responses
2200         returned from the platform authenticator.
2201
2202         Covered by API tests.
2203
2204         * Modules/webauthn/AuthenticatorAssertionResponse.cpp:
2205         (WebCore::AuthenticatorAssertionResponse::create):
2206         (WebCore::AuthenticatorAssertionResponse::setAuthenticatorData):
2207         (WebCore::AuthenticatorAssertionResponse::AuthenticatorAssertionResponse):
2208         * Modules/webauthn/AuthenticatorAssertionResponse.h:
2209         (WebCore::AuthenticatorAssertionResponse::authenticatorData const):
2210         (WebCore::AuthenticatorAssertionResponse::signature const):
2211         (WebCore::AuthenticatorAssertionResponse::name const):
2212         (WebCore::AuthenticatorAssertionResponse::displayName const):
2213         (WebCore::AuthenticatorAssertionResponse::numberOfCredentials const):
2214         (WebCore::AuthenticatorAssertionResponse::accessControl const):
2215         (WebCore::AuthenticatorAssertionResponse::setSignature):
2216         (WebCore::AuthenticatorAssertionResponse::setName):
2217         (WebCore::AuthenticatorAssertionResponse::setDisplayName):
2218         (WebCore::AuthenticatorAssertionResponse::setNumberOfCredentials):
2219
2220 2020-02-24  Simon Fraser  <simon.fraser@apple.com>
2221
2222         Rename the clashing WebOverlayLayer classes
2223         https://bugs.webkit.org/show_bug.cgi?id=208156
2224         rdar://problem/59739250
2225
2226         Reviewed by Tim Horton.
2227
2228         The name WebOverlayLayer was used in two places. Rename them both to more specific names.
2229
2230         * page/cocoa/ResourceUsageOverlayCocoa.mm:
2231         (-[WebResourceUsageOverlayLayer initWithResourceUsageOverlay:]):
2232         (WebCore::ResourceUsageOverlay::platformInitialize):
2233         (-[WebOverlayLayer initWithResourceUsageOverlay:]): Deleted.
2234         (-[WebOverlayLayer drawInContext:]): Deleted.
2235
2236 2020-02-24  Andres Gonzalez  <andresg_22@apple.com>
2237
2238         [WebAccessibilityObjectWrapper updateObjectBackingStore] should return the backing object.
2239         https://bugs.webkit.org/show_bug.cgi?id=208153
2240
2241         Reviewed by Chris Fleizach.
2242
2243         Covered by existing tests.
2244
2245         Currently in many WebAccessibilityObjectWrapper's methods we call
2246         updateObjectBackingStore followed by one or more calls to
2247         axBackingObject. This patch eliminates this unnecessary call by making
2248         updateObjectBackingStore return the backing object. It also cleans up
2249         other unnecessary calls to axBackingObject and does some minor code
2250         cleanup.
2251
2252         * accessibility/mac/WebAccessibilityObjectWrapperBase.h:
2253         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
2254         (-[WebAccessibilityObjectWrapperBase updateObjectBackingStore]):
2255         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2256         (-[WebAccessibilityObjectWrapper ALLOW_DEPRECATED_IMPLEMENTATIONS_END]):
2257         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
2258         (-[WebAccessibilityObjectWrapper accessibilityFocusedUIElement]):
2259         (-[WebAccessibilityObjectWrapper accessibilityHitTest:]):
2260         (-[WebAccessibilityObjectWrapper accessibilityIsAttributeSettable:]):
2261         (-[WebAccessibilityObjectWrapper _accessibilityPerformPressAction]):
2262         (-[WebAccessibilityObjectWrapper _accessibilityPerformIncrementAction]):
2263         (-[WebAccessibilityObjectWrapper _accessibilityPerformDecrementAction]):
2264         (-[WebAccessibilityObjectWrapper accessibilityPerformAction:]):
2265         (-[WebAccessibilityObjectWrapper accessibilityReplaceRange:withText:]):
2266         (-[WebAccessibilityObjectWrapper accessibilityInsertText:]):
2267         (-[WebAccessibilityObjectWrapper _accessibilitySetValue:forAttribute:]):
2268         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
2269         (-[WebAccessibilityObjectWrapper accessibilityIndexOfChild:]):
2270         (-[WebAccessibilityObjectWrapper accessibilityArrayAttributeCount:]):
2271         (-[WebAccessibilityObjectWrapper accessibilityArrayAttributeValues:index:maxCount:]):
2272
2273 2020-02-24  Zalan Bujtas  <zalan@apple.com>
2274
2275         [LFC][IFC][Floats] Fix float box handling inside unbreakable content
2276         https://bugs.webkit.org/show_bug.cgi?id=208109
2277         <rdar://problem/59708646>
2278
2279         Reviewed by Antti Koivisto.
2280
2281         We've been handling float boxes and other inline items as mutually exclusive content (in the context of unbreakable candidate runs).
2282         While this works in most cases, when the unbreakable content includes float boxes, the layout
2283         ends up being incorrect.
2284         This patch is in preparation for making sure we process the inline content and the associated float boxes as one entity.
2285         (e.g "text_<div style="float: left"></div>_content" produces an unbreakable inline content of [text_][_content] and an associated float box)
2286
2287         * layout/inlineformatting/LineLayoutContext.cpp:
2288         (WebCore::Layout::isAtSoftWrapOpportunity):
2289         (WebCore::Layout::LineCandidate::FloatContent::append):
2290         (WebCore::Layout::LineCandidate::FloatContent::list const):
2291         (WebCore::Layout::LineCandidate::FloatContent::reset):
2292         (WebCore::Layout::LineCandidate::reset):
2293         (WebCore::Layout::LineLayoutContext::layoutLine):
2294         (WebCore::Layout::LineLayoutContext::nextContentForLine):
2295         (WebCore::Layout::LineLayoutContext::tryAddingFloatContent):
2296         (WebCore::Layout::LineLayoutContext::tryAddingFloatItem): Deleted.
2297         * layout/inlineformatting/LineLayoutContext.h:
2298
2299 2020-02-24  Chris Dumez  <cdumez@apple.com>
2300
2301         Document / DOMWindow objects get leaked on CNN.com due to CSSTransitions
2302         https://bugs.webkit.org/show_bug.cgi?id=208145
2303
2304         Reviewed by Antoine Quint.
2305
2306         Break reference cycles using WeakPtr so that CSSTransitions can no longer cause whole document / DOM trees to
2307         get leaked.
2308
2309         * animation/DocumentTimeline.cpp:
2310         (WebCore::DocumentTimeline::DocumentTimeline):
2311         * animation/DocumentTimeline.h:
2312         * animation/KeyframeEffect.cpp:
2313         (WebCore::KeyframeEffect::KeyframeEffect):
2314         (WebCore::KeyframeEffect::setTarget):
2315         * animation/KeyframeEffect.h:
2316
2317 2020-02-24  Youenn Fablet  <youenn@apple.com>
2318
2319         Add a runtime flag dedicated to WebRTC codecs in GPUProcess
2320         https://bugs.webkit.org/show_bug.cgi?id=208136
2321
2322         Reviewed by Alex Christensen.
2323
2324         Add a runtime flag for WebRTC codecs in GPUProcess.
2325         Enable the flag by default for MacOS.
2326
2327         * page/RuntimeEnabledFeatures.h:
2328         (WebCore::RuntimeEnabledFeatures::webRTCPlatformCodecsInGPUProcessEnabled const):
2329         (WebCore::RuntimeEnabledFeatures::setWebRTCPlatformCodecsInGPUProcessEnabled):
2330         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
2331         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
2332         * testing/Internals.cpp:
2333         (WebCore::Internals::resetToConsistentState):
2334         (WebCore::Internals::setUseGPUProcessForWebRTC):
2335
2336 2020-02-24  Simon Fraser  <simon.fraser@apple.com>
2337
2338         Remove geometry information from the scrolling tree
2339         https://bugs.webkit.org/show_bug.cgi?id=208085
2340
2341         Reviewed by Sam Weinig.
2342
2343         The scrolling tree doesn't have enough information to do hit-testing because it has
2344         no representation of layers that overlap scrollers. We'll have to do hit-testing another
2345         way, so remove hit-testing-geometry data from the scrolling tree.
2346
2347         * page/scrolling/AsyncScrollingCoordinator.cpp:
2348         (WebCore::AsyncScrollingCoordinator::setRectRelativeToParentNode): Deleted.
2349         * page/scrolling/AsyncScrollingCoordinator.h:
2350         * page/scrolling/ScrollingCoordinator.h:
2351         (WebCore::ScrollingCoordinator::setRectRelativeToParentNode): Deleted.
2352         * page/scrolling/ScrollingStateFrameHostingNode.cpp:
2353         (WebCore::ScrollingStateFrameHostingNode::ScrollingStateFrameHostingNode):
2354         (WebCore::ScrollingStateFrameHostingNode::dumpProperties const):
2355         (WebCore::ScrollingStateFrameHostingNode::setPropertyChangedBitsAfterReattach): Deleted.
2356         (WebCore::ScrollingStateFrameHostingNode::setParentRelativeScrollableRect): Deleted.
2357         * page/scrolling/ScrollingStateFrameHostingNode.h:
2358         * page/scrolling/ScrollingStateScrollingNode.cpp:
2359         (WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode):
2360         (WebCore::ScrollingStateScrollingNode::setPropertyChangedBitsAfterReattach):
2361         (WebCore::ScrollingStateScrollingNode::dumpProperties const):
2362         (WebCore::ScrollingStateScrollingNode::setParentRelativeScrollableRect): Deleted.
2363         * page/scrolling/ScrollingStateScrollingNode.h:
2364         (WebCore::ScrollingStateScrollingNode::parentRelativeScrollableRect const): Deleted.
2365         * page/scrolling/ScrollingTree.cpp:
2366         (WebCore::ScrollingTree::handleWheelEvent):
2367         (WebCore::ScrollingTree::scrollingNodeForPoint):
2368         * page/scrolling/ScrollingTree.h:
2369         * page/scrolling/ScrollingTreeFrameHostingNode.cpp:
2370         (WebCore::ScrollingTreeFrameHostingNode::commitStateBeforeChildren):
2371         (WebCore::ScrollingTreeFrameHostingNode::dumpProperties const):
2372         (WebCore::ScrollingTreeFrameHostingNode::parentToLocalPoint const): Deleted.
2373         * page/scrolling/ScrollingTreeFrameHostingNode.h:
2374         (WebCore::ScrollingTreeFrameHostingNode::parentRelativeScrollableRect const): Deleted.
2375         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
2376         (WebCore::ScrollingTreeFrameScrollingNode::parentToLocalPoint const): Deleted.
2377         (WebCore::ScrollingTreeFrameScrollingNode::localToContentsPoint const): Deleted.
2378         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
2379         * page/scrolling/ScrollingTreeNode.cpp:
2380         (WebCore::ScrollingTreeNode::ScrollingTreeNode):
2381         (WebCore::ScrollingTreeNode::scrollingNodeForPoint const): Deleted.
2382         * page/scrolling/ScrollingTreeNode.h:
2383         (WebCore::ScrollingTreeNode::parentToLocalPoint const): Deleted.
2384         (WebCore::ScrollingTreeNode::localToContentsPoint const): Deleted.
2385         * page/scrolling/ScrollingTreeScrollingNode.cpp:
2386         (WebCore::ScrollingTreeScrollingNode::commitStateBeforeChildren):
2387         (WebCore::ScrollingTreeScrollingNode::dumpProperties const):
2388         (WebCore::ScrollingTreeScrollingNode::parentToLocalPoint const): Deleted.
2389         (WebCore::ScrollingTreeScrollingNode::localToContentsPoint const): Deleted.
2390         (WebCore::ScrollingTreeScrollingNode::scrollingNodeForPoint const): Deleted.
2391         * page/scrolling/ScrollingTreeScrollingNode.h:
2392         * rendering/RenderLayerCompositor.cpp:
2393         (WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingRole):
2394         (WebCore::RenderLayerCompositor::updateScrollingNodeForFrameHostingRole):
2395         (WebCore::RenderLayerCompositor::rootParentRelativeScrollableRect const): Deleted.
2396         * rendering/RenderLayerCompositor.h:
2397
2398 2020-02-24  Alex Christensen  <achristensen@webkit.org>
2399
2400         WKWebViewConfiguration._corsDisablingPatterns should also disable CORS for non-DocumentThreadableLoader loading
2401         https://bugs.webkit.org/show_bug.cgi?id=208035
2402         <rdar://problem/58011337>
2403
2404         Reviewed by Tim Hatcher.
2405
2406         Covered by an API test.
2407
2408         * loader/CrossOriginAccessControl.cpp:
2409         (WebCore::createPotentialAccessControlRequest):
2410
2411 2020-02-24  Zalan Bujtas  <zalan@apple.com>
2412
2413         [LFC][IFC] Remove redundant trailing line break handling.
2414         https://bugs.webkit.org/show_bug.cgi?id=208108
2415         <rdar://problem/59708620>
2416
2417         Reviewed by Antti Koivisto.
2418
2419         LineLayoutContext::layoutLine should be able to handle both cases of trailing line breaks.
2420         (This patch also makes tryAddingInlineItems return explicit IsEndOfLine values.)
2421
2422         * layout/inlineformatting/LineLayoutContext.cpp:
2423         (WebCore::Layout::LineLayoutContext::layoutLine):
2424         (WebCore::Layout::LineLayoutContext::tryAddingInlineItems):
2425
2426 2020-02-24  Zalan Bujtas  <zalan@apple.com>
2427
2428         [LFC][IFC][Floats] Move float handling out of LineBreaker
2429         https://bugs.webkit.org/show_bug.cgi?id=208107
2430         <rdar://problem/59708575>
2431
2432         Reviewed by Antti Koivisto.
2433
2434         LineBreaker should only deal with inline content.
2435
2436         * layout/inlineformatting/InlineLineBreaker.cpp:
2437         (WebCore::Layout::LineBreaker::shouldWrapFloatBox): Deleted.
2438         * layout/inlineformatting/InlineLineBreaker.h:
2439         * layout/inlineformatting/LineLayoutContext.cpp:
2440         (WebCore::Layout::LineLayoutContext::tryAddingFloatItem):
2441
2442 2020-02-24  Antoine Quint  <graouts@webkit.org>
2443
2444         RenderLayerBacking::notifyAnimationStarted calls directly into the old animation controller
2445         https://bugs.webkit.org/show_bug.cgi?id=207979
2446
2447         Reviewed by Simon Fraser.
2448
2449         Only call into CSSAnimationController if the "Web Animations for CSS Animations" flag is disabled.
2450
2451         * rendering/RenderLayerBacking.cpp:
2452         (WebCore::RenderLayerBacking::notifyAnimationStarted):
2453
2454 2020-02-24  Rob Buis  <rbuis@igalia.com>
2455
2456         Handle page closure for stale-while-revalidate revalidations
2457         https://bugs.webkit.org/show_bug.cgi?id=204147
2458
2459         Reviewed by Youenn Fablet.
2460
2461         Add a new hook to LoaderStrategy to signal browsing context removal
2462         and call it when the main frame stops all loaders.
2463
2464         Test: imported/w3c/web-platform-tests/fetch/stale-while-revalidate/frame-removal.html
2465
2466         * loader/FrameLoader.cpp:
2467         (WebCore::FrameLoader::stopAllLoaders):
2468         * loader/LoaderStrategy.h:
2469         * loader/cache/CachedResource.cpp:
2470         (WebCore::CachedResource::canUseCacheValidator const):
2471
2472 2020-02-24  Andres Gonzalez  <andresg_22@apple.com>
2473
2474         Fix for build: follow up to bug 208074.
2475         https://bugs.webkit.org/show_bug.cgi?id=208133
2476
2477         Unreviewed build fix.
2478
2479         No new tests needed.
2480
2481         * accessibility/isolatedtree/AXIsolatedObject.cpp:
2482         (WebCore::AXIsolatedObject::cellForColumnAndRow):
2483
2484 2020-02-24  Philippe Normand  <pnormand@igalia.com>
2485
2486         [GStreamer][WPE] Add GstGLMemoryEGL support for the video-plane-display
2487         https://bugs.webkit.org/show_bug.cgi?id=208046
2488
2489         Reviewed by Žan Doberšek.
2490
2491         The glupload element might fill EGL memories in some cases, so for
2492         the video sink we can then directly access the corresponding
2493         EGLImage and export it to DMABuf, instead of using the more
2494         general GLMemory code path.
2495
2496         With this patch we also ensure that both DMABuf FD and stride are valid.
2497
2498         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2499         (WebCore::GstVideoFrameHolder::GstVideoFrameHolder):
2500         (WebCore::GstVideoFrameHolder::handoffVideoDmaBuf):
2501
2502 2020-02-23  Andres Gonzalez  <andresg_22@apple.com>
2503
2504         AXIsolatedObject support for tables.
2505         https://bugs.webkit.org/show_bug.cgi?id=208074
2506
2507         Reviewed by Chris Fleizach.
2508
2509         Covered by existing tests.
2510
2511         AccessibilityObjectWrapper code and some utility functions in
2512         AccessibilityObject.cpp assume that AX objects can be downcast to a
2513         specialized subclass like AccessibilityTable. That is not true for
2514         AXIsolatedObjects, and the reason why tables don’t work in IsolatedTree
2515         mode.
2516
2517         To solve this problem, this patch exposes the AccessibilityTable
2518         interface as part of the AXCoreObject. Thus it eliminates the need to
2519         downcast an AX object to an AccessibilityTable. It also implements the
2520         AccessibilityTable interface in the AXIsolatedObject class. The same
2521         approach will be used in subsequent patches for other specialized
2522         interfaces used by client code.
2523
2524         * accessibility/AccessibilityARIAGrid.cpp:
2525         (WebCore::AccessibilityARIAGrid::addChildren):
2526         * accessibility/AccessibilityARIAGrid.h:
2527         * accessibility/AccessibilityARIAGridCell.cpp:
2528         (WebCore::AccessibilityARIAGridCell::parentTable const):
2529         (WebCore::AccessibilityARIAGridCell::rowIndexRange const):
2530         (WebCore::AccessibilityARIAGridCell::columnIndexRange const):
2531         * accessibility/AccessibilityARIAGridRow.cpp:
2532         (WebCore::AccessibilityARIAGridRow::disclosedRows):
2533         (WebCore::AccessibilityARIAGridRow::disclosedByRow const):
2534         (WebCore::AccessibilityARIAGridRow::parentTable const):
2535         * accessibility/AccessibilityNodeObject.cpp:
2536         (WebCore::shouldUseAccessibilityObjectInnerText):
2537         * accessibility/AccessibilityObject.cpp:
2538         (WebCore::appendChildrenToArray): Use AXCoreObject interface instead of downcasting.
2539         (WebCore::Accessibility::isAccessibilityObjectSearchMatchAtIndex): Use AXCoreObject interface instead of downcasting.
2540         * accessibility/AccessibilityObject.h:
2541         * accessibility/AccessibilityObjectInterface.h: AXCoreObject now exposes the table interface.
2542         * accessibility/AccessibilityRenderObject.cpp:
2543         (WebCore::AccessibilityRenderObject::ariaSelectedRows):
2544         * accessibility/AccessibilityTable.cpp:
2545         (WebCore::AccessibilityTable::AccessibilityTable):
2546         (WebCore::AccessibilityTable::init):
2547         (WebCore::AccessibilityTable::isExposable const):
2548         (WebCore::AccessibilityTable::addChildren):
2549         (WebCore::AccessibilityTable::headerContainer): Returns an AXCoreObject.
2550
2551         The following methods now return a vector of objects instead of taking
2552         and out parameter. RVO guaranties that this does not cause extra copy.
2553         (WebCore::AccessibilityTable::columns):
2554         (WebCore::AccessibilityTable::rows):
2555         (WebCore::AccessibilityTable::columnHeaders):
2556         (WebCore::AccessibilityTable::rowHeaders):
2557         (WebCore::AccessibilityTable::visibleRows):
2558         (WebCore::AccessibilityTable::cells):
2559
2560         (WebCore::AccessibilityTable::tableLevel const):
2561         (WebCore::AccessibilityTable::roleValue const):
2562         (WebCore::AccessibilityTable::computeAccessibilityIsIgnored const):
2563         (WebCore::AccessibilityTable::title const):
2564         (WebCore::AccessibilityTable::isExposableThroughAccessibility const): Renamed to just isExposable.
2565         * accessibility/AccessibilityTable.h:
2566         (WebCore::AccessibilityTable::supportsSelectedRows): Deleted.
2567         * accessibility/AccessibilityTableCell.cpp:
2568         (WebCore::AccessibilityTableCell::parentTable const):
2569         (WebCore::AccessibilityTableCell::isTableCell const):
2570         (WebCore::AccessibilityTableCell::columnHeaders):
2571         (WebCore::AccessibilityTableCell::rowHeaders):
2572         * accessibility/AccessibilityTableCell.h:
2573         * accessibility/AccessibilityTableColumn.cpp:
2574         (WebCore::AccessibilityTableColumn::headerObject):
2575         (WebCore::AccessibilityTableColumn::addChildren):
2576         * accessibility/AccessibilityTableHeaderContainer.cpp:
2577         (WebCore::AccessibilityTableHeaderContainer::addChildren):
2578         * accessibility/AccessibilityTableRow.cpp:
2579         (WebCore::AccessibilityTableRow::isTableRow const):
2580         (WebCore::AccessibilityTableRow::parentTable const):
2581         * accessibility/atk/WebKitAccessible.cpp:
2582         (webkitAccessibleGetAttributes):
2583         * accessibility/atk/WebKitAccessibleInterfaceTable.cpp:
2584         (webkitAccessibleTableGetColumnHeader):
2585         (webkitAccessibleTableGetRowHeader):
2586         * accessibility/atk/WebKitAccessibleInterfaceTableCell.cpp:
2587         (webkitAccessibleTableCellGetColumnHeaderCells):
2588         (webkitAccessibleTableCellGetRowHeaderCells):
2589         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2590         (-[WebAccessibilityObjectWrapper tableParent]):
2591         (-[WebAccessibilityObjectWrapper accessibilityHeaderElements]):
2592         * accessibility/isolatedtree/AXIsolatedObject.cpp:
2593         (WebCore::AXIsolatedObject::initializeAttributeData):
2594         (WebCore::AXIsolatedObject::setObjectVectorProperty):
2595         (WebCore::AXIsolatedObject::cellForColumnAndRow):
2596         (WebCore::AXIsolatedObject::fillChildrenVectorForProperty const):
2597         (WebCore::AXIsolatedObject::isAccessibilityTableInstance const):
2598         (WebCore::AXIsolatedObject::isDataTable const): Deleted.
2599         * accessibility/isolatedtree/AXIsolatedObject.h:
2600         * accessibility/isolatedtree/AXIsolatedTree.cpp:
2601         (WebCore::AXIsolatedTree::nodeForID const):
2602         (WebCore::AXIsolatedTree::objectsForIDs const):
2603         * accessibility/isolatedtree/AXIsolatedTree.h:
2604         * accessibility/mac/AXObjectCacheMac.mm:
2605         (WebCore::AXObjectCache::postPlatformNotification):
2606         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2607         In addition to replacing the downcast to AccessibilityTable, cleaned up
2608         the unnecessary calls to self.axBackingObject. This used to be a macro,
2609         but it is now a method that check for the execution thread and returns
2610         the appropriate AX object.
2611         (-[WebAccessibilityObjectWrapper additionalAccessibilityAttributeNames]):
2612         (-[WebAccessibilityObjectWrapper ALLOW_DEPRECATED_IMPLEMENTATIONS_END]):
2613         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
2614         (-[WebAccessibilityObjectWrapper _accessibilitySetValue:forAttribute:]):
2615         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
2616
2617 2020-02-23  Adrian Perez de Castro  <aperez@igalia.com>
2618
2619         Non-unified build fixes late February 2020 edition
2620         https://bugs.webkit.org/show_bug.cgi?id=208111
2621
2622         Unreviewed build fix.
2623
2624         No new tests needed.
2625
2626         * dom/WindowEventLoop.cpp: Add missing include.
2627         * html/HTMLEmbedElement.cpp: Ditto.
2628         * html/HTMLFrameSetElement.cpp: Ditto.
2629         * html/HTMLOptionElement.cpp: Ditto.
2630         * html/HTMLTablePartElement.cpp: Ditto.
2631         * html/HTMLTextFormControlElement.cpp: Ditto.
2632         * html/RangeInputType.cpp: Ditto.
2633         * inspector/agents/InspectorCSSAgent.cpp: Ditto.
2634         * loader/ImageLoader.h: Add missing forward declration for WebCore::Document.
2635         * platform/graphics/ImageBuffer.cpp: Add missing include.
2636         * platform/graphics/filters/FilterEffect.cpp: Ditto.
2637         * platform/wpe/ThemeWPE.h: Add missing include and forward declaration for WebCore::Path.
2638         * svg/graphics/filters/SVGFilterBuilder.cpp: Add missing include.
2639
2640 2020-02-23  Darin Adler  <darin@apple.com>
2641
2642         Follow up element iterator work by reducing includes and using is<> in a few more places
2643         https://bugs.webkit.org/show_bug.cgi?id=207816
2644
2645         Reviewed by Antti Koivisto.
2646
2647         * accessibility/AccessibilityTableColumn.cpp: Removed unneeded includes.
2648         * bindings/js/JSDOMWindowCustom.cpp: Ditto.
2649         * dom/CustomElementRegistry.cpp: Ditto.
2650         * dom/Node.cpp: Ditto.
2651         * editing/markup.cpp: Ditto.
2652         * html/GenericCachedHTMLCollection.cpp: Ditto.
2653         * html/HTMLCollection.cpp: Ditto.
2654         * html/HTMLFrameSetElement.cpp: Ditto.
2655         * html/track/TextTrackCue.cpp: Ditto.
2656         * page/scrolling/AxisScrollSnapOffsets.cpp: Ditto.
2657
2658         * platform/DataListSuggestionsClient.h: Reduced includes, use forward declarations.
2659
2660         * style/StyleResolver.cpp:
2661         (WebCore::Style::isAtShadowBoundary): Use the is<ShadowRoot> function.
2662
2663         * rendering/svg/RenderSVGResourceClipper.cpp:
2664         (WebCore::RenderSVGResourceClipper::pathOnlyClipping): Use is<RenderSVGText> and
2665         is<SVGGraphicsElement>, tweak coding style a tiny bit, and fix wording of comments.
2666
2667         * svg/SVGAElement.cpp:
2668         (WebCore::SVGAElement::createElementRenderer): Use is<SVGElement>.
2669
2670         * svg/SVGElement.cpp: Removed unneeded includes.
2671         (WebCore::SVGElement::isOutermostSVGSVGElement): Use is<SVGElement> and
2672         is<SVGForeignObjectElement>.
2673         (WebCore::SVGElement::reportAttributeParsingError): Use is<SVGElement>.
2674         (WebCore::SVGElement::updateRelativeLengthsInformation): Use
2675         is<SVGGraphicsElement> and is<SVGElement>, and use an if statement instead of
2676         a while loop since this doesn't loop.
2677
2678 2020-02-22  Darin Adler  <darin@apple.com>
2679
2680         Fix HTMLDataListElement.options to include even options that are not suggestions
2681         https://bugs.webkit.org/show_bug.cgi?id=208102
2682
2683         Reviewed by Antti Koivisto.
2684
2685         * html/ColorInputType.cpp:
2686         (WebCore::ColorInputType::suggestedColors const): Use
2687         HTMLDataListElement::suggestions instead of HTMLCollection, both for efficiency
2688         and for correctness.
2689
2690         * html/GenericCachedHTMLCollection.cpp:
2691         (WebCore::GenericCachedHTMLCollection<traversalType>::elementMatches const):
2692         Removed code to filter out options that are not valid suggestions. This is not
2693         called for in the HTML specification.
2694
2695         * html/HTMLDataListElement.cpp:
2696         (WebCore::HTMLDataListElement::isSuggestion): Added.
2697
2698         * html/HTMLDataListElement.h: Added isSuggestion and suggestions functions so
2699         logic about which datalist options are suggestions can be easily shared. The
2700         suggestions uses the new filteredDescendants function template.
2701
2702         * html/HTMLInputElement.cpp:
2703         (WebCore::HTMLInputElement::setupDateTimeChooserParameters): Use
2704         HTMLDataListElement::suggestions instead of HTMLCollection.
2705
2706         * html/TextFieldInputType.cpp:
2707         (WebCore::TextFieldInputType::suggestions):  Use
2708         HTMLDataListElement::suggestions instead of HTMLCollection. Also added a FIXME
2709         since this implementation uses case-insensitive ASCII but it's for user interface
2710         and the current implementation might be insufficient for some lanagues.
2711
2712         * rendering/RenderTheme.cpp:
2713         (WebCore::RenderTheme::paintSliderTicks): Use
2714         HTMLDataListElement::suggestions instead of HTMLCollection.
2715
2716 2020-02-22  Darin Adler  <darin@apple.com>
2717
2718         Refine the DOM element iterator implementation
2719         https://bugs.webkit.org/show_bug.cgi?id=208100
2720
2721         Reviewed by Antti Koivisto.
2722
2723         - Removed the duplicate descendant iterator, keeping the one that matches
2724           the style of the ancestor and child iterators.
2725         - Removed the non-template elementAncestors, elementChildren, elementDescendants,
2726           and elementLineage functions and changed callers to use xxxOfType<Element> instead.
2727         - Renamed "IteratorAdapter" templates to "Range", choosing that term to match the
2728           upcoming C++20 Ranges library and range-based for loops.
2729         - Changed the iterators to use an actual "nullptr" for end, following the "sentinel"
2730           design pattern from the Ranges library. Still kept a tiny bit of using an iterator
2731           for end around, only so we can use iterator library functions like std::distance
2732           while waiting for std::ranges::distance, which is compatible with sentinels.
2733         - Implemented const correctness by using const types instead of separate "Const"
2734           class templates. This cut down on source code size a lot. These element iterators
2735           don't need whole separate templates to implement the const correctness the way
2736           collection classes like HashMap do.
2737         - Improved some other details, like using more const and constexpr on members.
2738           All the functions on a range are const, because the range itself doesn't ever
2739           get modified, and all functions on an iterator are also const, because only
2740           operations like ++ and -- actually modify the iterator.
2741         - For now at least, removed extra code we don't need in practice. We never need to
2742           compare iterators to each other except when iterating a range, for example, so
2743           kept the != used for range iteration but not ==.
2744         - Simplified the HTMLCollection implementations by taking advantage of the null-
2745           based and sentinel designs. There are various places where we can write
2746           simpler code and pass around fewer arguments.
2747         - Added a new descendantsOfType template that takes a predicate and filters to only
2748           the elements that match that predicate. Similar concept to how we implement HTML
2749           collections, and possibly could be used even more eventually.
2750         - Use std::iterator in ElementIterator so we don't need to do that in derived
2751           classes. Also made more of ElementIterator protected to make it more explicit
2752           that it's an abstract class template and not something to be used directly.
2753
2754         The most unusual clients of the elmeent ranges and iterators are HTMLCollection and
2755         the related caches, and this patch includes changes to those to adopt the new model.
2756
2757         * Headers.cmake: Removed ElementDescendantIterator.h.
2758         * WebCore.xcodeproj/project.pbxproj: Ditto.
2759
2760         * dom/ChildNodeList.cpp:
2761         (WebCore::ChildNodeList::ChildNodeList): Removed initialization of m_indexCache
2762         since the constructor no longer requires arguments.
2763         (WebCore::ChildNodeList::invalidateCache): Removed argument to
2764         CollectionIndexCache::invalidate.
2765         * dom/ChildNodeList.h: Removed collectionEnd, since it's no longer needed.
2766
2767         * dom/CollectionIndexCache.h: Removed the collection argument to the
2768         constructor, hasValidCache, and invalidate functions. Updated algorithms to use
2769         null style termination instead of actually relying on comparing with an end
2770         iterator, since that works for our element iterators.
2771
2772         * dom/ContainerNode.cpp:
2773         (WebCore::ContainerNode::childElementCount const):: Use an empty initializer
2774         list instead of the result of the end function since std::distance requires
2775         both begin and end iterators have the same type.
2776
2777         * dom/ElementAncestorIterator.h: Made the changes mentioned above, plus moved the
2778         declarations of functions to the top of the file, since the classes are
2779         implementation details, used downcast instead of static_cast.
2780
2781         * dom/ElementAndTextDescendantIterator.h: Renamed IteratorAdapter to Range,
2782         mostly didn't make other changes since this is not one of the element iterators.
2783
2784         * dom/ElementChildIterator.h: Made the changes mentioned above, plus moved the
2785         declarations of functions to the top of the file, since the classes are
2786         implementation details.
2787
2788         * dom/ElementDescendantIterator.h: Removed.
2789
2790         * dom/ElementIterator.h: Made the changes mentioned above.
2791
2792         * dom/LiveNodeList.cpp: Removed some unneeded includes, including HTMLCollection.h.
2793         (WebCore::LiveNodeList::LiveNodeList): Simplified a little bit.
2794         (WebCore::LiveNodeList::rootNode): Moved to the header.
2795
2796         * dom/LiveNodeList.h: Updated since CollectionTraversal now uses the
2797         more modern ElementDescendantIterator, not the older one that used a vector of
2798         ancestors to do the iteration. Also use WTF_MAKE_ISO_NONALLOCATABLE since
2799         LiveNodeList is an abstract class, and made some members protected. Removed
2800         CachedLiveNodeList::rootNode since it was identical to LiveNodeList::rootNode,
2801         and made LiveNodeList::rootNode protected so it can be called in
2802         CachedLiveNodeList, and moved it to the header so it will still be inlined.
2803         Simplified CachedListNodeList to use more final, to name long types less by
2804         using "auto" and "using", and to not pass arguments to functions that don't
2805         need them any more.
2806
2807         * dom/NameNodeList.cpp:
2808         (WebCore::NameNodeList::create): Moved here from the header.
2809         * dom/NameNodeList.h: Removed unneeded includes and comment, moved create
2810         function out of the header.
2811
2812         * dom/TypedElementDescendantIterator.h: Made all the change mentioned above.
2813         Also added a new filteredDescendants function, range, and iterator that uses
2814         a filter function. Not used yet in this patch; use comes in a future one.
2815
2816         * html/CachedHTMLCollection.h: Updated includes, shortened type names,
2817         and used auto to simplify the code a bit. Removed unneeded collection arguments
2818         from various CollectionIndexCache functions.
2819
2820         * html/CollectionTraversal.h: Updated to use the new/typed version of
2821         ElementDescendantIterator. Removed end functions. Use shorter type names.
2822         Tweaked algorithms to use null termination for loops instead of end iterators.
2823
2824         * html/HTMLFormControlsCollection.h:
2825         (WebCore::HTMLFormControlsCollection::item const): Removed unneeded class
2826         template arguments.
2827
2828         * html/HTMLFormElement.cpp:
2829         (WebCore::HTMLFormElement::formElementIndex): Changed to use the null check
2830         instead of comparing iterator with end.
2831         * html/HTMLMediaElement.cpp:
2832         (WebCore::HTMLMediaElement::selectNextSourceChild): Ditto.
2833
2834         * html/HTMLTableSectionElement.cpp:
2835         (WebCore::HTMLTableSectionElement::numRows const): Pass a default-constructed
2836         iterator for end to std::distance. When we get C++20 we can clean this up by
2837         using std::ranges::distances instead.
2838
2839         * html/LabelsNodeList.cpp:
2840         (WebCore::LabelsNodeList::create): Moved here from the header.
2841         * html/LabelsNodeList.h: Removed unneeded include, tweaked coding style a bit,
2842         moved create function into the .cpp file.
2843
2844         * html/RadioNodeList.cpp: Removed unneeded include.
2845         (WebCore::RadioNodeList::create): Moved this here from the header.
2846         (WebCore::nonEmptyRadioButton): Renamed from toRadioButtonInputElement to make
2847         a little clearer what the function does.
2848         (WebCore::RadioNodeList::value const): Updated to use nonEmptyRadioButton and
2849         straighten out the loop a tiny bit.
2850         (WebCore::RadioNodeList::setValue): Ditto.
2851         (WebCore::RadioNodeList::checkElementMatchesRadioNodeListFilter const): Deleted.
2852         (WebCore::RadioNodeList::elementMatches const): Merged in the logic from
2853         checkElementMatchesRadioNodeListFilter, since the separate function wasn't helpful.
2854
2855         * html/RadioNodeList.h: Removed unneeded includes. Moved the create function out
2856         of the header. Removed unneeded override of the item function to tighten the
2857         return type; not used in WebCore and not helpful for bindings. Made more private.
2858
2859         * style/StyleInvalidator.cpp:
2860         (WebCore::Style::Invalidator::invalidateStyleForDescendants): Use null checking
2861         style for the loop rather than comparing with end.
2862         (WebCore::Style::Invalidator::invalidateStyleWithMatchElement): Remove an unneeded
2863         local variable and braces.
2864
2865         * svg/SVGUseElement.cpp:
2866         (WebCore::removeDisallowedElementsFromSubtree): Use null checking style rather than
2867         comparing with end.
2868         (WebCore::SVGUseElement::expandUseElementsInShadowTree const): Ditto. Also use
2869         dropAssertions rather than assigning to end with a comment saying it drops assertions.
2870         (WebCore::SVGUseElement::expandSymbolElementsInShadowTree const): Ditto.
2871
2872 2020-02-22  Darin Adler  <darin@apple.com>
2873
2874         Put more of the datalist element implementation inside ENABLE(DATALIST_ELEMENT)
2875         https://bugs.webkit.org/show_bug.cgi?id=208098
2876
2877         Reviewed by Antti Koivisto.
2878
2879         * html/HTMLFormControlElement.cpp:
2880         (WebCore::HTMLFormControlElement::computeWillValidate const): Use
2881         ancestorsOfType instead of a loop. Since this involves using the class
2882         HTMLDataListElement, it's only implemented when ENABLE(DATALIST_ELEMENT)
2883         is true. The old code would always do this validation for elements with
2884         the datalist tag even if the element is not implemented, so this changes
2885         behavior and affects some test results.
2886
2887 2020-02-22  Jer Noble  <jer.noble@apple.com>
2888
2889         Stop using QTKit for rendering WK1 video fullscreen controls
2890         https://bugs.webkit.org/show_bug.cgi?id=207795
2891         <rdar://problem/48894915>
2892
2893         Reviewed by Jon Lee.
2894
2895         Drive-by fixes:
2896
2897         - Don't set the video layer to not-visible when in video fullscreen mode.
2898         - Export previously un-exported methods.
2899         - Make some ios-only classes available on mac.
2900         - Add a couple previously unimplemented properties to WebAVPlayerController needed by AVKit.
2901         - WebCoreFullscreenWindow doesn't depend on FULLSCREEN_API.
2902
2903         * WebCore.xcodeproj/project.pbxproj:
2904         * html/HTMLMediaElement.cpp:
2905         (WebCore::HTMLMediaElement::visibilityStateChanged):
2906         * html/HTMLMediaElement.h:
2907         (WebCore::HTMLMediaElement::setVideoFullscreenLayer):
2908         * platform/ios/PlaybackSessionInterfaceAVKit.h:
2909         * platform/ios/PlaybackSessionInterfaceAVKit.mm:
2910         (WebCore::PlaybackSessionInterfaceAVKit::externalPlaybackChanged):
2911         * platform/ios/WebAVPlayerController.h:
2912         * platform/ios/WebAVPlayerController.mm:
2913         (-[WebAVPlayerController canSeekFrameBackward]):
2914         (-[WebAVPlayerController canSeekFrameForward]):
2915         * platform/mac/WebCoreFullScreenWindow.h:
2916         * platform/mac/WebCoreFullScreenWindow.mm:
2917
2918 2020-02-22  Darin Adler  <darin@apple.com>
2919
2920         Use DOM element iterators more, and more consistently
2921         https://bugs.webkit.org/show_bug.cgi?id=208097
2922
2923         Reviewed by Antti Koivisto.
2924
2925         - Added uses of element iterators in many places that had hand-written loops.
2926         - Eliminated most uses of elementAncestors, elementChildren, elementDescendants,
2927           and elementLineage functions and use ancestorsOfType<Element>,
2928           childrenOfType<Element>, descendantsOfType<Element> and lineageOfType<Element>
2929           instead. In particular, descendantsOfType<Element> uses a better traversal
2930           algorithm than elementDescendants does.
2931
2932         - Unrelated: Omit template arguments in various cases where the C++ language lets
2933           us just give the name of the class template without repeating the arguments.
2934         - Unrelated: Remove some uses of the inefficient Node::nodeType function.
2935
2936         * accessibility/AccessibilityNodeObject.cpp:
2937         (WebCore::AccessibilityNodeObject::mouseButtonListener const): Use
2938         lineageOfType instead of elementLineage.
2939
2940         * accessibility/AccessibilityRenderObject.cpp:
2941         (WebCore::AccessibilityRenderObject::accessibilityImageMapHitTest const):
2942         Use ancestorsOfType instead of a handwritten loop.
2943
2944         * dom/AllDescendantsCollection.h:
2945         (WebCore::AllDescendantsCollection::AllDescendantsCollection): Removed
2946         class template arguments.
2947         * dom/ClassCollection.h:
2948         (WebCore::ClassCollection::ClassCollection): Ditto.
2949
2950         * dom/DocumentFragment.cpp:
2951         (WebCore::DocumentFragment::getElementById const): Use
2952         descendantsOfType insteadof elementDescendants.
2953
2954         * dom/Element.cpp:
2955         (WebCore::Element::computeInheritedLanguage const): Use lineageOfType
2956         instead of a handrwitten loop.
2957
2958         * dom/SelectorQuery.cpp:
2959         (WebCore::SelectorDataList::closest const): Use lineageOfType instead of an
2960         explicit loop.
2961         (WebCore::elementsForLocalName): Use descendantsOfType instead of elementDescendants.
2962         (WebCore::anyElement): Ditto.
2963         (WebCore::SelectorDataList::executeSingleTagNameSelectorData const): Ditto.
2964         (WebCore::SelectorDataList::executeSingleClassNameSelectorData const): Ditto.
2965         (WebCore::SelectorDataList::executeSingleSelectorData const): Ditto.
2966         (WebCore::SelectorDataList::executeSingleMultiSelectorData const): Ditto.
2967         (WebCore::SelectorDataList::executeCompiledSimpleSelectorChecker const): Ditto.
2968         (WebCore::SelectorDataList::executeCompiledSelectorCheckerWithCheckingContext const): Ditto.
2969         (WebCore::SelectorDataList::executeCompiledSingleMultiSelectorData const): Ditto.
2970
2971         * dom/TagCollection.cpp:
2972         (WebCore::TagCollectionNS::TagCollectionNS): Removed class template arguments.
2973         (WebCore::TagCollection::TagCollection): Ditto.
2974         (WebCore::HTMLTagCollection::HTMLTagCollection): Ditto.
2975
2976         * editing/Editor.cpp:
2977         (WebCore::Editor::applyEditingStyleToBodyElement const): Use the function
2978         descendantsOfType<HTMLBodyElement> instead of getElementByTagName(bodyTag).
2979         Also merged applyEditingStyleToElement in here.
2980         (WebCore::Editor::applyEditingStyleToElement const): Deleted.
2981
2982         * editing/Editor.h: Deleted applyEditingStyleToElement.
2983
2984         * editing/FrameSelection.cpp:
2985         (WebCore::scanForForm): Cleaned up descendantsOfType loop so there's no
2986         explicit use of end. Also changed if nesting a little bit.
2987
2988         * editing/TextManipulationController.cpp:
2989         (WebCore::ExclusionRuleMatcher::isExcluded): Use lineageOfType instead of
2990         elementLineage.
2991
2992         * html/HTMLAllCollection.h: Removed class template arguments.
2993
2994         * html/HTMLElement.cpp:
2995         (WebCore::elementAffectsDirectionality): Refactored so we get a more efficient
2996         implementation when the type of the element is known.
2997         (WebCore::HTMLElement::adjustDirectionalityIfNeededAfterChildAttributeChanged):
2998         Use lineageOfType instead of elementLineage.
2999
3000         * html/HTMLElement.h: Removed some uneeeded forward declarations.
3001
3002         * html/HTMLEmbedElement.cpp:
3003         (WebCore::findWidgetRenderer): Use ancestorsOfType instead of a loop.
3004
3005         * html/HTMLFormControlElement.cpp:
3006         (WebCore::HTMLFormControlElement::enclosingFormControlElement): Deleted.
3007
3008         * html/HTMLFormControlElement.h: Deleted unused enclosingFormControlElement.
3009
3010         * html/HTMLFormControlsCollection.cpp:
3011         (WebCore::HTMLFormControlsCollection::HTMLFormControlsCollection): Removed
3012         class template arguments.
3013         (WebCore::HTMLFormControlsCollection::ownerNode const): Ditto.
3014         (WebCore::HTMLFormControlsCollection::invalidateCacheForDocument): Ditto.
3015
3016         * html/HTMLOptGroupElement.cpp:
3017         (WebCore::HTMLOptGroupElement::ownerSelectElement const): Use ancestorsOfType
3018         instead of a hand-written loop.
3019
3020         * html/HTMLOptionElement.cpp:
3021         (WebCore::HTMLOptionElement::parseAttribute): Use ancestorsOfType instead of
3022         calling ownerDataListElement.
3023         (WebCore::HTMLOptionElement::childrenChanged): Ditto.
3024         (WebCore::HTMLOptionElement::ownerDataListElement const): Deleted. Since the
3025         same option element can be used by multiple nested data list elements, the
3026         concept of a single "owner" data list element isn't correct.
3027         (WebCore::HTMLOptionElement::ownerSelectElement const): Use ancestorsOfType
3028         instead of a hand-written loop.
3029
3030         * html/HTMLOptionElement.h: Deleted ownerDataListElement.
3031
3032         * html/HTMLOptionsCollection.cpp:
3033         (WebCore::HTMLOptionsCollection::HTMLOptionsCollection): Removed class
3034         template arguments.
3035
3036         * html/HTMLTableCellElement.cpp:
3037         (WebCore::HTMLTableCellElement::additionalPresentationAttributeStyle const):
3038         Use auto since findParentTable now returns a const table pointer.
3039         * html/HTMLTableColElement.cpp:
3040         (WebCore::HTMLTableColElement::additionalPresentationAttributeStyle const):
3041         Ditto.
3042
3043         * html/HTMLTableElement.cpp:
3044         (WebCore::HTMLTableElement::createSharedCellStyle): Made const.
3045         (WebCore::HTMLTableElement::additionalCellStyle): Ditto.
3046         (WebCore::HTMLTableElement::additionalGroupStyle): Ditto.
3047
3048         * html/HTMLTableElement.h: Made the functions const, and m_sharedCellStyle
3049         mutable.
3050
3051         * html/HTMLTablePartElement.cpp:
3052         (WebCore::HTMLTablePartElement::findParentTable const): Use ancestorsOfType
3053         instead of a hand-written loop. Also revised return type to be const-consistent.
3054
3055         * html/HTMLTablePartElement.h: Updated return type.
3056
3057         * html/HTMLTableRowsCollection.cpp:
3058         (WebCore::HTMLTableRowsCollection::HTMLTableRowsCollection): Removed class
3059         template arguments.
3060
3061         * html/HTMLTextFormControlElement.cpp:
3062         (WebCore::parentHTMLElement): Deleted.
3063         (WebCore::HTMLTextFormControlElement::directionForFormData const): Use
3064         lineageOfType rather than a hand-written loop. Also got rid of the multiple
3065         strings in return paths since the function always returns one of two strings.
3066
3067         * inspector/InspectorAuditAccessibilityObject.cpp:
3068         (WebCore::InspectorAuditAccessibilityObject::getElementsByComputedRole):
3069         Use descendantsOfType instead of elementDescendants.
3070
3071         * inspector/agents/InspectorCSSAgent.cpp:
3072         (WebCore::InspectorCSSAgent::getMatchedStylesForNode): Use ancestorsOfType
3073         instead of a hand-written loop.
3074
3075         * inspector/agents/InspectorDOMAgent.cpp:
3076         (WebCore::InspectorDOMAgent::inspect): Use isElementNode and isDocumentNode
3077         instead of the much slower nodeType.
3078         (WebCore::InspectorDOMAgent::highlightMousedOverNode): Use isTextNode instead of
3079         the much slower nodeType.
3080
3081         * page/DragController.cpp:
3082         (WebCore::containingLinkElement): Added. Uses lineageOfType instead of elementLineage.
3083         (WebCore::DragController::doSystemDrag): Updated for the above.
3084
3085         * rendering/svg/SVGRenderSupport.cpp:
3086         (WebCore::SVGRenderSupport::updateMaskedAncestorShouldIsolateBlending):
3087         Use ancestorsOfType instead of a hand-written loop.
3088
3089         * svg/SVGElement.h: Make computedStyle public so we can use it even after downcasting
3090         to SVGElement or a class derived from it. This arises in the revised version of
3091         SVGRenderSupport::updateMaskedAncestorShouldIsolateBlending, which will now be able
3092         to compile a non-virtual call to the function as a bonus.
3093
3094         * xml/parser/XMLDocumentParser.cpp:
3095         (WebCore::findXMLParsingNamespaces): Factored this function out from
3096         parseDocumentFragment. Use lineageOfType instead of elementLineage. Also add a null
3097         check that seems to have been needed before.
3098         (WebCore::XMLDocumentParser::parseDocumentFragment): Use findXMLParsingNamespaces.
3099
3100 2020-02-22  Darin Adler  <darin@apple.com>
3101
3102         Some small improvements to DOM bindings for HTML collections
3103         https://bugs.webkit.org/show_bug.cgi?id=208092
3104
3105         Reviewed by Antti Koivisto.
3106
3107         * WebCore.xcodeproj/project.pbxproj: Added RadioNodeList.idl.
3108
3109         * html/HTMLAllCollection.idl: Specify [RequiresExistingAtomString] on the
3110         argument to namedItem, and [AtomString] for the argument to item.
3111         * html/HTMLCollection.idl: Ditto.
3112         * html/HTMLFormControlsCollection.idl: Ditto.
3113         * html/HTMLOptionsCollection.idl: Ditto.
3114         * html/HTMLSelectElement.idl: Ditto.
3115
3116         * html/RadioNodeList.idl: Removed unneeded getter; the inherited one from NodeList
3117         works correctly, and this isn't more efficient because of a more specific type.
3118
3119 2020-02-21  Wenson Hsieh  <wenson_hsieh@apple.com>
3120
3121         Remove an unused local variable after r256808
3122         https://bugs.webkit.org/show_bug.cgi?id=208072
3123
3124         Reviewed by Chris Dumez.
3125
3126         Remove scriptsToExecuteSoon.
3127
3128         * dom/ScriptRunner.cpp:
3129         (WebCore::ScriptRunner::timerFired):
3130
3131 2020-02-21  Said Abou-Hallawa  <sabouhallawa@apple.com>
3132
3133         Create a new ImageBuffer type for drawing on a DisplayList
3134         https://bugs.webkit.org/show_bug.cgi?id=207109
3135
3136         Reviewed by Simon Fraser.
3137
3138         DisplayList::ImageBuffer inherits ConcreteImageBuffer and DrawingContext.
3139         The drawing context will be the context of DrawingContext. The operations
3140         of ConcreteImageBuffer will have to ensure the recorded display-list is
3141         replayed back before getting the pixels of the ImageBufferBackend.
3142
3143         * Sources.txt:
3144         * WebCore.xcodeproj/project.pbxproj:
3145
3146         * html/HTMLCanvasElement.cpp:
3147         (WebCore::HTMLCanvasElement::createContext2d):
3148         (WebCore::HTMLCanvasElement::setUsesDisplayListDrawing):
3149         (WebCore::HTMLCanvasElement::setTracksDisplayListReplay):
3150         (WebCore::HTMLCanvasElement::displayListAsText const):
3151         (WebCore::HTMLCanvasElement::replayDisplayListAsText const):
3152         All the DisplayList operations will be routed to the DrawingContext of
3153         the ImageBuffer.
3154
3155         (WebCore::HTMLCanvasElement::createImageBuffer const):
3156         createImageBuffer() can decide the ImageBuffer type based on the settings
3157         and the size of the canvas.
3158
3159         * html/HTMLCanvasElement.h:
3160         * platform/graphics/ConcreteImageBuffer.h:
3161         (WebCore::ConcreteImageBuffer::create):
3162         The type of the ImageBuffer will be passed to this function such that
3163         it can create instances of derived classes.
3164
3165         * platform/graphics/ImageBuffer.cpp:
3166         (WebCore::ImageBuffer::create):
3167         Create ImageBuffers which record the drawing commands to DisplayLists before
3168         committing them to the back-ends.
3169
3170         * platform/graphics/ImageBuffer.h:
3171         (WebCore::ImageBuffer::drawingContext):
3172         (WebCore::ImageBuffer::flushDrawingContext):
3173         Add virtual methods to support DisplayList in ImageBuffer.
3174
3175         * platform/graphics/PlatformImageBuffer.h:
3176         * platform/graphics/RenderingMode.h:
3177         Add DisplayList types to RenderingMode and define platform types for
3178         DisplayList ImageBuffers.
3179
3180         * platform/graphics/displaylists/DisplayListDrawingContext.cpp: Added.
3181         (WebCore::DisplayList::DrawingContext::DrawingContext):
3182         (WebCore::DisplayList::DrawingContext::setTracksDisplayListReplay):
3183         (WebCore::DisplayList::DrawingContext::replayDisplayList):
3184         * platform/graphics/displaylists/DisplayListDrawingContext.h: Added.
3185         (WebCore::DisplayList::DrawingContext::context const):
3186         (WebCore::DisplayList::DrawingContext::displayList):
3187         (WebCore::DisplayList::DrawingContext::displayList const):
3188         (WebCore::DisplayList::DrawingContext::replayedDisplayList const):
3189         DisplayList::DrawingContext holds a recording and an optional replaying 
3190         back DisplayLists. It also provides a recording GraphicsContext.
3191
3192         * platform/graphics/displaylists/DisplayListImageBuffer.h: Added.
3193         (WebCore::DisplayList::ImageBuffer::create):
3194         (WebCore::DisplayList::ImageBuffer::ImageBuffer):
3195         (WebCore::DisplayList::ImageBuffer::~ImageBuffer):
3196         Drawing commands will be recorded first because context() is overridden
3197         to return the GraphicsContext of DrawingContext. These drawing commands
3198         will be flushed before getting the pixels of the back-end because 
3199         flushDrawingContext() is overridden to replay back the recorded DisplayList
3200         to the GraphicsContext of the back-end.
3201
3202 2020-02-21  Wenson Hsieh  <wenson_hsieh@apple.com>
3203
3204         [macOS] Large form controls are rendered at the wrong NSControlSize
3205         https://bugs.webkit.org/show_bug.cgi?id=208043
3206         <rdar://problem/59659134>
3207
3208         Reviewed by Tim Horton.
3209
3210         When painting form controls that are larger than a certain threshold (for the most part, 21px), use
3211         NSControlSizeLarge instead of NSControlSizeRegular. This makes us choose a more appropriate appearance when
3212         painting native large form controls, as long as the system supports it. Note that not all the metrics for
3213         NSControlSizeLarge form controls are finalized, as noted in the per-method comments below.
3214
3215         With this patch alone, there is no change in behavior yet; in the near future, these changes will be covered by
3216         new platform-specific baselines.
3217
3218         * platform/PopupMenuStyle.h: Add a new PopupMenuSizeLarge that corresponds to a popup that has NSControlSizeLarge.
3219         * platform/mac/ThemeMac.h: Add a helper to check (at runtime) whether the new large form control size is enabled.
3220         * platform/mac/ThemeMac.mm:
3221         (WebCore::controlSizeForFont): Add a new font size breakpoint, for which we use NSControlSizeLarge instead of
3222         NSControlSizeRegular.
3223
3224         (WebCore::sizeFromNSControlSize):
3225         (WebCore::sizeFromFont):
3226         (WebCore::controlSizeFromPixelSize):
3227         (WebCore::setControlSize):
3228         (WebCore::checkboxSizes): Reflect the fact that checkboxes with NSControlSizeLarge are 16 by 16.
3229         (WebCore::checkboxMargins): Just match NSControlSizeRegular margins for now. These seem incorrect already, even
3230         for NSControlSizeRegular in macOS 10.15.
3231
3232         (WebCore::radioSizes): Reflect the fact that radio buttons with NSControlSizeLarge are 16 by 16, and
3233         NSControlSizeRegular radio buttons are 14 by 14.
3234
3235         (WebCore::radioMargins): Just match NSControlSizeRegular margins for now. These seem incorrect already, even for
3236         NSControlSizeRegular in macOS 10.15.
3237
3238         (WebCore::buttonSizes): Reflect the fact that buttons with NSControlSizeLarge are 28px tall.
3239         (WebCore::buttonMargins): Just match NSControlSizeRegular margins for now, and add a FIXME about updating them.
3240         (WebCore::setUpButtonCell):
3241         (WebCore::stepperSizes): NSControlSizeLarge matches NSControlSizeRegular at the moment.
3242         (WebCore::stepperControlSizeForFont): Add a new font size breakpoint for using NSControlSizeLarge.
3243         * rendering/RenderThemeMac.mm:
3244         (WebCore::RenderThemeMac::controlSizeForFont const):
3245         (WebCore::RenderThemeMac::controlSizeForCell const):
3246         (WebCore::RenderThemeMac::controlSizeForSystemFont const):
3247         (WebCore::RenderThemeMac::popupButtonMargins const):
3248         (WebCore::RenderThemeMac::popupButtonSizes const):
3249         (WebCore::RenderThemeMac::popupButtonPadding const):
3250
3251         NSControlSizeLarge metrics for popup buttons cannot be determined yet.
3252
3253         (WebCore::RenderThemeMac::progressBarSizes const):
3254         (WebCore::RenderThemeMac::progressBarMargins const):
3255         (WebCore::RenderThemeMac::paintProgressBar):
3256
3257         NSControlSizeLarge matches NSControlSizeRegular at the moment.
3258
3259         (WebCore::menuListButtonSizes):
3260         (WebCore::RenderThemeMac::popupMenuSize const):
3261         (WebCore::RenderThemeMac::menuListSizes const):
3262         (WebCore::RenderThemeMac::searchFieldSizes const):
3263         (WebCore::RenderThemeMac::cancelButtonSizes const):
3264         (WebCore::RenderThemeMac::resultsButtonSizes const):
3265
3266         Search field results and cancel buttons have the same size in NSControlSizeLarge as in NSControlSizeRegular.
3267
3268 2020-02-21  Michael Catanzaro  <mcatanzaro@gnome.org>
3269
3270         [WPE][GTK] googleapis.com is a public suffix, defeating isGoogle() check in UserAgentQuirks.cpp
3271         https://bugs.webkit.org/show_bug.cgi?id=207984
3272
3273         Reviewed by Daniel Bates.
3274
3275         Fix the check for googleapis.com. Since it's now a public suffix, we can no longer check the
3276         URL's base domain here. Instead, we can check endsWith().
3277
3278         I considered switching to endsWith() for all the checks in this file, to make our user agent
3279         quirks robust to future changes in the public suffix list, but checking the base domain is
3280         nicer and it seems unnecessary. We can continue to adjust our quirks in the future as
3281         necessary.
3282
3283         The public suffix list:
3284         https://github.com/publicsuffix/list/blob/7922d7c20e246552be418e8f72e577899fd30d99/public_suffix_list.dat#L11922
3285
3286         * platform/UserAgentQuirks.cpp:
3287         (WebCore::isGoogle):
3288
3289 2020-02-21  Simon Fraser  <simon.fraser@apple.com>
3290
3291         [Web Animations] Repeated animations on pseudo elements will fail to run after a while
3292         https://bugs.webkit.org/show_bug.cgi?id=207993
3293         <rdar://problem/59428472>
3294
3295         Reviewed by Zalan Bujtas.
3296
3297         We failed to clear PseudoElement* from AnimationTimeline's various HashMaps on destruction,
3298         causing animations to fail to run when those pointer addresses were reused.
3299
3300         Make DeclarativeAnimation::owningElement() be a WeakPtr<>.
3301
3302         Test: animations/many-pseudo-animations.html
3303
3304         * animation/AnimationTimeline.cpp:
3305         (WebCore::AnimationTimeline::willDestoryRendererForElement):
3306         (WebCore::AnimationTimeline::elementWasRemoved):
3307         * animation/AnimationTimeline.h:
3308         * animation/DeclarativeAnimation.cpp:
3309         (WebCore::DeclarativeAnimation::DeclarativeAnimation):
3310         (WebCore::DeclarativeAnimation::enqueueDOMEvent):
3311         * animation/DeclarativeAnimation.h:
3312         (WebCore::DeclarativeAnimation::owningElement const):
3313         * dom/Element.cpp:
3314         (WebCore::Element::removedFromAncestor):
3315         * dom/PseudoElement.cpp:
3316         (WebCore::PseudoElement::clearHostElement):
3317         * rendering/updating/RenderTreeUpdater.cpp:
3318         (WebCore::RenderTreeUpdater::tearDownRenderers):
3319
3320 2020-02-21  Lauro Moura  <lmoura@igalia.com>
3321
3322         [GStreamer] TextCombinerGStreamer is failing to compile with Gst1.14
3323         https://bugs.webkit.org/show_bug.cgi?id=208041
3324
3325         Reviewed by Xabier Rodriguez-Calvar.
3326
3327         Replace usage of gst_clear_object and gst_clear_tag_list with previous
3328         *_unref functions. The clear versions were added in 1.16 while Ubuntu
3329         18.04 (current LTS) and Debian stable uses 1.14.
3330
3331         * platform/graphics/gstreamer/TextCombinerGStreamer.cpp:
3332         (webkitTextCombinerPadDispose):
3333
3334 2020-02-21  Carlos Alberto Lopez Perez  <clopez@igalia.com>
3335
3336         Value sanitization for input[type=text] should not truncate a value at a control character
3337         https://bugs.webkit.org/show_bug.cgi?id=207900
3338
3339         Reviewed by Darin Adler.
3340
3341         Stop truncating value at a control character. The new behavior is compatible with Chrome and Firefox.
3342         Inspired on Chromium patch https://codereview.chromium.org/189843008
3343
3344         Covered by existing tests: affected layout tests are modified to reflect the new behaviour.
3345         This improves WPT pass-rate in around 49K new subtest passes for Japanesse encoding tests.
3346
3347         * html/TextFieldInputType.cpp:
3348         (WebCore::limitLength):
3349
3350 2020-02-21  Carlos Garcia Campos  <cgarcia@igalia.com>
3351
3352         [WPE] Use custom theme style for media controls
3353         https://bugs.webkit.org/show_bug.cgi?id=208002
3354
3355         Reviewed by Adrian Perez de Castro.
3356
3357         Add mediaControlsAdwaita.css and mediaControlsAdwaita.js. The style is based on GTK port with a few differences:
3358
3359           - Adwaita icons are included in the css.
3360           - All buttons have effects for hover, pressed and disabled states.
3361           - Mute and fullscreen (only for videos) buttons are always visible, but disabled when not available to avoid
3362             the dancing when they are shown.
3363           - Media duration is always shown too (for non-live streams), being 00:00 and disabled when unknown, for the
3364             same reason.
3365           - Timeline and volume sliders are smaller and their thumbs are circled instead of rounded rectangles.
3366           - Slider thumbs also have effects for hover, pressed and disabled states.
3367
3368         * Modules/mediacontrols/mediaControlsAdwaita.css: Added.
3369         (audio::-webkit-media-controls-panel.hidden,):
3370         (body:-webkit-full-page-media):
3371         (audio):
3372         (audio:-webkit-full-page-media,):
3373         (audio:-webkit-full-page-media::-webkit-media-controls-panel,):
3374         (::-webkit-media-controls):
3375         (audio::-webkit-media-controls-enclosure,):
3376         (video::-webkit-media-controls-enclosure):
3377         (audio::-webkit-media-controls-panel,):
3378         (video::-webkit-media-controls-panel):
3379         (video::-webkit-media-controls-panel div.mute-box,):
3380         (audio::-webkit-media-controls-panel div.mute-box.hidden,):
3381         (audio::-webkit-media-controls-mute-button,):
3382         (audio::-webkit-media-controls-mute-button.muted,):
3383         (audio::-webkit-media-controls-play-button,):
3384         (audio::-webkit-media-controls-play-button.paused,):
3385         (audio::-webkit-media-controls-current-time-display,):
3386         (audio::-webkit-media-controls-current-time-display.no-duration,):
3387         (audio::-webkit-media-controls-current-time-display.hidden,):
3388         (audio::-webkit-media-controls-timeline,):
3389         (input[type="range"][disabled]::-webkit-media-slider-thumb,):
3390         (audio::-webkit-media-controls-timeline.hidden,):
3391         (audio::-webkit-media-controls-volume-slider-container,):
3392         (audio::-webkit-media-controls-volume-slider-container.hiding,):
3393         (audio::-webkit-media-controls-volume-slider-container.down,):
3394         (audio::-webkit-media-controls-panel .hiding.down,):
3395         (audio::-webkit-media-controls-volume-slider,):
3396         (audio::-webkit-media-controls-volume-slider-container input[type="range"]::-webkit-media-slider-container > div,):
3397         (input[type="range"]::-webkit-media-slider-container):
3398         (input[type="range"]::-webkit-media-slider-container > div):
3399         (input[type="range"]::-webkit-media-slider-thumb):
3400         (audio::-webkit-media-controls-toggle-closed-captions-button,):
3401         (audio::-webkit-media-controls-toggle-closed-captions-button.hidden,):
3402         (video::-webkit-media-controls-closed-captions-container):
3403         (video::-webkit-media-controls-closed-captions-container.out):
3404         (video::-webkit-media-controls-closed-captions-container.hidden):
3405         (video::-webkit-media-controls-closed-captions-container h3):
3406         (video::-webkit-media-controls-closed-captions-container ul):
3407         (video::-webkit-media-controls-closed-captions-container li):
3408         (video::-webkit-media-controls-closed-captions-container li.selected):
3409         (audio::-webkit-media-controls-fullscreen-button,):
3410         (audio::-webkit-media-controls-fullscreen-button.hidden,):
3411         (audio::-webkit-media-controls-panel button:hover,):
3412         (audio::-webkit-media-controls-panel button:active,):
3413         (audio::-webkit-media-controls-panel button[disabled],):
3414         * Modules/mediacontrols/mediaControlsAdwaita.js: Added.
3415         (createControls):
3416         (ControllerAdwaita):
3417         (contains):
3418         (ControllerAdwaita.prototype.createControls):
3419         (ControllerAdwaita.prototype.configureInlineControls):
3420         (ControllerAdwaita.prototype.shouldHaveControls):
3421         (ControllerAdwaita.prototype.reconnectControls):
3422         (ControllerAdwaita.prototype.setStatusHidden):
3423         (ControllerAdwaita.prototype.updateTime):
3424         (ControllerAdwaita.prototype.handleTimeUpdate):
3425         (ControllerAdwaita.prototype.updateHasAudio):
3426         (ControllerAdwaita.prototype.handleMuteButtonMouseOver):
3427         (ControllerAdwaita.prototype.handleVolumeBoxMouseOut):
3428         (ControllerAdwaita.prototype.removeControls):
3429         (ControllerAdwaita.prototype.addControls):
3430         (ControllerAdwaita.prototype.updateFullscreenButton):
3431         (ControllerAdwaita.prototype.updateReadyState):
3432         (ControllerAdwaita.prototype.updateDuration):
3433         (ControllerAdwaita.prototype.setIsLive):
3434         (ControllerAdwaita.prototype.updatePlaying):
3435         (ControllerAdwaita.prototype.updateProgress):
3436         (ControllerAdwaita.prototype.handleCaptionButtonClicked):
3437         (ControllerAdwaita.prototype.buildCaptionMenu):
3438         (ControllerAdwaita.prototype.destroyCaptionMenu):
3439         (ControllerAdwaita.prototype.showCaptionMenu):
3440         (ControllerAdwaita.prototype.hideCaptionMenu):
3441         (ControllerAdwaita.prototype.captionMenuTransitionEnd):
3442         (ControllerAdwaita.prototype.handleCaptionButtonMouseOver):
3443         (ControllerAdwaita.prototype.handleCaptionButtonShowMenu):
3444         (ControllerAdwaita.prototype.handleCaptionButtonMouseOut):
3445         (ControllerAdwaita.prototype.handleCaptionMouseOut):
3446         * Modules/mediacontrols/mediaControlsBase.js:
3447         * PlatformWPE.cmake: