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