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