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