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