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