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