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