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