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