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