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