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