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