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