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