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