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