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