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