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