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