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