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