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