Non-composited negative z-order children should not trigger creation of a foreground...
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-06-01  Simon Fraser  <simon.fraser@apple.com>
2
3         Non-composited negative z-order children should not trigger creation of a foreground layer
4         https://bugs.webkit.org/show_bug.cgi?id=198455
5
6         Reviewed by Sam Weinig.
7
8         The existing code triggered creation of a foreground layer on RenderLayerBacking when
9         the negative z-order list was non-empty. This isn't necessary; we can paint the negative
10         z-order children just fine.
11
12         We only need a foreground layer when the negative z-order layers are composited or
13         have composited descendants.
14
15         This will reduce backing store memory use in some cases.
16
17         Test: compositing/layer-creation/composited-negative-z-subtree.html
18
19         * rendering/RenderLayerCompositor.cpp:
20         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
21         (WebCore::RenderLayerCompositor::updateBackingAndHierarchy):
22         (WebCore::RenderLayerCompositor::needsContentsCompositingLayer const):
23
24 2019-06-01  Andy Estes  <aestes@apple.com>
25
26         [Apple Pay] Every PaymentCoordinator client should explicitly decide whether they support unrestricted Apple Pay
27         https://bugs.webkit.org/show_bug.cgi?id=198449
28         <rdar://problem/51038583>
29
30         Reviewed by Wenson Hsieh.
31
32         Rather than having a default return value of true for
33         PaymentCoordinatorClient::supportsUnrestrictedApplePay, make it pure virtual to force each
34         subclass to implement an override and explicitly choose an appropriate return value.
35
36         The only two clients that did not explicitly override were the empty client and
37         WebKitLegacy's client, and Apple Pay was never enabled in those clients, so there is no
38         change in behavior.
39
40         * Modules/applepay/PaymentCoordinatorClient.h:
41         (WebCore::PaymentCoordinatorClient::isAlwaysOnLoggingAllowed const):
42         (WebCore::PaymentCoordinatorClient::supportsUnrestrictedApplePay const): Deleted.
43         * loader/EmptyClients.cpp:
44
45 2019-05-31  Youenn Fablet  <youenn@apple.com>
46
47         Add an option to mute audio capture automatically when page is not visible
48         https://bugs.webkit.org/show_bug.cgi?id=198307
49
50         Reviewed by Eric Carlson.
51
52         Reuse video capture mechanism for audio capture.
53         In case document gets in the background, interrupt the audio track if the audio factory requires it.
54         CoreAudioCaptureSourceIOS requires the audio source be interrupted if the app has not the right background mode.
55         It also allows interrupting the audio capture based on a runtime flag.
56
57         Add a runtime flag to control this.
58         Internals API is used to set it for test purposes, off by default.
59         For regular cases, the runtime flag is set through web preferences.
60
61         Test: platform/ios/mediastream/audio-muted-in-background-tab.html
62
63         * dom/Document.cpp:
64         (WebCore::Document::notifyMediaCaptureOfVisibilityChanged):
65         * page/RuntimeEnabledFeatures.h:
66         (WebCore::RuntimeEnabledFeatures::interruptAudioOnPageVisibilityChangeEnabled const):
67         (WebCore::RuntimeEnabledFeatures::setInterruptAudioOnPageVisibilityChangeEnabled):
68         * platform/mediastream/RealtimeMediaSourceCenter.cpp:
69         (WebCore::RealtimeMediaSourceCenter::RealtimeMediaSourceCenter):
70         (WebCore::RealtimeMediaSourceCenter::initializeShouldInterruptAudioOnPageVisibilityChange):
71         (WebCore::RealtimeMediaSourceCenter::setCapturePageState):
72         (WebCore::RealtimeMediaSourceCenter::visibilityDidChange):
73         * platform/mediastream/RealtimeMediaSourceCenter.h:
74         (WebCore::RealtimeMediaSourceCenter::shouldInterruptAudioOnPageVisibilityChange):
75         * platform/mediastream/RealtimeMediaSourceFactory.h:
76         (WebCore::AudioCaptureFactory::setAudioCapturePageState):
77         (WebCore::VideoCaptureFactory::setVideoCapturePageState):
78         * platform/mediastream/ios/CoreAudioCaptureSourceIOS.h:
79         * platform/mediastream/ios/CoreAudioCaptureSourceIOS.mm:
80         (WebCore::CoreAudioCaptureSourceFactory::setAudioCapturePageState):
81         (WebCore::CoreAudioCaptureSourceFactoryIOS::shouldInterruptAudioOnPageVisibilityChange):
82         * platform/mediastream/mac/CoreAudioCaptureSource.h:
83         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
84         (WebCore::RealtimeMediaSourceCenter::initializeShouldInterruptAudioOnPageVisibilityChange):
85         * testing/Internals.cpp:
86         (WebCore::Internals::resetToConsistentState):
87         (WebCore::Internals::setShouldInterruptAudioOnPageVisibilityChange):
88         * testing/Internals.h:
89         * testing/Internals.idl:
90
91 2019-05-31  Geoffrey Garen  <ggaren@apple.com>
92
93         Some WeakPtr typedef cleanup
94         https://bugs.webkit.org/show_bug.cgi?id=198431
95
96         Reviewed by Chris Dumez.
97
98         Use "using" instead of "typedef", since using is preferred in C++ for
99         better compatibility with templates.
100
101         * Modules/indexeddb/shared/InProcessIDBServer.h:
102         * html/HTMLMediaElement.h:
103         * platform/ScrollView.h:
104
105 2019-05-31  Andres Gonzalez  <andresg_22@apple.com>
106
107         Inserting a newline in contenteditable causes two characters to be added instead of one
108         https://bugs.webkit.org/show_bug.cgi?id=197894
109         <rdar://problems/49700998>
110
111         Reviewed by Chris Fleizach.
112
113         No new test is necessary since this is a comment change.
114
115         Removed radar reference from code.
116
117         * editing/Editing.cpp:
118         (WebCore::visiblePositionForIndexUsingCharacterIterator):
119
120 2019-05-31  Tim Horton  <timothy_horton@apple.com>
121
122         Optionally respect device management restrictions when loading from the network
123         https://bugs.webkit.org/show_bug.cgi?id=198318
124         <rdar://problem/44263806>
125
126         Reviewed by Alex Christensen.
127
128         * en.lproj/Localizable.strings:
129
130 2019-05-31  Simon Fraser  <simon.fraser@apple.com>
131
132         Move code that sets compositing paint phases into a single function
133         https://bugs.webkit.org/show_bug.cgi?id=198420
134
135         Reviewed by Zalan Bujtas.
136
137         To compute the correct paint phases for the various GraphicsLayers in a RenderLayerBacking,
138         we have to know which set of layers we've created (m_scrollContainerLayer, m_foregroundLayer etc).
139         So move the code that sets phases into a single function which is called when that
140         set of layers changes.
141
142         The test dumps paint phases for a stacking-context-composited scroller with a negative z-index child.
143
144         Also have GraphicsLayer::setPaintingPhase() trigger the necessary repaint when the paint phase changes.
145
146         Test: compositing/overflow/stacking-context-composited-scroller-with-foreground-paint-phases.html
147
148         * platform/graphics/GraphicsLayer.cpp:
149         (WebCore::GraphicsLayer::setPaintingPhase):
150         * platform/graphics/GraphicsLayer.h:
151         (WebCore::GraphicsLayer::setPaintingPhase): Deleted.
152         * rendering/RenderLayerBacking.cpp:
153         (WebCore::RenderLayerBacking::updateConfiguration):
154         (WebCore::RenderLayerBacking::updateForegroundLayer):
155         (WebCore::RenderLayerBacking::updateBackgroundLayer):
156         (WebCore::RenderLayerBacking::updateMaskingLayer):
157         (WebCore::RenderLayerBacking::updateScrollingLayers):
158         (WebCore::RenderLayerBacking::updatePaintingPhases):
159         (WebCore::RenderLayerBacking::paintingPhaseForPrimaryLayer const): Deleted.
160         * rendering/RenderLayerBacking.h:
161
162 2019-05-31  Saam Barati  <sbarati@apple.com>
163
164         [WHLSL] Make sure we properly emit code for "&*x"
165         https://bugs.webkit.org/show_bug.cgi?id=198198
166
167         Reviewed by Myles C. Maxfield.
168
169         I ran into this when trying to test zero-filling code, so let's just fix it.
170         The issue is that the property resolver ends up emitting code that looks like
171         "&*x". The semantics of this are such that it should result in just x.
172         However, we emitted Metal code in such a way where we'd end up with a pointer
173         to a temporary value. To fix this, DereferenceExpression will emit code that results
174         in a reference type. Then, MakePointerExpression will correctly return the
175         pointer backing that reference type.
176         
177         Because of this, we also no longer need to pattern match the lhs of assignment
178         expressions since we will now be assigning to a reference type.
179
180         Test: webgpu/whlsl-store-to-property-updates-properly.html
181
182         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
183         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::visit):
184
185 2019-05-31  Simon Fraser  <simon.fraser@apple.com>
186
187         [Async overflow scrolling] Flashes of missing layer backing store when scrolling an overflow
188         https://bugs.webkit.org/show_bug.cgi?id=198363
189
190         Reviewed by Tim Horton.
191
192         When the contents of an overflow:scroll did not use a tiled backing layer, GraphicsLayerCA::adjustCoverageRect()
193         would do no coverage rect expansion for scrolling, which meant that backing store attachment for
194         descendant layers would just use the visible rect from their scrolling ancestor which made it easy
195         to scroll into view a layer whose backing store was not yet attached.
196         
197         Since this only affects non-tiled layers, re-use the generic TileController::adjustTileCoverageRect()
198         code by moving it down to GraphicsLayer, and call it for a scrolled contents layer which does not
199         have tiled backing.
200         
201         Tested by fast/scrolling/ios/reconcile-layer-position-recursive.html
202
203         * platform/graphics/GraphicsLayer.cpp:
204         (WebCore::GraphicsLayer::adjustCoverageRectForMovement):
205         * platform/graphics/GraphicsLayer.h:
206         * platform/graphics/ca/GraphicsLayerCA.cpp:
207         (WebCore::GraphicsLayerCA::adjustCoverageRect const):
208         * platform/graphics/ca/TileController.cpp:
209         (WebCore::TileController::adjustTileCoverageRect):
210
211 2019-05-31  Geoffrey Garen  <ggaren@apple.com>
212
213         Some WeakPtr cleanup
214         https://bugs.webkit.org/show_bug.cgi?id=198390
215
216         Reviewed by Chris Dumez.
217
218         * Modules/indexeddb/shared/InProcessIDBServer.cpp:
219         (WebCore::storageQuotaManagerGetter): Dereference the weak pointer
220         directly instead of using a weak pointer to guard a raw pointer. It's
221         safer and more idiomatic to use weak pointers directly.
222
223         * Modules/indexeddb/shared/InProcessIDBServer.h: Use our base clase
224         weakPtrFactory() definition instead of writing our own. Declare
225         WeakValueType so we can dereference the weak pointer we create (above).
226
227 2019-05-31  Zalan Bujtas  <zalan@apple.com>
228
229         [LFC][IFC] InlineFormattingContext::LineLayout::processInlineItemsForLine should create and destroy Line.
230         https://bugs.webkit.org/show_bug.cgi?id=198419
231         <rdar://problem/51300837>
232
233         Reviewed by Antti Koivisto.
234
235         This is in preparation for using "createInlineRunsForLine" logic when computing preferred width.
236         1. Line object is now constructed and destroyed in processInlineItemsForLine (caller does not need to know about Line).
237         2. processInlineItemsForLine returns a Line::Content instance.
238
239         * layout/inlineformatting/InlineFormattingContext.h:
240         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
241         (WebCore::Layout::InlineFormattingContext::LineLayout::LineInput::LineInput):
242         (WebCore::Layout::constructLine):
243         (WebCore::Layout::InlineFormattingContext::LineLayout::processInlineItemsForLine const):
244         (WebCore::Layout::InlineFormattingContext::LineLayout::layout const):
245         (WebCore::Layout::InlineFormattingContext::LineLayout::createDisplayRuns const):
246         (WebCore::Layout::InlineFormattingContext::LineLayout::createLine const): Deleted.
247         (WebCore::Layout::InlineFormattingContext::LineLayout::createInlineRunsForLine const): Deleted.
248         (WebCore::Layout::InlineFormattingContext::LineLayout::processInlineRuns const): Deleted.
249
250 2019-05-31  Don Olmstead  <don.olmstead@sony.com>
251
252         [CMake] Add WebKit::WTF target
253         https://bugs.webkit.org/show_bug.cgi?id=198400
254
255         Reviewed by Konstantin Tokarev.
256
257         Use the WebKit::WTF target.
258
259         * PlatformWin.cmake:
260
261 2019-05-31  Joonghun Park  <jh718.park@samsung.com>
262
263         Always min-width should win over max-width.
264         https://bugs.webkit.org/show_bug.cgi?id=198032
265
266         Reviewed by Darin Adler.
267
268         In the spec, https://www.w3.org/TR/CSS21/visudet.html#min-max-widths,
269         the following algorithm describes how the two properties influence
270         the used value of the 'width' property.
271
272         1. The tentative used width is calculated (without 'min-width' and 'max-width')
273         following the rules under "Calculating widths and margins" above.
274         2. If the tentative used width is greater than 'max-width',
275         the rules above are applied again, but this time using the computed value of 'max-width'
276         as the computed value for 'width'.
277         3. If the resulting width is smaller than 'min-width', the rules above are applied again,
278         but this time using the value of 'min-width' as the computed value for 'width'.
279
280         * rendering/RenderBlock.cpp:
281         (WebCore::RenderBlock::computePreferredLogicalWidths):
282
283 2019-05-31  Ryan Haddad  <ryanhaddad@apple.com>
284
285         Unreviewed, rolling out r245946.
286
287         Breaks the watchOS build.
288
289         Reverted changeset:
290
291         "Add an option to mute audio capture automatically when page
292         is not visible"
293         https://bugs.webkit.org/show_bug.cgi?id=198307
294         https://trac.webkit.org/changeset/245946
295
296 2019-05-31  Zalan Bujtas  <zalan@apple.com>
297
298         [LFC[IFC] Do not reuse the same Line object.
299         https://bugs.webkit.org/show_bug.cgi?id=198366
300         <rdar://problem/51250279>
301
302         Reviewed by Antti Koivisto.
303
304         This is in preparation for constructing Line inside createInlineRunsForLine and return Line::Content. 
305
306         * layout/inlineformatting/InlineFormattingContext.h:
307         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
308         (WebCore::Layout::InlineFormattingContext::LineLayout::createLine const):
309         (WebCore::Layout::InlineFormattingContext::LineLayout::layout const):
310         (WebCore::Layout::InlineFormattingContext::LineLayout::processInlineRuns const):
311         (WebCore::Layout::InlineFormattingContext::LineLayout::initializeLine const): Deleted.
312         * layout/inlineformatting/InlineLine.cpp:
313         (WebCore::Layout::Line::Line):
314         (WebCore::Layout::m_lineLogicalWidth):
315         (WebCore::Layout::Line::close):
316         (WebCore::Layout::Line::moveLogicalLeft):
317         (WebCore::Layout::Line::appendNonBreakableSpace):
318         (WebCore::Layout::Line::appendTextContent):
319         (WebCore::Layout::Line::appendNonReplacedInlineBox):
320         (WebCore::Layout::Line::appendHardLineBreak):
321         (WebCore::Layout::Line::reset): Deleted.
322         * layout/inlineformatting/InlineLine.h:
323         (WebCore::Layout::Line::hasContent const):
324
325 2019-05-31  Zalan Bujtas  <zalan@apple.com>
326
327         [LFC][IFC] Move final runs to a dedicated class (Line::Content)
328         https://bugs.webkit.org/show_bug.cgi?id=198360
329         <rdar://problem/51247717>
330
331         Reviewed by Antti Koivisto.
332
333         It decouples the line and the final line content. So when we process the runs after closing the line,
334         LineContent should be able to answer all the content and geometry related questions.
335         This is also in preparation for
336         transfering the ownership of the line content when calling Line::close(). 
337
338         * WebCore.xcodeproj/project.pbxproj:
339         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
340         (WebCore::Layout::InlineFormattingContext::LineLayout::processInlineRuns const):
341         * layout/inlineformatting/InlineLine.cpp:
342         (WebCore::Layout::Line::Content::isVisuallyEmpty const):
343         (WebCore::Layout::Line::Content::Run::Run):
344         (WebCore::Layout::Line::reset):
345         (WebCore::Layout::Line::close):
346         (WebCore::Layout::Line::moveLogicalLeft):
347         (WebCore::Layout::Line::appendNonBreakableSpace):
348         (WebCore::Layout::Line::appendTextContent):
349         (WebCore::Layout::Line::appendNonReplacedInlineBox):
350         (WebCore::Layout::Line::appendHardLineBreak):
351         (WebCore::Layout::Line::LineItem::LineItem): Deleted.
352         (WebCore::Layout::Line::hasContent const): Deleted.
353         * layout/inlineformatting/InlineLine.h:
354         (WebCore::Layout::Line::Content::runs const):
355         (WebCore::Layout::Line::Content::isEmpty const):
356         (WebCore::Layout::Line::Content::logicalTop const):
357         (WebCore::Layout::Line::Content::logicalLeft const):
358         (WebCore::Layout::Line::Content::logicalRight const):
359         (WebCore::Layout::Line::Content::logicalBottom const):
360         (WebCore::Layout::Line::Content::logicalWidth const):
361         (WebCore::Layout::Line::Content::logicalHeight const):
362         (WebCore::Layout::Line::Content::setLogicalRect):
363         (WebCore::Layout::Line::Content::runs):
364         (WebCore::Layout::Line::hasContent const):
365         (WebCore::Layout::Line::availableWidth const):
366         (WebCore::Layout::Line::contentLogicalRight const):
367         (WebCore::Layout::Line::logicalTop const):
368         (WebCore::Layout::Line::logicalBottom const):
369         (WebCore::Layout::Line::logicalLeft const):
370         (WebCore::Layout::Line::logicalRight const):
371         (WebCore::Layout::Line::logicalWidth const):
372         (WebCore::Layout::Line::logicalHeight const):
373         (WebCore::Layout::Line::contentLogicalWidth const):
374         * page/FrameViewLayoutContext.cpp:
375         (WebCore::layoutUsingFormattingContext):
376
377 2019-05-31  Joonghun Park  <jh718.park@samsung.com>
378
379         Unreviewed. Fix typo of |ComputedStyleExtractor::valueForPropertyInStyle|
380         to follow camel case function naming style.
381
382         No behavioral changes.
383
384         * animation/KeyframeEffect.cpp:
385         (WebCore::KeyframeEffect::getKeyframes):
386         * css/CSSComputedStyleDeclaration.cpp:
387         (WebCore::ComputedStyleExtractor::propertyValue):
388         (WebCore::ComputedStyleExtractor::valueForPropertyInStyle):
389         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle): Deleted.
390         * css/CSSComputedStyleDeclaration.h:
391         * rendering/style/RenderStyle.cpp:
392         (WebCore::changedCustomPaintWatchedProperty):
393
394 2019-05-31  Ali Juma  <ajuma@chromium.org>
395
396         REGRESSION (r245396): Page load time performance regression
397         https://bugs.webkit.org/show_bug.cgi?id=198382
398
399         Reviewed by Simon Fraser.
400
401         Delay the scheduling of a rendering update by 500ms when a new
402         IntersectionObserver target is added during page load. This addresses
403         a page load time regression from r245396, which immediately scheduled a
404         rendering update when a target is added. Note that even with this change,
405         if anything else triggers a rendering update before the 500ms delay expires,
406         intersection observations will be updated during that rendering update.
407
408         Covered by intersection-observer/initial-observation.html 
409
410         * dom/Document.cpp:
411         (WebCore::Document::updateIntersectionObservations):
412         (WebCore::Document::scheduleInitialIntersectionObservationUpdate):
413         * dom/Document.h:
414         * page/IntersectionObserver.cpp:
415         (WebCore::IntersectionObserver::observe):
416
417 2019-05-30  Zan Dobersek  <zdobersek@igalia.com>
418
419         Unreviewed. Suppress -Wunused-variable warnings for the unused static
420         mousePointerID variable by making it a constexpr.
421
422         * platform/PointerID.h:
423
424 2019-05-30  Simon Fraser  <simon.fraser@apple.com>
425
426         Use an OptionSet<> for GraphicsLayerPaintingPhase
427         https://bugs.webkit.org/show_bug.cgi?id=198404
428
429         Reviewed by Tim Horton.
430
431         Replace GraphicsLayerPaintingPhase with OptionSet<GraphicsLayerPaintingPhase>.
432
433         No behavior change.
434
435         * page/PageOverlayController.cpp:
436         (WebCore::PageOverlayController::setPageOverlayNeedsDisplay):
437         (WebCore::PageOverlayController::paintContents):
438         (WebCore::PageOverlayController::notifyFlushRequired):
439         * page/PageOverlayController.h:
440         * page/linux/ResourceUsageOverlayLinux.cpp:
441         * page/mac/ServicesOverlayController.h:
442         * page/mac/ServicesOverlayController.mm:
443         (WebCore::ServicesOverlayController::Highlight::paintContents):
444         * platform/graphics/GraphicsLayer.cpp:
445         (WebCore::GraphicsLayer::dumpProperties const):
446         * platform/graphics/GraphicsLayer.h:
447         (WebCore::GraphicsLayer::paintingPhase const):
448         (WebCore::GraphicsLayer::setPaintingPhase):
449         * platform/graphics/GraphicsLayerClient.h:
450         (WebCore::GraphicsLayerClient::paintContents):
451         * rendering/RenderLayerBacking.cpp:
452         (WebCore::RenderLayerBacking::updateForegroundLayer):
453         (WebCore::RenderLayerBacking::updateBackgroundLayer):
454         (WebCore::RenderLayerBacking::updateMaskingLayer):
455         (WebCore::RenderLayerBacking::updateChildClippingStrategy):
456         (WebCore::RenderLayerBacking::updateScrollingLayers):
457         (WebCore::RenderLayerBacking::paintingPhaseForPrimaryLayer const):
458         (WebCore::RenderLayerBacking::paintIntoLayer):
459         (WebCore::RenderLayerBacking::paintContents):
460         * rendering/RenderLayerBacking.h:
461         * rendering/RenderLayerCompositor.cpp:
462         (WebCore::RenderLayerCompositor::paintContents):
463         * rendering/RenderLayerCompositor.h:
464
465 2019-05-30  Youenn Fablet  <youenn@apple.com>
466
467         Fix AVVideoCaptureSource::setFrameRateWithPreset logging
468         https://bugs.webkit.org/show_bug.cgi?id=198392
469
470         Reviewed by Eric Carlson.
471
472         Move logging from setFrameRateWithPreset to setSessionSizeAndFrameRate which does the actual job.
473         This ensures to not log in case of preset being null.
474         No change of behavior.
475
476         * platform/mediastream/mac/AVVideoCaptureSource.mm:
477         (WebCore::AVVideoCaptureSource::setFrameRateWithPreset):
478         (WebCore::AVVideoCaptureSource::setSessionSizeAndFrameRate):
479
480 2019-05-30  Jer Noble  <jer.noble@apple.com>
481
482         Video playback in Safari should continue when CarPlay is plugged in
483         https://bugs.webkit.org/show_bug.cgi?id=198345
484         <rdar://problem/45505750>
485
486         Reviewed by Eric Carlson.
487
488         Test: media/video-isplayingtoautomotiveheadunit.html
489
490         * html/HTMLMediaElement.cpp:
491         (WebCore::HTMLMediaElement::shouldOverrideBackgroundPlaybackRestriction const):
492         * platform/audio/PlatformMediaSessionManager.cpp:
493         (WebCore::PlatformMediaSessionManager::setIsPlayingToAutomotiveHeadUnit):
494         * platform/audio/PlatformMediaSessionManager.h:
495         (WebCore::PlatformMediaSessionManager::isPlayingToAutomotiveHeadUnit const):
496         * platform/audio/ios/MediaSessionManagerIOS.h:
497         * platform/audio/ios/MediaSessionManagerIOS.mm:
498         (WebCore::MediaSessionManageriOS::MediaSessionManageriOS):
499         (WebCore::MediaSessionManageriOS::carPlayServerDied):
500         (WebCore::MediaSessionManageriOS::updateCarPlayIsConnected):
501         (-[WebMediaSessionHelper initWithCallback:]):
502         (-[WebMediaSessionHelper startMonitoringAirPlayRoutes]):
503         (-[WebMediaSessionHelper interruption:]):
504         (-[WebMediaSessionHelper applicationWillEnterForeground:]):
505         (-[WebMediaSessionHelper applicationDidBecomeActive:]):
506         (-[WebMediaSessionHelper applicationWillResignActive:]):
507         (-[WebMediaSessionHelper wirelessRoutesAvailableDidChange:]):
508         (-[WebMediaSessionHelper applicationDidEnterBackground:]):
509         (-[WebMediaSessionHelper carPlayServerDied:]):
510         (-[WebMediaSessionHelper carPlayIsConnectedDidChange:]):
511         * testing/Internals.cpp:
512         (WebCore::Internals::resetToConsistentState):
513         (WebCore::Internals::setIsPlayingToAutomotiveHeadUnit):
514         * testing/Internals.h:
515         * testing/Internals.idl:
516
517 2019-05-30  Youenn Fablet  <youenn@apple.com>
518
519         Add an option to mute audio capture automatically when page is not visible
520         https://bugs.webkit.org/show_bug.cgi?id=198307
521
522         Reviewed by Eric Carlson.
523
524         Reuse video capture mechanism for audio capture.
525         In case document gets in the background, interrupt the audio track if the audio factory requires it.
526         CoreAudioCaptureSourceIOS requires the audio source be interrupted if the app has not the right background mode.
527         It also allows interrupting the audio capture based on a runtime flag.
528
529         Add a runtime flag to control this.
530         Internals API is used to set it for test purposes, off by default.
531         For regular cases, the runtime flag is set through web preferences.
532
533         Test: platform/ios/mediastream/audio-muted-in-background-tab.html
534
535         * dom/Document.cpp:
536         (WebCore::Document::notifyMediaCaptureOfVisibilityChanged):
537         * page/RuntimeEnabledFeatures.h:
538         (WebCore::RuntimeEnabledFeatures::interruptAudioOnPageVisibilityChangeEnabled const):
539         (WebCore::RuntimeEnabledFeatures::setInterruptAudioOnPageVisibilityChangeEnabled):
540         * platform/mediastream/RealtimeMediaSourceCenter.cpp:
541         (WebCore::RealtimeMediaSourceCenter::RealtimeMediaSourceCenter):
542         (WebCore::RealtimeMediaSourceCenter::initializeShouldInterruptAudioOnPageVisibilityChange):
543         (WebCore::RealtimeMediaSourceCenter::setCapturePageState):
544         (WebCore::RealtimeMediaSourceCenter::visibilityDidChange):
545         * platform/mediastream/RealtimeMediaSourceCenter.h:
546         (WebCore::RealtimeMediaSourceCenter::shouldInterruptAudioOnPageVisibilityChange):
547         * platform/mediastream/RealtimeMediaSourceFactory.h:
548         (WebCore::AudioCaptureFactory::setAudioCapturePageState):
549         (WebCore::VideoCaptureFactory::setVideoCapturePageState):
550         * platform/mediastream/ios/CoreAudioCaptureSourceIOS.h:
551         * platform/mediastream/ios/CoreAudioCaptureSourceIOS.mm:
552         (WebCore::CoreAudioCaptureSourceFactory::setAudioCapturePageState):
553         (WebCore::CoreAudioCaptureSourceFactoryIOS::shouldInterruptAudioOnPageVisibilityChange):
554         * platform/mediastream/mac/CoreAudioCaptureSource.h:
555         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
556         (WebCore::RealtimeMediaSourceCenter::initializeShouldInterruptAudioOnPageVisibilityChange):
557         * testing/Internals.cpp:
558         (WebCore::Internals::resetToConsistentState):
559         (WebCore::Internals::setShouldInterruptAudioOnPageVisibilityChange):
560         * testing/Internals.h:
561         * testing/Internals.idl:
562
563 2019-05-30  Saam Barati  <sbarati@apple.com>
564
565         [WHLSL] Enforce variable lifetimes
566         https://bugs.webkit.org/show_bug.cgi?id=195794
567         <rdar://problem/50746293>
568
569         Reviewed by Myles C. Maxfield.
570
571         In WHLSL, each variable has global lifetime. So returning a pointer to a
572         local variable is a legitimate and well specified thing to do. Each local
573         variable has a unique place in memory. So, for example:
574         
575         ```
576         thread int* ptr() { int local; return &local; }
577         thread int* ptrPtr() { return ptr(); }
578         ```
579         
580         In the above program, ptr() must always return the same value
581         as ptrPtr(). So, the following would print "42":
582         ```
583         thread int* p = ptrPtr();
584         *ptr() = 42;
585         print(*p);
586         ```
587         
588         To implement these semantics, this patch introduces a new pass which does the
589         following transformations:
590         - It notes every variable whose address is taken in the program.
591         - Each such variable gets defined as a field in a struct.
592         - Each function which is an entry point defines this struct.
593         - Each non entry point takes a pointer to this struct as its final parameter.
594         - Each call to a non-native function is rewritten to pass a pointer to the
595           struct as the last call argument.
596         - Each variable reference to "x", where "x" ends up in the struct, is
597           modified to instead be "struct->x". We store to "struct->x" after declaring
598           "x". If "x" is a function parameter, we store to "struct->x" as the first
599           thing we do in the function body.
600
601         Tests: webgpu/whlsl-ensure-proper-variable-lifetime-2.html
602                webgpu/whlsl-ensure-proper-variable-lifetime-3.html
603                webgpu/whlsl-ensure-proper-variable-lifetime.html
604                webgpu/whlsl-return-local-variable.html
605
606         * Modules/webgpu/WHLSL/AST/WHLSLAST.h:
607         * Modules/webgpu/WHLSL/AST/WHLSLExpression.h:
608         (WebCore::WHLSL::AST::Expression::Expression):
609         (WebCore::WHLSL::AST::Expression::isGlobalVariableReference const):
610         (WebCore::WHLSL::AST::Expression::origin const): Deleted.
611         * Modules/webgpu/WHLSL/AST/WHLSLFunctionDeclaration.h:
612         (WebCore::WHLSL::AST::FunctionDeclaration::origin):
613         * Modules/webgpu/WHLSL/AST/WHLSLGlobalVariableReference.h: Added.
614         (WebCore::WHLSL::AST::GlobalVariableReference::GlobalVariableReference):
615         (WebCore::WHLSL::AST::GlobalVariableReference::structField):
616         (WebCore::WHLSL::AST::GlobalVariableReference::base):
617         * Modules/webgpu/WHLSL/AST/WHLSLStatement.h:
618         (WebCore::WHLSL::AST::Statement::Statement):
619         (WebCore::WHLSL::AST::Statement::isStatementList const):
620         (WebCore::WHLSL::AST::Statement::isWhileLoop const):
621         * Modules/webgpu/WHLSL/AST/WHLSLStatementList.h: Added.
622         (WebCore::WHLSL::AST::StatementList::StatementList):
623         (WebCore::WHLSL::AST::StatementList::statements):
624         * Modules/webgpu/WHLSL/AST/WHLSLValue.h:
625         (WebCore::WHLSL::AST::Value::Value):
626         (WebCore::WHLSL::AST::Value::origin const):
627         * Modules/webgpu/WHLSL/AST/WHLSLVariableDeclaration.h:
628         (WebCore::WHLSL::AST::VariableDeclaration::VariableDeclaration):
629         (WebCore::WHLSL::AST::VariableDeclaration::takeInitializer):
630         (WebCore::WHLSL::AST::VariableDeclaration::origin const): Deleted.
631         * Modules/webgpu/WHLSL/AST/WHLSLVariableReference.h:
632         (WebCore::WHLSL::AST::VariableReference::wrap):
633         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
634         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::visit):
635         * Modules/webgpu/WHLSL/WHLSLASTDumper.cpp:
636         (WebCore::WHLSL::ASTDumper::visit):
637         * Modules/webgpu/WHLSL/WHLSLASTDumper.h:
638         (WebCore::WHLSL::dumpASTNode):
639         (WebCore::WHLSL::dumpAST):
640         (WebCore::WHLSL::toString): Deleted.
641         * Modules/webgpu/WHLSL/WHLSLPrepare.cpp:
642         (WebCore::WHLSL::prepareShared):
643         * Modules/webgpu/WHLSL/WHLSLPreserveVariableLifetimes.cpp: Added.
644         (WebCore::WHLSL::EscapedVariableCollector::takeEscapedVariables):
645         (WebCore::WHLSL::anonymousToken):
646         (WebCore::WHLSL::PreserveLifetimes::PreserveLifetimes):
647         (WebCore::WHLSL::PreserveLifetimes::makeStructVariableReference):
648         (WebCore::WHLSL::preserveVariableLifetimes):
649         * Modules/webgpu/WHLSL/WHLSLPreserveVariableLifetimes.h: Added.
650         * Modules/webgpu/WHLSL/WHLSLVisitor.cpp:
651         (WebCore::WHLSL::Visitor::visit):
652         * Modules/webgpu/WHLSL/WHLSLVisitor.h:
653         * Sources.txt:
654         * WebCore.xcodeproj/project.pbxproj:
655
656 2019-05-30  Ryan Haddad  <ryanhaddad@apple.com>
657
658         Unreviewed, rolling out r245890, 245887.
659
660         Breaks internal builds.
661
662         Reverted changeset:
663         "Video playback in Safari should continue when CarPlay is plugged in"
664         https://bugs.webkit.org/show_bug.cgi?id=198345
665         https://trac.webkit.org/changeset/245887/webkit
666
667 2019-05-30  Dean Jackson  <dino@apple.com>
668
669         Media documents on iPad are too wide in split screen
670         https://bugs.webkit.org/show_bug.cgi?id=198405
671         <rdar://problem/50974548>
672
673         Reviewed by Tim Horton.
674
675         Media documents on iPad had a minimum width of 700px. This
676         was fine in full-screen, but didn't work when then window
677         was smaller, such as split screen or a link preview.
678
679         Tests: media/modern-media-controls/media-documents/media-document-video-ipad-sizing.html
680                media/modern-media-controls/media-documents/media-document-video-iphone-sizing.html
681
682         * Modules/modern-media-controls/controls/media-document.css: Add a media query to
683         detect small windows.
684         * Modules/modern-media-controls/media/media-document-controller.js:
685
686 2019-05-30  Andres Gonzalez  <andresg_22@apple.com>
687
688         Inserting a newline in contenteditable causes two characters to be added instead of one
689         https://bugs.webkit.org/show_bug.cgi?id=197894
690         <rdar://problem/49700998>
691
692         Reviewed by Wenson Hsieh and Chris Fleizach.
693
694         There were two issues with inserting a newline character at the end of 
695         a line that caused problems for accessibility:
696         - the first '\n' inserted after text would result in two line breaks 
697         inserted instead of one. createFragmentFromText in markup.cpp was 
698         splitting the string "\n" into two empty strings and creating a <div> 
699         and a <br> respectively. Then the emission code would emit a '\n' for 
700         the empty div and another for the <br>.
701         - the second problem is a consequence of <rdar://problem/5192593> and 
702         the workaround is the change in editing.cpp in the function
703         visiblePositionForIndexUsingCharacterIterator, similar to what is done
704         in VisibleUnits.cpp for nextBoundary.
705         The rest of the changes in this patch are accessibility changes to 
706         execute the layout tests.
707
708         Tests: accessibility/ios-simulator/set-selected-text-range-after-newline.html
709                accessibility/set-selected-text-range-after-newline.html
710
711         * accessibility/AccessibilityRenderObject.cpp:
712         (WebCore::AccessibilityRenderObject::setSelectedTextRange):
713         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
714         (-[WebAccessibilityObjectWrapper stringForRange:]):
715         (-[WebAccessibilityObjectWrapper _accessibilitySelectedTextRange]):
716         (-[WebAccessibilityObjectWrapper accessibilityReplaceRange:withText:]):
717         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
718         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
719         * editing/Editing.cpp:
720         (WebCore::visiblePositionForIndexUsingCharacterIterator):
721         * editing/markup.cpp:
722         (WebCore::createFragmentFromText):
723
724 2019-05-30  Justin Fan  <justin_fan@apple.com>
725
726         [Web GPU] Vertex Buffers/Input State API updates
727         https://bugs.webkit.org/show_bug.cgi?id=194258
728         <rdar://problem/47806127>
729
730         Reviewed by Myles C. Maxfield.
731
732         The vertex buffer attributes model for GPURenderPipelines in the WebGPU API has been updated.
733         Update our implementation to match.
734
735         No new tests. Existing tests updated to match new behavior.
736
737         * CMakeLists.txt:
738         * DerivedSources-input.xcfilelist:
739         * DerivedSources-output.xcfilelist:
740         * DerivedSources.make:
741         * Modules/webgpu/GPUVertexAttributeDescriptor.idl:
742         * Modules/webgpu/GPUVertexBufferDescriptor.idl: Renamed from Source/WebCore/Modules/webgpu/GPUInputStateDescriptor.idl.
743         * Modules/webgpu/GPUVertexInputDescriptor.idl:
744         * Modules/webgpu/WebGPURenderPipelineDescriptor.idl:
745         * Sources.txt:
746         * WebCore.xcodeproj/project.pbxproj:
747         * platform/graphics/gpu/GPURenderPipelineDescriptor.h:
748         * platform/graphics/gpu/GPUVertexAttributeDescriptor.h:
749         * platform/graphics/gpu/GPUVertexBufferDescriptor.h: Renamed from Source/WebCore/platform/graphics/gpu/GPUInputStateDescriptor.h.
750         * platform/graphics/gpu/GPUVertexInputDescriptor.h:
751         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
752         (WebCore::trySetVertexInput): Added. Populate Metal and WHLSL pipeline descriptors with vertex attribute metadata.
753         (WebCore::trySetColorStates): Added. Populate Metal and WHLSL pipeline descriptors with color attachment metadata.
754         (WebCore::convertLayout): Moved.
755         (WebCore::trySetMetalFunctions): Moved.
756         (WebCore::trySetFunctions): Added. WHLSL compilation to Metal SL happens here, then MSL functions are set on pipeline descriptor.
757         (WebCore::convertRenderPipelineDescriptor): Repurposed. Convert a GPURenderPipelineDescriptor to Metal and WHLSL versions.
758         (WebCore::tryCreateMtlRenderPipelineState):
759         (WebCore::GPURenderPipeline::tryCreate):
760         (WebCore::trySetMetalFunctionsForPipelineDescriptor): Deleted.
761         (WebCore::trySetWHLSLFunctionsForPipelineDescriptor): Deleted.
762         (WebCore::trySetFunctionsForPipelineDescriptor): Deleted.
763         (WebCore::trySetInputStateForPipelineDescriptor): Deleted.
764         (WebCore::setColorStatesForColorAttachmentArray): Deleted.
765
766 2019-05-30  Zalan Bujtas  <zalan@apple.com>
767
768         [iOS] Do not linkify telephone numbers inside <a> elements.
769         https://bugs.webkit.org/show_bug.cgi?id=198378
770
771         Reviewed by Chris Dumez.
772
773         Phone number linkifying mutates the DOM in a potentially unexpected way triggering different kinds of failures with JS, CSS selectors etc.
774         This patch tightens the linkifying rule so that content inside an <a> element won't get linkified even when the <a> has no valid href attribute.
775
776         Test: fast/dom/linkify-phone-numbers.html
777
778         * html/parser/HTMLTreeBuilder.cpp:
779         (WebCore::disallowTelephoneNumberParsing):
780
781 2019-05-30  Truitt Savell  <tsavell@apple.com>
782
783         Unreviewed, rolling out r245883.
784
785         Caused 6 webgpu/ layout test failures.
786
787         Reverted changeset:
788
789         "[WHLSL] Parsing and lexing the standard library is slow"
790         https://bugs.webkit.org/show_bug.cgi?id=192890
791         https://trac.webkit.org/changeset/245883
792
793 2019-05-30  Simon Fraser  <simon.fraser@apple.com>
794
795         Move some HistoricalVelocityData code into the cpp file
796         https://bugs.webkit.org/show_bug.cgi?id=198353
797
798         Reviewed by Tim Horton.
799         
800         Now that we have VelocityData.cpp put the non-trivial HistoricalVelocityData::velocityForNewData()
801         into it. append() can become a lambda function.
802
803         * platform/graphics/VelocityData.cpp:
804         (WebCore::HistoricalVelocityData::velocityForNewData):
805         * platform/graphics/VelocityData.h:
806         (WebCore::HistoricalVelocityData::velocityForNewData): Deleted.
807         (WebCore::HistoricalVelocityData::append): Deleted.
808
809 2019-05-30  Truitt Savell  <tsavell@apple.com>
810
811         Fix the iOS build after r245887
812         https://bugs.webkit.org/show_bug.cgi?id=198345
813
814         Unreviewed build fix.
815
816         * platform/audio/ios/MediaSessionManagerIOS.mm:
817         (WebCore::MediaSessionManageriOS::updateCarPlayIsConnected):
818
819 2019-05-30  Jer Noble  <jer.noble@apple.com>
820
821         ASSERTION FAILED: m_scriptExecutionContext under WebCore::AudioContext::isPlayingAudioDidChange()
822         https://bugs.webkit.org/show_bug.cgi?id=181597
823         <rdar://problem/36474088>
824
825         Reviewed by Eric Carlson.
826
827         Because document() is usually null-checked before using (and we can add null-checks where missing),
828         there's no good reason to debug-assert that m_scriptExecutionContext is non-null before downcast<>ing
829         to Document*.
830
831         * Modules/webaudio/AudioContext.cpp:
832         (WebCore::AudioContext::constructCommon):
833         (WebCore::AudioContext::stop):
834         (WebCore::AudioContext::document const):
835         (WebCore::AudioContext::visibilityStateChanged):
836         (WebCore::AudioContext::willBeginPlayback):
837         (WebCore::AudioContext::willPausePlayback):
838         (WebCore::AudioContext::pageMutedStateDidChange):
839
840 2019-05-30  Jer Noble  <jer.noble@apple.com>
841
842         Video playback in Safari should continue when CarPlay is plugged in
843         https://bugs.webkit.org/show_bug.cgi?id=198345
844         <rdar://problem/45505750>
845
846         Reviewed by Eric Carlson.
847
848         Test: media/video-isplayingtoautomotiveheadunit.html
849
850         * html/HTMLMediaElement.cpp:
851         (WebCore::HTMLMediaElement::shouldOverrideBackgroundPlaybackRestriction const):
852         * platform/audio/PlatformMediaSessionManager.cpp:
853         (WebCore::PlatformMediaSessionManager::setIsPlayingToAutomotiveHeadUnit):
854         * platform/audio/PlatformMediaSessionManager.h:
855         (WebCore::PlatformMediaSessionManager::isPlayingToAutomotiveHeadUnit const):
856         * platform/audio/ios/MediaSessionManagerIOS.h:
857         * platform/audio/ios/MediaSessionManagerIOS.mm:
858         (WebCore::MediaSessionManageriOS::MediaSessionManageriOS):
859         (WebCore::MediaSessionManageriOS::carPlayServerDied):
860         (WebCore::MediaSessionManageriOS::updateCarPlayIsConnected):
861         (-[WebMediaSessionHelper initWithCallback:]):
862         (-[WebMediaSessionHelper startMonitoringAirPlayRoutes]):
863         (-[WebMediaSessionHelper interruption:]):
864         (-[WebMediaSessionHelper applicationWillEnterForeground:]):
865         (-[WebMediaSessionHelper applicationDidBecomeActive:]):
866         (-[WebMediaSessionHelper applicationWillResignActive:]):
867         (-[WebMediaSessionHelper wirelessRoutesAvailableDidChange:]):
868         (-[WebMediaSessionHelper applicationDidEnterBackground:]):
869         (-[WebMediaSessionHelper carPlayServerDied:]):
870         (-[WebMediaSessionHelper carPlayIsConnectedDidChange:]):
871         * testing/Internals.cpp:
872         (WebCore::Internals::resetToConsistentState):
873         (WebCore::Internals::setIsPlayingToAutomotiveHeadUnit):
874         * testing/Internals.h:
875         * testing/Internals.idl:
876
877 2019-05-29  Robin Morisset  <rmorisset@apple.com>
878
879         [WHLSL] Parsing and lexing the standard library is slow
880         https://bugs.webkit.org/show_bug.cgi?id=192890
881         <rdar://problem/50746335>
882
883         Reviewed by Myles Maxfield.
884
885         The main idea is to avoid backtracking by instead peeking at the next token (and occasionally at the one after that).
886         This implies a few things:
887         - We can replace the stack of tokens by a trivial ring buffer of size 2 (holding the next token and the one after, or WTF::nullopt if we are at the end of the file).
888         - We now have "completeFooExpression" functions, to avoid having to reparse the prefix of some expression, if we find half-way through what it is.
889
890         I also fixed the following parser bug:
891         - https://bugs.webkit.org/show_bug.cgi?id=198305 [WHLSL] Multiple variables with initializers in a declaration statement crashes the compiler
892             which was due to a mistake I made in the grammar
893
894         Finally I added two new macros: CONSUME_TYPE and PARSE to eliminate about 500 lines of error propagation boilerplate.
895
896         There are still lots of ways of improving the parser and lexer, such as:
897         - finishing the conversion of tokens in the lexer, not bothering with allocating string views
898         - make two special tokens Invalid and EOF, to remove the overhead of Optional
899         - make peekTypes and consumeTypes use templates to avoid constructing a Vector and calling find on it.
900         - Turn the entire lexer into a proper automata, not going through the same characters again and again (this is certainly the largest win by far)
901         - Remove the last few pieces of backtracking from the parser.
902
903         The current patch is already enough to make parsing the full standard library (something like 85k lines) approximately 260ms.
904         This is still longer than I would like, but nowhere near the bottleneck any longer because of some other parts of the compiler.
905
906         * Modules/webgpu/WHLSL/WHLSLLexer.h:
907         (WebCore::WHLSL::Lexer::Lexer):
908         (WebCore::WHLSL::Lexer::consumeToken):
909         (WebCore::WHLSL::Lexer::peek):
910         (WebCore::WHLSL::Lexer::peekFurther):
911         (WebCore::WHLSL::Lexer::state const):
912         (WebCore::WHLSL::Lexer::setState):
913         (WebCore::WHLSL::Lexer::unconsumeToken): Deleted.
914         * Modules/webgpu/WHLSL/WHLSLParser.cpp:
915         (WebCore::WHLSL::Parser::parse):
916         (WebCore::WHLSL::Parser::peek):
917         (WebCore::WHLSL::Parser::peekTypes):
918         (WebCore::WHLSL::Parser::tryType):
919         (WebCore::WHLSL::Parser::tryTypes):
920         (WebCore::WHLSL::Parser::consumeTypes):
921         (WebCore::WHLSL::Parser::parseConstantExpression):
922         (WebCore::WHLSL::Parser::parseTypeArgument):
923         (WebCore::WHLSL::Parser::parseTypeArguments):
924         (WebCore::WHLSL::Parser::parseTypeSuffixAbbreviated):
925         (WebCore::WHLSL::Parser::parseTypeSuffixNonAbbreviated):
926         (WebCore::WHLSL::Parser::parseType):
927         (WebCore::WHLSL::Parser::parseTypeDefinition):
928         (WebCore::WHLSL::Parser::parseResourceSemantic):
929         (WebCore::WHLSL::Parser::parseSpecializationConstantSemantic):
930         (WebCore::WHLSL::Parser::parseStageInOutSemantic):
931         (WebCore::WHLSL::Parser::parseSemantic):
932         (WebCore::WHLSL::Parser::parseQualifiers):
933         (WebCore::WHLSL::Parser::parseStructureElement):
934         (WebCore::WHLSL::Parser::parseStructureDefinition):
935         (WebCore::WHLSL::Parser::parseEnumerationDefinition):
936         (WebCore::WHLSL::Parser::parseEnumerationMember):
937         (WebCore::WHLSL::Parser::parseNativeTypeDeclaration):
938         (WebCore::WHLSL::Parser::parseNumThreadsFunctionAttribute):
939         (WebCore::WHLSL::Parser::parseAttributeBlock):
940         (WebCore::WHLSL::Parser::parseParameter):
941         (WebCore::WHLSL::Parser::parseParameters):
942         (WebCore::WHLSL::Parser::parseFunctionDefinition):
943         (WebCore::WHLSL::Parser::parseComputeFunctionDeclaration):
944         (WebCore::WHLSL::Parser::parseVertexFragmentFunctionDeclaration):
945         (WebCore::WHLSL::Parser::parseRegularFunctionDeclaration):
946         (WebCore::WHLSL::Parser::parseOperatorFunctionDeclaration):
947         (WebCore::WHLSL::Parser::parseFunctionDeclaration):
948         (WebCore::WHLSL::Parser::parseNativeFunctionDeclaration):
949         (WebCore::WHLSL::Parser::parseBlock):
950         (WebCore::WHLSL::Parser::parseBlockBody):
951         (WebCore::WHLSL::Parser::parseIfStatement):
952         (WebCore::WHLSL::Parser::parseSwitchStatement):
953         (WebCore::WHLSL::Parser::parseSwitchCase):
954         (WebCore::WHLSL::Parser::parseForLoop):
955         (WebCore::WHLSL::Parser::parseWhileLoop):
956         (WebCore::WHLSL::Parser::parseDoWhileLoop):
957         (WebCore::WHLSL::Parser::parseVariableDeclaration):
958         (WebCore::WHLSL::Parser::parseVariableDeclarations):
959         (WebCore::WHLSL::Parser::parseStatement):
960         (WebCore::WHLSL::Parser::parseEffectfulExpression):
961         (WebCore::WHLSL::Parser::parseEffectfulAssignment):
962         (WebCore::WHLSL::Parser::parseExpression):
963         (WebCore::WHLSL::Parser::parseTernaryConditional):
964         (WebCore::WHLSL::Parser::completeTernaryConditional):
965         (WebCore::WHLSL::Parser::parseAssignment):
966         (WebCore::WHLSL::Parser::completeAssignment):
967         (WebCore::WHLSL::Parser::parsePossibleTernaryConditional):
968         (WebCore::WHLSL::Parser::parsePossibleLogicalBinaryOperation):
969         (WebCore::WHLSL::Parser::completePossibleLogicalBinaryOperation):
970         (WebCore::WHLSL::Parser::parsePossibleRelationalBinaryOperation):
971         (WebCore::WHLSL::Parser::completePossibleRelationalBinaryOperation):
972         (WebCore::WHLSL::Parser::parsePossibleShift):
973         (WebCore::WHLSL::Parser::completePossibleShift):
974         (WebCore::WHLSL::Parser::parsePossibleAdd):
975         (WebCore::WHLSL::Parser::completePossibleAdd):
976         (WebCore::WHLSL::Parser::parsePossibleMultiply):
977         (WebCore::WHLSL::Parser::completePossibleMultiply):
978         (WebCore::WHLSL::Parser::parsePossiblePrefix):
979         (WebCore::WHLSL::Parser::parsePossibleSuffix):
980         (WebCore::WHLSL::Parser::parseCallExpression):
981         (WebCore::WHLSL::Parser::parseTerm):
982         (WebCore::WHLSL::Parser::parseAddressSpaceType): Deleted.
983         (WebCore::WHLSL::Parser::parseNonAddressSpaceType): Deleted.
984         (WebCore::WHLSL::Parser::parseEntryPointFunctionDeclaration): Deleted.
985         (WebCore::WHLSL::Parser::parseEffectfulPrefix): Deleted.
986         (WebCore::WHLSL::Parser::parseEffectfulSuffix): Deleted.
987         * Modules/webgpu/WHLSL/WHLSLParser.h:
988         (WebCore::WHLSL::Parser::Error::dump const):
989
990 2019-05-29  Jiewen Tan  <jiewen_tan@apple.com>
991
992         Unreviewed, update WebAuthN to "Supported In Preview"
993
994         * features.json:
995
996 2019-05-29  Don Olmstead  <don.olmstead@sony.com>
997
998         Remove ENABLE definitions from WebKit config files
999         https://bugs.webkit.org/show_bug.cgi?id=197858
1000
1001         Reviewed by Simon Fraser.
1002
1003         Sync FeatureDefines.xcconfig.
1004
1005         * Configurations/FeatureDefines.xcconfig:
1006
1007 2019-05-29  Youenn Fablet  <youenn@apple.com>
1008
1009         Reestablish WebSWClientConnection in case of network process crash
1010         https://bugs.webkit.org/show_bug.cgi?id=198333
1011
1012         Reviewed by Alex Christensen.
1013
1014         Refactor DocumentLoader to no longer take a ref to the SWClientConnection.
1015         Instead, store the sessionID and get the SWClientConnection from it.
1016         Remove unused code from ServiceWorkerContainer.
1017
1018         Test: http/wpt/service-workers/service-worker-networkprocess-crash.html
1019
1020         * loader/DocumentLoader.cpp:
1021         (WebCore::DocumentLoader::registerTemporaryServiceWorkerClient):
1022         (WebCore::DocumentLoader::unregisterTemporaryServiceWorkerClient):
1023         * loader/DocumentLoader.h:
1024         * workers/service/ServiceWorkerContainer.cpp:
1025         * workers/service/ServiceWorkerContainer.h:
1026         * workers/service/ServiceWorkerJobClient.h:
1027
1028 2019-05-29  David Kilzer  <ddkilzer@apple.com>
1029
1030         IndexedDatabase Server thread in com.apple.WebKit.Networking process leaks objects into an autoreleasePool that's never cleared
1031         <https://webkit.org/b/198346>
1032         <rdar://problem/50895658>
1033
1034         Reviewed by Brent Fulgham.
1035
1036         * Modules/indexeddb/server/IDBServer.cpp:
1037         (WebCore::IDBServer::IDBServer::IDBServer):
1038         - Pass AutodrainedPoolForRunLoop::Use when creating
1039           CrossThreadTaskHandler to fix the bug.
1040
1041 2019-05-29  Geoffrey Garen  <ggaren@apple.com>
1042
1043         WeakPtr breaks vtables when upcasting to base classes
1044         https://bugs.webkit.org/show_bug.cgi?id=188799
1045
1046         Reviewed by Youenn Fablet.
1047
1048         * Modules/encryptedmedia/MediaKeySession.cpp:
1049         (WebCore::MediaKeySession::MediaKeySession):
1050         * Modules/encryptedmedia/MediaKeySession.h: Adopted modern WeakPtr APIs.
1051         Removed redundant WeakPtrFactory.
1052
1053         * css/CSSFontFace.cpp:
1054         (WebCore::CSSFontFace::existingWrapper):
1055         * css/CSSFontFace.h: Moved functions out of line to avoid #include
1056         explosion for .get().
1057
1058         * dom/ContainerNode.h:
1059         * dom/Document.h:
1060         * dom/Element.h: Moved CanMakeWeakPtr to ContainerNode because all
1061         subclasses except for DocumentFragment were already so, and we have
1062         code that uses WeakPtr<ContainerNode>, which, now that WeakPtr is
1063         type-safe, is awkward to do when ContainerNode isn't CanMakeWeakPtr.
1064
1065         * dom/FullscreenManager.cpp:
1066         (WebCore::FullscreenManager::fullscreenRenderer const):
1067         * dom/FullscreenManager.h:
1068         (WebCore::FullscreenManager::fullscreenRenderer const): Deleted.
1069         * html/FormAssociatedElement.cpp:
1070         (WebCore::FormAssociatedElement::form const):
1071         * html/FormAssociatedElement.h:
1072         (WebCore::FormAssociatedElement::form const): Deleted. Moved functions
1073         out of line to avoid #include explosion for .get().
1074
1075         * html/HTMLMediaElement.h: It takes an extra using declaration
1076         to disambiguate multiple CanMakeWeakPtr base classes now.
1077
1078         * loader/MediaResourceLoader.cpp:
1079         (WebCore::MediaResourceLoader::requestResource): Removed redundant .get().
1080
1081         * page/DOMWindowProperty.cpp:
1082         (WebCore::DOMWindowProperty::window const):
1083         * page/DOMWindowProperty.h:
1084         (WebCore::DOMWindowProperty::window const): Deleted.
1085         * page/FrameViewLayoutContext.cpp:
1086         (WebCore::FrameViewLayoutContext::subtreeLayoutRoot const):
1087         * page/FrameViewLayoutContext.h:
1088         (WebCore::FrameViewLayoutContext::subtreeLayoutRoot const): Deleted.
1089         * page/UndoItem.cpp:
1090         (WebCore::UndoItem::undoManager const):
1091         * page/UndoItem.h:
1092         (WebCore::UndoItem::undoManager const): Deleted. Moved functions out of
1093         line to avoid #include explosion for .get().
1094
1095         * platform/ScrollView.h: It takes an extra using declaration
1096         to disambiguate multiple CanMakeWeakPtr base classes now.
1097
1098         * platform/Widget.cpp:
1099         (WebCore::Widget::parent const):
1100         * platform/Widget.h:
1101         (WebCore::Widget::parent const): Deleted. Moved functions out of line to avoid #include
1102         explosion for .get().
1103
1104         * platform/encryptedmedia/CDMInstanceSession.h: Made
1105         CDMInstanceSessionClient CanMakeWeakPtr because we use WeakPtr<CDMInstanceSessionClient>.
1106
1107         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
1108         CanMakeWeakPtr is inherited now.
1109
1110         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1111         (WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC):
1112         (WebCore::MediaPlayerPrivateAVFoundationObjC::~MediaPlayerPrivateAVFoundationObjC):
1113         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
1114         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::cdmSession const): Deleted.
1115         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::createWeakPtr): Deleted.
1116         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1117         (WebCore::CMTimebaseEffectiveRateChangedCallback):
1118         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
1119         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::play):
1120         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::pause):
1121         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekWithTolerance):
1122         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::durationChanged):
1123         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::cdmSession const):
1124         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
1125         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1126         (WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC):
1127         (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
1128         (WebCore::SourceBufferPrivateAVFObjC::setCDMSession):
1129         (WebCore::SourceBufferPrivateAVFObjC::flushVideo):
1130         (WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
1131         (WebCore::SourceBufferPrivateAVFObjC::notifyClientWhenReadyForMoreSamples):
1132         (WebCore::SourceBufferPrivateAVFObjC::setVideoLayer):
1133         (WebCore::SourceBufferPrivateAVFObjC::setDecompressionSession): Modernized WeakPtr API usage.
1134
1135         * rendering/RenderBlockFlow.cpp:
1136         (WebCore::RenderBlockFlow::multiColumnFlowSlowCase const):
1137         * rendering/RenderBlockFlow.h:
1138         (WebCore::RenderBlockFlow::multiColumnFlow const):
1139         * rendering/RenderMultiColumnFlow.cpp:
1140         (WebCore::RenderMultiColumnFlow::findColumnSpannerPlaceholder const):
1141         * rendering/RenderMultiColumnFlow.h:
1142         * rendering/RenderTable.cpp:
1143         (WebCore::RenderTable::header const):
1144         (WebCore::RenderTable::footer const):
1145         (WebCore::RenderTable::firstBody const):
1146         (WebCore::RenderTable::topSection const):
1147         * rendering/RenderTable.h:
1148         (WebCore::RenderTable::header const): Deleted.
1149         (WebCore::RenderTable::footer const): Deleted.
1150         (WebCore::RenderTable::firstBody const): Deleted.
1151         (WebCore::RenderTable::topSection const): Deleted. Moved functions out
1152         of line to avoid #include explosion for .get().
1153
1154 2019-05-29  Antoine Quint  <graouts@apple.com>
1155
1156         [Pointer Events] toElement and fromElement should be null
1157         https://bugs.webkit.org/show_bug.cgi?id=198338
1158
1159         Reviewed by Dean Jackson.
1160
1161         * dom/MouseEvent.h:
1162         * dom/PointerEvent.h:
1163
1164 2019-05-29  Ryan Haddad  <ryanhaddad@apple.com>
1165
1166         Unreviewed, rolling out r245857.
1167
1168         Breaks internal builds.
1169
1170         Reverted changeset:
1171
1172         "WeakPtr breaks vtables when upcasting to base classes"
1173         https://bugs.webkit.org/show_bug.cgi?id=188799
1174         https://trac.webkit.org/changeset/245857
1175
1176 2019-05-29  Keith Rollin  <krollin@apple.com>
1177
1178         Fix builds that don't use makeWindowFromView
1179         https://bugs.webkit.org/show_bug.cgi?id=198342
1180         <rdar://problem/51228563>
1181
1182         Reviewed by Wenson Hsieh.
1183
1184         In some configurations, VideoFullscreenInterfaceAVKit.mm declares but
1185         does not use makeWindowFromView. Fix by conditionalizing the the
1186         declaration on the same symbol as point where it's used.
1187
1188         No new tests -- no new functionality.
1189
1190         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
1191
1192 2019-05-28  Geoffrey Garen  <ggaren@apple.com>
1193
1194         WeakPtr breaks vtables when upcasting to base classes
1195         https://bugs.webkit.org/show_bug.cgi?id=188799
1196
1197         Reviewed by Youenn Fablet.
1198
1199         * Modules/encryptedmedia/MediaKeySession.cpp:
1200         (WebCore::MediaKeySession::MediaKeySession):
1201         * Modules/encryptedmedia/MediaKeySession.h: Adopted modern WeakPtr APIs.
1202         Removed redundant WeakPtrFactory.
1203
1204         * css/CSSFontFace.cpp:
1205         (WebCore::CSSFontFace::existingWrapper):
1206         * css/CSSFontFace.h: Moved functions out of line to avoid #include
1207         explosion for .get().
1208
1209         * dom/ContainerNode.h:
1210         * dom/Document.h:
1211         * dom/Element.h: Moved CanMakeWeakPtr to ContainerNode because all
1212         subclasses except for DocumentFragment were already so, and we have
1213         code that uses WeakPtr<ContainerNode>, which, now that WeakPtr is
1214         type-safe, is awkward to do when ContainerNode isn't CanMakeWeakPtr.
1215
1216         * dom/FullscreenManager.cpp:
1217         (WebCore::FullscreenManager::fullscreenRenderer const):
1218         * dom/FullscreenManager.h:
1219         (WebCore::FullscreenManager::fullscreenRenderer const): Deleted.
1220         * html/FormAssociatedElement.cpp:
1221         (WebCore::FormAssociatedElement::form const):
1222         * html/FormAssociatedElement.h:
1223         (WebCore::FormAssociatedElement::form const): Deleted. Moved functions
1224         out of line to avoid #include explosion for .get().
1225
1226         * html/HTMLMediaElement.h: It takes an extra using declaration
1227         to disambiguate multiple CanMakeWeakPtr base classes now.
1228
1229         * loader/MediaResourceLoader.cpp:
1230         (WebCore::MediaResourceLoader::requestResource): Removed redundant .get().
1231
1232         * page/DOMWindowProperty.cpp:
1233         (WebCore::DOMWindowProperty::window const):
1234         * page/DOMWindowProperty.h:
1235         (WebCore::DOMWindowProperty::window const): Deleted.
1236         * page/FrameViewLayoutContext.cpp:
1237         (WebCore::FrameViewLayoutContext::subtreeLayoutRoot const):
1238         * page/FrameViewLayoutContext.h:
1239         (WebCore::FrameViewLayoutContext::subtreeLayoutRoot const): Deleted.
1240         * page/UndoItem.cpp:
1241         (WebCore::UndoItem::undoManager const):
1242         * page/UndoItem.h:
1243         (WebCore::UndoItem::undoManager const): Deleted. Moved functions out of
1244         line to avoid #include explosion for .get().
1245
1246         * platform/ScrollView.h: It takes an extra using declaration
1247         to disambiguate multiple CanMakeWeakPtr base classes now.
1248
1249         * platform/Widget.cpp:
1250         (WebCore::Widget::parent const):
1251         * platform/Widget.h:
1252         (WebCore::Widget::parent const): Deleted. Moved functions out of line to avoid #include
1253         explosion for .get().
1254
1255         * platform/encryptedmedia/CDMInstanceSession.h: Made
1256         CDMInstanceSessionClient CanMakeWeakPtr because we use WeakPtr<CDMInstanceSessionClient>.
1257
1258         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
1259         CanMakeWeakPtr is inherited now.
1260
1261         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1262         (WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC):
1263         (WebCore::MediaPlayerPrivateAVFoundationObjC::~MediaPlayerPrivateAVFoundationObjC):
1264         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
1265         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::cdmSession const): Deleted.
1266         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::createWeakPtr): Deleted.
1267         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1268         (WebCore::CMTimebaseEffectiveRateChangedCallback):
1269         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
1270         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::play):
1271         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::pause):
1272         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekWithTolerance):
1273         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::durationChanged):
1274         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::cdmSession const):
1275         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
1276         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1277         (WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC):
1278         (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
1279         (WebCore::SourceBufferPrivateAVFObjC::setCDMSession):
1280         (WebCore::SourceBufferPrivateAVFObjC::flushVideo):
1281         (WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
1282         (WebCore::SourceBufferPrivateAVFObjC::notifyClientWhenReadyForMoreSamples):
1283         (WebCore::SourceBufferPrivateAVFObjC::setVideoLayer):
1284         (WebCore::SourceBufferPrivateAVFObjC::setDecompressionSession): Modernized WeakPtr API usage.
1285
1286         * rendering/RenderBlockFlow.cpp:
1287         (WebCore::RenderBlockFlow::multiColumnFlowSlowCase const):
1288         * rendering/RenderBlockFlow.h:
1289         (WebCore::RenderBlockFlow::multiColumnFlow const):
1290         * rendering/RenderMultiColumnFlow.cpp:
1291         (WebCore::RenderMultiColumnFlow::findColumnSpannerPlaceholder const):
1292         * rendering/RenderMultiColumnFlow.h:
1293         * rendering/RenderTable.cpp:
1294         (WebCore::RenderTable::header const):
1295         (WebCore::RenderTable::footer const):
1296         (WebCore::RenderTable::firstBody const):
1297         (WebCore::RenderTable::topSection const):
1298         * rendering/RenderTable.h:
1299         (WebCore::RenderTable::header const): Deleted.
1300         (WebCore::RenderTable::footer const): Deleted.
1301         (WebCore::RenderTable::firstBody const): Deleted.
1302         (WebCore::RenderTable::topSection const): Deleted. Moved functions out
1303         of line to avoid #include explosion for .get().
1304
1305 2019-05-29  Antti Koivisto  <antti@apple.com>
1306
1307         Scrolling node ordering wrong when a layer has both positioning and fixed/sticky node
1308         https://bugs.webkit.org/show_bug.cgi?id=198329
1309
1310         Reviewed by Darin Adler.
1311
1312         Test: scrollingcoordinator/scrolling-tree/sticky-in-overflow.html
1313
1314         With sticky positioning in non-stacking context overflow you currently get structure like
1315
1316         FrameScrollingNode
1317           OverflowScrollingNode
1318           StickyNode
1319             PositionedNode
1320
1321         where StickyNode and PositionedNode reference the same layer. Sticky doesn't get applied at all when the overflow moves.
1322
1323         This patch reverses the order of sticky and positioned. It doesn't fix sticky positioning during scrolling yet,
1324         but it does make it less jumpy. It is a prerequisite for the full fix.
1325
1326         * rendering/RenderLayerCompositor.cpp:
1327         (WebCore::RenderLayerCompositor::updateScrollCoordinationForLayer):
1328
1329 2019-05-29  Ludovico de Nittis  <ludovico.denittis@collabora.com>
1330
1331         Prepend KEY_ to the last key alias in PlatformEventKeyboardGtk
1332         https://bugs.webkit.org/show_bug.cgi?id=198331
1333
1334         Reviewed by Michael Catanzaro.
1335
1336         No behavior change.
1337
1338         With the commit
1339         https://bugs.webkit.org/show_bug.cgi?id=198326
1340         A gdk key slipped away from the renaming.
1341
1342         * platform/gtk/PlatformKeyboardEventGtk.cpp:
1343         (WebCore::modifiersForGdkKeyEvent):
1344
1345 2019-05-29  Zalan Bujtas  <zalan@apple.com>
1346
1347         [LFC][IFC] Move Line class to a dedicated file
1348         https://bugs.webkit.org/show_bug.cgi?id=198332
1349         <rdar://problem/51221403>
1350
1351         Reviewed by Antti Koivisto.
1352
1353         An upcoming refactoring requires the Line class to be in a .h.
1354
1355         * Sources.txt:
1356         * WebCore.xcodeproj/project.pbxproj:
1357         * layout/displaytree/DisplayRun.h:
1358         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
1359         (WebCore::Layout::InlineFormattingContext::LineLayout::initializeLine const):
1360         (WebCore::Layout::InlineFormattingContext::LineLayout::computedIntrinsicWidth const):
1361         (WebCore::Layout::halfLeadingMetrics): Deleted.
1362         (WebCore::Layout::Line::availableWidth const): Deleted.
1363         (WebCore::Layout::Line::contentLogicalRight const): Deleted.
1364         (WebCore::Layout::Line::contentLogicalWidth const): Deleted.
1365         (WebCore::Layout::Line::logicalTop const): Deleted.
1366         (WebCore::Layout::Line::logicalLeft const): Deleted.
1367         (WebCore::Layout::Line::logicalRight const): Deleted.
1368         (WebCore::Layout::Line::logicalBottom const): Deleted.
1369         (WebCore::Layout::Line::logicalWidth const): Deleted.
1370         (WebCore::Layout::Line::logicalHeight const): Deleted.
1371         (WebCore::Layout::Line::LineItem::LineItem): Deleted.
1372         (WebCore::Layout::Line::Line): Deleted.
1373         (WebCore::Layout::Line::reset): Deleted.
1374         (WebCore::Layout::Line::close): Deleted.
1375         (WebCore::Layout::Line::removeTrailingTrimmableContent): Deleted.
1376         (WebCore::Layout::Line::moveLogicalLeft): Deleted.
1377         (WebCore::Layout::Line::moveLogicalRight): Deleted.
1378         (WebCore::Layout::isTrimmableContent): Deleted.
1379         (WebCore::Layout::Line::trailingTrimmableWidth const): Deleted.
1380         (WebCore::Layout::Line::hasContent const): Deleted.
1381         (WebCore::Layout::Line::appendNonBreakableSpace): Deleted.
1382         (WebCore::Layout::Line::appendInlineContainerStart): Deleted.
1383         (WebCore::Layout::Line::appendInlineContainerEnd): Deleted.
1384         (WebCore::Layout::Line::appendTextContent): Deleted.
1385         (WebCore::Layout::Line::appendNonReplacedInlineBox): Deleted.
1386         (WebCore::Layout::Line::appendReplacedInlineBox): Deleted.
1387         (WebCore::Layout::Line::appendHardLineBreak): Deleted.
1388         * layout/inlineformatting/InlineTextItem.h:
1389         * layout/inlineformatting/text/TextUtil.cpp:
1390         (WebCore::Layout::TextUtil::isTrimmableContent):
1391         * layout/inlineformatting/text/TextUtil.h:
1392
1393 2019-05-29  Ludovico de Nittis  <ludovico.denittis@collabora.com>
1394
1395         PlatformEventKeyboardGtk still uses old key aliases
1396         https://bugs.webkit.org/show_bug.cgi?id=198326
1397
1398         Reviewed by Carlos Garcia Campos.
1399
1400         No behavior change.
1401
1402         Use the new key names convention prepending "KEY_".
1403
1404         * platform/gtk/PlatformKeyboardEventGtk.cpp:
1405         (WebCore::PlatformKeyboardEvent::keyIdentifierForGdkKeyCode):
1406         (WebCore::PlatformKeyboardEvent::windowsKeyCodeForGdkKeyCode):
1407         (WebCore::PlatformKeyboardEvent::singleCharacterString):
1408         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
1409
1410 2019-05-28  Yacine Bandou  <yacine.bandou@softathome.com>
1411
1412         [MSE][GStreamer] update the readyState correctly in MediaPlayerPrivateGStreamerMSE
1413         https://bugs.webkit.org/show_bug.cgi?id=197834
1414
1415         Reviewed by Xabier Rodriguez-Calvar.
1416
1417         The buffering state and the m_downloadFinished boolean aren't supported in the MSE case.
1418         When the readyState is already "HaveEnoughData", we don't want to revert it to "HaveFutureData",
1419         or else the MediaPlayer would send a "canplay" event instead of a "canplaythrough".
1420
1421         Test: media/media-source/media-source-canplaythrough-event.html
1422
1423         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
1424         (WebCore::MediaPlayerPrivateGStreamerMSE::updateStates):
1425
1426 2019-05-28  Fujii Hironori  <Hironori.Fujii@sony.com>
1427
1428         [WinCairo] ASSERTION FAILED: !m_preparingToPlay in MediaPlayerPrivateMediaFoundation::prepareToPlay
1429         https://bugs.webkit.org/show_bug.cgi?id=190747
1430
1431         Reviewed by Alex Christensen.
1432
1433         HTMLMediaElement::prepareToPlay had a assertion ensuring that it
1434         was not called twice. However, it was called twice. The first from
1435         HTMLMediaElement::load, the second from
1436         MediaPlayerPrivateMediaFoundation::onTopologySet.
1437
1438         prepareToPlay started loading. And, loading should be started
1439         after onTopologySet is called back.
1440
1441         Covered by existing tests.
1442
1443         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
1444         (WebCore::MediaPlayerPrivateMediaFoundation::onTopologySet): Moved code from prepareToPlay.
1445         (WebCore::MediaPlayerPrivateMediaFoundation::prepareToPlay): Deleted and moved the code to onTopologySet.
1446         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h: Removed prepareToPlay declaration.
1447
1448 2019-05-28  Fujii Hironori  <Hironori.Fujii@sony.com>
1449
1450         [WinCairo][MediaFoundation] Assertion failure in MediaPlayerPrivateMediaFoundation::Direct3DPresenter::presentSample
1451         https://bugs.webkit.org/show_bug.cgi?id=198290
1452
1453         Reviewed by Per Arne Vollan.
1454
1455         Covered by existing tests.
1456
1457         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
1458         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::presentSample):
1459         Call clear() of m_memSurface before assigning new value.
1460
1461 2019-05-28  Saam Barati  <sbarati@apple.com>
1462
1463         [WHLSL] Type of dereference is the type of the thing we point to, not a pointer to that type
1464         https://bugs.webkit.org/show_bug.cgi?id=198321
1465
1466         Reviewed by Myles C. Maxfield.
1467
1468         Consider this program:
1469         ```
1470         thread int* x;
1471         *x = 42
1472         ```
1473         
1474         In the Checker, we were saying the type of "*x" was "int*" instead of "int".
1475
1476         Test: webgpu/whlsl-dereference-pointer-should-type-check.html
1477
1478         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
1479         (WebCore::WHLSL::Checker::visit):
1480
1481 2019-05-28  Wenson Hsieh  <wenson_hsieh@apple.com>
1482
1483         [iOS] Respect NSItemProvider's registered types when dropping files that are loaded in-place
1484         https://bugs.webkit.org/show_bug.cgi?id=198315
1485         <rdar://problem/51183762>
1486
1487         Reviewed by Tim Horton.
1488
1489         Currently, logic in PasteboardIOS.mm and WebContentReaderCocoa.mm attempts to deduce the content type from the
1490         file path when dropping attachments on iOS. Instead, we should be plumbing the content type through to the
1491         reader.
1492
1493         Test: WKAttachmentTestsIOS.InsertDroppedImageWithNonImageFileExtension
1494
1495         * editing/WebContentReader.h:
1496         * editing/cocoa/WebContentReaderCocoa.mm:
1497         (WebCore::typeForAttachmentElement):
1498
1499         Add a helper method to determine which type to use in attachment elements. This makes the paste
1500         (attachmentForData) and drop (attachmentForFilePaths) behave the same way, with respect to the type attribute
1501         used to represent the attachment.
1502
1503         (WebCore::attachmentForFilePath):
1504
1505         Use the content type, if specified; otherwise, fall back to deducing it from the file path.
1506
1507         (WebCore::attachmentForData):
1508         (WebCore::WebContentReader::readFilePath):
1509         * platform/Pasteboard.h:
1510         (WebCore::PasteboardWebContentReader::readFilePath):
1511
1512         Pass the highest fidelity representation's content type to the web content reader.
1513
1514         * platform/ios/PasteboardIOS.mm:
1515         (WebCore::Pasteboard::readRespectingUTIFidelities):
1516
1517 2019-05-28  Myles C. Maxfield  <mmaxfield@apple.com>
1518
1519         Move idempotent text autosizing to StyleTreeResolver
1520         https://bugs.webkit.org/show_bug.cgi?id=197808
1521         <rdar://problem/50283983>
1522
1523         Reviewed by Antti Koivisto.
1524
1525         This patch migrates the idempotent text autosizing code to live inside style resolution. This is almost
1526         the same as the algorithm that uses the result of layout to calculate autosizing, but this version only
1527         operates on style (and thus doesn't require double layouts). Because it is being run in an environment
1528         with less information, autosizing is occurring in more places, so the curves have been adjusted to make
1529         autosizing not boost as much as the previous implementation did. The new algorithm is modelled after
1530         text-decorations-in-effect. I've claimed 4 of the unused bits in RenderStyle to contain the state of the
1531         autosizing algorithm. StyleResolver::adjustRenderStyle() is where the algorithm is implemented:
1532         - Look at the inherited bits
1533         - Interogate the element's RenderStyle
1534         - Compute new bits for the element, and set them in its RenderStyle
1535         - Based on the newly computed bits, determine whether we should increase the text size
1536         - If so, determine how much using the specified font size, and apply the result to the computed font size
1537
1538         This works because StyleBuilderCustom::applyInheritFontSize() inherits from the specified font size, not
1539         the computed font size.
1540
1541         This patch also will disable autosizing using the other methods (so there aren't two methods of autosizing
1542         fighting each other) and will honor text-size-adjust:none. However, it won't honor text-size-adjust:100%.
1543         If content says text-size-adjust:100%, we will disregard it and take this code path.
1544
1545         Tests: fast/text-autosizing/ios/idempotentmode/css-exposure.html
1546                fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-skip.html
1547                fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-identity.html
1548                fast/text-autosizing/ios/idempotentmode/idempotent-autosizing.html
1549
1550         * Sources.txt:
1551         * WebCore.xcodeproj/project.pbxproj:
1552         * css/CSSComputedStyleDeclaration.cpp:
1553         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
1554         * css/CSSProperties.json:
1555         * css/StyleBuilderCustom.h:
1556         (WebCore::computeBaseSpecifiedFontSize):
1557         (WebCore::computeLineHeightMultiplierDueToFontSize):
1558         * css/StyleResolver.cpp:
1559         (WebCore::idempotentTextSize):
1560         (WebCore::hasTextChildren):
1561         (WebCore::StyleResolver::adjustRenderStyle):
1562         (WebCore::StyleResolver::checkForTextSizeAdjust):
1563         * page/FrameViewLayoutContext.cpp:
1564         (WebCore::FrameViewLayoutContext::applyTextSizingIfNeeded):
1565         * rendering/RenderBlockFlow.cpp:
1566         (WebCore::RenderBlockFlow::adjustComputedFontSizes):
1567         (WebCore::idempotentTextSize): Deleted.
1568         * rendering/RenderBlockFlow.h:
1569         * rendering/RenderElement.cpp:
1570         (WebCore::includeNonFixedHeight):
1571         (WebCore::RenderElement::adjustComputedFontSizesOnBlocks):
1572         (WebCore::RenderElement::resetTextAutosizing):
1573         * rendering/style/RenderStyle.cpp:
1574         (WebCore::RenderStyle::RenderStyle):
1575         (WebCore::RenderStyle::autosizeStatus const):
1576         (WebCore::RenderStyle::setAutosizeStatus):
1577         * rendering/style/RenderStyle.h:
1578         * rendering/style/TextSizeAdjustment.cpp: Added.
1579         (WebCore::AutosizeStatus::AutosizeStatus):
1580         (WebCore::AutosizeStatus::contains const):
1581         (WebCore::AutosizeStatus::modifiedStatus const):
1582         (WebCore::AutosizeStatus::shouldSkipSubtree const):
1583         * rendering/style/TextSizeAdjustment.h:
1584
1585 2019-05-28  Simon Fraser  <simon.fraser@apple.com>
1586
1587         Use scroll-velocity-based tile coverage for overflow:scroll
1588         https://bugs.webkit.org/show_bug.cgi?id=198294
1589         rdar://problem/48942184
1590
1591         Reviewed by Tim Horton.
1592
1593         Start using a velocity-based tile coverage computation on layers with Type::ScrolledContents,
1594         which is the content layers for overflow:scroll when they get big enough to get tiled.
1595
1596         Move legacy macOS coverage code into adjustTileCoverageForDesktopPageScrolling() because
1597         I don't want to change its behavior in this patch. Use TileController::adjustTileCoverageRectForScrolling()
1598         for iOS and macOS overflow scrolling. Since only iOS page scrolling gets velocity data from the UI
1599         process, compute velocity in TileController using the visible rect top-left.
1600         
1601         For overflow scroll, we have to plumb horizontal and vertical coverage in from
1602         RenderLayerBacking.
1603
1604         Tests: tiled-drawing/scrolling/overflow/overflow-scrolled-down-tile-coverage.html
1605                tiled-drawing/scrolling/overflow/overflow-scrolled-up-tile-coverage.html
1606                tiled-drawing/scrolling/overflow/overflow-tile-coverage.html
1607
1608         * platform/graphics/TiledBacking.h:
1609         * platform/graphics/ca/GraphicsLayerCA.cpp:
1610         (WebCore::GraphicsLayerCA::adjustCoverageRect const):
1611         * platform/graphics/ca/PlatformCALayer.h:
1612         * platform/graphics/ca/TileController.cpp:
1613         (WebCore::TileController::setVelocity):
1614         (WebCore::TileController::adjustTileCoverageRect):
1615         (WebCore::TileController::adjustTileCoverageForDesktopPageScrolling const):
1616         (WebCore::TileController::adjustTileCoverageWithScrollingVelocity const):
1617         (WebCore::TileController::adjustTileCoverageRectForScrolling):
1618         (WebCore::expandRectWithinRect): Deleted.
1619         (WebCore::TileController::adjustTileCoverageRect const): Deleted.
1620         (WebCore::TileController::adjustTileCoverageRectForScrolling const): Deleted.
1621         * platform/graphics/ca/TileController.h:
1622         * rendering/RenderLayer.h:
1623         * rendering/RenderLayerBacking.cpp:
1624         (WebCore::computePageTiledBackingCoverage):
1625         (WebCore::computeOverflowTiledBackingCoverage):
1626         (WebCore::RenderLayerBacking::adjustTiledBackingCoverage):
1627         (WebCore::RenderLayerBacking::updateGeometry):
1628
1629 2019-05-28  Shawn Roberts  <sroberts@apple.com>
1630
1631         Unreviewed, rolling out r245475.
1632
1633         Newly imported test is flaky. Features need flags.
1634
1635         Reverted changeset:
1636
1637         "Implement imagesrcset and imagesizes attributes on link
1638         rel=preload"
1639         https://bugs.webkit.org/show_bug.cgi?id=192950
1640         https://trac.webkit.org/changeset/245475
1641
1642 2019-05-28  Brent Fulgham  <bfulgham@apple.com>
1643
1644         Protect frames during style and layout changes
1645         https://bugs.webkit.org/show_bug.cgi?id=198047
1646         <rdar://problem/50954082>
1647
1648         Reviewed by Zalan Bujtas.
1649
1650         Be more careful about the scope and lifetime of objects that participate in layout or
1651         style updates. If a method decides a layout or style update is needed, it needs to
1652         confirm that the elements it was operating on are still valid and needed in the
1653         current operation.
1654
1655         * accessibility/AXObjectCache.cpp:
1656         (WebCore::AXObjectCache::getOrCreate):
1657         * accessibility/AccessibilityRenderObject.cpp:
1658         (WebCore::AccessibilityRenderObject::accessibilityHitTest const):
1659         * css/CSSComputedStyleDeclaration.cpp:
1660         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
1661         * css/CSSComputedStyleDeclaration.h:
1662         * css/SVGCSSComputedStyleDeclaration.cpp:
1663         (WebCore::ComputedStyleExtractor::svgPropertyValue):
1664         * dom/Document.cpp:
1665         (WebCore::Document::setFocusedElement):
1666         * editing/TypingCommand.cpp:
1667         (WebCore::TypingCommand::insertTextRunWithoutNewlines):
1668         (WebCore::TypingCommand::insertLineBreak):
1669         (WebCore::TypingCommand::insertParagraphSeparator):
1670         (WebCore::TypingCommand::insertParagraphSeparatorInQuotedContent):
1671         * editing/ios/EditorIOS.mm:
1672         (WebCore::Editor::setDictationPhrasesAsChildOfElement):
1673         * html/HTMLLabelElement.cpp:
1674         (WebCore::HTMLLabelElement::focus):
1675         * html/HTMLTextAreaElement.cpp:
1676         (WebCore::HTMLTextAreaElement::appendFormData):
1677         * html/ImageDocument.cpp:
1678         (WebCore::ImageDocument::imageClicked):
1679         * html/ValidationMessage.cpp:
1680         (WebCore::ValidationMessage::buildBubbleTree):
1681         * page/FrameView.cpp:
1682         (WebCore::FrameView::autoSizeIfEnabled):
1683         (WebCore::FrameView::trackedRepaintRectsAsText const):
1684         * page/PrintContext.cpp:
1685         (WebCore::PrintContext::pageProperty):
1686         (WebCore::PrintContext::numberOfPages):
1687         (WebCore::PrintContext::spoolAllPagesWithBoundaries):
1688
1689 2019-05-28  Antti Koivisto  <antti@apple.com>
1690
1691         [async scrolling] Fixed positioning inside stacking context overflow scroll is jumpy
1692         https://bugs.webkit.org/show_bug.cgi?id=198292
1693
1694         Reviewed by Darin Adler.
1695
1696         Tests: scrollingcoordinator/ios/fixed-in-stacking-context-overflow-scroll-2.html
1697                scrollingcoordinator/ios/fixed-in-stacking-context-overflow-scroll.html
1698
1699         We were computing delta from the layout scroll position in ScrollingTree::notifyRelatedNodesAfterScrollPositionChange
1700         based on the passed in node only. If any other node had deltas they were not taken into account at all. This would occur
1701         frequently since the function is always invoked for the root node after layer tree commit.
1702
1703         Fix by moving the delta computation (and fetching layoutViewport) to ScrollingTreeFixedNode.
1704
1705         * page/scrolling/ScrollingTree.cpp:
1706         (WebCore::ScrollingTree::applyLayerPositions):
1707
1708         No need to pass offset and layoutViewport around anymore.
1709
1710         (WebCore::ScrollingTree::applyLayerPositionsRecursive):
1711         (WebCore::ScrollingTree::notifyRelatedNodesAfterScrollPositionChange):
1712
1713         Remove the offset and layoutViewport computations.
1714
1715         (WebCore::ScrollingTree::notifyRelatedNodesRecursive):
1716         * page/scrolling/ScrollingTree.h:
1717         * page/scrolling/ScrollingTreeFrameHostingNode.cpp:
1718         (WebCore::ScrollingTreeFrameHostingNode::applyLayerPositions):
1719         * page/scrolling/ScrollingTreeFrameHostingNode.h:
1720         * page/scrolling/ScrollingTreeNode.cpp:
1721         (WebCore::ScrollingTreeNode::relatedNodeScrollPositionDidChange):
1722         * page/scrolling/ScrollingTreeNode.h:
1723         * page/scrolling/ScrollingTreeScrollingNode.cpp:
1724         (WebCore::ScrollingTreeScrollingNode::applyLayerPositions):
1725         * page/scrolling/ScrollingTreeScrollingNode.h:
1726         * page/scrolling/cocoa/ScrollingTreeFixedNode.h:
1727         * page/scrolling/cocoa/ScrollingTreeFixedNode.mm:
1728         (WebCore::ScrollingTreeFixedNode::applyLayerPositions):
1729
1730         Compute them here instead, always taking all overflow scrollers up to the closest frame into account.
1731
1732         * page/scrolling/cocoa/ScrollingTreePositionedNode.h:
1733         * page/scrolling/cocoa/ScrollingTreePositionedNode.mm:
1734         (WebCore::ScrollingTreePositionedNode::applyLayerPositions):
1735         (WebCore::ScrollingTreePositionedNode::relatedNodeScrollPositionDidChange):
1736         * page/scrolling/cocoa/ScrollingTreeStickyNode.h:
1737         * page/scrolling/cocoa/ScrollingTreeStickyNode.mm:
1738         (WebCore::ScrollingTreeStickyNode::applyLayerPositions):
1739
1740 2019-05-28  Zalan Bujtas  <zalan@apple.com>
1741
1742         [LFC][Verification] Add additional inline and block checks
1743         https://bugs.webkit.org/show_bug.cgi?id=198252
1744         <rdar://problem/51140687>
1745
1746         Reviewed by Antti Koivisto.
1747
1748         Now we also test the geometry of the blocks with inline formatting contexts.
1749
1750         * layout/Verification.cpp:
1751         (WebCore::Layout::checkForMatchingTextRuns):
1752         (WebCore::Layout::verifyAndOutputSubtree):
1753
1754 2019-05-28  Zalan Bujtas  <zalan@apple.com>
1755
1756         [LFC][IFC] Decouple line layout and processing inline runs.
1757         https://bugs.webkit.org/show_bug.cgi?id=198282
1758         <rdar://problem/51167954>
1759
1760         Reviewed by Antti Koivisto.
1761
1762         This is in preparation for using "createInlineRunsForLine" logic when computing preferred width.
1763
1764         * layout/inlineformatting/InlineFormattingContext.h:
1765         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
1766         (WebCore::Layout::UncommittedContent::size const):
1767         (WebCore::Layout::InlineFormattingContext::LineLayout::createInlineRunsForLine const):
1768         (WebCore::Layout::InlineFormattingContext::LineLayout::layout const):
1769         (WebCore::Layout::InlineFormattingContext::LineLayout::processInlineRuns const):
1770         (WebCore::Layout::InlineFormattingContext::LineLayout::closeLine const): Deleted.
1771         * layout/inlineformatting/InlineFormattingState.h:
1772         (WebCore::Layout::InlineFormattingState::addInlineItem):
1773         * layout/inlineformatting/InlineTextItem.cpp:
1774         (WebCore::Layout::InlineTextItem::createAndAppendTextItems):
1775
1776 2019-05-28  Zalan Bujtas  <zalan@apple.com>
1777
1778         [LFC][IFC] Move intrinsic width computation from InlineFormattingContext to LineLayout
1779         https://bugs.webkit.org/show_bug.cgi?id=198258
1780
1781         Reviewed by Antti Koivisto.
1782
1783         This is in preparation for sharing even more code between line layout and preferred width computation. 
1784
1785         * layout/inlineformatting/InlineFormattingContext.cpp:
1786         (WebCore::Layout::InlineFormattingContext::layout const):
1787         (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthConstraints const):
1788         * layout/inlineformatting/InlineFormattingContext.h:
1789         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
1790         (WebCore::Layout::InlineFormattingContext::LineLayout::initializeLine const):
1791         (WebCore::Layout::InlineFormattingContext::LineLayout::layout const):
1792         (WebCore::Layout::InlineFormattingContext::LineLayout::computedIntrinsicWidth const):
1793         (WebCore::Layout::InlineFormattingContext::LineLayout::closeLine const):
1794
1795 2019-05-28  Zalan Bujtas  <zalan@apple.com>
1796
1797         [LFC[IFC] Ignore the initial strut's height when the line does not have any content.
1798         https://bugs.webkit.org/show_bug.cgi?id=198268
1799         <rdar://problem/51150057>
1800
1801         Reviewed by Antti Koivisto.
1802
1803         The strut (https://www.w3.org/TR/CSS22/visudet.html#leading) defines the initial logical height
1804         for the line. This height should be ignored though when the line does not have any content. 
1805
1806         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
1807         (WebCore::Layout::InlineFormattingContext::LineLayout::closeLine const):
1808
1809 2019-05-27  Antoine Quint  <graouts@apple.com>
1810
1811         [Pointer Events] Check that capturing data managed by the PointerCaptureController gets cleared upon navigation
1812         https://bugs.webkit.org/show_bug.cgi?id=198191
1813
1814         Reviewed by Dean Jackson.
1815
1816         When the document of the page's main frame changes, make sure we clear all of the data accumulated for the previous document.
1817         I don't think this particular change is testable as none of the data contained in the PointerIdToCapturingDataMap maintained by
1818         the PointerCaptureController contains any data that could be inspected by the page due to other fixes landed to fix wkb.ug/198129,
1819         but I've checked that removing those fixes and using this patch correctly fixes that bug.
1820
1821         * page/Page.cpp:
1822         (WebCore::Page::didChangeMainDocument):
1823         * page/PointerCaptureController.cpp:
1824         (WebCore::PointerCaptureController::PointerCaptureController):
1825         (WebCore::PointerCaptureController::reset):
1826         * page/PointerCaptureController.h:
1827
1828 2019-05-27  Carlos Garcia Campos  <cgarcia@igalia.com>
1829
1830         [GTK] Use WPEBackend-fdo for accelerating compositing in Wayland instead of the nested compositor
1831         https://bugs.webkit.org/show_bug.cgi?id=197944
1832
1833         Reviewed by Michael Catanzaro.
1834
1835         * PlatformGTK.cmake:
1836         * SourcesGTK.txt:
1837         * platform/graphics/GLContext.cpp:
1838         (WebCore::GLContext::createContextForWindow): Check current display is X11 before trying to create a GLX context.
1839         * platform/graphics/PlatformDisplay.cpp:
1840         (WebCore::PlatformDisplay::createPlatformDisplay): Use USE(WPE_RENDERER) instead of USE(LIBWPE).
1841         * platform/graphics/PlatformDisplay.h:
1842         * platform/graphics/egl/GLContextEGL.cpp:
1843         (WebCore::GLContextEGL::createWindowContext): Use USE(WPE_RENDERER) instead of PLATFORM(WPE).
1844         (WebCore::GLContextEGL::createContext): Ditto.
1845         (WebCore::GLContextEGL::createSharingContext): Ditto.
1846         (WebCore::GLContextEGL::~GLContextEGL): Ditto.
1847         * platform/graphics/egl/GLContextEGL.h:
1848         * platform/graphics/egl/GLContextEGLLibWPE.cpp:
1849         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1850         (WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext): Ditto.
1851         * platform/graphics/libwpe/PlatformDisplayLibWPE.cpp:
1852         (WebCore::PlatformDisplayLibWPE::PlatformDisplayLibWPE): In GTK port set the display as the shared one for compositing.
1853         * platform/graphics/libwpe/PlatformDisplayLibWPE.h:
1854
1855 2019-05-27  Takashi Komori  <Takashi.Komori@sony.com>
1856
1857         [CURL] Fix crashing SocketStreamHandle.
1858         https://bugs.webkit.org/show_bug.cgi?id=197873
1859
1860         Reviewed by Fujii Hironori.
1861
1862         When NetworkSocketStream was destructed SocketStreamHandleImple::platformClose was called wrongly times.
1863         This is because closed state is not set.
1864
1865         Test: http/tests/websocket/tests/hybi/workers/close.html
1866
1867         * platform/network/curl/SocketStreamHandleImpl.h:
1868         * platform/network/curl/SocketStreamHandleImplCurl.cpp:
1869         (WebCore::SocketStreamHandleImpl::platformSendInternal):
1870         (WebCore::SocketStreamHandleImpl::platformClose):
1871         (WebCore::SocketStreamHandleImpl::threadEntryPoint):
1872         (WebCore::SocketStreamHandleImpl::handleError):
1873         (WebCore::SocketStreamHandleImpl::callOnWorkerThread):
1874         (WebCore::SocketStreamHandleImpl::executeTasks):
1875
1876 2019-05-27  Oriol Brufau  <obrufau@igalia.com>
1877
1878         [css-grid] Preserve repeat() notation when serializing declared values
1879         https://bugs.webkit.org/show_bug.cgi?id=197840
1880
1881         Reviewed by Manuel Rego Casasnovas.
1882
1883         Tests: fast/css-grid-layout/grid-element-auto-repeat-get-set.html
1884                fast/css-grid-layout/grid-repeat-calc.html
1885                fast/css-grid-layout/named-grid-line-get-set.html
1886                imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-support-repeat-002.html
1887
1888         Before this change, a repeat() notation with an integral number of
1889         repetitions was expanded at parse time. This was observable when reading
1890         declared values using JS APIs.
1891
1892         This patch makes the parser preserve that notation, like it was already
1893         happening when the number of repetitions was automatic and not integral.
1894
1895         The resolved value in getComputedStyle() will still be expanded, though,
1896         as required by the spec.
1897
1898         * Sources.txt:
1899         * WebCore.xcodeproj/project.pbxproj:
1900         * css/CSSGridIntegerRepeatValue.cpp: Added.
1901         (WebCore::CSSGridIntegerRepeatValue::customCSSText const):
1902         (WebCore::CSSGridIntegerRepeatValue::equals const):
1903         * css/CSSGridIntegerRepeatValue.h: Added.
1904         * css/CSSValue.cpp:
1905         (WebCore::CSSValue::equals const):
1906         (WebCore::CSSValue::cssText const):
1907         (WebCore::CSSValue::destroy):
1908         * css/CSSValue.h:
1909         (WebCore::CSSValue::isGridIntegerRepeatValue const):
1910         * css/StyleBuilderConverter.h:
1911         (WebCore::StyleBuilderConverter::createGridTrackList):
1912         (WebCore::StyleBuilderConverter::convertGridTrackSizeList):
1913         * css/parser/CSSPropertyParser.cpp:
1914         (WebCore::consumeGridTrackRepeatFunction):
1915
1916 2019-05-27  Chris Dumez  <cdumez@apple.com>
1917
1918         Use a strongly-typed identifier for pages
1919         https://bugs.webkit.org/show_bug.cgi?id=198206
1920
1921         Reviewed by Youenn Fablet.
1922
1923         * WebCore/*:
1924
1925 2019-05-26  Simon Fraser  <simon.fraser@apple.com>
1926
1927         Move GraphicsLayerCA::adjustTiledLayerVisibleRect() to TileController
1928         https://bugs.webkit.org/show_bug.cgi?id=198266
1929
1930         Reviewed by Zalan Bujtas.
1931
1932         GraphicsLayerCA::adjustTiledLayerVisibleRect() was computing tile coverage for a
1933         TiledBacking, just like TileController::adjustTileCoverageRect(), so move the code
1934         into TileController as a first step to unifying more of this code. It's currently
1935         used for tiled compositing layers, including overflow:scroll, and tiled layers
1936         whose coverage may be affected by animations, so it's general-purpose.
1937
1938         TileController::adjustTileCoverageRect() is used for scrollable things, so rename
1939         it to adjustTileCoverageRectForScrolling().
1940
1941         No behavior change.
1942
1943         * platform/graphics/TiledBacking.h:
1944         * platform/graphics/ca/GraphicsLayerCA.cpp:
1945         (WebCore::GraphicsLayerCA::adjustCoverageRect const):
1946         (WebCore::GraphicsLayerCA::adjustTiledLayerVisibleRect): Deleted.
1947         * platform/graphics/ca/GraphicsLayerCA.h:
1948         * platform/graphics/ca/TileController.cpp:
1949         (WebCore::TileController::adjustTileCoverageRect const):
1950         (WebCore::TileController::adjustTileCoverageRectForScrolling const):
1951         * platform/graphics/ca/TileController.h:
1952
1953 2019-05-27  Simon Fraser  <simon.fraser@apple.com>
1954
1955         Fix Apple Internal builds after r245788.
1956
1957         * platform/PlatformScreen.h:
1958         (WebCore::screenHasTouchDevice):
1959         (WebCore::screenIsTouchPrimaryInputDevice):
1960
1961 2019-05-27  Zalan Bujtas  <zalan@apple.com>
1962
1963         [LFC][IFC] Ignore collapsed runs when setting the width on the associated display boxes.
1964         https://bugs.webkit.org/show_bug.cgi?id=198260
1965         <rdar://problem/51145704>
1966
1967         Reviewed by Antti Koivisto.
1968
1969         Collapsed runs don't contribute to the logical width of their containers.
1970
1971         Covered by existing tests.
1972
1973         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
1974         (WebCore::Layout::InlineFormattingContext::LineLayout::closeLine const):
1975
1976 2019-05-27  Carlos Garcia Campos  <cgarcia@igalia.com>
1977
1978         Unreviewed. Fix GTK distcheck
1979
1980         Move mac headers to platform specific makefile.
1981
1982         * Headers.cmake:
1983         * PlatformMac.cmake:
1984
1985 2019-05-27  Carlos Garcia Campos  <cgarcia@igalia.com>
1986
1987         Touch support is reported even when the device doesn't have a touch screen
1988         https://bugs.webkit.org/show_bug.cgi?id=139681
1989
1990         Reviewed by Michael Catanzaro.
1991
1992         Add screenHasTouchDevice() and screenIsTouchPrimaryInputDevice() to PlatformScreen and use it to decide whether
1993         to expose touch events functionality or not.
1994
1995         * bindings/js/WebCoreBuiltinNames.h:
1996         * css/MediaQueryEvaluator.cpp:
1997         (WebCore::hoverEvaluate): Use screenIsTouchPrimaryInputDevice() when touch events are enabled at build time.
1998         (WebCore::anyHoverEvaluate): Use screenHasTouchDevice() when touch events are enabled at build time.
1999         (WebCore::pointerEvaluate): Use screenIsTouchPrimaryInputDevice() when touch events are enabled at build time.
2000         (WebCore::anyPointerEvaluate): Use screenHasTouchDevice() when touch events are enabled at build time.
2001         * dom/GlobalEventHandlers.idl: Make touch event attributes enabled at runtime.
2002         * page/RuntimeEnabledFeatures.cpp:
2003         (WebCore::RuntimeEnabledFeatures::touchEventsEnabled const): Return whether touch events are enabled.
2004         * page/RuntimeEnabledFeatures.h:
2005         (WebCore::RuntimeEnabledFeatures::setTouchEventsEnabled): Force touch events to be enabled or disabled.
2006         * platform/PlatformScreen.h:
2007         (WebCore::screenHasTouchDevice): Just return true when touch events are enabled at build time for non-gtk ports.
2008         (WebCore::screenIsTouchPrimaryInputDevice): Ditto.
2009         * platform/gtk/PlatformScreenGtk.cpp:
2010         (WebCore::screenHasTouchDevice):
2011         (WebCore::screenIsTouchPrimaryInputDevice):
2012         (WebCore::isTouchDevice):
2013         (WebCore::deviceAddedCallback):
2014         (WebCore::deviceRemovedCallback):
2015
2016 2019-05-26  Simon Fraser  <simon.fraser@apple.com>
2017
2018         Move VelocityData to WebCore
2019         https://bugs.webkit.org/show_bug.cgi?id=198261
2020
2021         Reviewed by Antti Koivisto.
2022
2023         Move VelocityData and HistoricalVelocityData to WebCore for future use in overflow scroll.
2024         
2025         VisibleContentRectUpdateInfo can now store a VelocityData (its timestamp is used as
2026         the timetamp for the entire update).
2027
2028         No behavior change.
2029
2030         * Headers.cmake:
2031         * Sources.txt:
2032         * WebCore.xcodeproj/project.pbxproj:
2033         * page/FrameView.cpp:
2034         (WebCore::FrameView::setScrollVelocity):
2035         * page/FrameView.h:
2036         * platform/graphics/TiledBacking.h:
2037         (WebCore::VelocityData::VelocityData): Deleted.
2038         (WebCore::VelocityData::velocityOrScaleIsChanging const): Deleted.
2039         * platform/graphics/ca/TileController.cpp:
2040         (WebCore::TileController::adjustTileCoverageRect const):
2041         * platform/graphics/ca/TileController.h:
2042
2043 2019-05-26  Simon Fraser  <simon.fraser@apple.com>
2044
2045         Add a GraphicsLayer::Type for ScrolledContents
2046         https://bugs.webkit.org/show_bug.cgi?id=198257
2047
2048         Reviewed by Zalan Bujtas.
2049
2050         This ScrolledContents layer type will be used to choose different tiling behaviors
2051         in a future patch.
2052
2053         * platform/graphics/GraphicsLayer.cpp:
2054         (WebCore::GraphicsLayer::supportsLayerType):
2055         * platform/graphics/GraphicsLayer.h:
2056         * platform/graphics/ca/GraphicsLayerCA.cpp:
2057         (WebCore::GraphicsLayer::supportsLayerType):
2058         (WebCore::GraphicsLayerCA::initialize):
2059         (WebCore::GraphicsLayerCA::adjustCoverageRect const):
2060         * rendering/RenderLayerBacking.cpp:
2061         (WebCore::RenderLayerBacking::updateScrollingLayers):
2062         * rendering/RenderLayerCompositor.cpp:
2063         (WebCore::RenderLayerCompositor::ensureRootLayer):
2064
2065 2019-05-26  John Wilander  <wilander@apple.com>
2066
2067         Resource Load Statistics: Downgrade document.referrer to the referrer's eTLD+1 if the page was navigated to with a prevalent resource referrer containing link decoration
2068         https://bugs.webkit.org/show_bug.cgi?id=198227
2069         <rdar://problem/51117258>
2070
2071         Reviewed by Alex Christensen.
2072
2073         Test: http/tests/resourceLoadStatistics/downgraded-referrer-for-navigation-with-link-query-from-prevalent-resource.html
2074
2075         * Headers.cmake:
2076         * WebCore.xcodeproj/project.pbxproj:
2077         * dom/Document.cpp:
2078         (WebCore::Document::referrer const):
2079             Now checks if the referrer has been overridden.
2080         (WebCore::Document::wasLoadedWithDataTransferFromPrevalentResource):
2081         (WebCore::Document::downgradeReferrerToRegistrableDomain):
2082         * dom/Document.h:
2083         * page/CrossSiteNavigationDataTransfer.h: Added.
2084             New option set for the growing number of navigational data transfers we care about.
2085         * platform/network/NetworkStorageSession.cpp:
2086         (WebCore::NetworkStorageSession::didCommitCrossSiteLoadWithDataTransferFromPrevalentResource):
2087         (WebCore::NetworkStorageSession::committedCrossSiteLoadWithLinkDecoration): Deleted.
2088             New name since we no longer only look for link decoration but also other means of navigational data transfer.
2089         * platform/network/NetworkStorageSession.h:
2090
2091 2019-05-26  Zalan Bujtas  <zalan@apple.com>
2092
2093         [LFC][Verification] Add areEssentiallyEqual for LayoutRect
2094         https://bugs.webkit.org/show_bug.cgi?id=198250
2095         <rdar://problem/51140119>
2096
2097         Reviewed by Antti Koivisto.
2098
2099         WebKit's inline layout is a mix of int/float/LayoutUnit types, while LFC mostly uses LayoutUnit.
2100         When we compute the used size of a block container (based on the inline tree), the final value might go through a few conversions.
2101
2102         * layout/Verification.cpp:
2103         (WebCore::Layout::areEssentiallyEqual):
2104         (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
2105
2106 2019-05-26  Wenson Hsieh  <wenson_hsieh@apple.com>
2107
2108         [iOS] Dropped text, attachments, and images should animate into place
2109         https://bugs.webkit.org/show_bug.cgi?id=198243
2110         <rdar://problem/35205373>
2111
2112         Reviewed by Tim Horton.
2113
2114         Add some hooks to notify the chrome client when an HTMLImageElement's image is finished loading. See WebKit
2115         changelog for more detail.
2116
2117         Test: DragAndDropTests.DropPreviewForImageInEditableArea
2118
2119         * loader/EmptyClients.h:
2120         * page/ChromeClient.h:
2121         * page/Page.cpp:
2122         (WebCore::Page::didFinishLoadingImageForElement):
2123         * page/Page.h:
2124         * rendering/RenderImage.cpp:
2125         (WebCore::RenderImage::notifyFinished):
2126
2127 2019-05-25  Zalan Bujtas  <zalan@apple.com>
2128
2129         [LFC][IFC] Introduce DisplayRun to display tree
2130         https://bugs.webkit.org/show_bug.cgi?id=197198
2131
2132         Reviewed by Antti Koivisto.
2133
2134         Add a simple inline layout implementation. Now we've got DisplayBoxes for layout boxes and
2135         DisplayRuns for inline runs.
2136
2137         * Sources.txt:
2138         * WebCore.xcodeproj/project.pbxproj:
2139         * layout/FormattingContextGeometry.cpp:
2140         (WebCore::Layout::contentHeightForFormattingContextRoot):
2141         * layout/Verification.cpp:
2142         (WebCore::Layout::areEssentiallyEqual):
2143         (WebCore::Layout::outputMismatchingSimpleLineInformationIfNeeded):
2144         (WebCore::Layout::checkForMatchingNonTextRuns):
2145         (WebCore::Layout::checkForMatchingTextRuns):
2146         (WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
2147         (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
2148         (WebCore::Layout::resolveForRelativePositionIfNeeded): Deleted.
2149         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2150         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
2151         * layout/displaytree/DisplayBox.cpp:
2152         (WebCore::Display::Box::marginBox const):
2153         (WebCore::Display::Box::nonCollapsedMarginBox const):
2154         (WebCore::Display::Box::borderBox const):
2155         (WebCore::Display::Box::paddingBox const):
2156         (WebCore::Display::Box::contentBox const):
2157         (WebCore::Display::Box::Rect::Rect): Deleted.
2158         * layout/displaytree/DisplayBox.h:
2159         (WebCore::Display::Box::rectWithMargin const):
2160         (WebCore::Display::Box::horizontalMargin const):
2161         (WebCore::Display::Box::Rect::intersects const): Deleted.
2162         (WebCore::Display::Box::Rect::invalidateTop): Deleted.
2163         (WebCore::Display::Box::Rect::invalidateLeft): Deleted.
2164         (WebCore::Display::Box::Rect::invalidateWidth): Deleted.
2165         (WebCore::Display::Box::Rect::invalidateHeight): Deleted.
2166         (WebCore::Display::Box::Rect::hasValidPosition const): Deleted.
2167         (WebCore::Display::Box::Rect::hasValidSize const): Deleted.
2168         (WebCore::Display::Box::Rect::hasValidGeometry const): Deleted.
2169         (WebCore::Display::Box::Rect::invalidatePosition): Deleted.
2170         (WebCore::Display::Box::Rect::setHasValidPosition): Deleted.
2171         (WebCore::Display::Box::Rect::setHasValidSize): Deleted.
2172         (WebCore::Display::Box::Rect::top const): Deleted.
2173         (WebCore::Display::Box::Rect::left const): Deleted.
2174         (WebCore::Display::Box::Rect::bottom const): Deleted.
2175         (WebCore::Display::Box::Rect::right const): Deleted.
2176         (WebCore::Display::Box::Rect::topLeft const): Deleted.
2177         (WebCore::Display::Box::Rect::bottomRight const): Deleted.
2178         (WebCore::Display::Box::Rect::size const): Deleted.
2179         (WebCore::Display::Box::Rect::width const): Deleted.
2180         (WebCore::Display::Box::Rect::height const): Deleted.
2181         (WebCore::Display::Box::Rect::setTopLeft): Deleted.
2182         (WebCore::Display::Box::Rect::setTop): Deleted.
2183         (WebCore::Display::Box::Rect::setLeft): Deleted.
2184         (WebCore::Display::Box::Rect::setWidth): Deleted.
2185         (WebCore::Display::Box::Rect::setHeight): Deleted.
2186         (WebCore::Display::Box::Rect::setSize): Deleted.
2187         (WebCore::Display::Box::Rect::shiftLeftTo): Deleted.
2188         (WebCore::Display::Box::Rect::shiftRightTo): Deleted.
2189         (WebCore::Display::Box::Rect::shiftTopTo): Deleted.
2190         (WebCore::Display::Box::Rect::shiftBottomTo): Deleted.
2191         (WebCore::Display::Box::Rect::moveHorizontally): Deleted.
2192         (WebCore::Display::Box::Rect::moveVertically): Deleted.
2193         (WebCore::Display::Box::Rect::expand): Deleted.
2194         (WebCore::Display::Box::Rect::clone const): Deleted.
2195         (WebCore::Display::Box::Rect::operator LayoutRect const): Deleted.
2196         * layout/displaytree/DisplayRect.h: Added.
2197         (WebCore::Display::Rect::expandHorizontally):
2198         (WebCore::Display::Rect::expandVertically):
2199         (WebCore::Display::Rect::intersects const):
2200         (WebCore::Display::Rect::invalidateTop):
2201         (WebCore::Display::Rect::invalidateLeft):
2202         (WebCore::Display::Rect::invalidateWidth):
2203         (WebCore::Display::Rect::invalidateHeight):
2204         (WebCore::Display::Rect::hasValidPosition const):
2205         (WebCore::Display::Rect::hasValidSize const):
2206         (WebCore::Display::Rect::hasValidGeometry const):
2207         (WebCore::Display::Rect::Rect):
2208         (WebCore::Display::Rect::invalidatePosition):
2209         (WebCore::Display::Rect::setHasValidPosition):
2210         (WebCore::Display::Rect::setHasValidSize):
2211         (WebCore::Display::Rect::top const):
2212         (WebCore::Display::Rect::left const):
2213         (WebCore::Display::Rect::bottom const):
2214         (WebCore::Display::Rect::right const):
2215         (WebCore::Display::Rect::topLeft const):
2216         (WebCore::Display::Rect::bottomRight const):
2217         (WebCore::Display::Rect::size const):
2218         (WebCore::Display::Rect::width const):
2219         (WebCore::Display::Rect::height const):
2220         (WebCore::Display::Rect::setTopLeft):
2221         (WebCore::Display::Rect::setTop):
2222         (WebCore::Display::Rect::setLeft):
2223         (WebCore::Display::Rect::setWidth):
2224         (WebCore::Display::Rect::setHeight):
2225         (WebCore::Display::Rect::setSize):
2226         (WebCore::Display::Rect::shiftLeftTo):
2227         (WebCore::Display::Rect::shiftRightTo):
2228         (WebCore::Display::Rect::shiftTopTo):
2229         (WebCore::Display::Rect::shiftBottomTo):
2230         (WebCore::Display::Rect::moveHorizontally):
2231         (WebCore::Display::Rect::moveVertically):
2232         (WebCore::Display::Rect::expand):
2233         (WebCore::Display::Rect::clone const):
2234         (WebCore::Display::Rect::operator LayoutRect const):
2235         * layout/displaytree/DisplayRun.h: Renamed from Source/WebCore/layout/inlineformatting/InlineRun.h.
2236         (WebCore::Display::Run::TextContext::start const):
2237         (WebCore::Display::Run::TextContext::end const):
2238         (WebCore::Display::Run::TextContext::length const):
2239         (WebCore::Display::Run::TextContext::expand):
2240         (WebCore::Display::Run::logicalTopLeft const):
2241         (WebCore::Display::Run::logicalLeft const):
2242         (WebCore::Display::Run::logicalRight const):
2243         (WebCore::Display::Run::logicalTop const):
2244         (WebCore::Display::Run::logicalBottom const):
2245         (WebCore::Display::Run::logicalWidth const):
2246         (WebCore::Display::Run::logicalHeight const):
2247         (WebCore::Display::Run::setLogicalWidth):
2248         (WebCore::Display::Run::setLogicalTop):
2249         (WebCore::Display::Run::setLogicalLeft):
2250         (WebCore::Display::Run::setLogicalRight):
2251         (WebCore::Display::Run::moveVertically):
2252         (WebCore::Display::Run::moveHorizontally):
2253         (WebCore::Display::Run::expandVertically):
2254         (WebCore::Display::Run::expandHorizontally):
2255         (WebCore::Display::Run::setTextContext):
2256         (WebCore::Display::Run::textContext):
2257         (WebCore::Display::Run::textContext const):
2258         (WebCore::Display::Run::Run):
2259         (WebCore::Display::Run::TextContext::TextContext):
2260         * layout/floats/FloatAvoider.cpp:
2261         (WebCore::Layout::FloatAvoider::rectInContainingBlock const):
2262         * layout/floats/FloatAvoider.h:
2263         (WebCore::Layout::FloatAvoider::rect const):
2264         * layout/floats/FloatBox.cpp:
2265         (WebCore::Layout::FloatBox::rect const):
2266         * layout/floats/FloatBox.h:
2267         * layout/floats/FloatingContext.cpp:
2268         (WebCore::Layout::FloatPair::intersects const):
2269         * layout/floats/FloatingState.h:
2270         (WebCore::Layout::FloatingState::FloatItem::rectWithMargin const):
2271         * layout/inlineformatting/InlineFormattingContext.cpp:
2272         (WebCore::Layout::InlineFormattingContext::layout const):
2273         (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthConstraints const):
2274         (WebCore::Layout::InlineFormattingContext::initializeMarginBorderAndPaddingForGenericInlineBox const):
2275         (WebCore::Layout::InlineFormattingContext::computeMarginBorderAndPaddingForInlineContainer const):
2276         (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFloatBox const):
2277         (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForInlineBlock const):
2278         (WebCore::Layout::InlineFormattingContext::computeHorizontalMargin const):
2279         (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
2280         (WebCore::Layout::InlineFormattingContext::collectInlineContent const):
2281         (WebCore::Layout::InlineFormattingContext::computeMargin const): Deleted.
2282         (WebCore::Layout::addDetachingRules): Deleted.
2283         (WebCore::Layout::createAndAppendInlineItem): Deleted.
2284         * layout/inlineformatting/InlineFormattingContext.h:
2285         (WebCore::Layout::InlineFormattingContext::LineLayout::layoutState const):
2286         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
2287         (WebCore::Layout::halfLeadingMetrics):
2288         (WebCore::Layout::Line::availableWidth const):
2289         (WebCore::Layout::Line::contentLogicalRight const):
2290         (WebCore::Layout::Line::contentLogicalWidth const):
2291         (WebCore::Layout::Line::logicalTop const):
2292         (WebCore::Layout::Line::logicalLeft const):
2293         (WebCore::Layout::Line::logicalRight const):
2294         (WebCore::Layout::Line::logicalBottom const):
2295         (WebCore::Layout::Line::logicalWidth const):
2296         (WebCore::Layout::Line::logicalHeight const):
2297         (WebCore::Layout::Line::LineItem::LineItem):
2298         (WebCore::Layout::Line::Line):
2299         (WebCore::Layout::Line::reset):
2300         (WebCore::Layout::Line::close):
2301         (WebCore::Layout::Line::removeTrailingTrimmableContent):
2302         (WebCore::Layout::Line::moveLogicalLeft):
2303         (WebCore::Layout::Line::moveLogicalRight):
2304         (WebCore::Layout::isTrimmableContent):
2305         (WebCore::Layout::Line::trailingTrimmableWidth const):
2306         (WebCore::Layout::Line::hasContent const):
2307         (WebCore::Layout::Line::appendNonBreakableSpace):
2308         (WebCore::Layout::Line::appendInlineContainerStart):
2309         (WebCore::Layout::Line::appendInlineContainerEnd):
2310         (WebCore::Layout::Line::appendTextContent):
2311         (WebCore::Layout::Line::appendNonTextContent):
2312         (WebCore::Layout::Line::appendHardLineBreak):
2313         (WebCore::Layout::UncommittedContent::isEmpty const):
2314         (WebCore::Layout::UncommittedContent::width const):
2315         (WebCore::Layout::UncommittedContent::add):
2316         (WebCore::Layout::UncommittedContent::reset):
2317         (WebCore::Layout::InlineFormattingContext::LineLayout::LineLayout):
2318         (WebCore::Layout::InlineFormattingContext::LineLayout::initializeLine const):
2319         (WebCore::Layout::InlineFormattingContext::LineLayout::layout const):
2320         (WebCore::Layout::InlineFormattingContext::LineLayout::closeLine const):
2321         (WebCore::Layout::InlineFormattingContext::LineLayout::handleFloat const):
2322         (WebCore::Layout::InlineFormattingContext::LineLayout::commitInlineItemToLine const):
2323         (WebCore::Layout::horizontalAdjustmentForAlignment):
2324         (WebCore::Layout::InlineFormattingContext::LineLayout::alignRuns const):
2325         (WebCore::Layout::Line::isClosed const): Deleted.
2326         (WebCore::Layout::Line::isFirstLine const): Deleted.
2327         (WebCore::Layout::Line::runs): Deleted.
2328         (WebCore::Layout::Line::contentLogicalLeft const): Deleted.
2329         (WebCore::Layout::Line::lastRunType const): Deleted.
2330         (WebCore::Layout::Line::init): Deleted.
2331         (WebCore::Layout::Line::adjustLogicalLeft): Deleted.
2332         (WebCore::Layout::Line::adjustLogicalRight): Deleted.
2333         (WebCore::Layout::Line::appendContent): Deleted.
2334         (WebCore::Layout::InlineFormattingContext::LineLayout::initializeNewLine const): Deleted.
2335         (WebCore::Layout::InlineFormattingContext::LineLayout::splitInlineRunIfNeeded const): Deleted.
2336         (WebCore::Layout::InlineFormattingContext::LineLayout::createFinalRuns const): Deleted.
2337         (WebCore::Layout::InlineFormattingContext::LineLayout::postProcessInlineRuns const): Deleted.
2338         (WebCore::Layout::InlineFormattingContext::LineLayout::appendContentToLine const): Deleted.
2339         (WebCore::Layout::InlineFormattingContext::LineLayout::computeFloatPosition const): Deleted.
2340         (WebCore::Layout::InlineFormattingContext::LineLayout::placeInFlowPositionedChildren const): Deleted.
2341         (WebCore::Layout::adjustedLineLogicalLeft): Deleted.
2342         (WebCore::Layout::InlineFormattingContext::LineLayout::justifyRuns): Deleted.
2343         (WebCore::Layout::InlineFormattingContext::LineLayout::computeExpansionOpportunities const): Deleted.
2344         (WebCore::Layout::InlineFormattingContext::LineLayout::runWidth const): Deleted.
2345         * layout/inlineformatting/InlineFormattingState.h:
2346         (WebCore::Layout::InlineFormattingState::inlineItems):
2347         (WebCore::Layout::InlineFormattingState::lineBoxes):
2348         (WebCore::Layout::InlineFormattingState::addInlineItem):
2349         (WebCore::Layout::InlineFormattingState::addInlineRun):
2350         (WebCore::Layout::InlineFormattingState::addLineBox):
2351         (WebCore::Layout::InlineFormattingState::inlineContent): Deleted.
2352         (WebCore::Layout::InlineFormattingState::lastInlineItem const): Deleted.
2353         (WebCore::Layout::InlineFormattingState::appendInlineRun): Deleted.
2354         * layout/inlineformatting/InlineItem.h:
2355         (WebCore::Layout::InlineItem::type const):
2356         (WebCore::Layout::InlineItem::isText const):
2357         (WebCore::Layout::InlineItem::isBox const):
2358         (WebCore::Layout::InlineItem::isHardLineBreak const):
2359         (WebCore::Layout::InlineItem::isFloat const):
2360         (WebCore::Layout::InlineItem::isLineBreak const):
2361         (WebCore::Layout::InlineItem::isContainerStart const):
2362         (WebCore::Layout::InlineItem::isContainerEnd const):
2363         (WebCore::Layout::InlineItem::InlineItem):
2364         (WebCore::Layout::InlineItem::setWidth):
2365         (WebCore::Layout::InlineItem::width const):
2366         (WebCore::Layout::InlineItem::addDetachingRule): Deleted.
2367         (WebCore::Layout::InlineItem::detachingRules const): Deleted.
2368         (WebCore::Layout::InlineItem::nonBreakableStart const): Deleted.
2369         (WebCore::Layout::InlineItem::nonBreakableEnd const): Deleted.
2370         (WebCore::Layout::InlineItem::addNonBreakableStart): Deleted.
2371         (WebCore::Layout::InlineItem::addNonBreakableEnd): Deleted.
2372         (WebCore::Layout::InlineItem::textContent const): Deleted.
2373         * layout/inlineformatting/InlineLineBox.h: Copied from Source/WebCore/layout/floats/FloatBox.h.
2374         (WebCore::Layout::LineBox::logicalTopLeft const):
2375         (WebCore::Layout::LineBox::logicalLeft const):
2376         (WebCore::Layout::LineBox::logicalRight const):
2377         (WebCore::Layout::LineBox::logicalTop const):
2378         (WebCore::Layout::LineBox::logicalBottom const):
2379         (WebCore::Layout::LineBox::logicalWidth const):
2380         (WebCore::Layout::LineBox::logicalHeight const):
2381         (WebCore::Layout::LineBox::LineBox):
2382         * layout/inlineformatting/InlineLineBreaker.cpp:
2383         (WebCore::Layout::LineBreaker::LineBreaker):
2384         (WebCore::Layout::LineBreaker::breakingContext):
2385         (WebCore::Layout::LineBreaker::wordBreakingBehavior const):
2386         (WebCore::Layout::LineBreaker::runWidth const):
2387         (WebCore::Layout::LineBreaker::isAtBreakingOpportunity):
2388         (WebCore::Layout::LineBreaker::textWidth const):
2389         (WebCore::Layout::InlineLineBreaker::InlineLineBreaker): Deleted.
2390         (WebCore::Layout::InlineLineBreaker::nextRun): Deleted.
2391         (WebCore::Layout::InlineLineBreaker::isAtContentEnd const): Deleted.
2392         (WebCore::Layout::InlineLineBreaker::lineBreakingBehavior): Deleted.
2393         (WebCore::Layout::InlineLineBreaker::runWidth const): Deleted.
2394         (WebCore::Layout::InlineLineBreaker::textWidth const): Deleted.
2395         (WebCore::Layout::InlineLineBreaker::splitRun): Deleted.
2396         (WebCore::Layout::InlineLineBreaker::adjustSplitPositionWithHyphenation const): Deleted.
2397         * layout/inlineformatting/InlineLineBreaker.h:
2398         * layout/inlineformatting/InlineRunProvider.cpp: Removed.
2399         * layout/inlineformatting/InlineRunProvider.h: Removed.
2400         * layout/inlineformatting/InlineTextItem.cpp: Added.
2401         (WebCore::Layout::isWhitespaceCharacter):
2402         (WebCore::Layout::isSoftLineBreak):
2403         (WebCore::Layout::moveToNextNonWhitespacePosition):
2404         (WebCore::Layout::moveToNextBreakablePosition):
2405         (WebCore::Layout::InlineTextItem::createAndAppendTextItems):
2406         (WebCore::Layout::InlineTextItem::InlineTextItem):
2407         * layout/inlineformatting/InlineTextItem.h: Copied from Source/WebCore/layout/inlineformatting/text/TextUtil.h.
2408         (WebCore::Layout::InlineTextItem::start const):
2409         (WebCore::Layout::InlineTextItem::end const):
2410         (WebCore::Layout::InlineTextItem::length const):
2411         (WebCore::Layout::InlineTextItem::isWhitespace const):
2412         (WebCore::Layout::InlineTextItem::isCollapsed const):
2413         * layout/inlineformatting/text/TextUtil.cpp:
2414         (WebCore::Layout::TextUtil::hyphenPositionBefore):
2415         (WebCore::Layout::TextUtil::width):
2416         (WebCore::Layout::TextUtil::fixedPitchWidth):
2417         * layout/inlineformatting/text/TextUtil.h:
2418         * layout/layouttree/LayoutBox.h:
2419         * layout/layouttree/LayoutReplaced.cpp:
2420         (WebCore::Layout::Replaced::intrinsicRatio const):
2421         * layout/layouttree/LayoutTreeBuilder.cpp:
2422         (WebCore::Layout::accumulatedOffsetForInFlowPositionedContinuation):
2423         (WebCore::Layout::TreeBuilder::createSubTree):
2424         (WebCore::Layout::outputInlineRuns):
2425         (WebCore::Layout::outputLayoutBox):
2426
2427 2019-05-25  Wenson Hsieh  <wenson_hsieh@apple.com>
2428
2429         [iOS] Respect -[NSItemProvider preferredPresentationSize] when dropping images
2430         https://bugs.webkit.org/show_bug.cgi?id=198242
2431
2432         Reviewed by Beth Dakin.
2433
2434         Teach the web content reader to respect the -preferredPresentationSize when creating attachment-backed image
2435         elements. See below for more details.
2436
2437         Test: WKAttachmentTestsIOS.InsertDroppedImageWithPreferredPresentationSize
2438
2439         * editing/WebContentReader.h:
2440         * editing/cocoa/WebContentReaderCocoa.mm:
2441         (WebCore::attachmentForFilePath):
2442         (WebCore::attachmentForData):
2443
2444         When creating attachment-backed image elements, additionally set width and height attributes from the preferred
2445         presentation size, if specified.
2446
2447         (WebCore::WebContentReader::readFilePath):
2448
2449         Add a version of readFilePath that takes a single file path, and an optional preferred presentation size.
2450
2451         (WebCore::WebContentReader::readFilePaths):
2452
2453         Reimplement readFilePaths in terms of readFilePath.
2454
2455         (WebCore::WebContentReader::readDataBuffer):
2456
2457         Add more plumbing for preferredPresentationSize.
2458
2459         * platform/Pasteboard.h:
2460         (WebCore::PasteboardWebContentReader::readFilePath):
2461         (WebCore::PasteboardWebContentReader::readDataBuffer):
2462         * platform/ios/PasteboardIOS.mm:
2463         (WebCore::Pasteboard::read):
2464         (WebCore::Pasteboard::readRespectingUTIFidelities):
2465
2466         Forward PasteboardItemInfo's preferredPresentationSize to the web content reader.
2467
2468 2019-05-25  Antoine Quint  <graouts@apple.com>
2469
2470         Opt naver.com into simulated mouse events quirk on iOS
2471         https://bugs.webkit.org/show_bug.cgi?id=198248
2472         <rdar://problem/50598281>
2473
2474         Reviewed by Brent Fulgham.
2475
2476         * page/Quirks.cpp:
2477         (WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):
2478
2479 2019-05-25  Youenn Fablet  <youenn@apple.com>
2480
2481         media/video-remote-control-playpause.html is timing out after r245712
2482         https://bugs.webkit.org/show_bug.cgi?id=198238
2483
2484         Reviewed by Eric Carlson.
2485
2486         Fix regression introduced in r245712.
2487         Covered by test no longer timing out.
2488
2489         * platform/audio/PlatformMediaSessionManager.cpp:
2490         (WebCore::PlatformMediaSessionManager::sessionWillEndPlayback):
2491
2492 2019-05-25  Simon Fraser  <simon.fraser@apple.com>
2493
2494         [Async overflow scrolling] Absolute positioned element inside async overflow scroll didn't get composited sometimes
2495         https://bugs.webkit.org/show_bug.cgi?id=198237
2496
2497         Reviewed by Antti Koivisto.
2498
2499         The logic in requiresCompositingForIndirectReason() that decides if we need to do
2500         compositing for a layer that needs to move independently of its enclosing scroller
2501         was wrong.
2502
2503         Instead of asking question about the enclosing compositing layer, it needs to ask
2504         whether it has different positioning behavior from the layer that it would
2505         otherwise paint into, which is its paint-order parent.
2506
2507         "paintsIntoProvidedBacking" already does a containing-block check against the
2508         scroller, so we know we don't have to do the check in that case.
2509
2510         Test: scrollingcoordinator/scrolling-tree/absolute-inside-stacking-in-scroller.html
2511
2512         * rendering/RenderLayerCompositor.cpp:
2513         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
2514         (WebCore::enclosingCompositedScrollingLayer):
2515         (WebCore::isScrolledByOverflowScrollLayer):
2516         (WebCore::isNonScrolledLayerInsideScrolledCompositedAncestor):
2517         (WebCore::RenderLayerCompositor::requiresCompositingForIndirectReason const):
2518         * rendering/RenderLayerCompositor.h:
2519
2520 2019-05-25  Simon Fraser  <simon.fraser@apple.com>
2521
2522         [macOS] Fix programmatic scroll in RTL overflow with async scrolling enabled
2523         https://bugs.webkit.org/show_bug.cgi?id=198226
2524
2525         Reviewed by Antti Koivisto.
2526
2527         On macOS we need to use a scroll offset to set the layer position, not
2528         a scroll position.
2529
2530         Test: scrollingcoordinator/mac/rtl-programmatic-overflow-scroll.html
2531
2532         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
2533         (WebCore::ScrollingTreeOverflowScrollingNodeMac::repositionScrollingLayers):
2534
2535 2019-05-24  Joonghun Park  <jh718.park@samsung.com>
2536
2537         Make computed width of non-replaced inline return computed style.
2538         https://bugs.webkit.org/show_bug.cgi?id=197814
2539
2540         Reviewed by Antti Koivisto.
2541
2542         Currently, Computed width of non-replaced inline incorrectly returns "auto"
2543         instead of the computed value.
2544         This patch changes the behavior according to
2545         https://drafts.csswg.org/cssom/#resolved-value as below.
2546
2547         'If the property applies to the element or pseudo-element
2548         and the resolved value of the display property is not none or contents,
2549         then the resolved value is the used value.
2550         Otherwise the resolved value is the computed value.'
2551
2552         * css/CSSComputedStyleDeclaration.cpp:
2553         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
2554
2555 2019-05-24  Myles C. Maxfield  <mmaxfield@apple.com>
2556
2557         [WHLSL] Allow vertex attributes to have arbitrary names in the shader
2558         https://bugs.webkit.org/show_bug.cgi?id=198235
2559
2560         Reviewed by Dean Jackson and Justin Fan.
2561
2562         Metal doesn't allow arbitrary vertex attribute IDs. If you try to create a vertex attribute > 16,
2563         the Metal validation layer will assert. So, we need to have a mapping from whatever the WebGPU
2564         API says the vertex attribute IDs should be to the internally-used vertex attribute IDs.
2565
2566         Test: webgpu/whlsl-arbitrary-vertex-attribute-locations.html
2567
2568         * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp:
2569         (WebCore::WHLSL::Metal::VertexEntryPointScaffolding::VertexEntryPointScaffolding):
2570         * Modules/webgpu/WHLSL/WHLSLPipelineDescriptor.h:
2571         * Modules/webgpu/WHLSL/WHLSLSemanticMatcher.cpp:
2572         (WebCore::WHLSL::matchVertexAttributes):
2573         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
2574         (WebCore::convertRenderPipelineDescriptor):
2575         (WebCore::trySetInputStateForPipelineDescriptor):
2576
2577 2019-05-24  Timothy Hatcher  <timothy@apple.com>
2578
2579         Refactor how showLetterpressedGlyphsWithAdvances gets the graphics context.
2580         https://bugs.webkit.org/show_bug.cgi?id=198225
2581
2582         Reviewed by Dean Jackson.
2583
2584         * platform/graphics/cocoa/FontCascadeCocoa.mm:
2585         (WebCore::showLetterpressedGlyphsWithAdvances):
2586         (WebCore::FontCascade::drawGlyphs):
2587
2588 2019-05-24  Timothy Hatcher  <timothy@apple.com>
2589
2590         Plumb dark appearance down to GraphicsContext.
2591         https://bugs.webkit.org/show_bug.cgi?id=198224
2592         rdar://problem/51068494
2593
2594         Reviewed by Dean Jackson.
2595
2596         No test yet, as it is not testable until this gets used.
2597
2598         * platform/graphics/GraphicsContext.cpp:
2599         (WebCore::GraphicsContextStateChange::changesFromState const):
2600         (WebCore::GraphicsContextStateChange::accumulate):
2601         (WebCore::GraphicsContextStateChange::apply const):
2602         (WebCore::GraphicsContextStateChange::dump const):
2603         (WebCore::GraphicsContext::setUseDarkAppearance):
2604         * platform/graphics/GraphicsContext.h:
2605         (WebCore::GraphicsContext::useDarkAppearance const):
2606         * rendering/TextPaintStyle.cpp:
2607         (WebCore::TextPaintStyle::operator== const):
2608         (WebCore::computeTextPaintStyle):
2609         (WebCore::updateGraphicsContext):
2610         * rendering/TextPaintStyle.h:
2611
2612 2019-05-24  Youenn Fablet  <youenn@apple.com>
2613
2614         Make sure completion handler is always called in SWServer::startSuspension
2615         https://bugs.webkit.org/show_bug.cgi?id=198215
2616
2617         Reviewed by Alex Christensen.
2618
2619         * workers/service/server/SWServer.cpp:
2620         (WebCore::SWServer::startSuspension):
2621         Make sure completion handler is called in case of no registration store.
2622
2623 2019-05-24  Ryosuke Niwa  <rniwa@webkit.org>
2624
2625         Asssertion failure in dispatchSubtreeModifiedEvent due to TextFieldInputType updating UA shadow tree inside Element::removedFromAncestor
2626         https://bugs.webkit.org/show_bug.cgi?id=198216
2627
2628         Reviewed by Brent Fulgham.
2629
2630         The bug was caused by ListAttributeTargetObserver::idTargetChanged() updating the shadow tree of an input element
2631         within Element::removedFromAncestor via TextFieldInputType::createDataListDropdownIndicator(). Fixed it by
2632         supressing the assertions with ScriptDisallowedScope::EventAllowedScope since it's always safe to update
2633         UA shadow trees of input elements as it's not exposed to author scripts.
2634
2635         Avoiding the creation of dropdown indicator in this particular scenario is a lot more involved and it's not
2636         particularly correct because there could be another datalist element which matches the ID specified in list
2637         content attribute after the removal of the old datalist element.
2638
2639         Test: fast/forms/datalist/datalist-removal-assertion.html
2640
2641         * html/TextFieldInputType.cpp:
2642         (WebCore::TextFieldInputType::createDataListDropdownIndicator):
2643         (WebCore::TextFieldInputType::createContainer):
2644         * html/shadow/DataListButtonElement.cpp:
2645         (WebCore::DataListButtonElement::DataListButtonElement):
2646
2647 2019-05-24  Saam barati  <sbarati@apple.com>
2648
2649         [WHLSL] ReadModifyWriteExpression always has a result and new value expression
2650         https://bugs.webkit.org/show_bug.cgi?id=198079
2651
2652         Reviewed by Myles Maxfield.
2653
2654         Let's not pretend it might not.
2655
2656         * Modules/webgpu/WHLSL/AST/WHLSLReadModifyWriteExpression.h:
2657         (WebCore::WHLSL::AST::ReadModifyWriteExpression::newValueExpression):
2658         (WebCore::WHLSL::AST::ReadModifyWriteExpression::resultExpression):
2659         (WebCore::WHLSL::AST::ReadModifyWriteExpression::takeNewValueExpression):
2660         (WebCore::WHLSL::AST::ReadModifyWriteExpression::takeResultExpression):
2661         * Modules/webgpu/WHLSL/WHLSLASTDumper.cpp:
2662         (WebCore::WHLSL::ASTDumper::visit):
2663         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
2664         (WebCore::WHLSL::Checker::visit):
2665         * Modules/webgpu/WHLSL/WHLSLPropertyResolver.cpp:
2666         (WebCore::WHLSL::PropertyResolver::visit):
2667         * Modules/webgpu/WHLSL/WHLSLVisitor.cpp:
2668         (WebCore::WHLSL::Visitor::visit):
2669
2670 2019-05-23  Simon Fraser  <simon.fraser@apple.com>
2671
2672         With async overflow scrolling, programmatic scroll to a negative offset fails to clamp the scroll offset
2673         https://bugs.webkit.org/show_bug.cgi?id=198208
2674         <rdar://problem/49720087>
2675
2676         Reviewed by Zalan Bujtas.
2677
2678         RenderLayer::scrollToOffset() needs to pass the clamped offset to scrollingCoordinator->requestScrollPositionUpdate(),
2679         otherwise the scrolling tree will round-trip a negative value and scrollLeft will end up negative.
2680
2681         Test: fast/scrolling/programmatic-scroll-to-negative-offset.html
2682
2683         * rendering/RenderLayer.cpp:
2684         (WebCore::RenderLayer::scrollToOffset):
2685
2686 2019-05-23  Devin Rousso  <drousso@apple.com>
2687
2688         Web Inspector: Overlay: rulers/guides should be shown whenever element selection is enabled
2689         https://bugs.webkit.org/show_bug.cgi?id=198088
2690
2691         Reviewed by Timothy Hatcher.
2692
2693         When trying to "measure" the absolute position (to the viewport) or relative position (to
2694         another element) of a given element, often the easiest way is to enable Element Selection
2695         and Show Rulers at the same time.
2696
2697         This can have the undesired "side-effect" of having the rulers be always present, even when
2698         not highlighting any nodes.
2699
2700         The ideal functionality is to allow the rulers/guides to be shown when element selection is
2701         active and a node is hovered, regardless of whether "Show Rulers" is enabled.
2702
2703         * inspector/InspectorOverlay.h:
2704         (WebCore::InspectorOverlay::setShowRulersDuringElementSelection): Added.
2705         * inspector/InspectorOverlay.cpp:
2706         (WebCore::InspectorOverlay::paint):
2707         (WebCore::InspectorOverlay::shouldShowOverlay):
2708         (WebCore::InspectorOverlay::drawNodeHighlight):
2709         (WebCore::InspectorOverlay::drawQuadHighlight):
2710         (WebCore::InspectorOverlay::drawElementTitle):
2711         If `showRulersDuringElementSelection` is enabled, draw rulers whenever any highlight bounds
2712         are calculated, but don't update the overlay if it's the only thing enabled (e.g. if there's
2713         no currently hovered node, the overlay will disappear).
2714
2715         * inspector/agents/InspectorDOMAgent.cpp:
2716         (WebCore::InspectorDOMAgent::willDestroyFrontendAndBackend):
2717         (WebCore::InspectorDOMAgent::inspect):
2718         (WebCore::InspectorDOMAgent::setInspectModeEnabled):
2719         (WebCore::InspectorDOMAgent::setSearchingForNode):
2720         Add an optional `showRulers` parameter to `DOM.setInspectModeEnabled` that supersedes the
2721         current value of `Page.setShowRulers` as to whether rulers/guides are shown.
2722
2723 2019-05-23  Devin Rousso  <drousso@apple.com>
2724
2725         Web Inspector: Overlay: rulers should switch sides if they intersect the highlighted node(s) so they don't obstruct any content
2726         https://bugs.webkit.org/show_bug.cgi?id=198165
2727
2728         Reviewed by Timothy Hatcher.
2729
2730         If the highlighted node is against the top edge of the screen, the top ruler should shift to
2731         the bottom, unless the highlighted node is also against the bottom edge of the screen.
2732
2733         If the highlighted node is against the left edge of the screen, the left ruler should shift
2734         to the right, unless the highlighted node is also against the right edge of the screen.
2735
2736         This way, unless the node is very wide/tall, the rulers won't be drawn on top of anything
2737         being highlighted.
2738
2739         * inspector/InspectorOverlay.h:
2740         * inspector/InspectorOverlay.cpp:
2741         (WebCore::InspectorOverlay::paint):
2742         (WebCore::InspectorOverlay::drawNodeHighlight):
2743         (WebCore::InspectorOverlay::drawQuadHighlight):
2744         (WebCore::InspectorOverlay::drawBounds):
2745         (WebCore::InspectorOverlay::drawRulers):
2746         Drive-by: create an alias for the type (`FloatRect`) used when calculating the bounds of
2747                   everything that's highlighted.
2748
2749 2019-05-23  Saam barati  <sbarati@apple.com>
2750
2751         [WHLSL] Make the AST dumper disambiguate expressions using parenthesis to represent AST construction
2752         https://bugs.webkit.org/show_bug.cgi?id=198199
2753
2754         Reviewed by Myles C. Maxfield.
2755
2756         We would dump "*foo.bar" for "(*foo).bar", which is super confusing.
2757         We now dump "(*foo).bar".
2758
2759         * Modules/webgpu/WHLSL/WHLSLASTDumper.cpp:
2760         (WebCore::WHLSL::ASTDumper::visit):
2761
2762 2019-05-23  Saam barati  <sbarati@apple.com>
2763
2764         [WHLSL] Don't wrap anonymous variables in parens in the AST dumper
2765         https://bugs.webkit.org/show_bug.cgi?id=198196
2766
2767         Reviewed by Myles C. Maxfield.
2768
2769         This makes the dump of 'foo.bar.x = 42' go from
2770         ($(0x7f86d9d94440) = &foo, $(0x7f86d9d944e0) = operator.bar(*$(0x7f86d9d94440)), $(0x7f86d9d944e0) = operator.x=($(0x7f86d9d944e0), 42), *$(0x7f86d9d94440) = operator.bar=(*$(0x7f86d9d94440), $(0x7f86d9d944e0)));
2771         
2772         to:
2773         ($0x7f86d9d94440 = &foo, $0x7f86d9d944e0 = operator.bar(*$0x7f86d9d94440), $0x7f86d9d944e0 = operator.x=($0x7f86d9d944e0, 42), *$0x7f86d9d94440 = operator.bar=(*$0x7f86d9d94440, $0x7f86d9d944e0));
2774
2775         * Modules/webgpu/WHLSL/WHLSLASTDumper.cpp:
2776         (WebCore::WHLSL::ASTDumper::visit):
2777
2778 2019-05-23  Myles C. Maxfield  <mmaxfield@apple.com>
2779
2780         [WHLSL] Implement property resolver
2781         https://bugs.webkit.org/show_bug.cgi?id=195925
2782         <rdar://problem/48219643>
2783
2784         Unreviewed watchOS build fix.
2785
2786         * Modules/webgpu/WHLSL/AST/WHLSLAssignmentExpression.h:
2787         (WebCore::WHLSL::AST::AssignmentExpression::AssignmentExpression):
2788
2789 2019-05-23  Saam barati  <sbarati@apple.com>
2790
2791         [WHLSL] Property resolver needs to recurse to handle the base when simplifying rvalues
2792         https://bugs.webkit.org/show_bug.cgi?id=198193
2793
2794         Reviewed by Myles Maxfield.
2795
2796         We were only transforming the top most node in the AST. So things like
2797         'x = foo.bar' would work, but 'x = foo.bar.baz' would not.
2798
2799         Test: webgpu/whlsl-nested-dot-expression-rvalue.html
2800
2801         * Modules/webgpu/WHLSL/WHLSLPropertyResolver.cpp:
2802         (WebCore::WHLSL::PropertyResolver::simplifyRightValue):
2803
2804 2019-05-22  Stephanie Lewis  <slewis@apple.com>
2805
2806         release builds of webkit cannot be used to generate a dyld shared cache
2807         https://bugs.webkit.org/show_bug.cgi?id=198150
2808         <rdar://problem/50675982>
2809
2810         Reviewed by Dan Bernstein.
2811
2812         Restrict the -not_for_dyld_shared_cache linker flag to macosx
2813
2814         * Configurations/WebCore.xcconfig:
2815
2816 2019-05-23  Zalan Bujtas  <zalan@apple.com>
2817
2818         [Hittest] Move hittesting from RenderView to Document
2819         https://bugs.webkit.org/show_bug.cgi?id=198192
2820         <rdar://problem/51077762>
2821
2822         Reviewed by Antti Koivisto.
2823
2824         RenderView is not refcounted and may be destroyed in updateLayout(), so enter hit-testing from Document.
2825
2826         * accessibility/AccessibilityObject.cpp:
2827         (WebCore::AccessibilityObject::press):
2828         * accessibility/AccessibilityRenderObject.cpp:
2829         (WebCore::AccessibilityRenderObject::visiblePositionForPoint const):
2830         * dom/Document.cpp:
2831         (WebCore::FrameFlatteningLayoutDisallower::FrameFlatteningLayoutDisallower):
2832         (WebCore::FrameFlatteningLayoutDisallower::~FrameFlatteningLayoutDisallower):
2833         (WebCore::Document::scheduleStyleRecalc):
2834         (WebCore::Document::prepareMouseEvent):
2835         (WebCore::Document::hitTest):
2836         * dom/Document.h:
2837         (WebCore::Document::inHitTesting const):
2838         * dom/TreeScope.cpp:
2839         (WebCore::TreeScope::nodeFromPoint):
2840         (WebCore::TreeScope::elementsFromPoint):
2841         * editing/FrameSelection.cpp:
2842         (WebCore::FrameSelection::contains const):
2843         * html/HTMLPlugInElement.cpp:
2844         (WebCore::HTMLPlugInElement::isReplacementObscured):
2845         * html/MediaElementSession.cpp:
2846         (WebCore::isElementMainContentForPurposesOfAutoplay):
2847         * page/DragController.cpp:
2848         (WebCore::elementUnderMouse):
2849         * page/EventHandler.cpp:
2850         (WebCore::EventHandler::handleMouseDraggedEvent):
2851         (WebCore::EventHandler::eventMayStartDrag const):
2852         (WebCore::EventHandler::updateSelectionForMouseDrag):
2853         (WebCore::EventHandler::hitTestResultAtPoint const):
2854         (WebCore::EventHandler::updateCursor):
2855         (WebCore::EventHandler::isInsideScrollbar const):
2856         (WebCore::EventHandler::handleWheelEvent):
2857         (WebCore::EventHandler::hoverTimerFired):
2858         (WebCore::EventHandler::handleDrag):
2859         (WebCore::hitTestResultInFrame):
2860         * page/FrameViewLayoutContext.cpp:
2861         (WebCore::FrameViewLayoutContext::setNeedsLayoutAfterViewConfigurationChange):
2862         * rendering/RenderView.cpp:
2863         (WebCore::FrameFlatteningLayoutDisallower::FrameFlatteningLayoutDisallower): Deleted.
2864         (WebCore::FrameFlatteningLayoutDisallower::~FrameFlatteningLayoutDisallower): Deleted.
2865         (): Deleted.
2866         (WebCore::RenderView::hitTest): Deleted.
2867         * rendering/RenderView.h:
2868         * rendering/RenderWidget.cpp:
2869         (WebCore::RenderWidget::nodeAtPoint):
2870         * testing/Internals.cpp:
2871         (WebCore::Internals::nodesFromRect const):
2872
2873 2019-05-23  Youenn Fablet  <youenn@apple.com>
2874
2875         CacheStorageConnection callbacks should be completed on network connection close
2876         https://bugs.webkit.org/show_bug.cgi?id=195757
2877
2878         Reviewed by Alex Christensen.
2879
2880         Move HashMap-based callbacks to WorkerCacheStorageConnection.
2881         Make CacheStorageConnection default API to implement use callbacks.
2882         This is used by WebKit layer to do AsyncReply IPC.
2883
2884         Move DOMCacheEngine callbacks to CompletionHandler.
2885
2886         Test: http/wpt/cache-storage/cache-storage-networkprocess-crash.html
2887
2888         * Modules/cache/CacheStorageConnection.cpp:
2889         * Modules/cache/CacheStorageConnection.h:
2890         (WebCore::CacheStorageConnection::engineRepresentation):
2891         * Modules/cache/DOMCacheEngine.h:
2892         * Modules/cache/WorkerCacheStorageConnection.cpp:
2893         (WebCore::recordsDataFromRecords):
2894         (WebCore::recordsDataOrErrorFromRecords):
2895         (WebCore::recordsFromRecordsData):
2896         (WebCore::recordsOrErrorFromRecordsData):
2897         (WebCore::WorkerCacheStorageConnection::open):
2898         (WebCore::WorkerCacheStorageConnection::openOrRemoveCompleted):
2899         (WebCore::WorkerCacheStorageConnection::remove):
2900         (WebCore::WorkerCacheStorageConnection::retrieveCaches):
2901         (WebCore::WorkerCacheStorageConnection::retrieveCachesCompleted):
2902         (WebCore::WorkerCacheStorageConnection::retrieveRecords):
2903         (WebCore::WorkerCacheStorageConnection::retrieveRecordsCompleted):
2904         (WebCore::WorkerCacheStorageConnection::batchDeleteOperation):
2905         (WebCore::WorkerCacheStorageConnection::deleteRecordsCompleted):
2906         (WebCore::WorkerCacheStorageConnection::batchPutOperation):
2907         (WebCore::WorkerCacheStorageConnection::putRecordsCompleted):
2908         (WebCore::WorkerCacheStorageConnection::reference):
2909         (WebCore::WorkerCacheStorageConnection::dereference):
2910         (WebCore::WorkerCacheStorageConnection::clearPendingRequests):
2911         * Modules/cache/WorkerCacheStorageConnection.h:
2912         * page/CacheStorageProvider.h:
2913         (WebCore::CacheStorageProvider::createCacheStorageConnection):
2914
2915 2019-05-23  Youenn Fablet  <youenn@apple.com>
2916
2917         Multiple videos (with audios) with autoplay & playinline not working. Only one video play at a time.
2918         https://bugs.webkit.org/show_bug.cgi?id=193312
2919         <rdar://problem/47189864>
2920
2921         Reviewed by Jer Noble.
2922
2923         Allow all MediaStream backed video elements to play together.
2924         Any non MediaStream backed video will stop all MediaStream backed video elements.
2925         Conversely, all non MediaStream backed videos will stop when playing one MediaStream backed video.
2926
2927         Refactor PlatformMediaSessionManager as the way to iterate through sessions
2928         is not safe when pausing a session: if playing, the session will be moved in the array of sessions.
2929
2930         To handle this, copy the list of sessions before iterating through them.
2931         For extra safety, make sessions WeakPtr.
2932
2933         Add routines for the case of filtering with a predicate taking a const session.
2934         In that case, we do not copy the vector but iterate through it as a small optimization.
2935
2936         Test: webrtc/concurrentVideoPlayback.html
2937
2938         * html/HTMLMediaElement.cpp:
2939         (WebCore::HTMLMediaElement::bestMediaElementForShowingPlaybackControlsManager):
2940         (WebCore::HTMLMediaElement::hasMediaStreamSource const):
2941         * html/HTMLMediaElement.h:
2942         * platform/audio/PlatformMediaSession.cpp:
2943         (WebCore::PlatformMediaSession::activeAudioSessionRequired const):
2944         (WebCore::PlatformMediaSession::canPlayConcurrently const):
2945         (WebCore::PlatformMediaSession::activeAudioSessionRequired): Deleted.
2946         * platform/audio/PlatformMediaSession.h:
2947         (WebCore::PlatformMediaSessionClient::hasMediaStreamSource const):
2948         * platform/audio/PlatformMediaSessionManager.cpp:
2949         (WebCore::PlatformMediaSessionManager::has const):
2950         (WebCore::PlatformMediaSessionManager::activeAudioSessionRequired const):
2951         (WebCore::PlatformMediaSessionManager::canProduceAudio const):
2952         (WebCore::PlatformMediaSessionManager::count const):
2953         (WebCore::PlatformMediaSessionManager::beginInterruption):
2954         (WebCore::PlatformMediaSessionManager::endInterruption):
2955         (WebCore::PlatformMediaSessionManager::addSession):
2956         (WebCore::PlatformMediaSessionManager::removeSession):
2957         (WebCore::PlatformMediaSessionManager::sessionWillBeginPlayback):
2958         (WebCore::PlatformMediaSessionManager::sessionWillEndPlayback):
2959         (WebCore::PlatformMediaSessionManager::setCurrentSession):
2960         (WebCore::PlatformMediaSessionManager::currentSession const):
2961         (WebCore::PlatformMediaSessionManager::applicationWillBecomeInactive):
2962         (WebCore::PlatformMediaSessionManager::applicationDidBecomeActive):
2963         (WebCore::PlatformMediaSessionManager::applicationDidEnterBackground):
2964         (WebCore::PlatformMediaSessionManager::applicationWillEnterForeground):
2965         (WebCore::PlatformMediaSessionManager::systemWillSleep):
2966         (WebCore::PlatformMediaSessionManager::systemDidWake):
2967         (WebCore::PlatformMediaSessionManager::stopAllMediaPlaybackForDocument):
2968         (WebCore::PlatformMediaSessionManager::stopAllMediaPlaybackForProcess):
2969         (WebCore::PlatformMediaSessionManager::suspendAllMediaPlaybackForDocument):
2970         (WebCore::PlatformMediaSessionManager::resumeAllMediaPlaybackForDocument):
2971         (WebCore::PlatformMediaSessionManager::suspendAllMediaBufferingForDocument):
2972         (WebCore::PlatformMediaSessionManager::resumeAllMediaBufferingForDocument):
2973         (WebCore::PlatformMediaSessionManager::currentSessionsMatching const):
2974         (WebCore::PlatformMediaSessionManager::forEachMatchingSession):
2975         (WebCore::PlatformMediaSessionManager::forEachMatchingSession const):
2976         (WebCore::PlatformMediaSessionManager::forEachSession):
2977         (WebCore::PlatformMediaSessionManager::anyOfSessions const):
2978         (): Deleted.
2979         (WebCore::PlatformMediaSessionManager::applicationWillBecomeInactive const): Deleted.
2980         (WebCore::PlatformMediaSessionManager::applicationDidBecomeActive const): Deleted.
2981         (WebCore::PlatformMediaSessionManager::applicationDidEnterBackground const): Deleted.
2982         (WebCore::PlatformMediaSessionManager::applicationWillEnterForeground const): Deleted.
2983         (WebCore::PlatformMediaSessionManager::forEachSession const): Deleted.
2984         (WebCore::PlatformMediaSessionManager::findSession const): Deleted.
2985         * platform/audio/PlatformMediaSessionManager.h:
2986         (WebCore::PlatformMediaSessionManager::anyOfSessions const): Deleted.
2987         * platform/audio/cocoa/MediaSessionManagerCocoa.mm:
2988         (MediaSessionManagerCocoa::updateSessionState):
2989         (MediaSessionManagerCocoa::beginInterruption):
2990         * platform/audio/ios/MediaSessionManagerIOS.mm:
2991         (WebCore::MediaSessionManageriOS::configureWireLessTargetMonitoring):
2992         (WebCore::MediaSessionManageriOS::externalOutputDeviceAvailableDidChange):
2993
2994 2019-05-23  Saam barati  <sbarati@apple.com>
2995
2996         [WHLSL] Add a helper for in-place AST mutation
2997         https://bugs.webkit.org/show_bug.cgi?id=198175
2998
2999         Reviewed by Myles Maxfield.
3000
3001         This makes WHLSL AST mutation code a bit easier to read and write.
3002         
3003         Code that looked like:
3004         ```
3005         static_assert(sizeof(AST::DereferenceExpression) <= sizeof(AST::DotExpression), "Dot expressions need to be able to become dereference expressions without updating backreferences");
3006         void* location = &dotExpression;
3007         dotExpression.~DotExpression();
3008         auto* dereferenceExpression = new (location) AST::DereferenceExpression(WTFMove(origin), WTFMove(callExpression));
3009         ```
3010         
3011         Can now be:
3012         ```
3013         auto* dereferenceExpression = AST::replaceWith<AST::DereferenceExpression>(dotExpression, WTFMove(origin), WTFMove(callExpression));
3014         ```
3015
3016         * Modules/webgpu/WHLSL/AST/WHLSLNode.h:
3017         (WebCore::WHLSL::AST::replaceWith):
3018         * Modules/webgpu/WHLSL/WHLSLNameResolver.cpp:
3019         (WebCore::WHLSL::NameResolver::visit):
3020         * Modules/webgpu/WHLSL/WHLSLPropertyResolver.cpp:
3021         (WebCore::WHLSL::PropertyResolver::visit):
3022         (WebCore::WHLSL::PropertyResolver::simplifyRightValue):
3023         (WebCore::WHLSL::LeftValueSimplifier::visit):
3024
3025 2019-05-23  Eric Carlson  <eric.carlson@apple.com>
3026
3027         [macOS,iOS] Add always-on logging for AVPlayerTimeControlStatus changes
3028         https://bugs.webkit.org/show_bug.cgi?id=197946
3029         <rdar://problem/50627457>
3030
3031         Reviewed by Jon Lee.
3032
3033         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3034         (WebCore::convertEnumerationToString):
3035         (WTF::LogArgument<AVPlayerTimeControlStatus>::toString):
3036         (WebCore::MediaPlayerPrivateAVFoundationObjC::timeControlStatusDidChange):
3037
3038 2019-05-23  Antoine Quint  <graouts@apple.com>
3039
3040         [Pointer Events] Compatibility mouse events can only be prevented while the pointer is pressed
3041         https://bugs.webkit.org/show_bug.cgi?id=198178
3042
3043         Reviewed by Dean Jackson.
3044
3045         Test: pointerevents/mouse/compatibility-mouse-events-prevention-mouse-released.html
3046
3047         The Pointer Events spec, in https://www.w3.org/TR/pointerevents/#compatibility-mapping-with-mouse-events, says that "Mouse events
3048         can only be prevented when the pointer is down. Hovering pointers (e.g. a mouse with no buttons pressed) cannot have their mouse
3049         events prevented." We now track whether the pointer is pressed and clear the preventsCompatibilityMouseEvents when the pointer is
3050         moved and it is not pressed.
3051
3052         * page/PointerCaptureController.cpp:
3053         (WebCore::PointerCaptureController::pointerEventWasDispatched):
3054         * page/PointerCaptureController.h:
3055
3056 2019-05-23  Simon Fraser  <simon.fraser@apple.com>
3057
3058         Build fix after r245695.
3059
3060         * dom/Element.cpp:
3061
3062 2019-05-23  Antoine Quint  <graouts@apple.com>
3063
3064         [Pointer Events] The mouseover, mouseout, mouseenter, and mouseleave events should not be prevented while the pointer is down
3065         https://bugs.webkit.org/show_bug.cgi?id=198177
3066
3067         Reviewed by Dean Jackson.
3068
3069         Test: pointerevents/mouse/compatibility-mouse-events-prevention-mouse-pressed.html
3070
3071         The Pointer Event spec, in https://www.w3.org/TR/pointerevents/#compatibility-mapping-with-mouse-events, says that "the mouseover,
3072         mouseout, mouseenter, and mouseleave events are never prevented (even if the pointer is down)." We add a new static function which
3073         indicates what is "compatibility" mouse event since those should be excluded, along with "click", which we already excluded.
3074
3075         * dom/Element.cpp:
3076         (WebCore::isCompatibilityMouseEvent):
3077         (WebCore::Element::dispatchMouseEvent):
3078
3079 2019-05-23  Jon Davis  <jond@apple.com>
3080
3081         Update feature status for shipped features
3082         https://bugs.webkit.org/show_bug.cgi?id=196783
3083
3084         Reviewed by Timothy Hatcher.
3085         
3086         Updated feature status for Beacon API, CSS Text Decoration Level 4, Intersection Observer,
3087         Conic Gradients, Datalist Element, and Web Share.
3088
3089         * features.json:
3090
3091 2019-05-23  Simon Fraser  <simon.fraser@apple.com>
3092
3093         Create scrolling tree nodes for descendants of position:absolute inside stacking-context overflow
3094         https://bugs.webkit.org/show_bug.cgi?id=198154
3095
3096         Reviewed by Antti Koivisto.
3097         
3098         There exists code that creates scrolling tree nodes for position:absolute when the containing block
3099         chain skips an enclosing scroller, but the compositing ancestor tree includes the scroller. However
3100         this code explicitly checked that the layer was position:absolute.
3101
3102         This needed to be generalized for any layer whose containing block ancestor chain includes
3103         a position:absolute that skips the scroller, for example a transformed inside a position:absolute,
3104         so remove an explicit isAbsolutelyPositioned() check and some similar assertions.
3105
3106         Test: scrollingcoordinator/scrolling-tree/composited-in-absolute-in-stacking-context-overflow.html
3107
3108         * rendering/RenderLayerCompositor.cpp:
3109         (WebCore::collectStationaryLayerRelatedOverflowNodes):
3110         (WebCore::RenderLayerCompositor::computeCoordinatedPositioningForLayer const):
3111         (WebCore::collectRelatedCoordinatedScrollingNodes):
3112
3113 2019-05-23  Adrian Perez de Castro  <aperez@igalia.com>
3114
3115         Fix a few missing header inclusions often masked by by unified sources
3116         https://bugs.webkit.org/show_bug.cgi?id=198180
3117
3118         Reviewed by Eric Carlson.
3119
3120         * editing/markup.h: Add missing "FloatSize.h" inclusion.
3121         * html/FeaturePolicy.cpp: Add missing "HTMLParserIdioms.h" inclusion.
3122         * platform/text/TextCodec.cpp: Add missing <cstdio> inclusion.
3123
3124 2019-05-23  Myles C. Maxfield  <mmaxfield@apple.com>
3125
3126         [WHLSL] Implement property resolver
3127         https://bugs.webkit.org/show_bug.cgi?id=195925
3128         <rdar://problem/48219643>
3129
3130         Reviewed by Saam Barati and Robin Morisset.
3131
3132         The property resolver is the thing that replaces dot expressions, index expressions, and
3133         read-modify-write expressions with calls to getters, setters, and anders. This patch doesn't
3134         fully implement the property resolver, but implements enough for simple dot expressions to
3135         work. This is enough for us to be able to test most of the rest of the compiler. Index
3136         expressions and read-modify-write expressions are not fully included in this patch, and will
3137         be finished in a follow-up patch.
3138
3139         The property resolver may introduce anonymous variables in various places. In order to do
3140         this, after the property resolver runs, it will insert all these anonymous variables in the
3141         beginning of the function. However, this means that entries in the VariableDeclarations
3142         vector will all shift, which means VariableDeclarations have to be allocated on the heap so
3143         backreferences to them stay valid. This patch moves the storage associated with these values
3144         to living directly in the vector's storage to living in heap storage (via filling the vector
3145         with UniqueRefs).
3146
3147         This patch also adds the third concept of value-ness. We now have right values, left values,
3148         and abstract left values (for things which have setters but have no address). This addition
3149         is required for the analysis the property resolver performs. This concept is also present in
3150         the spec.
3151
3152         Test: webgpu/whlsl-dot-expressions.html
3153
3154         * Modules/webgpu/WHLSL/AST/WHLSLAddressSpace.h:
3155         (WebCore::WHLSL::AST::TypeAnnotation::TypeAnnotation):
3156         (WebCore::WHLSL::AST::TypeAnnotation::leftAddressSpace const):
3157         (WebCore::WHLSL::AST::TypeAnnotation::isRightValue const):
3158         (WebCore::WHLSL::AST::TypeAnnotation::visit):
3159         * Modules/webgpu/WHLSL/AST/WHLSLAssignmentExpression.h:
3160         (WebCore::WHLSL::AST::AssignmentExpression::takeRight):
3161         * Modules/webgpu/WHLSL/AST/WHLSLConstantExpression.h:
3162         * Modules/webgpu/WHLSL/AST/WHLSLDotExpression.h:
3163         * Modules/webgpu/WHLSL/AST/WHLSLEntryPointType.h:
3164         * Modules/webgpu/WHLSL/AST/WHLSLExpression.h:
3165         (WebCore::WHLSL::AST::Expression::maybeResolvedType):
3166         (WebCore::WHLSL::AST::Expression::resolvedType):
3167         (WebCore::WHLSL::AST::Expression::maybeTypeAnnotation const):
3168         (WebCore::WHLSL::AST::Expression::typeAnnotation const):
3169         (WebCore::WHLSL::AST::Expression::setTypeAnnotation):
3170         (WebCore::WHLSL::AST::Expression::addressSpace const): Deleted.
3171         (WebCore::WHLSL::AST::Expression::setAddressSpace): Deleted.
3172         * Modules/webgpu/WHLSL/AST/WHLSLFloatLiteral.h:
3173         (WebCore::WHLSL::AST::FloatLiteral::clone const):
3174         * Modules/webgpu/WHLSL/AST/WHLSLIndexExpression.h:
3175         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteral.cpp:
3176         (WebCore::WHLSL::AST::IntegerLiteral::valueForSelectedType const):
3177         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteral.h:
3178         (WebCore::WHLSL::AST::IntegerLiteral::clone const):
3179         * Modules/webgpu/WHLSL/AST/WHLSLMakeArrayReferenceExpression.h:
3180         (WebCore::WHLSL::AST::MakeArrayReferenceExpression::MakeArrayReferenceExpression):
3181         (WebCore::WHLSL::AST::MakeArrayReferenceExpression::leftValue):
3182         (WebCore::WHLSL::AST::MakeArrayReferenceExpression::lValue): Deleted.
3183         * Modules/webgpu/WHLSL/AST/WHLSLMakePointerExpression.h:
3184         (WebCore::WHLSL::AST::MakePointerExpression::MakePointerExpression):
3185         (WebCore::WHLSL::AST::MakePointerExpression::leftValue):
3186         (WebCore::WHLSL::AST::MakePointerExpression::lValue): Deleted.
3187         * Modules/webgpu/WHLSL/AST/WHLSLNullLiteral.h:
3188         (WebCore::WHLSL::AST::NullLiteral::clone const):
3189         * Modules/webgpu/WHLSL/AST/WHLSLPropertyAccessExpression.h:
3190         (WebCore::WHLSL::AST::PropertyAccessExpression::possibleGetterOverloads):
3191         (WebCore::WHLSL::AST::PropertyAccessExpression::possibleSetterOverloads):
3192         (WebCore::WHLSL::AST::PropertyAccessExpression::possibleAnderOverloads):
3193         (WebCore::WHLSL::AST::PropertyAccessExpression::getterFunction):
3194         (WebCore::WHLSL::AST::PropertyAccessExpression::anderFunction):
3195         (WebCore::WHLSL::AST::PropertyAccessExpression::threadAnderFunction):
3196         (WebCore::WHLSL::AST::PropertyAccessExpression::setterFunction):
3197         (WebCore::WHLSL::AST::PropertyAccessExpression::setPossibleGetterOverloads):
3198         (WebCore::WHLSL::AST::PropertyAccessExpression::setPossibleAnderOverloads):
3199         (WebCore::WHLSL::AST::PropertyAccessExpression::setPossibleSetterOverloads):
3200         (WebCore::WHLSL::AST::PropertyAccessExpression::setGetterFunction):
3201         (WebCore::WHLSL::AST::PropertyAccessExpression::setAnderFunction):
3202         (WebCore::WHLSL::AST::PropertyAccessExpression::setThreadAnderFunction):
3203         (WebCore::WHLSL::AST::PropertyAccessExpression::setSetterFunction):
3204         (WebCore::WHLSL::AST::PropertyAccessExpression::takeBase):
3205         (WebCore::WHLSL::AST::PropertyAccessExpression::possibleGetOverloads): Deleted.
3206         (WebCore::WHLSL::AST::PropertyAccessExpression::possibleSetOverloads): Deleted.
3207         (WebCore::WHLSL::AST::PropertyAccessExpression::possibleAndOverloads): Deleted.
3208         (WebCore::WHLSL::AST::PropertyAccessExpression::setPossibleGetOverloads): Deleted.
3209         (WebCore::WHLSL::AST::PropertyAccessExpression::setPossibleSetOverloads): Deleted.
3210         (WebCore::WHLSL::AST::PropertyAccessExpression::setPossibleAndOverloads): Deleted.
3211         * Modules/webgpu/WHLSL/AST/WHLSLReadModifyWriteExpression.h:
3212         (WebCore::WHLSL::AST::ReadModifyWriteExpression::oldVariableReference):
3213         (WebCore::WHLSL::AST::ReadModifyWriteExpression::newVariableReference):
3214         (WebCore::WHLSL::AST::ReadModifyWriteExpression::leftValue):
3215         (WebCore::WHLSL::AST::ReadModifyWriteExpression::takeLeftValue):
3216         (WebCore::WHLSL::AST::ReadModifyWriteExpression::takeOldValue):
3217         (WebCore::WHLSL::AST::ReadModifyWriteExpression::takeNewValue):
3218         (WebCore::WHLSL::AST::ReadModifyWriteExpression::takeNewValueExpression):
3219         (WebCore::WHLSL::AST::ReadModifyWriteExpression::takeResultExpression):
3220         (WebCore::WHLSL::AST::ReadModifyWriteExpression::ReadModifyWriteExpression):
3221         (WebCore::WHLSL::AST::ReadModifyWriteExpression::lValue): Deleted.
3222         * Modules/webgpu/WHLSL/AST/WHLSLResolvableType.h:
3223         (WebCore::WHLSL::AST::ResolvableType::maybeResolvedType const):
3224         (WebCore::WHLSL::AST::ResolvableType::resolvedType const):
3225         (WebCore::WHLSL::AST::ResolvableType::maybeResolvedType):
3226         (WebCore::WHLSL::AST::ResolvableType::resolvedType):
3227         * Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.cpp:
3228         (WebCore::WHLSL::AST::ResourceSemantic::isAcceptableType const):
3229         * Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.cpp:
3230         (WebCore::WHLSL::AST::SpecializationConstantSemantic::isAcceptableType const):
3231         * Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.cpp:
3232         (WebCore::WHLSL::AST::StageInOutSemantic::isAcceptableType const):
3233         * Modules/webgpu/WHLSL/AST/WHLSLStructureDefinition.h:
3234         (WebCore::WHLSL::AST::StructureDefinition::find):
3235         * Modules/webgpu/WHLSL/AST/WHLSLTypeReference.h:
3236         (WebCore::WHLSL::AST::TypeReference::maybeResolvedType const):
3237         (WebCore::WHLSL::AST::TypeReference::resolvedType const):
3238         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteral.cpp:
3239         (WebCore::WHLSL::AST::UnsignedIntegerLiteral::valueForSelectedType const):
3240         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteral.h:
3241         (WebCore::WHLSL::AST::UnsignedIntegerLiteral::clone const):
3242         * Modules/webgpu/WHLSL/AST/WHLSLVariableDeclaration.h:
3243         * Modules/webgpu/WHLSL/AST/WHLSLVariableDeclarationsStatement.h:
3244         (WebCore::WHLSL::AST::VariableDeclarationsStatement::VariableDeclarationsStatement):
3245         (WebCore::WHLSL::AST::VariableDeclarationsStatement::variableDeclarations):
3246         * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp:
3247         (WebCore::WHLSL::Metal::attributeForSemantic):
3248         (WebCore::WHLSL::Metal::EntryPointScaffolding::mangledInputPath):
3249         (WebCore::WHLSL::Metal::EntryPointScaffolding::unpackResourcesAndNamedBuiltIns):
3250         (WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::helperTypes):
3251         (WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::unpack):
3252         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
3253         (WebCore::WHLSL::Metal::FunctionDeclarationWriter::visit):
3254         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::visit):
3255         * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp:
3256         (WebCore::WHLSL::Metal::writeNativeFunction):
3257         * Modules/webgpu/WHLSL/Metal/WHLSLNativeTypeWriter.cpp:
3258         (WebCore::WHLSL::Metal::writeNativeType):
3259         * Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.cpp:
3260         (WebCore::WHLSL::Metal::findInVector):
3261         (WebCore::WHLSL::Metal::TypeNamer::visit):
3262         (WebCore::WHLSL::Metal::TypeNamer::createNameNode):
3263         * Modules/webgpu/WHLSL/WHLSLASTDumper.cpp:
3264         (WebCore::WHLSL::ASTDumper::visit):
3265         * Modules/webgpu/WHLSL/WHLSLCheckDuplicateFunctions.cpp:
3266         (WebCore::WHLSL::checkDuplicateFunctions):
3267         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
3268         (WebCore::WHLSL::resolveWithOperatorAnderIndexer):
3269         (WebCore::WHLSL::resolveWithOperatorLength):
3270         (WebCore::WHLSL::resolveWithReferenceComparator):
3271         (WebCore::WHLSL::resolveByInstantiation):
3272         (WebCore::WHLSL::checkOperatorOverload):
3273         (WebCore::WHLSL::Checker::assignTypes):
3274         (WebCore::WHLSL::commit):
3275         (WebCore::WHLSL::Checker::visit):
3276         (WebCore::WHLSL::Checker::recurseAndGetInfo):
3277         (WebCore::WHLSL::Checker::getInfo):
3278         (WebCore::WHLSL::Checker::assignType):
3279         (WebCore::WHLSL::Checker::forwardType):
3280         (WebCore::WHLSL::getUnnamedType):
3281         (WebCore::WHLSL::Checker::finishVisitingPropertyAccess): Deleted.
3282         (WebCore::WHLSL::Checker::recurseAndWrapBaseType): Deleted.
3283         * Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.cpp:
3284         (WebCore::WHLSL::Gatherer::takeEntryPointItems):
3285         (WebCore::WHLSL::Gatherer::visit):
3286         * Modules/webgpu/WHLSL/WHLSLInferTypes.cpp:
3287         (WebCore::WHLSL::matchAndCommit):
3288         (WebCore::WHLSL::commit):
3289         (WebCore::WHLSL::inferTypesForCall):
3290         * Modules/webgpu/WHLSL/WHLSLLiteralTypeChecker.cpp:
3291         (WebCore::WHLSL::getNativeTypeDeclaration):
3292         * Modules/webgpu/WHLSL/WHLSLNameResolver.cpp:
3293         (WebCore::WHLSL::NameResolver::visit):
3294         * Modules/webgpu/WHLSL/WHLSLParser.cpp:
3295         (WebCore::WHLSL::Parser::parseParameters):
3296         (WebCore::WHLSL::Parser::parseVariableDeclarations):
3297         * Modules/webgpu/WHLSL/WHLSLPipelineDescriptor.h:
3298         * Modules/webgpu/WHLSL/WHLSLPrepare.cpp:
3299         (WebCore::WHLSL::prepareShared):
3300         * Modules/webgpu/WHLSL/WHLSLPrepare.h:
3301         * Modules/webgpu/WHLSL/WHLSLPropertyResolver.cpp: Added.
3302         (WebCore::WHLSL::PropertyResolver::visit):
3303         (WebCore::WHLSL::setterCall):
3304         (WebCore::WHLSL::getterCall):
3305         (WebCore::WHLSL::modify):
3306         (WebCore::WHLSL::PropertyResolver::simplifyRightValue):
3307         (WebCore::WHLSL::LeftValueSimplifier::visit):
3308         (WebCore::WHLSL::PropertyResolver::simplifyLeftValue):
3309         (WebCore::WHLSL::resolveProperties):
3310         * Modules/webgpu/WHLSL/WHLSLPropertyResolver.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLEntryPointType.h.
3311         * Modules/webgpu/WHLSL/WHLSLRecursiveTypeChecker.cpp:
3312         (WebCore::WHLSL::RecursiveTypeChecker::visit):
3313         * Modules/webgpu/WHLSL/WHLSLResolveOverloadImpl.cpp:
3314         (WebCore::WHLSL::conversionCost):
3315         * Modules/webgpu/WHLSL/WHLSLResolvingType.h:
3316         (WebCore::WHLSL::ResolvingType::getUnnamedType):
3317         * Modules/webgpu/WHLSL/WHLSLStandardLibrary.txt:
3318         * Modules/webgpu/WHLSL/WHLSLSynthesizeArrayOperatorLength.cpp:
3319         (WebCore::WHLSL::FindArrayTypes::takeArrayTypes):
3320         (WebCore::WHLSL::synthesizeArrayOperatorLength):
3321         * Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp:
3322         (WebCore::WHLSL::FindAllTypes::takeUnnamedTypes):
3323         (WebCore::WHLSL::FindAllTypes::takeNamedTypes):
3324         (WebCore::WHLSL::synthesizeConstructors):
3325         * Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.cpp:
3326         (WebCore::WHLSL::synthesizeEnumerationFunctions):
3327         * Modules/webgpu/WHLSL/WHLSLSynthesizeStructureAccessors.cpp:
3328         (WebCore::WHLSL::synthesizeStructureAccessors):
3329         * Modules/webgpu/WHLSL/WHLSLVisitor.cpp:
3330         (WebCore::WHLSL::Visitor::visit):
3331         * Modules/webgpu/WHLSL/WHLSLVisitor.h:
3332         * Sources.txt:
3333         * WebCore.xcodeproj/project.pbxproj:
3334         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
3335         (WebCore::trySetWHLSLFunctionsForPipelineDescriptor):
3336
3337 2019-05-22  Myles C. Maxfield  <mmaxfield@apple.com>
3338
3339         font-optical-sizing applies the wrong variation value
3340         https://bugs.webkit.org/show_bug.cgi?id=197528
3341         <rdar://problem/50152854>
3342
3343         Reviewed by Antti Koivisto.
3344
3345         The OpenType spec says in
3346         https://docs.microsoft.com/en-us/typography/opentype/spec/dvaraxistag_opsz
3347
3348         "Scale interpretation: Values can be interpreted as text size, in points."
3349
3350         It turns out that it means "typographic point size" which is equal to CSS pixels, not
3351         CSS points.
3352
3353         There are two parts of the font that are sensitive to optical sizing: variation values and
3354         the trak table. We don't want to set the variation value directly because then the trak table
3355         won't be affected. Instead, we can use kCTFontOpticalSizeAttribute to set both of them together.
3356         We will only do this when the CSS says text-rendering:optimizeLegibility or when the font has
3357         an opsz axis but no STAT table. Otherwise, we won't do anything special, which lets CoreText
3358         handle the default behavior for us. This gives us the same default behavior as the rest of the
3359         system.
3360
3361         Tests: fast/text/variations/optical-sizing-trak-2.html
3362                fast/text/variations/optical-sizing-trak.html
3363                fast/text/variations/optical-sizing-units-2.html
3364                fast/text/variations/optical-sizing-units.html
3365
3366         * platform/graphics/cocoa/FontCacheCoreText.cpp:
3367         (WebCore::FontType::FontType):
3368         (WebCore::preparePlatformFont):
3369         (WebCore::fontWithFamily):
3370         (WebCore::FontCache::systemFallbackForCharacters):
3371         * platform/graphics/cocoa/FontCacheCoreText.h:
3372         * platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp:
3373         (WebCore::FontFamilySpecificationCoreText::fontRanges const):
3374         * platform/graphics/mac/FontCustomPlatformData.cpp:
3375         (WebCore::FontCustomPlatformData::fontPlatformData):
3376
3377 2019-05-22  Antti Koivisto  <antti@apple.com>
3378
3379         Subselectors not searched when determining property whitelist for selector
3380         https://bugs.webkit.org/show_bug.cgi?id=198147
3381         <rdar://problem/50405208>
3382
3383         Reviewed by Zalan Bujtas.
3384
3385         This can cause marker elements get style they shouldn't.
3386
3387         Test: fast/lists/marker-style-subselector-whitelist.html
3388
3389         * css/RuleSet.cpp:
3390         (WebCore::determinePropertyWhitelistType):
3391
3392         Check subselectors too.
3393
3394 2019-05-22  Saam barati  <sbarati@apple.com>
3395
3396         WHLSL: fix enum parsing
3397         https://bugs.webkit.org/show_bug.cgi?id=198087
3398
3399         Reviewed by Myles Maxfield.
3400
3401         This fixes two bugs:
3402         
3403         1. We were using a String by reference after moving the underlying owner of
3404         the string. This would lead to the String becoming the empty value, and
3405         crashing when used as a key in a hash map.
3406         2. We were incorrectly producing a syntax error for enum declarations by
3407         saying it's invalid if an enum value was added to a hash map for the first
3408         time. This logic should be negated. We need to error when it's added for
3409         the second time and onwards.
3410
3411         Test: webgpu/whlsl-dont-crash-parsing-enum.html
3412
3413         * Modules/webgpu/WHLSL/AST/WHLSLAST.h: Replaced.
3414         * Modules/webgpu/WHLSL/AST/WHLSLEnumerationDefinition.h:
3415         (WebCore::WHLSL::AST::EnumerationDefinition::add):
3416         * Modules/webgpu/WHLSL/AST/WHLSLEnumerationMember.h:
3417         (WebCore::WHLSL::AST::EnumerationMember::name):
3418         * Modules/webgpu/WHLSL/WHLSLASTDumper.cpp: Replaced.
3419         (WebCore::WHLSL::ASTDumper::visit):
3420         * Modules/webgpu/WHLSL/WHLSLASTDumper.h: Replaced.
3421
3422 2019-05-22  Simon Fraser  <simon.fraser@apple.com>
3423
3424         Fix scrolling tree state for more obscure combinations of positioning and paint order
3425         https://bugs.webkit.org/show_bug.cgi?id=198139
3426
3427         Reviewed by Antti Koivisto.
3428
3429         There were three places in RenderLayerCompositor that used a version of ancestor
3430         layer traversal looking at containing blocks, and all three had issues. So make a
3431         shared function to do the ancestor walk, and use it thrice.
3432
3433         isScrolledByOverflowScrollLayer() fumbled containingBlockCanSkipLayers, so failed
3434         to create a scrolling tree node for a composited layer inside position:fixed in
3435         overflow (tested by composited-in-absolute-in-overflow.html).
3436
3437         collectStationaryLayerRelatedOverflowNodes() failed to handle nested
3438         overflow:scroll; it needs to find all the composited scrollers that affect the
3439         position of the given layer relative to its compositing ancestor, which may be the
3440         scroller, or a descendant of the scroller. However, it didn't walk up far enough
3441         and find more that one ancestor. Tested by absolute-in-nested-sc-scrollers.html.
3442
3443         enclosingClippingScopes() was OK but now uses the share function.
3444
3445         Tests: scrollingcoordinator/scrolling-tree/absolute-in-nested-sc-scrollers.html
3446                scrollingcoordinator/scrolling-tree/composited-in-absolute-in-overflow.html
3447
3448         * rendering/RenderLayerCompositor.cpp:
3449         (WebCore::traverseAncestorLayers):
3450         (WebCore::enclosingClippingScopes):
3451         (WebCore::isScrolledByOverflowScrollLayer):
3452         (WebCore::collectStationaryLayerRelatedOverflowNodes):
3453         (WebCore::collectRelatedCoordinatedScrollingNodes):
3454
3455 2019-05-22  Simon Fraser  <simon.fraser@apple.com>
3456
3457         Inner scroller of nested overflow:scrolls jitters when scrolling
3458         https://bugs.webkit.org/show_bug.cgi?id=198131
3459
3460         Reviewed by Antti Koivisto.
3461
3462         enclosingCompositedScrollingLayer(layer) would return the layer itself, rather than
3463         its scrolling ancestor, which meant that a composited scroller nested inside another
3464         scroller would fail to get a "Moves" scrolling tree node, and therefore jitter
3465         when scrolling.
3466
3467         Test: scrollingcoordinator/scrolling-tree/nested-overflow-scroll.html
3468
3469         * rendering/RenderLayerCompositor.cpp:
3470         (WebCore::enclosingCompositedScrollingLayer):
3471
3472 2019-05-22  Ryan Haddad  <ryanhaddad@apple.com>
3473
3474         Unreviewed, rolling out r245598.
3475
3476         Breaks watchOS build.
3477
3478         Reverted changeset:
3479
3480         "font-optical-sizing applies the wrong variation value"
3481         https://bugs.webkit.org/show_bug.cgi?id=197528
3482         https://trac.webkit.org/changeset/245598
3483
3484 2019-05-22  Daniel Bates  <dabates@apple.com>
3485
3486         WebKit does not generate an ESC key event for CMD+.
3487         https://bugs.webkit.org/show_bug.cgi?id=198137
3488         <rdar://problem/51038641>
3489
3490         Reviewed by Brent Fulgham.
3491
3492         This patch maps the Command + '.' keystroke to the 'Escape'. This also requires a change to UIKit to properly pass
3493         the key state to WebKit (see <rdar://problem/46431552>).
3494
3495         * platform/ios/WebEvent.mm:
3496         (-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:withInputManagerHint:keyCode:isTabKey:]):
3497
3498 2019-05-22  Ali Juma  <ajuma@chromium.org>
3499
3500         Intersection Observer: bounding client rect is wrong for an inline element
3501         https://bugs.webkit.org/show_bug.cgi?id=198009
3502
3503         Reviewed by Simon Fraser.
3504
3505         Make target rect computation for inline elements share logic with the computation
3506         of bounding client rects.
3507
3508         Test: imported/w3c/web-platform-tests/intersection-observer/inline-with-block-child-client-rect.html
3509
3510         * dom/Document.cpp:
3511         (WebCore::computeIntersectionState):
3512         * dom/Element.cpp:
3513         (WebCore::Element::boundingAbsoluteRectWithoutLayout):
3514         (WebCore::Element::boundingClientRect):
3515         * dom/Element.h:
3516
3517 2019-05-22  Antoine Quint  <graouts@apple.com>
3518
3519         [iOS] Compatibility mouse events aren't prevented by calling preventDefault() on pointerdown
3520         https://bugs.webkit.org/show_bug.cgi?id=198124
3521         <rdar://problem/50410863>
3522
3523         Reviewed by Tim Horton.
3524
3525         This fix builds atop the one made for wkb.ug/198072 which fixes this bug on macOS alone.
3526
3527         In order to correctly prevent "compatibility" mouse events from being dispatched when the initial "pointerdown" event had preventDefault()
3528         called while handled, we need to pass the PointerID for the touch that triggered a tap gesture in the UI process down in the Web process
3529         and into the resulting PlatformMouseEvent. This will allow upon dispatch of a PlatformMouseEvent to call into PointerCaptureController
3530         to identify if the dispatch of mouse events is allowed for the event's PointerID.
3531
3532         To support this, some refactoring was required. The PointerID header is now under platform/ such that PlatformMouseEvent may safely use it.
3533         Additionally, PointerEvent::defaultMousePointerIdentifier() is now a global mousePointerID defined in PointerID.h.
3534
3535         Finally, PointerCaptureController::touchEndedOrWasCancelledForIdentifier() has been renamed to PointerCaptureController::touchWithIdentifierWasRemoved() and
3536         has WEBCORE_EXPORT such that it may be called from WebKit as the indication that a pointer is no longer active will now be initiated in WebKit
3537         on the UI process side.
3538
3539         Testing is covered by the pre-existing imported/w3c/web-platform-tests/pointerevents/pointerevent_suppress_compat_events_on_click.html
3540         which will now run on iOS through a change to WebKitAdditions.
3541
3542         * Headers.cmake:
3543         * WebCore.xcodeproj/project.pbxproj:
3544         * dom/Element.cpp:
3545         (WebCore::Element::dispatchMouseEvent): When dealing with a mouse event on iOS, check whether the mouse event's PointerID allows for compatibility
3546         mouse events to be dispatched using PointerCaptureController::preventsCompatibilityMouseEventsForIdentifier(). The "click" event is not a compatibility
3547         mouse event.
3548         * dom/PointerEvent.h:
3549         * page/PointerCaptureController.cpp:
3550         (WebCore::PointerCaptureController::PointerCaptureController):
3551         (WebCore::PointerCaptureController::touchWithIdentifierWasRemoved):
3552         (WebCore::PointerCaptureController::touchEndedOrWasCancelledForIdentifier): Deleted.
3553         * page/PointerCaptureController.h:
3554         * platform/PlatformMouseEvent.h:
3555         (WebCore::PlatformMouseEvent::PlatformMouseEvent):
3556         (WebCore::PlatformMouseEvent::pointerId const):
3557         * platform/PointerID.h: Renamed from Source/WebCore/dom/PointerID.h.
3558         (WebCore::mousePointerID):
3559
3560 2019-05-22  Jiewen Tan  <jiewen_tan@apple.com>
3561
3562         [WebAuthN] Support Attestation Conveyance Preference
3563         https://bugs.webkit.org/show_bug.cgi?id=192722
3564         <rdar://problem/49939647>
3565
3566         Reviewed by Brent Fulgham.
3567
3568         This patch implements https://www.w3.org/TR/webauthn/#enumdef-attestationconveyancepreference, together with
3569         Step 20 with regard to AttestationConveyancePreference of https://www.w3.org/TR/webauthn/#createCredential.
3570         Few notes with regard to Step 20: 1) We treat indirect attestation as direct attestation as we don't MITM
3571         the attestation process; 2) We won't distinguish self attestation and return it to keep consistency between
3572         the response and the request. If callers want none attestation, they will very likely ignore fmt and attStmt
3573         of the attestation object, and therefore it is meaningless to return self attestation.
3574
3575         Covered by new tests within existing files.
3576
3577         * CMakeLists.txt:
3578         * DerivedSources-input.xcfilelist:
3579         * DerivedSources-output.xcfilelist:
3580         * DerivedSources.make:
3581         * Headers.cmake:
3582         * Modules/webauthn/AttestationConveyancePreference.h: Copied from Source/WebCore/Modules/webauthn/WebAuthenticationUtils.h.
3583         * Modules/webauthn/AttestationConveyancePreference.idl: Copied from Source/WebCore/Modules/webauthn/WebAuthenticationUtils.h.
3584         * Modules/webauthn/PublicKeyCredentialCreationOptions.h:
3585         (WebCore::PublicKeyCredentialCreationOptions::encode const):
3586         (WebCore::PublicKeyCredentialCreationOptions::decode):
3587         * Modules/webauthn/PublicKeyCredentialCreationOptions.idl:
3588         * Modules/webauthn/WebAuthenticationConstants.h:
3589         * Modules/webauthn/WebAuthenticationUtils.cpp:
3590         (WebCore::buildAttestationObject):
3591         * Modules/webauthn/WebAuthenticationUtils.h:
3592         * Modules/webauthn/fido/DeviceResponseConverter.cpp:
3593         (fido::readCTAPMakeCredentialResponse):
3594         * Modules/webauthn/fido/DeviceResponseConverter.h:
3595         * Modules/webauthn/fido/FidoConstants.h:
3596         noneAttestationValue is moved to WebAuthenticationConstants.h.
3597         * Modules/webauthn/fido/U2fResponseConverter.cpp:
3598         (fido::readU2fRegisterResponse):
3599         * Modules/webauthn/fido/U2fResponseConverter.h:
3600         * Sources.txt:
3601         * WebCore.xcodeproj/project.pbxproj:
3602
3603 2019-05-22  Zalan Bujtas  <zalan@apple.com>
3604
3605         [Paste] Add support for preferred presentation size when pasting an image
3606         https://bugs.webkit.org/show_bug.cgi?id=198132
3607         <rdar://problem/50886917>
3608
3609         Reviewed by Wenson Hsieh.
3610
3611         Set the pasted <img> width/height attributes when the preferred presentation size is available.
3612
3613         * editing/WebContentReader.h:
3614         * editing/cocoa/WebContentReaderCocoa.mm:
3615         (WebCore::createFragmentForImageAttachment):
3616         (WebCore::WebContentReader::readImage):
3617         * editing/markup.cpp:
3618         (WebCore::createFragmentForImageAndURL):
3619         * editing/markup.h:
3620         * platform/Pasteboard.h:
3621         (WebCore::PasteboardWebContentReader::readImage):
3622         * platform/PasteboardItemInfo.h:
3623         (WebCore::PasteboardItemInfo::encode const):
3624         (WebCore::PasteboardItemInfo::decode):
3625         * platform/ios/PasteboardIOS.mm:
3626         (WebCore::Pasteboard::readPasteboardWebContentDataForType):
3627         (WebCore::Pasteboard::read):
3628         (WebCore::Pasteboard::readRespectingUTIFidelities):
3629         * platform/ios/PlatformPasteboardIOS.mm:
3630         (WebCore::PlatformPasteboard::informationForItemAtIndex):
3631
3632 2019-05-22  Jer Noble  <jer.noble@apple.com>
3633
3634         Hide MediaCapabilities.encodingInfo() when the platform does not support it.
3635         https://bugs.webkit.org/show_bug.cgi?id=197476
3636
3637         Reviewed by Eric Carlson.
3638
3639         Test: platform/mac/media/mediacapabilities/mediacapabilities-encodingInfo-undefined.html
3640
3641         Add a new IDL attribute, CustomEnabled, which allows non Settings-based enabling of attributes and objects.
3642
3643         * Modules/mediacapabilities/MediaCapabilities.idl:
3644         * WebCore.xcodeproj/project.pbxproj:
3645         * bindings/js/JSMediaCapabilitiesCustom.h: Copied from Source/WebCore/Modules/mediacapabilities/MediaCapabilities.idl.
3646         (WebCore::JSMediaCapabilitiesEncodingInfoIsEnabled):
3647         * bindings/scripts/CodeGeneratorJS.pm:
3648         (NeedsRuntimeCheck):
3649         (GenerateRuntimeEnableConditionalString):
3650         * bindings/scripts/IDLAttributes.json:
3651         * bindings/scripts/preprocess-idls.pl:
3652         (GenerateConstructorAttributes):
3653         * platform/mediacapabilities/MediaEngineConfigurationFactory.cpp:
3654         (WebCore::MediaEngineConfigurationFactory::hasDecodingConfigurationFactory):
3655         (WebCore::MediaEngineConfigurationFactory::hasEncodingConfigurationFactory):
3656         * platform/mediacapabilities/MediaEngineConfigurationFactory.h:
3657
3658 2019-05-22  Youenn Fablet  <youenn@apple.com>
3659
3660         Implement Feature policy self/none/* parsing
3661         https://bugs.webkit.org/show_bug.cgi?id=198078
3662
3663         Reviewed by Eric Carlson.
3664
3665         Start to implement https://w3c.github.io/webappsec-feature-policy/#algo-parse-policy-directive
3666         'src' is not supported yet.
3667         Apply the rules to getUserMedia.
3668         Update getDisplayMedia keyword from 'display' to 'display-capture' as per spec.
3669
3670         Test: imported/w3c/web-platform-tests/mediacapture-streams/MediaStream-feature-policy-none.https.html
3671
3672         * Headers.cmake:
3673         * Modules/mediastream/UserMediaController.cpp:
3674         (WebCore::isSecure):
3675         (WebCore::isAllowedByFeaturePolicy):
3676         (WebCore::isAllowedToUse):
3677         * Sources.txt:
3678         * WebCore.xcodeproj/project.pbxproj:
3679         * html/FeaturePolicy.cpp: Added.
3680         (WebCore::isAllowedByFeaturePolicy):
3681         (WebCore::processOriginItem):
3682         (WebCore::updateList):
3683         (WebCore::FeaturePolicy::parse):
3684         (WebCore::FeaturePolicy::allows const):
3685         * html/FeaturePolicy.h: Added.
3686         * html/HTMLIFrameElement.cpp:
3687         (WebCore::HTMLIFrameElement::featurePolicy const):
3688         * html/HTMLIFrameElement.h:
3689
3690 2019-05-21  Jer Noble  <jer.noble@apple.com>
3691
3692         Media controls don't show in WK2 video fullscreen sometimes
3693         https://bugs.webkit.org/show_bug.cgi?id=198094
3694         <rdar://problem/50970661>
3695
3696         Reviewed by Tim Horton.
3697
3698         Ensure that the WebAVPlayerLayer never allows hit testing, as this keeps touches from reaching
3699         AVKit's controls.
3700
3701         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
3702         (-[WebAVPlayerLayer init]):
3703
3704 2019-05-21  Saam barati  <sbarati@apple.com>
3705
3706         WHLSL: Add an AST dumper
3707         https://bugs.webkit.org/show_bug.cgi?id=198059
3708
3709         Reviewed by Myles Maxfield.
3710
3711         This patch makes it so we can dump the WHLSL program's AST.
3712         This will become useful when we're debugging passes that
3713         transform the AST.
3714         
3715         The dumper mostly prints in a style where the dump is almost
3716         valid WHLSL code. E.g, this WHLSL program:
3717         ```
3718         int foo(int arg) {
3719             return arg + 1;
3720         }
3721         ```
3722         
3723         gets dumped as:
3724         ```
3725         int foo(int arg) {
3726            return operator+(arg, 1);
3727         }
3728         ```
3729         
3730         This patch also adds a way to dump between each pass, after
3731         parsing, or at the end of all passes. Currently, this is controlled
3732         by a static variable. I'll make these runtime configurable in a follow
3733         up: https://bugs.webkit.org/show_bug.cgi?id=198097
3734
3735         No new tests because this is used for logging.
3736
3737         * Modules/webgpu/WHLSL/AST/WHLSLAST.h: Added.
3738         * Modules/webgpu/WHLSL/AST/WHLSLAddressSpace.h:
3739         (WebCore::WHLSL::AST::toString):
3740         * Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.h:
3741         (WebCore::WHLSL::AST::BuiltInSemantic::toString const):
3742         * Modules/webgpu/WHLSL/AST/WHLSLEntryPointType.h:
3743         (WebCore::WHLSL::AST::toString):
3744         * Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.h:
3745         (WebCore::WHLSL::AST::ResourceSemantic::toString):
3746         * Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.cpp:
3747         (WebCore::WHLSL::Metal::toString): Deleted.
3748         * Modules/webgpu/WHLSL/WHLSLASTDumper.cpp: Added.
3749         (WebCore::WHLSL::ASTDumper::visit):
3750         * Modules/webgpu/WHLSL/WHLSLASTDumper.h: Added.
3751         (WebCore::WHLSL::ASTDumper::toString):
3752         (WebCore::WHLSL::ASTDumper::Indent::Indent):
3753         (WebCore::WHLSL::ASTDumper::bumpIndent):
3754         (WebCore::WHLSL::toString):
3755         (WebCore::WHLSL::dumpAST):
3756         * Modules/webgpu/WHLSL/WHLSLPrepare.cpp:
3757         (WebCore::WHLSL::dumpASTIfNeeded):
3758         (WebCore::WHLSL::dumpASTAfterParsingIfNeeded):
3759         (WebCore::WHLSL::dumpASTBetweenEachPassIfNeeded):
3760         (WebCore::WHLSL::dumpASTAtEndIfNeeded):
3761         (WebCore::WHLSL::prepareShared):
3762         * Modules/webgpu/WHLSL/WHLSLVisitor.cpp:
3763         * Sources.txt:
3764         * WebCore.xcodeproj/project.pbxproj:
3765
3766 2019-05-21  Saam barati  <sbarati@apple.com>
3767
3768         WHLSL: Parsing negative int literals parses the positive value instead
3769         https://bugs.webkit.org/show_bug.cgi?id=198096
3770
3771         Reviewed by Dean Jackson.
3772
3773         I also made the code around < INT_MIN a bit easier to follow along with.
3774
3775         No new tests because we haven't imported WHLSL test suite yet.
3776         Verified this works using the AST dumper.
3777
3778         * Modules/webgpu/WHLSL/WHLSLParser.cpp:
3779         (WebCore::WHLSL::intLiteralToInt):
3780
3781 2019-05-21  Myles C. Maxfield  <mmaxfield@apple.com>
3782
3783         font-optical-sizing applies the wrong variation value
3784         https://bugs.webkit.org/show_bug.cgi?id=197528
3785         <rdar://problem/50152854>
3786
3787         Reviewed by Antti Koivisto.
3788
3789         The OpenType spec says in
3790         https://docs.microsoft.com/en-us/typography/opentype/spec/dvaraxistag_opsz
3791
3792         "Scale interpretation: Values can be interpreted as text size, in points."
3793
3794         It turns out that it means "typographic point size" which is equal to CSS pixels, not
3795         CSS points.
3796
3797         There are two parts of the font that are sensitive to optical sizing: variation values and
3798         the trak table. We don't want to set the variation value directly because then the trak table
3799         won't be affected. Instead, we can use kCTFontOpticalSizeAttribute to set both of them together.
3800         We will only do this when the CSS says text-rendering:optimizeLegibility or when the font has
3801         an opsz axis but no STAT table. Otherwise, we won't do anything special, which lets CoreText
3802         handle the default behavior for us. This gives us the same default behavior as the rest of the
3803         system.
3804
3805         Tests: fast/text/variations/optical-sizing-trak-2.html
3806                fast/text/variations/optical-sizing-trak.html
3807                fast/text/variations/optical-sizing-units.html
3808                fast/text/variations/optical-sizing-units-2.html
3809
3810         * platform/graphics/cocoa/FontCacheCoreText.cpp:
3811         (WebCore::FontType::FontType):
3812         (WebCore::preparePlatformFont):
3813         (WebCore::fontWithFamily):
3814         (WebCore::FontCache::systemFallbackForCharacters):
3815         * platform/graphics/cocoa/FontCacheCoreText.h:
3816         * platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp:
3817         (WebCore::FontFamilySpecificationCoreText::fontRanges const):
3818         * platform/graphics/mac/FontCustomPlatformData.cpp:
3819         (WebCore::FontCustomPlatformData::fontPlatformData):
3820
3821 2019-05-21  Simon Fraser  <simon.fraser@apple.com>
3822
3823         Layer flashing and poor perf during scrolling of message list on gmail.com and hotmail.com - overlap testing needs to constrained to clipping scopes
3824         https://bugs.webkit.org/show_bug.cgi?id=198091
3825         <rdar://problem/49403082>
3826
3827         Reviewed by Antti Koivisto.
3828         
3829         When overflow:scroll is scrolled asynchronously, we need to have already created compositing layers where necessary
3830         for clipped-out layers in the scrolled content so that we have something to reveal. We also have ensure
3831         that layers inside the scroller (but scrolled out of view) don't trigger overlap with layers outside the scroller.
3832         All this has to work when the containing block hierarchy (clipping/scrolling) doesn't match the paint order hierarchy (structure
3833         of the z-order and compositing trees).
3834
3835         Overlap testing previously simply used a list of rectangles per compositing container (OverlapMapContainer). This is
3836         a series of layer bounds, built up as we traver the layer tree in z-order. Layers contribute to container N-2, and test
3837         against container N-1.
3838         
3839         To handle overlap with non-stacking-context scrollers, introduce the concept of a ClippingScope, which encompasses
3840         a set of layers sharing the same composited-scrolling containing-block ancestor. Within a ClippingScope, layer bounds
3841         are computed unclipped. Between them, bounds are tested clipped.
3842         
3843         Conceptually, each OverlapMapContainer has a tree of ClippingScopes (reflecting the containing-block order tree of
3844         composited overflow scroll), and rects are added to the appropriate ClippingScope. This tree is currently always
3845         root-relative; the root node is the RenderView's RenderLayer, and will accumulate the bounds of layers not inside
3846         composited overflow scroll (just like the old code).
3847         
3848         When a OverlapMapContainer is popped, the list of rectangles in its ClippingScope tree is merged with that of the previous
3849         container.
3850
3851         Tests: compositing/layer-creation/clipping-scope/nested-scroller-overlap.html
3852                compositing/layer-creation/clipping-scope/overlap-constrained-inside-scroller.html
3853                compositing/layer-creation/clipping-scope/overlap-constrained-inside-stacking-context-scroller.html
3854                compositing/layer-creation/clipping-scope/scroller-with-negative-z-children.html
3855                compositing/layer-creation/clipping-scope/shared-layers-in-scroller.html
3856
3857         * rendering/LayerOverlapMap.cpp:
3858         (WebCore::operator<<):
3859         (WebCore::OverlapMapContainer::OverlapMapContainer):
3860         (WebCore::OverlapMapContainer::ClippingScope::ClippingScope):
3861         (WebCore::OverlapMapContainer::ClippingScope::childWithLayer const):
3862         (WebCore::OverlapMapContainer::ClippingScope::addChildWithLayerAndBounds):
3863         (WebCore::OverlapMapContainer::ClippingScope::addChild):
3864         (WebCore::OverlapMapContainer::ClippingScope::appendRect):
3865         (WebCore::OverlapMapContainer::clippingScopeContainingLayerChildRecursive):
3866         (WebCore::OverlapMapContainer::scopeContainingLayer const):
3867         (WebCore::OverlapMapContainer::rootScope const):
3868         (WebCore::OverlapMapContainer::rootScope):
3869         (WebCore::OverlapMapContainer::add):
3870         (WebCore::OverlapMapContainer::overlapsLayers const):
3871         (WebCore::OverlapMapContainer::mergeClippingScopesRecursive):
3872         (WebCore::OverlapMapContainer::append):
3873         (WebCore::OverlapMapContainer::ensureClippingScopeForLayers):
3874         (WebCore::OverlapMapContainer::findClippingScopeForLayers const):
3875         (WebCore::OverlapMapContainer::recursiveOutputToStream const):
3876         (WebCore::OverlapMapContainer::dump const):
3877         (WebCore::LayerOverlapMap::LayerOverlapMap):
3878         (WebCore::LayerOverlapMap::add):
3879         (WebCore::LayerOverlapMap::overlapsLayers const):
3880         (WebCore::LayerOverlapMap::pushCompositingContainer):
3881         (WebCore::LayerOverlapMap::popCompositingContainer):
3882         (WebCore::OverlapMapContainer::unite): Deleted.
3883         (WebCore::OverlapMapContainer::rectList const): Deleted.
3884         * rendering/LayerOverlapMap.h:
3885         * rendering/RenderLayerCompositor.cpp:
3886         (WebCore::RenderLayerCompositor::BackingSharingState::appendSharingLayer):
3887         (WebCore::RenderLayerCompositor::BackingSharingState::updateBeforeDescendantTraversal):
3888         (WebCore::RenderLayerCompositor::updateCompositingLayers):
3889         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
3890         (WebCore::RenderLayerCompositor::traverseUnchangedSubtree):
3891         (WebCore::RenderLayerCompositor::computeExtent const):
3892         (WebCore::createsClippingScope):
3893         (WebCore::enclosingClippingScopes):
3894         (WebCore::RenderLayerCompositor::addToOverlapMap const):
3895         (WebCore::RenderLayerCompositor::updateOverlapMap const):
3896         (WebCore::RenderLayerCompositor::layerOverlaps const):
3897         * rendering/RenderLayerCompositor.h:
3898
3899 2019-05-21  Antoine Quint  <graouts@apple.com>
3900
3901         [macOS] Compatibility mouse events aren't prevented by calling preventDefault() on pointerdown
3902         https://bugs.webkit.org/show_bug.cgi?id=198072
3903         <rdar://problem/50983361>
3904
3905         Reviewed by Dean Jackson.
3906
3907         The Pointer Events spec says that "compatibility" mouse events, which means all mouse events save for "click",
3908         should not be dispatched for a given pointer if preventDefault() was called during the dispatch of the "pointerdown"
3909         event. Additionally, calling preventDefault() during the dispatch of "pointerup" has no effect.
3910
3911         * dom/Element.cpp:
3912         (WebCore::Element::dispatchMouseEvent):
3913         * page/PointerCaptureController.cpp:
3914         (WebCore::PointerCaptureController::preventsCompatibilityMouseEventsForIdentifier):
3915         (WebCore::PointerCaptureController::pointerEventWasDispatched):
3916         * page/PointerCaptureController.h:
3917
3918 2019-05-21  Antti Koivisto  <antti@apple.com>
3919
3920         RTL/overflow scroll tests fail with async overflow enabled
3921         https://bugs.webkit.org/show_bug.cgi?id=196013
3922         <rdar://problem/49066649>
3923
3924         Reviewed by Simon Fraser.
3925
3926         Test: compositing/ios/rtl-overflow-scrolling-2.html
3927
3928         This patch makes the basic RTL cases work in the scrolling tree.
3929
3930         * page/scrolling/AsyncScrollingCoordinator.cpp:
3931         (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
3932         * page/scrolling/ScrollingTreeScrollingNode.cpp:
3933         (WebCore::ScrollingTreeScrollingNode::minimumScrollPosition const):
3934         (WebCore::ScrollingTreeScrollingNode::maximumScrollPosition const):
3935
3936         Add missing scroll offset <-> scroll position conversions.
3937
3938 2019-05-21  Carlos Garcia Campos  <cgarcia@igalia.com>
3939
3940         [WPE] Add initial accessibility support using ATK
3941         https://bugs.webkit.org/show_bug.cgi?id=197413
3942
3943         Reviewed by Michael Catanzaro.