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