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