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