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