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