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