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