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