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