Fix security check in ScriptController::canAccessFromCurrentOrigin()
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-05-20  Chris Dumez  <cdumez@apple.com>
2
3         Fix security check in ScriptController::canAccessFromCurrentOrigin()
4         https://bugs.webkit.org/show_bug.cgi?id=196730
5         <rdar://problem/49731231>
6
7         Reviewed by Ryosuke Niwa.
8
9         Fix security check in ScriptController::canAccessFromCurrentOrigin() when there is no
10         current JS exec state. Instead of returning true unconditionally, we now fall back to
11         using the accessing document's origin for the security check. The new behavior is
12         aligned with Blink:
13         https://cs.chromium.org/chromium/src/third_party/blink/renderer/core/html/html_frame_element_base.cc?rcl=d3f22423d512b45466f1694020e20da9e0c6ee6a&l=62
14
15         This fix is based on a patch from Sergei Glazunov <glazunov@google.com>.
16
17         Test: http/tests/security/showModalDialog-sync-cross-origin-page-load2.html
18
19         * bindings/js/ScriptController.cpp:
20         (WebCore::ScriptController::canAccessFromCurrentOrigin):
21         * bindings/js/ScriptController.h:
22         * html/HTMLFrameElementBase.cpp:
23         (WebCore::HTMLFrameElementBase::isURLAllowed const):
24
25 2019-05-20  Gabe Giosia  <giosia@google.com>
26
27         Range getBoundingClientRect returning zero rect on simple text node with <br> before it
28         https://bugs.webkit.org/show_bug.cgi?id=182181
29
30         Reviewed by Antti Koivisto.
31         
32         Correct rect of RenderText in a block element when used in a Range
33         over a line break element. The end offset was miscalculated.
34
35         Addded line-break case to fast/dom/Range/getBoundingClientRect.html
36
37         * rendering/SimpleLineLayoutFunctions.cpp:
38         (WebCore::SimpleLineLayout::collectAbsoluteQuadsForRange):
39         * rendering/SimpleLineLayoutResolver.cpp:
40         (WebCore::SimpleLineLayout::RunResolver::rangeForRendererWithOffsets const):
41
42 2019-05-19  Brent Fulgham  <bfulgham@apple.com>
43
44         Unreviewed build fix after r245508.
45
46         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp: Don't use
47         an 'import' directive in a C++ file.
48
49 2019-05-19  Brent Fulgham  <bfulgham@apple.com>
50
51         Wait to get frame until after layout has been run
52         https://bugs.webkit.org/show_bug.cgi?id=197999
53         <rdar://problem/50800345>
54
55         Reviewed by Alex Christensen.
56
57         The current frame can change when layout runs, so don't bother retrieving
58         the frame until the final layout pass is complete.
59
60         Test: fast/dom/window-inner-width-crash.html
61
62         * page/DOMWindow.cpp:
63         (WebCore::DOMWindow::innerHeight const): Move frame access past the
64         layout operation.
65         (WebCore::DOMWindow::innerWidth const): Ditto.
66         (WebCore::DOMWindow::scrollX const): Ditto.
67         (WebCore::DOMWindow::scrollY const): Ditto.
68
69 2019-05-19  Brent Fulgham  <bfulgham@apple.com>
70
71         Unreviewed build fix
72
73         Attempting to build with only Open Source sources on shipping software with
74         ASan enabled triggers build failures due to missing includes. This patch adds
75         the necessary includes to cleanly build WebCore.
76
77         * Modules/applepay/ApplePaySession.cpp:
78         * Modules/applepay/PaymentSession.cpp:
79         * Modules/mediastream/UserMediaController.cpp:
80         * bindings/js/ScriptController.cpp:
81         * contentextensions/ContentExtensionsBackend.cpp:
82         * dom/Document.cpp:
83         * dom/ScriptedAnimationController.cpp:
84         * editing/cocoa/EditorCocoa.mm:
85         * editing/cocoa/HTMLConverter.mm:
86         * editing/cocoa/WebContentReaderCocoa.mm:
87         * editing/markup.cpp:
88         * history/CachedFrame.cpp:
89         * html/HTMLDocument.cpp:
90         * html/HTMLHtmlElement.cpp:
91         * html/HTMLMediaElement.cpp:
92         * html/ImageDocument.cpp:
93         * html/MediaDocument.cpp:
94         * html/PluginDocument.cpp:
95         * html/parser/HTMLDocumentParser.cpp:
96         * html/parser/XSSAuditor.cpp:
97         * inspector/InspectorInstrumentation.cpp:
98         * inspector/agents/InspectorApplicationCacheAgent.cpp:
99         * inspector/agents/InspectorNetworkAgent.cpp:
100         * inspector/agents/InspectorPageAgent.cpp:
101         * inspector/agents/page/PageNetworkAgent.cpp:
102         * loader/ApplicationManifestLoader.cpp:
103         * loader/FrameLoader.cpp:
104         * loader/LoadTiming.cpp:
105         * loader/NetscapePlugInStreamLoader.cpp:
106         * loader/ResourceLoader.cpp:
107         * loader/SubresourceLoader.cpp:
108         * loader/appcache/ApplicationCacheHost.cpp:
109         * loader/archive/cf/LegacyWebArchive.cpp:
110         * loader/icon/IconLoader.cpp:
111         * page/ContextMenuController.cpp:
112         * page/FrameView.cpp:
113         * page/Page.cpp:
114         * page/Performance.cpp:
115         * page/PerformanceNavigation.cpp:
116         * page/Quirks.cpp:
117         * page/UserContentProvider.cpp:
118         * page/csp/ContentSecurityPolicy.cpp:
119         * page/mac/PageMac.mm:
120         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
121         * svg/graphics/SVGImage.cpp:
122         * testing/Internals.cpp:
123
124 2019-05-19  Antoine Quint  <graouts@apple.com>
125
126         [Pointer Events] Listening to a "pointerover", "pointerenter", "pointerout" or "pointerleave" event alone does not fire the event on iOS
127         https://bugs.webkit.org/show_bug.cgi?id=197882
128         <rdar://problem/50769116>
129
130         Reviewed by Dean Jackson.
131
132         Tests: pointerevents/ios/pointerenter-alone.html
133                pointerevents/ios/pointerleave-alone.html
134                pointerevents/ios/pointerout-alone.html
135                pointerevents/ios/pointerover-alone.html
136
137         * dom/EventNames.h:
138         (WebCore::EventNames::isTouchRelatedEventType const):
139         (WebCore::EventNames::touchRelatedEventNames const):
140         (WebCore::EventNames::extendedTouchRelatedEventNames const):
141
142 2019-05-19  Antoine Quint  <graouts@apple.com>
143
144         [Pointer Events] A pointer should be marked as primary for all of its events
145         https://bugs.webkit.org/show_bug.cgi?id=197909
146         <rdar://problem/50801608>
147
148         Reviewed by Dean Jackson.
149
150         Add an ivar for EventHandler which we'll use in WebKitAdditions code to track the touch identifier
151         of the very first touch to start in a given sequence.
152
153         * page/EventHandler.h:
154
155 2019-05-19  Darin Adler  <darin@apple.com>
156
157         Change String::number to use "shortest" instead of "fixed precision 6 digits"
158         https://bugs.webkit.org/show_bug.cgi?id=178319
159
160         Reviewed by Sam Weinig.
161
162         * accessibility/atk/WebKitAccessibleInterfaceValue.cpp:
163         (webkitAccessibleSetNewValue): Use String::numberToStringFixedPrecision
164         instead of String::number to be explicit about the fact that it's fixed precision.
165         * page/linux/ResourceUsageOverlayLinux.cpp:
166         (gcTimerString): Ditto.
167
168         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
169         (printTransform): Use appendFixedPrecisionNumber instead of appendNumber
170         to be explicit about the fact that it's fixed precision.
171         (printLayer): Ditto.
172         (WebCore::PlatformCALayerWin::layerTreeAsString const): Ditto.
173         * platform/graphics/freetype/FontCacheFreeType.cpp:
174         (buildVariationSettings): Ditto.
175
176         * svg/SVGNumberList.h: Use appendFixedPrecisionNumber instead of appendNumber
177         to be explicit about the fact that it's fixed precision. We'll consider moving
178         to shortest later.
179
180         * svg/SVGPathUtilities.cpp:
181         (WebCore::buildStringFromPath): Use appendNumberShortest instead of
182         appendNumberECMAScript since these are single-precision.
183
184         * svg/SVGPointList.h: Use appendFixedPrecisionNumber instead of appendNumber
185         to be explicit about the fact that it's fixed precision. We'll consider moving
186         to shortest later.
187         * svg/SVGTransformValue.h: Ditto.
188
189 2019-05-19  Simon Fraser  <simon.fraser@apple.com>
190
191         Layers painting into shared backing need to contribute to overlap
192         https://bugs.webkit.org/show_bug.cgi?id=198021
193
194         Reviewed by Zalan Bujtas.
195         
196         Layers that paint into a composited (non-root) layer get added to the overlap map so
197         that later layers correct overlap them; this is done via the test against currentState.compositingAncestor.
198
199         We need the same logic for layers that paint into shared backing; they need to behave
200         the same way in terms of how they contribute to overlap. We already had currentState.backingSharingAncestor
201         which was unused, but now use it for this, and correctly null it out when a layer composites.
202
203         Bug was noticed during testing, and not known to affect any websites (though it probably does).
204         
205         Also move the overlap container popping into updateOverlapMap() so the two callers can
206         share the code, and more explicitly track whether a container was pushed.
207
208         Test: compositing/shared-backing/sharing-child-contributes-to-overlap.html
209
210         * rendering/RenderLayerCompositor.cpp:
211         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
212         (WebCore::RenderLayerCompositor::traverseUnchangedSubtree):
213         (WebCore::RenderLayerCompositor::updateOverlapMap const):
214         * rendering/RenderLayerCompositor.h:
215
216 2019-05-17  Joonghun Park  <pjh0718@gmail.com>
217
218         Implement CSS `display: flow-root` (modern clearfix)
219         https://bugs.webkit.org/show_bug.cgi?id=165603
220
221         Reviewed by Zalan Bujtas.
222
223         This change follows https://drafts.csswg.org/css-display-3/#valdef-display-flow-root as below.
224
225         'display: flow-root' generates a block container box, and lays out its contents using flow layout.
226         It always establishes a new block formatting context for its contents.
227
228         * css/CSSPrimitiveValueMappings.h:
229         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
230         * css/CSSValueKeywords.in:
231         * css/StyleResolver.cpp:
232         (WebCore::equivalentBlockDisplay):
233         * css/parser/CSSParserFastPaths.cpp:
234         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
235         * rendering/RenderBox.cpp:
236         (WebCore::RenderBox::createsNewFormattingContext const):
237         * rendering/RenderElement.cpp:
238         (WebCore::RenderElement::createFor):
239         * rendering/style/RenderStyleConstants.h:
240
241 2019-05-17  Don Olmstead  <don.olmstead@sony.com>
242
243         [CMake] Use builtin FindICU
244         https://bugs.webkit.org/show_bug.cgi?id=197934
245
246         Reviewed by Michael Catanzaro.
247
248         Remove uses of ICU_INCLUDE_DIRS and ICU_LIBRARIES.
249
250         * CMakeLists.txt:
251         * PlatformPlayStation.cmake:
252         * PlatformWPE.cmake:
253
254 2019-05-17  Alex Christensen  <achristensen@webkit.org>
255
256         Enable legacy EME for iOS WKWebView
257         https://bugs.webkit.org/show_bug.cgi?id=197964
258         <rdar://problem/50625666>
259
260         Reviewed by Wenson Hsieh.
261
262         This was attempted unsuccessfully in r230169.
263         Verified manually that it works as desired.
264
265         * page/RuntimeEnabledFeatures.h:
266
267 2019-05-17  Sihui Liu  <sihui_liu@apple.com>
268
269         ASSERTION FAILED: !m_backingStore in WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore(uint64_t)
270         https://bugs.webkit.org/show_bug.cgi?id=197741
271         <rdar://problem/50625006>
272
273         Reviewed by Youenn Fablet.
274
275         If an open request is made before a delete request, open task should be performed before delete task on the
276         database thread. After r242911, open request needs to wait decision of StorageQuotaManager before posting task
277         to database thread, while delete request needs not. This makes deletion happen before open.
278
279         We need to make sure tasks are in correct order by not starting next open or delete request when database is in 
280         the middle of open or deletion.
281
282         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
283         (WebCore::IDBServer::UniqueIDBDatabase::performCurrentOpenOperation):
284         (WebCore::IDBServer::UniqueIDBDatabase::handleDatabaseOperations):
285
286 2019-05-17  Antoine Quint  <graouts@apple.com>
287
288         Add a website policy to disable the legacy -webkit-overflow-scrolling:touch behavior
289         https://bugs.webkit.org/show_bug.cgi?id=197943
290         <rdar://problem/49078202>
291
292         Reviewed by Brent Fulgham.
293
294         Tests: fast/scrolling/ipad/overflow-scrolling-touch-enabled-stacking-modern-compatibility-mode.html
295                platform/ipad/fast/css/webkit-overflow-scrolling-parsing-modern-compatibility-mode.html
296
297         * css/parser/CSSParserContext.cpp:
298         (WebCore::CSSParserContext::CSSParserContext):
299         * loader/DocumentLoader.h:
300         (WebCore::DocumentLoader::legacyOverflowScrollingTouchPolicy const):
301         (WebCore::DocumentLoader::setLegacyOverflowScrollingTouchPolicy):
302
303 2019-05-17  Alex Christensen  <achristensen@webkit.org>
304
305         Add SPI to set a list of hosts to which to send custom header fields cross-origin
306         https://bugs.webkit.org/show_bug.cgi?id=197397
307
308         Reviewed by Geoff Garen.
309
310         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.
311         We need the ability to specify what origins to send these headers to even if they are not first party requests.
312         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,
313         indicating that the headers are to be sent to all subdomains.
314
315         I repurposed some ObjC SPI that was never adopted, but I keep testing the C API that was to verify no regression.
316         I also added some new API tests for the new behavior.
317
318         * Sources.txt:
319         * WebCore.xcodeproj/project.pbxproj:
320         * loader/CustomHeaderFields.cpp: Added.
321         (WebCore::CustomHeaderFields::thirdPartyDomainsMatch const):
322         * loader/CustomHeaderFields.h: Added.
323         (WebCore::CustomHeaderFields::encode const):
324         (WebCore::CustomHeaderFields::decode):
325         * loader/DocumentLoader.cpp:
326         (WebCore::DocumentLoader::setCustomHeaderFields): Deleted.
327         * loader/DocumentLoader.h:
328         (WebCore::DocumentLoader::setCustomHeaderFields):
329         (WebCore::DocumentLoader::customHeaderFields const):
330         (WebCore::DocumentLoader::customHeaderFields): Deleted.
331         * loader/cache/CachedResourceLoader.cpp:
332         (WebCore::CachedResourceLoader::requestResource):
333
334 2019-05-17  Youenn Fablet  <youenn@apple.com>
335
336         Make AVVideoCaptureSource more robust to configuration failures
337         https://bugs.webkit.org/show_bug.cgi?id=197997
338         rdar://problem/50875662
339
340         Reviewed by Eric Carlson.
341
342         Covered by manual testing.
343
344         * platform/mediastream/mac/AVVideoCaptureSource.mm:
345         (WebCore::AVVideoCaptureSource::setSessionSizeAndFrameRate):
346         Make sure to commit configuration once calling beginConfiguration.
347         In case of error in setting frame rate, log the error but continue capturing.
348
349 2019-05-17  Rob Buis  <rbuis@igalia.com>
350
351         Implement imagesrcset and imagesizes attributes on link rel=preload
352         https://bugs.webkit.org/show_bug.cgi?id=192950
353
354         Reviewed by Youenn Fablet.
355
356         Implement imagesrcset and imagesizes attributes for both Link header
357         and link element.
358
359         Tests: imported/w3c/web-platform-tests/preload/dynamic-adding-preload-imagesrcset.html
360                imported/w3c/web-platform-tests/preload/link-header-preload-delay-onload.html
361                imported/w3c/web-platform-tests/preload/link-header-preload-imagesrcset.html
362                imported/w3c/web-platform-tests/preload/link-header-preload-nonce.html
363                imported/w3c/web-platform-tests/preload/link-header-preload.html
364                imported/w3c/web-platform-tests/preload/onload-event.html
365                imported/w3c/web-platform-tests/preload/preload-with-type.html
366
367         * html/HTMLAttributeNames.in:
368         * html/HTMLLinkElement.cpp:
369         (WebCore::HTMLLinkElement::process):
370         * html/HTMLLinkElement.idl:
371         * loader/LinkHeader.cpp:
372         (WebCore::paramterNameFromString):
373         (WebCore::LinkHeader::setValue):
374         (WebCore::LinkHeader::LinkHeader):
375         * loader/LinkHeader.h:
376         (WebCore::LinkHeader::imageSrcSet const):
377         (WebCore::LinkHeader::imageSizes const):
378         (WebCore::LinkHeader::isViewportDependent const):
379         * loader/LinkLoader.cpp:
380         (WebCore::LinkLoader::loadLinksFromHeader):
381         (WebCore::LinkLoader::preloadIfNeeded):
382         (WebCore::LinkLoader::loadLink):
383         * loader/LinkLoader.h:
384
385 2019-05-17  Keith Rollin  <krollin@apple.com>
386
387         Re-enable generate-xcfilelists
388         https://bugs.webkit.org/show_bug.cgi?id=197933
389         <rdar://problem/50831677>
390
391         Reviewed by Jonathan Bedard.
392
393         The following two tasks have been completed, and we can re-enable
394         generate-xcfilelists:
395
396         Bug 197619 <rdar://problem/50507392> Temporarily disable generate-xcfilelists (197619)
397         Bug 197622 <rdar://problem/50508222> Rewrite generate-xcfilelists in Python (197622)
398
399         No new tests -- no change in user-visible functionality.
400
401         * Scripts/check-xcfilelists.sh:
402
403 2019-05-17  Wenson Hsieh  <wenson_hsieh@apple.com>
404
405         Fix a typo in some user agent string logic
406         https://bugs.webkit.org/show_bug.cgi?id=197992
407         <rdar://problem/50895962>
408
409         Reviewed by Brent Fulgham.
410
411         Adjust the major version number for the desktop user agent string.
412
413         * platform/ios/UserAgentIOS.mm:
414         (WebCore::standardUserAgentWithApplicationName):
415
416 2019-05-17  Simon Fraser  <simon.fraser@apple.com>
417
418         REGRESSION (r245170): gmail.com inbox table header flickers
419         https://bugs.webkit.org/show_bug.cgi?id=198005
420         <rdar://problem/50907718>
421
422         Reviewed by Antti Koivisto.
423
424         When a layer started as painting into shared backing, but then became independently
425         composited (e.g. by having to clip composited children), it wouldn't have the "overlap"
426         indirect compositing reason. This allowed requiresOwnBackingStore() to say that it
427         could paint into some ancestor, but this breaks overlap. So in this code path,
428         put IndirectCompositingReason::Overlap back on the layer which restores the previous
429         behavior.
430
431         Make some logging changes to help diagnose things like this.
432
433         Test: compositing/shared-backing/overlap-after-end-sharing.html
434
435         * rendering/RenderLayer.cpp:
436         (WebCore::RenderLayer::calculateClipRects const):
437         (WebCore::outputPaintOrderTreeLegend):
438         (WebCore::outputPaintOrderTreeRecursive):
439         * rendering/RenderLayer.h:
440         * rendering/RenderLayerCompositor.cpp:
441         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
442         (WebCore::RenderLayerCompositor::updateBacking):
443         (WebCore::RenderLayerCompositor::requiresOwnBackingStore const):
444         (WebCore::RenderLayerCompositor::reasonsForCompositing const):
445         (WebCore::RenderLayerCompositor::requiresCompositingForIndirectReason const):
446         * rendering/RenderLayerCompositor.h:
447
448 2019-05-17  Simon Fraser  <simon.fraser@apple.com>
449
450         REGRESSION (r245170): gmail.com header flickers when hovering over the animating buttons
451         https://bugs.webkit.org/show_bug.cgi?id=197975
452         <rdar://problem/50865946>
453
454         Reviewed by Antti Koivisto.
455
456         When computeCompositingRequirements() determined that a layer could paint into shared backing, it
457         pushed an overlap container. If that layer then converted to normal composting, we'd push a second
458         overlap container, which left the overlap map in a bad state for the rest of the compositing
459         traversal, causing layers to not get composited when necessary.
460
461         Test: compositing/shared-backing/overlap-after-shared-to-composited.html
462
463         * rendering/RenderLayerCompositor.cpp:
464         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
465
466 2019-05-17  Commit Queue  <commit-queue@webkit.org>
467
468         Unreviewed, rolling out r245401.
469         https://bugs.webkit.org/show_bug.cgi?id=197990
470
471         Causing internal build failures (Requested by ShawnRoberts on
472         #webkit).
473
474         Reverted changeset:
475
476         "Add SPI to set a list of hosts to which to send custom header
477         fields cross-origin"
478         https://bugs.webkit.org/show_bug.cgi?id=197397
479         https://trac.webkit.org/changeset/245401
480
481 2019-05-16  Said Abou-Hallawa  <sabouhallawa@apple.com>
482
483         SVGElement should detach itself from all its properties before it is deleted
484         https://bugs.webkit.org/show_bug.cgi?id=197954
485
486         Reviewed by Simon Fraser.
487
488         Before deleting the SVGElement node, SVGElement::detachAllProperties()
489         needs to be called. This will make the properties be detached objects
490         which means no change will be committed unless these properties are
491         attached to another owner.
492
493         Test: svg/dom/svg-properties-detach-change.html
494
495         * dom/Node.cpp:
496         (WebCore::Node::removedLastRef):
497         * svg/SVGElement.h:
498         (WebCore::SVGElement::detachAllProperties):
499
500 2019-05-17  Eric Carlson  <eric.carlson@apple.com>
501
502         Allow sequential playback of media files when initial playback started with a user gesture
503         https://bugs.webkit.org/show_bug.cgi?id=197959
504         <rdar://problem/50655207>
505
506         Reviewed by Youenn Fablet.
507
508         Test: media/playlist-inherits-user-gesture.html
509
510         * dom/Document.cpp:
511         (WebCore::Document::processingUserGestureForMedia const): Return true if it is within
512         one second of the last HTMLMediaElement 'ended' event.
513         * dom/Document.h:
514         (WebCore::Document::mediaFinishedPlaying):
515
516         * html/HTMLMediaElement.cpp:
517         (WebCore::HTMLMediaElement::parseAttribute): removeBehaviorsRestrictionsAfterFirstUserGesture -> 
518         removeBehaviorRestrictionsAfterFirstUserGesture.
519         (WebCore::HTMLMediaElement::load): Ditto. Don't call removeBehaviorsRestrictionsAfterFirstUserGesture,
520         it will be done in prepareForLoad.
521         (WebCore::HTMLMediaElement::prepareForLoad): removeBehaviorsRestrictionsAfterFirstUserGesture -> 
522         removeBehaviorRestrictionsAfterFirstUserGesture.
523         (WebCore::HTMLMediaElement::audioTrackEnabledChanged): Ditto.
524         (WebCore::HTMLMediaElement::play): Ditto.
525         (WebCore::HTMLMediaElement::pause): Ditto.
526         (WebCore::HTMLMediaElement::setVolume): Ditto.
527         (WebCore::HTMLMediaElement::setMuted): Ditto.
528         (WebCore::HTMLMediaElement::webkitShowPlaybackTargetPicker): Ditto.
529         (WebCore::HTMLMediaElement::dispatchEvent): Call document().mediaFinishedPlaying()
530         when dispatching the 'ended' event.
531         (WebCore::HTMLMediaElement::removeBehaviorRestrictionsAfterFirstUserGesture): Rename. Set
532         m_removedBehaviorRestrictionsAfterFirstUserGesture.
533         (WebCore::HTMLMediaElement::removeBehaviorsRestrictionsAfterFirstUserGesture): Deleted.
534         * html/HTMLMediaElement.h:
535         
536         * html/HTMLVideoElement.cpp:
537         (WebCore:HTMLVideoElement::nativeImageForCurrentTime): Convert to runtime logging.
538         (WebCore:HTMLVideoElement::webkitEnterFullscreen): Ditto.
539         (WebCore:HTMLVideoElement::webkitSetPresentationMode): Ditto.
540         (WebCore:HTMLVideoElement::fullscreenModeChanged): Ditto.
541
542         * html/MediaElementSession.cpp:
543         (WebCore::MediaElementSession::removeBehaviorRestriction): Update log message.
544
545 2019-05-17  Brent Fulgham  <bfulgham@apple.com>
546
547         Hardening: Prevent FrameLoader crash due to SetForScope
548         https://bugs.webkit.org/show_bug.cgi?id=197458
549         <rdar://problem/50368338>
550
551         Reviewed by Chris Dumez.
552
553         Since SetForScope takes action during a function returns, it might cause
554         a crash if its scope is broader than the value it is resetting.
555
556         * loader/FrameLoader.cpp:
557         (WebCore::FrameLoader::loadDifferentDocumentItem):
558
559 2019-05-16  Carlos Garcia Campos  <cgarcia@igalia.com>
560
561         [GTK] Need WebKitContextMenuItemType to open emoji picker
562         https://bugs.webkit.org/show_bug.cgi?id=176760
563
564         Reviewed by Michael Catanzaro.
565
566         Add a new context menu item to insert an emoji.
567
568         * loader/EmptyClients.cpp: Empty implementation of ContextMenuClient::insertEmoji().
569         * page/ContextMenuClient.h: Add insertEmoji for GTK port.
570         * page/ContextMenuController.cpp:
571         (WebCore::ContextMenuController::contextMenuItemSelected): Handle insert emoji action.
572         (WebCore::ContextMenuController::populate): Add insert emoji item after select all.
573         (WebCore::ContextMenuController::checkOrEnableIfNeeded const): Handle insert emoji action.
574         * platform/ContextMenuItem.h: Add insert emoji action.
575         * platform/LocalizedStrings.h:
576         * platform/gtk/LocalizedStringsGtk.cpp:
577         (WebCore::contextMenuItemTagInsertEmoji):
578
579 2019-05-16  Greg Doolittle  <gr3g@apple.com>
580
581         AX: Unship some ARIA string reflectors that are to-be-replaced by element reflection
582         https://bugs.webkit.org/show_bug.cgi?id=197764
583         <rdar://problem/50649689>
584
585         Reviewed by Chris Fleizach.
586
587         Specifically these:
588         - ariaActiveDescendant
589         - ariaControls
590         - ariaDescribedBy
591         - ariaDetails
592         - ariaErrorMessage
593         - ariaFlowTo
594         - ariaLabelledBy
595         - ariaOwns
596
597         Test: LayoutTests/accessibility/ARIA-reflections.html (updated)
598
599         * accessibility/AriaAttributes.idl:
600
601 2019-05-16  Youenn Fablet  <youenn@apple.com>
602
603         CoreAudioCaptureSource should be marked as an audio capture track
604         https://bugs.webkit.org/show_bug.cgi?id=197953
605         <rdar://problem/50552007>
606
607         Reviewed by Eric Carlson.
608
609         Manually tested.
610
611         * platform/mediastream/mac/CoreAudioCaptureSource.h:
612         Mark it as microphone so that it can get muted properly.
613
614 2019-05-16  Alex Christensen  <achristensen@webkit.org>
615
616         Add SPI to set a list of hosts to which to send custom header fields cross-origin
617         https://bugs.webkit.org/show_bug.cgi?id=197397
618
619         Reviewed by Geoff Garen.
620
621         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.
622         We need the ability to specify what origins to send these headers to even if they are not first party requests.
623         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,
624         indicating that the headers are to be sent to all subdomains.
625
626         I repurposed some ObjC SPI that was never adopted, but I keep testing the C API that was to verify no regression.
627         I also added some new API tests for the new behavior.
628
629         * Sources.txt:
630         * WebCore.xcodeproj/project.pbxproj:
631         * loader/CustomHeaderFields.cpp: Added.
632         (WebCore::CustomHeaderFields::thirdPartyDomainsMatch const):
633         * loader/CustomHeaderFields.h: Added.
634         (WebCore::CustomHeaderFields::encode const):
635         (WebCore::CustomHeaderFields::decode):
636         * loader/DocumentLoader.cpp:
637         (WebCore::DocumentLoader::setCustomHeaderFields): Deleted.
638         * loader/DocumentLoader.h:
639         (WebCore::DocumentLoader::setCustomHeaderFields):
640         (WebCore::DocumentLoader::customHeaderFields const):
641         (WebCore::DocumentLoader::customHeaderFields): Deleted.
642         * loader/cache/CachedResourceLoader.cpp:
643         (WebCore::CachedResourceLoader::requestResource):
644
645 2019-05-16  Ali Juma  <ajuma@chromium.org>
646
647         [IntersectionObserver] Regression: No initial observation when nothing else triggers rendering
648         https://bugs.webkit.org/show_bug.cgi?id=197891
649
650         Reviewed by Simon Fraser.
651
652         Schedule a rendering update whenever a new IntersectionObserver target is added.
653
654         Test: intersection-observer/initial-observation.html
655
656         * page/IntersectionObserver.cpp:
657         (WebCore::IntersectionObserver::observe):
658
659 2019-05-16  Carlos Garcia Campos  <cgarcia@igalia.com>
660
661         [FreeType] Some character sequences with a variation selector are not rendered
662         https://bugs.webkit.org/show_bug.cgi?id=197838
663
664         Reviewed by Michael Catanzaro.
665
666         We get the invalid glyph instead. See http://mts.io/2015/04/21/unicode-symbol-render-text-emoji/. In the table at
667         the end the Emoji and Text columns are not correctly rendered. It happens also when copying an emoji from
668         GtkEmojiChooser and pasting in WebKit text field, because GTK appends U+FE0F to all emojis to force the emoji
669         style. We need to take into account the variation selector when checking if a font can render a combining
670         sequence, using FT_Face_GetCharVariantIndex to get the right glyph in case of variation character present.
671
672         * platform/graphics/Font.cpp:
673         (WebCore::Font::platformSupportsCodePoint const): Add optional variation parameter.
674         (WebCore::Font::canRenderCombiningCharacterSequence const): Take into account variation selector characters
675         * platform/graphics/Font.h:
676         * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
677         (WebCore::FontCascade::fontForCombiningCharacterSequence const): Check variation selectors 0xFE0E and 0xFE0F to
678         decide whether to use the emoji or text style.
679         * platform/graphics/cocoa/FontCocoa.mm:
680         (WebCore::Font::platformSupportsCodePoint const): Return false when a variation character is passed so that
681         characters are checked individually.
682         * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
683         (WebCore::Font::platformSupportsCodePoint const): Use FT_Face_GetCharVariantIndex when a variation character is
684         passed.
685         * platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
686         (WebCore::harfBuzzFontFunctions): Do not return true when FT_Face_GetCharVariantIndex returns 0.
687
688 2019-05-16  Greg Hughes  <ghughes@apple.com>
689
690         Updated screenHasInvertedColors to use AppKit when available
691         https://bugs.webkit.org/show_bug.cgi?id=197935
692         <rdar://problem/50834405>
693
694         Reviewed by Chris Fleizach.
695
696         * platform/mac/PlatformScreenMac.mm:
697         (WebCore::collectScreenProperties):
698         (WebCore::screenHasInvertedColors):
699
700 2019-05-15  Simon Fraser  <simon.fraser@apple.com>
701
702         Avoid a recursive descendants layer walk sometimes
703         https://bugs.webkit.org/show_bug.cgi?id=197939
704
705         Reviewed by Zalan Bujtas.
706
707         If a layer got composited post-descendants because it needs to clip, for example, we'd do a recursive
708         descendant tree walk to add layers to the overlap map. However, all the descendants would already
709         have contributed to the overlap map if some non-root ancestor was already composited. So we can
710         skip the addDescendantsToOverlapMapRecursive() if we know, before descendants, whether there's
711         a non-root composited ancestor.
712
713         * rendering/RenderLayerCompositor.cpp:
714         (WebCore::RenderLayerCompositor::CompositingState::hasNonRootCompositedAncestor const):
715         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
716
717 2019-05-15  Simon Fraser  <simon.fraser@apple.com>
718
719         Clean up code related to compositing overlap map maintenance
720         https://bugs.webkit.org/show_bug.cgi?id=197936
721
722         Reviewed by Zalan Bujtas.
723
724         Clarify the logic around updating the overlap map:
725
726         When a layer becomes composited, or paints into a non-root composited layer, we add it to the overlap map
727         after traversing descendants (since it only affets layers later in traversal).
728
729         If a layer became composited after traversing descendants, we need to go back and add all the descendants
730         to the overlap map with a recursive traversal.
731
732         We can do all this near the end of computeCompositingRequirements/traverseUnchangedSubtree because
733         we only check overlap when we enter this function on later layers.
734
735         Add a CompositingOverlap log channel and use it to log the state of the overlap map.
736
737         * platform/Logging.h:
738         * rendering/RenderLayerCompositor.cpp:
739         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
740         (WebCore::RenderLayerCompositor::traverseUnchangedSubtree):
741         (WebCore::RenderLayerCompositor::addToOverlapMap const):
742         (WebCore::RenderLayerCompositor::addDescendantsToOverlapMapRecursive const):
743         (WebCore::RenderLayerCompositor::updateOverlapMap const):
744         (WebCore::RenderLayerCompositor::addToOverlapMap): Deleted.
745         (WebCore::RenderLayerCompositor::addToOverlapMapRecursive): Deleted.
746         * rendering/RenderLayerCompositor.h:
747
748 2019-05-15  Timothy Hatcher  <timothy@apple.com>
749
750         REGRESSION (r245072): Missing code in Document::styleColorOptions to propagate StyleColor::Options::UseInactiveAppearance
751         https://bugs.webkit.org/show_bug.cgi?id=197930
752         rdar://problem/49833954
753
754         Reviewed by Wenson Hsieh and Megan Gardner.
755
756         Add some code that was missing from Document in my original patch for r245072.
757
758         * dom/Document.cpp:
759         (WebCore::Document::useSystemAppearance const): Drive-by fix code style.
760         (WebCore::Document::useInactiveAppearance const): Added.
761         (WebCore::Document::styleColorOptions const): Add StyleColor::Options::UseInactiveAppearance.
762         * dom/Document.h: Added useInactiveAppearance().
763
764 2019-05-15  Devin Rousso  <drousso@apple.com>
765
766         Web Inspector: user gesture toggle should also force user interaction flag
767         https://bugs.webkit.org/show_bug.cgi?id=197269
768
769         Reviewed by Joseph Pecoraro.
770
771         Test: inspector/runtime/evaluate-userGestureEmulation-userIsInteracting.html
772
773         * inspector/agents/page/PageRuntimeAgent.cpp:
774         (WebCore::PageRuntimeAgent::evaluate):
775
776         * page/ChromeClient.h:
777         (WebCore::ChromeClient::userIsInteracting const): Added.
778         (WebCore::ChromeClient::setUserIsInteracting): Added.
779
780         * testing/Internals.idl:
781         * testing/Internals.h:
782         * testing/Internals.cpp:
783         (WebCore::Internals::userIsInteracting): Added.
784
785 2019-05-15  Zalan Bujtas  <zalan@apple.com>
786
787         Do not create a shape object outside of the layout context
788         https://bugs.webkit.org/show_bug.cgi?id=197926
789         <rdar://problem/50627858>
790
791         Reviewed by Simon Fraser.
792
793         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).
794         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.
795
796         Test: fast/block/float/float-with-shape-outside-crash.html
797
798         * rendering/FloatingObjects.cpp:
799         (WebCore::ComputeFloatOffsetForLineLayoutAdapter<FloatingObject::FloatLeft>::updateOffsetIfNeeded):
800         (WebCore::ComputeFloatOffsetForLineLayoutAdapter<FloatingObject::FloatRight>::updateOffsetIfNeeded):
801         * rendering/shapes/ShapeOutsideInfo.cpp:
802         (WebCore::ShapeOutsideInfo::computeDeltasForContainingBlockLine):
803
804 2019-05-15  Youenn Fablet  <youenn@apple.com>
805
806         Mark beacon and ping loads as low priority
807         https://bugs.webkit.org/show_bug.cgi?id=197919
808         <rdar://problem/50818286>
809
810         Reviewed by Alex Christensen.
811
812         No JS observable change of behavior.
813
814         * Modules/beacon/NavigatorBeacon.cpp:
815         (WebCore::NavigatorBeacon::sendBeacon):
816         * loader/PingLoader.cpp:
817         (WebCore::PingLoader::sendPing):
818
819 2019-05-15  Simon Fraser  <simon.fraser@apple.com>
820
821         Clean up RenderLayerCompositor::computeCompositingRequirements() and traverseUnchangedSubtree()
822         https://bugs.webkit.org/show_bug.cgi?id=197931
823
824         Reviewed by Zalan Bujtas.
825
826         These functions have grown and become hard to maintain, so try to undo some technical debt.
827
828         Rename "childState" to "currentState" since it's the state we pass to children, but also
829         is state we change when the current layer becomes composited.
830
831         Separate the layerWillComposite() lambda from layerWillCompositePostDescendants().
832
833         Group the chunks of code at end of the functions into:
834             - updating bits on RenderLayer
835             - updating compositingState with changes from children and our state
836             - doing post-traversal work on overlapMap and backingSharingState
837
838         Code shared between the two functions is pushed into CompositingState::updateWithDescendantStateAndLayer().
839
840         This moves code around but should not cause any behavior change.
841
842         * rendering/RenderLayerBacking.cpp:
843         (WebCore::RenderLayerBacking::updateConfiguration):
844         * rendering/RenderLayerCompositor.cpp:
845         (WebCore::RenderLayerCompositor::OverlapExtent::knownToBeHaveExtentUncertainty const):
846         (WebCore::RenderLayerCompositor::CompositingState::updateWithDescendantStateAndLayer):
847         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
848         (WebCore::RenderLayerCompositor::traverseUnchangedSubtree):
849         (WebCore::RenderLayerCompositor::clipsCompositingDescendants):
850         (WebCore::RenderLayerCompositor::CompositingState::propagateStateFromChildren): Deleted.
851         (WebCore::RenderLayerCompositor::CompositingState::propagateStateFromChildrenForUnchangedSubtree): Deleted.
852         (WebCore::RenderLayerCompositor::clipsCompositingDescendants const): Deleted.
853         * rendering/RenderLayerCompositor.h:
854
855 2019-05-15  Simon Fraser  <simon.fraser@apple.com>
856
857         Make LayerOverlapMap able to output to a TextStream
858         https://bugs.webkit.org/show_bug.cgi?id=197923
859
860         Reviewed by Zalan Bujtas.
861
862         Make it possible output LayerOverlapMap to a TextStream for logging.
863
864         * rendering/LayerOverlapMap.cpp:
865         (WebCore::OverlapMapContainer::rectList const):
866         (WebCore::operator<<):
867         * rendering/LayerOverlapMap.h:
868         (WebCore::LayerOverlapMap::overlapStack const):
869
870 2019-05-15  Youenn Fablet  <youenn@apple.com>
871
872         getUserMedia sandbox extensions should not be revoked when a getUserMedia allowed request is being processed
873         https://bugs.webkit.org/show_bug.cgi?id=197851
874
875         Reviewed by Alex Christensen.
876
877         Add a completion handler to create a new capture stream.
878         This is used by WK2 layer to acknowledge the pending capture request is completed.
879         Just after the completion handler, make sure to update the document media state.
880         This is done to ensure that, should capture failing, the UIProcess
881         knows about it and can manage proper sandbox extension revocation.
882
883         Test: fast/mediastream/gum-stop-track.html
884
885         * Modules/mediastream/UserMediaRequest.cpp:
886         (WebCore::UserMediaRequest::allow):
887         (WebCore::UserMediaRequest::PendingActivationMediaStream::PendingActivationMediaStream):
888         (WebCore::UserMediaRequest::PendingActivationMediaStream::~PendingActivationMediaStream):
889         * Modules/mediastream/UserMediaRequest.h:
890         (WebCore::UserMediaRequest::PendingActivationMediaStream::create):
891         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
892         (WebCore::MockRealtimeMediaSourceCenter::mockRealtimeMediaSourceCenterEnabled):
893         * platform/mock/MockRealtimeMediaSourceCenter.h:
894
895 2019-05-15  Simon Fraser  <simon.fraser@apple.com>
896
897         Make LOG_WITH_STREAM more efficient
898         https://bugs.webkit.org/show_bug.cgi?id=197905
899
900         Reviewed by Alex Christensen.
901
902         No longer need to conditionalize ClipRects logging on the channel being enabled
903         since LOG_WITH_STREAM fix the performance problem.
904
905         Convert some RenderLayerCompositor logging to use LOG_WITH_STREAM.
906
907         * rendering/RenderLayer.cpp:
908         (WebCore::RenderLayer::calculateClipRects const):
909         (WebCore::clipRectsLogEnabled): Deleted.
910         * rendering/RenderLayerCompositor.cpp:
911         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
912         (WebCore::RenderLayerCompositor::traverseUnchangedSubtree):
913
914 2019-05-15  Simon Fraser  <simon.fraser@apple.com>
915
916         Move RenderLayerCompositor's OverlapMap to its own file
917         https://bugs.webkit.org/show_bug.cgi?id=197915
918
919         Reviewed by Alex Christensen.
920
921         Move OverlapMap to its own file.
922         Make use of RectList, which was in the file but unused!
923         Allocate OverlapMapContainer on the heap both to avoid header pollution of internals,
924         and because they will get bigger in future.
925
926         No behavior change.
927
928         * Sources.txt:
929         * WebCore.xcodeproj/project.pbxproj:
930         * rendering/LayerOverlapMap.cpp: Added.
931         (WebCore::RectList::append):
932         (WebCore::RectList::intersects const):
933         (WebCore::OverlapMapContainer::add):
934         (WebCore::OverlapMapContainer::overlapsLayers const):
935         (WebCore::OverlapMapContainer::unite):
936         (WebCore::LayerOverlapMap::LayerOverlapMap):
937         (WebCore::LayerOverlapMap::add):
938         (WebCore::LayerOverlapMap::overlapsLayers const):
939         (WebCore::LayerOverlapMap::pushCompositingContainer):
940         (WebCore::LayerOverlapMap::popCompositingContainer):
941         * rendering/LayerOverlapMap.h: Added.
942         (WebCore::LayerOverlapMap::isEmpty const):
943         (WebCore::LayerOverlapMap::geometryMap const):
944         (WebCore::LayerOverlapMap::geometryMap):
945         * rendering/RenderLayerCompositor.cpp:
946         (WebCore::RenderLayerCompositor::updateCompositingLayers):
947         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
948         (WebCore::RenderLayerCompositor::traverseUnchangedSubtree):
949         (WebCore::RenderLayerCompositor::computeExtent const):
950         (WebCore::RenderLayerCompositor::addToOverlapMap):
951         (WebCore::RenderLayerCompositor::addToOverlapMapRecursive):
952         (WebCore::OverlapMapContainer::add): Deleted.
953         (WebCore::OverlapMapContainer::overlapsLayers const): Deleted.
954         (WebCore::OverlapMapContainer::unite): Deleted.
955         (WebCore::RenderLayerCompositor::OverlapMap::OverlapMap): Deleted.
956         (WebCore::RenderLayerCompositor::OverlapMap::add): Deleted.
957         (WebCore::RenderLayerCompositor::OverlapMap::overlapsLayers const): Deleted.
958         (WebCore::RenderLayerCompositor::OverlapMap::isEmpty const): Deleted.
959         (WebCore::RenderLayerCompositor::OverlapMap::pushCompositingContainer): Deleted.
960         (WebCore::RenderLayerCompositor::OverlapMap::popCompositingContainer): Deleted.
961         (WebCore::RenderLayerCompositor::OverlapMap::geometryMap const): Deleted.
962         (WebCore::RenderLayerCompositor::OverlapMap::geometryMap): Deleted.
963         (WebCore::RenderLayerCompositor::OverlapMap::RectList::append): Deleted.
964         (WebCore::RenderLayerCompositor::OverlapMap::RectList::intersects const): Deleted.
965         * rendering/RenderLayerCompositor.h:
966
967 2019-05-15  Devin Rousso  <drousso@apple.com>
968
969         Web Automation: elements larger than the viewport have incorrect in-view center point
970         https://bugs.webkit.org/show_bug.cgi?id=195696
971         <rdar://problem/48737122>
972
973         Reviewed by Simon Fraser.
974
975         Original patch by Brian Burg <bburg@apple.com>.
976
977         Some conversion methods do not exist for `FloatRect`/`FloatPoint`. Fill them in as needed,
978         and export some symbols used by WebDriver code to compute an element's in-view center point
979         in various coordinate systems.
980
981         * dom/TreeScope.h:
982         * dom/TreeScope.cpp:
983         (WebCore::TreeScope::elementsFromPoint): Added.
984         * page/FrameView.h:
985         * page/FrameView.cpp:
986         (WebCore::FrameView::absoluteToLayoutViewportPoint const): Added.
987         (WebCore::FrameView::layoutViewportToAbsoluteRect const): Added.
988         (WebCore::FrameView::absoluteToLayoutViewportRect const): Added.
989         * platform/ScrollView.h:
990         * platform/ScrollView.cpp:
991         (WebCore::ScrollView::viewToContents const): Added.
992         (WebCore::ScrollView::contentsToView const): Added.
993         (WebCore::ScrollView::contentsToRootView const): Added.
994         * platform/Widget.h:
995         * platform/Widget.cpp:
996         (WebCore::Widget::convertToRootView const): Added.
997         (WebCore::Widget::convertFromRootView const): Added.
998         (WebCore::Widget::convertToContainingView const): Added.
999         (WebCore::Widget::convertFromContainingView const): Added.
1000
1001 2019-05-14  Wenson Hsieh  <wenson_hsieh@apple.com>
1002
1003         Missing cursor/caret showing in search field on google.com
1004         https://bugs.webkit.org/show_bug.cgi?id=197862
1005         <rdar://problem/50291989>
1006
1007         Reviewed by Simon Fraser.
1008
1009         In this bug, the search field is inside of a fixed position container, which is inside of an empty "overflow:
1010         hidden" form element (the new layout test demonstrates a simple version of this). The layer of the fixed
1011         position container's renderer has an overflow clipping layer of itself, and its clipping rect is non-empty, so
1012         the heuristic initially identifies the layer as not fully clipped. However, as the heuristic ascends the
1013         RenderLayer tree, it then finds the layer for the "overflow: hidden" form element's renderer; this layer is
1014         completely clipped, which causes the heuristic to incorrectly believe that the editable element is completely
1015         clipped.
1016
1017         To fix the bug, this patch reworks the clipping portion of the heuristic, such that we no longer need to ascend
1018         the layer tree. Instead of computing the clip rect relative to the nearest ancestor that has an overflow clip
1019         and then walking up the layer tree repeating this process, simply compute the clip rect relative to RenderView's
1020         layer, and then walk up to the parent frame and repeat if necessary.
1021
1022         Test: editing/selection/ios/do-not-hide-selection-in-visible-field.html
1023
1024         * rendering/RenderLayer.cpp:
1025         (WebCore::RenderLayer::isTransparentOrFullyClippedRespectingParentFrames const):
1026
1027 2019-05-14  Andy Estes  <aestes@apple.com>
1028
1029         [Apple Pay] Payment APIs should be completely disabled in web views into which clients have injected user scripts
1030         https://bugs.webkit.org/show_bug.cgi?id=197751
1031         <rdar://problem/50631563>
1032
1033         Reviewed by Alex Christensen.
1034
1035         In r243324, when a document has had user agent scripts injected into it, payment APIs were
1036         disabled at runtime by having all entry points return falsy values or throw exceptions
1037         (e.g., ApplePaySession.canMakePayments() returns false).
1038
1039         In the case of user scripts in particular (e.g., WKUserScript), since we know whether these
1040         exist at the time we create a document's DOMWindow, we can do better than r243324 by
1041         completely disabling the payment APIs in the presence of user scripts.
1042
1043         To achieve this, this change introduces the 'EnabledByContext' extended attribute for
1044         interfaces, which instructs the bindings generator to add a conjunct to the payment API
1045         constructors that asks the interface's implementation class whether it should be enabled for
1046         a given ScriptExecutionContext. The PaymentRequest and ApplePaySession interfaces adopt this
1047         new extended attribute to implement the new user script check.
1048
1049         Added new API tests.
1050
1051         * Modules/applepay/ApplePaySession.idl:
1052         * Modules/applepay/PaymentCoordinator.cpp:
1053         (WebCore::PaymentCoordinator::shouldEnableApplePayAPIs const):
1054         * Modules/applepay/PaymentCoordinator.h:
1055         * Modules/applepay/PaymentSession.cpp:
1056         (WebCore::PaymentSession::enabledForContext):
1057         * Modules/applepay/PaymentSession.h:
1058         * Modules/paymentrequest/PaymentHandler.cpp:
1059         (WebCore::PaymentHandler::enabledForContext):
1060         * Modules/paymentrequest/PaymentHandler.h:
1061         * Modules/paymentrequest/PaymentRequest.cpp:
1062         (WebCore::PaymentRequest::enabledForContext):
1063         * Modules/paymentrequest/PaymentRequest.h:
1064         * Modules/paymentrequest/PaymentRequest.idl:
1065         * bindings/scripts/CodeGeneratorJS.pm:
1066         (NeedsRuntimeCheck):
1067         (GenerateRuntimeEnableConditionalString):
1068         * bindings/scripts/IDLAttributes.json:
1069         * bindings/scripts/preprocess-idls.pl:
1070         (GenerateConstructorAttributes):
1071         * bindings/scripts/test/JS/JSTestEnabledForContext.cpp: Added.
1072         * bindings/scripts/test/JS/JSTestEnabledForContext.h: Added.
1073         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
1074         (WebCore::JSTestGlobalObject::finishCreation):
1075         (WebCore::jsTestGlobalObjectTestEnabledForContextConstructorGetter):
1076         (WebCore::jsTestGlobalObjectTestEnabledForContextConstructor):
1077         (WebCore::setJSTestGlobalObjectTestEnabledForContextConstructorSetter):
1078         (WebCore::setJSTestGlobalObjectTestEnabledForContextConstructor):
1079         * bindings/scripts/test/TestEnabledForContext.idl: Added.
1080
1081 2019-05-14  Robin Morisset  <rmorisset@apple.com>
1082
1083         [WHLSL] parseEffectfulSuffix() is never called
1084         https://bugs.webkit.org/show_bug.cgi?id=195864
1085         <rdar://problem/50746278>
1086
1087         Reviewed by Myles C. Maxfield.
1088
1089         The fix is trivial: when parseEffectfulPrefix does not see a ++ or --, it must call parseEffectfulSuffix.
1090
1091         No test yet, as it is not testable until the property resolver is finished.
1092         It will be tested with the rest of the compiler, when we port the testsuite from the js implementation (it already covers this case).
1093
1094         * Modules/webgpu/WHLSL/WHLSLParser.cpp:
1095         (WebCore::WHLSL::Parser::parseEffectfulPrefix):
1096
1097 2019-05-14  Robin Morisset  <rmorisset@apple.com>
1098
1099         [WHLSL] parseEffectfulAssignment should not call parseCallExpression directly
1100         https://bugs.webkit.org/show_bug.cgi?id=197890
1101
1102         Reviewed by Myles Maxfield.
1103
1104         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).
1105         I've already fixed the grammar (https://github.com/gpuweb/WHLSL/commit/a07005f4d692fe3370618dca5db218992b362049), the grammar was always good, this patch is fixing the parser.
1106
1107         * Modules/webgpu/WHLSL/WHLSLParser.cpp:
1108         (WebCore::WHLSL::Parser::parseEffectfulAssignment):
1109
1110 2019-05-14  Ross Kirsling  <ross.kirsling@sony.com>
1111
1112         Unreviewed restoration of non-unified build.
1113
1114         * Modules/cache/DOMCache.cpp:
1115         * bindings/js/JSLazyEventListener.h:
1116         * loader/NavigationScheduler.h:
1117         * page/Quirks.cpp:
1118         * page/Quirks.h:
1119         * rendering/ClipRect.cpp:
1120
1121 2019-05-14  Zalan Bujtas  <zalan@apple.com>
1122
1123         Do not try to issue repaint while the render tree is being destroyed.
1124         https://bugs.webkit.org/show_bug.cgi?id=197461
1125         <rdar://problem/50368992>
1126
1127         Reviewed by Simon Fraser.
1128
1129         Test: http/tests/svg/crash-on-reload-with-filter.html
1130
1131         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.
1132         Also during full render tree destruction the inline tree state is undefined. We should avoid accessing it.
1133
1134         * rendering/svg/RenderSVGResourceContainer.cpp:
1135         (WebCore::RenderSVGResourceContainer::markAllClientLayersForInvalidation):
1136
1137 2019-05-14  Youenn Fablet  <youenn@apple.com>
1138
1139         A service worker process should app nap when all its clients app nap
1140         https://bugs.webkit.org/show_bug.cgi?id=185626
1141         <rdar://problem/46785908>
1142
1143         Reviewed by Alex Christensen.
1144
1145         Update RegistrableDomain to work with SecurityOriginData.
1146         Add internal API to enable accessing to service worker process throttle state.
1147
1148         Test: http/wpt/service-workers/mac/processSuppression.https.html
1149
1150         * platform/RegistrableDomain.h:
1151         (WebCore::RegistrableDomain::RegistrableDomain):
1152         (WebCore::RegistrableDomain::matches const):
1153         (WebCore::RegistrableDomain::registrableDomainFromHost):
1154         * testing/ServiceWorkerInternals.cpp:
1155         (WebCore::ServiceWorkerInternals::isThrottleable const):
1156         * testing/ServiceWorkerInternals.h:
1157         * testing/ServiceWorkerInternals.idl:
1158         * workers/service/SWClientConnection.h:
1159         * workers/service/context/SWContextManager.cpp:
1160         * workers/service/context/SWContextManager.h:
1161         * workers/service/server/SWServer.cpp:
1162         (WebCore::SWServer::serverToContextConnectionCreated):
1163         * workers/service/server/SWServer.h:
1164         (WebCore::SWServer::Connection::server const):
1165         (WebCore::SWServer::connections const):
1166         * workers/service/server/SWServerToContextConnection.h:
1167
1168 2019-05-14  Youenn Fablet  <youenn@apple.com>
1169
1170         getUserMedia capture changes on iOS after homing out
1171         https://bugs.webkit.org/show_bug.cgi?id=197707
1172
1173         Reviewed by Eric Carlson.
1174
1175         In case of muting an AVVideoCaptureSource on iOS, the session is cleared.
1176         We need to store the preset information, to setup the new session on unnmuting correctly.
1177         Manually tested.
1178
1179         * platform/mediastream/mac/AVVideoCaptureSource.h:
1180         * platform/mediastream/mac/AVVideoCaptureSource.mm:
1181         (WebCore::AVVideoCaptureSource::setSizeAndFrameRateWithPreset):
1182         (WebCore::AVVideoCaptureSource::setSessionSizeAndFrameRate):
1183         (WebCore::AVVideoCaptureSource::setupCaptureSession):
1184
1185 2019-05-14  Oriol Brufau  <obrufau@igalia.com>
1186
1187         [css-grid] Update grid when changing auto repeat type
1188         https://bugs.webkit.org/show_bug.cgi?id=197849
1189
1190         Reviewed by Javier Fernandez.
1191
1192         Test: imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-change-auto-repeat-tracks.html
1193
1194         This patch makes two 'repeat()' values for 'grid-template' be considered
1195         to be different if one uses 'auto-fill' and the other 'auto-fit'.
1196
1197         Previously, they were considered to be equal if the repeated values
1198         were the same, without comparing the repeat type. Therefore, the grid
1199         was not updated when setting both values one after the other.
1200
1201         * css/CSSGridAutoRepeatValue.cpp:
1202         (WebCore::CSSGridAutoRepeatValue::equals const):
1203         * css/CSSGridAutoRepeatValue.h:
1204
1205 2019-05-14  Antti Koivisto  <antti@apple.com>
1206
1207         Event region computation should respect transforms
1208         https://bugs.webkit.org/show_bug.cgi?id=197836
1209         <rdar://problem/50762971>
1210
1211         Reviewed by Darin Adler.
1212
1213         * platform/graphics/transforms/AffineTransform.cpp:
1214         (WebCore::AffineTransform::mapRegion const):
1215
1216         Add support for transforming regions. Non-rectlinear results use enclosing rects.
1217
1218         * platform/graphics/transforms/AffineTransform.h:
1219         * rendering/EventRegion.cpp:
1220         (WebCore::EventRegionContext::EventRegionContext):
1221         (WebCore::EventRegionContext::pushTransform):
1222         (WebCore::EventRegionContext::popTransform):
1223         (WebCore::EventRegionContext::unite):
1224         (WebCore::EventRegionContext::contains const):
1225
1226         Add a context object that holds the current transform.
1227
1228         * rendering/EventRegion.h:
1229         (WebCore::EventRegion::makeContext):
1230         * rendering/InlineTextBox.cpp:
1231         (WebCore::InlineTextBox::paint):
1232         * rendering/PaintInfo.h:
1233
1234         Replace the region object with the context.
1235
1236         * rendering/RenderBlock.cpp:
1237         (WebCore::RenderBlock::paintObject):
1238         * rendering/RenderLayer.cpp:
1239         (WebCore::RenderLayer::paintLayerByApplyingTransform):
1240
1241         Apply transforms to regions if needed.
1242
1243         (WebCore::RenderLayer::collectEventRegionForFragments):
1244         * rendering/RenderLayer.h:
1245         * rendering/RenderLayerBacking.cpp:
1246         (WebCore::RenderLayerBacking::updateEventRegion):
1247         * rendering/SimpleLineLayoutFunctions.cpp:
1248         (WebCore::SimpleLineLayout::paintFlow):
1249
1250 2019-05-14  Youenn Fablet  <youenn@apple.com>
1251
1252         Video frame resizing should be using Trim
1253         https://bugs.webkit.org/show_bug.cgi?id=197722
1254         <rdar://problem/50602188>
1255
1256         Reviewed by Eric Carlson.
1257
1258         Move from letter box to trim mode for resizing.
1259         This ensures no black stripes are present when rendering the stream.
1260
1261         Test: fast/mediastream/resize-trim.html
1262
1263         * platform/cocoa/VideoToolboxSoftLink.cpp:
1264         * platform/cocoa/VideoToolboxSoftLink.h:
1265         * platform/graphics/cv/ImageTransferSessionVT.mm:
1266         (WebCore::ImageTransferSessionVT::ImageTransferSessionVT):
1267
1268 2019-05-14  Yusuke Suzuki  <ysuzuki@apple.com>
1269
1270         [JSC] Shrink sizeof(UnlinkedFunctionExecutable) more
1271         https://bugs.webkit.org/show_bug.cgi?id=197833
1272
1273         Reviewed by Darin Adler.
1274
1275         * testing/Internals.cpp:
1276         (WebCore::Internals::parserMetaData):
1277
1278 2019-05-14  Antoine Quint  <graouts@apple.com>
1279
1280         [Pointer Events] The pointerenter and pointerleave events target the wrong element on iOS
1281         https://bugs.webkit.org/show_bug.cgi?id=197881
1282         <rdar://problem/50187657>
1283
1284         Reviewed by Dean Jackson.
1285
1286         Test: pointerevents/ios/enter-leave-target.html
1287
1288         The "pointerenter" and "pointerleave" should target the element on which the event listener was added and not
1289         the element that would otherwise hit test. This matches the behavior of "mouseenter" and "mouseleave" on macOS.
1290
1291         * page/PointerCaptureController.cpp:
1292         (WebCore::PointerCaptureController::dispatchEventForTouchAtIndex):
1293
1294 2019-05-14  Said Abou-Hallawa  <sabouhallawa@apple.com>
1295
1296         [CG] Adding support for HEIF-sequence ('public.heics') images
1297         https://bugs.webkit.org/show_bug.cgi?id=197384
1298
1299         Reviewed by Simon Fraser.
1300
1301         -- Get the image repetitionCount and the frame duration.
1302         -- Add a new function setAdditionalSupportedImageTypesForTesting() which
1303            takes a delimited String.
1304         -- Add internal APIs to retrive the image frame count and the frame
1305            duration.
1306
1307         Tests: fast/images/animated-heics-draw.html
1308                fast/images/animated-heics-verify.html
1309
1310         * platform/graphics/ImageSource.h:
1311         * platform/graphics/cg/ImageDecoderCG.cpp:
1312         (WebCore::animationPropertiesFromProperties):
1313         (WebCore::animationHEICSPropertiesFromProperties):
1314         (WebCore::ImageDecoderCG::repetitionCount const):
1315         (WebCore::ImageDecoderCG::frameDurationAtIndex const):
1316         * platform/graphics/cg/UTIRegistry.cpp:
1317         (WebCore::setAdditionalSupportedImageTypesForTesting):
1318         * platform/graphics/cg/UTIRegistry.h:
1319         * testing/Internals.cpp:
1320         (WebCore::Internals::imageFrameCount):
1321         (WebCore::Internals::imageFrameDurationAtIndex):
1322         * testing/Internals.h:
1323         * testing/Internals.idl:
1324         * testing/js/WebCoreTestSupport.cpp:
1325         (WebCoreTestSupport::setAdditionalSupportedImageTypesForTesting):
1326         * testing/js/WebCoreTestSupport.h:
1327
1328 2019-05-14  Manuel Rego Casasnovas  <rego@igalia.com>
1329
1330         [css-grid] Use max size to compute auto repeat tracks
1331         https://bugs.webkit.org/show_bug.cgi?id=197854
1332
1333         Reviewed by Javier Fernandez.
1334
1335         When available size is indefinite we should use max size to compute the number of auto repeat tracks.
1336
1337         The spec text is very clear (https://drafts.csswg.org/css-grid/#auto-repeat):
1338         > When auto-fill is given as the repetition number, if the grid container
1339         > has a definite size or **max size** in the relevant axis...
1340
1341         So far we were not doing that for widths, in this patch we modify RenderGrid::computeAutoRepeatTracksCount()
1342         to do the same than for heights.
1343
1344         We also take advantage to fix problems related to min|max sizes and box-sizing property,
1345         that were inconsistent for columns and rows.
1346
1347         Tests: imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-max-size-001.html
1348                imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-max-size-002.html
1349                imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-min-max-size-001.html
1350                imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-min-size-001.html
1351                imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-min-size-002.html
1352
1353         * rendering/RenderGrid.cpp:
1354         (WebCore::RenderGrid::computeAutoRepeatTracksCount const):
1355
1356 2019-05-14  Joonghun Park  <pjh0718@gmail.com>
1357
1358         Implement page-break-* and -webkit-column-break-* as legacy-shorthands.
1359         https://bugs.webkit.org/show_bug.cgi?id=197656
1360
1361         Reviewed by Darin Adler.
1362
1363         According to https://drafts.csswg.org/css-cascade-4/#legacy-shorthand,
1364         implement page-break-* and -webkit-column-break-* as legacy-shorthands for break-*.
1365
1366         This change also serialize page-break-* properties
1367         to CSSStyleDeclaration,
1368         per https://drafts.csswg.org/css-break/#page-break-properties.
1369
1370         * css/CSSProperties.json:
1371         * css/StyleBuilderConverter.h:
1372         (WebCore::StyleBuilderConverter::convertFontSynthesis):
1373         (WebCore::StyleBuilderConverter::convertPageBreakBetween): Deleted.
1374         (WebCore::StyleBuilderConverter::convertPageBreakInside): Deleted.
1375         (WebCore::StyleBuilderConverter::convertColumnBreakBetween): Deleted.
1376         (WebCore::StyleBuilderConverter::convertColumnBreakInside): Deleted.
1377         * css/StyleProperties.cpp:
1378         (WebCore::StyleProperties::getPropertyValue const):
1379         (WebCore::StyleProperties::pageBreakPropertyValue const):
1380         * css/StyleProperties.h:
1381         * css/parser/CSSPropertyParser.cpp:
1382         (WebCore::CSSPropertyParser::parseValueStart):
1383         (WebCore::mapFromPageBreakBetween):
1384         (WebCore::CSSPropertyParser::parseShorthand):
1385         (WebCore::isLegacyBreakProperty): Deleted.
1386
1387 2019-05-14  Javier Fernandez  <jfernandez@igalia.com>
1388
1389         Implement "line-break: anywhere"
1390         https://bugs.webkit.org/show_bug.cgi?id=181169
1391         <rdar://problem/48507088>
1392
1393         Reviewed by Myles C. Maxfield.
1394
1395         The CSS WG resolved [1] to add a new value 'anywhere' to the 'line-break'
1396         CSS property in order to allow additional breaking opportunities not
1397         considered in the definition of the 'word-break: break-all'.
1398
1399         [1] https://github.com/w3c/csswg-drafts/issues/1171
1400
1401         Tests: imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-003.html
1402                imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-004.html
1403                imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-005.html
1404                imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-006.html
1405                imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-007.html
1406                imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-008.html
1407                imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-009.html
1408                imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-010.html
1409                imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-011.html
1410                imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-012.html
1411                imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-016.html
1412                imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-017.html
1413                imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-018.html
1414                imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-019.html
1415                imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-021.html
1416                imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-022.html
1417                imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-023.html
1418                imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-024.html
1419
1420         * css/CSSPrimitiveValueMappings.h:
1421         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
1422         (WebCore::CSSPrimitiveValue::operator LineBreak const):
1423         * css/CSSProperties.json:
1424         * css/CSSValueKeywords.in:
1425         * css/parser/CSSParserFastPaths.cpp:
1426         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
1427         * rendering/BreakLines.h:
1428         (WebCore::nextBreakablePositionBreakCharacter):
1429         (WebCore::isBreakable):
1430         * rendering/RenderText.cpp:
1431         (WebCore::mapLineBreakToIteratorMode):
1432         (WebCore::RenderText::computePreferredLogicalWidths):
1433         * rendering/line/BreakingContext.h:
1434         (WebCore::BreakingContext::handleText):
1435         * rendering/style/RenderStyleConstants.h:
1436
1437 2019-05-13  Yusuke Suzuki  <ysuzuki@apple.com>
1438
1439         Unreviewed, build fix after 245258, missing ThreadSpecific.h include
1440         https://bugs.webkit.org/show_bug.cgi?id=197146
1441
1442         * platform/ios/wak/WebCoreThread.mm:
1443
1444 2019-05-13  Yusuke Suzuki  <ysuzuki@apple.com>
1445
1446         [WTF] Simplify GCThread and CompilationThread flags by adding them to WTF::Thread
1447         https://bugs.webkit.org/show_bug.cgi?id=197146
1448
1449         Reviewed by Saam Barati.
1450
1451         * Modules/indexeddb/IDBDatabase.cpp:
1452         (WebCore::IDBDatabase::hasPendingActivity const):
1453         * Modules/indexeddb/IDBRequest.cpp:
1454         (WebCore::IDBRequest::hasPendingActivity const):
1455         * Modules/indexeddb/IDBTransaction.cpp:
1456         (WebCore::IDBTransaction::hasPendingActivity const):
1457
1458 2019-05-13  Geoffrey Garen  <ggaren@apple.com>
1459
1460         Downgrade RELEASE_ASSERT TO RELEASE_LOG_FAULT for SQLite Class A files
1461         https://bugs.webkit.org/show_bug.cgi?id=197760
1462
1463         Reviewed by Jer Noble.
1464
1465         Only makeSafeToUseMemoryMapForPath() if needed. (Fixed missing brace.)
1466
1467         * platform/sql/SQLiteDatabase.cpp:
1468         (WebCore::SQLiteDatabase::open):
1469
1470 2019-05-13  Tadeu Zagallo  <tzagallo@apple.com>
1471
1472         JSObject::getOwnPropertyDescriptor is missing an exception check
1473         https://bugs.webkit.org/show_bug.cgi?id=197693
1474
1475         Reviewed by Saam Barati.
1476
1477         JSObject::getOwnPropertyDescriptor assumes that getOwnPropertySlot returns false
1478         if an exception is thrown, but that was not true for JSLocation::getOwnPropertySlotCommon.
1479
1480         This is already covered by http/tests/security/cross-frame-access-getOwnPropertyDescriptor.html
1481
1482         * bindings/js/JSLocationCustom.cpp:
1483         (WebCore::getOwnPropertySlotCommon):
1484         (WebCore::JSLocation::getOwnPropertySlot):
1485         (WebCore::JSLocation::getOwnPropertySlotByIndex):
1486
1487 2019-05-13  Antti Koivisto  <antti@apple.com>
1488
1489         REGRESSION (r245208): compositing/shared-backing/sharing-bounds-non-clipping-shared-layer.html asserts
1490         https://bugs.webkit.org/show_bug.cgi?id=197818
1491         <rdar://problem/50705762>
1492
1493         Reviewed by Simon Fraser.
1494
1495         Tests: fast/scrolling/ios/event-region-scale-transform-shared.html
1496                fast/scrolling/ios/event-region-translate-transform-shared.html
1497
1498         This fixes the assert. However the added tests demonstrate that transform is not taken into account
1499         when computing the event region, https://bugs.webkit.org/show_bug.cgi?id=197836.
1500
1501         * rendering/RenderLayerBacking.cpp:
1502         (WebCore::RenderLayerBacking::updateEventRegion):
1503
1504 2019-05-13  Wenson Hsieh  <wenson_hsieh@apple.com>
1505
1506         [macOS] Font formatting options don't work when composing a message in Yahoo mail
1507         https://bugs.webkit.org/show_bug.cgi?id=197813
1508         <rdar://problem/49382250>
1509
1510         Reviewed by Darin Adler.
1511
1512         The bug happens because on mousedown, the "Aa Font" menu item's event handler hides itself before changing the
1513         font at the text selection. This causes us to clear the selection in FocusController::setFocusedElement.
1514
1515         There is existing logic in clearSelectionIfNeeded that would normally prevent us from clearing the selection due
1516         to the mousePressNode not being able to start a selection. However, since the clickable element in this case is
1517         hidden during mousedown, it is missing a renderer, and we bail from the `mousePressNode->renderer() &&
1518         !mousePressNode->canStartSelection()` check as a result.
1519
1520         This check was orginally added in https://trac.webkit.org/r24334 to avoid clearing the selection when clicking
1521         a button; the intention appears to have been making it so that clicking on something that could not start a
1522         selection (back then, synonymous with -webkit-user-select: ignore;) would not clear the current selection; to
1523         this end, it seems odd to additionally require that the thing being clicked should still have a renderer, so
1524         it seems safe to remove this requirement.
1525
1526         Test: editing/selection/preserve-selection-when-clicking-button.html
1527
1528         * page/FocusController.cpp:
1529         (WebCore::clearSelectionIfNeeded):
1530
1531 2019-05-13  Eric Carlson  <eric.carlson@apple.com>
1532
1533         https://bugs.webkit.org/show_bug.cgi?id=197793
1534         <rdar://problem/46429187>
1535
1536         Unreviewed, build fix after r245199.
1537
1538         * platform/audio/ios/MediaSessionManagerIOS.mm:
1539         (WebCore::MediaSessionManageriOS::externalOutputDeviceAvailableDidChange):
1540
1541 2019-05-13  Darin Adler  <darin@apple.com>
1542
1543         WHLSLPrepare.cpp always recompiles, even if nothing was changed
1544         https://bugs.webkit.org/show_bug.cgi?id=197151
1545
1546         Reviewed by Dan Bernstein and Keith Rollin.
1547
1548         * DerivedSources-input.xcfilelist: Script updated this automatically after
1549         DerivedSources.make was corrected.
1550         * DerivedSources-output.xcfilelist: Ditto, although I had to manually remove
1551         one bogus leftover reference to WHLSLStandardLibrary.cpp.
1552
1553         * DerivedSources.make: Updated the rule that builds WHSLStandardLibrary.h to
1554         no longer refer to nonexistent WHLSLStandardLibrary.cpp. Because the dependency
1555         was on a file that was never created, the rule to regenerate WHSLStandardLibrary.h
1556         was running on every build, instead of only when one of the dependencies changed.
1557
1558 2019-05-12  Simon Fraser  <simon.fraser@apple.com>
1559
1560         When the set of backing-sharing layers changes, we need to issue a repaint
1561         https://bugs.webkit.org/show_bug.cgi?id=197825
1562
1563         Reviewed by Zalan Bujtas.
1564
1565         If the set of layers painting into a shared backing store changes, we need
1566         to repaint that backing store. This happens when scrolling as shared layers
1567         enter the visible area.
1568
1569         Test: compositing/shared-backing/overflow-scroll/repaint-shared-on-scroll.html
1570
1571         * rendering/RenderLayerBacking.cpp:
1572         (WebCore::RenderLayerBacking::setBackingSharingLayers):
1573
1574 2019-05-02  Simon Fraser  <simon.fraser@apple.com>
1575
1576         Add logging for RenderLayer clip rects
1577         https://bugs.webkit.org/show_bug.cgi?id=197547
1578
1579         Reviewed by Zalan Bujtas.
1580
1581         Add a ClipRects log channel, and stream output for ClipRect and ClipRects.
1582
1583         The ClipRect code is performance sensitive, even in debug, so guard the log sites
1584         with clipRectsLogEnabled() because the macro still evaluates its arguments even if
1585         the channel is disabled (we need some better way to log that doesn't do this).
1586
1587         * platform/Logging.h:
1588         * rendering/ClipRect.cpp:
1589         (WebCore::operator<<):
1590         * rendering/ClipRect.h:
1591         * rendering/RenderLayer.cpp:
1592         (WebCore::operator<<):
1593         (WebCore::RenderLayer::calculateClipRects const):
1594         * rendering/RenderLayer.h:
1595
1596 2019-05-12  Simon Fraser  <simon.fraser@apple.com>
1597
1598         Refactor composited backing-sharing code
1599         https://bugs.webkit.org/show_bug.cgi?id=197824
1600
1601         Reviewed by Zalan Bujtas.
1602
1603         Clean up the backing-sharing code to share more code, and make it easier to understand.
1604         
1605         Moves more logic into member functions on BackingSharingState, which are named to make
1606         their functions clearer: startBackingSharingSequence/endBackingSharingSequence.
1607         
1608         computeCompositingRequirements() and traverseUnchangedSubtree() now just call
1609         updateBeforeDescendantTraversal/updateAfterDescendantTraversal.
1610
1611         No behavior change.
1612
1613         * rendering/RenderLayerBacking.cpp:
1614         (WebCore::RenderLayerBacking::willBeDestroyed):
1615         (WebCore::RenderLayerBacking::setBackingSharingLayers): Remove the early return, since
1616         we need to call setBackingProviderLayer() on the sharing layers in both code paths.
1617         (WebCore::RenderLayerBacking::removeBackingSharingLayer):
1618         (WebCore::RenderLayerBacking::clearBackingSharingLayers):
1619         * rendering/RenderLayerCompositor.cpp:
1620         (WebCore::RenderLayerCompositor::BackingSharingState::backingProviderCandidate const):
1621         (WebCore::RenderLayerCompositor::BackingSharingState::appendSharingLayer):
1622         (WebCore::RenderLayerCompositor::BackingSharingState::startBackingSharingSequence):
1623         (WebCore::RenderLayerCompositor::BackingSharingState::endBackingSharingSequence):
1624         (WebCore::RenderLayerCompositor::BackingSharingState::updateBeforeDescendantTraversal):
1625         (WebCore::RenderLayerCompositor::BackingSharingState::updateAfterDescendantTraversal):
1626         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
1627         (WebCore::RenderLayerCompositor::traverseUnchangedSubtree):
1628         (WebCore::RenderLayerCompositor::BackingSharingState::resetBackingProviderCandidate): Deleted.
1629         * rendering/RenderLayerCompositor.h:
1630
1631 2019-05-12  Youenn Fablet  <youenn@apple.com>
1632
1633         Use clampTo in AVVideoCaptureSource::setSizeAndFrameRateWithPreset
1634         https://bugs.webkit.org/show_bug.cgi?id=197704
1635
1636         Reviewed by Alex Christensen.
1637
1638         Use clampTo as suggested in bug 196214 review.
1639         No change of behavior.
1640
1641         * platform/mediastream/mac/AVVideoCaptureSource.mm:
1642         (WebCore::AVVideoCaptureSource::setSizeAndFrameRateWithPreset):
1643
1644 2019-05-12  Youenn Fablet  <youenn@apple.com>
1645
1646         Use the main screen for screen capture
1647         https://bugs.webkit.org/show_bug.cgi?id=197804
1648         <rdar://problem/47671383>
1649
1650         Reviewed by Eric Carlson.
1651
1652         If the main screen, i.e. the screen that has focus at the time of
1653         selection of the screen to capture, is capturable, add it to the list
1654         of screen devices, but do not add any other screen.
1655         This will make sure the main screen is selected.
1656         Manually tested.
1657
1658         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
1659         (WebCore::ScreenDisplayCaptureSourceMac::screenCaptureDevices):
1660
1661 2019-05-12  Takashi Komori  <Takashi.Komori@sony.com>
1662
1663         [Curl] Suppress extra didReceiveAuthenticationChallenge call when accessing a server which checks basic auth.
1664         https://bugs.webkit.org/show_bug.cgi?id=197650
1665
1666         Reviewed by Fujii Hironori.
1667
1668         When Curl port accesses a page which checks Basic Authentication credential and server trust challenge occurs,
1669         Curl port calls extra didReceiveAuthenticationChallenge unnecessarily.
1670         This is because Curl port discards information about allowed server trust challenge before in NetworkDataTaskCurl::restartWithCredential.
1671
1672         Test: http/tests/ssl/curl/certificate-and-authentication.html
1673
1674         * platform/network/curl/CurlRequest.h:
1675         (WebCore::CurlRequest::isServerTrustEvaluationDisabled):
1676
1677 2019-05-11  Simon Fraser  <simon.fraser@apple.com>
1678
1679         Overflow scroll that becomes non-scrollable should stop being composited
1680         https://bugs.webkit.org/show_bug.cgi?id=197817
1681         <rdar://problem/50697290>
1682
1683         Reviewed by Antti Koivisto.
1684
1685         Remove the iOS-specific #ifdef around code that triggers a compositing re-evaluation
1686         when scrolling state changes.
1687
1688         Test: compositing/scrolling/async-overflow-scrolling/become-non-scrollable.html
1689
1690         * rendering/RenderLayer.cpp:
1691         (WebCore::RenderLayer::updateScrollInfoAfterLayout):
1692
1693 2019-05-11  Simon Fraser  <simon.fraser@apple.com>
1694
1695         Layer bounds are incorrect for sharing layers that paint with transforms
1696         https://bugs.webkit.org/show_bug.cgi?id=197768
1697         <rdar://problem/50695493>
1698
1699         Reviewed by Zalan Bujtas.
1700
1701         We don't need to traverse shared layers if the backing-provider has overflow clip,
1702         because we know they are containing-block descendants and therefore clipped.
1703
1704         Note tha the CSS "clip" property doesn't guarantee this, because the clip rect
1705         can be larger than the element, so in that case we just traverse shared layers.
1706
1707         Tests: compositing/shared-backing/sharing-bounds-clip.html
1708                compositing/shared-backing/sharing-bounds-non-clipping-shared-layer.html
1709                compositing/shared-backing/sharing-bounds-transformed-sharing-layer.html
1710                compositing/shared-backing/sharing-bounds.html
1711
1712         * rendering/RenderLayerBacking.cpp:
1713         (WebCore::RenderLayerBacking::updateCompositedBounds):
1714
1715 2019-05-11  Simon Fraser  <simon.fraser@apple.com>
1716
1717         Translucent gradient rendering bug due to will-change transform
1718         https://bugs.webkit.org/show_bug.cgi?id=197654
1719         <rdar://problem/50547664>
1720
1721         Reviewed by Dean Jackson.
1722         
1723         We failed to re-evaluate 'contentsOpaque' when a background changed, because this
1724         happened in updateGeometry() and that doesn't run for background changes.
1725         
1726         However, 'contentsOpaque' also requires knowing about geometry because we have to
1727         turn it off when there's subpixel positioning, and updateConfiguration()
1728         runs before updateGeometry().
1729         
1730         So compute m_hasSubpixelRounding in updateGeometry() and set contentsOpaque in
1731         updateAfterDescendants().
1732
1733         Test: compositing/contents-opaque/background-change-to-transparent.html
1734
1735         * rendering/RenderLayerBacking.cpp:
1736         (WebCore::RenderLayerBacking::updateConfiguration):
1737         (WebCore::RenderLayerBacking::updateGeometry):
1738         (WebCore::RenderLayerBacking::updateAfterDescendants):
1739         * rendering/RenderLayerBacking.h:
1740
1741 2019-05-11  Simon Fraser  <simon.fraser@apple.com>
1742
1743         When the scroller hosting a shared layer becomes non-scrollable, content disappears
1744         https://bugs.webkit.org/show_bug.cgi?id=197766
1745         <rdar://problem/50695808>
1746
1747         Reviewed by Zalan Bujtas.
1748
1749         RenderLayerCompositor::requiresOwnBackingStore() should return true for a layer that shares
1750         its backing store. We always made backing for overlap layers, so even  if the sharing layers
1751         have no painted content, this should rarely be a backing store memory regression.
1752
1753         Test: compositing/shared-backing/overflow-scroll/sharing-layer-becomes-non-scrollable.html
1754
1755         * rendering/RenderLayerCompositor.cpp:
1756         (WebCore::RenderLayerCompositor::requiresOwnBackingStore const):
1757
1758 2019-05-11  Simon Fraser  <simon.fraser@apple.com>
1759
1760         Backing-sharing layers with transforms render incorrectly
1761         https://bugs.webkit.org/show_bug.cgi?id=197692
1762         <rdar://problem/50652127>
1763
1764         Reviewed by Antti Koivisto.
1765
1766         Layers that paint into shared backing need to enter the RenderLayer painting code
1767         in a way that paints the filters, transforms, opacity and blending.
1768         
1769         RenderLayerBacking::paintIntoLayer() normally enters at paintLayerContents(), because
1770         the effects are rendered via the GraphicsLayer, but shared layers will paint effects.
1771         Note that if the backing-provider has effects, it will be the stacking context
1772         for the shared layers, so it's correct that sharing layers are impacted by effects
1773         on the backing-provider.
1774
1775         In addition, we have to ensure that we don't over-eagerly make layers shared.
1776         Consider:
1777         
1778         <div class="clipping">
1779             <div class="sharing">
1780                 <div class="inner">
1781                 </div>
1782             </div>
1783         </div>
1784         
1785         Here "clipping" is the provider layer, "sharing" paints into shared backing, but
1786         we don't want to also mark "inner" as sharing, since "sharing" will just paint it.
1787         This is akin to avoiding unnecessary compositing of z-order descendants when they can just
1788         paint.
1789         
1790         To do this we need to ensure that sharing layers are treated like compositing layers
1791         in the overlap map, i.e. when a layer is sharing, we call overlapMap.pushCompositingContainer(),
1792         and later overlapMap.popCompositingContainer().
1793
1794         Tests: compositing/shared-backing/nested-shared-layers-with-opacity.html
1795                compositing/shared-backing/shared-layer-has-blending.html
1796                compositing/shared-backing/shared-layer-has-filter.html
1797                compositing/shared-backing/shared-layer-has-opacity.html
1798                compositing/shared-backing/shared-layer-has-reflection.html
1799                compositing/shared-backing/shared-layer-has-transform.html
1800                compositing/shared-backing/shared-layer-isolates-blending.html
1801                compositing/shared-backing/shared-transformed-layer-bounds.html
1802                compositing/shared-backing/sharing-layer-becomes-non-scrollable.html
1803                compositing/shared-backing/sharing-layer-has-effect.html
1804
1805         * rendering/RenderLayer.cpp:
1806         (WebCore::RenderLayer::paintLayer):
1807         (WebCore::RenderLayer::paintLayerWithEffects):
1808         * rendering/RenderLayer.h:
1809         * rendering/RenderLayerBacking.cpp:
1810         (WebCore::RenderLayerBacking::paintIntoLayer):
1811         * rendering/RenderLayerCompositor.cpp:
1812         (WebCore::RenderLayerCompositor::CompositingState::stateForPaintOrderChildren const):
1813         (WebCore::backingProviderLayerCanIncludeLayer):
1814         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
1815         (WebCore::RenderLayerCompositor::traverseUnchangedSubtree):
1816
1817 2019-05-10  Youenn Fablet  <youenn@apple.com>
1818
1819         A service worker instance should be terminated when its SWServer is destroyed
1820         https://bugs.webkit.org/show_bug.cgi?id=197801
1821         <rdar://problem/50587270>
1822
1823         Reviewed by Chris Dumez.
1824
1825         On session destruction, the SWServer is destroyed.
1826         At that time, it should terminate all its running service workers.
1827         Covered by updated API test.
1828
1829         * workers/service/server/SWServer.cpp:
1830         (WebCore::SWServer::~SWServer):
1831
1832 2019-05-10  Eric Carlson  <eric.carlson@apple.com>
1833
1834         [iOS] HTMLMediaElement sometimes doesn't send 'webkitplaybacktargetavailabilitychanged' event
1835         https://bugs.webkit.org/show_bug.cgi?id=197793
1836         <rdar://problem/46429187>
1837
1838         Reviewed by Jer Noble.
1839
1840         * html/MediaElementSession.cpp:
1841         (WebCore::MediaElementSession::MediaElementSession): Initialize m_hasPlaybackTargets.
1842
1843         * platform/audio/ios/MediaSessionManagerIOS.mm:
1844         (WebCore::MediaSessionManageriOS::externalOutputDeviceAvailableDidChange): Log
1845         target availability.
1846         (-[WebMediaSessionHelper startMonitoringAirPlayRoutes]): Call the client 
1847         externalOutputDeviceAvailableDidChange method after the AVRouteDetector is available.
1848
1849 2019-05-09  Geoffrey Garen  <ggaren@apple.com>
1850
1851         Downgrade RELEASE_ASSERT TO RELEASE_LOG_FAULT for SQLite Class A files
1852         https://bugs.webkit.org/show_bug.cgi?id=197760
1853
1854         Reviewed by Jer Noble.
1855
1856         We have all the data we need, and this crash is happening more than
1857         expected.
1858
1859         * platform/sql/SQLiteDatabase.cpp:
1860         (WebCore::SQLiteDatabase::open):
1861
1862 2019-05-10  Zalan Bujtas  <zalan@apple.com>
1863
1864         [iOS] baidu.com: Synthetic bold renders too far apart, appears doubled.
1865         https://bugs.webkit.org/show_bug.cgi?id=197781
1866         <rdar://problem/48027412>
1867
1868         Reviewed by Simon Fraser.
1869
1870         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
1871         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.
1872         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.
1873
1874         Test: fast/text/large-synthetic-bold-with-scale-transform.html
1875
1876         * platform/graphics/cocoa/FontCascadeCocoa.mm:
1877         (WebCore::FontCascade::drawGlyphs):
1878
1879 2019-05-10  Brent Fulgham  <bfulgham@apple.com>
1880
1881         Gracefully handle inaccessible font face data
1882         https://bugs.webkit.org/show_bug.cgi?id=197762
1883         <rdar://problem/50433861>
1884
1885         Reviewed by Per Arne Vollan.
1886
1887         Make sure CSS Font Face handling gracefully recovers from
1888         missing font data.
1889
1890         Test: fast/text/missing-font-crash.html
1891
1892         * css/CSSFontFace.cpp:
1893         (WebCore::CSSFontFace::fontLoadEventOccurred):
1894         (WebCore::CSSFontFace::timeoutFired):
1895         (WebCore::CSSFontFace::fontLoaded):
1896         (WebCore::CSSFontFace::font):
1897
1898 2019-05-10  Simon Fraser  <simon.fraser@apple.com>
1899
1900         ASSERT(isSelfPaintingLayer() || hasSelfPaintingLayerDescendant()) on nytimes.com after r245170
1901         https://bugs.webkit.org/show_bug.cgi?id=197776
1902
1903         Reviewed by Zalan Bujtas.
1904
1905         Only try to paint into shared backing for layers that are able to be composited. This
1906         avoids trying to do sharing for non-self-painting layers, which doesn't make sense.
1907
1908         Test: compositing/shared-backing/overflow-scroll/non-self-painting-layer-should-not-share.html
1909
1910         * rendering/RenderLayerCompositor.cpp:
1911         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
1912
1913 2019-05-10  Michael Catanzaro  <mcatanzaro@igalia.com>
1914
1915         Fix a bunch of compiler warnings
1916         https://bugs.webkit.org/show_bug.cgi?id=197785
1917
1918         Reviewed by Don Olmstead.
1919
1920         * CMakeLists.txt: WebCoreTestSupport should accept extra SYSTEM includes.
1921         * PlatformGTK.cmake: GTK includes should be added to SYSTEM headers to avoid warnings.
1922         * inspector/InspectorCanvas.cpp: Add preprocessor guards to fix unused function warning.
1923         * rendering/RenderLayer.cpp: Fix unused variable warning.
1924         (WebCore::RenderLayer::updateClipRects):
1925
1926 2019-05-10  Antti Koivisto  <antti@apple.com>
1927
1928         Event region generation needs to know about backing-sharing
1929         https://bugs.webkit.org/show_bug.cgi?id=197694
1930         <rdar://problem/50584991>
1931
1932         Reviewed by Simon Fraser.
1933
1934         Test: pointerevents/ios/touch-action-region-backing-sharing.html
1935
1936         * rendering/RenderLayerBacking.cpp:
1937         (WebCore::RenderLayerBacking::updateEventRegion):
1938
1939         Gather event region from backing sharing layers too.
1940
1941 2019-05-10  Michael Catanzaro  <mcatanzaro@igalia.com>
1942
1943         [WPE][GTK] Add WebKitWebPage::did-associate-form-controls-for-frame and deprecate original did-associate-form-controls
1944         https://bugs.webkit.org/show_bug.cgi?id=197271
1945
1946         Reviewed by Youenn Fablet.
1947
1948         * dom/Document.cpp:
1949         (WebCore::Document::didAssociateFormControlsTimerFired):
1950         * loader/EmptyClients.h:
1951         * page/ChromeClient.h:
1952
1953 2019-05-09  Simon Fraser  <simon.fraser@apple.com>
1954
1955         Implement backing-sharing in compositing layers, allowing overlap layers to paint into the backing store of another layer
1956         https://bugs.webkit.org/show_bug.cgi?id=197561
1957         <rdar://problem/50445998>
1958
1959         Reviewed by Antti Koivisto.
1960
1961         This change introduces the concept of layers that share backing store for compositing. A layer
1962         which is sharing its backing store first paints itself, and then some set of layers which come
1963         later in paint order in the same stacking context. This reduces the composited layer count in
1964         some overflow scrolling scenarios, thereby also simplifying the scrolling tree.
1965         
1966         A backing-shared layer stores a vector of "sharing" RenderLayer* in its RenderLayerBacking. At
1967         paint time, the owning layer is painted, then the sharing layers, setting the owning layer as the
1968         painting root so that positioning and clipping just work.
1969         
1970         Sharing layer relationships are constructed in RenderLayerCompositor::computeCompositingRequirements().
1971         We track the last layer which was composited in paint order as a shared candidate. If a later layer
1972         would composite for overlap (and no other reasons), then we allow it to share with the candidate
1973         if the candidate is in its ancestor containing block chain. Sharing is currently limited to layers
1974         in the same stacking context.
1975         
1976         isComposited() returns false for sharing layers, but they are like composited layers in that
1977         they behave as painting boundaries, so RenderLayer::paintLayer() needs to stop at them,
1978         and repaints in shared layers have to be directed to their shared layer, hence
1979         changes to RenderLayer::clippingRootForPainting() and RenderLayer::enclosingCompositingLayerForRepaint().
1980         
1981         The clipping boundary logic in RenderLayer::backgroundClipRect() needed to be generalized so that
1982         all calls to RenderLayer::parentClipRects() check for crossing painting boundaries and use
1983         TemporaryClipRects in that case.
1984
1985         Tests: compositing/shared-backing/overflow-scroll/absolute-in-stacking-relative-in-scroller.html
1986                compositing/shared-backing/overflow-scroll/composited-absolute-in-absolute-in-relative-in-scroller.html
1987                compositing/shared-backing/overflow-scroll/nested-absolute-with-clipping-in-stacking-overflow.html
1988                compositing/shared-backing/overflow-scroll/previous-sibling-prevents-inclusiveness.html
1989                compositing/shared-backing/overflow-scroll/relative-in-clipping-in-scroller-in-clipping.html
1990                compositing/shared-backing/overflow-scroll/relative-in-clipping-in-scroller-in-relative-clipping.html
1991                compositing/shared-backing/overflow-scroll/relative-in-div-in-overflow-scroll.html
1992                compositing/shared-backing/overflow-scroll/scrolled-contents-has-painted-content.html
1993                compositing/shared-backing/overflow-scroll/scrolled-contents-unconstrained-clip.html
1994                compositing/shared-backing/overflow-scroll/shared-layer-clipping.html
1995                compositing/shared-backing/overflow-scroll/shared-layer-composited-bounds.html
1996                compositing/shared-backing/overflow-scroll/shared-layer-nested-relative-stacking.html
1997                compositing/shared-backing/overflow-scroll/shared-layer-repaint.html
1998                compositing/shared-backing/partial-compositing-update.html
1999                compositing/shared-backing/partial-compositing-update2.html
2000                compositing/shared-backing/remove-sharing-layer.html
2001                compositing/shared-backing/sharing-cached-clip-rects.html
2002
2003         * rendering/RenderLayer.cpp:
2004         (WebCore::RenderLayer::~RenderLayer):
2005         (WebCore::RenderLayer::ancestorLayerIsInContainingBlockChain const):
2006         (WebCore::RenderLayer::setBackingProviderLayer):
2007         (WebCore::RenderLayer::disconnectFromBackingProviderLayer):
2008         (WebCore::RenderLayer::enclosingCompositingLayerForRepaint const):
2009         (WebCore::RenderLayer::clippingRootForPainting const):
2010         (WebCore::RenderLayer::clipToRect):
2011         (WebCore::RenderLayer::paintLayer):
2012         (WebCore::RenderLayer::updateClipRects):
2013         (WebCore::RenderLayer::clipCrossesPaintingBoundary const):
2014         (WebCore::RenderLayer::calculateClipRects const):
2015         (WebCore::outputPaintOrderTreeLegend):
2016         (WebCore::outputPaintOrderTreeRecursive):
2017         (WebCore::inContainingBlockChain): Deleted.
2018         * rendering/RenderLayer.h:
2019         * rendering/RenderLayerBacking.cpp:
2020         (WebCore::RenderLayerBacking::willBeDestroyed):
2021         (WebCore::clearBackingSharingLayerProviders):
2022         (WebCore::RenderLayerBacking::setBackingSharingLayers):
2023         (WebCore::RenderLayerBacking::removeBackingSharingLayer):
2024         (WebCore::RenderLayerBacking::clearBackingSharingLayers):
2025         (WebCore::RenderLayerBacking::updateCompositedBounds):
2026         (WebCore::RenderLayerBacking::updateDrawsContent):
2027         (WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer const):
2028         (WebCore::RenderLayerBacking::paintIntoLayer):
2029         (WebCore::RenderLayerBacking::paintContents):
2030         * rendering/RenderLayerBacking.h:
2031         * rendering/RenderLayerCompositor.cpp:
2032         (WebCore::RenderLayerCompositor::CompositingState::stateForPaintOrderChildren const):
2033         (WebCore::RenderLayerCompositor::CompositingState::propagateStateFromChildren):
2034         (WebCore::RenderLayerCompositor::CompositingState::propagateStateFromChildrenForUnchangedSubtree):
2035         (WebCore::RenderLayerCompositor::BackingSharingState::resetBackingProviderCandidate):
2036         (WebCore::RenderLayerCompositor::updateCompositingLayers):
2037         (WebCore::backingProviderLayerCanIncludeLayer):
2038         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
2039         (WebCore::RenderLayerCompositor::traverseUnchangedSubtree):
2040         (WebCore::RenderLayerCompositor::updateBacking):
2041         (WebCore::RenderLayerCompositor::layerWillBeRemoved):
2042         (WebCore::RenderLayerCompositor::requiresCompositingForIndirectReason const):
2043         * rendering/RenderLayerCompositor.h:
2044         * rendering/RenderTreeAsText.cpp:
2045
2046 2019-05-09  Daniel Bates  <dabates@apple.com>
2047
2048         [iOS] Right command key has wrong value for property code
2049         https://bugs.webkit.org/show_bug.cgi?id=193876
2050         <rdar://problem/47577308>
2051
2052         Reviewed by Brent Fulgham.
2053
2054         We're looking for the wrong Windows virtual key code for the right command key.
2055         Substitute VK_APPS for VK_RWIN so we can identify the right command key and return
2056         the correct value for the code property of the DOM key event.
2057
2058         * platform/ios/PlatformEventFactoryIOS.mm:
2059         (WebCore::codeForKeyEvent):
2060
2061 2019-05-09  Daniel Bates  <dabates@apple.com>
2062
2063         [iOS] Numpad comma key has incorrect keyIdentifier property
2064         https://bugs.webkit.org/show_bug.cgi?id=197753
2065         <rdar://problem/50636274>
2066
2067         Reviewed by Brent Fulgham.
2068
2069         Map the Numpad Comma HID usage code to its Window virtual key code, VK_SEPARATOR,
2070         so that can compute the keyIdentifier property for the Numpad Comma key. Also
2071         consider this key as a keypad key just like we do on Mac. There is no discernable
2072         difference for doing so on iOS because the non-keypad code path computes the same result
2073         due to GraphicsServices having fixed up the input string for the Numpad Comma to be
2074         ",", which is want.
2075
2076         * platform/ios/KeyEventIOS.mm:
2077         (WebCore::windowsKeyCodeForKeyCode): Map kHIDUsage_KeypadComma to VK_SEPARATOR.
2078         * platform/ios/PlatformEventFactoryIOS.mm:
2079         (WebCore::codeForKeyEvent): Add a comment to explain that this key is only on
2080         JIS keyboards.
2081         (WebCore::isKeypadEvent): Return true for the Numpad Comma key.
2082
2083 2019-05-09  Zalan Bujtas  <zalan@apple.com>
2084
2085         Do not mix inline and block level boxes.
2086         https://bugs.webkit.org/show_bug.cgi?id=197462
2087         <rdar://problem/50369362>
2088
2089         Reviewed by Antti Koivisto.
2090
2091         This patch tightens the remove-anonymous-wrappers logic by checking if the removal would
2092         produce an inline-block sibling mix.
2093         When a block level box is removed from the tree, we check if after the removal the anonymous sibling block
2094         boxes are still needed or whether we can removed them as well (and have only inline level child boxes).
2095         In addition to checking if the container is anonymous and is part of a continuation, we also need to check
2096         if collapsing it (and by that moving its children one level up) would cause a inline-block box mix.
2097
2098         Test: fast/ruby/continuation-and-column-spanner-crash.html
2099
2100         * rendering/updating/RenderTreeBuilder.cpp:
2101         (WebCore::RenderTreeBuilder::removeAnonymousWrappersForInlineChildrenIfNeeded):
2102         * rendering/updating/RenderTreeBuilderContinuation.cpp:
2103         (WebCore::RenderTreeBuilder::Continuation::cleanupOnDestroy):
2104
2105 2019-05-09  Eric Carlson  <eric.carlson@apple.com>
2106
2107         Refine AudioSession route sharing policy
2108         https://bugs.webkit.org/show_bug.cgi?id=197742
2109         <rdar://problem/50590818>
2110
2111         Reviewed by Darin Adler.
2112
2113         No new tests, updated AVAudioSessionRouteSharingPolicy API test.
2114
2115         * platform/audio/cocoa/MediaSessionManagerCocoa.mm:
2116         (MediaSessionManagerCocoa::updateSessionState):
2117
2118 2019-05-09  Simon Fraser  <simon.fraser@apple.com>
2119
2120         fast/hidpi/video-controls-in-hidpi.html sometimes asserts in WK1
2121         https://bugs.webkit.org/show_bug.cgi?id=197695
2122
2123         Reviewed by Zalan Bujtas.
2124
2125         With the backing-sharing changes that landed in r245058, some WebKit1 tests with media controls asserted in
2126         RenderLayerBacking::computeParentGraphicsLayerRect() because a layer would have a m_ancestorClippingLayer,
2127         but backgroundClipRect() would return an infinite rect.
2128         
2129         This happened when a layer tree change caused the layer's compositing ancestor to no longer isolate
2130         composited blending (which affects the behavior of RenderLayerCompositor:clippedByAncestor()), but we failed
2131         to mark its composited children as needing the configuration update which would eliminate their m_ancestorClippingLayers.
2132         
2133         The fix is to call setChildrenNeedCompositingGeometryUpdate() when isolatesCompositedBlending changes. We don't haev
2134         setChildrenNeedCompositingConfigurationUpdate(), but setChildrenNeedCompositingGeometryUpdate() has the desired side-effect.
2135
2136         I was unable to make a standalone test case for this, but the code is exercised by media control tests.
2137
2138         * rendering/RenderLayerCompositor.cpp:
2139         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
2140
2141 2019-05-09  Brent Fulgham  <bfulgham@apple.com>
2142
2143         Correct delayed load event handling
2144         https://bugs.webkit.org/show_bug.cgi?id=197679
2145         <rdar://problem/50423334>
2146
2147         Reviewed by Alex Christensen.
2148
2149         We need to properly account for the fact that JavaScript might run
2150         while performing loads.
2151
2152         * dom/Document.cpp:
2153         (WebCore::Document::loadEventDelayTimerFired):
2154
2155 2019-05-09  Antti Koivisto  <antti@apple.com>
2156
2157         Elements with "display: inline-block" don't have a touch-action region
2158         https://bugs.webkit.org/show_bug.cgi?id=197281
2159         <rdar://problem/50535081>
2160
2161         Reviewed by Antoine Quint.
2162
2163         Test: pointerevents/ios/touch-action-region-inline-block.html
2164
2165         PaintPhase::EventRegion failed to traverse into inline boxes.
2166
2167         * rendering/InlineElementBox.cpp:
2168         (WebCore::InlineElementBox::paint):
2169         * rendering/RenderElement.cpp:
2170         (WebCore::RenderElement::paintAsInlineBlock):
2171
2172 2019-05-08  Carlos Garcia Campos  <cgarcia@igalia.com>
2173
2174         REGRESSION(r239915): [FreeType] White space skipped when rendering plain text with noto CJK font
2175         https://bugs.webkit.org/show_bug.cgi?id=197658
2176
2177         Reviewed by Michael Catanzaro.
2178
2179         Since r239915 we no longer overwrite control characters with zero width space, they are handled later when
2180         filling the glyph pages. In Font::platformGlyphInit() there's an optimization to get the glyph of zero with
2181         space character that assumes that control characters are always overwritten. Since the glyph for character at 0
2182         index is always overwritten with zero width space, we can avoid loading the page for the actual zero width space
2183         character and use the first page instead. In the particular case of noto CJK font, character at 0 is mapped to
2184         the same glyph as space character, so space and zero width space end up being the same glyph. That breaks the
2185         space width calculation, that returns 0 when isZeroWidthSpaceGlyph() is true. That's why spaces are no
2186         longer rendered, ComplexTextController::adjustGlyphsAndAdvances() is setting the x advance for the space glyphs
2187         to 0.
2188
2189         * platform/graphics/Font.cpp:
2190         (WebCore::Font::platformGlyphInit): Use the actual zero width space page to get the glyph instead of 0 when
2191         using FreeType.
2192
2193 2019-05-08  Alex Christensen  <achristensen@webkit.org>
2194
2195         Fix WPE build.
2196
2197         * CMakeLists.txt:
2198         Bots wanted a "PUBLIC" or "PRIVATE" keyword here.
2199
2200 2019-05-08  Alex Christensen  <achristensen@webkit.org>
2201
2202         Try to fix Linux build
2203
2204         * platform/graphics/ANGLEWebKitBridge.h:
2205         Include headers consistently on all platforms.
2206
2207 2019-05-08  Don Olmstead  <don.olmstead@sony.com>
2208
2209         Update ANGLE
2210         https://bugs.webkit.org/show_bug.cgi?id=197676
2211
2212         Reviewed by Alex Christensen.
2213
2214         * CMakeLists.txt:
2215         * PlatformGTK.cmake:
2216         * PlatformMac.cmake:
2217         * PlatformPlayStation.cmake:
2218         * PlatformWPE.cmake:
2219         * PlatformWin.cmake:
2220         * platform/graphics/GLContext.cpp:
2221         * platform/graphics/egl/GLContextEGL.cpp:
2222         * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
2223         * platform/graphics/opengl/Extensions3DOpenGLES.h:
2224         * platform/graphics/opengl/TemporaryOpenGLSetting.cpp:
2225         * platform/graphics/texmap/TextureMapperGLHeaders.h:
2226
2227 2019-05-08  Chris Dumez  <cdumez@apple.com>
2228
2229         [iOS Debug] ASSERTION FAILED: !m_originalNode in WebCore::JSLazyEventListener::checkValidityForEventTarget(WebCore::EventTarget &)
2230         https://bugs.webkit.org/show_bug.cgi?id=197696
2231         <rdar://problem/50586956>
2232
2233         Reviewed by Simon Fraser.
2234
2235         Setting the onorientationchange / onresize event handler on the body should set the event handler on the
2236         window object, as per the HTML specification. However, calling body.addEventListener() with 'orientationchange'
2237         or 'resize' should not set the event listener on the window object, only the body. Blink and Gecko seem to
2238         behave as per specification but WebKit had a quirk for the addEventListener case. The quirk's implementation
2239         is slightly wrong (because it is unsafe to take a JSLazyEventListener from a body element and add it to the
2240         window, given that the JSLazyEventListener keeps a raw pointer to its element) and was causing crashes such
2241         as <rdar://problem/24314027>. As a result, this patch simply drops the WebKit quirk, which will align our
2242         behavior with other browsers and fix the crashes altogether.
2243
2244         Test: fast/events/ios/rotation/orientationchange-event-listener-on.body.html
2245
2246         * dom/Node.cpp:
2247         (WebCore::tryAddEventListener):
2248         (WebCore::tryRemoveEventListener):
2249
2250 2019-05-08  Ryan Haddad  <ryanhaddad@apple.com>
2251
2252         Unreviewed, rolling out r245058.
2253
2254         Causes crashes under ASan / GuardMalloc
2255
2256         Reverted changeset:
2257
2258         "Implement backing-sharing in compositing layers, allowing
2259         overlap layers to paint into the backing store of another
2260         layer"
2261         https://bugs.webkit.org/show_bug.cgi?id=197561
2262         https://trac.webkit.org/changeset/245058
2263
2264 2019-05-08  Ryan Haddad  <ryanhaddad@apple.com>
2265
2266         Unreviewed, rolling out r245068.
2267
2268         Caused debug layout tests to exit early due to an assertion
2269         failure.
2270
2271         Reverted changeset:
2272
2273         "All prototypes should call didBecomePrototype()"
2274         https://bugs.webkit.org/show_bug.cgi?id=196315
2275         https://trac.webkit.org/changeset/245068
2276
2277 2019-05-08  Megan Gardner  <megan_gardner@apple.com>
2278
2279         Add quirks to emulate undo and redo in hidden editable areas on some websites
2280         https://bugs.webkit.org/show_bug.cgi?id=197452
2281
2282         Reviewed by Alex Christensen.
2283
2284         UI change, not testable.
2285
2286         We need to send synthetic keyboard events to the web process to emulate undo and redo
2287         key combinations for when we are trying to get our undo and redo UI to work
2288         on rich editing websites that only listen to keystrokes, and don't let us use our
2289         undo manager to help manage the input content.
2290
2291         * page/EventHandler.cpp:
2292         (WebCore::EventHandler::keyEvent):
2293         * platform/PlatformKeyboardEvent.h:
2294         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
2295         (WebCore::PlatformKeyboardEvent::isSyntheticEvent):
2296         (WebCore::PlatformKeyboardEvent::setSyntheticEvent):
2297         * platform/ios/KeyEventIOS.mm:
2298         (WebCore::PlatformKeyboardEvent::currentStateOfModifierKeys):
2299         * platform/ios/PlatformEventFactoryIOS.mm:
2300         (WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder):
2301         * platform/mac/PlatformEventFactoryMac.mm:
2302         (WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder):
2303
2304 2019-05-08  Don Olmstead  <don.olmstead@sony.com>
2305
2306         CSSFontFaceSource fails to compile when !ENABLE(SVG_FONTS)
2307         https://bugs.webkit.org/show_bug.cgi?id=197720
2308
2309         Unreviewed build fix.
2310
2311         Add usesInDocumentSVGFont to the !ENABLE(SVG_FONT) path.
2312
2313         * css/CSSFontFaceSource.cpp:
2314         (WebCore::CSSFontFaceSource::font):
2315
2316 2019-05-08  Timothy Hatcher  <timothy@apple.com>
2317
2318         Add plumbing for inactive system colors in RenderTheme cache.
2319         https://bugs.webkit.org/show_bug.cgi?id=197699
2320         rdar://problem/49406936
2321
2322         Reviewed by Tim Horton.
2323
2324         * css/StyleColor.h:
2325         * page/Page.cpp:
2326         (WebCore::Page::effectiveAppearanceDidChange): Renamed from setUseDarkAppearance.
2327         * page/Page.h:
2328         (WebCore::Page::useInactiveAppearance const):
2329         * rendering/RenderTheme.cpp:
2330         (WebCore::RenderTheme::purgeCaches):
2331         (WebCore::RenderTheme::platformColorsDidChange):
2332         (WebCore::RenderTheme::colorCache const):
2333         * rendering/RenderTheme.h:
2334         * testing/InternalSettings.cpp:
2335         (WebCore::InternalSettings::setUseDarkAppearanceInternal):
2336
2337 2019-05-08  Robin Morisset  <rmorisset@apple.com>
2338
2339         All prototypes should call didBecomePrototype()
2340         https://bugs.webkit.org/show_bug.cgi?id=196315
2341
2342         Reviewed by Saam Barati.
2343
2344         This changelog already landed, but the commit was missing the actual changes.
2345
2346         It was found by existing tests, with the new assert in JSC::Structure
2347
2348         * bindings/js/JSWindowProxy.cpp:
2349         (WebCore::JSWindowProxy::setWindow):
2350         * bindings/scripts/CodeGeneratorJS.pm:
2351         (GeneratePrototypeDeclaration):
2352         (GenerateConstructorHelperMethods):
2353         * bindings/scripts/test/JS/JSInterfaceName.cpp:
2354         (WebCore::JSInterfaceNamePrototype::JSInterfaceNamePrototype):
2355         * bindings/scripts/test/JS/JSMapLike.cpp:
2356         (WebCore::JSMapLikePrototype::JSMapLikePrototype):
2357         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
2358         (WebCore::JSReadOnlyMapLikePrototype::JSReadOnlyMapLikePrototype):
2359         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
2360         (WebCore::JSTestActiveDOMObjectPrototype::JSTestActiveDOMObjectPrototype):
2361         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
2362         (WebCore::JSTestCEReactionsPrototype::JSTestCEReactionsPrototype):
2363         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
2364         (WebCore::JSTestCEReactionsStringifierPrototype::JSTestCEReactionsStringifierPrototype):
2365         * bindings/scripts/test/JS/JSTestCallTracer.cpp:
2366         (WebCore::JSTestCallTracerPrototype::JSTestCallTracerPrototype):
2367         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
2368         (WebCore::JSTestClassWithJSBuiltinConstructorPrototype::JSTestClassWithJSBuiltinConstructorPrototype):
2369         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
2370         (WebCore::JSTestDOMJITPrototype::JSTestDOMJITPrototype):
2371         (WebCore::JSTestDOMJITConstructor::prototypeForStructure):
2372         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
2373         (WebCore::JSTestEnabledBySettingPrototype::JSTestEnabledBySettingPrototype):
2374         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
2375         (WebCore::JSTestEventConstructorPrototype::JSTestEventConstructorPrototype):
2376         (WebCore::JSTestEventConstructorConstructor::prototypeForStructure):
2377         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
2378         (WebCore::JSTestEventTargetPrototype::JSTestEventTargetPrototype):
2379         (WebCore::JSTestEventTargetConstructor::prototypeForStructure):
2380         * bindings/scripts/test/JS/JSTestException.cpp:
2381         (WebCore::JSTestExceptionPrototype::JSTestExceptionPrototype):
2382         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
2383         (WebCore::JSTestGenerateIsReachablePrototype::JSTestGenerateIsReachablePrototype):
2384         * bindings/scripts/test/JS/JSTestGlobalObject.h:
2385         (WebCore::JSTestGlobalObjectPrototype::JSTestGlobalObjectPrototype):
2386         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
2387         (WebCore::JSTestIndexedSetterNoIdentifierPrototype::JSTestIndexedSetterNoIdentifierPrototype):
2388         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
2389         (WebCore::JSTestIndexedSetterThrowingExceptionPrototype::JSTestIndexedSetterThrowingExceptionPrototype):
2390         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
2391         (WebCore::JSTestIndexedSetterWithIdentifierPrototype::JSTestIndexedSetterWithIdentifierPrototype):
2392         * bindings/scripts/test/JS/JSTestInterface.cpp:
2393         (WebCore::JSTestInterfacePrototype::JSTestInterfacePrototype):
2394         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
2395         (WebCore::JSTestInterfaceLeadingUnderscorePrototype::JSTestInterfaceLeadingUnderscorePrototype):
2396         * bindings/scripts/test/JS/JSTestIterable.cpp:
2397         (WebCore::JSTestIterablePrototype::JSTestIterablePrototype):
2398         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
2399         (WebCore::JSTestJSBuiltinConstructorPrototype::JSTestJSBuiltinConstructorPrototype):
2400         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
2401         (WebCore::JSTestMediaQueryListListenerPrototype::JSTestMediaQueryListListenerPrototype):
2402         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
2403         (WebCore::JSTestNamedAndIndexedSetterNoIdentifierPrototype::JSTestNamedAndIndexedSetterNoIdentifierPrototype):
2404         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
2405         (WebCore::JSTestNamedAndIndexedSetterThrowingExceptionPrototype::JSTestNamedAndIndexedSetterThrowingExceptionPrototype):
2406         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
2407         (WebCore::JSTestNamedAndIndexedSetterWithIdentifierPrototype::JSTestNamedAndIndexedSetterWithIdentifierPrototype):
2408         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
2409         (WebCore::JSTestNamedConstructorPrototype::JSTestNamedConstructorPrototype):
2410         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
2411         (WebCore::JSTestNamedDeleterNoIdentifierPrototype::JSTestNamedDeleterNoIdentifierPrototype):
2412         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
2413         (WebCore::JSTestNamedDeleterThrowingExceptionPrototype::JSTestNamedDeleterThrowingExceptionPrototype):
2414         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
2415         (WebCore::JSTestNamedDeleterWithIdentifierPrototype::JSTestNamedDeleterWithIdentifierPrototype):
2416         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
2417         (WebCore::JSTestNamedDeleterWithIndexedGetterPrototype::JSTestNamedDeleterWithIndexedGetterPrototype):
2418         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
2419         (WebCore::JSTestNamedGetterCallWithPrototype::JSTestNamedGetterCallWithPrototype):
2420         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
2421         (WebCore::JSTestNamedGetterNoIdentifierPrototype::JSTestNamedGetterNoIdentifierPrototype):
2422         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
2423         (WebCore::JSTestNamedGetterWithIdentifierPrototype::JSTestNamedGetterWithIdentifierPrototype):
2424         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
2425         (WebCore::JSTestNamedSetterNoIdentifierPrototype::JSTestNamedSetterNoIdentifierPrototype):
2426         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
2427         (WebCore::JSTestNamedSetterThrowingExceptionPrototype::JSTestNamedSetterThrowingExceptionPrototype):
2428         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
2429         (WebCore::JSTestNamedSetterWithIdentifierPrototype::JSTestNamedSetterWithIdentifierPrototype):
2430         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
2431         (WebCore::JSTestNamedSetterWithIndexedGetterPrototype::JSTestNamedSetterWithIndexedGetterPrototype):
2432         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
2433         (WebCore::JSTestNamedSetterWithIndexedGetterAndSetterPrototype::JSTestNamedSetterWithIndexedGetterAndSetterPrototype):
2434         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
2435         (WebCore::JSTestNamedSetterWithOverrideBuiltinsPrototype::JSTestNamedSetterWithOverrideBuiltinsPrototype):
2436         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
2437         (WebCore::JSTestNamedSetterWithUnforgablePropertiesPrototype::JSTestNamedSetterWithUnforgablePropertiesPrototype):
2438         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
2439         (WebCore::JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsPrototype::JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsPrototype):
2440         * bindings/scripts/test/JS/JSTestNode.cpp:
2441         (WebCore::JSTestNodePrototype::JSTestNodePrototype):
2442         (WebCore::JSTestNodeConstructor::prototypeForStructure):
2443         * bindings/scripts/test/JS/JSTestObj.cpp:
2444         (WebCore::JSTestObjPrototype::JSTestObjPrototype):
2445         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
2446         (WebCore::JSTestOverloadedConstructorsPrototype::JSTestOverloadedConstructorsPrototype):
2447         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
2448         (WebCore::JSTestOverloadedConstructorsWithSequencePrototype::JSTestOverloadedConstructorsWithSequencePrototype):
2449         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
2450         (WebCore::JSTestOverrideBuiltinsPrototype::JSTestOverrideBuiltinsPrototype):
2451         * bindings/scripts/test/JS/JSTestPluginInterface.cpp:
2452         (WebCore::JSTestPluginInterfacePrototype::JSTestPluginInterfacePrototype):
2453         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
2454         (WebCore::JSTestPromiseRejectionEventPrototype::JSTestPromiseRejectionEventPrototype):
2455         (WebCore::JSTestPromiseRejectionEventConstructor::prototypeForStructure):
2456         * bindings/scripts/test/JS/JSTestSerialization.cpp:
2457         (WebCore::JSTestSerializationPrototype::JSTestSerializationPrototype):
2458         * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp:
2459         (WebCore::JSTestSerializationIndirectInheritancePrototype::JSTestSerializationIndirectInheritancePrototype):
2460         (WebCore::JSTestSerializationIndirectInheritanceConstructor::prototypeForStructure):
2461         * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
2462         (WebCore::JSTestSerializationInheritPrototype::JSTestSerializationInheritPrototype):
2463         (WebCore::JSTestSerializationInheritConstructor::prototypeForStructure):
2464         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
2465         (WebCore::JSTestSerializationInheritFinalPrototype::JSTestSerializationInheritFinalPrototype):
2466         (WebCore::JSTestSerializationInheritFinalConstructor::prototypeForStructure):
2467         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
2468         (WebCore::JSTestSerializedScriptValueInterfacePrototype::JSTestSerializedScriptValueInterfacePrototype):
2469         * bindings/scripts/test/JS/JSTestStringifier.cpp:
2470         (WebCore::JSTestStringifierPrototype::JSTestStringifierPrototype):
2471         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
2472         (WebCore::JSTestStringifierAnonymousOperationPrototype::JSTestStringifierAnonymousOperationPrototype):
2473         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
2474         (WebCore::JSTestStringifierNamedOperationPrototype::JSTestStringifierNamedOperationPrototype):
2475         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
2476         (WebCore::JSTestStringifierOperationImplementedAsPrototype::JSTestStringifierOperationImplementedAsPrototype):
2477         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
2478         (WebCore::JSTestStringifierOperationNamedToStringPrototype::JSTestStringifierOperationNamedToStringPrototype):
2479         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
2480         (WebCore::JSTestStringifierReadOnlyAttributePrototype::JSTestStringifierReadOnlyAttributePrototype):
2481         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
2482         (WebCore::JSTestStringifierReadWriteAttributePrototype::JSTestStringifierReadWriteAttributePrototype):
2483         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2484         (WebCore::JSTestTypedefsPrototype::JSTestTypedefsPrototype):
2485
2486 2019-05-08  Don Olmstead  <don.olmstead@sony.com>
2487
2488         WEBCORE_EXPORT shouldn't be on the class and its methods
2489         https://bugs.webkit.org/show_bug.cgi?id=197681
2490
2491         Reviewed by Simon Fraser.
2492
2493         Remove WEBCORE_EXPORT from the methods.
2494
2495         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
2496         * page/scrolling/ScrollingTreeScrollingNode.h:
2497
2498 2019-05-08  Wenson Hsieh  <wenson_hsieh@apple.com>
2499
2500         [iOS] Add a quirk to synthesize mouse events when modifying the selection
2501         https://bugs.webkit.org/show_bug.cgi?id=197683
2502         <rdar://problem/48003980>
2503
2504         Reviewed by Tim Horton.
2505
2506         See WebKit ChangeLog for more details.
2507
2508         Test: editing/selection/ios/dispatch-mouse-events-when-modifying-selection-quirk.html
2509
2510         * page/EventHandler.cpp:
2511         (WebCore::EventHandler::handleMousePressEvent):
2512         (WebCore::EventHandler::supportsSelectionUpdatesOnMouseDrag const):
2513
2514         Add some platform hooks to prevent mousemove events from updating the selection on iOS.
2515
2516         (WebCore::EventHandler::shouldAllowMouseDownToStartDrag const):
2517
2518         Add some platform hooks to prevent drag and drop from kicking in when sending synthetic mousemove events to the
2519         page on iOS (drag and drop is instead triggered by EventHandler::tryToBeginDragAtPoint).
2520
2521         (WebCore::EventHandler::updateSelectionForMouseDrag):
2522         * page/EventHandler.h:
2523         * page/Quirks.cpp:
2524         (WebCore::Quirks::shouldDispatchSyntheticMouseEventsWhenModifyingSelection const):
2525         * page/Quirks.h:
2526
2527         Add the new site-specific quirk.
2528
2529         * page/Settings.yaml:
2530         * page/ios/EventHandlerIOS.mm:
2531         (WebCore::EventHandler::tryToBeginDragAtPoint):
2532         (WebCore::EventHandler::supportsSelectionUpdatesOnMouseDrag const):
2533         (WebCore::EventHandler::shouldAllowMouseDownToStartDrag const):
2534         * testing/InternalSettings.cpp:
2535         (WebCore::InternalSettings::Backup::Backup):
2536         (WebCore::InternalSettings::Backup::restoreTo):
2537         (WebCore::InternalSettings::setShouldDispatchSyntheticMouseEventsWhenModifyingSelection):
2538         * testing/InternalSettings.h:
2539         * testing/InternalSettings.idl:
2540
2541         Add an internal settings hook to opt into this quirk, for use in layout tests.
2542
2543 2019-05-08  Simon Fraser  <simon.fraser@apple.com>
2544
2545         Implement backing-sharing in compositing layers, allowing overlap layers to paint into the backing store of another layer
2546         https://bugs.webkit.org/show_bug.cgi?id=197561
2547         <rdar://problem/50445998>
2548
2549         Reviewed by Antti Koivisto.
2550
2551         This change introduces the concept of layers that share backing store for compositing. A layer
2552         which is sharing its backing store first paints itself, and then some set of layers which come
2553         later in paint order in the same stacking context. This reduces the composited layer count in
2554         some overflow scrolling scenarios, thereby also simplifying the scrolling tree.
2555         
2556         A backing-shared layer stores a vector of "sharing" RenderLayer* in its RenderLayerBacking. At
2557         paint time, the owning layer is painted, then the sharing layers, setting the owning layer as the
2558         painting root so that positioning and clipping just work.
2559         
2560         Sharing layer relationships are constructed in RenderLayerCompositor::computeCompositingRequirements().
2561         We track the last layer which was composited in paint order as a shared candidate. If a later layer
2562         would composite for overlap (and no other reasons), then we allow it to share with the candidate
2563         if the candidate is in its ancestor containing block chain. Sharing is currently limited to layers
2564         in the same stacking context.
2565         
2566         isComposited() returns false for sharing layers, but they are like composited layers in that
2567         they behave as painting boundaries, so RenderLayer::paintLayer() needs to stop at them,
2568         and repaints in shared layers have to be directed to their shared layer, hence
2569         changes to RenderLayer::clippingRootForPainting() and RenderLayer::enclosingCompositingLayerForRepaint().
2570         
2571         The clipping boundary logic in RenderLayer::backgroundClipRect() needed to be generalized so that
2572         all calls to RenderLayer::parentClipRects() check for crossing painting boundaries and use
2573         TemporaryClipRects in that case.
2574
2575         Tests: compositing/shared-backing/overflow-scroll/absolute-in-stacking-relative-in-scroller.html
2576                compositing/shared-backing/overflow-scroll/composited-absolute-in-absolute-in-relative-in-scroller.html
2577                compositing/shared-backing/overflow-scroll/nested-absolute-with-clipping-in-stacking-overflow.html
2578                compositing/shared-backing/overflow-scroll/previous-sibling-prevents-inclusiveness.html
2579                compositing/shared-backing/overflow-scroll/relative-in-clipping-in-scroller-in-clipping.html
2580                compositing/shared-backing/overflow-scroll/relative-in-clipping-in-scroller-in-relative-clipping.html
2581                compositing/shared-backing/overflow-scroll/relative-in-div-in-overflow-scroll.html
2582                compositing/shared-backing/overflow-scroll/scrolled-contents-has-painted-content.html
2583                compositing/shared-backing/overflow-scroll/scrolled-contents-unconstrained-clip.html
2584                compositing/shared-backing/overflow-scroll/shared-layer-clipping.html
2585                compositing/shared-backing/overflow-scroll/shared-layer-composited-bounds.html
2586                compositing/shared-backing/overflow-scroll/shared-layer-nested-relative-stacking.html
2587                compositing/shared-backing/overflow-scroll/shared-layer-repaint.html
2588                compositing/shared-backing/partial-compositing-update.html
2589                compositing/shared-backing/partial-compositing-update2.html
2590                compositing/shared-backing/remove-sharing-layer.html
2591                compositing/shared-backing/sharing-cached-clip-rects.html
2592
2593         * rendering/RenderLayer.cpp:
2594         (WebCore::RenderLayer::~RenderLayer):
2595         (WebCore::RenderLayer::ancestorLayerIsInContainingBlockChain const):
2596         (WebCore::RenderLayer::setBackingProviderLayer):
2597         (WebCore::RenderLayer::disconnectFromBackingProviderLayer):
2598         (WebCore::RenderLayer::enclosingCompositingLayerForRepaint const):
2599         (WebCore::RenderLayer::clippingRootForPainting const):
2600         (WebCore::RenderLayer::clipToRect):
2601         (WebCore::RenderLayer::paintLayer):
2602         (WebCore::RenderLayer::updateClipRects):
2603         (WebCore::RenderLayer::clipCrossesPaintingBoundary const):
2604         (WebCore::RenderLayer::calculateClipRects const):
2605         (WebCore::outputPaintOrderTreeLegend):
2606         (WebCore::outputPaintOrderTreeRecursive):
2607         (WebCore::inContainingBlockChain): Deleted.
2608         * rendering/RenderLayer.h:
2609         * rendering/RenderLayerBacking.cpp:
2610         (WebCore::RenderLayerBacking::willBeDestroyed):
2611         (WebCore::clearBackingSharingLayerProviders):
2612         (WebCore::RenderLayerBacking::setBackingSharingLayers):
2613         (WebCore::RenderLayerBacking::removeBackingSharingLayer):
2614         (WebCore::RenderLayerBacking::clearBackingSharingLayers):
2615         (WebCore::RenderLayerBacking::updateCompositedBounds):
2616         (WebCore::RenderLayerBacking::updateDrawsContent):
2617         (WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer const):
2618         (WebCore::RenderLayerBacking::paintIntoLayer):
2619         (WebCore::RenderLayerBacking::paintContents):
2620         * rendering/RenderLayerBacking.h:
2621         * rendering/RenderLayerCompositor.cpp:
2622         (WebCore::RenderLayerCompositor::CompositingState::stateForPaintOrderChildren const):
2623         (WebCore::RenderLayerCompositor::CompositingState::propagateStateFromChildren):
2624         (WebCore::RenderLayerCompositor::CompositingState::propagateStateFromChildrenForUnchangedSubtree):
2625         (WebCore::RenderLayerCompositor::BackingSharingState::resetBackingProviderCandidate):
2626         (WebCore::RenderLayerCompositor::updateCompositingLayers):
2627         (WebCore::backingProviderLayerCanIncludeLayer):
2628         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
2629         (WebCore::RenderLayerCompositor::traverseUnchangedSubtree):
2630         (WebCore::RenderLayerCompositor::updateBacking):
2631         (WebCore::RenderLayerCompositor::layerWillBeRemoved):
2632         (WebCore::RenderLayerCompositor::requiresCompositingForIndirectReason const):
2633         * rendering/RenderLayerCompositor.h:
2634         * rendering/RenderTreeAsText.cpp:
2635
2636 2019-05-08  Brent Fulgham  <bfulgham@apple.com>
2637
2638         Correct delayed load event handling
2639         https://bugs.webkit.org/show_bug.cgi?id=197679
2640         <rdar://problem/50423334>
2641
2642         Reviewed by Alex Christensen.
2643
2644         We need to properly account for the fact that JavaScript might run
2645         while performing loads.
2646
2647         * dom/Document.cpp:
2648         (WebCore::Document::loadEventDelayTimerFired):
2649
2650 2019-05-08  Philippe Normand  <pnormand@igalia.com>
2651
2652         REGRESSION(r243197): [GStreamer] Error playing redirected streams
2653         https://bugs.webkit.org/show_bug.cgi?id=197410
2654
2655         Reviewed by Carlos Garcia Campos.
2656
2657         Revert the change introduced in r243197 that was checking the
2658         redirected URI instead of the original URI. Non-main URIs should
2659         be ignored only when they are HLS (or similar) fragments.
2660
2661         Test http/tests/security/canvas-remote-read-remote-video-hls.html still passes.
2662
2663         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2664         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
2665
2666 2019-05-08  Rob Buis  <rbuis@igalia.com>
2667
2668         Link prefetch not useful for top-level navigation
2669         https://bugs.webkit.org/show_bug.cgi?id=195623
2670
2671         Reviewed by Youenn Fablet.
2672
2673         Cache cross-domain top-level prefetches in a dedicated cache and not in the
2674         memory cache.
2675
2676         Tests: http/tests/cache/link-prefetch-main-resource-iframe.html
2677                http/tests/cache/link-prefetch-main-resource.html
2678                http/tests/contentextensions/prefetch-blocked.html
2679
2680         * loader/LinkLoader.cpp:
2681         (WebCore::LinkLoader::prefetchIfNeeded):
2682         * loader/ResourceLoadInfo.cpp:
2683         (WebCore::toResourceType):
2684
2685 2019-05-07  Don Olmstead  <don.olmstead@sony.com>
2686
2687         Fix !HAVE(ACCESSIBILITY) build
2688         https://bugs.webkit.org/show_bug.cgi?id=197680
2689
2690         Reviewed by Fujii Hironori.
2691
2692         * accessibility/AXObjectCache.h:
2693         (WebCore::AXObjectCache::focusedUIElementForPage):
2694         Update declaration for !HAVE(ACCESSIBILITY)
2695         * accessibility/AccessibilityObject.h:
2696         Add wrapper implementation for !HAVE(ACCESSIBILITY)
2697         * accessibility/AccessibilityProgressIndicator.cpp:
2698         (WebCore::AccessibilityProgressIndicator::roleValue const):
2699         Add ENABLE(METER_ELEMENT) guard.
2700
2701 2019-05-07  Ryan Haddad  <ryanhaddad@apple.com>
2702
2703         Unreviewed, rolling out r245038.
2704
2705         Breaks internal builds.
2706
2707         Reverted changeset:
2708
2709         "Add SPI to set a list of hosts to which to send custom header
2710         fields cross-origin"
2711         https://bugs.webkit.org/show_bug.cgi?id=197397
2712         https://trac.webkit.org/changeset/245038
2713
2714 2019-05-07  Jiewen Tan  <jiewen_tan@apple.com>
2715
2716         [WebAuthN] A new request should always suppress the pending request if any
2717         https://bugs.webkit.org/show_bug.cgi?id=191517
2718         <rdar://problem/46888222>
2719
2720         Reviewed by Brent Fulgham.
2721
2722         Blocking new requests from the same page when there is a pending request could DoS the
2723         WebAuthN API in the period between [the page is refreshed, the pending request is
2724         hanedled/timeout]. Therefore, the policy will be to always cancel any pending requests
2725         whenever a new request is made. This will enforce the policy of handling only one
2726         request at a time.
2727
2728         Covered by new tests in existing files.
2729
2730         * Modules/webauthn/AuthenticatorCoordinatorClient.cpp:
2731         (WebCore::AuthenticatorCoordinatorClient::requestReply):
2732         (WebCore::AuthenticatorCoordinatorClient::setRequestCompletionHandler):
2733         (WebCore::AuthenticatorCoordinatorClient::addQueryCompletionHandler):
2734         * Modules/webauthn/AuthenticatorCoordinatorClient.h:
2735
2736 2019-05-07  Eric Carlson  <eric.carlson@apple.com>
2737
2738         Define media buffering policy
2739         https://bugs.webkit.org/show_bug.cgi?id=196979
2740         <rdar://problem/28383861>
2741
2742         Reviewed by Jer Noble.
2743
2744         Test: MediaBufferingPolicy API test.
2745
2746         * html/HTMLMediaElement.cpp:
2747         (WebCore::HTMLMediaElement::HTMLMediaElement):
2748         (WebCore::HTMLMediaElement::suspend):
2749         (WebCore::HTMLMediaElement::resume):
2750         (WebCore::HTMLMediaElement::createMediaPlayer):
2751         (WebCore::HTMLMediaElement::setBufferingPolicy):
2752         (WebCore::HTMLMediaElement::purgeBufferedDataIfPossible):
2753         (WebCore::HTMLMediaElement::bufferingPolicy const):
2754         (WebCore::HTMLMediaElement::setShouldBufferData): Deleted.
2755         * html/HTMLMediaElement.h:
2756         (WebCore::HTMLMediaElement::shouldBufferData const): Deleted.
2757         * html/MediaElementSession.cpp:
2758         (WebCore::MediaElementSession::updateClientDataBuffering):
2759         (WebCore::MediaElementSession::preferredBufferingPolicy const):
2760         (WebCore::MediaElementSession::dataBufferingPermitted const): Deleted.
2761         * html/MediaElementSession.h:
2762         * platform/graphics/MediaPlayer.cpp:
2763         (WebCore::MediaPlayer::setBufferingPolicy):
2764         (WebCore::convertEnumerationToString):
2765         (WebCore::MediaPlayer::setShouldBufferData): Deleted.
2766         * platform/graphics/MediaPlayer.h:
2767         * platform/graphics/MediaPlayerEnums.h:
2768         (WTF::LogArgument<WebCore::MediaPlayerEnums::BufferingPolicy>::toString):
2769         * platform/graphics/MediaPlayerPrivate.h:
2770         (WebCore::MediaPlayerPrivateInterface::setBufferingPolicy):
2771         (WebCore::MediaPlayerPrivateInterface::setShouldBufferData): Deleted.
2772         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
2773         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2774         (WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC):
2775         (WebCore::MediaPlayerPrivateAVFoundationObjC::setBufferingPolicy):
2776         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldBufferData): Deleted.
2777         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
2778         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
2779         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setBufferingPolicy):
2780         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::flushAndRemoveVideoSampleBuffers): Deleted.
2781         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setShouldBufferData): Deleted.
2782         * testing/Internals.cpp:
2783         (WebCore::Internals::elementShouldBufferData):
2784         (WebCore::Internals::elementBufferingPolicy):
2785         * testing/Internals.h:
2786         * testing/Internals.idl:
2787
2788 2019-05-07  Alex Christensen  <achristensen@webkit.org>
2789
2790         Add SPI to set a list of hosts to which to send custom header fields cross-origin
2791         https://bugs.webkit.org/show_bug.cgi?id=197397
2792
2793         Reviewed by Geoff Garen.
2794
2795         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.
2796         We need the ability to specify what origins to send these headers to even if they are not first party requests.
2797         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,
2798         indicating that the headers are to be sent to all subdomains.
2799
2800         I repurposed some ObjC SPI that was never adopted, but I keep testing the C API that was to verify no regression.
2801         I also added some new API tests for the new behavior.
2802
2803         * Sources.txt:
2804         * WebCore.xcodeproj/project.pbxproj:
2805         * loader/CustomHeaderFields.cpp: Added.
2806         (WebCore::CustomHeaderFields::thirdPartyDomainsMatch const):
2807         * loader/CustomHeaderFields.h: Added.
2808         (WebCore::CustomHeaderFields::encode const):
2809         (WebCore::CustomHeaderFields::decode):
2810         * loader/DocumentLoader.cpp:
2811         (WebCore::DocumentLoader::setCustomHeaderFields): Deleted.
2812         * loader/DocumentLoader.h:
2813         (WebCore::DocumentLoader::setCustomHeaderFields):
2814         (WebCore::DocumentLoader::customHeaderFields const):
2815         (WebCore::DocumentLoader::customHeaderFields): Deleted.
2816         * loader/cache/CachedResourceLoader.cpp:
2817         (WebCore::CachedResourceLoader::requestResource):
2818
2819 2019-05-07  Andy Estes  <aestes@apple.com>
2820
2821         run-bindings-tests should test global scope constructor generation
2822         https://bugs.webkit.org/show_bug.cgi?id=197669
2823
2824         Reviewed by Alex Christensen.
2825
2826         For interfaces that are exposed on a global object, preprocess-idls.pl generates a partial
2827         interface for the global object defining attributes for the interfaces' constructors. Most
2828         interfaces don't specify a global object, so preprocess-idls.pl defaults to DOMWindow.
2829         Since there is no DOMWindow.idl test case, we never generate the code for exposed interface
2830         constructors when running bindings tests. This means that we can't test changes to how these
2831         constructors are generated.
2832
2833         To fix this, teach preprocess-idls.pl to treat 'TestGlobalObject' as the default global
2834         object when running bindings tests. This means that all exposed interface test cases will
2835         generate their constructors as part of JSTestGlobalObject (unless otherwise specified
2836         by the 'Exposed' extended attribute).
2837
2838         * bindings/scripts/preprocess-idls.pl:
2839         Added --testGlobalContextName and --testGlobalScopeConstructorsFile arguments for use by
2840         run-bindings-tests.
2841
2842         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
2843         Updated expected results.
2844
2845 2019-05-07  Youenn Fablet  <youenn@apple.com>
2846
2847         Video stream freeze on front camera orientation changing
2848         https://bugs.webkit.org/show_bug.cgi?id=197227
2849         <rdar://problem/50175498>
2850
2851         Reviewed by Eric Carlson.
2852
2853         Use m_currentRotationSessionAngle instead of m_currentRotation to create or not a new rotation session.
2854         Covered by updated test.
2855
2856         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.h:
2857         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.mm:
2858         (WebCore::RealtimeOutgoingVideoSourceCocoa::rotatePixelBuffer):
2859
2860 2019-05-07  Youenn Fablet  <youenn@apple.com>
2861
2862         getUserMedia framerate unusable under low light in iOS 12.2
2863         https://bugs.webkit.org/show_bug.cgi?id=196214
2864         <rdar://problem/49232193>
2865
2866         Reviewed by Geoffrey Garen.
2867
2868         When setting the frame rate, set it to the exact value instead of a range.
2869         Otherwise, the capture device might use the lowest frame rate according the light conditions
2870         for best picture quality which is not what is expected by most web pages.
2871
2872         Move frame rate range computation to closer where actually used.
2873         Since frame rate matching is fuzzy, add some checks in case the expected frame rate is slightly out of min/max range.
2874
2875         Manually tested on a real device.
2876
2877         * platform/mediastream/mac/AVVideoCaptureSource.mm:
2878         (WebCore::AVVideoCaptureSource::setSizeAndFrameRateWithPreset):
2879
2880 2019-05-07  Robin Morisset  <rmorisset@apple.com>
2881
2882         All prototypes should call didBecomePrototype()
2883         https://bugs.webkit.org/show_bug.cgi?id=196315
2884
2885         Reviewed by Saam Barati.
2886
2887         It was found by existing tests, with the new assert in JSC::Structure
2888
2889         * bindings/js/JSWindowProxy.cpp:
2890         (WebCore::JSWindowProxy::setWindow):
2891         * bindings/scripts/CodeGeneratorJS.pm:
2892         (GeneratePrototypeDeclaration):
2893         (GenerateConstructorHelperMethods):
2894
2895 2019-05-07  John Wilander  <wilander@apple.com>
2896
2897         Storage Access API: Make two changes requested by developers and complete refactoring and cleanup
2898         https://bugs.webkit.org/show_bug.cgi?id=197648
2899         <rdar://problem/50527493>
2900
2901         Reviewed by Chris Dumez.
2902
2903         Developers have requested two minor changes to the Storage Access API:
2904         - Only consume the user gesture when the user explicitly denies access.
2905         - Make document.hasStorageAccess() return true instead of false when the feature is off.
2906
2907         In addition to this, we have refactoring and cleanup to do. Namely:
2908         - Make use of WebCore::RegistrableDomain all the way.
2909         - Remove dead code in WebKit::NetworkProcess since the calls now go through NetworkConnectionToWebProcess.
2910         - Introduce boolean enums for state handling.
2911         - Break out the Storage Access API functionality into a supplement of WebCore::Document.
2912
2913         Reviewed by Chris Dumez.
2914
2915         Tests: http/tests/storageAccess/deny-with-prompt-does-not-preserve-gesture.html
2916                http/tests/storageAccess/deny-without-prompt-preserves-gesture.html
2917                http/tests/storageAccess/grant-with-prompt-preserves-gesture.html
2918                http/tests/storageAccess/has-storage-access-true-if-feature-off.html
2919
2920         * DerivedSources-input.xcfilelist:
2921         * DerivedSources-output.xcfilelist:
2922         * DerivedSources.make:
2923         * Headers.cmake:
2924         * Sources.txt:
2925         * WebCore.xcodeproj/project.pbxproj:
2926         * dom/Document.cpp:
2927         (WebCore::Document::hasStorageAccess): Deleted.
2928         (WebCore::Document::requestStorageAccess): Deleted.
2929         (WebCore::Document::enableTemporaryTimeUserGesture): Deleted.
2930         (WebCore::Document::consumeTemporaryTimeUserGesture): Deleted.
2931         (WebCore::Document::hasFrameSpecificStorageAccess const): Deleted.
2932         (WebCore::Document::setHasFrameSpecificStorageAccess): Deleted.
2933         * dom/Document.h:
2934         (WebCore::Document::setUserGrantsStorageAccessOverride): Deleted.
2935             All of this has been moved to the supplement WebCore::DocumentStorageAccess.
2936         * dom/Document.idl:
2937             The Storage Access API has been moved to DocumentStorageAccess.idl.
2938         * dom/DocumentStorageAccess.cpp: Added.
2939         (WebCore::DocumentStorageAccess::from):
2940         (WebCore::DocumentStorageAccess::supplementName):
2941         (WebCore::DocumentStorageAccess::hasStorageAccess):
2942         (WebCore::DocumentStorageAccess::requestStorageAccess):
2943         (WebCore::DocumentStorageAccess::enableTemporaryTimeUserGesture):
2944         (WebCore::DocumentStorageAccess::consumeTemporaryTimeUserGesture):
2945         (WebCore::DocumentStorageAccess::hasFrameSpecificStorageAccess const):
2946         (WebCore::DocumentStorageAccess::setHasFrameSpecificStorageAccess):
2947         * dom/DocumentStorageAccess.h: Added.
2948         * dom/DocumentStorageAccess.idl: Added.
2949         * page/ChromeClient.h:
2950         * testing/Internals.cpp:
2951         (WebCore::Internals::setUserGrantsStorageAccess): Deleted.
2952             This was dead code.
2953         * testing/Internals.h:
2954         * testing/Internals.idl:
2955
2956 2019-05-07  Antoine Quint  <graouts@apple.com>
2957
2958         [Pointer Events] isPrimary property of pointercancel events should match previous events for that pointer
2959         https://bugs.webkit.org/show_bug.cgi?id=197665
2960
2961         Reviewed by Dean Jackson.
2962
2963         The test at web-platform-tests/pointerevents/pointerevent_pointercancel_touch.html would fail early because one of the first assertions
2964         would check that isPrimary for a pointercancel event would match the isPrimary property of the previous pointer event dispatched for that
2965         pointer id. This prevented many further assertions from passing and also was the cause of flakiness for the next test since this test was
2966         ended early and the state of touches created using UIScriptController were not in a clean state.
2967
2968         We now track the isPrimary state for a given pointer using the CapturingData and use that value when dispatching a pointercancel event.
2969
2970         * dom/PointerEvent.cpp:
2971         (WebCore::PointerEvent::create):
2972         (WebCore::PointerEvent::PointerEvent):
2973         * dom/PointerEvent.h:
2974         * page/PointerCaptureController.cpp:
2975         (WebCore::PointerCaptureController::pointerEventWasDispatched):
2976         (WebCore::PointerCaptureController::cancelPointer):
2977         * page/PointerCaptureController.h:
2978
2979 2019-05-07  Ryan Haddad  <ryanhaddad@apple.com>
2980
2981         Unreviewed, rolling out r244900.
2982
2983         Caused media/track/track-cue-missing.html to fail on debug
2984         queues
2985
2986         Reverted changeset:
2987
2988         "Add logging for RenderLayer clip rects"
2989         https://bugs.webkit.org/show_bug.cgi?id=197547
2990         https://trac.webkit.org/changeset/244900
2991
2992 2019-05-07  Antti Koivisto  <antti@apple.com>
2993
2994         <body> with overflow:hidden CSS is scrollable on iOS
2995         https://bugs.webkit.org/show_bug.cgi?id=153852
2996         <rdar://problem/38715356>
2997
2998         Reviewed by Antoine Quint.
2999
3000         Tests: fast/scrolling/ios/body-overflow-hidden-frame.html
3001                fast/scrolling/ios/body-overflow-hidden.html
3002
3003         * page/scrolling/ScrollingTreeScrollingNode.h:
3004
3005 2019-05-07  Antoine Quint  <graouts@apple.com>
3006
3007         Mouse event simulation should be limited to the graphing calculator on Desmos.com
3008         https://bugs.webkit.org/show_bug.cgi?id=197652
3009         <rdar://problem/47068176>
3010
3011         Reviewed by Antti Koivisto.
3012
3013         * page/Quirks.cpp:
3014         (WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):
3015
3016 2019-05-06  James Savage  <james.savage@apple.com>
3017
3018         Improve coordination for creating UIWindow instances.
3019         https://bugs.webkit.org/show_bug.cgi?id=197578.
3020         <rdar://problem/50456965>.
3021
3022         Reviewed by Wenson Hsieh.
3023
3024         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
3025         (makeWindowFromView): Pull out window creation.
3026         (VideoFullscreenInterfaceAVKit::doSetup): Call new helper function.
3027
3028 2019-05-06  Tim Horton  <timothy_horton@apple.com>
3029
3030         _overrideViewportWithArguments does not work when called before loading
3031         https://bugs.webkit.org/show_bug.cgi?id=197638
3032         <rdar://problem/50505111>
3033
3034         Reviewed by Wenson Hsieh.
3035
3036         * dom/Document.cpp:
3037         (WebCore::Document::viewportArguments const):
3038         (WebCore::Document::updateViewportArguments):
3039         (WebCore::Document::setOverrideViewportArguments): Deleted.
3040         * dom/Document.h:
3041         (WebCore::Document::viewportArguments const): Deleted.
3042         * page/Page.cpp:
3043         (WebCore::Page::setOverrideViewportArguments):
3044         * page/Page.h:
3045         (WebCore::Page::overrideViewportArguments const):
3046         * page/ViewportConfiguration.cpp:
3047         (WebCore::ViewportConfiguration::setViewportArguments):
3048         Move overrideViewportArguments to Page, since it is view-global in the API.
3049
3050 2019-05-06  Chris Dumez  <cdumez@apple.com>
3051
3052         Add assertions to JSLazyEventListener to help catch the cause of a crash
3053         https://bugs.webkit.org/show_bug.cgi?id=197617
3054
3055         Reviewed by Alexey Proskuryakov.
3056
3057         Add assertions to JSLazyEventListener to help catch the cause of <rdar://problem/24314027>.
3058
3059         * bindings/js/JSLazyEventListener.cpp:
3060         (WebCore::JSLazyEventListener::checkValidityForEventTarget):
3061         * bindings/js/JSLazyEventListener.h:
3062         * dom/EventListener.h:
3063         (WebCore::EventListener::checkValidityForEventTarget):
3064         * dom/EventTarget.cpp:
3065         (WebCore::EventTarget::addEventListener):
3066         (WebCore::EventTarget::setAttributeEventListener):
3067         (WebCore::EventTarget::innerInvokeEventListeners):
3068
3069 2019-05-04  Per Arne Vollan  <pvollan@apple.com>
3070
3071         -[WKWebsiteDataStore removeDataOfTypes:forDataRecords:completionHandler:] doesn't delete _WKWebsiteDataTypeCredentials
3072         https://bugs.webkit.org/show_bug.cgi?id=197510
3073         <rdar://problem/50372338>
3074
3075         Reviewed by Alex Christensen.
3076
3077         This patch implements deletion of non persistent credentials for a set of origins. In order for this to work, fetching
3078         credentials from the credential storage needs to return a set of SecurityOriginData objects, instead of a set of origin
3079         strings. This is implemented by iterating over all the elements in the credential map, and creating a SecurityOriginData
3080         object for each credential based on the protection space.
3081
3082         API test: WKWebsiteDataStore.RemoveNonPersistentCredentials
3083
3084         * platform/network/CredentialStorage.cpp:
3085         (WebCore::CredentialStorage::removeCredentialsWithOrigin):
3086         (WebCore::CredentialStorage::originsWithCredentials const):
3087         * platform/network/CredentialStorage.h:
3088         (WebCore::CredentialStorage::originsWithCredentials const): Deleted.
3089
3090 2019-05-06  Keith Rollin  <krollin@apple.com>
3091
3092         Temporarily disable generate-xcfilelists
3093         https://bugs.webkit.org/show_bug.cgi?id=197619
3094         <rdar://problem/50507392>
3095
3096         Reviewed by Alex Christensen.
3097
3098         We need to perform a significant update to the generate-xcfilelist
3099         scripts. This work involves coordinated work with another facility. If
3100         the work does not occur in tandem, the build will be broken. To avoid
3101         this, disable the invoking of the scripts during the transition. The
3102         checking will be restored once the new scripts are in place.
3103
3104         No new tests -- no change in user-visible functionality.
3105
3106         * Scripts/check-xcfilelists.sh:
3107
3108 2019-05-06  Andres Gonzalez  <andresg_22@apple.com>
3109
3110         Hitpoint for link which spans two lines in web content is incorrect
3111         https://bugs.webkit.org/show_bug.cgi?id=197511
3112         <rdar://problem/49971483>
3113
3114         Reviewed by Chris Fleizach.
3115
3116         - Special case for links to return first char location as clickPoint instead of middle point of bounding rect.
3117         - Modified iOS ActivationPoint to use clickPoint. This way all code paths go through the same function.
3118         - Made boundsForRects to return content coordinates in all platforms. Adjusted all callers, directly or indirectly, appropriately.
3119
3120         Tests: accessibility/ios-simulator/links-activation.html
3121                accessibility/links-activation.html
3122
3123         * accessibility/AccessibilityRenderObject.cpp:
3124         (WebCore::AccessibilityRenderObject::clickPoint):
3125         (WebCore::AccessibilityRenderObject::boundsForRects):
3126         (WebCore::AccessibilityRenderObject::boundsForRects const): Deleted.
3127         * accessibility/AccessibilityRenderObject.h:
3128         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
3129         (-[WebAccessibilityObjectWrapper accessibilityActivationPoint]):
3130         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3131         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
3132
3133 2019-05-06  Jer Noble  <jer.noble@apple.com>
3134
3135         Adopt AVStreamDataParser.audiovisualMIMETypes
3136         https://bugs.webkit.org/show_bug.cgi?id=197581
3137         <rdar://problem/50458981>
3138
3139         Reviewed by Eric Carlson.
3140
3141         Add a new singleton class, AVStreamDataParserMIMETypeCache, and rename AVFoundationMIMETypeCache to the more precise
3142         AVAssetMIMETypeCache.  Update all the old AVFoundationMIMETypeCache with the new name.
3143
3144         * SourcesCocoa.txt:
3145         * WebCore.xcodeproj/project.pbxproj:
3146         * platform/graphics/avfoundation/objc/AVAssetMIMETypeCache.h: Renamed from Source/WebCore/platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.h.
3147         (WebCore::AVAssetMIMETypeCache::setCacheMIMETypesCallback):
3148         * platform/graphics/avfoundation/objc/AVAssetMIMETypeCache.mm: Renamed from Source/WebCore/platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.mm.
3149         (WebCore::AVAssetMIMETypeCache::singleton):
3150         (WebCore::AVAssetMIMETypeCache::setSupportedTypes):
3151         (WebCore::AVAssetMIMETypeCache::types):
3152         (WebCore::AVAssetMIMETypeCache::supportsContentType):
3153         (WebCore::AVAssetMIMETypeCache::canDecodeType):
3154         (WebCore::AVAssetMIMETypeCache::isAvailable const):
3155         (WebCore::AVAssetMIMETypeCache::loadMIMETypes):
3156         * platform/graphics/avfoundation/objc/AVStreamDataParserMIMETypeCache.h: Added.
3157         * platform/graphics/avfoundation/objc/AVStreamDataParserMIMETypeCache.mm: Added.
3158         (WebCore::AVStreamDataParserMIMETypeCache::singleton):
3159         (WebCore::AVStreamDataParserMIMETypeCache::types):
3160         (WebCore::AVStreamDataParserMIMETypeCache::supportsContentType):
3161         (WebCore::AVStreamDataParserMIMETypeCache::canDecodeType):
3162         (WebCore::AVStreamDataParserMIMETypeCache::isAvailable const):
3163         (WebCore::AVStreamDataParserMIMETypeCache::loadMIMETypes):
3164         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
3165         (WebCore::ImageDecoderAVFObjC::create):
3166         (WebCore::ImageDecoderAVFObjC::supportsMediaType):
3167         (WebCore::ImageDecoderAVFObjC::supportsContentType):
3168         (WebCore::ImageDecoderAVFObjC::canDecodeType):
3169         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3170         (WebCore::MediaPlayerPrivateAVFoundationObjC::registerMediaEngine):
3171         (WebCore::MediaPlayerPrivateAVFoundationObjC::getSupportedTypes):
3172         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsType):
3173         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsKeySystem):
3174         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
3175         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::registerMediaEngine):
3176         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::getSupportedTypes):
3177         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsType):
3178
3179 2019-05-06  Youenn Fablet  <youenn@apple.com>
3180
3181         WebAudio Node JS wrappers should not be collected if events can be fired
3182         https://bugs.webkit.org/show_bug.cgi?id=197533
3183
3184         Reviewed by Jer Noble.
3185
3186         Before the patch, some web audio nodes could fire event listeners, but were not protected from GC.
3187         Use CustomIsReachable to ensure theses nodes can be collected if:
3188         - their AudioContext is stopped (typically due to document being navigated away).
3189         - their AudioContext is closed.
3190         - nodes do not have event listeners.
3191
3192         Covered by WPT mediacapture-streams/MediaStreamTrack-MediaElement-disabled-audio-is-silence.https.html and
3193         WPT webaudio/the-audio-api/the-mediaelementaudiosourcenode-interface/mediaElementAudioSourceToScriptProcessorTest.html
3194         and web audio WebRTC tests.
3195         Specific newly added test: webaudio/webaudio-gc.html
3196
3197         * Modules/webaudio/AudioContext.h:
3198         (WebCore::AudioContext::isClosed const):
3199         * Modules/webaudio/AudioNode.idl:
3200         * Sources.txt:
3201         * WebCore.xcodeproj/project.pbxproj:
3202         * bindings/js/JSAudioNodeCustom.cpp: Added.
3203         (WebCore::JSAudioNodeOwner::isReachableFromOpaqueRoots):
3204
3205 2019-05-06  Daniel Bates  <dabates@apple.com>
3206
3207         Google Docs & Yahoo! Japan: Can’t compose characters with Chinese or Japanese keyboard
3208         https://bugs.webkit.org/show_bug.cgi?id=197474
3209         <rdar://problem/47219324>
3210
3211         Reviewed by Ryosuke Niwa.
3212
3213         Fix up some #if defs to compile more Mac code when building on iOS.
3214
3215         * dom/KeyboardEvent.cpp:
3216         (WebCore::KeyboardEvent::KeyboardEvent):
3217         * platform/PlatformKeyboardEvent.h:
3218         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
3219
3220 2019-05-06  Chris Dumez  <cdumez@apple.com>
3221
3222         Add assertions to CachedFrame to help figure out crash in CachedFrame constructor
3223         https://bugs.webkit.org/show_bug.cgi?id=197621
3224
3225         Reviewed by Geoffrey Garen.
3226
3227         Add release assertions to try and figure out who is sometimes detaching the document from its
3228         frame while constructing CachedFrames for its descendants.
3229
3230         * dom/Document.cpp:
3231         (WebCore::Document::detachFromFrame):
3232         * dom/Document.h:
3233         (WebCore::Document::setMayBeDetachedFromFrame):
3234         * history/CachedFrame.cpp:
3235         (WebCore::CachedFrame::CachedFrame):
3236
3237 2019-05-06  Zan Dobersek  <zdobersek@igalia.com>
3238
3239         [GLib] WebCore::MainThreadSharedTimer should use the appropriate GSource priority, name
3240         https://bugs.webkit.org/show_bug.cgi?id=197606
3241
3242         Reviewed by Carlos Garcia Campos.
3243
3244         * platform/MainThreadSharedTimer.cpp:
3245         (WebCore::MainThreadSharedTimer::MainThreadSharedTimer):
3246         Use the MainThreadSharedTimer GLib priority for this timer. The name is
3247         also adjusted accordingly.
3248
3249 2019-05-05  Wenson Hsieh  <wenson_hsieh@apple.com>
3250
3251         fast/attachment/attachment-folder-icon.html is an Image Only failure on recent macOS builds
3252         https://bugs.webkit.org/show_bug.cgi?id=197593
3253         <rdar://problem/50379267>
3254
3255         Reviewed by Tim Horton.
3256
3257         On recent versions of macOS, -[NSWorkspace iconForFileType:] returns the generic document icon for
3258         "public.directory". Instead of using this UTI to generate attachment icons for "multipart/x-folder" and
3259         "application/vnd.apple.folder", we should instead be using "public.folder", which has a folder icon. This fixes
3260         the existing test fast/attachment/attachment-folder-icon.html, which currently results in an image diff on these
3261         builds of macOS.
3262
3263         * rendering/RenderThemeMac.mm:
3264         (WebCore::iconForAttachment):
3265
3266 2019-05-04  Alex Christensen  <achristensen@webkit.org>
3267
3268         Revert r244953 and r244954 because they broke internal builds.
3269         https://bugs.webkit.org/show_bug.cgi?id=197534
3270
3271         * platform/ios/PlatformPasteboardIOS.mm:
3272         (WebCore::PlatformPasteboard::changeCount const):
3273         (WebCore::PlatformPasteboard::write):
3274
3275 2019-05-04  Alex Christensen  <achristensen@webkit.org>
3276
3277         Merge the three UIKitSPI.h files into a single one in PAL
3278         https://bugs.webkit.org/show_bug.cgi?id=197534
3279
3280         Reviewed by Darin Adler.
3281
3282         * platform/ios/PlatformPasteboardIOS.mm:
3283         (WebCore::PlatformPasteboard::changeCount const):
3284         (WebCore::PlatformPasteboard::write):
3285
3286 2019-05-04  Youenn Fablet  <youenn@apple.com>
3287
3288         Convert some RealtimeOutgoingVideoSourceCocoa logging to ERROR_LOG
3289         https://bugs.webkit.org/show_bug.cgi?id=197549
3290
3291         Reviewed by Eric Carlson.
3292
3293         No change of behavior.
3294
3295         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.mm:
3296         (WebCore::RealtimeOutgoingVideoSourceCocoa::rotatePixelBuffer):
3297
3298 2019-05-03  Simon Fraser  <simon.fraser@apple.com>
3299
3300         [macOS] Fix programmatic scrolling with async overflow scroll
3301         https://bugs.webkit.org/show_bug.cgi?id=197590
3302
3303         Reviewed by Sam Weinig.
3304         
3305         ScrollingTreeOverflowScrollingNodeMac needs to handle RequestedScrollPosition.
3306
3307         Tests: scrollingcoordinator/mac/programmatic-frame-scroll.html
3308                scrollingcoordinator/mac/programmatic-overflow-scroll.html
3309
3310         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
3311         (WebCore::ScrollingTreeOverflowScrollingNodeMac::commitStateAfterChildren):
3312
3313 2019-05-03  Zalan Bujtas  <zalan@apple.com>
3314
3315         [iOS] outlook.live.com: Compose email frame not fully visible and not scrollable
3316         https://bugs.webkit.org/show_bug.cgi?id=197573
3317         <rdar://problem/48008441>
3318
3319         Reviewed by Wenson Hsieh.
3320
3321         The outlook mail view's flex column setup produces a somewhat unfortunate layout at certain viewport widths.
3322         This patch addresses the issue by ensuring that we never fall into that range.
3323
3324         * page/Quirks.cpp:
3325         (WebCore::Quirks::shouldIgnoreShrinkToFitContent const):
3326         (WebCore::Quirks::overriddenViewportLayoutWidth const):
3327         * page/Quirks.h:
3328
3329 2019-05-02  Jiewen Tan  <jiewen_tan@apple.com>
3330
3331         [WebAuthN] A focused document should be required
3332         https://bugs.webkit.org/show_bug.cgi?id=197543
3333         <rdar://problem/50430989>
3334
3335         Reviewed by Brent Fulgham.
3336
3337         This patch adds a check to see if the invoking document is focused before
3338         calling into WebAuthN. This patch also removes some out-to-dated comments.
3339
3340         Test: http/wpt/webauthn/public-key-credential-unfocused-document.https.html
3341
3342         * Modules/credentialmanagement/CredentialsContainer.cpp:
3343         (WebCore::CredentialsContainer::get):
3344         (WebCore::CredentialsContainer::isCreate):
3345         * Modules/webauthn/AuthenticatorCoordinator.cpp:
3346         (WebCore::AuthenticatorCoordinator::create const):
3347         (WebCore::AuthenticatorCoordinator::discoverFromExternalSource const):
3348
3349 2019-05-03  Devin Rousso  <drousso@apple.com>
3350
3351         Web Inspector: DOM: rename "low power" to "display composited"
3352         https://bugs.webkit.org/show_bug.cgi?id=197296
3353
3354         Reviewed by Joseph Pecoraro.
3355
3356         Removed specific ChangeLog entries since it is almost entirely mechanical changes.
3357
3358         * inspector/agents/InspectorDOMAgent.h:
3359         * inspector/agents/InspectorDOMAgent.cpp:
3360
3361 2019-05-03  Daniel Bates  <dabates@apple.com>
3362
3363         Pass KeyboardEvent by reference in more places
3364         https://bugs.webkit.org/show_bug.cgi?id=197480
3365
3366         Reviewed by Wenson Hsieh.
3367
3368         * editing/Editor.cpp:
3369         (WebCore::Editor::handleKeyboardEvent):
3370         (WebCore::Editor::handleInputMethodKeydown):
3371         * loader/EmptyClients.cpp:
3372         * page/EditorClient.h:
3373
3374 2019-05-03  Chris Dumez  <cdumez@apple.com>
3375
3376         [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
3377         https://bugs.webkit.org/show_bug.cgi?id=197530
3378         <rdar://problem/50448285>
3379
3380         Reviewed by Geoffrey Garen.
3381
3382         The issue is that NavigatorBase::platform() was not thread safe but was called by both Navigator on
3383         the main thread and WorkerNavigator on worker threads.
3384
3385         No new tests, covered by existing tests.
3386
3387         * page/Navigator.cpp:
3388         (WebCore::Navigator::platform const):
3389         * page/Navigator.h:
3390
3391         * page/NavigatorBase.cpp:
3392         (WebCore::NavigatorBase::platform const):
3393         * page/NavigatorBase.h:
3394         Make NavigatorBase::platform() thread safe.
3395
3396         * platform/ios/Device.cpp:
3397         (WebCore::deviceName):
3398         * platform/ios/Device.h:
3399         Make WebCore::deviceName() thread safe.
3400
3401         * platform/ios/UserAgentIOS.mm:
3402         (WebCore::deviceNameForUserAgent):
3403         Cache value returned by WebCore::deviceName() for performance.
3404
3405 2019-05-03  Chris Dumez  <cdumez@apple.com>
3406
3407         Use WeakPtr for JSLazyEventListener::m_originalNode for safety
3408         https://bugs.webkit.org/show_bug.cgi?id=197576
3409         <rdar://problem/24314027>
3410
3411         Reviewed by Alex Christensen.
3412
3413         * bindings/js/JSLazyEventListener.cpp:
3414         (WebCore::JSLazyEventListener::JSLazyEventListener):
3415         (WebCore::JSLazyEventListener::create):
3416        &nbs