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