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