REGRESSION (r245170): gmail.com inbox table header flickers
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-05-17  Sihui Liu  <sihui_liu@apple.com>
2
3         ASSERTION FAILED: !m_backingStore in WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore(uint64_t)
4         https://bugs.webkit.org/show_bug.cgi?id=197741
5         <rdar://problem/50625006>
6
7         Reviewed by Youenn Fablet.
8
9         If an open request is made before a delete request, open task should be performed before delete task on the
10         database thread. After r242911, open request needs to wait decision of StorageQuotaManager before posting task
11         to database thread, while delete request needs not. This makes deletion happen before open.
12
13         We need to make sure tasks are in correct order by not starting next open or delete request when database is in 
14         the middle of open or deletion.
15
16         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
17         (WebCore::IDBServer::UniqueIDBDatabase::performCurrentOpenOperation):
18         (WebCore::IDBServer::UniqueIDBDatabase::handleDatabaseOperations):
19
20 2019-05-17  Antoine Quint  <graouts@apple.com>
21
22         Add a website policy to disable the legacy -webkit-overflow-scrolling:touch behavior
23         https://bugs.webkit.org/show_bug.cgi?id=197943
24         <rdar://problem/49078202>
25
26         Reviewed by Brent Fulgham.
27
28         Tests: fast/scrolling/ipad/overflow-scrolling-touch-enabled-stacking-modern-compatibility-mode.html
29                platform/ipad/fast/css/webkit-overflow-scrolling-parsing-modern-compatibility-mode.html
30
31         * css/parser/CSSParserContext.cpp:
32         (WebCore::CSSParserContext::CSSParserContext):
33         * loader/DocumentLoader.h:
34         (WebCore::DocumentLoader::legacyOverflowScrollingTouchPolicy const):
35         (WebCore::DocumentLoader::setLegacyOverflowScrollingTouchPolicy):
36
37 2019-05-17  Alex Christensen  <achristensen@webkit.org>
38
39         Add SPI to set a list of hosts to which to send custom header fields cross-origin
40         https://bugs.webkit.org/show_bug.cgi?id=197397
41
42         Reviewed by Geoff Garen.
43
44         In r223001 I added the ability to send custom headers, but with a restriction that they will not be sent except to the origin of the main document.
45         We need the ability to specify what origins to send these headers to even if they are not first party requests.
46         We get this information in a list of strings which are the hosts to send the headers to.  Some of the strings have an asterisk at the beginning,
47         indicating that the headers are to be sent to all subdomains.
48
49         I repurposed some ObjC SPI that was never adopted, but I keep testing the C API that was to verify no regression.
50         I also added some new API tests for the new behavior.
51
52         * Sources.txt:
53         * WebCore.xcodeproj/project.pbxproj:
54         * loader/CustomHeaderFields.cpp: Added.
55         (WebCore::CustomHeaderFields::thirdPartyDomainsMatch const):
56         * loader/CustomHeaderFields.h: Added.
57         (WebCore::CustomHeaderFields::encode const):
58         (WebCore::CustomHeaderFields::decode):
59         * loader/DocumentLoader.cpp:
60         (WebCore::DocumentLoader::setCustomHeaderFields): Deleted.
61         * loader/DocumentLoader.h:
62         (WebCore::DocumentLoader::setCustomHeaderFields):
63         (WebCore::DocumentLoader::customHeaderFields const):
64         (WebCore::DocumentLoader::customHeaderFields): Deleted.
65         * loader/cache/CachedResourceLoader.cpp:
66         (WebCore::CachedResourceLoader::requestResource):
67
68 2019-05-17  Youenn Fablet  <youenn@apple.com>
69
70         Make AVVideoCaptureSource more robust to configuration failures
71         https://bugs.webkit.org/show_bug.cgi?id=197997
72         rdar://problem/50875662
73
74         Reviewed by Eric Carlson.
75
76         Covered by manual testing.
77
78         * platform/mediastream/mac/AVVideoCaptureSource.mm:
79         (WebCore::AVVideoCaptureSource::setSessionSizeAndFrameRate):
80         Make sure to commit configuration once calling beginConfiguration.
81         In case of error in setting frame rate, log the error but continue capturing.
82
83 2019-05-17  Rob Buis  <rbuis@igalia.com>
84
85         Implement imagesrcset and imagesizes attributes on link rel=preload
86         https://bugs.webkit.org/show_bug.cgi?id=192950
87
88         Reviewed by Youenn Fablet.
89
90         Implement imagesrcset and imagesizes attributes for both Link header
91         and link element.
92
93         Tests: imported/w3c/web-platform-tests/preload/dynamic-adding-preload-imagesrcset.html
94                imported/w3c/web-platform-tests/preload/link-header-preload-delay-onload.html
95                imported/w3c/web-platform-tests/preload/link-header-preload-imagesrcset.html
96                imported/w3c/web-platform-tests/preload/link-header-preload-nonce.html
97                imported/w3c/web-platform-tests/preload/link-header-preload.html
98                imported/w3c/web-platform-tests/preload/onload-event.html
99                imported/w3c/web-platform-tests/preload/preload-with-type.html
100
101         * html/HTMLAttributeNames.in:
102         * html/HTMLLinkElement.cpp:
103         (WebCore::HTMLLinkElement::process):
104         * html/HTMLLinkElement.idl:
105         * loader/LinkHeader.cpp:
106         (WebCore::paramterNameFromString):
107         (WebCore::LinkHeader::setValue):
108         (WebCore::LinkHeader::LinkHeader):
109         * loader/LinkHeader.h:
110         (WebCore::LinkHeader::imageSrcSet const):
111         (WebCore::LinkHeader::imageSizes const):
112         (WebCore::LinkHeader::isViewportDependent const):
113         * loader/LinkLoader.cpp:
114         (WebCore::LinkLoader::loadLinksFromHeader):
115         (WebCore::LinkLoader::preloadIfNeeded):
116         (WebCore::LinkLoader::loadLink):
117         * loader/LinkLoader.h:
118
119 2019-05-17  Keith Rollin  <krollin@apple.com>
120
121         Re-enable generate-xcfilelists
122         https://bugs.webkit.org/show_bug.cgi?id=197933
123         <rdar://problem/50831677>
124
125         Reviewed by Jonathan Bedard.
126
127         The following two tasks have been completed, and we can re-enable
128         generate-xcfilelists:
129
130         Bug 197619 <rdar://problem/50507392> Temporarily disable generate-xcfilelists (197619)
131         Bug 197622 <rdar://problem/50508222> Rewrite generate-xcfilelists in Python (197622)
132
133         No new tests -- no change in user-visible functionality.
134
135         * Scripts/check-xcfilelists.sh:
136
137 2019-05-17  Wenson Hsieh  <wenson_hsieh@apple.com>
138
139         Fix a typo in some user agent string logic
140         https://bugs.webkit.org/show_bug.cgi?id=197992
141         <rdar://problem/50895962>
142
143         Reviewed by Brent Fulgham.
144
145         Adjust the major version number for the desktop user agent string.
146
147         * platform/ios/UserAgentIOS.mm:
148         (WebCore::standardUserAgentWithApplicationName):
149
150 2019-05-17  Simon Fraser  <simon.fraser@apple.com>
151
152         REGRESSION (r245170): gmail.com inbox table header flickers
153         https://bugs.webkit.org/show_bug.cgi?id=198005
154         <rdar://problem/50907718>
155
156         Reviewed by Antti Koivisto.
157
158         When a layer started as painting into shared backing, but then became independently
159         composited (e.g. by having to clip composited children), it wouldn't have the "overlap"
160         indirect compositing reason. This allowed requiresOwnBackingStore() to say that it
161         could paint into some ancestor, but this breaks overlap. So in this code path,
162         put IndirectCompositingReason::Overlap back on the layer which restores the previous
163         behavior.
164
165         Make some logging changes to help diagnose things like this.
166
167         Test: compositing/shared-backing/overlap-after-end-sharing.html
168
169         * rendering/RenderLayer.cpp:
170         (WebCore::RenderLayer::calculateClipRects const):
171         (WebCore::outputPaintOrderTreeLegend):
172         (WebCore::outputPaintOrderTreeRecursive):
173         * rendering/RenderLayer.h:
174         * rendering/RenderLayerCompositor.cpp:
175         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
176         (WebCore::RenderLayerCompositor::updateBacking):
177         (WebCore::RenderLayerCompositor::requiresOwnBackingStore const):
178         (WebCore::RenderLayerCompositor::reasonsForCompositing const):
179         (WebCore::RenderLayerCompositor::requiresCompositingForIndirectReason const):
180         * rendering/RenderLayerCompositor.h:
181
182 2019-05-17  Simon Fraser  <simon.fraser@apple.com>
183
184         REGRESSION (r245170): gmail.com header flickers when hovering over the animating buttons
185         https://bugs.webkit.org/show_bug.cgi?id=197975
186         <rdar://problem/50865946>
187
188         Reviewed by Antti Koivisto.
189
190         When computeCompositingRequirements() determined that a layer could paint into shared backing, it
191         pushed an overlap container. If that layer then converted to normal composting, we'd push a second
192         overlap container, which left the overlap map in a bad state for the rest of the compositing
193         traversal, causing layers to not get composited when necessary.
194
195         Test: compositing/shared-backing/overlap-after-shared-to-composited.html
196
197         * rendering/RenderLayerCompositor.cpp:
198         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
199
200 2019-05-17  Commit Queue  <commit-queue@webkit.org>
201
202         Unreviewed, rolling out r245401.
203         https://bugs.webkit.org/show_bug.cgi?id=197990
204
205         Causing internal build failures (Requested by ShawnRoberts on
206         #webkit).
207
208         Reverted changeset:
209
210         "Add SPI to set a list of hosts to which to send custom header
211         fields cross-origin"
212         https://bugs.webkit.org/show_bug.cgi?id=197397
213         https://trac.webkit.org/changeset/245401
214
215 2019-05-16  Said Abou-Hallawa  <sabouhallawa@apple.com>
216
217         SVGElement should detach itself from all its properties before it is deleted
218         https://bugs.webkit.org/show_bug.cgi?id=197954
219
220         Reviewed by Simon Fraser.
221
222         Before deleting the SVGElement node, SVGElement::detachAllProperties()
223         needs to be called. This will make the properties be detached objects
224         which means no change will be committed unless these properties are
225         attached to another owner.
226
227         Test: svg/dom/svg-properties-detach-change.html
228
229         * dom/Node.cpp:
230         (WebCore::Node::removedLastRef):
231         * svg/SVGElement.h:
232         (WebCore::SVGElement::detachAllProperties):
233
234 2019-05-17  Eric Carlson  <eric.carlson@apple.com>
235
236         Allow sequential playback of media files when initial playback started with a user gesture
237         https://bugs.webkit.org/show_bug.cgi?id=197959
238         <rdar://problem/50655207>
239
240         Reviewed by Youenn Fablet.
241
242         Test: media/playlist-inherits-user-gesture.html
243
244         * dom/Document.cpp:
245         (WebCore::Document::processingUserGestureForMedia const): Return true if it is within
246         one second of the last HTMLMediaElement 'ended' event.
247         * dom/Document.h:
248         (WebCore::Document::mediaFinishedPlaying):
249
250         * html/HTMLMediaElement.cpp:
251         (WebCore::HTMLMediaElement::parseAttribute): removeBehaviorsRestrictionsAfterFirstUserGesture -> 
252         removeBehaviorRestrictionsAfterFirstUserGesture.
253         (WebCore::HTMLMediaElement::load): Ditto. Don't call removeBehaviorsRestrictionsAfterFirstUserGesture,
254         it will be done in prepareForLoad.
255         (WebCore::HTMLMediaElement::prepareForLoad): removeBehaviorsRestrictionsAfterFirstUserGesture -> 
256         removeBehaviorRestrictionsAfterFirstUserGesture.
257         (WebCore::HTMLMediaElement::audioTrackEnabledChanged): Ditto.
258         (WebCore::HTMLMediaElement::play): Ditto.
259         (WebCore::HTMLMediaElement::pause): Ditto.
260         (WebCore::HTMLMediaElement::setVolume): Ditto.
261         (WebCore::HTMLMediaElement::setMuted): Ditto.
262         (WebCore::HTMLMediaElement::webkitShowPlaybackTargetPicker): Ditto.
263         (WebCore::HTMLMediaElement::dispatchEvent): Call document().mediaFinishedPlaying()
264         when dispatching the 'ended' event.
265         (WebCore::HTMLMediaElement::removeBehaviorRestrictionsAfterFirstUserGesture): Rename. Set
266         m_removedBehaviorRestrictionsAfterFirstUserGesture.
267         (WebCore::HTMLMediaElement::removeBehaviorsRestrictionsAfterFirstUserGesture): Deleted.
268         * html/HTMLMediaElement.h:
269         
270         * html/HTMLVideoElement.cpp:
271         (WebCore:HTMLVideoElement::nativeImageForCurrentTime): Convert to runtime logging.
272         (WebCore:HTMLVideoElement::webkitEnterFullscreen): Ditto.
273         (WebCore:HTMLVideoElement::webkitSetPresentationMode): Ditto.
274         (WebCore:HTMLVideoElement::fullscreenModeChanged): Ditto.
275
276         * html/MediaElementSession.cpp:
277         (WebCore::MediaElementSession::removeBehaviorRestriction): Update log message.
278
279 2019-05-17  Brent Fulgham  <bfulgham@apple.com>
280
281         Hardening: Prevent FrameLoader crash due to SetForScope
282         https://bugs.webkit.org/show_bug.cgi?id=197458
283         <rdar://problem/50368338>
284
285         Reviewed by Chris Dumez.
286
287         Since SetForScope takes action during a function returns, it might cause
288         a crash if its scope is broader than the value it is resetting.
289
290         * loader/FrameLoader.cpp:
291         (WebCore::FrameLoader::loadDifferentDocumentItem):
292
293 2019-05-16  Carlos Garcia Campos  <cgarcia@igalia.com>
294
295         [GTK] Need WebKitContextMenuItemType to open emoji picker
296         https://bugs.webkit.org/show_bug.cgi?id=176760
297
298         Reviewed by Michael Catanzaro.
299
300         Add a new context menu item to insert an emoji.
301
302         * loader/EmptyClients.cpp: Empty implementation of ContextMenuClient::insertEmoji().
303         * page/ContextMenuClient.h: Add insertEmoji for GTK port.
304         * page/ContextMenuController.cpp:
305         (WebCore::ContextMenuController::contextMenuItemSelected): Handle insert emoji action.
306         (WebCore::ContextMenuController::populate): Add insert emoji item after select all.
307         (WebCore::ContextMenuController::checkOrEnableIfNeeded const): Handle insert emoji action.
308         * platform/ContextMenuItem.h: Add insert emoji action.
309         * platform/LocalizedStrings.h:
310         * platform/gtk/LocalizedStringsGtk.cpp:
311         (WebCore::contextMenuItemTagInsertEmoji):
312
313 2019-05-16  Greg Doolittle  <gr3g@apple.com>
314
315         AX: Unship some ARIA string reflectors that are to-be-replaced by element reflection
316         https://bugs.webkit.org/show_bug.cgi?id=197764
317         <rdar://problem/50649689>
318
319         Reviewed by Chris Fleizach.
320
321         Specifically these:
322         - ariaActiveDescendant
323         - ariaControls
324         - ariaDescribedBy
325         - ariaDetails
326         - ariaErrorMessage
327         - ariaFlowTo
328         - ariaLabelledBy
329         - ariaOwns
330
331         Test: LayoutTests/accessibility/ARIA-reflections.html (updated)
332
333         * accessibility/AriaAttributes.idl:
334
335 2019-05-16  Youenn Fablet  <youenn@apple.com>
336
337         CoreAudioCaptureSource should be marked as an audio capture track
338         https://bugs.webkit.org/show_bug.cgi?id=197953
339         <rdar://problem/50552007>
340
341         Reviewed by Eric Carlson.
342
343         Manually tested.
344
345         * platform/mediastream/mac/CoreAudioCaptureSource.h:
346         Mark it as microphone so that it can get muted properly.
347
348 2019-05-16  Alex Christensen  <achristensen@webkit.org>
349
350         Add SPI to set a list of hosts to which to send custom header fields cross-origin
351         https://bugs.webkit.org/show_bug.cgi?id=197397
352
353         Reviewed by Geoff Garen.
354
355         In r223001 I added the ability to send custom headers, but with a restriction that they will not be sent except to the origin of the main document.
356         We need the ability to specify what origins to send these headers to even if they are not first party requests.
357         We get this information in a list of strings which are the hosts to send the headers to.  Some of the strings have an asterisk at the beginning,
358         indicating that the headers are to be sent to all subdomains.
359
360         I repurposed some ObjC SPI that was never adopted, but I keep testing the C API that was to verify no regression.
361         I also added some new API tests for the new behavior.
362
363         * Sources.txt:
364         * WebCore.xcodeproj/project.pbxproj:
365         * loader/CustomHeaderFields.cpp: Added.
366         (WebCore::CustomHeaderFields::thirdPartyDomainsMatch const):
367         * loader/CustomHeaderFields.h: Added.
368         (WebCore::CustomHeaderFields::encode const):
369         (WebCore::CustomHeaderFields::decode):
370         * loader/DocumentLoader.cpp:
371         (WebCore::DocumentLoader::setCustomHeaderFields): Deleted.
372         * loader/DocumentLoader.h:
373         (WebCore::DocumentLoader::setCustomHeaderFields):
374         (WebCore::DocumentLoader::customHeaderFields const):
375         (WebCore::DocumentLoader::customHeaderFields): Deleted.
376         * loader/cache/CachedResourceLoader.cpp:
377         (WebCore::CachedResourceLoader::requestResource):
378
379 2019-05-16  Ali Juma  <ajuma@chromium.org>
380
381         [IntersectionObserver] Regression: No initial observation when nothing else triggers rendering
382         https://bugs.webkit.org/show_bug.cgi?id=197891
383
384         Reviewed by Simon Fraser.
385
386         Schedule a rendering update whenever a new IntersectionObserver target is added.
387
388         Test: intersection-observer/initial-observation.html
389
390         * page/IntersectionObserver.cpp:
391         (WebCore::IntersectionObserver::observe):
392
393 2019-05-16  Carlos Garcia Campos  <cgarcia@igalia.com>
394
395         [FreeType] Some character sequences with a variation selector are not rendered
396         https://bugs.webkit.org/show_bug.cgi?id=197838
397
398         Reviewed by Michael Catanzaro.
399
400         We get the invalid glyph instead. See http://mts.io/2015/04/21/unicode-symbol-render-text-emoji/. In the table at
401         the end the Emoji and Text columns are not correctly rendered. It happens also when copying an emoji from
402         GtkEmojiChooser and pasting in WebKit text field, because GTK appends U+FE0F to all emojis to force the emoji
403         style. We need to take into account the variation selector when checking if a font can render a combining
404         sequence, using FT_Face_GetCharVariantIndex to get the right glyph in case of variation character present.
405
406         * platform/graphics/Font.cpp:
407         (WebCore::Font::platformSupportsCodePoint const): Add optional variation parameter.
408         (WebCore::Font::canRenderCombiningCharacterSequence const): Take into account variation selector characters
409         * platform/graphics/Font.h:
410         * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
411         (WebCore::FontCascade::fontForCombiningCharacterSequence const): Check variation selectors 0xFE0E and 0xFE0F to
412         decide whether to use the emoji or text style.
413         * platform/graphics/cocoa/FontCocoa.mm:
414         (WebCore::Font::platformSupportsCodePoint const): Return false when a variation character is passed so that
415         characters are checked individually.
416         * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
417         (WebCore::Font::platformSupportsCodePoint const): Use FT_Face_GetCharVariantIndex when a variation character is
418         passed.
419         * platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
420         (WebCore::harfBuzzFontFunctions): Do not return true when FT_Face_GetCharVariantIndex returns 0.
421
422 2019-05-16  Greg Hughes  <ghughes@apple.com>
423
424         Updated screenHasInvertedColors to use AppKit when available
425         https://bugs.webkit.org/show_bug.cgi?id=197935
426         <rdar://problem/50834405>
427
428         Reviewed by Chris Fleizach.
429
430         * platform/mac/PlatformScreenMac.mm:
431         (WebCore::collectScreenProperties):
432         (WebCore::screenHasInvertedColors):
433
434 2019-05-15  Simon Fraser  <simon.fraser@apple.com>
435
436         Avoid a recursive descendants layer walk sometimes
437         https://bugs.webkit.org/show_bug.cgi?id=197939
438
439         Reviewed by Zalan Bujtas.
440
441         If a layer got composited post-descendants because it needs to clip, for example, we'd do a recursive
442         descendant tree walk to add layers to the overlap map. However, all the descendants would already
443         have contributed to the overlap map if some non-root ancestor was already composited. So we can
444         skip the addDescendantsToOverlapMapRecursive() if we know, before descendants, whether there's
445         a non-root composited ancestor.
446
447         * rendering/RenderLayerCompositor.cpp:
448         (WebCore::RenderLayerCompositor::CompositingState::hasNonRootCompositedAncestor const):
449         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
450
451 2019-05-15  Simon Fraser  <simon.fraser@apple.com>
452
453         Clean up code related to compositing overlap map maintenance
454         https://bugs.webkit.org/show_bug.cgi?id=197936
455
456         Reviewed by Zalan Bujtas.
457
458         Clarify the logic around updating the overlap map:
459
460         When a layer becomes composited, or paints into a non-root composited layer, we add it to the overlap map
461         after traversing descendants (since it only affets layers later in traversal).
462
463         If a layer became composited after traversing descendants, we need to go back and add all the descendants
464         to the overlap map with a recursive traversal.
465
466         We can do all this near the end of computeCompositingRequirements/traverseUnchangedSubtree because
467         we only check overlap when we enter this function on later layers.
468
469         Add a CompositingOverlap log channel and use it to log the state of the overlap map.
470
471         * platform/Logging.h:
472         * rendering/RenderLayerCompositor.cpp:
473         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
474         (WebCore::RenderLayerCompositor::traverseUnchangedSubtree):
475         (WebCore::RenderLayerCompositor::addToOverlapMap const):
476         (WebCore::RenderLayerCompositor::addDescendantsToOverlapMapRecursive const):
477         (WebCore::RenderLayerCompositor::updateOverlapMap const):
478         (WebCore::RenderLayerCompositor::addToOverlapMap): Deleted.
479         (WebCore::RenderLayerCompositor::addToOverlapMapRecursive): Deleted.
480         * rendering/RenderLayerCompositor.h:
481
482 2019-05-15  Timothy Hatcher  <timothy@apple.com>
483
484         REGRESSION (r245072): Missing code in Document::styleColorOptions to propagate StyleColor::Options::UseInactiveAppearance
485         https://bugs.webkit.org/show_bug.cgi?id=197930
486         rdar://problem/49833954
487
488         Reviewed by Wenson Hsieh and Megan Gardner.
489
490         Add some code that was missing from Document in my original patch for r245072.
491
492         * dom/Document.cpp:
493         (WebCore::Document::useSystemAppearance const): Drive-by fix code style.
494         (WebCore::Document::useInactiveAppearance const): Added.
495         (WebCore::Document::styleColorOptions const): Add StyleColor::Options::UseInactiveAppearance.
496         * dom/Document.h: Added useInactiveAppearance().
497
498 2019-05-15  Devin Rousso  <drousso@apple.com>
499
500         Web Inspector: user gesture toggle should also force user interaction flag
501         https://bugs.webkit.org/show_bug.cgi?id=197269
502
503         Reviewed by Joseph Pecoraro.
504
505         Test: inspector/runtime/evaluate-userGestureEmulation-userIsInteracting.html
506
507         * inspector/agents/page/PageRuntimeAgent.cpp:
508         (WebCore::PageRuntimeAgent::evaluate):
509
510         * page/ChromeClient.h:
511         (WebCore::ChromeClient::userIsInteracting const): Added.
512         (WebCore::ChromeClient::setUserIsInteracting): Added.
513
514         * testing/Internals.idl:
515         * testing/Internals.h:
516         * testing/Internals.cpp:
517         (WebCore::Internals::userIsInteracting): Added.
518
519 2019-05-15  Zalan Bujtas  <zalan@apple.com>
520
521         Do not create a shape object outside of the layout context
522         https://bugs.webkit.org/show_bug.cgi?id=197926
523         <rdar://problem/50627858>
524
525         Reviewed by Simon Fraser.
526
527         ShapeOutside objects are used to compute line constrains during layout (in a strict sense, they are part of the layout context and should only be mutated during layout).
528         If we don't create one during layout, we probably don't need to know its geometry during paint (or any other non-layout activity) either.
529
530         Test: fast/block/float/float-with-shape-outside-crash.html
531
532         * rendering/FloatingObjects.cpp:
533         (WebCore::ComputeFloatOffsetForLineLayoutAdapter<FloatingObject::FloatLeft>::updateOffsetIfNeeded):
534         (WebCore::ComputeFloatOffsetForLineLayoutAdapter<FloatingObject::FloatRight>::updateOffsetIfNeeded):
535         * rendering/shapes/ShapeOutsideInfo.cpp:
536         (WebCore::ShapeOutsideInfo::computeDeltasForContainingBlockLine):
537
538 2019-05-15  Youenn Fablet  <youenn@apple.com>
539
540         Mark beacon and ping loads as low priority
541         https://bugs.webkit.org/show_bug.cgi?id=197919
542         <rdar://problem/50818286>
543
544         Reviewed by Alex Christensen.
545
546         No JS observable change of behavior.
547
548         * Modules/beacon/NavigatorBeacon.cpp:
549         (WebCore::NavigatorBeacon::sendBeacon):
550         * loader/PingLoader.cpp:
551         (WebCore::PingLoader::sendPing):
552
553 2019-05-15  Simon Fraser  <simon.fraser@apple.com>
554
555         Clean up RenderLayerCompositor::computeCompositingRequirements() and traverseUnchangedSubtree()
556         https://bugs.webkit.org/show_bug.cgi?id=197931
557
558         Reviewed by Zalan Bujtas.
559
560         These functions have grown and become hard to maintain, so try to undo some technical debt.
561
562         Rename "childState" to "currentState" since it's the state we pass to children, but also
563         is state we change when the current layer becomes composited.
564
565         Separate the layerWillComposite() lambda from layerWillCompositePostDescendants().
566
567         Group the chunks of code at end of the functions into:
568             - updating bits on RenderLayer
569             - updating compositingState with changes from children and our state
570             - doing post-traversal work on overlapMap and backingSharingState
571
572         Code shared between the two functions is pushed into CompositingState::updateWithDescendantStateAndLayer().
573
574         This moves code around but should not cause any behavior change.
575
576         * rendering/RenderLayerBacking.cpp:
577         (WebCore::RenderLayerBacking::updateConfiguration):
578         * rendering/RenderLayerCompositor.cpp:
579         (WebCore::RenderLayerCompositor::OverlapExtent::knownToBeHaveExtentUncertainty const):
580         (WebCore::RenderLayerCompositor::CompositingState::updateWithDescendantStateAndLayer):
581         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
582         (WebCore::RenderLayerCompositor::traverseUnchangedSubtree):
583         (WebCore::RenderLayerCompositor::clipsCompositingDescendants):
584         (WebCore::RenderLayerCompositor::CompositingState::propagateStateFromChildren): Deleted.
585         (WebCore::RenderLayerCompositor::CompositingState::propagateStateFromChildrenForUnchangedSubtree): Deleted.
586         (WebCore::RenderLayerCompositor::clipsCompositingDescendants const): Deleted.
587         * rendering/RenderLayerCompositor.h:
588
589 2019-05-15  Simon Fraser  <simon.fraser@apple.com>
590
591         Make LayerOverlapMap able to output to a TextStream
592         https://bugs.webkit.org/show_bug.cgi?id=197923
593
594         Reviewed by Zalan Bujtas.
595
596         Make it possible output LayerOverlapMap to a TextStream for logging.
597
598         * rendering/LayerOverlapMap.cpp:
599         (WebCore::OverlapMapContainer::rectList const):
600         (WebCore::operator<<):
601         * rendering/LayerOverlapMap.h:
602         (WebCore::LayerOverlapMap::overlapStack const):
603
604 2019-05-15  Youenn Fablet  <youenn@apple.com>
605
606         getUserMedia sandbox extensions should not be revoked when a getUserMedia allowed request is being processed
607         https://bugs.webkit.org/show_bug.cgi?id=197851
608
609         Reviewed by Alex Christensen.
610
611         Add a completion handler to create a new capture stream.
612         This is used by WK2 layer to acknowledge the pending capture request is completed.
613         Just after the completion handler, make sure to update the document media state.
614         This is done to ensure that, should capture failing, the UIProcess
615         knows about it and can manage proper sandbox extension revocation.
616
617         Test: fast/mediastream/gum-stop-track.html
618
619         * Modules/mediastream/UserMediaRequest.cpp:
620         (WebCore::UserMediaRequest::allow):
621         (WebCore::UserMediaRequest::PendingActivationMediaStream::PendingActivationMediaStream):
622         (WebCore::UserMediaRequest::PendingActivationMediaStream::~PendingActivationMediaStream):
623         * Modules/mediastream/UserMediaRequest.h:
624         (WebCore::UserMediaRequest::PendingActivationMediaStream::create):
625         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
626         (WebCore::MockRealtimeMediaSourceCenter::mockRealtimeMediaSourceCenterEnabled):
627         * platform/mock/MockRealtimeMediaSourceCenter.h:
628
629 2019-05-15  Simon Fraser  <simon.fraser@apple.com>
630
631         Make LOG_WITH_STREAM more efficient
632         https://bugs.webkit.org/show_bug.cgi?id=197905
633
634         Reviewed by Alex Christensen.
635
636         No longer need to conditionalize ClipRects logging on the channel being enabled
637         since LOG_WITH_STREAM fix the performance problem.
638
639         Convert some RenderLayerCompositor logging to use LOG_WITH_STREAM.
640
641         * rendering/RenderLayer.cpp:
642         (WebCore::RenderLayer::calculateClipRects const):
643         (WebCore::clipRectsLogEnabled): Deleted.
644         * rendering/RenderLayerCompositor.cpp:
645         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
646         (WebCore::RenderLayerCompositor::traverseUnchangedSubtree):
647
648 2019-05-15  Simon Fraser  <simon.fraser@apple.com>
649
650         Move RenderLayerCompositor's OverlapMap to its own file
651         https://bugs.webkit.org/show_bug.cgi?id=197915
652
653         Reviewed by Alex Christensen.
654
655         Move OverlapMap to its own file.
656         Make use of RectList, which was in the file but unused!
657         Allocate OverlapMapContainer on the heap both to avoid header pollution of internals,
658         and because they will get bigger in future.
659
660         No behavior change.
661
662         * Sources.txt:
663         * WebCore.xcodeproj/project.pbxproj:
664         * rendering/LayerOverlapMap.cpp: Added.
665         (WebCore::RectList::append):
666         (WebCore::RectList::intersects const):
667         (WebCore::OverlapMapContainer::add):
668         (WebCore::OverlapMapContainer::overlapsLayers const):
669         (WebCore::OverlapMapContainer::unite):
670         (WebCore::LayerOverlapMap::LayerOverlapMap):
671         (WebCore::LayerOverlapMap::add):
672         (WebCore::LayerOverlapMap::overlapsLayers const):
673         (WebCore::LayerOverlapMap::pushCompositingContainer):
674         (WebCore::LayerOverlapMap::popCompositingContainer):
675         * rendering/LayerOverlapMap.h: Added.
676         (WebCore::LayerOverlapMap::isEmpty const):
677         (WebCore::LayerOverlapMap::geometryMap const):
678         (WebCore::LayerOverlapMap::geometryMap):
679         * rendering/RenderLayerCompositor.cpp:
680         (WebCore::RenderLayerCompositor::updateCompositingLayers):
681         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
682         (WebCore::RenderLayerCompositor::traverseUnchangedSubtree):
683         (WebCore::RenderLayerCompositor::computeExtent const):
684         (WebCore::RenderLayerCompositor::addToOverlapMap):
685         (WebCore::RenderLayerCompositor::addToOverlapMapRecursive):
686         (WebCore::OverlapMapContainer::add): Deleted.
687         (WebCore::OverlapMapContainer::overlapsLayers const): Deleted.
688         (WebCore::OverlapMapContainer::unite): Deleted.
689         (WebCore::RenderLayerCompositor::OverlapMap::OverlapMap): Deleted.
690         (WebCore::RenderLayerCompositor::OverlapMap::add): Deleted.
691         (WebCore::RenderLayerCompositor::OverlapMap::overlapsLayers const): Deleted.
692         (WebCore::RenderLayerCompositor::OverlapMap::isEmpty const): Deleted.
693         (WebCore::RenderLayerCompositor::OverlapMap::pushCompositingContainer): Deleted.
694         (WebCore::RenderLayerCompositor::OverlapMap::popCompositingContainer): Deleted.
695         (WebCore::RenderLayerCompositor::OverlapMap::geometryMap const): Deleted.
696         (WebCore::RenderLayerCompositor::OverlapMap::geometryMap): Deleted.
697         (WebCore::RenderLayerCompositor::OverlapMap::RectList::append): Deleted.
698         (WebCore::RenderLayerCompositor::OverlapMap::RectList::intersects const): Deleted.
699         * rendering/RenderLayerCompositor.h:
700
701 2019-05-15  Devin Rousso  <drousso@apple.com>
702
703         Web Automation: elements larger than the viewport have incorrect in-view center point
704         https://bugs.webkit.org/show_bug.cgi?id=195696
705         <rdar://problem/48737122>
706
707         Reviewed by Simon Fraser.
708
709         Original patch by Brian Burg <bburg@apple.com>.
710
711         Some conversion methods do not exist for `FloatRect`/`FloatPoint`. Fill them in as needed,
712         and export some symbols used by WebDriver code to compute an element's in-view center point
713         in various coordinate systems.
714
715         * dom/TreeScope.h:
716         * dom/TreeScope.cpp:
717         (WebCore::TreeScope::elementsFromPoint): Added.
718         * page/FrameView.h:
719         * page/FrameView.cpp:
720         (WebCore::FrameView::absoluteToLayoutViewportPoint const): Added.
721         (WebCore::FrameView::layoutViewportToAbsoluteRect const): Added.
722         (WebCore::FrameView::absoluteToLayoutViewportRect const): Added.
723         * platform/ScrollView.h:
724         * platform/ScrollView.cpp:
725         (WebCore::ScrollView::viewToContents const): Added.
726         (WebCore::ScrollView::contentsToView const): Added.
727         (WebCore::ScrollView::contentsToRootView const): Added.
728         * platform/Widget.h:
729         * platform/Widget.cpp:
730         (WebCore::Widget::convertToRootView const): Added.
731         (WebCore::Widget::convertFromRootView const): Added.
732         (WebCore::Widget::convertToContainingView const): Added.
733         (WebCore::Widget::convertFromContainingView const): Added.
734
735 2019-05-14  Wenson Hsieh  <wenson_hsieh@apple.com>
736
737         Missing cursor/caret showing in search field on google.com
738         https://bugs.webkit.org/show_bug.cgi?id=197862
739         <rdar://problem/50291989>
740
741         Reviewed by Simon Fraser.
742
743         In this bug, the search field is inside of a fixed position container, which is inside of an empty "overflow:
744         hidden" form element (the new layout test demonstrates a simple version of this). The layer of the fixed
745         position container's renderer has an overflow clipping layer of itself, and its clipping rect is non-empty, so
746         the heuristic initially identifies the layer as not fully clipped. However, as the heuristic ascends the
747         RenderLayer tree, it then finds the layer for the "overflow: hidden" form element's renderer; this layer is
748         completely clipped, which causes the heuristic to incorrectly believe that the editable element is completely
749         clipped.
750
751         To fix the bug, this patch reworks the clipping portion of the heuristic, such that we no longer need to ascend
752         the layer tree. Instead of computing the clip rect relative to the nearest ancestor that has an overflow clip
753         and then walking up the layer tree repeating this process, simply compute the clip rect relative to RenderView's
754         layer, and then walk up to the parent frame and repeat if necessary.
755
756         Test: editing/selection/ios/do-not-hide-selection-in-visible-field.html
757
758         * rendering/RenderLayer.cpp:
759         (WebCore::RenderLayer::isTransparentOrFullyClippedRespectingParentFrames const):
760
761 2019-05-14  Andy Estes  <aestes@apple.com>
762
763         [Apple Pay] Payment APIs should be completely disabled in web views into which clients have injected user scripts
764         https://bugs.webkit.org/show_bug.cgi?id=197751
765         <rdar://problem/50631563>
766
767         Reviewed by Alex Christensen.
768
769         In r243324, when a document has had user agent scripts injected into it, payment APIs were
770         disabled at runtime by having all entry points return falsy values or throw exceptions
771         (e.g., ApplePaySession.canMakePayments() returns false).
772
773         In the case of user scripts in particular (e.g., WKUserScript), since we know whether these
774         exist at the time we create a document's DOMWindow, we can do better than r243324 by
775         completely disabling the payment APIs in the presence of user scripts.
776
777         To achieve this, this change introduces the 'EnabledByContext' extended attribute for
778         interfaces, which instructs the bindings generator to add a conjunct to the payment API
779         constructors that asks the interface's implementation class whether it should be enabled for
780         a given ScriptExecutionContext. The PaymentRequest and ApplePaySession interfaces adopt this
781         new extended attribute to implement the new user script check.
782
783         Added new API tests.
784
785         * Modules/applepay/ApplePaySession.idl:
786         * Modules/applepay/PaymentCoordinator.cpp:
787         (WebCore::PaymentCoordinator::shouldEnableApplePayAPIs const):
788         * Modules/applepay/PaymentCoordinator.h:
789         * Modules/applepay/PaymentSession.cpp:
790         (WebCore::PaymentSession::enabledForContext):
791         * Modules/applepay/PaymentSession.h:
792         * Modules/paymentrequest/PaymentHandler.cpp:
793         (WebCore::PaymentHandler::enabledForContext):
794         * Modules/paymentrequest/PaymentHandler.h:
795         * Modules/paymentrequest/PaymentRequest.cpp:
796         (WebCore::PaymentRequest::enabledForContext):
797         * Modules/paymentrequest/PaymentRequest.h:
798         * Modules/paymentrequest/PaymentRequest.idl:
799         * bindings/scripts/CodeGeneratorJS.pm:
800         (NeedsRuntimeCheck):
801         (GenerateRuntimeEnableConditionalString):
802         * bindings/scripts/IDLAttributes.json:
803         * bindings/scripts/preprocess-idls.pl:
804         (GenerateConstructorAttributes):
805         * bindings/scripts/test/JS/JSTestEnabledForContext.cpp: Added.
806         * bindings/scripts/test/JS/JSTestEnabledForContext.h: Added.
807         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
808         (WebCore::JSTestGlobalObject::finishCreation):
809         (WebCore::jsTestGlobalObjectTestEnabledForContextConstructorGetter):
810         (WebCore::jsTestGlobalObjectTestEnabledForContextConstructor):
811         (WebCore::setJSTestGlobalObjectTestEnabledForContextConstructorSetter):
812         (WebCore::setJSTestGlobalObjectTestEnabledForContextConstructor):
813         * bindings/scripts/test/TestEnabledForContext.idl: Added.
814
815 2019-05-14  Robin Morisset  <rmorisset@apple.com>
816
817         [WHLSL] parseEffectfulSuffix() is never called
818         https://bugs.webkit.org/show_bug.cgi?id=195864
819         <rdar://problem/50746278>
820
821         Reviewed by Myles C. Maxfield.
822
823         The fix is trivial: when parseEffectfulPrefix does not see a ++ or --, it must call parseEffectfulSuffix.
824
825         No test yet, as it is not testable until the property resolver is finished.
826         It will be tested with the rest of the compiler, when we port the testsuite from the js implementation (it already covers this case).
827
828         * Modules/webgpu/WHLSL/WHLSLParser.cpp:
829         (WebCore::WHLSL::Parser::parseEffectfulPrefix):
830
831 2019-05-14  Robin Morisset  <rmorisset@apple.com>
832
833         [WHLSL] parseEffectfulAssignment should not call parseCallExpression directly
834         https://bugs.webkit.org/show_bug.cgi?id=197890
835
836         Reviewed by Myles Maxfield.
837
838         callExpression already appears in effSuffix which is in effPrefix which is in effAssignment, so having it directly in effAssignment as well is useless (and ambiguous).
839         I've already fixed the grammar (https://github.com/gpuweb/WHLSL/commit/a07005f4d692fe3370618dca5db218992b362049), the grammar was always good, this patch is fixing the parser.
840
841         * Modules/webgpu/WHLSL/WHLSLParser.cpp:
842         (WebCore::WHLSL::Parser::parseEffectfulAssignment):
843
844 2019-05-14  Ross Kirsling  <ross.kirsling@sony.com>
845
846         Unreviewed restoration of non-unified build.
847
848         * Modules/cache/DOMCache.cpp:
849         * bindings/js/JSLazyEventListener.h:
850         * loader/NavigationScheduler.h:
851         * page/Quirks.cpp:
852         * page/Quirks.h:
853         * rendering/ClipRect.cpp:
854
855 2019-05-14  Zalan Bujtas  <zalan@apple.com>
856
857         Do not try to issue repaint while the render tree is being destroyed.
858         https://bugs.webkit.org/show_bug.cgi?id=197461
859         <rdar://problem/50368992>
860
861         Reviewed by Simon Fraser.
862
863         Test: http/tests/svg/crash-on-reload-with-filter.html
864
865         We don't need to compute repaint rects when the render tree is getting torn down. We'll issue a full repaint at some point.
866         Also during full render tree destruction the inline tree state is undefined. We should avoid accessing it.
867
868         * rendering/svg/RenderSVGResourceContainer.cpp:
869         (WebCore::RenderSVGResourceContainer::markAllClientLayersForInvalidation):
870
871 2019-05-14  Youenn Fablet  <youenn@apple.com>
872
873         A service worker process should app nap when all its clients app nap
874         https://bugs.webkit.org/show_bug.cgi?id=185626
875         <rdar://problem/46785908>
876
877         Reviewed by Alex Christensen.
878
879         Update RegistrableDomain to work with SecurityOriginData.
880         Add internal API to enable accessing to service worker process throttle state.
881
882         Test: http/wpt/service-workers/mac/processSuppression.https.html
883
884         * platform/RegistrableDomain.h:
885         (WebCore::RegistrableDomain::RegistrableDomain):
886         (WebCore::RegistrableDomain::matches const):
887         (WebCore::RegistrableDomain::registrableDomainFromHost):
888         * testing/ServiceWorkerInternals.cpp:
889         (WebCore::ServiceWorkerInternals::isThrottleable const):
890         * testing/ServiceWorkerInternals.h:
891         * testing/ServiceWorkerInternals.idl:
892         * workers/service/SWClientConnection.h:
893         * workers/service/context/SWContextManager.cpp:
894         * workers/service/context/SWContextManager.h:
895         * workers/service/server/SWServer.cpp:
896         (WebCore::SWServer::serverToContextConnectionCreated):
897         * workers/service/server/SWServer.h:
898         (WebCore::SWServer::Connection::server const):
899         (WebCore::SWServer::connections const):
900         * workers/service/server/SWServerToContextConnection.h:
901
902 2019-05-14  Youenn Fablet  <youenn@apple.com>
903
904         getUserMedia capture changes on iOS after homing out
905         https://bugs.webkit.org/show_bug.cgi?id=197707
906
907         Reviewed by Eric Carlson.
908
909         In case of muting an AVVideoCaptureSource on iOS, the session is cleared.
910         We need to store the preset information, to setup the new session on unnmuting correctly.
911         Manually tested.
912
913         * platform/mediastream/mac/AVVideoCaptureSource.h:
914         * platform/mediastream/mac/AVVideoCaptureSource.mm:
915         (WebCore::AVVideoCaptureSource::setSizeAndFrameRateWithPreset):
916         (WebCore::AVVideoCaptureSource::setSessionSizeAndFrameRate):
917         (WebCore::AVVideoCaptureSource::setupCaptureSession):
918
919 2019-05-14  Oriol Brufau  <obrufau@igalia.com>
920
921         [css-grid] Update grid when changing auto repeat type
922         https://bugs.webkit.org/show_bug.cgi?id=197849
923
924         Reviewed by Javier Fernandez.
925
926         Test: imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-change-auto-repeat-tracks.html
927
928         This patch makes two 'repeat()' values for 'grid-template' be considered
929         to be different if one uses 'auto-fill' and the other 'auto-fit'.
930
931         Previously, they were considered to be equal if the repeated values
932         were the same, without comparing the repeat type. Therefore, the grid
933         was not updated when setting both values one after the other.
934
935         * css/CSSGridAutoRepeatValue.cpp:
936         (WebCore::CSSGridAutoRepeatValue::equals const):
937         * css/CSSGridAutoRepeatValue.h:
938
939 2019-05-14  Antti Koivisto  <antti@apple.com>
940
941         Event region computation should respect transforms
942         https://bugs.webkit.org/show_bug.cgi?id=197836
943         <rdar://problem/50762971>
944
945         Reviewed by Darin Adler.
946
947         * platform/graphics/transforms/AffineTransform.cpp:
948         (WebCore::AffineTransform::mapRegion const):
949
950         Add support for transforming regions. Non-rectlinear results use enclosing rects.
951
952         * platform/graphics/transforms/AffineTransform.h:
953         * rendering/EventRegion.cpp:
954         (WebCore::EventRegionContext::EventRegionContext):
955         (WebCore::EventRegionContext::pushTransform):
956         (WebCore::EventRegionContext::popTransform):
957         (WebCore::EventRegionContext::unite):
958         (WebCore::EventRegionContext::contains const):
959
960         Add a context object that holds the current transform.
961
962         * rendering/EventRegion.h:
963         (WebCore::EventRegion::makeContext):
964         * rendering/InlineTextBox.cpp:
965         (WebCore::InlineTextBox::paint):
966         * rendering/PaintInfo.h:
967
968         Replace the region object with the context.
969
970         * rendering/RenderBlock.cpp:
971         (WebCore::RenderBlock::paintObject):
972         * rendering/RenderLayer.cpp:
973         (WebCore::RenderLayer::paintLayerByApplyingTransform):
974
975         Apply transforms to regions if needed.
976
977         (WebCore::RenderLayer::collectEventRegionForFragments):
978         * rendering/RenderLayer.h:
979         * rendering/RenderLayerBacking.cpp:
980         (WebCore::RenderLayerBacking::updateEventRegion):
981         * rendering/SimpleLineLayoutFunctions.cpp:
982         (WebCore::SimpleLineLayout::paintFlow):
983
984 2019-05-14  Youenn Fablet  <youenn@apple.com>
985
986         Video frame resizing should be using Trim
987         https://bugs.webkit.org/show_bug.cgi?id=197722
988         <rdar://problem/50602188>
989
990         Reviewed by Eric Carlson.
991
992         Move from letter box to trim mode for resizing.
993         This ensures no black stripes are present when rendering the stream.
994
995         Test: fast/mediastream/resize-trim.html
996
997         * platform/cocoa/VideoToolboxSoftLink.cpp:
998         * platform/cocoa/VideoToolboxSoftLink.h:
999         * platform/graphics/cv/ImageTransferSessionVT.mm:
1000         (WebCore::ImageTransferSessionVT::ImageTransferSessionVT):
1001
1002 2019-05-14  Yusuke Suzuki  <ysuzuki@apple.com>
1003
1004         [JSC] Shrink sizeof(UnlinkedFunctionExecutable) more
1005         https://bugs.webkit.org/show_bug.cgi?id=197833
1006
1007         Reviewed by Darin Adler.
1008
1009         * testing/Internals.cpp:
1010         (WebCore::Internals::parserMetaData):
1011
1012 2019-05-14  Antoine Quint  <graouts@apple.com>
1013
1014         [Pointer Events] The pointerenter and pointerleave events target the wrong element on iOS
1015         https://bugs.webkit.org/show_bug.cgi?id=197881
1016         <rdar://problem/50187657>
1017
1018         Reviewed by Dean Jackson.
1019
1020         Test: pointerevents/ios/enter-leave-target.html
1021
1022         The "pointerenter" and "pointerleave" should target the element on which the event listener was added and not
1023         the element that would otherwise hit test. This matches the behavior of "mouseenter" and "mouseleave" on macOS.
1024
1025         * page/PointerCaptureController.cpp:
1026         (WebCore::PointerCaptureController::dispatchEventForTouchAtIndex):
1027
1028 2019-05-14  Said Abou-Hallawa  <sabouhallawa@apple.com>
1029
1030         [CG] Adding support for HEIF-sequence ('public.heics') images
1031         https://bugs.webkit.org/show_bug.cgi?id=197384
1032
1033         Reviewed by Simon Fraser.
1034
1035         -- Get the image repetitionCount and the frame duration.
1036         -- Add a new function setAdditionalSupportedImageTypesForTesting() which
1037            takes a delimited String.
1038         -- Add internal APIs to retrive the image frame count and the frame
1039            duration.
1040
1041         Tests: fast/images/animated-heics-draw.html
1042                fast/images/animated-heics-verify.html
1043
1044         * platform/graphics/ImageSource.h:
1045         * platform/graphics/cg/ImageDecoderCG.cpp:
1046         (WebCore::animationPropertiesFromProperties):
1047         (WebCore::animationHEICSPropertiesFromProperties):
1048         (WebCore::ImageDecoderCG::repetitionCount const):
1049         (WebCore::ImageDecoderCG::frameDurationAtIndex const):
1050         * platform/graphics/cg/UTIRegistry.cpp:
1051         (WebCore::setAdditionalSupportedImageTypesForTesting):
1052         * platform/graphics/cg/UTIRegistry.h:
1053         * testing/Internals.cpp:
1054         (WebCore::Internals::imageFrameCount):
1055         (WebCore::Internals::imageFrameDurationAtIndex):
1056         * testing/Internals.h:
1057         * testing/Internals.idl:
1058         * testing/js/WebCoreTestSupport.cpp:
1059         (WebCoreTestSupport::setAdditionalSupportedImageTypesForTesting):
1060         * testing/js/WebCoreTestSupport.h:
1061
1062 2019-05-14  Manuel Rego Casasnovas  <rego@igalia.com>
1063
1064         [css-grid] Use max size to compute auto repeat tracks
1065         https://bugs.webkit.org/show_bug.cgi?id=197854
1066
1067         Reviewed by Javier Fernandez.
1068
1069         When available size is indefinite we should use max size to compute the number of auto repeat tracks.
1070
1071         The spec text is very clear (https://drafts.csswg.org/css-grid/#auto-repeat):
1072         > When auto-fill is given as the repetition number, if the grid container
1073         > has a definite size or **max size** in the relevant axis...
1074
1075         So far we were not doing that for widths, in this patch we modify RenderGrid::computeAutoRepeatTracksCount()
1076         to do the same than for heights.
1077
1078         We also take advantage to fix problems related to min|max sizes and box-sizing property,
1079         that were inconsistent for columns and rows.
1080
1081         Tests: imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-max-size-001.html
1082                imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-max-size-002.html
1083                imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-min-max-size-001.html
1084                imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-min-size-001.html
1085                imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-min-size-002.html
1086
1087         * rendering/RenderGrid.cpp:
1088         (WebCore::RenderGrid::computeAutoRepeatTracksCount const):
1089
1090 2019-05-14  Joonghun Park  <pjh0718@gmail.com>
1091
1092         Implement page-break-* and -webkit-column-break-* as legacy-shorthands.
1093         https://bugs.webkit.org/show_bug.cgi?id=197656
1094
1095         Reviewed by Darin Adler.
1096
1097         According to https://drafts.csswg.org/css-cascade-4/#legacy-shorthand,
1098         implement page-break-* and -webkit-column-break-* as legacy-shorthands for break-*.
1099
1100         This change also serialize page-break-* properties
1101         to CSSStyleDeclaration,
1102         per https://drafts.csswg.org/css-break/#page-break-properties.
1103
1104         * css/CSSProperties.json:
1105         * css/StyleBuilderConverter.h:
1106         (WebCore::StyleBuilderConverter::convertFontSynthesis):
1107         (WebCore::StyleBuilderConverter::convertPageBreakBetween): Deleted.
1108         (WebCore::StyleBuilderConverter::convertPageBreakInside): Deleted.
1109         (WebCore::StyleBuilderConverter::convertColumnBreakBetween): Deleted.
1110         (WebCore::StyleBuilderConverter::convertColumnBreakInside): Deleted.
1111         * css/StyleProperties.cpp:
1112         (WebCore::StyleProperties::getPropertyValue const):
1113         (WebCore::StyleProperties::pageBreakPropertyValue const):
1114         * css/StyleProperties.h:
1115         * css/parser/CSSPropertyParser.cpp:
1116         (WebCore::CSSPropertyParser::parseValueStart):
1117         (WebCore::mapFromPageBreakBetween):
1118         (WebCore::CSSPropertyParser::parseShorthand):
1119         (WebCore::isLegacyBreakProperty): Deleted.
1120
1121 2019-05-14  Javier Fernandez  <jfernandez@igalia.com>
1122
1123         Implement "line-break: anywhere"
1124         https://bugs.webkit.org/show_bug.cgi?id=181169
1125         <rdar://problem/48507088>
1126
1127         Reviewed by Myles C. Maxfield.
1128
1129         The CSS WG resolved [1] to add a new value 'anywhere' to the 'line-break'
1130         CSS property in order to allow additional breaking opportunities not
1131         considered in the definition of the 'word-break: break-all'.
1132
1133         [1] https://github.com/w3c/csswg-drafts/issues/1171
1134
1135         Tests: imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-003.html
1136                imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-004.html
1137                imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-005.html
1138                imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-006.html
1139                imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-007.html
1140                imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-008.html
1141                imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-009.html
1142                imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-010.html
1143                imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-011.html
1144                imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-012.html
1145                imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-016.html
1146                imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-017.html
1147                imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-018.html
1148                imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-019.html
1149                imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-021.html
1150                imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-022.html
1151                imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-023.html
1152                imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-024.html
1153
1154         * css/CSSPrimitiveValueMappings.h:
1155         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
1156         (WebCore::CSSPrimitiveValue::operator LineBreak const):
1157         * css/CSSProperties.json:
1158         * css/CSSValueKeywords.in:
1159         * css/parser/CSSParserFastPaths.cpp:
1160         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
1161         * rendering/BreakLines.h:
1162         (WebCore::nextBreakablePositionBreakCharacter):
1163         (WebCore::isBreakable):
1164         * rendering/RenderText.cpp:
1165         (WebCore::mapLineBreakToIteratorMode):
1166         (WebCore::RenderText::computePreferredLogicalWidths):
1167         * rendering/line/BreakingContext.h:
1168         (WebCore::BreakingContext::handleText):
1169         * rendering/style/RenderStyleConstants.h:
1170
1171 2019-05-13  Yusuke Suzuki  <ysuzuki@apple.com>
1172
1173         Unreviewed, build fix after 245258, missing ThreadSpecific.h include
1174         https://bugs.webkit.org/show_bug.cgi?id=197146
1175
1176         * platform/ios/wak/WebCoreThread.mm:
1177
1178 2019-05-13  Yusuke Suzuki  <ysuzuki@apple.com>
1179
1180         [WTF] Simplify GCThread and CompilationThread flags by adding them to WTF::Thread
1181         https://bugs.webkit.org/show_bug.cgi?id=197146
1182
1183         Reviewed by Saam Barati.
1184
1185         * Modules/indexeddb/IDBDatabase.cpp:
1186         (WebCore::IDBDatabase::hasPendingActivity const):
1187         * Modules/indexeddb/IDBRequest.cpp:
1188         (WebCore::IDBRequest::hasPendingActivity const):
1189         * Modules/indexeddb/IDBTransaction.cpp:
1190         (WebCore::IDBTransaction::hasPendingActivity const):
1191
1192 2019-05-13  Geoffrey Garen  <ggaren@apple.com>
1193
1194         Downgrade RELEASE_ASSERT TO RELEASE_LOG_FAULT for SQLite Class A files
1195         https://bugs.webkit.org/show_bug.cgi?id=197760
1196
1197         Reviewed by Jer Noble.
1198
1199         Only makeSafeToUseMemoryMapForPath() if needed. (Fixed missing brace.)
1200
1201         * platform/sql/SQLiteDatabase.cpp:
1202         (WebCore::SQLiteDatabase::open):
1203
1204 2019-05-13  Tadeu Zagallo  <tzagallo@apple.com>
1205
1206         JSObject::getOwnPropertyDescriptor is missing an exception check
1207         https://bugs.webkit.org/show_bug.cgi?id=197693
1208
1209         Reviewed by Saam Barati.
1210
1211         JSObject::getOwnPropertyDescriptor assumes that getOwnPropertySlot returns false
1212         if an exception is thrown, but that was not true for JSLocation::getOwnPropertySlotCommon.
1213
1214         This is already covered by http/tests/security/cross-frame-access-getOwnPropertyDescriptor.html
1215
1216         * bindings/js/JSLocationCustom.cpp:
1217         (WebCore::getOwnPropertySlotCommon):
1218         (WebCore::JSLocation::getOwnPropertySlot):
1219         (WebCore::JSLocation::getOwnPropertySlotByIndex):
1220
1221 2019-05-13  Antti Koivisto  <antti@apple.com>
1222
1223         REGRESSION (r245208): compositing/shared-backing/sharing-bounds-non-clipping-shared-layer.html asserts
1224         https://bugs.webkit.org/show_bug.cgi?id=197818
1225         <rdar://problem/50705762>
1226
1227         Reviewed by Simon Fraser.
1228
1229         Tests: fast/scrolling/ios/event-region-scale-transform-shared.html
1230                fast/scrolling/ios/event-region-translate-transform-shared.html
1231
1232         This fixes the assert. However the added tests demonstrate that transform is not taken into account
1233         when computing the event region, https://bugs.webkit.org/show_bug.cgi?id=197836.
1234
1235         * rendering/RenderLayerBacking.cpp:
1236         (WebCore::RenderLayerBacking::updateEventRegion):
1237
1238 2019-05-13  Wenson Hsieh  <wenson_hsieh@apple.com>
1239
1240         [macOS] Font formatting options don't work when composing a message in Yahoo mail
1241         https://bugs.webkit.org/show_bug.cgi?id=197813
1242         <rdar://problem/49382250>
1243
1244         Reviewed by Darin Adler.
1245
1246         The bug happens because on mousedown, the "Aa Font" menu item's event handler hides itself before changing the
1247         font at the text selection. This causes us to clear the selection in FocusController::setFocusedElement.
1248
1249         There is existing logic in clearSelectionIfNeeded that would normally prevent us from clearing the selection due
1250         to the mousePressNode not being able to start a selection. However, since the clickable element in this case is
1251         hidden during mousedown, it is missing a renderer, and we bail from the `mousePressNode->renderer() &&
1252         !mousePressNode->canStartSelection()` check as a result.
1253
1254         This check was orginally added in https://trac.webkit.org/r24334 to avoid clearing the selection when clicking
1255         a button; the intention appears to have been making it so that clicking on something that could not start a
1256         selection (back then, synonymous with -webkit-user-select: ignore;) would not clear the current selection; to
1257         this end, it seems odd to additionally require that the thing being clicked should still have a renderer, so
1258         it seems safe to remove this requirement.
1259
1260         Test: editing/selection/preserve-selection-when-clicking-button.html
1261
1262         * page/FocusController.cpp:
1263         (WebCore::clearSelectionIfNeeded):
1264
1265 2019-05-13  Eric Carlson  <eric.carlson@apple.com>
1266
1267         https://bugs.webkit.org/show_bug.cgi?id=197793
1268         <rdar://problem/46429187>
1269
1270         Unreviewed, build fix after r245199.
1271
1272         * platform/audio/ios/MediaSessionManagerIOS.mm:
1273         (WebCore::MediaSessionManageriOS::externalOutputDeviceAvailableDidChange):
1274
1275 2019-05-13  Darin Adler  <darin@apple.com>
1276
1277         WHLSLPrepare.cpp always recompiles, even if nothing was changed
1278         https://bugs.webkit.org/show_bug.cgi?id=197151
1279
1280         Reviewed by Dan Bernstein and Keith Rollin.
1281
1282         * DerivedSources-input.xcfilelist: Script updated this automatically after
1283         DerivedSources.make was corrected.
1284         * DerivedSources-output.xcfilelist: Ditto, although I had to manually remove
1285         one bogus leftover reference to WHLSLStandardLibrary.cpp.
1286
1287         * DerivedSources.make: Updated the rule that builds WHSLStandardLibrary.h to
1288         no longer refer to nonexistent WHLSLStandardLibrary.cpp. Because the dependency
1289         was on a file that was never created, the rule to regenerate WHSLStandardLibrary.h
1290         was running on every build, instead of only when one of the dependencies changed.
1291
1292 2019-05-12  Simon Fraser  <simon.fraser@apple.com>
1293
1294         When the set of backing-sharing layers changes, we need to issue a repaint
1295         https://bugs.webkit.org/show_bug.cgi?id=197825
1296
1297         Reviewed by Zalan Bujtas.
1298
1299         If the set of layers painting into a shared backing store changes, we need
1300         to repaint that backing store. This happens when scrolling as shared layers
1301         enter the visible area.
1302
1303         Test: compositing/shared-backing/overflow-scroll/repaint-shared-on-scroll.html
1304
1305         * rendering/RenderLayerBacking.cpp:
1306         (WebCore::RenderLayerBacking::setBackingSharingLayers):
1307
1308 2019-05-02  Simon Fraser  <simon.fraser@apple.com>
1309
1310         Add logging for RenderLayer clip rects
1311         https://bugs.webkit.org/show_bug.cgi?id=197547
1312
1313         Reviewed by Zalan Bujtas.
1314
1315         Add a ClipRects log channel, and stream output for ClipRect and ClipRects.
1316
1317         The ClipRect code is performance sensitive, even in debug, so guard the log sites
1318         with clipRectsLogEnabled() because the macro still evaluates its arguments even if
1319         the channel is disabled (we need some better way to log that doesn't do this).
1320
1321         * platform/Logging.h:
1322         * rendering/ClipRect.cpp:
1323         (WebCore::operator<<):
1324         * rendering/ClipRect.h:
1325         * rendering/RenderLayer.cpp:
1326         (WebCore::operator<<):
1327         (WebCore::RenderLayer::calculateClipRects const):
1328         * rendering/RenderLayer.h:
1329
1330 2019-05-12  Simon Fraser  <simon.fraser@apple.com>
1331
1332         Refactor composited backing-sharing code
1333         https://bugs.webkit.org/show_bug.cgi?id=197824
1334
1335         Reviewed by Zalan Bujtas.
1336
1337         Clean up the backing-sharing code to share more code, and make it easier to understand.
1338         
1339         Moves more logic into member functions on BackingSharingState, which are named to make
1340         their functions clearer: startBackingSharingSequence/endBackingSharingSequence.
1341         
1342         computeCompositingRequirements() and traverseUnchangedSubtree() now just call
1343         updateBeforeDescendantTraversal/updateAfterDescendantTraversal.
1344
1345         No behavior change.
1346
1347         * rendering/RenderLayerBacking.cpp:
1348         (WebCore::RenderLayerBacking::willBeDestroyed):
1349         (WebCore::RenderLayerBacking::setBackingSharingLayers): Remove the early return, since
1350         we need to call setBackingProviderLayer() on the sharing layers in both code paths.
1351         (WebCore::RenderLayerBacking::removeBackingSharingLayer):
1352         (WebCore::RenderLayerBacking::clearBackingSharingLayers):
1353         * rendering/RenderLayerCompositor.cpp:
1354         (WebCore::RenderLayerCompositor::BackingSharingState::backingProviderCandidate const):
1355         (WebCore::RenderLayerCompositor::BackingSharingState::appendSharingLayer):
1356         (WebCore::RenderLayerCompositor::BackingSharingState::startBackingSharingSequence):
1357         (WebCore::RenderLayerCompositor::BackingSharingState::endBackingSharingSequence):
1358         (WebCore::RenderLayerCompositor::BackingSharingState::updateBeforeDescendantTraversal):
1359         (WebCore::RenderLayerCompositor::BackingSharingState::updateAfterDescendantTraversal):
1360         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
1361         (WebCore::RenderLayerCompositor::traverseUnchangedSubtree):
1362         (WebCore::RenderLayerCompositor::BackingSharingState::resetBackingProviderCandidate): Deleted.
1363         * rendering/RenderLayerCompositor.h:
1364
1365 2019-05-12  Youenn Fablet  <youenn@apple.com>
1366
1367         Use clampTo in AVVideoCaptureSource::setSizeAndFrameRateWithPreset
1368         https://bugs.webkit.org/show_bug.cgi?id=197704
1369
1370         Reviewed by Alex Christensen.
1371
1372         Use clampTo as suggested in bug 196214 review.
1373         No change of behavior.
1374
1375         * platform/mediastream/mac/AVVideoCaptureSource.mm:
1376         (WebCore::AVVideoCaptureSource::setSizeAndFrameRateWithPreset):
1377
1378 2019-05-12  Youenn Fablet  <youenn@apple.com>
1379
1380         Use the main screen for screen capture
1381         https://bugs.webkit.org/show_bug.cgi?id=197804
1382         <rdar://problem/47671383>
1383
1384         Reviewed by Eric Carlson.
1385
1386         If the main screen, i.e. the screen that has focus at the time of
1387         selection of the screen to capture, is capturable, add it to the list
1388         of screen devices, but do not add any other screen.
1389         This will make sure the main screen is selected.
1390         Manually tested.
1391
1392         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
1393         (WebCore::ScreenDisplayCaptureSourceMac::screenCaptureDevices):
1394
1395 2019-05-12  Takashi Komori  <Takashi.Komori@sony.com>
1396
1397         [Curl] Suppress extra didReceiveAuthenticationChallenge call when accessing a server which checks basic auth.
1398         https://bugs.webkit.org/show_bug.cgi?id=197650
1399
1400         Reviewed by Fujii Hironori.
1401
1402         When Curl port accesses a page which checks Basic Authentication credential and server trust challenge occurs,
1403         Curl port calls extra didReceiveAuthenticationChallenge unnecessarily.
1404         This is because Curl port discards information about allowed server trust challenge before in NetworkDataTaskCurl::restartWithCredential.
1405
1406         Test: http/tests/ssl/curl/certificate-and-authentication.html
1407
1408         * platform/network/curl/CurlRequest.h:
1409         (WebCore::CurlRequest::isServerTrustEvaluationDisabled):
1410
1411 2019-05-11  Simon Fraser  <simon.fraser@apple.com>
1412
1413         Overflow scroll that becomes non-scrollable should stop being composited
1414         https://bugs.webkit.org/show_bug.cgi?id=197817
1415         <rdar://problem/50697290>
1416
1417         Reviewed by Antti Koivisto.
1418
1419         Remove the iOS-specific #ifdef around code that triggers a compositing re-evaluation
1420         when scrolling state changes.
1421
1422         Test: compositing/scrolling/async-overflow-scrolling/become-non-scrollable.html
1423
1424         * rendering/RenderLayer.cpp:
1425         (WebCore::RenderLayer::updateScrollInfoAfterLayout):
1426
1427 2019-05-11  Simon Fraser  <simon.fraser@apple.com>
1428
1429         Layer bounds are incorrect for sharing layers that paint with transforms
1430         https://bugs.webkit.org/show_bug.cgi?id=197768
1431         <rdar://problem/50695493>
1432
1433         Reviewed by Zalan Bujtas.
1434
1435         We don't need to traverse shared layers if the backing-provider has overflow clip,
1436         because we know they are containing-block descendants and therefore clipped.
1437
1438         Note tha the CSS "clip" property doesn't guarantee this, because the clip rect
1439         can be larger than the element, so in that case we just traverse shared layers.
1440
1441         Tests: compositing/shared-backing/sharing-bounds-clip.html
1442                compositing/shared-backing/sharing-bounds-non-clipping-shared-layer.html
1443                compositing/shared-backing/sharing-bounds-transformed-sharing-layer.html
1444                compositing/shared-backing/sharing-bounds.html
1445
1446         * rendering/RenderLayerBacking.cpp:
1447         (WebCore::RenderLayerBacking::updateCompositedBounds):
1448
1449 2019-05-11  Simon Fraser  <simon.fraser@apple.com>
1450
1451         Translucent gradient rendering bug due to will-change transform
1452         https://bugs.webkit.org/show_bug.cgi?id=197654
1453         <rdar://problem/50547664>
1454
1455         Reviewed by Dean Jackson.
1456         
1457         We failed to re-evaluate 'contentsOpaque' when a background changed, because this
1458         happened in updateGeometry() and that doesn't run for background changes.
1459         
1460         However, 'contentsOpaque' also requires knowing about geometry because we have to
1461         turn it off when there's subpixel positioning, and updateConfiguration()
1462         runs before updateGeometry().
1463         
1464         So compute m_hasSubpixelRounding in updateGeometry() and set contentsOpaque in
1465         updateAfterDescendants().
1466
1467         Test: compositing/contents-opaque/background-change-to-transparent.html
1468
1469         * rendering/RenderLayerBacking.cpp:
1470         (WebCore::RenderLayerBacking::updateConfiguration):
1471         (WebCore::RenderLayerBacking::updateGeometry):
1472         (WebCore::RenderLayerBacking::updateAfterDescendants):
1473         * rendering/RenderLayerBacking.h:
1474
1475 2019-05-11  Simon Fraser  <simon.fraser@apple.com>
1476
1477         When the scroller hosting a shared layer becomes non-scrollable, content disappears
1478         https://bugs.webkit.org/show_bug.cgi?id=197766
1479         <rdar://problem/50695808>
1480
1481         Reviewed by Zalan Bujtas.
1482
1483         RenderLayerCompositor::requiresOwnBackingStore() should return true for a layer that shares
1484         its backing store. We always made backing for overlap layers, so even  if the sharing layers
1485         have no painted content, this should rarely be a backing store memory regression.
1486
1487         Test: compositing/shared-backing/overflow-scroll/sharing-layer-becomes-non-scrollable.html
1488
1489         * rendering/RenderLayerCompositor.cpp:
1490         (WebCore::RenderLayerCompositor::requiresOwnBackingStore const):
1491
1492 2019-05-11  Simon Fraser  <simon.fraser@apple.com>
1493
1494         Backing-sharing layers with transforms render incorrectly
1495         https://bugs.webkit.org/show_bug.cgi?id=197692
1496         <rdar://problem/50652127>
1497
1498         Reviewed by Antti Koivisto.
1499
1500         Layers that paint into shared backing need to enter the RenderLayer painting code
1501         in a way that paints the filters, transforms, opacity and blending.
1502         
1503         RenderLayerBacking::paintIntoLayer() normally enters at paintLayerContents(), because
1504         the effects are rendered via the GraphicsLayer, but shared layers will paint effects.
1505         Note that if the backing-provider has effects, it will be the stacking context
1506         for the shared layers, so it's correct that sharing layers are impacted by effects
1507         on the backing-provider.
1508
1509         In addition, we have to ensure that we don't over-eagerly make layers shared.
1510         Consider:
1511         
1512         <div class="clipping">
1513             <div class="sharing">
1514                 <div class="inner">
1515                 </div>
1516             </div>
1517         </div>
1518         
1519         Here "clipping" is the provider layer, "sharing" paints into shared backing, but
1520         we don't want to also mark "inner" as sharing, since "sharing" will just paint it.
1521         This is akin to avoiding unnecessary compositing of z-order descendants when they can just
1522         paint.
1523         
1524         To do this we need to ensure that sharing layers are treated like compositing layers
1525         in the overlap map, i.e. when a layer is sharing, we call overlapMap.pushCompositingContainer(),
1526         and later overlapMap.popCompositingContainer().
1527
1528         Tests: compositing/shared-backing/nested-shared-layers-with-opacity.html
1529                compositing/shared-backing/shared-layer-has-blending.html
1530                compositing/shared-backing/shared-layer-has-filter.html
1531                compositing/shared-backing/shared-layer-has-opacity.html
1532                compositing/shared-backing/shared-layer-has-reflection.html
1533                compositing/shared-backing/shared-layer-has-transform.html
1534                compositing/shared-backing/shared-layer-isolates-blending.html
1535                compositing/shared-backing/shared-transformed-layer-bounds.html
1536                compositing/shared-backing/sharing-layer-becomes-non-scrollable.html
1537                compositing/shared-backing/sharing-layer-has-effect.html
1538
1539         * rendering/RenderLayer.cpp:
1540         (WebCore::RenderLayer::paintLayer):
1541         (WebCore::RenderLayer::paintLayerWithEffects):
1542         * rendering/RenderLayer.h:
1543         * rendering/RenderLayerBacking.cpp:
1544         (WebCore::RenderLayerBacking::paintIntoLayer):
1545         * rendering/RenderLayerCompositor.cpp:
1546         (WebCore::RenderLayerCompositor::CompositingState::stateForPaintOrderChildren const):
1547         (WebCore::backingProviderLayerCanIncludeLayer):
1548         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
1549         (WebCore::RenderLayerCompositor::traverseUnchangedSubtree):
1550
1551 2019-05-10  Youenn Fablet  <youenn@apple.com>
1552
1553         A service worker instance should be terminated when its SWServer is destroyed
1554         https://bugs.webkit.org/show_bug.cgi?id=197801
1555         <rdar://problem/50587270>
1556
1557         Reviewed by Chris Dumez.
1558
1559         On session destruction, the SWServer is destroyed.
1560         At that time, it should terminate all its running service workers.
1561         Covered by updated API test.
1562
1563         * workers/service/server/SWServer.cpp:
1564         (WebCore::SWServer::~SWServer):
1565
1566 2019-05-10  Eric Carlson  <eric.carlson@apple.com>
1567
1568         [iOS] HTMLMediaElement sometimes doesn't send 'webkitplaybacktargetavailabilitychanged' event
1569         https://bugs.webkit.org/show_bug.cgi?id=197793
1570         <rdar://problem/46429187>
1571
1572         Reviewed by Jer Noble.
1573
1574         * html/MediaElementSession.cpp:
1575         (WebCore::MediaElementSession::MediaElementSession): Initialize m_hasPlaybackTargets.
1576
1577         * platform/audio/ios/MediaSessionManagerIOS.mm:
1578         (WebCore::MediaSessionManageriOS::externalOutputDeviceAvailableDidChange): Log
1579         target availability.
1580         (-[WebMediaSessionHelper startMonitoringAirPlayRoutes]): Call the client 
1581         externalOutputDeviceAvailableDidChange method after the AVRouteDetector is available.
1582
1583 2019-05-09  Geoffrey Garen  <ggaren@apple.com>
1584
1585         Downgrade RELEASE_ASSERT TO RELEASE_LOG_FAULT for SQLite Class A files
1586         https://bugs.webkit.org/show_bug.cgi?id=197760
1587
1588         Reviewed by Jer Noble.
1589
1590         We have all the data we need, and this crash is happening more than
1591         expected.
1592
1593         * platform/sql/SQLiteDatabase.cpp:
1594         (WebCore::SQLiteDatabase::open):
1595
1596 2019-05-10  Zalan Bujtas  <zalan@apple.com>
1597
1598         [iOS] baidu.com: Synthetic bold renders too far apart, appears doubled.
1599         https://bugs.webkit.org/show_bug.cgi?id=197781
1600         <rdar://problem/48027412>
1601
1602         Reviewed by Simon Fraser.
1603
1604         Synthetic bold is essentially two regular glyphs painted with an offset. While on macOS this offset is always 1px (CSS), on iOS larger font produces higher offset value. At paint time, this offset value (in CSS px unit) get converted
1605         to a device pixel value taking context scale into account. This conversion ensures that the gap between the 2 regular glyphs won't get wider (in device pixels) as the user pinch zooms in.
1606         This works as long as the scale on the context is >= 1. This patch ensures that a scaled down context won't blow up this gap.
1607
1608         Test: fast/text/large-synthetic-bold-with-scale-transform.html
1609
1610         * platform/graphics/cocoa/FontCascadeCocoa.mm:
1611         (WebCore::FontCascade::drawGlyphs):
1612
1613 2019-05-10  Brent Fulgham  <bfulgham@apple.com>
1614
1615         Gracefully handle inaccessible font face data
1616         https://bugs.webkit.org/show_bug.cgi?id=197762
1617         <rdar://problem/50433861>
1618
1619         Reviewed by Per Arne Vollan.
1620
1621         Make sure CSS Font Face handling gracefully recovers from
1622         missing font data.
1623
1624         Test: fast/text/missing-font-crash.html
1625
1626         * css/CSSFontFace.cpp:
1627         (WebCore::CSSFontFace::fontLoadEventOccurred):
1628         (WebCore::CSSFontFace::timeoutFired):
1629         (WebCore::CSSFontFace::fontLoaded):
1630         (WebCore::CSSFontFace::font):
1631
1632 2019-05-10  Simon Fraser  <simon.fraser@apple.com>
1633
1634         ASSERT(isSelfPaintingLayer() || hasSelfPaintingLayerDescendant()) on nytimes.com after r245170
1635         https://bugs.webkit.org/show_bug.cgi?id=197776
1636
1637         Reviewed by Zalan Bujtas.
1638
1639         Only try to paint into shared backing for layers that are able to be composited. This
1640         avoids trying to do sharing for non-self-painting layers, which doesn't make sense.
1641
1642         Test: compositing/shared-backing/overflow-scroll/non-self-painting-layer-should-not-share.html
1643
1644         * rendering/RenderLayerCompositor.cpp:
1645         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
1646
1647 2019-05-10  Michael Catanzaro  <mcatanzaro@igalia.com>
1648
1649         Fix a bunch of compiler warnings
1650         https://bugs.webkit.org/show_bug.cgi?id=197785
1651
1652         Reviewed by Don Olmstead.
1653
1654         * CMakeLists.txt: WebCoreTestSupport should accept extra SYSTEM includes.
1655         * PlatformGTK.cmake: GTK includes should be added to SYSTEM headers to avoid warnings.
1656         * inspector/InspectorCanvas.cpp: Add preprocessor guards to fix unused function warning.
1657         * rendering/RenderLayer.cpp: Fix unused variable warning.
1658         (WebCore::RenderLayer::updateClipRects):
1659
1660 2019-05-10  Antti Koivisto  <antti@apple.com>
1661
1662         Event region generation needs to know about backing-sharing
1663         https://bugs.webkit.org/show_bug.cgi?id=197694
1664         <rdar://problem/50584991>
1665
1666         Reviewed by Simon Fraser.
1667
1668         Test: pointerevents/ios/touch-action-region-backing-sharing.html
1669
1670         * rendering/RenderLayerBacking.cpp:
1671         (WebCore::RenderLayerBacking::updateEventRegion):
1672
1673         Gather event region from backing sharing layers too.
1674
1675 2019-05-10  Michael Catanzaro  <mcatanzaro@igalia.com>
1676
1677         [WPE][GTK] Add WebKitWebPage::did-associate-form-controls-for-frame and deprecate original did-associate-form-controls
1678         https://bugs.webkit.org/show_bug.cgi?id=197271
1679
1680         Reviewed by Youenn Fablet.
1681
1682         * dom/Document.cpp:
1683         (WebCore::Document::didAssociateFormControlsTimerFired):
1684         * loader/EmptyClients.h:
1685         * page/ChromeClient.h:
1686
1687 2019-05-09  Simon Fraser  <simon.fraser@apple.com>
1688
1689         Implement backing-sharing in compositing layers, allowing overlap layers to paint into the backing store of another layer
1690         https://bugs.webkit.org/show_bug.cgi?id=197561
1691         <rdar://problem/50445998>
1692
1693         Reviewed by Antti Koivisto.
1694
1695         This change introduces the concept of layers that share backing store for compositing. A layer
1696         which is sharing its backing store first paints itself, and then some set of layers which come
1697         later in paint order in the same stacking context. This reduces the composited layer count in
1698         some overflow scrolling scenarios, thereby also simplifying the scrolling tree.
1699         
1700         A backing-shared layer stores a vector of "sharing" RenderLayer* in its RenderLayerBacking. At
1701         paint time, the owning layer is painted, then the sharing layers, setting the owning layer as the
1702         painting root so that positioning and clipping just work.
1703         
1704         Sharing layer relationships are constructed in RenderLayerCompositor::computeCompositingRequirements().
1705         We track the last layer which was composited in paint order as a shared candidate. If a later layer
1706         would composite for overlap (and no other reasons), then we allow it to share with the candidate
1707         if the candidate is in its ancestor containing block chain. Sharing is currently limited to layers
1708         in the same stacking context.
1709         
1710         isComposited() returns false for sharing layers, but they are like composited layers in that
1711         they behave as painting boundaries, so RenderLayer::paintLayer() needs to stop at them,
1712         and repaints in shared layers have to be directed to their shared layer, hence
1713         changes to RenderLayer::clippingRootForPainting() and RenderLayer::enclosingCompositingLayerForRepaint().
1714         
1715         The clipping boundary logic in RenderLayer::backgroundClipRect() needed to be generalized so that
1716         all calls to RenderLayer::parentClipRects() check for crossing painting boundaries and use
1717         TemporaryClipRects in that case.
1718
1719         Tests: compositing/shared-backing/overflow-scroll/absolute-in-stacking-relative-in-scroller.html
1720                compositing/shared-backing/overflow-scroll/composited-absolute-in-absolute-in-relative-in-scroller.html
1721                compositing/shared-backing/overflow-scroll/nested-absolute-with-clipping-in-stacking-overflow.html
1722                compositing/shared-backing/overflow-scroll/previous-sibling-prevents-inclusiveness.html
1723                compositing/shared-backing/overflow-scroll/relative-in-clipping-in-scroller-in-clipping.html
1724                compositing/shared-backing/overflow-scroll/relative-in-clipping-in-scroller-in-relative-clipping.html
1725                compositing/shared-backing/overflow-scroll/relative-in-div-in-overflow-scroll.html
1726                compositing/shared-backing/overflow-scroll/scrolled-contents-has-painted-content.html
1727                compositing/shared-backing/overflow-scroll/scrolled-contents-unconstrained-clip.html
1728                compositing/shared-backing/overflow-scroll/shared-layer-clipping.html
1729                compositing/shared-backing/overflow-scroll/shared-layer-composited-bounds.html
1730                compositing/shared-backing/overflow-scroll/shared-layer-nested-relative-stacking.html
1731                compositing/shared-backing/overflow-scroll/shared-layer-repaint.html
1732                compositing/shared-backing/partial-compositing-update.html
1733                compositing/shared-backing/partial-compositing-update2.html
1734                compositing/shared-backing/remove-sharing-layer.html
1735                compositing/shared-backing/sharing-cached-clip-rects.html
1736
1737         * rendering/RenderLayer.cpp:
1738         (WebCore::RenderLayer::~RenderLayer):
1739         (WebCore::RenderLayer::ancestorLayerIsInContainingBlockChain const):
1740         (WebCore::RenderLayer::setBackingProviderLayer):
1741         (WebCore::RenderLayer::disconnectFromBackingProviderLayer):
1742         (WebCore::RenderLayer::enclosingCompositingLayerForRepaint const):
1743         (WebCore::RenderLayer::clippingRootForPainting const):
1744         (WebCore::RenderLayer::clipToRect):
1745         (WebCore::RenderLayer::paintLayer):
1746         (WebCore::RenderLayer::updateClipRects):
1747         (WebCore::RenderLayer::clipCrossesPaintingBoundary const):
1748         (WebCore::RenderLayer::calculateClipRects const):
1749         (WebCore::outputPaintOrderTreeLegend):
1750         (WebCore::outputPaintOrderTreeRecursive):
1751         (WebCore::inContainingBlockChain): Deleted.
1752         * rendering/RenderLayer.h:
1753         * rendering/RenderLayerBacking.cpp:
1754         (WebCore::RenderLayerBacking::willBeDestroyed):
1755         (WebCore::clearBackingSharingLayerProviders):
1756         (WebCore::RenderLayerBacking::setBackingSharingLayers):
1757         (WebCore::RenderLayerBacking::removeBackingSharingLayer):
1758         (WebCore::RenderLayerBacking::clearBackingSharingLayers):
1759         (WebCore::RenderLayerBacking::updateCompositedBounds):
1760         (WebCore::RenderLayerBacking::updateDrawsContent):
1761         (WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer const):
1762         (WebCore::RenderLayerBacking::paintIntoLayer):
1763         (WebCore::RenderLayerBacking::paintContents):
1764         * rendering/RenderLayerBacking.h:
1765         * rendering/RenderLayerCompositor.cpp:
1766         (WebCore::RenderLayerCompositor::CompositingState::stateForPaintOrderChildren const):
1767         (WebCore::RenderLayerCompositor::CompositingState::propagateStateFromChildren):
1768         (WebCore::RenderLayerCompositor::CompositingState::propagateStateFromChildrenForUnchangedSubtree):
1769         (WebCore::RenderLayerCompositor::BackingSharingState::resetBackingProviderCandidate):
1770         (WebCore::RenderLayerCompositor::updateCompositingLayers):
1771         (WebCore::backingProviderLayerCanIncludeLayer):
1772         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
1773         (WebCore::RenderLayerCompositor::traverseUnchangedSubtree):
1774         (WebCore::RenderLayerCompositor::updateBacking):
1775         (WebCore::RenderLayerCompositor::layerWillBeRemoved):
1776         (WebCore::RenderLayerCompositor::requiresCompositingForIndirectReason const):
1777         * rendering/RenderLayerCompositor.h:
1778         * rendering/RenderTreeAsText.cpp:
1779
1780 2019-05-09  Daniel Bates  <dabates@apple.com>
1781
1782         [iOS] Right command key has wrong value for property code
1783         https://bugs.webkit.org/show_bug.cgi?id=193876
1784         <rdar://problem/47577308>
1785
1786         Reviewed by Brent Fulgham.
1787
1788         We're looking for the wrong Windows virtual key code for the right command key.
1789         Substitute VK_APPS for VK_RWIN so we can identify the right command key and return
1790         the correct value for the code property of the DOM key event.
1791
1792         * platform/ios/PlatformEventFactoryIOS.mm:
1793         (WebCore::codeForKeyEvent):
1794
1795 2019-05-09  Daniel Bates  <dabates@apple.com>
1796
1797         [iOS] Numpad comma key has incorrect keyIdentifier property
1798         https://bugs.webkit.org/show_bug.cgi?id=197753
1799         <rdar://problem/50636274>
1800
1801         Reviewed by Brent Fulgham.
1802
1803         Map the Numpad Comma HID usage code to its Window virtual key code, VK_SEPARATOR,
1804         so that can compute the keyIdentifier property for the Numpad Comma key. Also
1805         consider this key as a keypad key just like we do on Mac. There is no discernable
1806         difference for doing so on iOS because the non-keypad code path computes the same result
1807         due to GraphicsServices having fixed up the input string for the Numpad Comma to be
1808         ",", which is want.
1809
1810         * platform/ios/KeyEventIOS.mm:
1811         (WebCore::windowsKeyCodeForKeyCode): Map kHIDUsage_KeypadComma to VK_SEPARATOR.
1812         * platform/ios/PlatformEventFactoryIOS.mm:
1813         (WebCore::codeForKeyEvent): Add a comment to explain that this key is only on
1814         JIS keyboards.
1815         (WebCore::isKeypadEvent): Return true for the Numpad Comma key.
1816
1817 2019-05-09  Zalan Bujtas  <zalan@apple.com>
1818
1819         Do not mix inline and block level boxes.
1820         https://bugs.webkit.org/show_bug.cgi?id=197462
1821         <rdar://problem/50369362>
1822
1823         Reviewed by Antti Koivisto.
1824
1825         This patch tightens the remove-anonymous-wrappers logic by checking if the removal would
1826         produce an inline-block sibling mix.
1827         When a block level box is removed from the tree, we check if after the removal the anonymous sibling block
1828         boxes are still needed or whether we can removed them as well (and have only inline level child boxes).
1829         In addition to checking if the container is anonymous and is part of a continuation, we also need to check
1830         if collapsing it (and by that moving its children one level up) would cause a inline-block box mix.
1831
1832         Test: fast/ruby/continuation-and-column-spanner-crash.html
1833
1834         * rendering/updating/RenderTreeBuilder.cpp:
1835         (WebCore::RenderTreeBuilder::removeAnonymousWrappersForInlineChildrenIfNeeded):
1836         * rendering/updating/RenderTreeBuilderContinuation.cpp:
1837         (WebCore::RenderTreeBuilder::Continuation::cleanupOnDestroy):
1838
1839 2019-05-09  Eric Carlson  <eric.carlson@apple.com>
1840
1841         Refine AudioSession route sharing policy
1842         https://bugs.webkit.org/show_bug.cgi?id=197742
1843         <rdar://problem/50590818>
1844
1845         Reviewed by Darin Adler.
1846
1847         No new tests, updated AVAudioSessionRouteSharingPolicy API test.
1848
1849         * platform/audio/cocoa/MediaSessionManagerCocoa.mm:
1850         (MediaSessionManagerCocoa::updateSessionState):
1851
1852 2019-05-09  Simon Fraser  <simon.fraser@apple.com>
1853
1854         fast/hidpi/video-controls-in-hidpi.html sometimes asserts in WK1
1855         https://bugs.webkit.org/show_bug.cgi?id=197695
1856
1857         Reviewed by Zalan Bujtas.
1858
1859         With the backing-sharing changes that landed in r245058, some WebKit1 tests with media controls asserted in
1860         RenderLayerBacking::computeParentGraphicsLayerRect() because a layer would have a m_ancestorClippingLayer,
1861         but backgroundClipRect() would return an infinite rect.
1862         
1863         This happened when a layer tree change caused the layer's compositing ancestor to no longer isolate
1864         composited blending (which affects the behavior of RenderLayerCompositor:clippedByAncestor()), but we failed
1865         to mark its composited children as needing the configuration update which would eliminate their m_ancestorClippingLayers.
1866         
1867         The fix is to call setChildrenNeedCompositingGeometryUpdate() when isolatesCompositedBlending changes. We don't haev
1868         setChildrenNeedCompositingConfigurationUpdate(), but setChildrenNeedCompositingGeometryUpdate() has the desired side-effect.
1869
1870         I was unable to make a standalone test case for this, but the code is exercised by media control tests.
1871
1872         * rendering/RenderLayerCompositor.cpp:
1873         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
1874
1875 2019-05-09  Brent Fulgham  <bfulgham@apple.com>
1876
1877         Correct delayed load event handling
1878         https://bugs.webkit.org/show_bug.cgi?id=197679
1879         <rdar://problem/50423334>
1880
1881         Reviewed by Alex Christensen.
1882
1883         We need to properly account for the fact that JavaScript might run
1884         while performing loads.
1885
1886         * dom/Document.cpp:
1887         (WebCore::Document::loadEventDelayTimerFired):
1888
1889 2019-05-09  Antti Koivisto  <antti@apple.com>
1890
1891         Elements with "display: inline-block" don't have a touch-action region
1892         https://bugs.webkit.org/show_bug.cgi?id=197281
1893         <rdar://problem/50535081>
1894
1895         Reviewed by Antoine Quint.
1896
1897         Test: pointerevents/ios/touch-action-region-inline-block.html
1898
1899         PaintPhase::EventRegion failed to traverse into inline boxes.
1900
1901         * rendering/InlineElementBox.cpp:
1902         (WebCore::InlineElementBox::paint):
1903         * rendering/RenderElement.cpp:
1904         (WebCore::RenderElement::paintAsInlineBlock):
1905
1906 2019-05-08  Carlos Garcia Campos  <cgarcia@igalia.com>
1907
1908         REGRESSION(r239915): [FreeType] White space skipped when rendering plain text with noto CJK font
1909         https://bugs.webkit.org/show_bug.cgi?id=197658
1910
1911         Reviewed by Michael Catanzaro.
1912
1913         Since r239915 we no longer overwrite control characters with zero width space, they are handled later when
1914         filling the glyph pages. In Font::platformGlyphInit() there's an optimization to get the glyph of zero with
1915         space character that assumes that control characters are always overwritten. Since the glyph for character at 0
1916         index is always overwritten with zero width space, we can avoid loading the page for the actual zero width space
1917         character and use the first page instead. In the particular case of noto CJK font, character at 0 is mapped to
1918         the same glyph as space character, so space and zero width space end up being the same glyph. That breaks the
1919         space width calculation, that returns 0 when isZeroWidthSpaceGlyph() is true. That's why spaces are no
1920         longer rendered, ComplexTextController::adjustGlyphsAndAdvances() is setting the x advance for the space glyphs
1921         to 0.
1922
1923         * platform/graphics/Font.cpp:
1924         (WebCore::Font::platformGlyphInit): Use the actual zero width space page to get the glyph instead of 0 when
1925         using FreeType.
1926
1927 2019-05-08  Alex Christensen  <achristensen@webkit.org>
1928
1929         Fix WPE build.
1930
1931         * CMakeLists.txt:
1932         Bots wanted a "PUBLIC" or "PRIVATE" keyword here.
1933
1934 2019-05-08  Alex Christensen  <achristensen@webkit.org>
1935
1936         Try to fix Linux build
1937
1938         * platform/graphics/ANGLEWebKitBridge.h:
1939         Include headers consistently on all platforms.
1940
1941 2019-05-08  Don Olmstead  <don.olmstead@sony.com>
1942
1943         Update ANGLE
1944         https://bugs.webkit.org/show_bug.cgi?id=197676
1945
1946         Reviewed by Alex Christensen.
1947
1948         * CMakeLists.txt:
1949         * PlatformGTK.cmake:
1950         * PlatformMac.cmake:
1951         * PlatformPlayStation.cmake:
1952         * PlatformWPE.cmake:
1953         * PlatformWin.cmake:
1954         * platform/graphics/GLContext.cpp:
1955         * platform/graphics/egl/GLContextEGL.cpp:
1956         * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
1957         * platform/graphics/opengl/Extensions3DOpenGLES.h:
1958         * platform/graphics/opengl/TemporaryOpenGLSetting.cpp:
1959         * platform/graphics/texmap/TextureMapperGLHeaders.h:
1960
1961 2019-05-08  Chris Dumez  <cdumez@apple.com>
1962
1963         [iOS Debug] ASSERTION FAILED: !m_originalNode in WebCore::JSLazyEventListener::checkValidityForEventTarget(WebCore::EventTarget &)
1964         https://bugs.webkit.org/show_bug.cgi?id=197696
1965         <rdar://problem/50586956>
1966
1967         Reviewed by Simon Fraser.
1968
1969         Setting the onorientationchange / onresize event handler on the body should set the event handler on the
1970         window object, as per the HTML specification. However, calling body.addEventListener() with 'orientationchange'
1971         or 'resize' should not set the event listener on the window object, only the body. Blink and Gecko seem to
1972         behave as per specification but WebKit had a quirk for the addEventListener case. The quirk's implementation
1973         is slightly wrong (because it is unsafe to take a JSLazyEventListener from a body element and add it to the
1974         window, given that the JSLazyEventListener keeps a raw pointer to its element) and was causing crashes such
1975         as <rdar://problem/24314027>. As a result, this patch simply drops the WebKit quirk, which will align our
1976         behavior with other browsers and fix the crashes altogether.
1977
1978         Test: fast/events/ios/rotation/orientationchange-event-listener-on.body.html
1979
1980         * dom/Node.cpp:
1981         (WebCore::tryAddEventListener):
1982         (WebCore::tryRemoveEventListener):
1983
1984 2019-05-08  Ryan Haddad  <ryanhaddad@apple.com>
1985
1986         Unreviewed, rolling out r245058.
1987
1988         Causes crashes under ASan / GuardMalloc
1989
1990         Reverted changeset:
1991
1992         "Implement backing-sharing in compositing layers, allowing
1993         overlap layers to paint into the backing store of another
1994         layer"
1995         https://bugs.webkit.org/show_bug.cgi?id=197561
1996         https://trac.webkit.org/changeset/245058
1997
1998 2019-05-08  Ryan Haddad  <ryanhaddad@apple.com>
1999
2000         Unreviewed, rolling out r245068.
2001
2002         Caused debug layout tests to exit early due to an assertion
2003         failure.
2004
2005         Reverted changeset:
2006
2007         "All prototypes should call didBecomePrototype()"
2008         https://bugs.webkit.org/show_bug.cgi?id=196315
2009         https://trac.webkit.org/changeset/245068
2010
2011 2019-05-08  Megan Gardner  <megan_gardner@apple.com>
2012
2013         Add quirks to emulate undo and redo in hidden editable areas on some websites
2014         https://bugs.webkit.org/show_bug.cgi?id=197452
2015
2016         Reviewed by Alex Christensen.
2017
2018         UI change, not testable.
2019
2020         We need to send synthetic keyboard events to the web process to emulate undo and redo
2021         key combinations for when we are trying to get our undo and redo UI to work
2022         on rich editing websites that only listen to keystrokes, and don't let us use our
2023         undo manager to help manage the input content.
2024
2025         * page/EventHandler.cpp:
2026         (WebCore::EventHandler::keyEvent):
2027         * platform/PlatformKeyboardEvent.h:
2028         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
2029         (WebCore::PlatformKeyboardEvent::isSyntheticEvent):
2030         (WebCore::PlatformKeyboardEvent::setSyntheticEvent):
2031         * platform/ios/KeyEventIOS.mm:
2032         (WebCore::PlatformKeyboardEvent::currentStateOfModifierKeys):
2033         * platform/ios/PlatformEventFactoryIOS.mm:
2034         (WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder):
2035         * platform/mac/PlatformEventFactoryMac.mm:
2036         (WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder):
2037
2038 2019-05-08  Don Olmstead  <don.olmstead@sony.com>
2039
2040         CSSFontFaceSource fails to compile when !ENABLE(SVG_FONTS)
2041         https://bugs.webkit.org/show_bug.cgi?id=197720
2042
2043         Unreviewed build fix.
2044
2045         Add usesInDocumentSVGFont to the !ENABLE(SVG_FONT) path.
2046
2047         * css/CSSFontFaceSource.cpp:
2048         (WebCore::CSSFontFaceSource::font):
2049
2050 2019-05-08  Timothy Hatcher  <timothy@apple.com>
2051
2052         Add plumbing for inactive system colors in RenderTheme cache.
2053         https://bugs.webkit.org/show_bug.cgi?id=197699
2054         rdar://problem/49406936
2055
2056         Reviewed by Tim Horton.
2057
2058         * css/StyleColor.h:
2059         * page/Page.cpp:
2060         (WebCore::Page::effectiveAppearanceDidChange): Renamed from setUseDarkAppearance.
2061         * page/Page.h:
2062         (WebCore::Page::useInactiveAppearance const):
2063         * rendering/RenderTheme.cpp:
2064         (WebCore::RenderTheme::purgeCaches):
2065         (WebCore::RenderTheme::platformColorsDidChange):
2066         (WebCore::RenderTheme::colorCache const):
2067         * rendering/RenderTheme.h:
2068         * testing/InternalSettings.cpp:
2069         (WebCore::InternalSettings::setUseDarkAppearanceInternal):
2070
2071 2019-05-08  Robin Morisset  <rmorisset@apple.com>
2072
2073         All prototypes should call didBecomePrototype()
2074         https://bugs.webkit.org/show_bug.cgi?id=196315
2075
2076         Reviewed by Saam Barati.
2077
2078         This changelog already landed, but the commit was missing the actual changes.
2079
2080         It was found by existing tests, with the new assert in JSC::Structure
2081
2082         * bindings/js/JSWindowProxy.cpp:
2083         (WebCore::JSWindowProxy::setWindow):
2084         * bindings/scripts/CodeGeneratorJS.pm:
2085         (GeneratePrototypeDeclaration):
2086         (GenerateConstructorHelperMethods):
2087         * bindings/scripts/test/JS/JSInterfaceName.cpp:
2088         (WebCore::JSInterfaceNamePrototype::JSInterfaceNamePrototype):
2089         * bindings/scripts/test/JS/JSMapLike.cpp:
2090         (WebCore::JSMapLikePrototype::JSMapLikePrototype):
2091         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
2092         (WebCore::JSReadOnlyMapLikePrototype::JSReadOnlyMapLikePrototype):
2093         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
2094         (WebCore::JSTestActiveDOMObjectPrototype::JSTestActiveDOMObjectPrototype):
2095         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
2096         (WebCore::JSTestCEReactionsPrototype::JSTestCEReactionsPrototype):
2097         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
2098         (WebCore::JSTestCEReactionsStringifierPrototype::JSTestCEReactionsStringifierPrototype):
2099         * bindings/scripts/test/JS/JSTestCallTracer.cpp:
2100         (WebCore::JSTestCallTracerPrototype::JSTestCallTracerPrototype):
2101         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
2102         (WebCore::JSTestClassWithJSBuiltinConstructorPrototype::JSTestClassWithJSBuiltinConstructorPrototype):
2103         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
2104         (WebCore::JSTestDOMJITPrototype::JSTestDOMJITPrototype):
2105         (WebCore::JSTestDOMJITConstructor::prototypeForStructure):
2106         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
2107         (WebCore::JSTestEnabledBySettingPrototype::JSTestEnabledBySettingPrototype):
2108         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
2109         (WebCore::JSTestEventConstructorPrototype::JSTestEventConstructorPrototype):
2110         (WebCore::JSTestEventConstructorConstructor::prototypeForStructure):
2111         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
2112         (WebCore::JSTestEventTargetPrototype::JSTestEventTargetPrototype):
2113         (WebCore::JSTestEventTargetConstructor::prototypeForStructure):
2114         * bindings/scripts/test/JS/JSTestException.cpp:
2115         (WebCore::JSTestExceptionPrototype::JSTestExceptionPrototype):
2116         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
2117         (WebCore::JSTestGenerateIsReachablePrototype::JSTestGenerateIsReachablePrototype):
2118         * bindings/scripts/test/JS/JSTestGlobalObject.h:
2119         (WebCore::JSTestGlobalObjectPrototype::JSTestGlobalObjectPrototype):
2120         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
2121         (WebCore::JSTestIndexedSetterNoIdentifierPrototype::JSTestIndexedSetterNoIdentifierPrototype):
2122         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
2123         (WebCore::JSTestIndexedSetterThrowingExceptionPrototype::JSTestIndexedSetterThrowingExceptionPrototype):
2124         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
2125         (WebCore::JSTestIndexedSetterWithIdentifierPrototype::JSTestIndexedSetterWithIdentifierPrototype):
2126         * bindings/scripts/test/JS/JSTestInterface.cpp:
2127         (WebCore::JSTestInterfacePrototype::JSTestInterfacePrototype):
2128         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
2129         (WebCore::JSTestInterfaceLeadingUnderscorePrototype::JSTestInterfaceLeadingUnderscorePrototype):
2130         * bindings/scripts/test/JS/JSTestIterable.cpp:
2131         (WebCore::JSTestIterablePrototype::JSTestIterablePrototype):
2132         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
2133         (WebCore::JSTestJSBuiltinConstructorPrototype::JSTestJSBuiltinConstructorPrototype):
2134         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
2135         (WebCore::JSTestMediaQueryListListenerPrototype::JSTestMediaQueryListListenerPrototype):
2136         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
2137         (WebCore::JSTestNamedAndIndexedSetterNoIdentifierPrototype::JSTestNamedAndIndexedSetterNoIdentifierPrototype):
2138         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
2139         (WebCore::JSTestNamedAndIndexedSetterThrowingExceptionPrototype::JSTestNamedAndIndexedSetterThrowingExceptionPrototype):
2140         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
2141         (WebCore::JSTestNamedAndIndexedSetterWithIdentifierPrototype::JSTestNamedAndIndexedSetterWithIdentifierPrototype):
2142         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
2143         (WebCore::JSTestNamedConstructorPrototype::JSTestNamedConstructorPrototype):
2144         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
2145         (WebCore::JSTestNamedDeleterNoIdentifierPrototype::JSTestNamedDeleterNoIdentifierPrototype):
2146         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
2147         (WebCore::JSTestNamedDeleterThrowingExceptionPrototype::JSTestNamedDeleterThrowingExceptionPrototype):
2148         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
2149         (WebCore::JSTestNamedDeleterWithIdentifierPrototype::JSTestNamedDeleterWithIdentifierPrototype):
2150         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
2151         (WebCore::JSTestNamedDeleterWithIndexedGetterPrototype::JSTestNamedDeleterWithIndexedGetterPrototype):
2152         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
2153         (WebCore::JSTestNamedGetterCallWithPrototype::JSTestNamedGetterCallWithPrototype):
2154         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
2155         (WebCore::JSTestNamedGetterNoIdentifierPrototype::JSTestNamedGetterNoIdentifierPrototype):
2156         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
2157         (WebCore::JSTestNamedGetterWithIdentifierPrototype::JSTestNamedGetterWithIdentifierPrototype):
2158         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
2159         (WebCore::JSTestNamedSetterNoIdentifierPrototype::JSTestNamedSetterNoIdentifierPrototype):
2160         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
2161         (WebCore::JSTestNamedSetterThrowingExceptionPrototype::JSTestNamedSetterThrowingExceptionPrototype):
2162         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
2163         (WebCore::JSTestNamedSetterWithIdentifierPrototype::JSTestNamedSetterWithIdentifierPrototype):
2164         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
2165         (WebCore::JSTestNamedSetterWithIndexedGetterPrototype::JSTestNamedSetterWithIndexedGetterPrototype):
2166         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
2167         (WebCore::JSTestNamedSetterWithIndexedGetterAndSetterPrototype::JSTestNamedSetterWithIndexedGetterAndSetterPrototype):
2168         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
2169         (WebCore::JSTestNamedSetterWithOverrideBuiltinsPrototype::JSTestNamedSetterWithOverrideBuiltinsPrototype):
2170         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
2171         (WebCore::JSTestNamedSetterWithUnforgablePropertiesPrototype::JSTestNamedSetterWithUnforgablePropertiesPrototype):
2172         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
2173         (WebCore::JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsPrototype::JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsPrototype):
2174         * bindings/scripts/test/JS/JSTestNode.cpp:
2175         (WebCore::JSTestNodePrototype::JSTestNodePrototype):
2176         (WebCore::JSTestNodeConstructor::prototypeForStructure):
2177         * bindings/scripts/test/JS/JSTestObj.cpp:
2178         (WebCore::JSTestObjPrototype::JSTestObjPrototype):
2179         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
2180         (WebCore::JSTestOverloadedConstructorsPrototype::JSTestOverloadedConstructorsPrototype):
2181         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
2182         (WebCore::JSTestOverloadedConstructorsWithSequencePrototype::JSTestOverloadedConstructorsWithSequencePrototype):
2183         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
2184         (WebCore::JSTestOverrideBuiltinsPrototype::JSTestOverrideBuiltinsPrototype):
2185         * bindings/scripts/test/JS/JSTestPluginInterface.cpp:
2186         (WebCore::JSTestPluginInterfacePrototype::JSTestPluginInterfacePrototype):
2187         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
2188         (WebCore::JSTestPromiseRejectionEventPrototype::JSTestPromiseRejectionEventPrototype):
2189         (WebCore::JSTestPromiseRejectionEventConstructor::prototypeForStructure):
2190         * bindings/scripts/test/JS/JSTestSerialization.cpp:
2191         (WebCore::JSTestSerializationPrototype::JSTestSerializationPrototype):
2192         * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp:
2193         (WebCore::JSTestSerializationIndirectInheritancePrototype::JSTestSerializationIndirectInheritancePrototype):
2194         (WebCore::JSTestSerializationIndirectInheritanceConstructor::prototypeForStructure):
2195         * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
2196         (WebCore::JSTestSerializationInheritPrototype::JSTestSerializationInheritPrototype):
2197         (WebCore::JSTestSerializationInheritConstructor::prototypeForStructure):
2198         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
2199         (WebCore::JSTestSerializationInheritFinalPrototype::JSTestSerializationInheritFinalPrototype):
2200         (WebCore::JSTestSerializationInheritFinalConstructor::prototypeForStructure):
2201         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
2202         (WebCore::JSTestSerializedScriptValueInterfacePrototype::JSTestSerializedScriptValueInterfacePrototype):
2203         * bindings/scripts/test/JS/JSTestStringifier.cpp:
2204         (WebCore::JSTestStringifierPrototype::JSTestStringifierPrototype):
2205         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
2206         (WebCore::JSTestStringifierAnonymousOperationPrototype::JSTestStringifierAnonymousOperationPrototype):
2207         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
2208         (WebCore::JSTestStringifierNamedOperationPrototype::JSTestStringifierNamedOperationPrototype):
2209         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
2210         (WebCore::JSTestStringifierOperationImplementedAsPrototype::JSTestStringifierOperationImplementedAsPrototype):
2211         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
2212         (WebCore::JSTestStringifierOperationNamedToStringPrototype::JSTestStringifierOperationNamedToStringPrototype):
2213         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
2214         (WebCore::JSTestStringifierReadOnlyAttributePrototype::JSTestStringifierReadOnlyAttributePrototype):
2215         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
2216         (WebCore::JSTestStringifierReadWriteAttributePrototype::JSTestStringifierReadWriteAttributePrototype):
2217         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2218         (WebCore::JSTestTypedefsPrototype::JSTestTypedefsPrototype):
2219
2220 2019-05-08  Don Olmstead  <don.olmstead@sony.com>
2221
2222         WEBCORE_EXPORT shouldn't be on the class and its methods
2223         https://bugs.webkit.org/show_bug.cgi?id=197681
2224
2225         Reviewed by Simon Fraser.
2226
2227         Remove WEBCORE_EXPORT from the methods.
2228
2229         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
2230         * page/scrolling/ScrollingTreeScrollingNode.h:
2231
2232 2019-05-08  Wenson Hsieh  <wenson_hsieh@apple.com>
2233
2234         [iOS] Add a quirk to synthesize mouse events when modifying the selection
2235         https://bugs.webkit.org/show_bug.cgi?id=197683
2236         <rdar://problem/48003980>
2237
2238         Reviewed by Tim Horton.
2239
2240         See WebKit ChangeLog for more details.
2241
2242         Test: editing/selection/ios/dispatch-mouse-events-when-modifying-selection-quirk.html
2243
2244         * page/EventHandler.cpp:
2245         (WebCore::EventHandler::handleMousePressEvent):
2246         (WebCore::EventHandler::supportsSelectionUpdatesOnMouseDrag const):
2247
2248         Add some platform hooks to prevent mousemove events from updating the selection on iOS.
2249
2250         (WebCore::EventHandler::shouldAllowMouseDownToStartDrag const):
2251
2252         Add some platform hooks to prevent drag and drop from kicking in when sending synthetic mousemove events to the
2253         page on iOS (drag and drop is instead triggered by EventHandler::tryToBeginDragAtPoint).
2254
2255         (WebCore::EventHandler::updateSelectionForMouseDrag):
2256         * page/EventHandler.h:
2257         * page/Quirks.cpp:
2258         (WebCore::Quirks::shouldDispatchSyntheticMouseEventsWhenModifyingSelection const):
2259         * page/Quirks.h:
2260
2261         Add the new site-specific quirk.
2262
2263         * page/Settings.yaml:
2264         * page/ios/EventHandlerIOS.mm:
2265         (WebCore::EventHandler::tryToBeginDragAtPoint):
2266         (WebCore::EventHandler::supportsSelectionUpdatesOnMouseDrag const):
2267         (WebCore::EventHandler::shouldAllowMouseDownToStartDrag const):
2268         * testing/InternalSettings.cpp:
2269         (WebCore::InternalSettings::Backup::Backup):
2270         (WebCore::InternalSettings::Backup::restoreTo):
2271         (WebCore::InternalSettings::setShouldDispatchSyntheticMouseEventsWhenModifyingSelection):
2272         * testing/InternalSettings.h:
2273         * testing/InternalSettings.idl:
2274
2275         Add an internal settings hook to opt into this quirk, for use in layout tests.
2276
2277 2019-05-08  Simon Fraser  <simon.fraser@apple.com>
2278
2279         Implement backing-sharing in compositing layers, allowing overlap layers to paint into the backing store of another layer
2280         https://bugs.webkit.org/show_bug.cgi?id=197561
2281         <rdar://problem/50445998>
2282
2283         Reviewed by Antti Koivisto.
2284
2285         This change introduces the concept of layers that share backing store for compositing. A layer
2286         which is sharing its backing store first paints itself, and then some set of layers which come
2287         later in paint order in the same stacking context. This reduces the composited layer count in
2288         some overflow scrolling scenarios, thereby also simplifying the scrolling tree.
2289         
2290         A backing-shared layer stores a vector of "sharing" RenderLayer* in its RenderLayerBacking. At
2291         paint time, the owning layer is painted, then the sharing layers, setting the owning layer as the
2292         painting root so that positioning and clipping just work.
2293         
2294         Sharing layer relationships are constructed in RenderLayerCompositor::computeCompositingRequirements().
2295         We track the last layer which was composited in paint order as a shared candidate. If a later layer
2296         would composite for overlap (and no other reasons), then we allow it to share with the candidate
2297         if the candidate is in its ancestor containing block chain. Sharing is currently limited to layers
2298         in the same stacking context.
2299         
2300         isComposited() returns false for sharing layers, but they are like composited layers in that
2301         they behave as painting boundaries, so RenderLayer::paintLayer() needs to stop at them,
2302         and repaints in shared layers have to be directed to their shared layer, hence
2303         changes to RenderLayer::clippingRootForPainting() and RenderLayer::enclosingCompositingLayerForRepaint().
2304         
2305         The clipping boundary logic in RenderLayer::backgroundClipRect() needed to be generalized so that
2306         all calls to RenderLayer::parentClipRects() check for crossing painting boundaries and use
2307         TemporaryClipRects in that case.
2308
2309         Tests: compositing/shared-backing/overflow-scroll/absolute-in-stacking-relative-in-scroller.html
2310                compositing/shared-backing/overflow-scroll/composited-absolute-in-absolute-in-relative-in-scroller.html
2311                compositing/shared-backing/overflow-scroll/nested-absolute-with-clipping-in-stacking-overflow.html
2312                compositing/shared-backing/overflow-scroll/previous-sibling-prevents-inclusiveness.html
2313                compositing/shared-backing/overflow-scroll/relative-in-clipping-in-scroller-in-clipping.html
2314                compositing/shared-backing/overflow-scroll/relative-in-clipping-in-scroller-in-relative-clipping.html
2315                compositing/shared-backing/overflow-scroll/relative-in-div-in-overflow-scroll.html
2316                compositing/shared-backing/overflow-scroll/scrolled-contents-has-painted-content.html
2317                compositing/shared-backing/overflow-scroll/scrolled-contents-unconstrained-clip.html
2318                compositing/shared-backing/overflow-scroll/shared-layer-clipping.html
2319                compositing/shared-backing/overflow-scroll/shared-layer-composited-bounds.html
2320                compositing/shared-backing/overflow-scroll/shared-layer-nested-relative-stacking.html
2321                compositing/shared-backing/overflow-scroll/shared-layer-repaint.html
2322                compositing/shared-backing/partial-compositing-update.html
2323                compositing/shared-backing/partial-compositing-update2.html
2324                compositing/shared-backing/remove-sharing-layer.html
2325                compositing/shared-backing/sharing-cached-clip-rects.html
2326
2327         * rendering/RenderLayer.cpp:
2328         (WebCore::RenderLayer::~RenderLayer):
2329         (WebCore::RenderLayer::ancestorLayerIsInContainingBlockChain const):
2330         (WebCore::RenderLayer::setBackingProviderLayer):
2331         (WebCore::RenderLayer::disconnectFromBackingProviderLayer):
2332         (WebCore::RenderLayer::enclosingCompositingLayerForRepaint const):
2333         (WebCore::RenderLayer::clippingRootForPainting const):
2334         (WebCore::RenderLayer::clipToRect):
2335         (WebCore::RenderLayer::paintLayer):
2336         (WebCore::RenderLayer::updateClipRects):
2337         (WebCore::RenderLayer::clipCrossesPaintingBoundary const):
2338         (WebCore::RenderLayer::calculateClipRects const):
2339         (WebCore::outputPaintOrderTreeLegend):
2340         (WebCore::outputPaintOrderTreeRecursive):
2341         (WebCore::inContainingBlockChain): Deleted.
2342         * rendering/RenderLayer.h:
2343         * rendering/RenderLayerBacking.cpp:
2344         (WebCore::RenderLayerBacking::willBeDestroyed):
2345         (WebCore::clearBackingSharingLayerProviders):
2346         (WebCore::RenderLayerBacking::setBackingSharingLayers):
2347         (WebCore::RenderLayerBacking::removeBackingSharingLayer):
2348         (WebCore::RenderLayerBacking::clearBackingSharingLayers):
2349         (WebCore::RenderLayerBacking::updateCompositedBounds):
2350         (WebCore::RenderLayerBacking::updateDrawsContent):
2351         (WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer const):
2352         (WebCore::RenderLayerBacking::paintIntoLayer):
2353         (WebCore::RenderLayerBacking::paintContents):
2354         * rendering/RenderLayerBacking.h:
2355         * rendering/RenderLayerCompositor.cpp:
2356         (WebCore::RenderLayerCompositor::CompositingState::stateForPaintOrderChildren const):
2357         (WebCore::RenderLayerCompositor::CompositingState::propagateStateFromChildren):
2358         (WebCore::RenderLayerCompositor::CompositingState::propagateStateFromChildrenForUnchangedSubtree):
2359         (WebCore::RenderLayerCompositor::BackingSharingState::resetBackingProviderCandidate):
2360         (WebCore::RenderLayerCompositor::updateCompositingLayers):
2361         (WebCore::backingProviderLayerCanIncludeLayer):
2362         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
2363         (WebCore::RenderLayerCompositor::traverseUnchangedSubtree):
2364         (WebCore::RenderLayerCompositor::updateBacking):
2365         (WebCore::RenderLayerCompositor::layerWillBeRemoved):
2366         (WebCore::RenderLayerCompositor::requiresCompositingForIndirectReason const):
2367         * rendering/RenderLayerCompositor.h:
2368         * rendering/RenderTreeAsText.cpp:
2369
2370 2019-05-08  Brent Fulgham  <bfulgham@apple.com>
2371
2372         Correct delayed load event handling
2373         https://bugs.webkit.org/show_bug.cgi?id=197679
2374         <rdar://problem/50423334>
2375
2376         Reviewed by Alex Christensen.
2377
2378         We need to properly account for the fact that JavaScript might run
2379         while performing loads.
2380
2381         * dom/Document.cpp:
2382         (WebCore::Document::loadEventDelayTimerFired):
2383
2384 2019-05-08  Philippe Normand  <pnormand@igalia.com>
2385
2386         REGRESSION(r243197): [GStreamer] Error playing redirected streams
2387         https://bugs.webkit.org/show_bug.cgi?id=197410
2388
2389         Reviewed by Carlos Garcia Campos.
2390
2391         Revert the change introduced in r243197 that was checking the
2392         redirected URI instead of the original URI. Non-main URIs should
2393         be ignored only when they are HLS (or similar) fragments.
2394
2395         Test http/tests/security/canvas-remote-read-remote-video-hls.html still passes.
2396
2397         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2398         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
2399
2400 2019-05-08  Rob Buis  <rbuis@igalia.com>
2401
2402         Link prefetch not useful for top-level navigation
2403         https://bugs.webkit.org/show_bug.cgi?id=195623
2404
2405         Reviewed by Youenn Fablet.
2406
2407         Cache cross-domain top-level prefetches in a dedicated cache and not in the
2408         memory cache.
2409
2410         Tests: http/tests/cache/link-prefetch-main-resource-iframe.html
2411                http/tests/cache/link-prefetch-main-resource.html
2412                http/tests/contentextensions/prefetch-blocked.html
2413
2414         * loader/LinkLoader.cpp:
2415         (WebCore::LinkLoader::prefetchIfNeeded):
2416         * loader/ResourceLoadInfo.cpp:
2417         (WebCore::toResourceType):
2418
2419 2019-05-07  Don Olmstead  <don.olmstead@sony.com>
2420
2421         Fix !HAVE(ACCESSIBILITY) build
2422         https://bugs.webkit.org/show_bug.cgi?id=197680
2423
2424         Reviewed by Fujii Hironori.
2425
2426         * accessibility/AXObjectCache.h:
2427         (WebCore::AXObjectCache::focusedUIElementForPage):
2428         Update declaration for !HAVE(ACCESSIBILITY)
2429         * accessibility/AccessibilityObject.h:
2430         Add wrapper implementation for !HAVE(ACCESSIBILITY)
2431         * accessibility/AccessibilityProgressIndicator.cpp:
2432         (WebCore::AccessibilityProgressIndicator::roleValue const):
2433         Add ENABLE(METER_ELEMENT) guard.
2434
2435 2019-05-07  Ryan Haddad  <ryanhaddad@apple.com>
2436
2437         Unreviewed, rolling out r245038.
2438
2439         Breaks internal builds.
2440
2441         Reverted changeset:
2442
2443         "Add SPI to set a list of hosts to which to send custom header
2444         fields cross-origin"
2445         https://bugs.webkit.org/show_bug.cgi?id=197397
2446         https://trac.webkit.org/changeset/245038
2447
2448 2019-05-07  Jiewen Tan  <jiewen_tan@apple.com>
2449
2450         [WebAuthN] A new request should always suppress the pending request if any
2451         https://bugs.webkit.org/show_bug.cgi?id=191517
2452         <rdar://problem/46888222>
2453
2454         Reviewed by Brent Fulgham.
2455
2456         Blocking new requests from the same page when there is a pending request could DoS the
2457         WebAuthN API in the period between [the page is refreshed, the pending request is
2458         hanedled/timeout]. Therefore, the policy will be to always cancel any pending requests
2459         whenever a new request is made. This will enforce the policy of handling only one
2460         request at a time.
2461
2462         Covered by new tests in existing files.
2463
2464         * Modules/webauthn/AuthenticatorCoordinatorClient.cpp:
2465         (WebCore::AuthenticatorCoordinatorClient::requestReply):
2466         (WebCore::AuthenticatorCoordinatorClient::setRequestCompletionHandler):
2467         (WebCore::AuthenticatorCoordinatorClient::addQueryCompletionHandler):
2468         * Modules/webauthn/AuthenticatorCoordinatorClient.h:
2469
2470 2019-05-07  Eric Carlson  <eric.carlson@apple.com>
2471
2472         Define media buffering policy
2473         https://bugs.webkit.org/show_bug.cgi?id=196979
2474         <rdar://problem/28383861>
2475
2476         Reviewed by Jer Noble.
2477
2478         Test: MediaBufferingPolicy API test.
2479
2480         * html/HTMLMediaElement.cpp:
2481         (WebCore::HTMLMediaElement::HTMLMediaElement):
2482         (WebCore::HTMLMediaElement::suspend):
2483         (WebCore::HTMLMediaElement::resume):
2484         (WebCore::HTMLMediaElement::createMediaPlayer):
2485         (WebCore::HTMLMediaElement::setBufferingPolicy):
2486         (WebCore::HTMLMediaElement::purgeBufferedDataIfPossible):
2487         (WebCore::HTMLMediaElement::bufferingPolicy const):
2488         (WebCore::HTMLMediaElement::setShouldBufferData): Deleted.
2489         * html/HTMLMediaElement.h:
2490         (WebCore::HTMLMediaElement::shouldBufferData const): Deleted.
2491         * html/MediaElementSession.cpp:
2492         (WebCore::MediaElementSession::updateClientDataBuffering):
2493         (WebCore::MediaElementSession::preferredBufferingPolicy const):
2494         (WebCore::MediaElementSession::dataBufferingPermitted const): Deleted.
2495         * html/MediaElementSession.h:
2496         * platform/graphics/MediaPlayer.cpp:
2497         (WebCore::MediaPlayer::setBufferingPolicy):
2498         (WebCore::convertEnumerationToString):
2499         (WebCore::MediaPlayer::setShouldBufferData): Deleted.
2500         * platform/graphics/MediaPlayer.h:
2501         * platform/graphics/MediaPlayerEnums.h:
2502         (WTF::LogArgument<WebCore::MediaPlayerEnums::BufferingPolicy>::toString):
2503         * platform/graphics/MediaPlayerPrivate.h:
2504         (WebCore::MediaPlayerPrivateInterface::setBufferingPolicy):
2505         (WebCore::MediaPlayerPrivateInterface::setShouldBufferData): Deleted.
2506         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
2507         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2508         (WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC):
2509         (WebCore::MediaPlayerPrivateAVFoundationObjC::setBufferingPolicy):
2510         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldBufferData): Deleted.
2511         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
2512         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
2513         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setBufferingPolicy):
2514         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::flushAndRemoveVideoSampleBuffers): Deleted.
2515         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setShouldBufferData): Deleted.
2516         * testing/Internals.cpp:
2517         (WebCore::Internals::elementShouldBufferData):
2518         (WebCore::Internals::elementBufferingPolicy):
2519         * testing/Internals.h:
2520         * testing/Internals.idl:
2521
2522 2019-05-07  Alex Christensen  <achristensen@webkit.org>
2523
2524         Add SPI to set a list of hosts to which to send custom header fields cross-origin
2525         https://bugs.webkit.org/show_bug.cgi?id=197397
2526
2527         Reviewed by Geoff Garen.
2528
2529         In r223001 I added the ability to send custom headers, but with a restriction that they will not be sent except to the origin of the main document.
2530         We need the ability to specify what origins to send these headers to even if they are not first party requests.
2531         We get this information in a list of strings which are the hosts to send the headers to.  Some of the strings have an asterisk at the beginning,
2532         indicating that the headers are to be sent to all subdomains.
2533
2534         I repurposed some ObjC SPI that was never adopted, but I keep testing the C API that was to verify no regression.
2535         I also added some new API tests for the new behavior.
2536
2537         * Sources.txt:
2538         * WebCore.xcodeproj/project.pbxproj:
2539         * loader/CustomHeaderFields.cpp: Added.
2540         (WebCore::CustomHeaderFields::thirdPartyDomainsMatch const):
2541         * loader/CustomHeaderFields.h: Added.
2542         (WebCore::CustomHeaderFields::encode const):
2543         (WebCore::CustomHeaderFields::decode):
2544         * loader/DocumentLoader.cpp:
2545         (WebCore::DocumentLoader::setCustomHeaderFields): Deleted.
2546         * loader/DocumentLoader.h:
2547         (WebCore::DocumentLoader::setCustomHeaderFields):
2548         (WebCore::DocumentLoader::customHeaderFields const):
2549         (WebCore::DocumentLoader::customHeaderFields): Deleted.
2550         * loader/cache/CachedResourceLoader.cpp:
2551         (WebCore::CachedResourceLoader::requestResource):
2552
2553 2019-05-07  Andy Estes  <aestes@apple.com>
2554
2555         run-bindings-tests should test global scope constructor generation
2556         https://bugs.webkit.org/show_bug.cgi?id=197669
2557
2558         Reviewed by Alex Christensen.
2559
2560         For interfaces that are exposed on a global object, preprocess-idls.pl generates a partial
2561         interface for the global object defining attributes for the interfaces' constructors. Most
2562         interfaces don't specify a global object, so preprocess-idls.pl defaults to DOMWindow.
2563         Since there is no DOMWindow.idl test case, we never generate the code for exposed interface
2564         constructors when running bindings tests. This means that we can't test changes to how these
2565         constructors are generated.
2566
2567         To fix this, teach preprocess-idls.pl to treat 'TestGlobalObject' as the default global
2568         object when running bindings tests. This means that all exposed interface test cases will
2569         generate their constructors as part of JSTestGlobalObject (unless otherwise specified
2570         by the 'Exposed' extended attribute).
2571
2572         * bindings/scripts/preprocess-idls.pl:
2573         Added --testGlobalContextName and --testGlobalScopeConstructorsFile arguments for use by
2574         run-bindings-tests.
2575
2576         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
2577         Updated expected results.
2578
2579 2019-05-07  Youenn Fablet  <youenn@apple.com>
2580
2581         Video stream freeze on front camera orientation changing
2582         https://bugs.webkit.org/show_bug.cgi?id=197227
2583         <rdar://problem/50175498>
2584
2585         Reviewed by Eric Carlson.
2586
2587         Use m_currentRotationSessionAngle instead of m_currentRotation to create or not a new rotation session.
2588         Covered by updated test.
2589
2590         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.h:
2591         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.mm:
2592         (WebCore::RealtimeOutgoingVideoSourceCocoa::rotatePixelBuffer):
2593
2594 2019-05-07  Youenn Fablet  <youenn@apple.com>
2595
2596         getUserMedia framerate unusable under low light in iOS 12.2
2597         https://bugs.webkit.org/show_bug.cgi?id=196214
2598         <rdar://problem/49232193>
2599
2600         Reviewed by Geoffrey Garen.
2601
2602         When setting the frame rate, set it to the exact value instead of a range.
2603         Otherwise, the capture device might use the lowest frame rate according the light conditions
2604         for best picture quality which is not what is expected by most web pages.
2605
2606         Move frame rate range computation to closer where actually used.
2607         Since frame rate matching is fuzzy, add some checks in case the expected frame rate is slightly out of min/max range.
2608
2609         Manually tested on a real device.
2610
2611         * platform/mediastream/mac/AVVideoCaptureSource.mm:
2612         (WebCore::AVVideoCaptureSource::setSizeAndFrameRateWithPreset):
2613
2614 2019-05-07  Robin Morisset  <rmorisset@apple.com>
2615
2616         All prototypes should call didBecomePrototype()
2617         https://bugs.webkit.org/show_bug.cgi?id=196315
2618
2619         Reviewed by Saam Barati.
2620
2621         It was found by existing tests, with the new assert in JSC::Structure
2622
2623         * bindings/js/JSWindowProxy.cpp:
2624         (WebCore::JSWindowProxy::setWindow):
2625         * bindings/scripts/CodeGeneratorJS.pm:
2626         (GeneratePrototypeDeclaration):
2627         (GenerateConstructorHelperMethods):
2628
2629 2019-05-07  John Wilander  <wilander@apple.com>
2630
2631         Storage Access API: Make two changes requested by developers and complete refactoring and cleanup
2632         https://bugs.webkit.org/show_bug.cgi?id=197648
2633         <rdar://problem/50527493>
2634
2635         Reviewed by Chris Dumez.
2636
2637         Developers have requested two minor changes to the Storage Access API:
2638         - Only consume the user gesture when the user explicitly denies access.
2639         - Make document.hasStorageAccess() return true instead of false when the feature is off.
2640
2641         In addition to this, we have refactoring and cleanup to do. Namely:
2642         - Make use of WebCore::RegistrableDomain all the way.
2643         - Remove dead code in WebKit::NetworkProcess since the calls now go through NetworkConnectionToWebProcess.
2644         - Introduce boolean enums for state handling.
2645         - Break out the Storage Access API functionality into a supplement of WebCore::Document.
2646
2647         Reviewed by Chris Dumez.
2648
2649         Tests: http/tests/storageAccess/deny-with-prompt-does-not-preserve-gesture.html
2650                http/tests/storageAccess/deny-without-prompt-preserves-gesture.html
2651                http/tests/storageAccess/grant-with-prompt-preserves-gesture.html
2652                http/tests/storageAccess/has-storage-access-true-if-feature-off.html
2653
2654         * DerivedSources-input.xcfilelist:
2655         * DerivedSources-output.xcfilelist:
2656         * DerivedSources.make:
2657         * Headers.cmake:
2658         * Sources.txt:
2659         * WebCore.xcodeproj/project.pbxproj:
2660         * dom/Document.cpp:
2661         (WebCore::Document::hasStorageAccess): Deleted.
2662         (WebCore::Document::requestStorageAccess): Deleted.
2663         (WebCore::Document::enableTemporaryTimeUserGesture): Deleted.
2664         (WebCore::Document::consumeTemporaryTimeUserGesture): Deleted.
2665         (WebCore::Document::hasFrameSpecificStorageAccess const): Deleted.
2666         (WebCore::Document::setHasFrameSpecificStorageAccess): Deleted.
2667         * dom/Document.h:
2668         (WebCore::Document::setUserGrantsStorageAccessOverride): Deleted.
2669             All of this has been moved to the supplement WebCore::DocumentStorageAccess.
2670         * dom/Document.idl:
2671             The Storage Access API has been moved to DocumentStorageAccess.idl.
2672         * dom/DocumentStorageAccess.cpp: Added.
2673         (WebCore::DocumentStorageAccess::from):
2674         (WebCore::DocumentStorageAccess::supplementName):
2675         (WebCore::DocumentStorageAccess::hasStorageAccess):
2676         (WebCore::DocumentStorageAccess::requestStorageAccess):
2677         (WebCore::DocumentStorageAccess::enableTemporaryTimeUserGesture):
2678         (WebCore::DocumentStorageAccess::consumeTemporaryTimeUserGesture):
2679         (WebCore::DocumentStorageAccess::hasFrameSpecificStorageAccess const):
2680         (WebCore::DocumentStorageAccess::setHasFrameSpecificStorageAccess):
2681         * dom/DocumentStorageAccess.h: Added.
2682         * dom/DocumentStorageAccess.idl: Added.
2683         * page/ChromeClient.h:
2684         * testing/Internals.cpp:
2685         (WebCore::Internals::setUserGrantsStorageAccess): Deleted.
2686             This was dead code.
2687         * testing/Internals.h:
2688         * testing/Internals.idl:
2689
2690 2019-05-07  Antoine Quint  <graouts@apple.com>
2691
2692         [Pointer Events] isPrimary property of pointercancel events should match previous events for that pointer
2693         https://bugs.webkit.org/show_bug.cgi?id=197665
2694
2695         Reviewed by Dean Jackson.
2696
2697         The test at web-platform-tests/pointerevents/pointerevent_pointercancel_touch.html would fail early because one of the first assertions
2698         would check that isPrimary for a pointercancel event would match the isPrimary property of the previous pointer event dispatched for that
2699         pointer id. This prevented many further assertions from passing and also was the cause of flakiness for the next test since this test was
2700         ended early and the state of touches created using UIScriptController were not in a clean state.
2701
2702         We now track the isPrimary state for a given pointer using the CapturingData and use that value when dispatching a pointercancel event.
2703
2704         * dom/PointerEvent.cpp:
2705         (WebCore::PointerEvent::create):
2706         (WebCore::PointerEvent::PointerEvent):
2707         * dom/PointerEvent.h:
2708         * page/PointerCaptureController.cpp:
2709         (WebCore::PointerCaptureController::pointerEventWasDispatched):
2710         (WebCore::PointerCaptureController::cancelPointer):
2711         * page/PointerCaptureController.h:
2712
2713 2019-05-07  Ryan Haddad  <ryanhaddad@apple.com>
2714
2715         Unreviewed, rolling out r244900.
2716
2717         Caused media/track/track-cue-missing.html to fail on debug
2718         queues
2719
2720         Reverted changeset:
2721
2722         "Add logging for RenderLayer clip rects"
2723         https://bugs.webkit.org/show_bug.cgi?id=197547
2724         https://trac.webkit.org/changeset/244900
2725
2726 2019-05-07  Antti Koivisto  <antti@apple.com>
2727
2728         <body> with overflow:hidden CSS is scrollable on iOS
2729         https://bugs.webkit.org/show_bug.cgi?id=153852
2730         <rdar://problem/38715356>
2731
2732         Reviewed by Antoine Quint.
2733
2734         Tests: fast/scrolling/ios/body-overflow-hidden-frame.html
2735                fast/scrolling/ios/body-overflow-hidden.html
2736
2737         * page/scrolling/ScrollingTreeScrollingNode.h:
2738
2739 2019-05-07  Antoine Quint  <graouts@apple.com>
2740
2741         Mouse event simulation should be limited to the graphing calculator on Desmos.com
2742         https://bugs.webkit.org/show_bug.cgi?id=197652
2743         <rdar://problem/47068176>
2744
2745         Reviewed by Antti Koivisto.
2746
2747         * page/Quirks.cpp:
2748         (WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):
2749
2750 2019-05-06  James Savage  <james.savage@apple.com>
2751
2752         Improve coordination for creating UIWindow instances.
2753         https://bugs.webkit.org/show_bug.cgi?id=197578.
2754         <rdar://problem/50456965>.
2755
2756         Reviewed by Wenson Hsieh.
2757
2758         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
2759         (makeWindowFromView): Pull out window creation.
2760         (VideoFullscreenInterfaceAVKit::doSetup): Call new helper function.
2761
2762 2019-05-06  Tim Horton  <timothy_horton@apple.com>
2763
2764         _overrideViewportWithArguments does not work when called before loading
2765         https://bugs.webkit.org/show_bug.cgi?id=197638
2766         <rdar://problem/50505111>
2767
2768         Reviewed by Wenson Hsieh.
2769
2770         * dom/Document.cpp:
2771         (WebCore::Document::viewportArguments const):
2772         (WebCore::Document::updateViewportArguments):
2773         (WebCore::Document::setOverrideViewportArguments): Deleted.
2774         * dom/Document.h:
2775         (WebCore::Document::viewportArguments const): Deleted.
2776         * page/Page.cpp:
2777         (WebCore::Page::setOverrideViewportArguments):
2778         * page/Page.h:
2779         (WebCore::Page::overrideViewportArguments const):
2780         * page/ViewportConfiguration.cpp:
2781         (WebCore::ViewportConfiguration::setViewportArguments):
2782         Move overrideViewportArguments to Page, since it is view-global in the API.
2783
2784 2019-05-06  Chris Dumez  <cdumez@apple.com>
2785
2786         Add assertions to JSLazyEventListener to help catch the cause of a crash
2787         https://bugs.webkit.org/show_bug.cgi?id=197617
2788
2789         Reviewed by Alexey Proskuryakov.
2790
2791         Add assertions to JSLazyEventListener to help catch the cause of <rdar://problem/24314027>.
2792
2793         * bindings/js/JSLazyEventListener.cpp:
2794         (WebCore::JSLazyEventListener::checkValidityForEventTarget):
2795         * bindings/js/JSLazyEventListener.h:
2796         * dom/EventListener.h:
2797         (WebCore::EventListener::checkValidityForEventTarget):
2798         * dom/EventTarget.cpp:
2799         (WebCore::EventTarget::addEventListener):
2800         (WebCore::EventTarget::setAttributeEventListener):
2801         (WebCore::EventTarget::innerInvokeEventListeners):
2802
2803 2019-05-04  Per Arne Vollan  <pvollan@apple.com>
2804
2805         -[WKWebsiteDataStore removeDataOfTypes:forDataRecords:completionHandler:] doesn't delete _WKWebsiteDataTypeCredentials
2806         https://bugs.webkit.org/show_bug.cgi?id=197510
2807         <rdar://problem/50372338>
2808
2809         Reviewed by Alex Christensen.
2810
2811         This patch implements deletion of non persistent credentials for a set of origins. In order for this to work, fetching
2812         credentials from the credential storage needs to return a set of SecurityOriginData objects, instead of a set of origin
2813         strings. This is implemented by iterating over all the elements in the credential map, and creating a SecurityOriginData
2814         object for each credential based on the protection space.
2815
2816         API test: WKWebsiteDataStore.RemoveNonPersistentCredentials
2817
2818         * platform/network/CredentialStorage.cpp:
2819         (WebCore::CredentialStorage::removeCredentialsWithOrigin):
2820         (WebCore::CredentialStorage::originsWithCredentials const):
2821         * platform/network/CredentialStorage.h:
2822         (WebCore::CredentialStorage::originsWithCredentials const): Deleted.
2823
2824 2019-05-06  Keith Rollin  <krollin@apple.com>
2825
2826         Temporarily disable generate-xcfilelists
2827         https://bugs.webkit.org/show_bug.cgi?id=197619
2828         <rdar://problem/50507392>
2829
2830         Reviewed by Alex Christensen.
2831
2832         We need to perform a significant update to the generate-xcfilelist
2833         scripts. This work involves coordinated work with another facility. If
2834         the work does not occur in tandem, the build will be broken. To avoid
2835         this, disable the invoking of the scripts during the transition. The
2836         checking will be restored once the new scripts are in place.
2837
2838         No new tests -- no change in user-visible functionality.
2839
2840         * Scripts/check-xcfilelists.sh:
2841
2842 2019-05-06  Andres Gonzalez  <andresg_22@apple.com>
2843
2844         Hitpoint for link which spans two lines in web content is incorrect
2845         https://bugs.webkit.org/show_bug.cgi?id=197511
2846         <rdar://problem/49971483>
2847
2848         Reviewed by Chris Fleizach.
2849
2850         - Special case for links to return first char location as clickPoint instead of middle point of bounding rect.
2851         - Modified iOS ActivationPoint to use clickPoint. This way all code paths go through the same function.
2852         - Made boundsForRects to return content coordinates in all platforms. Adjusted all callers, directly or indirectly, appropriately.
2853
2854         Tests: accessibility/ios-simulator/links-activation.html
2855                accessibility/links-activation.html
2856
2857         * accessibility/AccessibilityRenderObject.cpp:
2858         (WebCore::AccessibilityRenderObject::clickPoint):
2859         (WebCore::AccessibilityRenderObject::boundsForRects):
2860         (WebCore::AccessibilityRenderObject::boundsForRects const): Deleted.
2861         * accessibility/AccessibilityRenderObject.h:
2862         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2863         (-[WebAccessibilityObjectWrapper accessibilityActivationPoint]):
2864         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2865         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
2866
2867 2019-05-06  Jer Noble  <jer.noble@apple.com>
2868
2869         Adopt AVStreamDataParser.audiovisualMIMETypes
2870         https://bugs.webkit.org/show_bug.cgi?id=197581
2871         <rdar://problem/50458981>
2872
2873         Reviewed by Eric Carlson.
2874
2875         Add a new singleton class, AVStreamDataParserMIMETypeCache, and rename AVFoundationMIMETypeCache to the more precise
2876         AVAssetMIMETypeCache.  Update all the old AVFoundationMIMETypeCache with the new name.
2877
2878         * SourcesCocoa.txt:
2879         * WebCore.xcodeproj/project.pbxproj:
2880         * platform/graphics/avfoundation/objc/AVAssetMIMETypeCache.h: Renamed from Source/WebCore/platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.h.
2881         (WebCore::AVAssetMIMETypeCache::setCacheMIMETypesCallback):
2882         * platform/graphics/avfoundation/objc/AVAssetMIMETypeCache.mm: Renamed from Source/WebCore/platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.mm.
2883         (WebCore::AVAssetMIMETypeCache::singleton):
2884         (WebCore::AVAssetMIMETypeCache::setSupportedTypes):
2885         (WebCore::AVAssetMIMETypeCache::types):
2886         (WebCore::AVAssetMIMETypeCache::supportsContentType):
2887         (WebCore::AVAssetMIMETypeCache::canDecodeType):
2888         (WebCore::AVAssetMIMETypeCache::isAvailable const):
2889         (WebCore::AVAssetMIMETypeCache::loadMIMETypes):
2890         * platform/graphics/avfoundation/objc/AVStreamDataParserMIMETypeCache.h: Added.
2891         * platform/graphics/avfoundation/objc/AVStreamDataParserMIMETypeCache.mm: Added.
2892         (WebCore::AVStreamDataParserMIMETypeCache::singleton):
2893         (WebCore::AVStreamDataParserMIMETypeCache::types):
2894         (WebCore::AVStreamDataParserMIMETypeCache::supportsContentType):
2895         (WebCore::AVStreamDataParserMIMETypeCache::canDecodeType):
2896         (WebCore::AVStreamDataParserMIMETypeCache::isAvailable const):
2897         (WebCore::AVStreamDataParserMIMETypeCache::loadMIMETypes):
2898         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
2899         (WebCore::ImageDecoderAVFObjC::create):
2900         (WebCore::ImageDecoderAVFObjC::supportsMediaType):
2901         (WebCore::ImageDecoderAVFObjC::supportsContentType):
2902         (WebCore::ImageDecoderAVFObjC::canDecodeType):
2903         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2904         (WebCore::MediaPlayerPrivateAVFoundationObjC::registerMediaEngine):
2905         (WebCore::MediaPlayerPrivateAVFoundationObjC::getSupportedTypes):
2906         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsType):
2907         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsKeySystem):
2908         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2909         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::registerMediaEngine):
2910         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::getSupportedTypes):
2911         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsType):
2912
2913 2019-05-06  Youenn Fablet  <youenn@apple.com>
2914
2915         WebAudio Node JS wrappers should not be collected if events can be fired
2916         https://bugs.webkit.org/show_bug.cgi?id=197533
2917
2918         Reviewed by Jer Noble.
2919
2920         Before the patch, some web audio nodes could fire event listeners, but were not protected from GC.
2921         Use CustomIsReachable to ensure theses nodes can be collected if:
2922         - their AudioContext is stopped (typically due to document being navigated away).
2923         - their AudioContext is closed.
2924         - nodes do not have event listeners.
2925
2926         Covered by WPT mediacapture-streams/MediaStreamTrack-MediaElement-disabled-audio-is-silence.https.html and
2927         WPT webaudio/the-audio-api/the-mediaelementaudiosourcenode-interface/mediaElementAudioSourceToScriptProcessorTest.html
2928         and web audio WebRTC tests.
2929         Specific newly added test: webaudio/webaudio-gc.html
2930
2931         * Modules/webaudio/AudioContext.h:
2932         (WebCore::AudioContext::isClosed const):
2933         * Modules/webaudio/AudioNode.idl:
2934         * Sources.txt:
2935         * WebCore.xcodeproj/project.pbxproj:
2936         * bindings/js/JSAudioNodeCustom.cpp: Added.
2937         (WebCore::JSAudioNodeOwner::isReachableFromOpaqueRoots):
2938
2939 2019-05-06  Daniel Bates  <dabates@apple.com>
2940
2941         Google Docs & Yahoo! Japan: Can’t compose characters with Chinese or Japanese keyboard
2942         https://bugs.webkit.org/show_bug.cgi?id=197474
2943         <rdar://problem/47219324>
2944
2945         Reviewed by Ryosuke Niwa.
2946
2947         Fix up some #if defs to compile more Mac code when building on iOS.
2948
2949         * dom/KeyboardEvent.cpp:
2950         (WebCore::KeyboardEvent::KeyboardEvent):
2951         * platform/PlatformKeyboardEvent.h:
2952         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
2953
2954 2019-05-06  Chris Dumez  <cdumez@apple.com>
2955
2956         Add assertions to CachedFrame to help figure out crash in CachedFrame constructor
2957         https://bugs.webkit.org/show_bug.cgi?id=197621
2958
2959         Reviewed by Geoffrey Garen.
2960
2961         Add release assertions to try and figure out who is sometimes detaching the document from its
2962         frame while constructing CachedFrames for its descendants.
2963
2964         * dom/Document.cpp:
2965         (WebCore::Document::detachFromFrame):
2966         * dom/Document.h:
2967         (WebCore::Document::setMayBeDetachedFromFrame):
2968         * history/CachedFrame.cpp:
2969         (WebCore::CachedFrame::CachedFrame):
2970
2971 2019-05-06  Zan Dobersek  <zdobersek@igalia.com>
2972
2973         [GLib] WebCore::MainThreadSharedTimer should use the appropriate GSource priority, name
2974         https://bugs.webkit.org/show_bug.cgi?id=197606
2975
2976         Reviewed by Carlos Garcia Campos.
2977
2978         * platform/MainThreadSharedTimer.cpp:
2979         (WebCore::MainThreadSharedTimer::MainThreadSharedTimer):
2980         Use the MainThreadSharedTimer GLib priority for this timer. The name is
2981         also adjusted accordingly.
2982
2983 2019-05-05  Wenson Hsieh  <wenson_hsieh@apple.com>
2984
2985         fast/attachment/attachment-folder-icon.html is an Image Only failure on recent macOS builds
2986         https://bugs.webkit.org/show_bug.cgi?id=197593
2987         <rdar://problem/50379267>
2988
2989         Reviewed by Tim Horton.
2990
2991         On recent versions of macOS, -[NSWorkspace iconForFileType:] returns the generic document icon for
2992         "public.directory". Instead of using this UTI to generate attachment icons for "multipart/x-folder" and
2993         "application/vnd.apple.folder", we should instead be using "public.folder", which has a folder icon. This fixes
2994         the existing test fast/attachment/attachment-folder-icon.html, which currently results in an image diff on these
2995         builds of macOS.
2996
2997         * rendering/RenderThemeMac.mm:
2998         (WebCore::iconForAttachment):
2999
3000 2019-05-04  Alex Christensen  <achristensen@webkit.org>
3001
3002         Revert r244953 and r244954 because they broke internal builds.
3003         https://bugs.webkit.org/show_bug.cgi?id=197534
3004
3005         * platform/ios/PlatformPasteboardIOS.mm:
3006         (WebCore::PlatformPasteboard::changeCount const):
3007         (WebCore::PlatformPasteboard::write):
3008
3009 2019-05-04  Alex Christensen  <achristensen@webkit.org>
3010
3011         Merge the three UIKitSPI.h files into a single one in PAL
3012         https://bugs.webkit.org/show_bug.cgi?id=197534
3013
3014         Reviewed by Darin Adler.
3015
3016         * platform/ios/PlatformPasteboardIOS.mm:
3017         (WebCore::PlatformPasteboard::changeCount const):
3018         (WebCore::PlatformPasteboard::write):
3019
3020 2019-05-04  Youenn Fablet  <youenn@apple.com>
3021
3022         Convert some RealtimeOutgoingVideoSourceCocoa logging to ERROR_LOG
3023         https://bugs.webkit.org/show_bug.cgi?id=197549
3024
3025         Reviewed by Eric Carlson.
3026
3027         No change of behavior.
3028
3029         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.mm:
3030         (WebCore::RealtimeOutgoingVideoSourceCocoa::rotatePixelBuffer):
3031
3032 2019-05-03  Simon Fraser  <simon.fraser@apple.com>
3033
3034         [macOS] Fix programmatic scrolling with async overflow scroll
3035         https://bugs.webkit.org/show_bug.cgi?id=197590
3036
3037         Reviewed by Sam Weinig.
3038         
3039         ScrollingTreeOverflowScrollingNodeMac needs to handle RequestedScrollPosition.
3040
3041         Tests: scrollingcoordinator/mac/programmatic-frame-scroll.html
3042                scrollingcoordinator/mac/programmatic-overflow-scroll.html
3043
3044         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
3045         (WebCore::ScrollingTreeOverflowScrollingNodeMac::commitStateAfterChildren):
3046
3047 2019-05-03  Zalan Bujtas  <zalan@apple.com>
3048
3049         [iOS] outlook.live.com: Compose email frame not fully visible and not scrollable
3050         https://bugs.webkit.org/show_bug.cgi?id=197573
3051         <rdar://problem/48008441>
3052
3053         Reviewed by Wenson Hsieh.
3054
3055         The outlook mail view's flex column setup produces a somewhat unfortunate layout at certain viewport widths.
3056         This patch addresses the issue by ensuring that we never fall into that range.
3057
3058         * page/Quirks.cpp:
3059         (WebCore::Quirks::shouldIgnoreShrinkToFitContent const):
3060         (WebCore::Quirks::overriddenViewportLayoutWidth const):
3061         * page/Quirks.h:
3062
3063 2019-05-02  Jiewen Tan  <jiewen_tan@apple.com>
3064
3065         [WebAuthN] A focused document should be required
3066         https://bugs.webkit.org/show_bug.cgi?id=197543
3067         <rdar://problem/50430989>
3068
3069         Reviewed by Brent Fulgham.
3070
3071         This patch adds a check to see if the invoking document is focused before
3072         calling into WebAuthN. This patch also removes some out-to-dated comments.
3073
3074         Test: http/wpt/webauthn/public-key-credential-unfocused-document.https.html
3075
3076         * Modules/credentialmanagement/CredentialsContainer.cpp:
3077         (WebCore::CredentialsContainer::get):
3078         (WebCore::CredentialsContainer::isCreate):
3079         * Modules/webauthn/AuthenticatorCoordinator.cpp:
3080         (WebCore::AuthenticatorCoordinator::create const):
3081         (WebCore::AuthenticatorCoordinator::discoverFromExternalSource const):
3082
3083 2019-05-03  Devin Rousso  <drousso@apple.com>
3084
3085         Web Inspector: DOM: rename "low power" to "display composited"
3086         https://bugs.webkit.org/show_bug.cgi?id=197296
3087
3088         Reviewed by Joseph Pecoraro.
3089
3090         Removed specific ChangeLog entries since it is almost entirely mechanical changes.
3091
3092         * inspector/agents/InspectorDOMAgent.h:
3093         * inspector/agents/InspectorDOMAgent.cpp:
3094
3095 2019-05-03  Daniel Bates  <dabates@apple.com>
3096
3097         Pass KeyboardEvent by reference in more places
3098         https://bugs.webkit.org/show_bug.cgi?id=197480
3099
3100         Reviewed by Wenson Hsieh.
3101
3102         * editing/Editor.cpp:
3103         (WebCore::Editor::handleKeyboardEvent):
3104         (WebCore::Editor::handleInputMethodKeydown):
3105         * loader/EmptyClients.cpp:
3106         * page/EditorClient.h:
3107
3108 2019-05-03  Chris Dumez  <cdumez@apple.com>
3109
3110         [iOS Sim Debug] ASSERTION FAILED The atomic string comes from an other thread! Layout Test imported/w3c/web-platform-tests/workers/WorkerNavigator_appName.htm is a flaky crash
3111         https://bugs.webkit.org/show_bug.cgi?id=197530
3112         <rdar://problem/50448285>
3113
3114         Reviewed by Geoffrey Garen.
3115
3116         The issue is that NavigatorBase::platform() was not thread safe but was called by both Navigator on
3117         the main thread and WorkerNavigator on worker threads.
3118
3119         No new tests, covered by existing tests.
3120
3121         * page/Navigator.cpp:
3122         (WebCore::Navigator::platform const):
3123         * page/Navigator.h:
3124
3125         * page/NavigatorBase.cpp:
3126         (WebCore::NavigatorBase::platform const):
3127         * page/NavigatorBase.h:
3128         Make NavigatorBase::platform() thread safe.
3129
3130         * platform/ios/Device.cpp:
3131         (WebCore::deviceName):
3132         * platform/ios/Device.h:
3133         Make WebCore::deviceName() thread safe.
3134
3135         * platform/ios/UserAgentIOS.mm:
3136         (WebCore::deviceNameForUserAgent):
3137         Cache value returned by WebCore::deviceName() for performance.
3138
3139 2019-05-03  Chris Dumez  <cdumez@apple.com>
3140
3141         Use WeakPtr for JSLazyEventListener::m_originalNode for safety
3142         https://bugs.webkit.org/show_bug.cgi?id=197576
3143         <rdar://problem/24314027>
3144
3145         Reviewed by Alex Christensen.
3146
3147         * bindings/js/JSLazyEventListener.cpp:
3148         (WebCore::JSLazyEventListener::JSLazyEventListener):
3149         (WebCore::JSLazyEventListener::create):
3150         * bindings/js/JSLazyEventListener.h:
3151
3152 2019-05-03  Eric Carlson  <eric.carlson@apple.com>
3153
3154         AVFoundation framework isn't always installed
3155         https://bugs.webkit.org/show_bug.cgi?id=197577
3156         <rdar://problem/50447841>
3157
3158         Reviewed by Jer Noble.
3159         
3160         Use PAL::isAVFoundationFrameworkAvailable() to check to see if AVFoundation is
3161         installed, not PAL::AVFoundationLibrary().
3162
3163         * platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.mm:
3164         (WebCore::AVFoundationMIMETypeCache::isAvailable const):
3165         (WebCore::AVFoundationMIMETypeCache::loadMIMETypes):
3166         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3167         (WebCore::MediaPlayerPrivateAVFoundationObjC::isAvailable):
3168         (WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessPlaybackTargetType const):
3169         (WebCore::exernalDeviceDisplayNameForPlayer):
3170         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
3171         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isAvailable):
3172         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
3173         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::isAvailable):
3174         * platform/graphics/cocoa/HEVCUtilitiesCocoa.mm:
3175         (WebCore::validateHEVCParameters):
3176         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
3177         (WebCore::AVCaptureDeviceManager::isAvailable):
3178
3179 2019-05-03  Sihui Liu  <sihui_liu@apple.com>
3180
3181         Add assertion to check whether shm files have maximum FileProtection of CompleteUnlessOpen
3182         https://bugs.webkit.org/show_bug.cgi?id=197390
3183         <rdar://problem/42685773>
3184
3185         Reviewed by Geoffrey Garen.
3186
3187         We have seen crashes about accessing database files after device is locked. We are suspecting this is because 
3188         shm files have wrong data protection class, but shm files should not have Complete class protection when it 
3189         is created. It is likely the protection class is changed later. Add an assertion to verify our guess. If the 
3190         crash signature changes after this patch, we probably need to change database implementation. If it is not, we
3191         have other problem than data protection.
3192
3193         * platform/sql/SQLiteDatabase.cpp:
3194         (WebCore::SQLiteDatabase::open):
3195
3196 2019-05-03  Youenn Fablet  <youenn@apple.com>
3197
3198         Cache.add and Cache.addAll should compute a correct response body size
3199         https://bugs.webkit.org/show_bug.cgi?id=197464
3200
3201         Reviewed by Chris Dumez.
3202
3203         Compute the response body size as we do for regular Cache.put
3204
3205         Test: http/wpt/cache-storage/cache-quota-add.any.html
3206
3207         * Modules/cache/CacheStorageConnection.cpp:
3208         (WebCore::CacheStorageConnection::computeRecordBodySize):
3209         * Modules/cache/CacheStorageConnection.h:
3210         * Modules/cache/DOMCache.cpp:
3211         (WebCore::FetchTasksHandler::addResponseBody):
3212         (WebCore::DOMCache::addAll):
3213         Compute the response body size requires getting access to the connection.
3214         'this' is added to the lambda which is fine since taskHandler keeps a
3215         Ref to 'this' in its completion handler.
3216         (WebCore::DOMCache::toConnectionRecord):
3217         * Modules/fetch/FetchResponse.h:
3218
3219 2019-05-03  Tomoki Imai  <Tomoki.Imai@sony.com>
3220
3221         [Cairo] Improve ShadowBlur performance using tiling optimization
3222         https://bugs.webkit.org/show_bug.cgi?id=197308
3223         Reviewed by Žan Doberšek.
3224
3225         Enable tiling tiling-based optimization for drawRectShadow() and drawInsetShadow().
3226         Since r228776, cairo ports doesn't have tiling-based optimization.
3227
3228         For AppleWin, this patch refactors code and it shares almost same code as cairo port.
3229         Only the difference is that AppleWin uses ScratchBuffer, but cairo ports doesn't.
3230         This should avoid a performance regression for AppleWin.
3231
3232         No new tests, covered by existing tests.
3233
3234         * platform/graphics/ShadowBlur.cpp:
3235         (WebCore::calculateLobes):
3236         Fix stylecheck errors
3237
3238         (WebCore::ShadowBlur::blurLayerImage):
3239         Fix stylecheck errors
3240
3241         (WebCore::ShadowBlur::calculateLayerBoundingRect):
3242         We don't use position of m_sourceRect, so change the type to FloatSize.
3243
3244         (WebCore::ShadowBlur::drawShadowBuffer):
3245         Use m_layerSize instead of m_shadowedResultSize to fillRect, as m_layerSize is always smaller than m_shadowedResultSize.
3246         It's because in m_layerSize is equal to m_shadowedResultSize if it's not clipped.
3247         Clipping doesn't increase size of m_layerSize, so m_layerSize is always smaller than or equal to m_shadowedResultSize.
3248
3249         (WebCore::ShadowBlur::templateSize const):
3250         Fix stylecheck errors
3251
3252         (WebCore::ShadowBlur::drawRectShadow):
3253         (WebCore::ShadowBlur::drawInsetShadow):
3254         (WebCore::ShadowBlur::drawRectShadowWithoutTiling):
3255         (WebCore::ShadowBlur::drawInsetShadowWithoutTiling):
3256         (WebCore::ShadowBlur::drawRectShadowWithTiling):
3257         (WebCore::ShadowBlur::drawInsetShadowWithTiling):
3258         Incorporate tile-based drawing.
3259         To accomplish it, this patch abstracts GraphicsContext::drawImageBuffer to ShadowBlur::DrawImageCallback,
3260         GraphicsContext::fillRect to ShadowBlur::FillRectCallback, drawing rect with hole to  ShadowBlur::FillRectWithHoleCallback.
3261
3262         Variants which takes GraphicsContext as parameter now just calls another drawRectShadow.
3263
3264         (WebCore::ShadowBlur::drawLayerPieces):
3265         Instead of graphicsContext.drawImageBuffer, call corresponding callback.
3266
3267         (WebCore::ShadowBlur::drawLayerPiecesAndFillCenter):
3268         This function calls drawLayerPieces and fill center for outer shadow.
3269         Drawing outer shadow requires another callback for graphicsContext.fillRect.
3270
3271         (WebCore::ShadowBlur::drawShadowLayer):
3272         Use m_layerSize instead of m_shadowedResultSize to fillRect,
3273         as m_layerSize is always smaller than m_shadowedResultSize.
3274
3275         * platform/graphics/ShadowBlur.h:
3276         Rename m_sourceRect to m_shadowedResultSize, and change it to FloatSize from FloatRect.
3277         Remove GraphicsContext usage as much as possible and replace them by corresponding callbacks.
3278
3279         * platform/graphics/cairo/CairoOperations.cpp:
3280         (WebCore::Cairo::drawShadowImage):
3281         This function corresponds to ShadowBlur::DrawImageCallback.
3282
3283         (WebCore::Cairo::fillShadowBuffer):
3284         Erase sourceRect, as it's always bigger than layerSize.
3285
3286         (WebCore::Cairo::drawPathShadow):
3287         (WebCore::Cairo::drawGlyphsShadow):
3288         Erase unused parameter.
3289
3290         (WebCore::Cairo::fillRect):
3291         (WebCore::Cairo::fillRoundedRect):
3292         (WebCore::Cairo::fillRectWithRoundedHole):
3293         For tile-based optimization, add extra arguments to drawRectShadow.
3294
3295         (WebCore::Cairo::drawSurface):
3296         Erase unused parameter.
3297
3298 2019-05-03  Antti Koivisto  <antti@apple.com>
3299
3300         Add a quirk to make youtube navigation bar scrollable without mouse hover on iOS
3301         https://bugs.webkit.org/show_bug.cgi?id=197555
3302         <rdar://problem/49582231>
3303
3304         Reviewed by Brent Fulgham.
3305
3306         * css/StyleResolver.cpp:
3307         (WebCore::StyleResolver::adjustRenderStyleForSiteSpecificQuirks):
3308
3309         Turn 'overflow:hidden' into 'overflow:auto' on element with id="guide-inner-content".
3310
3311         * page/Quirks.cpp:
3312         (WebCore::Quirks::needsYouTubeOverflowScrollQuirk const):
3313         * page/Quirks.h:
3314
3315 2019-05-03  Devin Rousso  <drousso@apple.com>
3316
3317         Web Inspector: Record actions performed on WebGL2RenderingContext
3318         https://bugs.webkit.org/show_bug.cgi?id=176008
3319         <rdar://problem/34213884>
3320
3321         Reviewed by Joseph Pecoraro.
3322
3323         Tests: inspector/canvas/recording-webgl2.html
3324                inspector/canvas/recording-webgl2-snapshots.html
3325
3326         * html/canvas/WebGL2RenderingContext.idl:
3327
3328         * bindings/js/CallTracerTypes.h:
3329         * inspector/RecordingSwizzleTypes.h:
3330
3331         * inspector/InspectorCanvas.h:
3332         * inspector/InspectorCanvas.cpp:
3333         (WebCore::InspectorCanvas::canvasChanged): Added.
3334         (WebCore::InspectorCanvas::resetRecordingData):
3335         (WebCore::shouldSnapshotWebGL2Action): Added.
3336         (WebCore::InspectorCanvas::recordAction):
3337         (WebCore::InspectorCanvas::releaseObjectForRecording):
3338         (WebCore::InspectorCanvas::appendActionSnapshotIfNeeded):
3339         (WebCore::InspectorCanvas::buildAction):
3340         * inspector/agents/InspectorCanvasAgent.h:
3341         * inspector/agents/InspectorCanvasAgent.cpp:
3342         (WebCore::InspectorCanvasAgent::canvasChanged): Added.
3343         (WebCore::InspectorCanvasAgent::startRecording):
3344         Provide an actual implementation of `CanvasObserver::canvasChanged` since it can be used to
3345         determine whether or not an action needs a snapshot.
3346
3347         * page/PageConsoleClient.cpp:
3348         (WebCore::canvasRenderingContext):
3349
3350 2019-05-03  Commit Queue  <commit-queue@webkit.org>
3351
3352         Unreviewed, rolling out r244881.
3353         https://bugs.webkit.org/show_bug.cgi?id=197559
3354
3355         Breaks compilation of jsconly on linux, breaking compilation
3356         for jsc-i386-ews, jsc-mips-ews and jsc-armv7-ews (Requested by
3357         guijemont on #webkit).
3358
3359         Reverted changeset:
3360
3361         "[CMake] Refactor WEBKIT_MAKE_FORWARDING_HEADERS into
3362         WEBKIT_COPY_FILES"
3363         https://bugs.webkit.org/show_bug.cgi?id=197174
3364         https://trac.webkit.org/changeset/244881
3365
3366 2019-05-03  Joonghun Park  <jh718.park@samsung.com>
3367
3368         Resolve the percentage values of inset properties against proper box.
3369         https://bugs.webkit.org/show_bug.cgi?id=189549
3370
3371         Reviewed by Antti Koivisto.
3372
3373         Before this CL, sticky element's layout was executed relative to
3374         a box's overflow container,
3375         but the value returned by getComputedStyle was resolved against
3376         its containing block.
3377
3378         So, the computed value and the actual value used in layout
3379         was different before this change.
3380
3381         Tests: imported/w3c/web-platform-tests/css/cssom/getComputedStyle-insets-sticky-container-for-abspos.html
3382                imported/w3c/web-platform-tests/css/cssom/getComputedStyle-sticky-pos-percent.html
3383
3384         * css/CSSComputedStyleDeclaration.cpp:
3385         (WebCore::positionOffsetValue):
3386         * rendering/RenderBox.cpp:
3387         (WebCore::RenderBox::enclosingScrollportBox const):
3388         * rendering/RenderBox.h:
3389
3390 2019-05-02  Antti Koivisto  <antti@apple.com>
3391
3392         Add a quirk to make gmail navigation bar scrollable without mouse hover on iOS
3393         https://bugs.webkit.org/show_bug.cgi?id=197529
3394         <rdar://problem/49403416>
3395
3396         Reviewed by Simon Fraser.
3397
3398         * css/StyleResolver.cpp:
3399         (WebCore::StyleResolver::adjustRenderStyle):
3400         (WebCore::StyleResolver::adjustRenderStyleForSiteSpecificQuirks):
3401
3402         Turn 'overflow:hidden' to 'overflow:auto' on element with role="navigation".
3403         This should be both reasonably targeted and robust.
3404
3405         * css/StyleResolver.h:
3406         * page/Quirks.cpp:
3407         (WebCore::Quirks::needsGMailOverflowScrollQuirk const):
3408         * page/Quirks.h:
3409
3410 2019-05-02  Simon Fraser  <simon.fraser@apple.com>
3411
3412         Add logging for RenderLayer clip rects
3413         https://bugs.webkit.org/show_bug.cgi?id=197547
3414
3415         Reviewed by Zalan Bujtas.
3416
3417         Add a ClipRects log channel, and stream output for ClipRect and ClipRects.
3418
3419         * platform/Logging.h:
3420         * rendering/ClipRect.cpp:
3421         (WebCore::operator<<):
3422         * rendering/ClipRect.h:
3423         * rendering/RenderLayer.cpp:
3424         (WebCore::operator<<):
3425         (WebCore::RenderLayer::calculateClipRects const):
3426         * rendering/RenderLayer.h:
3427
3428 2019-05-02  Youenn Fablet  <youenn@apple.com>
3429
3430         Make AudioContext::scriptExecutionContext() private
3431         https://bugs.webkit.org/show_bug.cgi?id=197512
3432
3433         Reviewed by Eric Carlson.
3434
3435         Refactor code to make audio nodes not rely on AudioContext::scriptExecutionContext.
3436         Instead, let AudioContext provide the necessary API for its nodes.
3437         Covered by existing tests.
3438
3439         * Modules/webaudio/AudioBufferSourceNode.cpp:
3440         (WebCore::AudioBufferSourceNode::looping):
3441         (WebCore::AudioBufferSourceNode::setLooping):
3442         * Modules/webaudio/AudioContext.cpp:
3443         (WebCore::AudioContext::postTask):
3444         (WebCore::AudioContext::origin const):
3445         (WebCore::AudioContext::addConsoleMessage):
3446         * Modules/webaudio/AudioContext.h:
3447         (WebCore::AudioContext::isStopped const):
3448         * Modules/webaudio/AudioNode.cpp:
3449         (WebCore::AudioNode::scriptExecutionContext const):
3450         * Modules/webaudio/AudioNode.h:
3451         * Modules/webaudio/AudioScheduledSourceNode.cpp:
3452         (WebCore::AudioScheduledSourceNode::finish):
3453         * Modules/webaudio/DefaultAudioDestinationNode.cpp:
3454         (WebCore::DefaultAudioDestinationNode::resume):
3455         (WebCore::DefaultAudioDestinationNode::suspend):
3456         (WebCore::DefaultAudioDestinationNode::close):
3457         * Modules/webaudio/MediaElementAudioSourceNode.cpp:
3458         (WebCore::MediaElementAudioSourceNode::wouldTaintOrigin):
3459         * Modules/webaudio/MediaStreamAudioDestinationNode.cpp:
3460         (WebCore::MediaStreamAudioDestinationNode::MediaStreamAudioDestinationNode):
3461         * Modules/webaudio/ScriptProcessorNode.cpp:
3462         (WebCore::ScriptProcessorNode::fireProcessEvent):
3463
3464 2019-05-02  Ryosuke Niwa  <rniwa@webkit.org>
3465
3466         Disable software keyboard for a math field textarea on desmos.com
3467         https://bugs.webkit.org/show_bug.cgi?id=197488
3468
3469         Reviewed by Wenson Hsieh.
3470
3471         Treat a textarea inside a math field span as if it had inputmode content attribute set to none to suppress
3472         the software keyboard on desmos.com as it interferes with website's own UI.
3473
3474         * html/HTMLElement.cpp:
3475         (WebCore::HTMLElement::canonicalInputMode const):
3476         * page/Quirks.cpp:
3477         (WebCore::Quirks::needsInputModeNoneImplicitly const):
3478         * page/Quirks.h:
3479
3480 2019-05-02  Timothy Hatcher  <timothy@apple.com>
3481
3482         NSAttributedString conversion in a loop returns nil and WKUnknownError every other time.
3483         https://bugs.webkit.org/show_bug.cgi?id=197523
3484
3485         Reviewed by Darin Adler.
3486
3487         * editing/cocoa/HTMLConverter.mm:
3488         (HTMLConverter::convert): Don't return early if m_dataSource is nil. This is already null
3489         checked later and only needed in specific cases, it shouldn't fail the whole conversion.
3490
3491 2019-05-02  Chris Dumez  <cdumez@apple.com>
3492
3493         Setting a frame's src to a javascript URL should not run it synchronously
3494         https://bugs.webkit.org/show_bug.cgi?id=197466
3495
3496         Reviewed by Darin Adler.
3497
3498         When an iframe's src attribute is set to a javascript URL, whether when parsing
3499         or later on via JS, we now execute the URL's JavaScript asynchronously. We used
3500         to execute it synchronously, which was a source of bugs and also did not match
3501         other browsers.
3502
3503         I have verified that our new behavior is aligned with both Firefox and Chrome.
3504
3505         Note that for backward-compatibility and interoperability with Blink
3506         (https://bugs.chromium.org/p/chromium/issues/detail?id=923585), the
3507         "javascript:''" URL will still run synchronously. We should consider dropping
3508         this quirk at some point.
3509
3510         Test: fast/dom/frame-src-javascript-url-async.html
3511
3512         * loader/NavigationScheduler.cpp:
3513         (WebCore::ScheduledLocationChange::ScheduledLocationChange):
3514         (WebCore::ScheduledLocationChange::~ScheduledLocationChange):
3515         (WebCore::NavigationScheduler::scheduleLocationChange):
3516         * loader/NavigationScheduler.h:
3517         (WebCore::NavigationScheduler::scheduleLocationChange):
3518         * loader/SubframeLoader.cpp:
3519         (WebCore::SubframeLoader::requestFrame):
3520
3521 2019-05-02  Gary Katsevman  <git@gkatsev.com>
3522
3523         WebVTT: fix vertical cue alignment.
3524         https://bugs.webkit.org/show_bug.cgi?id=136627.
3525         <rdar://problem/49725538>
3526
3527         Reviewed by Eric Carlson.
3528
3529         Updated existing test results.
3530
3531         * html/track/VTTCue.cpp:
3532         (WebCore::VTTCueBox::applyCSSProperties):
3533
3534 2019-05-02  Don Olmstead  <don.olmstead@sony.com>
3535
3536         [CMake] Refactor WEBKIT_MAKE_FORWARDING_HEADERS into WEBKIT_COPY_FILES
3537         https://bugs.webkit.org/show_bug.cgi?id=197174
3538
3539         Reviewed by Alex Christensen.
3540
3541         Replace WEBKIT_MAKE_FORWARDING_HEADERS with WEBKIT_COPY_FILES and make dependencies
3542         for framework headers explicit.
3543
3544         * CMakeLists.txt:
3545
3546 2019-05-02  Jiewen Tan  <jiewen_tan@apple.com>
3547
3548         [WebAuthN] Add a quirk for google.com when processing AppID extension
3549         https://bugs.webkit.org/show_bug.cgi?id=196046
3550         <rdar://problem/49088479>
3551
3552         Reviewed by Brent Fulgham.
3553
3554         Relaxing the same site restriction on AppID while in google.com and any
3555         of its subdomains to allow two www.gstatic.com AppIDs to slip in.
3556
3557         Covered by manual tests on Google.com.
3558
3559         * Modules/webauthn/AuthenticatorCoordinator.cpp:
3560         (WebCore::AuthenticatorCoordinatorInternal::needsAppIdQuirks):
3561         (WebCore::AuthenticatorCoordinatorInternal::processAppIdExtension):
3562
3563 2019-05-02  Ross Kirsling  <ross.kirsling@sony.com>
3564
3565         Unreviewed fix for non-unified build after r244853.
3566
3567         * page/SecurityOrigin.cpp:
3568
3569 2019-05-02  Frederic Wang  <fwang@igalia.com>
3570
3571         [GTK][WPE] Disable "thin", "thick", "medium" values of mfrac@linethickness at runtime
3572         https://bugs.webkit.org/show_bug.cgi?id=196142
3573
3574         This patch introduces some experimental runtime flag to let users
3575         disable MathML features that are removed from MathML Core [1]. For now,
3576         these features are only disabled on GTK and WPE ports. This patch also
3577         adds a condition to disable "thin", "thick", "medium" values of
3578         mfrac@linethickness at runtime as agreed in [2].
3579
3580         [1] https://mathml-refresh.github.io/mathml-core/
3581         [2] https://github.com/mathml-refresh/mathml/issues/4
3582
3583         Reviewed by Rob Buis.
3584
3585         No new tests, covered by frac-linethickness-0001.html
3586
3587         * mathml/MathMLFractionElement.cpp:
3588         (WebCore::MathMLFractionElement::lineThickness): Just do standard
3589         parsing for MathML lengths when non-core MathML features are disabled.
3590         * page/Settings.yaml: Add WebCore setting.
3591
3592 2019-05-01  Jiewen Tan  <jiewen_tan@apple.com>
3593
3594         [WebAuthN] Adopt SecurityOrigin::isMatchingRegistrableDomainSuffix()
3595         https://bugs.webkit.org/show_bug.cgi?id=197481
3596
3597         Reviewed by Brent Fulgham.
3598
3599         This patch implements Step 6-7 from:
3600         https://www.w3.org/TR/webauthn/#createCredential,
3601         https://www.w3.org/TR/webauthn/#discover-from-external-source.
3602
3603         Test: http/wpt/webauthn/public-key-credential-ip-address.html
3604
3605         * Modules/webauthn/AuthenticatorCoordinator.cpp:
3606         (WebCore::AuthenticatorCoordinator::create const):
3607         (WebCore::AuthenticatorCoordinator::discoverFromExternalSource const):
3608
3609 2019-05-01  Youenn Fablet  <youenn@apple.com>
3610
3611         Add back hasNullReferences() assert in Document::updateIsPlayingMedia
3612         https://bugs.webkit.org/show_bug.cgi?id=197477
3613
3614         Reviewed by Eric Carlson.
3615
3616         AudioContext had a special scriptExecutionContext() getter
3617         that was returning nullptr when AudioContext is stopped.
3618         Instead, make this getter behave as all other scriptExecutionContext() getters
3619         and make sure existing call sites of the getter are fine with the change.
3620
3621         Covered by existing tests.
3622
3623         * Modules/webaudio/AudioContext.cpp:
3624         (WebCore::AudioContext::AudioContext):
3625         No need to check whether offline since this constructor is for non offline AudioContext.
3626         (WebCore::AudioContext::scriptExecutionContext const):
3627         (WebCore::AudioContext::fireCompletionEvent):
3628         * dom/Document.cpp:
3629         (WebCore::Document::updateIsPlayingMedia):
3630
3631 2019-05-01  Justin Fan  <justin_fan@apple.com>
3632
3633         Update WebGPU class names based on sketch.idl
3634         https://bugs.webkit.org/show_bug.cgi?id=194260
3635
3636         Reviewed by Dean Jackson.
3637
3638         Update all exposed Web GPU interface names to GPU* prefix.
3639
3640         Existing Web GPU tests updated to expect new names.
3641
3642         * Modules/webgpu/WebGPU.idl:
3643         * Modules/webgpu/WebGPUAdapter.idl:
3644         * Modules/webgpu/WebGPUBindGroup.idl:
3645         * Modules/webgpu/WebGPUBindGroupLayout.idl:
3646         * Modules/webgpu/WebGPUBuffer.idl:
3647         * Modules/webgpu/WebGPUDevice.idl:
3648         * Modules/webgpu/WebGPUInputStepMode.h: Removed.
3649         * Modules/webgpu/WebGPUPipelineLayout.idl:
3650         * Modules/webgpu/WebGPUProgrammablePassEncoder.idl:
3651         * Modules/webgpu/WebGPUQueue.idl:
3652         * Modules/webgpu/WebGPURenderPassEncoder.idl:
3653         * Modules/webgpu/WebGPURenderPipeline.idl:
3654         * Modules/webgpu/WebGPUSampler.idl:
3655         * Modules/webgpu/WebGPUTexture.idl:
3656         * Modules/webgpu/WebGPUTextureView.idl:
3657         * WebCore.xcodeproj/project.pbxproj:
3658         * bindings/js/WebCoreBuiltinNames.h:
3659
3660 2019-05-01  Jiewen Tan  <jiewen_tan@apple.com>
3661
3662         Move Document::domainIsRegisterable to SecurityOrigin::isMatchingRegistrableDomainSuffix
3663         https://bugs.webkit.org/show_bug.cgi?id=181950
3664         <rdar://problem/43357371>
3665
3666         Reviewed by Brent Fulgham.
3667
3668         This patch moves Document::domainIsRegisterable to SecurityOrigin::isMatchingRegistrableDomainSuffix
3669         to be more aligned with the HTML standard:
3670         https://html.spec.whatwg.org/multipage/origin.html#is-a-registrable-domain-suffix-of-or-is-equal-to.
3671         Besides that, it also removes redundant codes within the original method that is also done in
3672         OriginAccessEntry::matchesOrigin.
3673
3674         Covered by new API tests.
3675
3676         * dom/Document.cpp:
3677         (WebCore::Document::setDomain):
3678         (WebCore::Document::domainIsRegisterable const): Deleted.
3679         * dom/Document.h:
3680         * page/SecurityOrigin.cpp:
3681         (WebCore::SecurityOrigin::isMatchingRegistrableDomainSuffix const):
3682         * page/SecurityOrigin.h:
3683
3684 2019-05-01  Ryosuke Niwa  <rniwa@webkit.org>
3685
3686         [iOS] Element::focus and Element::scrollIntoView do not clamp scroll positions
3687         https://bugs.webkit.org/show_bug.cgi?id=197211
3688
3689         Reviewed by Simon Fraser.
3690
3691         Fixed the bug that Element::focus and Element::scrollIntoView were not clamping scroll offsets,
3692         which causes scrollTop etc... to return a bogus negative scrolling offset.
3693
3694         Unfortunately, we can't just use FrameView's ScrollableArea::constrainScrollPosition since
3695         scrollRectToVisible relies on the visible rect being expanded by the content insets in order to scroll to
3696         a position within the content insets of UIScrollView; e.g. revealing the top of the page as the center.
3697         We manually expand minimumScrollPosition() and maximumScrollPosition() by the content insets instead.
3698
3699         Tests: fast/scrolling/ios/programmatic-scroll-via-focus-should-clamp-top.html
3700                fast/scrolling/ios/programmatic-scroll-via-scrollIntoView-inside-iframe-should-clamp-top.html
3701                fast/scrolling/ios/programmatic-scroll-via-scrollIntoView-should-clamp-top.html
3702
3703         * rendering/RenderLayer.cpp:
3704         (WebCore::RenderLayer::scrollRectToVisible):
3705
3706 2019-05-01  Wenson Hsieh  <wenson_hsieh@apple.com>
3707
3708         [iOS] Add a version of viewport shrink-to-fit heuristics that preserves page layout
3709         https://bugs.webkit.org/show_bug.cgi?id=197342
3710         <rdar://problem/50063091>
3711
3712         Reviewed by Tim Horton.
3713
3714         Adds support for a new shrink-to-fit heuristic that attempts to lay out the contents of the page at a larger
3715         width in order to shrink content to fit the viewport. See WebKit ChangeLog for more details.
3716
3717         Tests: fast/viewport/ios/shrink-to-fit-content-constant-width.html
3718                fast/viewport/ios/shrink-to-fit-content-large-width-breakpoint.html
3719                fast/viewport/ios/shrink-to-fit-content-no-viewport.html
3720                fast/viewport/ios/shrink-to-fit-content-responsive-viewport-with-horizontal-overflow.html
3721                fast/viewport/ios/shrink-to-fit-content-temporary-overflow.html
3722
3723         * page/ViewportConfiguration.cpp:
3724         (WebCore::ViewportConfiguration::setMinimumEffectiveDeviceWidth):
3725         (WebCore::ViewportConfiguration::setIsKnownToLayOutWiderThanViewport):
3726         (WebCore::ViewportConfiguration::description const):
3727         * page/ViewportConfiguration.h:
3728         (WebCore::ViewportConfiguration::canIgnoreScalingConstraints const):
3729         (WebCore::ViewportConfiguration::minimumEffectiveDeviceWidth const):
3730
3731         Add several new getters and setters in ViewportConfiguration.
3732
3733         (WebCore::ViewportConfiguration::isKnownToLayOutWiderThanViewport const):
3734         (WebCore::ViewportConfiguration::shouldIgnoreMinimumEffectiveDeviceWidth const):
3735
3736         Importantly, only allow ignoring the minimum effective device width in webpages with responsive viewports, if
3737         they also have *not* laid out wider than the viewport.
3738
3739         (WebCore::ViewportConfiguration::setForceAlwaysUserScalable):
3740
3741 2019-05-01  Zalan Bujtas  <zalan@apple.com>
3742
3743         [iOS] Star rating is covered with a black circle when writing a review on Yelp
3744         https://bugs.webkit.org/show_bug.cgi?id=197469
3745         <rdar://problem/48094446>
3746
3747         Reviewed by Dean Jackson.
3748
3749         This patch moves the background painting of the radio/checkbox form controls in checked state to RenderTheme.
3750         It enables content authors to disable default appearance using -webkit-appearance: none (it is also inline with what we do on macOS).
3751
3752         Test: fast/forms/radio-and-checkbox-checked-with-no-appearance.html
3753
3754         * css/html.css:
3755         (input:matches([type="checkbox"], [type="radio"]):checked):
3756         * rendering/RenderThemeIOS.mm:
3757         (WebCore::RenderThemeIOS::paintCheckboxDecorations):
3758         (WebCore::RenderThemeIOS::paintRadioDecorations):
3759
3760 2019-05-01  Said Abou-Hallawa  <sabouhallawa@apple.com>
3761
3762         REGRESSION (r244182): RenderingUpdate should not be scheduled for invisible pages
3763         https://bugs.webkit.org/show_bug.cgi?id=197451
3764
3765         Reviewed by Simon Fraser.
3766
3767         Before r244182, some web pages never need to schedule a RenderingUpdate.
3768         Only pages with rAF callbacks, web animations, intersection and resize 
3769         observers needed to do so. After r244182, all pages have to schedule a
3770         RenderingUpdate when a page rendering update is required.
3771
3772         When Safari opens, it create a 'blank' web page. The blank page will not
3773         be visible unless the user selects to show the 'Empty page' in the new
3774         tab. Although the blank page is not visible, the loader needs to resolveStyle()
3775         which requires to scheduleLayerFlushNow(). 
3776
3777         We need to optimize this case: calling scheduleLayerFlushNow() for invisible
3778         pages. We do that by checking if the page is visible before scheduling
3779         the RenderingUpdate.
3780
3781         Also we need to change or get rid of scheduleLayerFlushNow() since its name
3782         has become confusing. It suggests that it is going to schedule flushing
3783         the layer 'now'. But after r244182, it does scheduleRenderingUpdate() first.
3784         And when it fires, scheduleCompositingLayerFlush() will be called.
3785
3786         * page/RenderingUpdateScheduler.cpp:
3787         (WebCore::RenderingUpdateScheduler::scheduleRenderingUpdate):
3788         * rendering/RenderLayerCompositor.cpp:
3789         (WebCore::RenderLayerCompositor::scheduleLayerFlush):
3790         (WebCore::RenderLayerCompositor::didChangeVisibleRect):
3791         (WebCore::RenderLayerCompositor::frameViewDidScroll):
3792         (WebCore::RenderLayerCompositor::attachRootLayer):
3793         (WebCore::RenderLayerCompositor::setLayerFlushThrottlingEnabled):
3794         (WebCore::RenderLayerCompositor::layerFlushTimerFired):
3795         (WebCore::RenderLayerCompositor::scheduleLayerFlushNow): Deleted.
3796         * rendering/RenderLayerCompositor.h:
3797
3798 2019-05-01  Darin Adler  <darin@apple.com>
3799
3800         WebKit has too much of its own UTF-8 code and should rely more on ICU's UTF-8 support
3801         https://bugs.webkit.org/show_bug.cgi?id=195535
3802
3803         Reviewed by Alexey Proskuryakov.
3804
3805         * platform/SharedBuffer.cpp:
3806         (WebCore::utf8Buffer): Removed unnecessary "strict" argument to convertUTF16ToUTF8 since
3807         that is the default behavior. Also updated for changes to return values.
3808
3809         * xml/XSLTProcessorLibxslt.cpp:
3810         (WebCore::writeToStringBuilder): Removed unnecessary use of StringBuffer for a temporary
3811         buffer for characters. Rewrote to use U8_NEXT and U16_APPEND directly.
3812
3813         * xml/parser/XMLDocumentParserLibxml2.cpp:
3814         (WebCore::convertUTF16EntityToUTF8): Updated for changes to CompletionResult.
3815
3816 2019-05-01  Shawn Roberts  <sroberts@apple.com>
3817
3818         Unreviewed, rolling out r244821.
3819
3820         Causing
3821
3822         Reverted changeset:
3823
3824         "WebKit has too much of its own UTF-8 code and should rely
3825         more on ICU's UTF-8 support"
3826         https://bugs.webkit.org/show_bug.cgi?id=195535
3827         https://trac.webkit.org/changeset/244821
3828
3829 2019-05-01  Shawn Roberts  <sroberts@apple.com>
3830
3831         Unreviewed, rolling out r244822.
3832
3833         Causing
3834
3835         Reverted changeset:
3836
3837         https://trac.webkit.org/changeset/244822
3838
3839 2019-05-01  Youenn Fablet  <youenn@apple.com>
3840
3841         Reject/throw when calling AudioContext methods on a stopped AudioContext
3842         https://bugs.webkit.org/show_bug.cgi?id=197391
3843
3844         Reviewed by Eric Carlson.
3845
3846         Return InvalidStateError in that case.
3847         ASSERT that we do not call lazyInitialize after being stopped
3848         since this would mean we are doing unneeded processing.
3849
3850         Test: http/wpt/webaudio/audiocontext-stopped.html
3851
3852         * Modules/webaudio/AudioContext.cpp:
3853         (WebCore::AudioContext::lazyInitialize):
3854         (WebCore::AudioContext::createBufferSource):
3855         (WebCore::AudioContext::createMediaElementSource):
3856         (WebCore::AudioContext::createMediaStreamSource):
3857         (WebCore::AudioContext::createMediaStreamDestination):
3858         (WebCore::AudioContext::createScriptProcessor):
3859         (WebCore::AudioContext::createBiquadFilter):
3860         (WebCore::AudioContext::createWaveShaper):
3861         (WebCore::AudioContext::createPanner):
3862         (WebCore::AudioContext::createConvolver):
3863         (WebCore::AudioContext::createDynamicsCompressor):
3864         (WebCore::AudioContext::createAnalyser):
3865         (WebCore::AudioContext::createGain):
3866         (WebCore::AudioContext::createDelay):
3867         (WebCore::AudioContext::createChannelSplitter):
3868         (WebCore::AudioContext::createChannelMerger):
3869         (WebCore::AudioContext::createOscillator):
3870         (WebCore::AudioContext::createPeriodicWave):
3871         (WebCore::AudioContext::startRendering):
3872         (WebCore::AudioContext::suspend):
3873         (WebCore::AudioContext::resume):
3874         (WebCore::AudioContext::close):
3875         * Modules/webaudio/AudioContext.h:
3876         * Modules/webaudio/AudioContext.idl:
3877
3878 2019-05-01  Eric Carlson  <eric.carlson@apple.com>
3879
3880         XMLHttpRequest should propagate user gestures for media playback
3881         https://bugs.webkit.org/show_bug.cgi?id=197428
3882         <rdar://problem/46677392>
3883
3884         Reviewed by Jer Noble.
3885
3886         A user gesture the would allow media state change in effect when XMLHttpRequest.send is 
3887         called should be active when the event handlers fire after the transaction completes successfully.
3888
3889         Test: http/tests/media/user-gesture-preserved-across-xmlhttprequest.html
3890
3891         * dom/UserGestureIndicator.cpp:
3892         (WebCore::UserGestureIndicator::UserGestureIndicator): Add a 'scope' parameter to potentially
3893         limit the scope of the gesture to just media.
3894         (WebCore::UserGestureIndicator::~UserGestureIndicator): Clear the scope.
3895         * dom/UserGestureIndicator.h:
3896         (WebCore::UserGestureToken::processingUserGesture const):
3897         (WebCore::UserGestureToken::setScope):
3898         (WebCore::UserGestureToken::resetScope):
3899         (WebCore::UserGestureToken::hasExpired const):
3900
3901         * page/DOMTimer.cpp:
3902         (WebCore::DOMTimerFireState::DOMTimerFireState): Don't need to store the nested timer interval,
3903         UserGestureIndicator knows when it started.
3904         (WebCore::DOMTimer::DOMTimer): Ditto.
3905         (WebCore::DOMTimer::fired): Ditto.
3906         (WebCore::DOMTimerFireState::nestedTimerInterval const): Deleted.
3907         (WebCore::shouldForwardUserGesture): Deleted.
3908         (WebCore::userGestureTokenToForward): Deleted.
3909         (WebCore::currentNestedTimerInterval): Deleted.
3910         * page/DOMTimer.h:
3911
3912         * testing/Internals.cpp:
3913         (WebCore::Internals::setXHRMaximumIntervalForUserGestureForwarding): Override the maximum
3914         user gesture interval for testing.
3915         * testing/Internals.h:
3916         * testing/Internals.idl:
3917
3918         * xml/XMLHttpRequest.cpp:
3919         (WebCore::XMLHttpRequest::XMLHttpRequest): 
3920         (WebCore::XMLHttpRequest::send): Stash the user gesture token.
3921         (WebCore::XMLHttpRequest::dispatchEvent): Clear user gesture token if it has expired. If still
3922         valid, activate it.
3923         * xml/XMLHttpRequest.h:
3924
3925 2019-04-29  Darin Adler  <darin@apple.com>
3926
3927         WebKit has too much of its own UTF-8 code and should rely more on ICU's UTF-8 support
3928         https://bugs.webkit.org/show_bug.cgi?id=195535
3929
3930         Reviewed by Alexey Proskuryakov.
3931
3932         * platform/SharedBuffer.cpp:
3933         (WebCore::utf8Buffer): Removed unnecessary "strict" argument to convertUTF16ToUTF8 since
3934         that is the default behavior. Also updated for changes to return values.
3935
3936         * xml/XSLTProcessorLibxslt.cpp:
3937         (WebCore::writeToStringBuilder): Removed unnecessary use of StringBuffer for a temporary
3938         buffer for characters. Rewrote to use U8_NEXT and U16_APPEND directly.
3939
3940         * xml/parser/XMLDocumentParserLibxml2.cpp:
3941         (WebCore::convertUTF16EntityToUTF8): Updated for changes to CompletionResult.
3942
3943 2019-04-30  John Wilander  <wilander@apple.com>
3944
3945         Add logging of Ad Click Attribution errors and events to a dedicated channel
3946         https://bugs.webkit.org/show_bug.cgi?id=197332
3947         <rdar://problem/49918800>
3948
3949         Reviewed by Youenn Fablet.
3950
3951         This patch adds an experimental Ad Click Attribution debug mode which
3952         logs information.
3953
3954         No new tests.
3955
3956         * loader/AdClickAttribution.cpp:
3957         (WebCore::AdClickAttribution::parseConversionRequest):
3958         (WebCore::AdClickAttribution::debugModeEnabled):
3959         * loader/AdClickAttribution.h:
3960         * page/RuntimeEnabledFeatures.h:
3961         (WebCore::RuntimeEnabledFeatures::adClickAttributionDebugModeEnabled const):
3962         (WebCore::RuntimeEnabledFeatures::setAdClickAttributionDebugModeEnabled):
3963         * platform/Logging.h:
3964
3965 2019-04-30  Myles C. Maxfield  <mmaxfield@apple.com>
3966
3967         font-weight: 1000 is not parsed successfully
3968         https://bugs.webkit.org/show_bug.cgi?id=197427
3969
3970         Reviewed by Dean Jackson.
3971
3972         The spec says:
3973         "Only values greater than or equal to 1, and less than or equal to 1000, are valid"
3974
3975         This change brings us in-line with all the other browsers.
3976
3977         Test: fast/text/font-weight-1-1000.html
3978
3979         * css/parser/CSSPropertyParserHelpers.cpp:
3980         (WebCore::CSSPropertyParserHelpers::consumeFontWeightNumber):
3981
3982 2019-04-30  Youenn Fablet  <youenn@apple.com>
3983
3984         Make Document audio producers use WeakPtr
3985         https://bugs.webkit.org/show_bug.cgi?id=197382
3986
3987         Reviewed by Eric Carlson.
3988
3989         Move from a hash set of raw pointers to a hash set of weak pointers.