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