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