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