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