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