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