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