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