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