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