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