Address Sam's post-landing review of r246234.
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-06-16  Zalan Bujtas  <zalan@apple.com>
2
3         Address Sam's post-landing review of r246234.
4
5         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
6         (WebCore::Layout::InlineFormattingContext::LineLayout::createDisplayRuns const):
7
8 2019-06-16  Zalan Bujtas  <zalan@apple.com>
9
10         [LFC][IFC] Decouple baseline ascent/descent and baseline offset.
11         https://bugs.webkit.org/show_bug.cgi?id=198901
12         <rdar://problem/51782393>
13
14         Reviewed by Antti Koivisto.
15
16         Baseline offset is the baseline's distance from the line's logical top -and it is not necessarily the same as the baseline's ascent.
17         It's easier to track the baseline and its top separately since certain properties only change one or the other.
18
19         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
20         (WebCore::Layout::InlineFormattingContext::LineLayout::placeInlineItems const):
21         (WebCore::Layout::InlineFormattingContext::LineLayout::createDisplayRuns const):
22         * layout/inlineformatting/InlineLine.cpp:
23         (WebCore::Layout::Line::Line):
24         (WebCore::Layout::Line::close):
25         (WebCore::Layout::Line::adjustBaselineAndLineHeight):
26         (WebCore::Layout::Line::halfLeadingMetrics):
27         * layout/inlineformatting/InlineLine.h:
28         (WebCore::Layout::Line::Content::baselineOffset const):
29         (WebCore::Layout::Line::Content::setBaselineOffset):
30         (WebCore::Layout::Line::baselineOffset const):
31         * layout/inlineformatting/InlineLineBox.h:
32         (WebCore::Layout::LineBox::baselineOffset const):
33         (WebCore::Layout::LineBox::LineBox):
34
35 2019-06-16  Zalan Bujtas  <zalan@apple.com>
36
37         [LFC][IFC] Intruding float may prevent adding any inline box
38         https://bugs.webkit.org/show_bug.cgi?id=198891
39         <rdar://problem/51779956>
40
41         Reviewed by Antti Koivisto.
42
43         Take the intruding left/right float pair and find the vertical position where the next line might go
44         if these floats prevent us from adding even one inline box to the current line.
45
46         * layout/FormattingContext.cpp:
47         (WebCore::Layout::FormattingContext::mapPointToAncestor):
48         (WebCore::Layout::FormattingContext::mapPointToDescendent):
49         * layout/FormattingContext.h:
50         * layout/LayoutUnits.h:
51         (WebCore::Layout::Point::max):
52         * layout/inlineformatting/InlineFormattingContext.h:
53         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
54         (WebCore::Layout::InlineFormattingContext::LineLayout::placeInlineItems const):
55         (WebCore::Layout::InlineFormattingContext::LineLayout::layout const):
56
57 2019-06-16  Zalan Bujtas  <zalan@apple.com>
58
59         [LFC][Floats] Add bottom value to FloatingState::Constraints
60         https://bugs.webkit.org/show_bug.cgi?id=198889
61         <rdar://problem/51776730>
62
63         Reviewed by Antti Koivisto.
64
65         Constraints::left/right->y indicates where this particular constrain ends. This is going to be used by inline layout to figure where
66         the next line should go (vertical position).
67
68         * layout/floats/FloatingState.cpp:
69         (WebCore::Layout::FloatingState::constraints const):
70         * layout/floats/FloatingState.h:
71
72 2019-06-16  Zalan Bujtas  <zalan@apple.com>
73
74         [LFC][IFC] Ignore descent when in limited/full quirks mode
75         https://bugs.webkit.org/show_bug.cgi?id=198893
76         <rdar://problem/51780634>
77
78         Reviewed by Antti Koivisto.
79
80         In limited/full quirks mode, line's descent should be ignored when computing the final line height when
81         1. the line has baseline aligned content only and
82         2. these baseline aligned boxes don't have descent.
83
84         * layout/inlineformatting/InlineLine.cpp:
85         (WebCore::Layout::Line::isVisuallyEmpty const):
86         (WebCore::Layout::Line::close):
87
88 2019-06-16  Zalan Bujtas  <zalan@apple.com>
89
90         [LFC][IFC] Line::isVisuallyEmpty should check inline-block boxes.
91         https://bugs.webkit.org/show_bug.cgi?id=198894
92         <rdar://problem/51780886>
93
94         Reviewed by Antti Koivisto.
95
96         Non-zero width/height inline-block boxes make the line visually non-empty.
97
98         * layout/inlineformatting/InlineLine.cpp:
99         (WebCore::Layout::Line::isVisuallyEmpty const):
100
101 2019-06-16  Zalan Bujtas  <zalan@apple.com>
102
103         [LFC] Add Layout::Box::isContainingBlockDescendantOf
104         https://bugs.webkit.org/show_bug.cgi?id=198888
105         <rdar://problem/51776466>
106
107         Reviewed by Antti Koivisto.
108
109         Box::isDescendantOf indicates simple ancestor - descendant relationship, while
110         isContainingBlockDescendantOf checks the containing block chain.
111
112         * layout/FormattingContext.cpp:
113         (WebCore::Layout::mapHorizontalPositionToAncestor):
114         (WebCore::Layout::FormattingContext::mapBoxToAncestor):
115         (WebCore::Layout::FormattingContext::mapTopToAncestor):
116         (WebCore::Layout::FormattingContext::mapPointToAncestor):
117         * layout/floats/FloatingState.h:
118         (WebCore::Layout::FloatingState::FloatItem::isDescendantOfFormattingRoot const):
119         * layout/layouttree/LayoutBox.cpp:
120         (WebCore::Layout::Box::isDescendantOf const):
121         (WebCore::Layout::Box::isContainingBlockDescendantOf const):
122         * layout/layouttree/LayoutBox.h:
123
124 2019-06-16  Zalan Bujtas  <zalan@apple.com>
125
126         [LFC][IFC] Remove Line::Content::isVisuallyEmpty
127         https://bugs.webkit.org/show_bug.cgi?id=198892
128         <rdar://problem/51780345>
129
130         Reviewed by Antti Koivisto.
131
132         Instead of setting the isVisuallyEmpty flag, reset the line height to 0. 
133
134         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
135         (WebCore::Layout::InlineFormattingContext::LineLayout::createDisplayRuns const):
136         * layout/inlineformatting/InlineLine.cpp:
137         (WebCore::Layout::Line::close):
138         * layout/inlineformatting/InlineLine.h:
139         (WebCore::Layout::Line::Content::isEmpty const):
140         (WebCore::Layout::Line::Content::setBaseline):
141         (WebCore::Layout::Line::Content::isVisuallyEmpty const): Deleted.
142         (WebCore::Layout::Line::Content::setIsVisuallyEmpty): Deleted.
143
144 2019-06-16  Zalan Bujtas  <zalan@apple.com>
145
146         [LFC] Add limited quirks mode to LayoutState.
147         https://bugs.webkit.org/show_bug.cgi?id=198881
148         <rdar://problem/51773229>
149
150         Reviewed by Antti Koivisto.
151
152         This is in preparation for introducing limited quirks mode to inline layout.
153
154         * layout/LayoutState.h:
155         (WebCore::Layout::LayoutState::setQuirksMode):
156         (WebCore::Layout::LayoutState::inQuirksMode const):
157         (WebCore::Layout::LayoutState::inLimitedQuirksMode const):
158         (WebCore::Layout::LayoutState::inNoQuirksMode const):
159         (WebCore::Layout::LayoutState::setInQuirksMode): Deleted.
160         * page/FrameViewLayoutContext.cpp:
161         (WebCore::layoutUsingFormattingContext):
162
163 2019-06-16  Zalan Bujtas  <zalan@apple.com>
164
165         [LFC][IFC] Completely collapsed runs should not go to the trimmable run list.
166         https://bugs.webkit.org/show_bug.cgi?id=198900
167         <rdar://problem/51782156>
168
169         Reviewed by Antti Koivisto.
170
171         * layout/inlineformatting/InlineLine.cpp:
172         (WebCore::Layout::Line::trailingTrimmableWidth const):
173         (WebCore::Layout::Line::appendTextContent):
174
175 2019-06-16  Zalan Bujtas  <zalan@apple.com>
176
177         [LFC][IFC] Use the borderBox rect consistently to size the inline box.
178         https://bugs.webkit.org/show_bug.cgi?id=198899
179
180         Reviewed by Antti Koivisto.
181         <rdar://problem/51781969>
182
183         Use the margin box height (when applicable) to adjust the line height and use the borderBox rect (or font size) height to size the inline box.
184
185         * layout/displaytree/DisplayBox.h:
186         (WebCore::Display::Box::borderBoxHeight const):
187         (WebCore::Display::Box::marginBoxHeight const):
188         * layout/inlineformatting/InlineLine.cpp:
189         (WebCore::Layout::Line::appendInlineContainerStart):
190         (WebCore::Layout::Line::appendTextContent):
191         (WebCore::Layout::Line::appendNonReplacedInlineBox):
192         (WebCore::Layout::Line::inlineItemContentHeight const):
193         (WebCore::Layout::Line::inlineItemHeight const): Deleted.
194         * layout/inlineformatting/InlineLine.h:
195
196 2019-06-15  Simon Fraser  <simon.fraser@apple.com>
197
198         Make layerTreeAsText() output a bit less verbose
199         https://bugs.webkit.org/show_bug.cgi?id=198870
200
201         Reviewed by Tim Horton.
202
203         "accelerates drawing" was getting dumped twice for debug dumps.
204         Only dump the non-default state for "uses display-list drawing".
205         Use the new OptionSet<> dumping for GraphicsLayerPaintingPhases.
206
207         * platform/graphics/GraphicsLayer.cpp:
208         (WebCore::GraphicsLayer::dumpProperties const):
209         (WebCore::operator<<):
210         * platform/graphics/GraphicsLayer.h:
211         * platform/graphics/ca/GraphicsLayerCA.cpp:
212         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
213
214 2019-06-15  Youenn Fablet  <youenn@apple.com>
215
216         Make MediaStream constructor take a Document instead of a ScriptExecutionContext
217         https://bugs.webkit.org/show_bug.cgi?id=198873
218
219         Reviewed by Darin Adler.
220
221         Update MediaStream constructors and call site to take a Document&.
222         Make the same for creation of CanvasCaptureMediaStreamTrack.
223         No observable change of behavior.
224
225         * Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
226         (WebCore::CanvasCaptureMediaStreamTrack::create):
227         (WebCore::CanvasCaptureMediaStreamTrack::CanvasCaptureMediaStreamTrack):
228         (WebCore::loggerFromContext): Deleted.
229         * Modules/mediastream/CanvasCaptureMediaStreamTrack.h:
230         * Modules/mediastream/MediaStream.cpp:
231         (WebCore::MediaStream::create):
232         (WebCore::MediaStream::MediaStream):
233         (WebCore::MediaStream::clone):
234         (WebCore::loggerFromContext): Deleted.
235         * Modules/mediastream/MediaStream.h:
236         * Modules/mediastream/MediaStream.idl:
237         * Modules/mediastream/UserMediaRequest.cpp:
238         (WebCore::UserMediaRequest::allow):
239         * html/HTMLCanvasElement.cpp:
240         (WebCore::HTMLCanvasElement::captureStream):
241         * html/HTMLCanvasElement.h:
242         * html/HTMLCanvasElement.idl:
243
244 2019-06-15  Zalan Bujtas  <zalan@apple.com>
245
246         [LFC][BFC] Fix available width for non-floating positioned float avoiders.
247         https://bugs.webkit.org/show_bug.cgi?id=198886
248         <rdar://problem/51773643>
249
250         Reviewed by Antti Koivisto.
251
252         Normally the available width for an in-flow block level box is the width of the containing block's content box.
253         However a non-floating positioned float avoider box might be constrained by existing floats.
254         The idea here is that we pre-compute(estimate) the vertical position and check the current floating context for
255         left and right floats. These floats contrain the available width and this computed value should be used instead of the containing block's
256         content box's width whe calculating the used width for width: auto.
257
258         * layout/FormattingContext.cpp:
259         (WebCore::Layout::mapHorizontalPositionToAncestor):
260         (WebCore::Layout::FormattingContext::mapLeftToAncestor):
261         (WebCore::Layout::FormattingContext::mapRightToAncestor):
262         (WebCore::Layout::FormattingContext::mapPointToAncestor):
263         (WebCore::Layout::FormattingContext::mapCoordinateToAncestor): Deleted.
264         * layout/FormattingContext.h:
265         * layout/blockformatting/BlockFormattingContext.cpp:
266         (WebCore::Layout::BlockFormattingContext::usedAvailableWidthForFloatAvoider const):
267         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
268         (WebCore::Layout::BlockFormattingContext::computeStaticVerticalPosition const):
269         (WebCore::Layout::BlockFormattingContext::computeStaticHorizontalPosition const):
270         (WebCore::Layout::BlockFormattingContext::computeStaticPosition const):
271         (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForFormattingRoot const):
272         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
273         * layout/blockformatting/BlockFormattingContext.h:
274         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin):
275         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
276         (WebCore::Layout::BlockFormattingContext::Geometry::staticVerticalPosition):
277         (WebCore::Layout::BlockFormattingContext::Geometry::staticHorizontalPosition):
278         (WebCore::Layout::BlockFormattingContext::Geometry::staticPosition):
279         * layout/floats/FloatingState.cpp:
280         (WebCore::Layout::FloatingState::constraints const):
281         * layout/layouttree/LayoutBlockContainer.cpp:
282         (WebCore::Layout::BlockContainer::establishesInlineFormattingContextOnly const):
283         * layout/layouttree/LayoutBlockContainer.h:
284         * layout/layouttree/LayoutBox.cpp:
285         (WebCore::Layout::Box::isFloatAvoider const):
286         * layout/layouttree/LayoutBox.h:
287         (WebCore::Layout::Box::establishesInlineFormattingContextOnly const):
288
289 2019-06-15  Ludovico de Nittis  <ludovico.denittis@collabora.com>
290
291         [GTK] Stop accessing GdkEvent fields when possible
292         https://bugs.webkit.org/show_bug.cgi?id=198829
293
294         Reviewed by Michael Catanzaro.
295
296         Direct access to GdkEvent structs is no longer possible in GTK 4.
297
298         No behaviour changes.
299
300         * platform/gtk/PlatformKeyboardEventGtk.cpp:
301         (WebCore::eventTypeForGdkKeyEvent):
302         (WebCore::modifiersForGdkKeyEvent):
303         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
304         * platform/gtk/PlatformMouseEventGtk.cpp:
305         (WebCore::PlatformMouseEvent::PlatformMouseEvent):
306         * platform/gtk/PlatformWheelEventGtk.cpp:
307         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
308
309 2019-06-15  Rob Buis  <rbuis@igalia.com>
310
311         Add tests for prefetch redirects
312         https://bugs.webkit.org/show_bug.cgi?id=197371
313
314         Reviewed by Youenn Fablet.
315
316         Test: http/wpt/prefetch/link-prefetch-main-resource-redirect.html
317
318         Allow clearing of the Purpose request header field.
319
320         * platform/network/ResourceRequestBase.cpp:
321         (WebCore::ResourceRequestBase::clearPurpose):
322         * platform/network/ResourceRequestBase.h:
323
324 2019-06-15  Zalan Bujtas  <zalan@apple.com>
325
326         [LFC][MarginCollapsing] Remove redundant checks in MarginCollapse::marginBefore/AfterCollapsesWith*
327         https://bugs.webkit.org/show_bug.cgi?id=198882
328         <rdar://problem/51773334>
329
330         Reviewed by Antti Koivisto.
331
332         In-flow child can neither be floating nor out-of-flow positioned.
333
334         * layout/blockformatting/BlockMarginCollapse.cpp:
335         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithFirstInFlowChildMarginBefore):
336         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithLastInFlowChildMarginAfter):
337
338 2019-06-15  Zalan Bujtas  <zalan@apple.com>
339
340         [LFC][MarginCollapsing] Collapsed through margin values preserve quirk state.
341         https://bugs.webkit.org/show_bug.cgi?id=198885
342         <rdar://problem/51773568>
343
344         Reviewed by Antti Koivisto.
345
346         The collapsed through margin becomes a quirk margin if either of the vertical(before/after) margins have quirk value.
347
348         * layout/blockformatting/BlockMarginCollapse.cpp:
349         (WebCore::Layout::computedPositiveAndNegativeMargin):
350
351 2019-06-15  Zalan Bujtas  <zalan@apple.com>
352
353         [LFC[MarginCollapsing] Anonymous boxes never collapse their margins with siblings.
354         https://bugs.webkit.org/show_bug.cgi?id=198884
355         <rdar://problem/51773509>
356
357         Reviewed by Antti Koivisto.
358
359         * layout/blockformatting/BlockMarginCollapse.cpp:
360         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithPreviousSiblingMarginAfter):
361
362 2019-06-15  Zalan Bujtas  <zalan@apple.com>
363
364         [LFC][MarginCollapsing] Add check for computed height value in MarginCollapse::marginsCollapseThrough
365         https://bugs.webkit.org/show_bug.cgi?id=198883
366         <rdar://problem/51773395>
367
368         Reviewed by Antti Koivisto.
369
370         "A box's own margins collapse if... ...and it has a 'height' of either 0 or 'auto"
371         https://www.w3.org/TR/CSS22/box.html#collapsing-margins
372
373         * layout/blockformatting/BlockMarginCollapse.cpp:
374         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginsCollapseThrough):
375
376 2019-06-15  Zalan Bujtas  <zalan@apple.com>
377
378         [LFC] Fix available width for shrink-to-fit (for out-of-flow non-replaced box)
379         https://bugs.webkit.org/show_bug.cgi?id=198880
380         <rdar://problem/51773118>
381
382         Reviewed by Antti Koivisto.
383
384         This patch fixes the cases when the available width for the out-of-flow positioned box is not the same as the containing block's (padding)width.  
385
386         * layout/FormattingContextGeometry.cpp:
387         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
388
389 2019-06-15  Zalan Bujtas  <zalan@apple.com>
390
391         [LFC] Fix over-constrained logic for out-of-flow non-replaced horizontal geometry.
392         https://bugs.webkit.org/show_bug.cgi?id=198879
393         <rdar://problem/51772995>
394
395         Reviewed by Antti Koivisto.
396
397         The over-constrained logic applies to the case when all the horizontal properties are set.
398
399         * layout/FormattingContextGeometry.cpp:
400         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
401
402 2019-06-15  Zalan Bujtas  <zalan@apple.com>
403
404         [LFC] Convert both the absolutely and statically positioned out-of-flow block level boxes positions relative to the containing block's padding box
405         https://bugs.webkit.org/show_bug.cgi?id=198878
406         <rdar://problem/51772882>
407
408         Reviewed by Antti Koivisto.
409
410         This patch ensures that while we compute the vertical/horizontal geometry for an out-of-flow block level box,
411         the static and the absolute positioned values are in the same coordinate system (relative to the containing block's padding box).
412
413         * layout/FormattingContextGeometry.cpp:
414         (WebCore::Layout::staticVerticalPositionForOutOfFlowPositioned):
415         (WebCore::Layout::staticHorizontalPositionForOutOfFlowPositioned):
416         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
417         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
418         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
419         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
420
421 2019-06-15  Zalan Bujtas  <zalan@apple.com>
422
423         [LFC][IFC] Add support for vertical-align: top and bottom
424         https://bugs.webkit.org/show_bug.cgi?id=198697
425         <rdar://problem/51556188>
426
427         Reviewed by Antti Koivisto.
428
429         Use the layout box's vertical alignment to adjust line baseline and height and set the run's logical top when the line is being closed.
430
431         * layout/inlineformatting/InlineLine.cpp:
432         (WebCore::Layout::Line::isVisuallyEmpty const):
433         (WebCore::Layout::Line::close):
434         (WebCore::Layout::Line::appendInlineContainerStart):
435         (WebCore::Layout::Line::appendTextContent):
436         (WebCore::Layout::Line::appendNonReplacedInlineBox):
437         (WebCore::Layout::Line::appendHardLineBreak):
438         (WebCore::Layout::Line::adjustBaselineAndLineHeight):
439         (WebCore::Layout::Line::inlineItemHeight const):
440         (WebCore::Layout::Line::Content::isVisuallyEmpty const): Deleted.
441         * layout/inlineformatting/InlineLine.h:
442         (WebCore::Layout::Line::Content::isVisuallyEmpty const):
443         (WebCore::Layout::Line::Content::setIsVisuallyEmpty):
444         (WebCore::Layout::Line::hasContent const):
445
446 2019-06-14  Antoine Quint  <graouts@apple.com>
447
448         [Pointer Events] button property is -1 for pointerdown and pointerup
449         https://bugs.webkit.org/show_bug.cgi?id=198868
450         <rdar://problem/51758109>
451
452         Reviewed by Dean Jackson.
453
454         A value of -1 for "button", which means there was no change of pressed button since the last event, should only ever be used for "pointermove" events.
455
456         Test: pointerevents/mouse/pointer-button-and-buttons.html
457
458         * page/PointerCaptureController.cpp:
459         (WebCore::PointerCaptureController::pointerEventForMouseEvent):
460
461 2019-06-14  Megan Gardner  <megan_gardner@apple.com>
462
463         Move Synthetic Editing Commands to behind an experimental feature flag
464         https://bugs.webkit.org/show_bug.cgi?id=198842
465         <rdar://problem/50594700>
466
467         Reviewed by Simon Fraser.
468
469         Moving from a quirk to a feature flag.
470
471         * page/Quirks.cpp:
472         (WebCore::shouldEmulateEditingButtonsAndGesturesInHiddenEditableAreasForHost): Deleted.
473         (WebCore::Quirks::shouldEmulateEditingButtonsAndGesturesInHiddenEditableAreas const): Deleted.
474         * page/Quirks.h:
475         * page/RuntimeEnabledFeatures.h:
476         (WebCore::RuntimeEnabledFeatures::setSyntheticEditingCommandsEnabled):
477         (WebCore::RuntimeEnabledFeatures::syntheticEditingCommandsEnabled const):
478
479 2019-06-14  Jer Noble  <jer.noble@apple.com>
480
481         REGRESSION(244439): platform/mac/media/encrypted-media/fps-* tests are crashing
482         https://bugs.webkit.org/show_bug.cgi?id=198612
483         <rdar://problem/51078978>
484
485         Reviewed by Eric Carlson.
486
487         There are two implementations of a 'cenc' initialiation data factory; an ASSERT fires when
488         the second one is added to the registry. Unify them.
489
490         * Modules/encryptedmedia/InitDataRegistry.cpp:
491         (WebCore::extractKeyIDsCenc):
492         * platform/graphics/avfoundation/CDMFairPlayStreaming.cpp:
493         (WebCore::CDMPrivateFairPlayStreaming::validFairPlayStreamingSchemes):
494         (WebCore::CDMPrivateFairPlayStreaming::fairPlaySystemID):
495         (WebCore::validInitDataTypes):
496         (WebCore::CDMFactory::platformRegisterFactories):
497         (WebCore::validFairPlayStreamingSchemes): Deleted.
498         (WebCore::CDMPrivateFairPlayStreaming::cencName): Deleted.
499         (WebCore::fairPlaySystemID): Deleted.
500         (WebCore::extractSchemeAndKeyIdFromCenc): Deleted.
501         (WebCore::CDMPrivateFairPlayStreaming::extractKeyIDsCenc): Deleted.
502         (WebCore::CDMPrivateFairPlayStreaming::sanitizeCenc): Deleted.
503         * platform/graphics/avfoundation/CDMFairPlayStreaming.h:
504
505 2019-06-14  Saam Barati  <sbarati@apple.com>
506
507         Unreviewed. Follow up to r246438. This removes a debug assert until
508         we do further compiler work in: https://bugs.webkit.org/show_bug.cgi?id=198861
509
510         * Modules/webgpu/WHLSL/WHLSLCheckDuplicateFunctions.cpp:
511         (WebCore::WHLSL::checkDuplicateFunctions):
512         * Modules/webgpu/WHLSL/WHLSLStandardLibrary.txt:
513
514 2019-06-14  Saam Barati  <sbarati@apple.com>
515
516         [WHLSL] Implement out-of-bounds and nullptr behavior
517         https://bugs.webkit.org/show_bug.cgi?id=198600
518         <rdar://problem/51668853>
519
520         Reviewed by Robin Morisset.
521
522         The behavior we're implementing is:
523         - OOB writes are ignored.
524         - OOB reads return zero.
525         - Writes to null are ignored.
526         - Reads from null return zero.
527         - &*x == x, including &*null == null.
528         
529         We implement this like so:
530         - The value stack in FunctionWriter turns into a stack of pairs: rvalues and lvalues.
531           rvalues are represented the same as before. Lvalues are always pointers.
532         - Anything that produces an lvalue must push a pointer to the stack. Not
533           all things produce lvalues, so that entry in the stack may be empty.
534           However, all things that produce lvalues also produce rvalues. So, "*x = 42" works,
535           and so does "foo(*x)". Nodes that produce lvalues are responsible for also producing
536           an rvalue, which should be the value as if the lvalue was dereferenced at that point
537           in program execution. So the "*x" in "thread int* x = null; *x" produces the int zero
538           for its rvalue, and null for its lvalue.
539         - Dereference just works, as dereference produces both an lvalue and rvalue. Dereference
540           node's child must also be an lvalue. So we just forward that value along on
541           the stack. For the rvalue, if we try to dereference nullptr, we just fill in
542           zero bytes instead. Otherwise, the rvalue is the result of dereferencing the
543           non-null pointer.
544         - Assignment expressions check if the incoming lvalue is null. If it is, it
545           skips the assignment.
546         - operator&[] returns nullptr on an OOB access. Then, based on the above
547           behavior, we get the desired OOB reads return zero, and OOB writes are
548           ignored.
549         - MakePointerExpression just takes the last lvalue off the stack (which must
550           be a pointer) and returns it as an rvalue.
551         - VariableReference will push both the variable value and a pointer to the variable
552           onto the stack.
553
554         This patch also fixes a few bugs where we weren't giving certain AST nodes the
555         proper address space values.
556
557         This patch also removes code to generate native functions for operators
558         "operator[]" and "operator[]=" as we should never be generating these
559         ourselves. We should only be generating the "operator&[]" ander.
560
561         Tests: webgpu/whlsl-null-dereference.html
562                webgpu/whlsl-oob-access.html
563
564         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
565         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::FunctionDefinitionWriter):
566         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::appendRightValue):
567         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::appendLeftValue):
568         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::takeLastValue):
569         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::takeLastLeftValue):
570         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::visit):
571         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::emitLoop):
572         * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp:
573         (WebCore::WHLSL::Metal::writeNativeFunction):
574         * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.h:
575         * Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.cpp:
576         (WebCore::WHLSL::Metal::TypeNamer::emitUnnamedTypeDefinition):
577         * Modules/webgpu/WHLSL/WHLSLPreserveVariableLifetimes.cpp:
578         (WebCore::WHLSL::PreserveLifetimes::assignVariableIntoStruct):
579         * Modules/webgpu/WHLSL/WHLSLPropertyResolver.cpp:
580         (WebCore::WHLSL::PropertyResolver::visit):
581         * Modules/webgpu/WHLSL/WHLSLStandardLibrary.txt:
582         * platform/graphics/gpu/cocoa/GPUComputePipelineMetal.mm:
583         (WebCore::trySetFunctions):
584         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
585         (WebCore::trySetFunctions):
586
587 2019-06-14  Jer Noble  <jer.noble@apple.com>
588
589         CRASH(nullptr) in WebCore::jsAudioContextCurrentTime()
590         https://bugs.webkit.org/show_bug.cgi?id=198859
591         <rdar://problem/27986991>
592
593         Reviewed by Eric Carlson.
594
595         AudioContext's m_destinationNode can become null during iframe teardown,
596         but can AudioContext methods can still be called by JavaScript. Add null-checks
597         to all (remaing) unprotected dereferences of m_destinationNode.
598
599         * Modules/webaudio/AudioContext.cpp:
600         (WebCore::AudioContext::uninitialize):
601         (WebCore::AudioContext::createBufferSource):
602         (WebCore::AudioContext::createScriptProcessor):
603         (WebCore::AudioContext::createBiquadFilter):
604         (WebCore::AudioContext::createPanner):
605         (WebCore::AudioContext::createConvolver):
606         (WebCore::AudioContext::createDynamicsCompressor):
607         (WebCore::AudioContext::createAnalyser):
608         (WebCore::AudioContext::createGain):
609         (WebCore::AudioContext::createDelay):
610         (WebCore::AudioContext::createChannelSplitter):
611         (WebCore::AudioContext::createChannelMerger):
612         (WebCore::AudioContext::createOscillator):
613         * Modules/webaudio/AudioContext.h:
614         (WebCore::AudioContext::currentSampleFrame const):
615         (WebCore::AudioContext::currentTime const):
616         (WebCore::AudioContext::sampleRate const):
617
618 2019-06-14  Youenn Fablet  <youenn@apple.com>
619
620         Cloning a MediaStreamTrack does not clone the logger
621         https://bugs.webkit.org/show_bug.cgi?id=198844
622
623         Reviewed by Eric Carlson.
624
625         Make MediaStream and MediaStreamTrack rely on their private versions for logging.
626         Move from a RefPtr version to a Ref so as to forbid nullptr crashes.
627         Make sure that RealtimeIncomingAudioSource and RealtimeIncomingVideoSource check for their logger before logging.
628         Covered by existing tests and updated test.
629
630         * Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
631         (WebCore::loggerFromContext):
632         (WebCore::CanvasCaptureMediaStreamTrack::CanvasCaptureMediaStreamTrack):
633         * Modules/mediastream/MediaStream.cpp:
634         (WebCore::loggerFromContext):
635         (WebCore::MediaStream::create):
636         (WebCore::MediaStream::MediaStream):
637         * Modules/mediastream/MediaStream.h:
638         * Modules/mediastream/MediaStreamTrack.cpp:
639         (WebCore::MediaStreamTrack::MediaStreamTrack):
640         * Modules/mediastream/MediaStreamTrack.h:
641         * Modules/mediastream/UserMediaRequest.cpp:
642         (WebCore::UserMediaRequest::allow):
643         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
644         (WebCore::LibWebRTCMediaEndpoint::mediaStreamFromRTCStream):
645         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
646         (WebCore::LibWebRTCPeerConnectionBackend::createReceiverForSource):
647         * Modules/webaudio/MediaStreamAudioDestinationNode.cpp:
648         (WebCore::MediaStreamAudioDestinationNode::MediaStreamAudioDestinationNode):
649         * platform/mediastream/MediaStreamPrivate.cpp:
650         (WebCore::MediaStreamPrivate::create):
651         (WebCore::MediaStreamPrivate::MediaStreamPrivate):
652         (WebCore::MediaStreamPrivate::setLogger): Deleted.
653         * platform/mediastream/MediaStreamPrivate.h:
654         * platform/mediastream/MediaStreamTrackPrivate.cpp:
655         (WebCore::MediaStreamTrackPrivate::create):
656         (WebCore::MediaStreamTrackPrivate::MediaStreamTrackPrivate):
657         (WebCore::MediaStreamTrackPrivate::clone):
658         (WebCore::MediaStreamTrackPrivate::setLogger): Deleted.
659         * platform/mediastream/MediaStreamTrackPrivate.h:
660         * platform/mediastream/RealtimeMediaSourceCenter.cpp:
661         (WebCore::RealtimeMediaSourceCenter::createMediaStream):
662         * platform/mediastream/RealtimeMediaSourceCenter.h:
663         * platform/mediastream/mac/RealtimeIncomingAudioSourceCocoa.cpp:
664         (WebCore::RealtimeIncomingAudioSourceCocoa::OnData):
665         * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
666         (WebCore::RealtimeIncomingVideoSourceCocoa::pixelBufferPool):
667         (WebCore::RealtimeIncomingVideoSourceCocoa::pixelBufferFromVideoFrame):
668         (WebCore::RealtimeIncomingVideoSourceCocoa::OnFrame):
669
670 2019-06-14  Ali Juma  <ajuma@chromium.org>
671
672         IntersectionObserver rootMargin detection fails when `root` is an element
673         https://bugs.webkit.org/show_bug.cgi?id=198784
674
675         Reviewed by Simon Fraser.
676
677         When computing a target's bounds in root space, we were applying the root's
678         clip rect (if any), and then intersecting with the root rect expanded by the
679         root margin. This meant that if a target did not intersect the non-expanded root
680         rect, we would get an empty intersection even if the target did intersect the
681         expanded root rect. Fix this by not applying the root's clip rect when computing
682         a target's bounds in root space. Add a new VisibleRectContextOption::ApplyContainerClip
683         that determines whether RenderObject::computeVisibleRectInContainer should apply
684         the container's clip.
685
686         Test: imported/w3c/web-platform-tests/intersection-observer/root-margin-root-element.html
687
688         * rendering/RenderBox.cpp:
689         (WebCore::RenderBox::applyCachedClipAndScrollPosition const):
690         * rendering/RenderObject.cpp:
691         (WebCore::RenderObject::visibleRectContextForRepaint):
692         * rendering/RenderObject.h:
693
694 2019-06-14  Carlos Garcia Campos  <cgarcia@igalia.com>
695
696         [cairo] Entering text into forms on github.com creates a trapezoid artifact
697         https://bugs.webkit.org/show_bug.cgi?id=126124
698
699         Reviewed by Michael Catanzaro.
700
701         Mixing antialiasing modes in the same clip is not actually supported by cairo. In the case of rectangle clips we
702         are already ignoring the current antialiasing to not do any antialiasing. We could do the opposite for clips
703         receiving a path, we want to enforce antialiasing in that case since the paths might contain curves. Doing that
704         we ensure all calls to clip with a path use the same antialiasing, which is the case of the github bug.
705
706         * platform/graphics/cairo/CairoOperations.cpp:
707         (WebCore::Cairo::doClipWithAntialias): Helper to call cairo_clip() with the given antialising mode.
708         (WebCore::Cairo::clip): Use doClipWithAntialias().
709         (WebCore::Cairo::clipOut): Ditto.
710         (WebCore::Cairo::clipPath): Ditto.
711
712 2019-06-13  Myles C. Maxfield  <mmaxfield@apple.com>
713
714         [WHLSL] Remove unnecessary ASSERT()s and clean up visitor lambdas
715         https://bugs.webkit.org/show_bug.cgi?id=198706
716
717         Reviewed by Dean Jackson, Saam Barati, and Robin Morisset.
718
719         Some minor refactoring.
720
721         If the code is going to unconditionally downcast<Foo>(bar), there's no need
722         to guard that with an ASSERT(is<Foo>(bar)) because the downcast() call will
723         do that automatically.
724
725         No new tests because there is no behavior change.
726
727         * Modules/webgpu/WHLSL/AST/WHLSLConstantExpression.h:
728         (WebCore::WHLSL::AST::ConstantExpression::visit):
729         (WebCore::WHLSL::AST::ConstantExpression::visit const):
730         * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp:
731         (WebCore::WHLSL::Metal::EntryPointScaffolding::resourceHelperTypes):
732         (WebCore::WHLSL::Metal::EntryPointScaffolding::mangledOutputPath):
733         (WebCore::WHLSL::Metal::EntryPointScaffolding::unpackResourcesAndNamedBuiltIns):
734         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
735         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::visit):
736         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::constantExpressionString):
737         * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp:
738         (WebCore::WHLSL::Metal::writeNativeFunction):
739         * Modules/webgpu/WHLSL/Metal/WHLSLNativeTypeWriter.cpp:
740         (WebCore::WHLSL::Metal::writeNativeType):
741         * Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.cpp:
742         (WebCore::WHLSL::Metal::find):
743         (WebCore::WHLSL::Metal::TypeNamer::createNameNode):
744         (WebCore::WHLSL::Metal::TypeNamer::insert):
745         (WebCore::WHLSL::Metal::TypeNamer::emitUnnamedTypeDefinition):
746         (WebCore::WHLSL::Metal::TypeNamer::emitNamedTypeDefinition):
747         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
748         (WebCore::WHLSL::Checker::visit):
749         (WebCore::WHLSL::argumentTypeForAndOverload):
750         * Modules/webgpu/WHLSL/WHLSLInferTypes.cpp:
751         (WebCore::WHLSL::inferTypesForTypeArguments):
752         * Modules/webgpu/WHLSL/WHLSLIntrinsics.cpp:
753         (WebCore::WHLSL::Intrinsics::addFullTexture):
754         (WebCore::WHLSL::Intrinsics::addDepthTexture):
755         * Modules/webgpu/WHLSL/WHLSLPropertyResolver.cpp:
756         (WebCore::WHLSL::modify):
757         (WebCore::WHLSL::PropertyResolver::visit):
758         * Modules/webgpu/WHLSL/WHLSLVisitor.cpp:
759         (WebCore::WHLSL::Visitor::visit):
760
761 2019-06-12  Myles C. Maxfield  <mmaxfield@apple.com>
762
763         [WHLSL] Hook up compute
764         https://bugs.webkit.org/show_bug.cgi?id=198644
765
766         Reviewed by Saam Barati.
767
768         This patch hooks up compute shaders in exactly the same way that vertex and fragment shaders
769         are hooked up. I've modified the two patchs (compute and rendering) to be almost exactly the
770         same code.
771
772         This patch also adds support for the WHLSL compiler to determine what the numthreads()
773         attribute in the shader says so that it can be hooked up to Metal's threads-per-threadgroup
774         argument in the dispatch call. There is some logic to make sure that there aren't two
775         numthreads() attributes on the same compute shader.
776
777         It also adds a little bit of type renaming. For built-in variables, sometimes Metal's type
778         doesn't always match WHLSL's (and HLSL's type). For example, in WHLSL and HLSL,        SV_DispatchThreadID variables have to be a float3, but in Metal, they are a uint3.
779         Therefore, I've added a little bit of code during each entry point's pack and unpack stages
780         to handle this type conversion.
781
782         Test: webgpu/whlsl-compute.html
783
784         * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp:
785         (WebCore::WHLSL::Metal::internalTypeForSemantic): Determine which Metal type corresponds to
786         each built-in variable.
787         (WebCore::WHLSL::Metal::EntryPointScaffolding::builtInsSignature): Perform the type
788         conversion.
789         (WebCore::WHLSL::Metal::EntryPointScaffolding::unpackResourcesAndNamedBuiltIns): Ditto.
790         (WebCore::WHLSL::Metal::VertexEntryPointScaffolding::VertexEntryPointScaffolding): Ditto.
791         (WebCore::WHLSL::Metal::VertexEntryPointScaffolding::helperTypes): Ditto.
792         (WebCore::WHLSL::Metal::VertexEntryPointScaffolding::pack): Ditto.
793         (WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::FragmentEntryPointScaffolding): Ditto.
794         (WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::helperTypes): Ditto.
795         (WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::pack): Ditto.
796         (WebCore::WHLSL::Metal::ComputeEntryPointScaffolding::signature): Ditto.
797         * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.h:
798         * Modules/webgpu/WHLSL/WHLSLComputeDimensions.cpp: Added. Add a pass to determine whether
799         or not any entry point has duplicate numthreads() attribute, and to determine what the
800         appropriate numthreads() values should be for the current entry point.
801         (WebCore::WHLSL::ComputeDimensionsVisitor::ComputeDimensionsVisitor):
802         (WebCore::WHLSL::ComputeDimensionsVisitor::computeDimensions const):
803         (WebCore::WHLSL::computeDimensions):
804         * Modules/webgpu/WHLSL/WHLSLComputeDimensions.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/WHLSLPrepare.h.
805         * Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.cpp:
806         (WebCore::WHLSL::gatherEntryPointItems): Compute shaders don't need to have a semantic for their return type.
807         * Modules/webgpu/WHLSL/WHLSLPrepare.cpp:
808         (WebCore::WHLSL::prepare): Run the computeDimensions() pass.
809         * Modules/webgpu/WHLSL/WHLSLPrepare.h:
810         * Modules/webgpu/WHLSL/WHLSLPropertyResolver.cpp: In a left-value propertyAccessExpression,
811         the index expression can be a right-value. Treat it as such.
812         (WebCore::WHLSL::LeftValueSimplifier::finishVisiting):
813         (WebCore::WHLSL::LeftValueSimplifier::visit):
814         * Modules/webgpu/WHLSL/WHLSLStandardLibrary.txt: We need support for multiplication (for a
815         test) and float3 for SV_DispatchThreadID.
816         * Sources.txt:
817         * SourcesCocoa.txt:
818         * WebCore.xcodeproj/project.pbxproj:
819         * platform/graphics/gpu/GPUComputePipeline.h: Associate a compute dimensions with a particular
820         compute pipeline. This is how Metal knows what values to use for a dispatch.
821         (WebCore::GPUComputePipeline::computeDimensions const):
822         * platform/graphics/gpu/cocoa/GPUComputePassEncoderMetal.mm: Use the saved compute dimensions.
823         (WebCore::GPUComputePassEncoder::dispatch):
824         * platform/graphics/gpu/cocoa/GPUComputePipelineMetal.mm: Make the code match GPURenderPipelineMetal.
825         (WebCore::trySetMetalFunctions):
826         (WebCore::trySetFunctions):
827         (WebCore::convertComputePipelineDescriptor):
828         (WebCore::tryCreateMTLComputePipelineState):
829         (WebCore::GPUComputePipeline::tryCreate):
830         (WebCore::GPUComputePipeline::GPUComputePipeline):
831         (WebCore::tryCreateMtlComputeFunction): Deleted.
832         * platform/graphics/gpu/cocoa/GPUPipelineMetalConvertLayout.cpp: Added. Moved shared helper
833         functions to a file where they can be accessed by multiple places.
834         (WebCore::convertShaderStageFlags):
835         (WebCore::convertBindingType):
836         (WebCore::convertLayout):
837         * platform/graphics/gpu/cocoa/GPUPipelineMetalConvertLayout.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/WHLSLPrepare.h.
838         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm: Delete the functions that were moved to GPUPipelineMetalConvertLayout.
839         (WebCore::trySetFunctions):
840         (WebCore::tryCreateMtlRenderPipelineState):
841         (WebCore::convertShaderStageFlags): Deleted.
842         (WebCore::convertBindingType): Deleted.
843         (WebCore::convertLayout): Deleted.
844
845 2019-06-13  Jer Noble  <jer.noble@apple.com>
846
847         AVKit play button bypasses MediaElementSession playbackPermitted() checks.
848         https://bugs.webkit.org/show_bug.cgi?id=198813
849
850         Reviewed by Eric Carlson.
851
852         HTMLMediaElement::togglePlayState() is an internal-only method that doesn't
853         run playbackPermitted() checks. For our imitation AVPlayerController, translate
854         requests to -togglePlayback: into calls to play() and pause() depending on
855         playback state.
856
857         * platform/ios/WebAVPlayerController.mm:
858         (-[WebAVPlayerController togglePlayback:]):
859
860 2019-06-13  Commit Queue  <commit-queue@webkit.org>
861
862         Unreviewed, rolling out r246396 and r246397.
863         https://bugs.webkit.org/show_bug.cgi?id=198837
864
865         Breaks internal builds (Requested by ShawnRoberts on #webkit).
866
867         Reverted changesets:
868
869         "[WHLSL] Hook up compute"
870         https://bugs.webkit.org/show_bug.cgi?id=198644
871         https://trac.webkit.org/changeset/246396
872
873         "[WHLSL] Hook up compute"
874         https://bugs.webkit.org/show_bug.cgi?id=198644
875         https://trac.webkit.org/changeset/246397
876
877 2019-06-13  Antti Koivisto  <antti@apple.com>
878
879         twitch.tv: embedded video hovers down the screen when scrolling on iPad
880         https://bugs.webkit.org/show_bug.cgi?id=198832
881         <rdar://problem/51541439>
882
883         Reviewed by Simon Fraser.
884
885         Test: compositing/scrolling/async-overflow-scrolling/overflow-scroll-paint-order-sibling.html
886
887         * rendering/RenderLayer.cpp:
888         (WebCore::RenderLayer::scrollTo):
889
890         Overflow scroll layer may have composited descendants that are its paint order siblings. We need to invalidate
891         the tree of the paint order parent for compositing update (instead of just the tree of the overflow scroll layer).
892
893         This matches what RenderLayer::updateLayerPosition() does.
894
895 2019-06-13  Youenn Fablet  <youenn@apple.com>
896
897         SocketStreamHandle should not be destroyed in a background thread
898         https://bugs.webkit.org/show_bug.cgi?id=198781
899
900         Reviewed by Geoffrey Garen.
901
902         Make sure to destroy SocketStreamHandle on the main thread since it owns an URL created on the main thread.
903         Covered by WPT websocket tests from https://bugs.webkit.org/show_bug.cgi?id=198774.
904
905         * platform/network/SocketStreamHandle.cpp:
906         (WebCore::SocketStreamHandle::SocketStreamHandle):
907         * platform/network/SocketStreamHandle.h:
908
909 2019-06-13  Antoine Quint  <graouts@apple.com>
910
911         "display: contents" Content click does not trigger
912         https://bugs.webkit.org/show_bug.cgi?id=198559
913         <rdar://problem/51488524>
914
915         Reviewed by Antti Koivisto.
916
917         Test: fast/events/ios/click-event-and-display-contents.html
918
919         * dom/Element.h:
920
921 2019-06-13  Takashi Komori  <Takashi.Komori@sony.com>
922
923         [curl] Remove member objects of CurlRequest not to share by different threads.
924         https://bugs.webkit.org/show_bug.cgi?id=198747
925
926         Reviewed by Fujii Hironori.
927
928         Removed m_certificateInfo and m_networkLoadMetrics.
929         Before patch those objects were updated by different threads.
930
931         No tests needed, no functionality changes.
932
933         * platform/network/curl/CurlDownload.cpp:
934         (WebCore::CurlDownload::curlDidReceiveResponse):
935         (WebCore::CurlDownload::curlDidReceiveBuffer):
936         (WebCore::CurlDownload::curlDidComplete):
937         (WebCore::CurlDownload::curlDidFailWithError):
938         * platform/network/curl/CurlDownload.h:
939         * platform/network/curl/CurlRequest.cpp:
940         (WebCore::CurlRequest::start):
941         (WebCore::CurlRequest::didReceiveHeader):
942         (WebCore::CurlRequest::didCompleteTransfer):
943         (WebCore::CurlRequest::invokeDidReceiveResponse):
944         (WebCore::CurlRequest::networkLoadMetrics):
945         (WebCore::CurlRequest::updateNetworkLoadMetrics): Deleted.
946         * platform/network/curl/CurlRequest.h:
947         (WebCore::CurlRequest::setStartTime):
948         (WebCore::CurlRequest::certificateInfo const): Deleted.
949         (WebCore::CurlRequest::networkLoadMetrics const): Deleted.
950         * platform/network/curl/CurlRequestClient.h:
951         * platform/network/curl/CurlResourceHandleDelegate.cpp:
952         (WebCore::CurlResourceHandleDelegate::curlDidSendData):
953         (WebCore::CurlResourceHandleDelegate::curlDidReceiveResponse):
954         (WebCore::CurlResourceHandleDelegate::curlDidReceiveBuffer):
955         (WebCore::CurlResourceHandleDelegate::curlDidComplete):
956         (WebCore::CurlResourceHandleDelegate::curlDidFailWithError):
957         * platform/network/curl/CurlResourceHandleDelegate.h:
958         * platform/network/curl/CurlResponse.h:
959         (WebCore::CurlResponse::isolatedCopy const):
960         * platform/network/curl/ResourceResponseCurl.cpp:
961         (WebCore::ResourceResponse::ResourceResponse):
962
963 2019-06-13  Zan Dobersek  <zdobersek@igalia.com>
964
965         [Nicosia] Add SceneIntegration
966         https://bugs.webkit.org/show_bug.cgi?id=198791
967
968         Reviewed by Carlos Garcia Campos.
969
970         Add the SceneIntegration class to the Nicosia namespace, primarily for
971         the purpose of being able to conveniently trigger scene updates whenever
972         changes are done to the state of layers that are included in that scene.
973         Initially this would be used for layer changes done on a
974         scrolling-dedicated thread.
975
976         Each Nicosia::PlatformLayer can have a SceneIntegration object reference
977         associated. Helper createUpdateScope() method returns a
978         SceneIntegration::UpdateScope instance that triggers an update for the
979         scene when that instance is destroyed (normally when it goes out of the
980         scope).
981
982         * platform/TextureMapper.cmake:
983         * platform/graphics/nicosia/NicosiaPlatformLayer.h:
984         (Nicosia::PlatformLayer::setSceneIntegration):
985         (Nicosia::PlatformLayer::createUpdateScope):
986         * platform/graphics/nicosia/NicosiaSceneIntegration.cpp: Added.
987         (Nicosia::SceneIntegration::SceneIntegration):
988         (Nicosia::SceneIntegration::~SceneIntegration):
989         (Nicosia::SceneIntegration::setClient):
990         (Nicosia::SceneIntegration::invalidate):
991         (Nicosia::SceneIntegration::requestUpdate):
992         (Nicosia::SceneIntegration::createUpdateScope):
993         (Nicosia::SceneIntegration::UpdateScope::UpdateScope):
994         (Nicosia::SceneIntegration::UpdateScope::~UpdateScope):
995         * platform/graphics/nicosia/NicosiaSceneIntegration.h: Added.
996
997 2019-06-13  Philippe Normand  <pnormand@igalia.com>
998
999         [GStreamer] HLS stream slow start
1000         https://bugs.webkit.org/show_bug.cgi?id=198377
1001
1002         Reviewed by Xabier Rodriguez-Calvar.
1003
1004         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
1005         (webKitWebSrcCreate): Cut down the adapter condition to 200 ms to
1006         improve start-up times for HLS playback.
1007
1008 2019-06-13  Ludovico de Nittis  <ludovico.denittis@collabora.com>
1009
1010         [GTK] gdk_display_get_device_manager and gdk_screen_get_width/height are deprecated
1011         https://bugs.webkit.org/show_bug.cgi?id=198822
1012
1013         Reviewed by Carlos Garcia Campos.
1014
1015         GdkSeat and GdkRectangle should be used, respectively.
1016
1017         No behaviour changes.
1018
1019         * platform/gtk/GtkVersioning.c:
1020         (getDefaultGDKPointerDevice):
1021         (getScreenWorkArea):
1022
1023 2019-06-12  Antoine Quint  <graouts@apple.com>
1024
1025         [WHLSL] Hook up compute
1026         https://bugs.webkit.org/show_bug.cgi?id=198644
1027
1028         Unreviewed build fix. Release iOS build would complain that pipelineState was unused.
1029
1030         * platform/graphics/gpu/cocoa/GPUComputePassEncoderMetal.mm:
1031         (WebCore::GPUComputePassEncoder::dispatch):
1032
1033 2019-06-12  Myles C. Maxfield  <mmaxfield@apple.com>
1034
1035         [WHLSL] Hook up compute
1036         https://bugs.webkit.org/show_bug.cgi?id=198644
1037
1038         Reviewed by Saam Barati.
1039
1040         This patch hooks up compute shaders in exactly the same way that vertex and fragment shaders
1041         are hooked up. I've modified the two patchs (compute and rendering) to be almost exactly the
1042         same code.
1043
1044         This patch also adds support for the WHLSL compiler to determine what the numthreads()
1045         attribute in the shader says so that it can be hooked up to Metal's threads-per-threadgroup
1046         argument in the dispatch call. There is some logic to make sure that there aren't two
1047         numthreads() attributes on the same compute shader.
1048
1049         It also adds a little bit of type renaming. For built-in variables, sometimes Metal's type
1050         doesn't always match WHLSL's (and HLSL's type). For example, in WHLSL and HLSL,        SV_DispatchThreadID variables have to be a float3, but in Metal, they are a uint3.
1051         Therefore, I've added a little bit of code during each entry point's pack and unpack stages
1052         to handle this type conversion.
1053
1054         Test: webgpu/whlsl-compute.html
1055
1056         * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp:
1057         (WebCore::WHLSL::Metal::internalTypeForSemantic): Determine which Metal type corresponds to
1058         each built-in variable.
1059         (WebCore::WHLSL::Metal::EntryPointScaffolding::builtInsSignature): Perform the type
1060         conversion.
1061         (WebCore::WHLSL::Metal::EntryPointScaffolding::unpackResourcesAndNamedBuiltIns): Ditto.
1062         (WebCore::WHLSL::Metal::VertexEntryPointScaffolding::VertexEntryPointScaffolding): Ditto.
1063         (WebCore::WHLSL::Metal::VertexEntryPointScaffolding::helperTypes): Ditto.
1064         (WebCore::WHLSL::Metal::VertexEntryPointScaffolding::pack): Ditto.
1065         (WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::FragmentEntryPointScaffolding): Ditto.
1066         (WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::helperTypes): Ditto.
1067         (WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::pack): Ditto.
1068         (WebCore::WHLSL::Metal::ComputeEntryPointScaffolding::signature): Ditto.
1069         * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.h:
1070         * Modules/webgpu/WHLSL/WHLSLComputeDimensions.cpp: Added. Add a pass to determine whether
1071         or not any entry point has duplicate numthreads() attribute, and to determine what the
1072         appropriate numthreads() values should be for the current entry point.
1073         (WebCore::WHLSL::ComputeDimensionsVisitor::ComputeDimensionsVisitor):
1074         (WebCore::WHLSL::ComputeDimensionsVisitor::computeDimensions const):
1075         (WebCore::WHLSL::computeDimensions):
1076         * Modules/webgpu/WHLSL/WHLSLComputeDimensions.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/WHLSLPrepare.h.
1077         * Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.cpp:
1078         (WebCore::WHLSL::gatherEntryPointItems): Compute shaders don't need to have a semantic for their return type.
1079         * Modules/webgpu/WHLSL/WHLSLPrepare.cpp:
1080         (WebCore::WHLSL::prepare): Run the computeDimensions() pass.
1081         * Modules/webgpu/WHLSL/WHLSLPrepare.h:
1082         * Modules/webgpu/WHLSL/WHLSLPropertyResolver.cpp: In a left-value propertyAccessExpression,
1083         the index expression can be a right-value. Treat it as such.
1084         (WebCore::WHLSL::LeftValueSimplifier::finishVisiting):
1085         (WebCore::WHLSL::LeftValueSimplifier::visit):
1086         * Modules/webgpu/WHLSL/WHLSLStandardLibrary.txt: We need support for multiplication (for a
1087         test) and float3 for SV_DispatchThreadID.
1088         * Sources.txt:
1089         * SourcesCocoa.txt:
1090         * WebCore.xcodeproj/project.pbxproj:
1091         * platform/graphics/gpu/GPUComputePipeline.h: Associate a compute dimensions with a particular
1092         compute pipeline. This is how Metal knows what values to use for a dispatch.
1093         (WebCore::GPUComputePipeline::computeDimensions const):
1094         * platform/graphics/gpu/cocoa/GPUComputePassEncoderMetal.mm: Use the saved compute dimensions.
1095         (WebCore::GPUComputePassEncoder::dispatch):
1096         * platform/graphics/gpu/cocoa/GPUComputePipelineMetal.mm: Make the code match GPURenderPipelineMetal.
1097         (WebCore::trySetMetalFunctions):
1098         (WebCore::trySetFunctions):
1099         (WebCore::convertComputePipelineDescriptor):
1100         (WebCore::tryCreateMTLComputePipelineState):
1101         (WebCore::GPUComputePipeline::tryCreate):
1102         (WebCore::GPUComputePipeline::GPUComputePipeline):
1103         (WebCore::tryCreateMtlComputeFunction): Deleted.
1104         * platform/graphics/gpu/cocoa/GPUPipelineMetalConvertLayout.cpp: Added. Moved shared helper
1105         functions to a file where they can be accessed by multiple places.
1106         (WebCore::convertShaderStageFlags):
1107         (WebCore::convertBindingType):
1108         (WebCore::convertLayout):
1109         * platform/graphics/gpu/cocoa/GPUPipelineMetalConvertLayout.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/WHLSLPrepare.h.
1110         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm: Delete the functions that were moved to GPUPipelineMetalConvertLayout.
1111         (WebCore::trySetFunctions):
1112         (WebCore::tryCreateMtlRenderPipelineState):
1113         (WebCore::convertShaderStageFlags): Deleted.
1114         (WebCore::convertBindingType): Deleted.
1115         (WebCore::convertLayout): Deleted.
1116
1117 2019-06-12  Myles C. Maxfield  <mmaxfield@apple.com>
1118
1119         [WHLSL] Implement array references
1120         https://bugs.webkit.org/show_bug.cgi?id=198163
1121
1122         Reviewed by Saam Barati.
1123
1124         The compiler automatically generates anders for every array reference. Luckily, the infrastructure
1125         to generate those anders and emit Metal code to represent them already exists in the compiler.
1126         There are two pieces remaining (which this patch implements):
1127
1128         1. The JavaScript compiler has a behavior where anders that are called with an array reference
1129            as an argument don't wrap the argument in a MakePointerExpression. This is because the array
1130            reference is already a reference type, so it's silly to operate on a pointer to a reference.
1131            This patch implements this by teaching the type checker about which types should be passed
1132            to the ander call, and by actually constructing those types in the property resolver.
1133            The property resolver does this by placing the logic to construct an ander argument in a
1134            single function which also has logic to save the argument in a temporary if the thread ander
1135            will be called. The semantics about which functions are called in which situations are not
1136            changed; instead, we just simply don't wrap array references with MakePointerExpressions.
1137
1138         2. Creating a bind group from the WebGPU API has to retain information about buffer lengths for
1139            each buffer so the shader can properly perform bounds checks. This can be broken down into a
1140            few pieces:
1141            - Creating a bind group layout has to assign extra id indexes for each buffer which will be
1142              filled in to represent the buffer's length
1143            - Creating the bind group itself needs to fill in the buffer length into the Metal argument
1144              buffer
1145            - The shader compiler needs to emit code at the beginning of entry point to find the buffer
1146              lengths and pack them together into the array reference (array references correspond to
1147              a Metal struct with two fields: a pointer and a length).
1148
1149         This patch doesn't actually implement bounds checks themselves; it just hooks up the buffer
1150         lengths so https://bugs.webkit.org/show_bug.cgi?id=198600 can implement it.
1151
1152         The shader compiler's API is modified to allow for this extra buffer length information to be
1153         passed in from the WebGPU implementation.
1154
1155         Unfortunately, I don't think I could split this patch up into two pieces because both are
1156         required to test the compiler with buffers.
1157
1158         Tests: webgpu/whlsl-buffer-fragment.html
1159                webgpu/whlsl-buffer-vertex.html
1160
1161         * Modules/webgpu/WHLSL/AST/WHLSLPropertyAccessExpression.h:
1162         (WebCore::WHLSL::AST::PropertyAccessExpression::baseReference):
1163         * Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.cpp:
1164         (WebCore::WHLSL::AST::ResourceSemantic::isAcceptableType const): Arrays can't be resources
1165         because the compiler has no way of guaranteeing if the resource is long enough to hold the
1166         array at compile time.
1167         * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp:
1168         (WebCore::WHLSL::Metal::EntryPointScaffolding::EntryPointScaffolding): Generate an extra
1169         variable name to represent the buffer length. Only do it for resources which have lengths.
1170         (WebCore::WHLSL::Metal::EntryPointScaffolding::resourceHelperTypes):
1171         (WebCore::WHLSL::Metal::EntryPointScaffolding::unpackResourcesAndNamedBuiltIns): Perform
1172         the appropriate math to turn byte lengths into element counts and store the element count
1173         in the array reference.
1174         * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.h:
1175         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
1176         (WebCore::WHLSL::resolveWithOperatorAnderIndexer): Refactor.
1177         (WebCore::WHLSL::resolveWithOperatorLength): Ditto.
1178         (WebCore::WHLSL::resolveWithReferenceComparator): Ditto.
1179         (WebCore::WHLSL::resolveByInstantiation): Ditto.
1180         (WebCore::WHLSL::argumentTypeForAndOverload): Given an ander, what should the type of the
1181         argument be?
1182         (WebCore::WHLSL::Checker::finishVisiting): Call argumentTypeForAndOverload(). Also, if
1183         we couldn't find an ander, try automatically generating it, the same way that function
1184         calls do. (This is how array references get their anders.)
1185         (WebCore::WHLSL::Checker::visit):
1186         * Modules/webgpu/WHLSL/WHLSLPipelineDescriptor.h: New WHLSL API to provide the length
1187         information.
1188         * Modules/webgpu/WHLSL/WHLSLPropertyResolver.cpp:
1189         (WebCore::WHLSL::PropertyResolver::visit): SimplifyRightValue() can't fail any more.
1190         (WebCore::WHLSL::wrapAnderCallArgument): If the ander argument should be wrapped in a
1191         MakePointer or a MakeArrayReference, do that. Also, if the ander is a thread ander, save
1192         the argument in a local variable and use that.
1193         (WebCore::WHLSL::anderCallArgument): The equivalent of argumentTypeForAndOverload().
1194         (WebCore::WHLSL::setterCall): Call anderCallArgument().
1195         (WebCore::WHLSL::getterCall): Ditto.
1196         (WebCore::WHLSL::modify): We used to have special-case code for handling pointer-to-argument
1197         values as distinct from just the argument values themselves. However, emitting
1198         chains of &* operators is valid and won't even make it through the Metal code generator
1199         after https://bugs.webkit.org/show_bug.cgi?id=198600 is fixed. So, in order to simplify
1200         wrapAnderCallArgument(), don't special case these values and just create &* chains instead.
1201         (WebCore::WHLSL::PropertyResolver::simplifyRightValue):
1202         (WebCore::WHLSL::LeftValueSimplifier::finishVisiting): Call anderCallArgument().
1203         * Modules/webgpu/WHLSL/WHLSLSemanticMatcher.cpp: Update to support the new compiler API.
1204         (WebCore::WHLSL::matchMode):
1205         (WebCore::WHLSL::matchResources):
1206         * Modules/webgpu/WebGPUBindGroupDescriptor.cpp: Ditto.
1207         (WebCore::WebGPUBindGroupDescriptor::tryCreateGPUBindGroupDescriptor const):
1208         * platform/graphics/gpu/GPUBindGroupLayout.h: Add some internal implementation data inside
1209         the bindings object. Use a Variant to differentiate between the various bindings types, and
1210         put the extra length field on just those members of the variant that represent buffers.
1211         * platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm: Update to support the new compiler API.
1212         (WebCore::argumentDescriptor):
1213         (WebCore::GPUBindGroupLayout::tryCreate):
1214         * platform/graphics/gpu/cocoa/GPUBindGroupMetal.mm: Ditto.
1215         (WebCore::setBufferOnEncoder):
1216         (WebCore::GPUBindGroup::tryCreate):
1217         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm: Ditto.
1218         (WebCore::convertBindingType):
1219         (WebCore::convertLayout):
1220
1221 2019-06-12  Carlos Garcia Campos  <cgarcia@igalia.com>
1222
1223         [cairo][SVG] If clipPath has multiple elements, clip-path doesn't work with transform
1224         https://bugs.webkit.org/show_bug.cgi?id=198746
1225
1226         Reviewed by Don Olmstead.
1227
1228         We need to save the current transformation matrix at the moment the image mask is set and set it again on
1229         restore right before applying the mask. This patch also creates a pattern for the image mask surface and set its
1230         transformation matrix according to the mask position, so that we don't need to save the mask rectangle too.
1231
1232         Tests: svg/clip-path/clip-hidpi-expected.svg
1233                svg/clip-path/clip-hidpi.svg
1234                svg/clip-path/clip-opacity-translate-expected.svg
1235                svg/clip-path/clip-opacity-translate.svg
1236
1237         * platform/graphics/cairo/PlatformContextCairo.cpp:
1238         (WebCore::PlatformContextCairo::restore):
1239         (WebCore::PlatformContextCairo::pushImageMask):
1240
1241 2019-06-12  Simon Fraser  <simon.fraser@apple.com>
1242
1243         paddingBoxRect() is wrong with RTL scrollbars on the left
1244         https://bugs.webkit.org/show_bug.cgi?id=198816
1245
1246         Reviewed by Jon Lee.
1247
1248         RenderBox::paddingBoxRect() needs to offset the left side of the box for the
1249         vertical scrollbar, if it's placed on the left.
1250
1251         Test: compositing/geometry/rtl-overflow-scroll.html
1252
1253         * rendering/RenderBox.cpp:
1254         (WebCore::RenderBox::paddingBoxRect const):
1255         * rendering/RenderBox.h:
1256         (WebCore::RenderBox::paddingBoxRect const): Deleted.
1257         * rendering/RenderLayerBacking.cpp:
1258         (WebCore::RenderLayerBacking::updateGeometry):
1259         * rendering/RenderListBox.cpp:
1260         (WebCore::RenderListBox::controlClipRect const):
1261
1262 2019-06-12  Youenn Fablet  <youenn@apple.com>
1263
1264         Use NSURLSession for WebSocket
1265         https://bugs.webkit.org/show_bug.cgi?id=198568
1266
1267         Reviewed by Geoffrey Garen.
1268
1269         Add a runtime flag to either choose the new WebSocket code path or the previously existing one.
1270         The switch is done at WebSocket channel API level which offers the necessary high level API to abstract the two code paths.
1271         By default, we continue using the current WebSocket implementation.
1272         Covered by manual testing on current WebSocket tests.
1273
1274         * Modules/websockets/ThreadableWebSocketChannel.cpp:
1275         (WebCore::ThreadableWebSocketChannel::create):
1276         * Modules/websockets/WebSocketChannel.cpp:
1277         (WebCore::WebSocketChannel::document):
1278         * Modules/websockets/WebSocketChannel.h:
1279         * WebCore.xcodeproj/project.pbxproj:
1280         * page/RuntimeEnabledFeatures.h:
1281         (WebCore::RuntimeEnabledFeatures::isNSURLSessionWebSocketEnabled const):
1282         (WebCore::RuntimeEnabledFeatures::setIsNSURLSessionWebSocketEnabled):
1283         * page/SocketProvider.cpp:
1284         (WebCore::SocketProvider::createWebSocketChannel):
1285         * page/SocketProvider.h:
1286
1287 2019-06-12  Myles C. Maxfield  <mmaxfield@apple.com>
1288
1289         [WHLSL] Educate the property resolver about IndexExpressions
1290         https://bugs.webkit.org/show_bug.cgi?id=198399
1291
1292         Reviewed by Saam Barati.
1293
1294         This is part one of two patches which will allow buffers to work. This patch
1295         adds support in the property resolver for index expressions. Index expressions
1296         get turned into calls to "getter indexers", "setter indexers", or "ander
1297         indexers". They work almost identically to dot expressions, except there is an
1298         extra "index" expression which gets turned into an extra argument to those
1299         functions.
1300
1301         There's actually a bit of a trick here. Let's say we need to run a getter and
1302         a setter separately (e.g. "foo[3]++;"). The index expression can't be duplicated
1303         for both the getter and the setter (e.g. the functions are
1304         int operator[](Foo, uint) and Foo operator[]=(Foo, uint, int), and we aren't
1305         allowed to execute the index expression multiple times. Consider if that "3"
1306         in the example is actually "bar()" with some side effect. So, we have to run
1307         the index expression once at the correct time, and save its result to a temporary
1308         variable, and then pass in the temporary variable into the getter and setter.
1309
1310         So, if the code says "foo[bar()][baz()] = quux();" the following sequence of
1311         functions get run:
1312
1313         - bar()
1314         - operator[](Foo, uint)
1315         - baz()
1316         - quux()
1317         - operator[]=(OtherType, uint, OtherOtherType)
1318         - operator[]=(Foo, uint, OtherType)
1319
1320         The next patch will modify the WebGPU JavaScript implementation to send buffer
1321         lengths to the shader, and for the shader compiler to correctly unpack this
1322         information and place it inside the array references. That should be everything
1323         that's needed to get buffers to work. After that, hooking up compute should be
1324         fairly trivial.
1325
1326         Tests: webgpu/propertyresolver/ander-abstract-lvalue.html
1327                webgpu/propertyresolver/ander-lvalue-3-levels.html
1328                webgpu/propertyresolver/ander-lvalue.html
1329                webgpu/propertyresolver/ander.html
1330                webgpu/propertyresolver/getter.html
1331                webgpu/propertyresolver/indexer-ander-abstract-lvalue.html
1332                webgpu/propertyresolver/indexer-ander-lvalue-3-levels.html
1333                webgpu/propertyresolver/indexer-ander-lvalue.html
1334                webgpu/propertyresolver/indexer-ander.html
1335                webgpu/propertyresolver/indexer-getter.html
1336                webgpu/propertyresolver/indexer-setter-abstract-lvalue-3-levels.html
1337                webgpu/propertyresolver/indexer-setter-abstract-lvalue.html
1338                webgpu/propertyresolver/indexer-setter-lvalue.html
1339                webgpu/propertyresolver/indexer-setter.html
1340                webgpu/propertyresolver/setter-abstract-lvalue-3-levels.html
1341                webgpu/propertyresolver/setter-abstract-lvalue.html
1342                webgpu/propertyresolver/setter-lvalue.html
1343
1344         * Modules/webgpu/WHLSL/AST/WHLSLAddressSpace.h:
1345         (WebCore::WHLSL::AST::toString):
1346         * Modules/webgpu/WHLSL/AST/WHLSLEntryPointType.h:
1347         (WebCore::WHLSL::AST::toString):
1348         * Modules/webgpu/WHLSL/AST/WHLSLIndexExpression.h:
1349         (WebCore::WHLSL::AST::IndexExpression::takeIndex):
1350         * Modules/webgpu/WHLSL/AST/WHLSLReferenceType.h:
1351         * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp:
1352         (WebCore::WHLSL::Metal::writeNativeFunction):
1353         (WebCore::WHLSL::Metal::convertAddressSpace): Deleted.
1354         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
1355         (WebCore::WHLSL::checkOperatorOverload):
1356         (WebCore::WHLSL::Checker::finishVisiting):
1357         (WebCore::WHLSL::Checker::visit):
1358         * Modules/webgpu/WHLSL/WHLSLInferTypes.h:
1359         * Modules/webgpu/WHLSL/WHLSLPropertyResolver.cpp:
1360         (WebCore::WHLSL::PropertyResolver::visit):
1361         (WebCore::WHLSL::setterCall):
1362         (WebCore::WHLSL::getterCall):
1363         (WebCore::WHLSL::modify):
1364         (WebCore::WHLSL::PropertyResolver::simplifyRightValue):
1365         (WebCore::WHLSL::LeftValueSimplifier::finishVisiting):
1366         (WebCore::WHLSL::LeftValueSimplifier::visit):
1367         * Modules/webgpu/WHLSL/WHLSLStandardLibrary.txt:
1368         * Modules/webgpu/WHLSL/WHLSLSynthesizeStructureAccessors.cpp:
1369         (WebCore::WHLSL::synthesizeStructureAccessors):
1370
1371 2019-06-12  Devin Rousso  <drousso@apple.com>
1372
1373         Web Inspector: artificial context menus don't work when Web Inspector is zoomed
1374         https://bugs.webkit.org/show_bug.cgi?id=198801
1375
1376         Reviewed by Joseph Pecoraro.
1377
1378         * inspector/InspectorFrontendHost.cpp:
1379         (WebCore::InspectorFrontendHost::dispatchEventAsContextMenuEvent):
1380         Use the `absoluteLocation` of the `MouseEvent`, which takes into account zoom and scale.
1381
1382 2019-06-12  Sam Weinig  <weinig@apple.com>
1383
1384         Remove dead code in user agent construction
1385         https://bugs.webkit.org/show_bug.cgi?id=198802
1386
1387         Reviewed by Anders Carlsson.
1388
1389         * page/NavigatorBase.cpp:
1390         (WebCore::NavigatorBase::platform const):
1391         Drop dead architures.
1392
1393 2019-06-12  Ludovico de Nittis  <ludovico.denittis@collabora.com>
1394
1395         [GTK] GTK_STOCK_* types have been deprecated since GTK 3.10
1396         https://bugs.webkit.org/show_bug.cgi?id=198787
1397
1398         Reviewed by Michael Catanzaro.
1399
1400         No behaviour changes.
1401
1402         * platform/graphics/gtk/IconGtk.cpp:
1403         (WebCore::lookupIconName):
1404         * platform/graphics/gtk/ImageGtk.cpp:
1405         (WebCore::loadMissingImageIconFromTheme):
1406
1407 2019-06-12  Antti Koivisto  <antti@apple.com>
1408
1409         (Async scrolling) Handle 'position:fixed' inside 'position:sticky' correctly.
1410         https://bugs.webkit.org/show_bug.cgi?id=198788
1411         <rdar://problem/51589759>
1412
1413         Reviewed by Simon Fraser.
1414
1415         Handle 'position:fixed' inside 'position:sticky' correctly.
1416
1417         Also fix nested 'position:fixed' in case where there is an overflow scroller between them.
1418
1419         Tests: scrollingcoordinator/ios/fixed-inside-overflow-inside-fixed.html
1420                scrollingcoordinator/ios/fixed-inside-sticky-frame.html
1421                scrollingcoordinator/ios/fixed-inside-sticky-no-stacking-context-2.html
1422                scrollingcoordinator/ios/fixed-inside-sticky-no-stacking-context.html
1423                scrollingcoordinator/ios/fixed-inside-sticky-stacking-context.html
1424
1425         * page/scrolling/cocoa/ScrollingTreeFixedNode.mm:
1426         (WebCore::ScrollingTreeFixedNode::applyLayerPositions):
1427
1428         Take offsets from sticky nodes into account.
1429
1430         * page/scrolling/cocoa/ScrollingTreeStickyNode.h:
1431         (WebCore::ScrollingTreeStickyNode::layer):
1432         * page/scrolling/cocoa/ScrollingTreeStickyNode.mm:
1433         (WebCore::ScrollingTreeStickyNode::computeLayerPosition const):
1434
1435         Factor into a function.
1436
1437         (WebCore::ScrollingTreeStickyNode::applyLayerPositions):
1438         (WebCore::ScrollingTreeStickyNode::scrollDeltaSinceLastCommit const):
1439         * rendering/RenderLayerCompositor.cpp:
1440         (WebCore::RenderLayerCompositor::isViewportConstrainedFixedOrStickyLayer const):
1441
1442         We need to generate a scrolling tree node for position:fixed in nested case if there is an overflow scroller
1443         between the layers.
1444
1445 2019-06-12  Truitt Savell  <tsavell@apple.com>
1446
1447         Unreviewed, rolling out r246350.
1448
1449         r246350 Introduced a failing and timing out test svg/clip-path
1450         /clip-hidpi.svg
1451
1452         Reverted changeset:
1453
1454         "[cairo][SVG] If clipPath has multiple elements, clip-path doesn't work with transform"
1455         https://bugs.webkit.org/show_bug.cgi?id=198746
1456         https://trac.webkit.org/changeset/246350
1457
1458 2019-06-12  Carlos Garcia Campos  <cgarcia@igalia.com>
1459
1460         [cairo][SVG] If clipPath has multiple elements, clip-path doesn't work with transform
1461         https://bugs.webkit.org/show_bug.cgi?id=198746
1462         <rdar://problem/51665805>
1463
1464         Reviewed by Don Olmstead.
1465
1466         We need to save the current transformation matrix at the moment the image mask is set and set it again on
1467         restore right before applying the mask. This patch also creates a pattern for the image mask surface and set its
1468         transformation matrix according to the mask position, so that we don't need to save the mask rectangle too.
1469
1470         Tests: svg/clip-path/clip-hidpi-expected.svg
1471                svg/clip-path/clip-hidpi.svg
1472                svg/clip-path/clip-opacity-translate-expected.svg
1473                svg/clip-path/clip-opacity-translate.svg
1474
1475         * platform/graphics/cairo/PlatformContextCairo.cpp:
1476         (WebCore::PlatformContextCairo::restore):
1477         (WebCore::PlatformContextCairo::pushImageMask):
1478
1479 2019-06-11  Wenson Hsieh  <wenson_hsieh@apple.com>
1480
1481         [iOS] Idempotent text autosizing needs to react properly to viewport changes
1482         https://bugs.webkit.org/show_bug.cgi?id=198736
1483         <rdar://problem/50591911>
1484
1485         Reviewed by Zalan Bujtas.
1486
1487         Minor refactoring and some adjustments around StyleResolver::adjustRenderStyleForTextAutosizing. See below for
1488         more details, as well as the WebKit ChangeLog.
1489
1490         Test: fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-after-changing-initial-scale.html
1491
1492         * css/StyleResolver.cpp:
1493         (WebCore::StyleResolver::adjustRenderStyleForTextAutosizing):
1494
1495         Rewrite this using early return statements, to make it easier to debug why elements fall out of text autosizing.
1496         Additionally, this function currently bails if the initial scale is exactly 1, whereas we can really avoid text
1497         autosizing in the case where the initial scale is at least 1; handle this by making idempotentTextSize return
1498         immediately with the specified size, in the case where the scale is at least 1.
1499
1500         Lastly, remove the null check for element by making this method take an Element&, and only call this from
1501         adjustRenderStyle if the element is nonnull (which matches adjustRenderStyleForSiteSpecificQuirks).
1502
1503         (WebCore::StyleResolver::adjustRenderStyle):
1504         * css/StyleResolver.h:
1505         * rendering/style/TextSizeAdjustment.cpp:
1506         (WebCore::AutosizeStatus::idempotentTextSize):
1507
1508 2019-06-11  Timothy Hatcher  <timothy@apple.com>
1509
1510         Flash when tapping compose button after switching to/from dark mode without restarting Mail.
1511         https://bugs.webkit.org/show_bug.cgi?id=198769
1512         rdar://problem/51370037
1513
1514         Reviewed by Tim Horton.
1515
1516         * WebCore.xcodeproj/project.pbxproj: Make LocalCurrentTraitCollection.h a private header.
1517
1518 2019-06-11  Commit Queue  <commit-queue@webkit.org>
1519
1520         Unreviewed, rolling out r246320.
1521         https://bugs.webkit.org/show_bug.cgi?id=198773
1522
1523         New test is failing, and commit is causing another test to
1524         fail. (Requested by ShawnRoberts on #webkit).
1525
1526         Reverted changeset:
1527
1528         "Web Inspector: AXI: Audit: image label test is throwing
1529         spurious errors on elements with existing alt attr, but no
1530         value: <img alt>"
1531         https://bugs.webkit.org/show_bug.cgi?id=194754
1532         https://trac.webkit.org/changeset/246320
1533
1534 2019-06-11  Devin Rousso  <drousso@apple.com>
1535
1536         Sort the computed styles list
1537         https://bugs.webkit.org/show_bug.cgi?id=198743
1538
1539         Reviewed by Simon Fraser
1540
1541         * css/CSSComputedStyleDeclaration.cpp:
1542
1543 2019-06-11  Michael Catanzaro  <mcatanzaro@igalia.com>
1544
1545         Unreviewed build warning fixes
1546
1547         Silence -Wunused-parameter warning
1548
1549         * testing/Internals.cpp:
1550         (WebCore::Internals::storeRegistrationsOnDisk):
1551
1552 2019-06-10  Simon Fraser  <simon.fraser@apple.com>
1553
1554         Add logging for UI-side compositing hit-testing
1555         https://bugs.webkit.org/show_bug.cgi?id=198739
1556
1557         Reviewed by Antti Koivisto.
1558
1559         Export the TextStream output operator.
1560
1561         * platform/TouchAction.h:
1562
1563 2019-06-11  Greg Doolittle  <gr3g@apple.com>
1564
1565         Web Inspector: AXI: Audit: image label test is throwing spurious errors on elements with existing alt attr, but no value: <img alt>
1566         https://bugs.webkit.org/show_bug.cgi?id=194754
1567         <rdar://problem/48144534>
1568
1569         Reviewed by Chris Fleizach.
1570
1571         Tests: accessibility/img-alt-attribute-empty-string.html
1572                accessibility/img-alt-attribute-no-value.html
1573
1574         * accessibility/AccessibilityObject.cpp:
1575         (WebCore::AccessibilityObject::computedRoleString const):
1576
1577 2019-06-11  Sihui Liu  <sihui_liu@apple.com>
1578
1579         Add a quirk for washingtonpost.com and nytimes.com
1580         https://bugs.webkit.org/show_bug.cgi?id=198678
1581
1582         Reviewed by Geoffrey Garen.
1583
1584         Covered by manual test.
1585
1586         * page/Quirks.cpp:
1587         (WebCore::Quirks::hasWebSQLSupportQuirk const):
1588
1589 2019-06-11  Devin Rousso  <drousso@apple.com>
1590
1591         Include `touch-action` in the computed styles list
1592         https://bugs.webkit.org/show_bug.cgi?id=198742
1593
1594         Reviewed by Antoine Quint.
1595
1596         * css/CSSComputedStyleDeclaration.cpp:
1597
1598 2019-06-11  Michael Catanzaro  <mcatanzaro@igalia.com>
1599
1600         tu-berlin university email web interface (Outlook Web App) goes directly to the light version instead of the normal web app
1601         https://bugs.webkit.org/show_bug.cgi?id=198749
1602
1603         Reviewed by Carlos Garcia Campos.
1604
1605         Add user agent quirk for exchange.tu-berlin.de, which has lost the right to receive an
1606         accurate user agent from WebKit.
1607
1608         * platform/UserAgentQuirks.cpp:
1609         (WebCore::urlRequiresMacintoshPlatform):
1610
1611 2019-06-11  Youenn Fablet  <youenn@apple.com>
1612
1613         MediaStreamAudioSourceNode::setFormat should check for m_sourceSampleRate equality
1614         https://bugs.webkit.org/show_bug.cgi?id=198740
1615         <rdar://problem/47088939>
1616
1617         Reviewed by Eric Carlson.
1618
1619         Covered by tests that are now passing.
1620
1621         * Modules/webaudio/MediaStreamAudioSourceNode.cpp:
1622         (WebCore::MediaStreamAudioSourceNode::setFormat):
1623
1624 2019-06-11  Ludovico de Nittis  <ludovico.denittis@collabora.com>
1625
1626         [GTK] Replace gdk_screen_get_monitor_geometry and gdk_screen_get_monitor_workarea
1627         https://bugs.webkit.org/show_bug.cgi?id=198750
1628
1629         Reviewed by Carlos Garcia Campos.
1630
1631         Since GTK 3.22 gdk_screen_get_monitor_geometry and
1632         gdk_screen_get_monitor_workarea has been deprecated. 
1633
1634         No behavior change.
1635
1636         * platform/gtk/PlatformScreenGtk.cpp:
1637         (WebCore::screenRect):
1638         (WebCore::screenAvailableRect):
1639
1640 2019-06-11  Fujii Hironori  <Hironori.Fujii@sony.com>
1641
1642         [cairo][SVG] Putting multiple path elements in clippath causes rendering artifacts
1643         https://bugs.webkit.org/show_bug.cgi?id=198701
1644
1645         PlatformContextCairo::pushImageMask blits wrong position of the
1646         surface to the background of masking objects. And, I don't know
1647         the reason why this blitting is needed. Removed the blitting.
1648
1649         Reviewed by Carlos Garcia Campos.
1650
1651         Tests: svg/clip-path/clip-opacity.html
1652                svg/clip-path/svg-in-html.html
1653
1654         * platform/graphics/cairo/PlatformContextCairo.cpp:
1655         (WebCore::PlatformContextCairo::pushImageMask): Don't blit the
1656         surface to the background.
1657
1658 2019-06-10  Fujii Hironori  <Hironori.Fujii@sony.com>
1659
1660         [WinCairo][MediaFoundation] Remove the unused video window
1661         https://bugs.webkit.org/show_bug.cgi?id=198523
1662
1663         Reviewed by Don Olmstead.
1664
1665         Remove the video window which had been unused since Bug 150941.
1666
1667         No behavior change.
1668
1669         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
1670         (WebCore::MediaPlayerPrivateMediaFoundation::MediaPlayerPrivateMediaFoundation):
1671         (WebCore::MediaPlayerPrivateMediaFoundation::~MediaPlayerPrivateMediaFoundation):
1672         (WebCore::MediaPlayerPrivateMediaFoundation::setSize):
1673         (WebCore::MediaPlayerPrivateMediaFoundation::paint):
1674         (WebCore::MediaPlayerPrivateMediaFoundation::hostWindow):
1675         (WebCore::MediaPlayerPrivateMediaFoundation::createOutputNode):
1676         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::setVideoWindow):
1677         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::setDestinationRect):
1678         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::createVideoSamples):
1679         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::presentSample):
1680         (WebCore::MediaPlayerPrivateMediaFoundation::VideoViewWndProc): Deleted.
1681         (WebCore::MediaPlayerPrivateMediaFoundation::registerVideoWindowClass): Deleted.
1682         (WebCore::MediaPlayerPrivateMediaFoundation::createVideoWindow): Deleted.
1683         (WebCore::MediaPlayerPrivateMediaFoundation::destroyVideoWindow): Deleted.
1684         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::presentSwapChain): Deleted.
1685         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::updateDestRect): Deleted.
1686         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
1687
1688 2019-06-10  Simon Fraser  <simon.fraser@apple.com>
1689
1690         Add visualization of touch action regions
1691         https://bugs.webkit.org/show_bug.cgi?id=198718
1692
1693         Reviewed by Antoine Quint.
1694
1695         Add a way to show which elements of the page have touch-action set on them by
1696         painting an overlay with small text that shows the type of action(s).
1697
1698         The event regions are painted into GraphicsLayers at paint time in
1699         RenderLayerBacking by making a pattern image and filling the region rects
1700         with the pattern.
1701
1702         * page/DebugPageOverlays.cpp:
1703         (WebCore::touchEventRegionColors):
1704         * rendering/EventRegion.cpp:
1705         (WebCore::EventRegion::regionForTouchAction const):
1706         * rendering/EventRegion.h:
1707         (WebCore::EventRegion::region const):
1708         * rendering/RenderLayerBacking.cpp:
1709         (WebCore::RenderLayerBacking::updateEventRegion):
1710         (WebCore::patternForTouchAction):
1711         (WebCore::RenderLayerBacking::paintContents):
1712
1713 2019-06-10  Basuke Suzuki  <Basuke.Suzuki@sony.com>
1714
1715         Web Inspector: DNS names in SymmaryInfo was wrong.
1716         https://bugs.webkit.org/show_bug.cgi?id=198732
1717
1718         Reviewed by Devin Rousso.
1719
1720         * inspector/agents/InspectorNetworkAgent.cpp:
1721         (WebCore::InspectorNetworkAgent::buildObjectForResourceResponse):
1722
1723 2019-06-10  Michael Catanzaro  <mcatanzaro@igalia.com>
1724
1725         [GTK] 2.25.1 does not build on 32-bit ARM due to bit-packing assertion, requires -DENABLE_DARK_MODE_CSS=OFF
1726         https://bugs.webkit.org/show_bug.cgi?id=198274
1727
1728         Reviewed by Timothy Hatcher.
1729
1730         Rather than reorder everything in StyleRareInheritedData, let's slightly increase the size
1731         of GreaterThanOrSameSizeAsStyleRareInheritedData to allow the static assert to pass.
1732
1733         At the same time, remove an obsolote iOS-specific member that is probably no longer needed.
1734
1735         * rendering/style/StyleRareInheritedData.cpp:
1736
1737 2019-06-10  Sam Weinig  <weinig@apple.com>
1738
1739         Remove Dashboard support
1740         https://bugs.webkit.org/show_bug.cgi?id=198615
1741
1742         Reviewed by Ryosuke Niwa.
1743
1744         * Configurations/FeatureDefines.xcconfig:
1745         * WebCore.xcodeproj/project.pbxproj:
1746         * css/CSSCalculationValue.cpp:
1747         (WebCore::hasDoubleValue):
1748         * css/CSSComputedStyleDeclaration.cpp:
1749         (WebCore::ComputedStyleExtractor::valueForPropertyInStyle):
1750         * css/CSSPrimitiveValue.cpp:
1751         (WebCore::isValidCSSUnitTypeForDoubleConversion):
1752         (WebCore::isStringType):
1753         (WebCore::CSSPrimitiveValue::cleanup):
1754         (WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText const):
1755         (WebCore::CSSPrimitiveValue::equals const):
1756         * css/CSSPrimitiveValue.h:
1757         * css/CSSProperties.json:
1758         * css/CSSValueKeywords.in:
1759         * css/DashboardRegion.h: Removed.
1760         * css/StyleBuilderCustom.h:
1761         (WebCore::convertToIntLength): Deleted.
1762         (WebCore::StyleBuilderCustom::applyValueWebkitDashboardRegion): Deleted.
1763         * css/StyleResolver.cpp:
1764         * css/parser/CSSPropertyParser.cpp:
1765         (WebCore::CSSPropertyParser::parseSingleValue):
1766         (WebCore::consumeWebkitDashboardRegion): Deleted.
1767         * dom/DataTransfer.cpp:
1768         (WebCore::DataTransfer::createForUpdatingDropTarget):
1769         * dom/Document.cpp:
1770         (WebCore::Document::invalidateRenderingDependentRegions):
1771         (WebCore::Document::annotatedRegions const): Deleted.
1772         (WebCore::Document::setAnnotatedRegions): Deleted.
1773         (WebCore::Document::updateAnnotatedRegions): Deleted.
1774         (WebCore::Document::invalidateScrollbarDependentRegions): Deleted.
1775         (WebCore::Document::updateZOrderDependentRegions): Deleted.
1776         * dom/Document.h:
1777         (WebCore::Document::setHasAnnotatedRegions): Deleted.
1778         (WebCore::Document::setAnnotatedRegionsDirty): Deleted.
1779         (WebCore::Document::annotatedRegionsDirty const): Deleted.
1780         (WebCore::Document::hasAnnotatedRegions const): Deleted.
1781         * html/HTMLCanvasElement.cpp:
1782         (WebCore::HTMLCanvasElement::createContext2d):
1783         * html/HTMLEmbedElement.cpp:
1784         (WebCore::HTMLEmbedElement::rendererIsNeeded):
1785         * html/HTMLImageLoader.cpp:
1786         (WebCore::HTMLImageLoader::sourceURI const):
1787         * html/canvas/CanvasGradient.cpp:
1788         (WebCore::CanvasGradient::addColorStop):
1789         * html/canvas/CanvasGradient.h:
1790         (WebCore::CanvasGradient::setDashboardCompatibilityMode): Deleted.
1791         (): Deleted.
1792         * html/canvas/CanvasRenderingContext2D.cpp:
1793         (WebCore::CanvasRenderingContext2D::create):
1794         (WebCore::CanvasRenderingContext2D::CanvasRenderingContext2D):
1795         * html/canvas/CanvasRenderingContext2D.h:
1796         * html/canvas/CanvasRenderingContext2DBase.cpp:
1797         (WebCore::CanvasRenderingContext2DBase::CanvasRenderingContext2DBase):
1798         (WebCore::CanvasRenderingContext2DBase::fill):
1799         (WebCore::CanvasRenderingContext2DBase::stroke):
1800         (WebCore::CanvasRenderingContext2DBase::clip):
1801         (WebCore::CanvasRenderingContext2DBase::createLinearGradient):
1802         (WebCore::CanvasRenderingContext2DBase::createRadialGradient):
1803         (WebCore::CanvasRenderingContext2DBase::prepareGradientForDashboard const): Deleted.
1804         (WebCore::CanvasRenderingContext2DBase::clearPathForDashboardBackwardCompatibilityMode): Deleted.
1805         * html/canvas/CanvasRenderingContext2DBase.h:
1806         * html/canvas/OffscreenCanvasRenderingContext2D.cpp:
1807         (WebCore::OffscreenCanvasRenderingContext2D::OffscreenCanvasRenderingContext2D):
1808         * html/canvas/PaintRenderingContext2D.cpp:
1809         (WebCore::PaintRenderingContext2D::PaintRenderingContext2D):
1810         * page/Chrome.cpp:
1811         (WebCore::ChromeClient::annotatedRegionsChanged): Deleted.
1812         * page/ChromeClient.h:
1813         * page/FrameView.cpp:
1814         (WebCore::FrameView::didLayout):
1815         (WebCore::FrameView::didPaintContents):
1816         * page/Settings.yaml:
1817         * page/mac/EventHandlerMac.mm:
1818         (WebCore::EventHandler::needsKeyboardEventDisambiguationQuirks const):
1819         * rendering/RenderInline.cpp:
1820         (WebCore::RenderInline::addAnnotatedRegions): Deleted.
1821         * rendering/RenderInline.h:
1822         * rendering/RenderLayer.cpp:
1823         (WebCore::RenderLayer::scrollTo):
1824         (WebCore::RenderLayer::setHasHorizontalScrollbar):
1825         (WebCore::RenderLayer::setHasVerticalScrollbar):
1826         (WebCore::RenderLayer::updateScrollbarsAfterLayout):
1827         * rendering/RenderListBox.cpp:
1828         (WebCore::RenderListBox::setHasVerticalScrollbar):
1829         * rendering/RenderObject.cpp:
1830         (WebCore::RenderObject::addAnnotatedRegions): Deleted.
1831         (WebCore::RenderObject::collectAnnotatedRegions): Deleted.
1832         * rendering/RenderObject.h:
1833         (WebCore::AnnotatedRegionValue::operator== const): Deleted.
1834         (WebCore::AnnotatedRegionValue::operator!= const): Deleted.
1835         * rendering/style/RenderStyle.cpp:
1836         (WebCore::rareNonInheritedDataChangeRequiresLayout):
1837         (WebCore::RenderStyle::initialDashboardRegions): Deleted.
1838         (WebCore::RenderStyle::noneDashboardRegions): Deleted.
1839         (WebCore::RenderStyle::setDashboardRegion): Deleted.
1840         * rendering/style/RenderStyle.h:
1841         (WebCore::RenderStyle::dashboardRegions const): Deleted.
1842         (WebCore::RenderStyle::setDashboardRegions): Deleted.
1843         * rendering/style/StyleDashboardRegion.h: Removed.
1844         * rendering/style/StyleRareNonInheritedData.cpp:
1845         (WebCore::StyleRareNonInheritedData::operator== const):
1846         * rendering/style/StyleRareNonInheritedData.h:
1847         * xml/XMLHttpRequest.cpp:
1848         (WebCore::XMLHttpRequest::send):
1849         (WebCore::XMLHttpRequest::setRequestHeader):
1850         (WebCore::XMLHttpRequest::usesDashboardBackwardCompatibilityMode const): Deleted.
1851         * xml/XMLHttpRequest.h:
1852
1853 2019-06-10  Antti Koivisto  <antti@apple.com>
1854
1855         Event region should be set on scrolledContentsLayer if it exists
1856         https://bugs.webkit.org/show_bug.cgi?id=198717
1857         <rdar://problem/51572169>
1858
1859         Reviewed by Simon Fraser.
1860
1861         Test: pointerevents/ios/touch-action-region-overflow.html
1862
1863         * rendering/RenderLayerBacking.cpp:
1864         (WebCore::RenderLayerBacking::updateConfiguration):
1865
1866         Move to updateBackingAndHierarchy.
1867
1868         (WebCore::RenderLayerBacking::updateEventRegion):
1869
1870         - Set event region on scrolledContentsLayer if it exists
1871         - Translate away the scroll offset
1872         - Get the offset from renderer from the GraphicsLayer so scrolling and non-scrolling case can be handled uniformly.
1873
1874         * rendering/RenderLayerBacking.h:
1875         * rendering/RenderLayerCompositor.cpp:
1876         (WebCore::RenderLayerCompositor::updateBackingAndHierarchy):
1877
1878         Invoke updateEventRegion after geometry update so offsets are already available on GraphicsLayer.
1879
1880 2019-06-10  Daniel Bates  <dabates@apple.com>
1881
1882         [CSP] Blob URLs should inherit their CSP policy
1883         https://bugs.webkit.org/show_bug.cgi?id=198579
1884         <rdar://problem/51366878>
1885
1886         Reviewed by Brent Fulgham.
1887
1888         As per <https://w3c.github.io/webappsec-csp/#security-inherit-csp> (Editor's Draft, 28 February 2019) blob
1889         URLs should inherit their CSP policy from their parent (if they have one).
1890
1891         Test: http/tests/security/contentSecurityPolicy/navigate-self-to-blob.html
1892               http/tests/security/contentSecurityPolicy/navigate-self-to-data-url.html
1893
1894         * dom/Document.cpp:
1895         (WebCore::Document::shouldInheritContentSecurityPolicyFromOwner const): Return true if the document's URL
1896         is a Blob URL.
1897         (WebCore::Document::initContentSecurityPolicy): Take a pointer to a ContentSecurityPolicy object that
1898         represents the previous document's CSP. We only make us of this if the current URL is a Blob URL or a data
1899         URL. Otherwise, do what we do now and take the policy from the owner frame.
1900         * dom/Document.h:
1901         * loader/DocumentWriter.cpp:
1902         (WebCore::DocumentWriter::begin): Extend the lifetime of the previous document temporarily so that we can
1903         pass its CSP to FrameLoader::didBeginDocument(). We need to do this extension because this function calls
1904         FrameLoader::clear(), which can destroy the previous document and its ContentSecurityPolicy object. This
1905         extension is also no different than if this function was called with a non-null ownerDocument except that
1906         in that case it is the caller that extends the previous document's lifetime. Although it is tempting to
1907         make use of ownerDocument to fix this bug by having the caller of begin() pass the previous document as
1908         the ownerDocument when the new document's url (the one we are begin()ing) is a Blob URL. The ownerDocument
1909         concept would privilege the Blob URL more than necessary; we only need to inherit the CSP policy from the
1910         previous document for a Blob URL, not inherit the cookie URL or strict mixed content checking bit, etc. 
1911         We could make ContentSecurityPolicy ref-counted or even steal the ContentSecurityPolicy object from the
1912         previous document. The latter is not of the question as a future enhancement, but the former seemed excessive
1913         as a way to avoid extending the lifetime of the previous document because this would be the *only* call site
1914         that actaully takes out a second ref of a ContentSecurityPolicy object. In general, shared ownership of
1915         a ContentSecurityPolicy object does not make sense.
1916         * loader/FrameLoader.cpp:
1917         (WebCore::FrameLoader::didBeginDocument): Pass the specified content security policy through to
1918         Document::initContentSecurityPolicy().
1919         * loader/FrameLoader.h:
1920
1921 2019-06-10  Saam Barati  <sbarati@apple.com>
1922
1923         [WHLSL] Auto initialize local variables
1924         https://bugs.webkit.org/show_bug.cgi?id=198426
1925
1926         Reviewed by Myles Maxfield.
1927
1928         This patch implements zero-filling for local variables in two parts:
1929         1. We add a new pass, autoInitializeVariables, which makes any variable declaration
1930         without an initializer call the default constructor for the variable's type.
1931         Since we auto generate the default constructor, it's a native function whose
1932         implementation we control.
1933         
1934         2. Each native constructor is implemented as a memset(&value, sizeof(value), 0).
1935         This memset is an inlined loop in each constructor. The reason this turns
1936         everything into zero is that for every primitive type, the "zero" value is
1937         represented as all zeroes in memory: float, int, pointers, etc.
1938         
1939         Since our ability to test some of this is limited, I opened a follow-up bug to
1940         test this more:
1941         https://bugs.webkit.org/show_bug.cgi?id=198413
1942
1943         Tests: webgpu/whlsl-zero-initialize-values-2.html
1944                webgpu/whlsl-zero-initialize-values.html
1945
1946         * Modules/webgpu/WHLSL/AST/WHLSLVariableDeclaration.h:
1947         (WebCore::WHLSL::AST::VariableDeclaration::setInitializer):
1948         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
1949         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::visit):
1950         * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp:
1951         (WebCore::WHLSL::Metal::writeNativeFunction):
1952         * Modules/webgpu/WHLSL/WHLSLASTDumper.h:
1953         * Modules/webgpu/WHLSL/WHLSLAutoInitializeVariables.cpp: Added.
1954         (WebCore::WHLSL::AutoInitialize::AutoInitialize):
1955         (WebCore::WHLSL::AutoInitialize::visit):
1956         (WebCore::WHLSL::autoInitializeVariables):
1957         * Modules/webgpu/WHLSL/WHLSLAutoInitializeVariables.h: Added.
1958         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
1959         (WebCore::WHLSL::checkOperatorOverload):
1960         (WebCore::WHLSL::Checker::visit):
1961         * Modules/webgpu/WHLSL/WHLSLInferTypes.cpp:
1962         (WebCore::WHLSL::inferTypesForCallImpl):
1963         (WebCore::WHLSL::inferTypesForCall):
1964         * Modules/webgpu/WHLSL/WHLSLInferTypes.h:
1965         * Modules/webgpu/WHLSL/WHLSLPrepare.cpp:
1966         (WebCore::WHLSL::prepareShared):
1967         * Modules/webgpu/WHLSL/WHLSLResolveOverloadImpl.cpp:
1968         (WebCore::WHLSL::resolveFunctionOverloadImpl):
1969         (WebCore::WHLSL::resolveFunctionOverload):
1970         * Modules/webgpu/WHLSL/WHLSLResolveOverloadImpl.h:
1971         * Sources.txt:
1972         * WebCore.xcodeproj/project.pbxproj:
1973
1974 2019-06-10  Timothy Hatcher  <timothy@apple.com>
1975
1976         Integrate dark mode support for iOS.
1977         https://bugs.webkit.org/show_bug.cgi?id=198687
1978         rdar://problem/51545643
1979
1980         Reviewed by Tim Horton.
1981
1982         Tests: css-dark-mode
1983
1984         * Configurations/FeatureDefines.xcconfig:
1985         * SourcesCocoa.txt:
1986         * WebCore.xcodeproj/project.pbxproj:
1987         * platform/graphics/cocoa/FontCascadeCocoa.mm:
1988         (WebCore::showLetterpressedGlyphsWithAdvances):
1989         * platform/ios/LocalCurrentTraitCollection.h: Added.
1990         * platform/ios/LocalCurrentTraitCollection.mm: Added.
1991         * platform/ios/PasteboardIOS.mm:
1992         * rendering/RenderThemeIOS.mm:
1993         (WebCore::RenderThemeIOS::systemColor const):
1994         * rendering/RenderThemeMac.mm:
1995         (WebCore::RenderThemeMac::systemColor const):
1996
1997 2019-06-10  Ali Juma  <ajuma@chromium.org>
1998
1999         REGRESSION (r245396): Page load time performance regression
2000         https://bugs.webkit.org/show_bug.cgi?id=198382
2001
2002         Reviewed by Per Arne Vollan.
2003
2004         Use a delay of 2000ms instead of 500ms when scheduling rendering updates
2005         for IntersectionObserver targets added during page load. This is a
2006         speculative fix for a page load time regression caused by r245396 and
2007         still not fixed after r245958.
2008
2009         * dom/Document.cpp:
2010         (WebCore::Document::scheduleTimedRenderingUpdate):
2011
2012 2019-06-10  Sihui Liu  <sihui_liu@apple.com>
2013
2014         [WKHTTPCookieStore getAllCookies:] may return duplicate cookies
2015         https://bugs.webkit.org/show_bug.cgi?id=198635
2016         <rdar://problem/46010232>
2017
2018         Reviewed by Ryosuke Niwa.
2019
2020         Test: WebKit.WKHTTPCookieStoreWithoutProcessPoolDuplicates
2021
2022         * platform/Cookie.h:
2023         (WebCore::Cookie::isKeyEqual const):
2024         (WTF::HashTraits<WebCore::Cookie>::isEmptyValue):
2025
2026 2019-06-09  Rob Buis  <rbuis@igalia.com>
2027
2028         Add wildcard to Access-Control-Allow-Methods and Access-Control-Allow-Headers
2029         https://bugs.webkit.org/show_bug.cgi?id=165508
2030
2031         Reviewed by Frédéric Wang.
2032
2033         According to the spec [1] step 6.5, a wildcard for method
2034         and request's credentials mode should be taken into account, so
2035         add this to the check. Same for Access-Control-Allow-Headers (step 6.7).
2036
2037         [1] https://fetch.spec.whatwg.org/#cors-preflight-fetch
2038
2039         Tests: web-platform-tests/fetch/api/cors/cors-preflight-star.any.html
2040                web-platform-tests/fetch/api/cors/cors-preflight-star.any.worker.html
2041
2042         * loader/CrossOriginAccessControl.cpp:
2043         (WebCore::validatePreflightResponse):
2044         * loader/CrossOriginPreflightResultCache.cpp:
2045         (WebCore::CrossOriginPreflightResultCacheItem::allowsCrossOriginMethod const):
2046         (WebCore::CrossOriginPreflightResultCacheItem::allowsCrossOriginHeaders const):
2047         (WebCore::CrossOriginPreflightResultCacheItem::allowsRequest const):
2048         * loader/CrossOriginPreflightResultCache.h:
2049
2050 2019-06-08  Zalan Bujtas  <zalan@apple.com>
2051
2052         [LFC][IFC] Introduce Baseline to LineBox
2053         https://bugs.webkit.org/show_bug.cgi?id=198686
2054         <rdar://problem/51545175>
2055
2056         Reviewed by Antti Koivisto.
2057
2058         Make baselines alignment explicit in Line.
2059         This is in preparation for adding non-baseline vertical alignment support.
2060
2061         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
2062         (WebCore::Layout::InlineFormattingContext::LineLayout::placeInlineItems const):
2063         (WebCore::Layout::InlineFormattingContext::LineLayout::createDisplayRuns const):
2064         * layout/inlineformatting/InlineLine.cpp:
2065         (WebCore::Layout::Line::Line):
2066         (WebCore::Layout::Line::close):
2067         (WebCore::Layout::Line::adjustBaselineAndLineHeight):
2068         (WebCore::Layout::Line::halfLeadingMetrics):
2069         * layout/inlineformatting/InlineLine.h:
2070         (WebCore::Layout::Line::Content::baseline const):
2071         (WebCore::Layout::Line::Content::setBaseline):
2072         (WebCore::Layout::Line::logicalHeight const):
2073         (WebCore::Layout::Line::baselineAlignedContentHeight const):
2074         (WebCore::Layout::Line::baselineOffset const):
2075         * layout/inlineformatting/InlineLineBox.h:
2076         (WebCore::Layout::LineBox::baseline const):
2077         (WebCore::Layout::LineBox::LineBox):
2078
2079 2019-06-07  Said Abou-Hallawa  <sabouhallawa@apple.com>
2080
2081         REGRESSION (r244182) [WK1]: Page updates should always scheduleCompositingLayerFlush() immediately
2082         https://bugs.webkit.org/show_bug.cgi?id=198664
2083
2084         Reviewed by Simon Fraser.
2085
2086         Because WK1 is a single process, scheduleCompositingLayerFlush() has to 
2087         be called immediately when layers' update is needed. Otherwise no content
2088         will be drawn for the current frame. Doing this will get smooth scrolling
2089         back to WK1.
2090
2091         RenderingUpdateScheduler now has three different scheduling methods:
2092
2093         1. scheduleTimedRenderingUpdate(): This is a two-steps scheduling method.
2094            DisplayRefreshMonitor has to fire before scheduleCompositingLayerFlush()
2095            is called. This is used by rAF, WebAnimations and intersection and
2096            resize observers.
2097
2098         2. scheduleImmediateRenderingUpdate(): This is a one-step scheduling method.
2099            layerTreeAsText() calls this method because it has to process the rendering
2100            update within the current frame.
2101
2102         3. scheduleRenderingUpdate(): RenderLayerCompositor::scheduleLayerFlush()
2103            calls this function to decide either immediately flush layers or wait
2104            for the next timed frame. scheduleImmediateRenderingUpdate() will be
2105            called for WK1. scheduleTimedRenderingUpdate() will be called for WK2.
2106
2107         * animation/DocumentTimeline.cpp:
2108         (WebCore::DocumentTimeline::scheduleAnimationResolution):
2109         * dom/Document.cpp:
2110         (WebCore::Document::scheduleTimedRenderingUpdate):
2111         (WebCore::Document::scheduleInitialIntersectionObservationUpdate):
2112         (WebCore::Document::updateResizeObservations):
2113         (WebCore::Document::scheduleRenderingUpdate): Deleted.
2114         * dom/Document.h:
2115         * dom/ScriptedAnimationController.cpp:
2116         (WebCore::ScriptedAnimationController::scheduleAnimation):
2117         * page/ChromeClient.h:
2118         * page/PageOverlayController.cpp:
2119         (WebCore::PageOverlayController::didChangeViewExposedRect):
2120         (WebCore::PageOverlayController::notifyFlushRequired):
2121         * page/RenderingUpdateScheduler.cpp:
2122         (WebCore::RenderingUpdateScheduler::scheduleTimedRenderingUpdate):
2123         (WebCore::RenderingUpdateScheduler::displayRefreshFired):
2124         (WebCore::RenderingUpdateScheduler::scheduleImmediateRenderingUpdate):
2125         (WebCore::RenderingUpdateScheduler::scheduleRenderingUpdate):
2126         (WebCore::RenderingUpdateScheduler::scheduleCompositingLayerFlush): Deleted.
2127         * page/RenderingUpdateScheduler.h:
2128         * page/ResizeObserver.cpp:
2129         (WebCore::ResizeObserver::observe):
2130         * page/mac/ServicesOverlayController.mm:
2131         (WebCore::ServicesOverlayController::Highlight::notifyFlushRequired):
2132         * rendering/RenderLayerCompositor.cpp:
2133         (WebCore::RenderLayerCompositor::layerTreeAsText):
2134
2135 2019-06-07  Megan Gardner  <megan_gardner@apple.com>
2136
2137         Extend quirks to emulate bold/italic/underline in hidden editable areas
2138         https://bugs.webkit.org/show_bug.cgi?id=198681
2139
2140         Reviewed by Wenson Hsieh.
2141
2142         Rename only.
2143
2144         Rename quirks to be more accurate for new extended use.
2145
2146         * page/Quirks.cpp:
2147         (WebCore::shouldEmulateEditingButtonsAndGesturesInHiddenEditableAreasForHost):
2148         (WebCore::Quirks::shouldEmulateEditingButtonsAndGesturesInHiddenEditableAreas const):
2149         (WebCore::shouldEmulateUndoRedoInHiddenEditableAreasForHost): Deleted.
2150         (WebCore::Quirks::shouldEmulateUndoRedoInHiddenEditableAreas const): Deleted.
2151         * page/Quirks.h:
2152
2153 2019-06-07  Truitt Savell  <tsavell@apple.com>
2154
2155         Unreviewed, rolling out r246138.
2156
2157         Broke internal builds
2158
2159         Reverted changeset:
2160
2161         "[WHLSL] Educate the property resolver about IndexExpressions"
2162         https://bugs.webkit.org/show_bug.cgi?id=198399
2163         https://trac.webkit.org/changeset/246138
2164
2165 2019-06-07  Justin Fan  <justin_fan@apple.com>
2166
2167         [WebGPU] Remove GPUBuffer.setSubData and implement GPUDevice.createBufferMapped
2168         https://bugs.webkit.org/show_bug.cgi?id=198591
2169
2170         Reviewed by Myles C. Maxfield.
2171
2172         Remove GPUBuffer.setSubData from the WebGPU API.
2173         Add GPUDevice.createBufferMapped to the WebGPU API. 
2174
2175         Existing tests have been updated.
2176
2177         * Modules/webgpu/WebGPUBuffer.cpp:
2178         (WebCore::WebGPUBuffer::setSubData): Deleted.
2179         * Modules/webgpu/WebGPUBuffer.h:
2180         * Modules/webgpu/WebGPUBuffer.idl:
2181         * Modules/webgpu/WebGPUDevice.cpp:
2182         (WebCore::WebGPUDevice::createBufferMapped const):
2183         * Modules/webgpu/WebGPUDevice.h:
2184         * Modules/webgpu/WebGPUDevice.idl:
2185         * platform/graphics/gpu/GPUBuffer.h:
2186         * platform/graphics/gpu/GPUCommandBuffer.h:
2187         * platform/graphics/gpu/GPUDevice.cpp:
2188         (WebCore::GPUDevice::tryCreateBuffer):
2189         * platform/graphics/gpu/GPUDevice.h:
2190         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
2191         (WebCore::GPUBuffer::tryCreate):
2192         (WebCore::GPUBuffer::GPUBuffer):
2193         (WebCore::GPUBuffer::state const):
2194         (WebCore::GPUBuffer::mapOnCreation):
2195         (WebCore::GPUBuffer::commandBufferCompleted):
2196         (WebCore::GPUBuffer::copyStagingBufferToGPU):
2197                 Required to unmap GPUBuffers created with GPU-private storage.
2198         (WebCore::GPUBuffer::unmap):
2199         (WebCore::GPUBuffer::setSubData): Deleted.
2200         (WebCore::GPUBuffer::reuseSubDataBuffer): Deleted.
2201
2202 2019-06-07  Michael Catanzaro  <mcatanzaro@igalia.com>
2203
2204         Unreviewed, fix non-iOS build after r246205
2205         https://bugs.webkit.org/show_bug.cgi?id=198657
2206         <rdar://problem/51345064>
2207
2208         * page/Quirks.cpp:
2209         * page/Quirks.h:
2210
2211 2019-06-07  Youenn Fablet  <youenn@apple.com>
2212
2213         mediaDevices.enumerateDevices() doesn't list the system default audio devices with deviceId as "default"
2214         https://bugs.webkit.org/show_bug.cgi?id=198577
2215         <rdar://problem/51454067>
2216
2217         Reviewed by Eric Carlson.
2218
2219         Make the system default microphone/camera be the first in the list.
2220         This ensures that getUserMedia without constraints will pick these devices.
2221         This also ensures enumerateDevices will show these default devices as first in the list.
2222         Make sure that a default device change will refresh the list.
2223
2224         For CoreAudioCaptureSource, we always add the default system input device in the list of capture devices.
2225
2226         Covered by manual testing.
2227
2228         * platform/mediastream/mac/AVCaptureDeviceManager.h:
2229         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
2230         (WebCore::toCaptureDevice):
2231         (WebCore::AVCaptureDeviceManager::isMatchingExistingCaptureDevice):
2232         (WebCore::AVCaptureDeviceManager::refreshCaptureDevices):
2233         * platform/mediastream/mac/CoreAudioCaptureDeviceManager.cpp:
2234         (WebCore::getDefaultDeviceID):
2235         (WebCore::CoreAudioCaptureDeviceManager::refreshAudioCaptureDevices):
2236
2237 2019-06-07  Youenn Fablet  <youenn@apple.com>
2238
2239         A MediaStreamTrack cannot modify whether being a capture track or not
2240         https://bugs.webkit.org/show_bug.cgi?id=198669
2241
2242         Reviewed by Eric Carlson.
2243
2244         Add a boolean in MediaStreamTrack to store whether a track is a capture one or not.
2245         This removes the need to always go through the private and its source.
2246         As a track might change of source (for non capture track cases), this
2247         also removes the possibility for a track to be capture and then no
2248         longer capture.
2249         No change of behavior.
2250         See also rdar://problem/49444622.
2251
2252         * Modules/mediastream/MediaStreamTrack.cpp:
2253         (WebCore::MediaStreamTrack::MediaStreamTrack):
2254         * Modules/mediastream/MediaStreamTrack.h:
2255         (WebCore::MediaStreamTrack::isCaptureTrack const):
2256
2257 2019-06-07  Youenn Fablet  <youenn@apple.com>
2258
2259         Add a RELEASE_ASSERT that removeAudioProducer should always be done in the main thread
2260         https://bugs.webkit.org/show_bug.cgi?id=198668
2261
2262         Reviewed by Eric Carlson.
2263
2264         See rdar://problem/49444622 for background information.
2265         No change of behavior.
2266
2267         * dom/Document.cpp:
2268         (WebCore::Document::removeAudioProducer):
2269
2270 2019-06-07  Zalan Bujtas  <zalan@apple.com>
2271
2272         Images are not resizing correctly when dragged to a message in 1/3 view
2273         https://bugs.webkit.org/show_bug.cgi?id=198623
2274         <rdar://problem/51185518>
2275
2276         Reviewed by Wenson Hsieh.
2277
2278         Mail's max-width: 100%; default style is in conflict with the preferred presentation size. This patch preserves the existing behaviour for Mail by
2279         not setting the height (and rely on the width + aspect ratio). 
2280
2281         * editing/WebContentReader.h:
2282         * editing/cocoa/WebContentReaderCocoa.mm:
2283         (WebCore::createFragmentForImageAttachment):
2284         (WebCore::WebContentReader::readImage):
2285         (WebCore::attachmentForFilePath):
2286         (WebCore::attachmentForData):
2287         (WebCore::WebContentReader::readFilePath):
2288         (WebCore::WebContentReader::readDataBuffer):
2289         * editing/gtk/EditorGtk.cpp:
2290         (WebCore::createFragmentFromPasteboardData):
2291         * editing/markup.cpp:
2292         (WebCore::createFragmentForImageAndURL):
2293         * editing/markup.h:
2294         * platform/Pasteboard.h:
2295         (WebCore::PasteboardWebContentReader::readFilePath):
2296         (WebCore::PasteboardWebContentReader::readImage):
2297         (WebCore::PasteboardWebContentReader::readDataBuffer):
2298         * platform/PasteboardItemInfo.h:
2299         (WebCore::PasteboardItemInfo::encode const):
2300         (WebCore::PasteboardItemInfo::decode):
2301         * platform/ios/PasteboardIOS.mm:
2302         (WebCore::Pasteboard::readPasteboardWebContentDataForType):
2303         (WebCore::Pasteboard::read):
2304         (WebCore::Pasteboard::readRespectingUTIFidelities):
2305         * platform/ios/PlatformPasteboardIOS.mm:
2306         (WebCore::PlatformPasteboard::informationForItemAtIndex):
2307
2308 2019-06-07  Zalan Bujtas  <zalan@apple.com>
2309
2310         [LFC][IFC] Line should skip all vertical adjustment when running preferred width computation
2311         https://bugs.webkit.org/show_bug.cgi?id=198642
2312         <rdar://problem/51511043>
2313
2314         Reviewed by Antti Koivisto.
2315
2316         While layout triggers both horizontal and vertical aligment, preferred width computation should only do (logical)horizontal.
2317         Make all vertical alignment computation optional in Line.
2318
2319         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
2320         (WebCore::Layout::UncommittedContent::add):
2321         (WebCore::Layout::InlineFormattingContext::LineLayout::placeInlineItems const):
2322         (WebCore::Layout::InlineFormattingContext::LineLayout::computedIntrinsicWidth const):
2323         (WebCore::Layout::InlineFormattingContext::LineLayout::createDisplayRuns const):
2324         (WebCore::Layout::inlineItemHeight): Deleted.
2325         * layout/inlineformatting/InlineLine.cpp:
2326         (WebCore::Layout::Line::Content::Run::Run):
2327         (WebCore::Layout::Line::Line):
2328         (WebCore::Layout::Line::close):
2329         (WebCore::Layout::Line::removeTrailingTrimmableContent):
2330         (WebCore::Layout::Line::moveLogicalLeft):
2331         (WebCore::Layout::Line::trailingTrimmableWidth const):
2332         (WebCore::Layout::Line::appendNonBreakableSpace):
2333         (WebCore::Layout::Line::appendInlineContainerStart):
2334         (WebCore::Layout::Line::appendInlineContainerEnd):
2335         (WebCore::Layout::Line::appendTextContent):
2336         (WebCore::Layout::Line::appendNonReplacedInlineBox):
2337         (WebCore::Layout::Line::appendReplacedInlineBox):
2338         (WebCore::Layout::Line::appendHardLineBreak):
2339         (WebCore::Layout::Line::inlineItemHeight const):
2340         * layout/inlineformatting/InlineLine.h:
2341
2342 2019-06-07  Antoine Quint  <graouts@apple.com>
2343
2344         Limit simulated mouse events on Google Maps to entering Street View
2345         https://bugs.webkit.org/show_bug.cgi?id=198657
2346         <rdar://problem/51345064>
2347
2348         Reviewed by Brent Fulgham.
2349
2350         * page/Quirks.cpp:
2351         (WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):
2352         (WebCore::Quirks::shouldDispatchSimulatedMouseEventsOnTarget const):
2353         * page/Quirks.h:
2354
2355 2019-06-07  Joonghun Park  <jh718.park@samsung.com>
2356
2357         Unreviewed. Use const TabSize& instead of TabSize to avoid unnecessary copy.
2358
2359         Using const reference is a c++ feature to extend the life time of
2360         a temporary object to the life time of the const reference which refers to it.
2361
2362         No behavioral changes.
2363
2364         * rendering/style/RenderStyle.h:
2365         (WebCore::RenderStyle::setTabSize):
2366
2367 2019-06-07  Michael Catanzaro  <mcatanzaro@igalia.com>
2368
2369         [GTK] GLContextEGL.h must be built with @no-unify
2370         https://bugs.webkit.org/show_bug.cgi?id=198659
2371
2372         Unreviewed ARM build fix.
2373
2374         * SourcesGTK.txt:
2375
2376 2019-06-07  Antti Koivisto  <antti@apple.com>
2377
2378         position:fixed inside overflow positioning nodes is jumpy
2379         https://bugs.webkit.org/show_bug.cgi?id=198647
2380         <rdar://problem/51514437>
2381
2382         Reviewed by Frédéric Wang.
2383
2384         Tests: scrollingcoordinator/ios/fixed-overflow-no-stacking-context-1.html
2385                scrollingcoordinator/ios/fixed-overflow-no-stacking-context-2.html
2386                scrollingcoordinator/ios/fixed-overflow-stacking-context-stationary.html
2387
2388         * page/scrolling/ScrollingTreeScrollingNode.h:
2389         * page/scrolling/cocoa/ScrollingTreeFixedNode.mm:
2390         (WebCore::ScrollingTreeFixedNode::applyLayerPositions):
2391
2392         Take deltas from positioning nodes into account.
2393
2394         * page/scrolling/cocoa/ScrollingTreePositionedNode.h:
2395         * page/scrolling/cocoa/ScrollingTreePositionedNode.mm:
2396         (WebCore::ScrollingTreePositionedNode::scrollDeltaSinceLastCommit const):
2397
2398         Rename since 'scrollOffset' has other meaning.
2399
2400         (WebCore::ScrollingTreePositionedNode::applyLayerPositions):
2401         (WebCore::ScrollingTreePositionedNode::scrollOffsetSinceLastCommit const): Deleted.
2402         * page/scrolling/cocoa/ScrollingTreeStickyNode.mm:
2403         (WebCore::ScrollingTreeStickyNode::applyLayerPositions):
2404
2405 2019-06-07  Enrique Ocaña González  <eocanha@igalia.com>
2406
2407         [MSE][GStreamer] Avoid QUOTA_EXCEEDED_ERR when seeking to a buffered range just before the buffered one
2408         https://bugs.webkit.org/show_bug.cgi?id=166620
2409
2410         Reviewed by Xabier Rodriguez-Calvar.
2411
2412         This patch is fixing a seek to unbuffered range just before the buffered one.
2413         For example, supposing a [120, 176) append has filled all the memory and then
2414         a seek to 115.0 is done, a subsequent [115, 120) append would fail without
2415         this fix. EvictCodedFrames() would return without actually evicting anything,
2416         and appendBufferInternal will print "buffer full, failing with
2417         QUOTA_EXCEEDED_ERR error" on GStreamer platforms instead of letting the new
2418         [115, 120) append succeed.
2419
2420         This patch is based on an original patch by iivlev <iivlev@productengine.com>
2421
2422         Test: media/media-source/media-source-append-before-last-range-no-quota-exceeded.html
2423
2424         * Modules/mediasource/SourceBuffer.cpp:
2425         (WebCore::SourceBuffer::evictCodedFrames):
2426         Removed the "only if there are buffered ranges *containing* the currentTime" condition
2427         to enter into the second part of the eviction algorithm, which removes frames
2428         starting from the duration of the media and going backwards down to currentPosition + 30.
2429         The loop break condition has also been changed to deal with notFound currentTimeRange.
2430
2431 2019-06-07  Philippe Normand  <philn@igalia.com>
2432
2433         [GStreamer] AVC1 decoding capabilities probing support
2434         https://bugs.webkit.org/show_bug.cgi?id=198569
2435
2436         Reviewed by Xabier Rodriguez-Calvar.
2437
2438         When capabilities for an avc1 codec are requested, the registry scanner looks
2439         for a compatible decoder for the given H.264 profile and level.
2440
2441         This new approach can be avoided by using the WEBKIT_GST_MAX_AVC1_RESOLUTION
2442         environment variable. If supplied, the decoder capabilities won't be probed and
2443         the codec will be advertised as supported if it complies with the contents of
2444         the environment variable. The resolutions currently handled are specifically:
2445         1080P, 720P and 480P. We don't handle framerate checking yet, so the implied
2446         H.264 levels are assumed to be for 30FPS.
2447
2448         * platform/graphics/gstreamer/GStreamerRegistryScanner.cpp:
2449         (WebCore::GStreamerRegistryScanner::isCodecSupported const):
2450         (WebCore::GStreamerRegistryScanner::areInputCapsAccepted const):
2451         (WebCore::GStreamerRegistryScanner::isAVC1CodecSupported const):
2452         * platform/graphics/gstreamer/GStreamerRegistryScanner.h:
2453
2454 2019-06-07  Joonghun Park  <jh718.park@samsung.com>
2455
2456         Implement tab-size with units
2457         https://bugs.webkit.org/show_bug.cgi?id=179022
2458
2459         Reviewed by Simon Fraser.
2460
2461         This change is ported from Blink.
2462         The committed revision is https://src.chromium.org/viewvc/blink?revision=189430&view=revision.
2463
2464         Additionally, this patch lets css "number" value be allowed as tab-size's property value,
2465         not css "integer" value,
2466         according to https://drafts.csswg.org/css-text-3/#tab-size-property.
2467
2468         Tests: css3/tab-size.html
2469                imported/w3c/web-platform-tests/css/css-values/calc-numbers.html
2470
2471         * Headers.cmake:
2472         * WebCore.xcodeproj/project.pbxproj:
2473         * css/CSSComputedStyleDeclaration.cpp:
2474         (WebCore::ComputedStyleExtractor::valueForPropertyInStyle):
2475         * css/CSSProperties.json:
2476         * css/StyleBuilderConverter.h:
2477         (WebCore::StyleBuilderConverter::convertTabSize):
2478         * css/parser/CSSPropertyParser.cpp:
2479         (WebCore::consumeTabSize):
2480         * layout/inlineformatting/text/TextUtil.cpp:
2481         (WebCore::Layout::TextUtil::width):
2482         * platform/graphics/FontCascade.h:
2483         (WebCore::FontCascade::tabWidth const):
2484         * platform/graphics/TabSize.h: Added.
2485         (WebCore::TabSize::TabSize):
2486         (WebCore::TabSize::isSpaces const):
2487         (WebCore::TabSize::widthInPixels const):
2488         (WebCore::TabSize::operator bool const):
2489         (WebCore::operator==):
2490         (WebCore::operator!=):
2491         * platform/graphics/TextRun.cpp:
2492         * platform/graphics/TextRun.h:
2493         (WebCore::TextRun::tabSize const):
2494         (WebCore::TextRun::setTabSize):
2495         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
2496         (WebCore::SimpleLineLayout::TextFragmentIterator::Style::Style):
2497         * rendering/SimpleLineLayoutTextFragmentIterator.h:
2498         * rendering/style/RenderStyle.h:
2499         (WebCore::RenderStyle::tabSize const):
2500         (WebCore::RenderStyle::setTabSize):
2501         (WebCore::RenderStyle::initialTabSize):
2502         * rendering/style/StyleRareInheritedData.cpp:
2503         * rendering/style/StyleRareInheritedData.h:
2504
2505 2019-06-07  Philippe Normand  <pnormand@igalia.com>
2506
2507         [GStreamer] videorate issues with v4l2src
2508         https://bugs.webkit.org/show_bug.cgi?id=198614
2509
2510         Reviewed by Xabier Rodriguez-Calvar.
2511
2512         Configure videorate to cope with the live stream provided by the
2513         source element. Not doing so might lead to errors in the v4l2
2514         buffer allocator.
2515
2516         * platform/mediastream/gstreamer/GStreamerVideoCapturer.cpp:
2517         (WebCore::GStreamerVideoCapturer::createConverter):
2518
2519 2019-06-06  Andy Estes  <aestes@apple.com>
2520
2521         process-swap-on-navigation error when loading blocked website on iOS 12.2 only.
2522         https://bugs.webkit.org/show_bug.cgi?id=196930
2523         <rdar://problem/47819301>
2524
2525         Reviewed by Chris Dumez.
2526
2527         When the content filter blocks a navigation, it will continue to load the content filter
2528         error page in the provisional web process. When dispatching didFailProvisionalLoad, we need
2529         to specify WillContinueLoading::Yes so that WebKit presents the error page rather than
2530         switching back to the committed web process.
2531
2532         Testing blocked by <https://webkit.org/b/198626>.
2533
2534         * loader/ContentFilter.cpp:
2535         (WebCore::ContentFilter::willHandleProvisionalLoadFailure):
2536         (WebCore::ContentFilter::handleProvisionalLoadFailure):
2537         * loader/ContentFilter.h:
2538         * loader/FrameLoader.cpp:
2539         (WebCore::FrameLoader::dispatchDidFailProvisionalLoad):
2540         (WebCore::FrameLoader::checkLoadCompleteForThisFrame):
2541         * loader/FrameLoader.h:
2542
2543 2019-06-06  Chris Dumez  <cdumez@apple.com>
2544
2545         RELEASE_ASSERT hit in CachedFrame constructor
2546         https://bugs.webkit.org/show_bug.cgi?id=198625
2547         <rdar://problem/49877867>
2548
2549         Reviewed by Geoffrey Garen.
2550
2551         This is a speculative fix, it appears the document is already detached from its
2552         frame by the time we construct a CachedFrame for it when entering PageCache.
2553
2554         No new tests, because we do not know yet how this can be reproduced.
2555
2556         * history/PageCache.cpp:
2557         (WebCore::canCacheFrame):
2558         Make a frame as ineligible for PageCache if:
2559         1. It does not have a document
2560         or
2561         2. Its document is already detached from the frame
2562
2563         (WebCore::PageCache::addIfCacheable):
2564         Destroy the render tree *before* we check if the page can enter page cache, in case
2565         destroying the render tree has any side effects that could make the page ineligible
2566         for Page Cache.
2567
2568 2019-06-06  Devin Rousso  <drousso@apple.com>
2569
2570         Web Inspector: Timelines: only complete Composite records if the m_startedComposite (followup to r246142)
2571         https://bugs.webkit.org/show_bug.cgi?id=198639
2572
2573         Reviewed by Matt Baker.
2574
2575         In r246142, an `ASSERT` was removed because it is possible for Web Inspector to be opened in
2576         between `willComposite` and `didComposite`, meaning that previously the `ASSERT` would fire.
2577
2578         In order to properly handle this, we should replace the `ASSERT` with an `if` so that Web
2579         Inspector doesn't even try to complete a `Composite` record if it was opened in that case.
2580
2581         * inspector/agents/InspectorTimelineAgent.cpp:
2582         (WebCore::InspectorTimelineAgent::didComposite):
2583
2584 2019-06-06  Youenn Fablet  <youenn@apple.com>
2585
2586         Allow WebKitTestRunner to terminate network process after it finishes service worker file operations
2587         https://bugs.webkit.org/show_bug.cgi?id=198584
2588
2589         Reviewed by Geoffrey Garen.
2590
2591         Add a promise-based internal API to store service worker registrations on disk.
2592         Covered by updated test.
2593
2594         * testing/Internals.cpp:
2595         (WebCore::Internals::storeRegistrationsOnDisk):
2596         * testing/Internals.h:
2597         * testing/Internals.idl:
2598         * workers/service/SWClientConnection.h:
2599         (WebCore::SWClientConnection::storeRegistrationsOnDiskForTesting):
2600         * workers/service/server/RegistrationStore.cpp:
2601         (WebCore::RegistrationStore::startSuspension):
2602         (WebCore::RegistrationStore::closeDatabase):
2603         * workers/service/server/RegistrationStore.h:
2604         * workers/service/server/SWServer.cpp:
2605         (WebCore::SWServer::Connection::storeRegistrationsOnDisk):
2606         * workers/service/server/SWServer.h:
2607
2608 2019-06-06  Brent Fulgham  <bfulgham@apple.com>
2609
2610         Avoid generating new XSLT-based document when already changing the document.
2611         https://bugs.webkit.org/show_bug.cgi?id=198525
2612         <rdar://problem/51393787>
2613
2614         Reviewed by Ryosuke Niwa.
2615
2616         We should not allow a pending XSLT transform to change the current document when
2617         that current document is int he process of being replaced.
2618
2619         * dom/Document.cpp:
2620         (WebCore::Document::applyPendingXSLTransformsTimerFired):
2621
2622 2019-06-06  Devin Rousso  <drousso@apple.com>
2623
2624         Web Inspector: create CommandLineAPIHost lazily like the other agents
2625         https://bugs.webkit.org/show_bug.cgi?id=196047
2626         <rdar://problem/49087835>
2627
2628         Reviewed by Timothy Hatcher.
2629
2630         No change in functionality.
2631
2632         * inspector/InspectorController.cpp:
2633         (WebCore::InspectorController::InspectorController):
2634         (WebCore::InspectorController::createLazyAgents):
2635         * inspector/WorkerInspectorController.cpp:
2636         (WebCore::WorkerInspectorController::WorkerInspectorController):
2637         (WebCore::WorkerInspectorController::createLazyAgents):
2638
2639         * inspector/WebInjectedScriptManager.h:
2640         * inspector/WebInjectedScriptManager.cpp:
2641         (WebCore::WebInjectedScriptManager::WebInjectedScriptManager):
2642         (WebCore::WebInjectedScriptManager::connect): Added.
2643         (WebCore::WebInjectedScriptManager::disconnect):
2644         (WebCore::WebInjectedScriptManager::discardInjectedScripts):
2645
2646         * inspector/agents/InspectorDOMAgent.cpp:
2647         (WebCore::InspectorDOMAgent::setInspectedNode):
2648
2649 2019-06-05  Said Abou-Hallawa  <sabouhallawa@apple.com>
2650
2651         REGRESSION (r243121): Load event should not be fired while animating the 'externalResourcesRequired' attribute 
2652         https://bugs.webkit.org/show_bug.cgi?id=198576
2653
2654         Reviewed by Simon Fraser.
2655
2656         Firing the load event should only happen when dynamic update changes the
2657         attribute 'externalResourcesRequired'. Animating this attribute should
2658         not fire the load event.
2659
2660         When stopping the animations, applyAnimatedPropertyChange() should be
2661         called first then stopAnimation() is called second. The target element
2662         should know that its svgAttributeChanged() is called because of animating
2663         the attribute. So it can differentiate this case from the dynamic update.
2664
2665         Test: svg/animations/animate-externalResourcesRequired-no-load-event.html
2666
2667         * svg/SVGExternalResourcesRequired.cpp:
2668         (WebCore::SVGExternalResourcesRequired::svgAttributeChanged):
2669         * svg/properties/SVGAnimatedPropertyAnimator.h:
2670
2671 2019-06-05  Saam Barati  <sbarati@apple.com>
2672 2019-06-06  Zalan Bujtas  <zalan@apple.com>
2673
2674         [LFC][IFC] Move baseline and line height computation to a dedicated function
2675         https://bugs.webkit.org/show_bug.cgi?id=198611
2676         <rdar://problem/51482708>
2677
2678         Reviewed by Antti Koivisto.
2679
2680         This is in preparation for adding vertical aligment.
2681
2682         * layout/inlineformatting/InlineLine.cpp:
2683         (WebCore::Layout::Line::appendInlineContainerStart):
2684         (WebCore::Layout::Line::appendNonReplacedInlineBox):
2685         (WebCore::Layout::Line::adjustBaselineAndLineHeight):
2686         * layout/inlineformatting/InlineLine.h:
2687
2688 2019-06-06  Antti Koivisto  <antti@apple.com>
2689
2690         Position fixed is buggy with overflow:auto scrolling inside iframes
2691         https://bugs.webkit.org/show_bug.cgi?id=154399
2692         <rdar://problem/24742251>
2693
2694         Reviewed by Frederic Wang and Simon Fraser.
2695
2696         Test: scrollingcoordinator/ios/fixed-frame-overflow-swipe.html
2697
2698         After layer tree commit we were calling mainFrameViewportChangedViaDelegatedScrolling (even if viewport did not change)
2699         and expecting it to apply UI side scrolling deltas. However optimization prevents it from descending into subframes
2700         and we fail to update those properly.
2701
2702         In reality we only need to to apply scrolling tree positiong after commit if there has been delegated scrolling after the last
2703         one. Track this and do full update when needed.
2704
2705         * page/scrolling/ScrollingTree.cpp:
2706         (WebCore::ScrollingTree::applyLayerPositionsAfterCommit):
2707
2708         Add specific function for this. Don't do anything unless needed.
2709
2710         * page/scrolling/ScrollingTree.h:
2711         (WebCore::ScrollingTree::didScrollByDelegatedScrolling):
2712
2713         Track if there has been any delegated scrolling.
2714
2715         * page/scrolling/ScrollingTreeScrollingNode.cpp:
2716         (WebCore::ScrollingTreeScrollingNode::wasScrolledByDelegatedScrolling):
2717
2718         We can now bail out if nothing changes since we no longer rely on this for post-commit updates.
2719
2720 2019-06-06  Zalan Bujtas  <zalan@apple.com>
2721
2722         [LFC][IFC] Layout and preferred width computation should both call placeInlineItems().
2723         https://bugs.webkit.org/show_bug.cgi?id=198587
2724         <rdar://problem/51460340>
2725
2726         Reviewed by Antti Koivisto.
2727
2728         This patch enables inline placement logic sharing between layout and preferred width computation.
2729
2730         * layout/inlineformatting/InlineFormattingContext.h:
2731         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
2732         (WebCore::Layout::InlineFormattingContext::LineLayout::LineInput::LineInput):
2733         (WebCore::Layout::InlineFormattingContext::LineLayout::placeInlineItems const):
2734         (WebCore::Layout::InlineFormattingContext::LineLayout::layout const):
2735         (WebCore::Layout::InlineFormattingContext::LineLayout::computedIntrinsicWidth const):
2736
2737 2019-06-05  Takashi Komori  <Takashi.Komori@sony.com>
2738
2739         [Curl] Report all request headers to web inspector.
2740         https://bugs.webkit.org/show_bug.cgi?id=191653
2741
2742         Reviewed by Fujii Hironori.
2743
2744         Test: http/tests/inspector/network/resource-request-headers.html
2745
2746         * platform/network/curl/CurlContext.cpp:
2747         (WebCore::CurlHandle::setDebugCallbackFunction):
2748         * platform/network/curl/CurlContext.h:
2749         * platform/network/curl/CurlRequest.cpp:
2750         (WebCore::CurlRequest::setupTransfer):
2751         (WebCore::CurlRequest::didReceiveDebugInfo):
2752         (WebCore::CurlRequest::updateNetworkLoadMetrics):
2753         (WebCore::CurlRequest::didReceiveDebugInfoCallback):
2754         * platform/network/curl/CurlRequest.h:
2755
2756 2019-06-05  Said Abou-Hallawa  <sabouhallawa@apple.com>
2757
2758         [Cocoa] REGRESSION(r244182): Inspector thinks CA commits can be nested
2759         https://bugs.webkit.org/show_bug.cgi?id=198497
2760
2761         Reviewed by Simon Fraser.
2762
2763         WebInspecter should coalesce nested composites as one recorded composite.
2764         This can be done by ensuring that we only process CA preCommit and postCommit
2765         once per nested commits.
2766
2767         * inspector/InspectorController.cpp:
2768         (WebCore::InspectorController::willComposite):
2769         * inspector/InspectorController.h:
2770         Export willComposite(). We want to call willComposite()/ didComposite()
2771         from CA preCommit and postCommit handlers in flushLayers().
2772
2773         * inspector/agents/InspectorTimelineAgent.cpp:
2774         (WebCore::InspectorTimelineAgent::didComposite):
2775         Unrelated change: didComposite() should not assert that we're in the middle
2776         of a composite. Web Inspector may connect in the middle of a composite.
2777
2778         * page/FrameView.cpp:
2779         (WebCore::FrameView::flushCompositingStateIncludingSubframes):
2780         InspectorController::willComposite() will be called form CA preCommit
2781         handler of flushLayers().
2782
2783 2019-06-05  Myles C. Maxfield  <mmaxfield@apple.com>
2784
2785         [WHLSL] Educate the property resolver about IndexExpressions
2786         https://bugs.webkit.org/show_bug.cgi?id=198399
2787
2788         Reviewed by Saam Barati.
2789
2790         This is part one of two patches which will allow buffers to work. This patch
2791         adds support in the property resolver for index expressions. Index expressions
2792         get turned into calls to "getter indexers", "setter indexers", or "ander
2793         indexers". They work almost identically to dot expressions, except there is an
2794         extra "index" expression which gets turned into an extra argument to those
2795         functions.
2796
2797         There's actually a bit of a trick here. Let's say we need to run a getter and
2798         a setter separately (e.g. "foo[3]++;"). The index expression can't be duplicated
2799         for both the getter and the setter (e.g. the functions are
2800         int operator[](Foo, uint) and Foo operator[]=(Foo, uint, int), and we aren't
2801         allowed to execute the index expression multiple times. Consider if that "3"
2802         in the example is actually "bar()" with some side effect. So, we have to run
2803         the index expression once at the correct time, and save its result to a temporary
2804         variable, and then pass in the temporary variable into the getter and setter.
2805
2806         So, if the code says "foo[bar()][baz()] = quux();" the following sequence of
2807         functions get run:
2808
2809         - bar()
2810         - operator[](Foo, uint)
2811         - baz()
2812         - quux()
2813         - operator[]=(OtherType, uint, OtherOtherType)
2814         - operator[]=(Foo, uint, OtherType)
2815
2816         The next patch will modify the WebGPU JavaScript implementation to send buffer
2817         lengths to the shader, and for the shader compiler to correctly unpack this
2818         information and place it inside the array references. That should be everything
2819         that's needed to get buffers to work. After that, hooking up compute should be
2820         fairly trivial.
2821
2822         Tests: webgpu/propertyresolver/ander-abstract-lvalue.html
2823                webgpu/propertyresolver/ander-lvalue-3-levels.html
2824                webgpu/propertyresolver/ander-lvalue.html
2825                webgpu/propertyresolver/ander.html
2826                webgpu/propertyresolver/getter.html
2827                webgpu/propertyresolver/indexer-ander-abstract-lvalue.html
2828                webgpu/propertyresolver/indexer-ander-lvalue-3-levels.html
2829                webgpu/propertyresolver/indexer-ander-lvalue.html
2830                webgpu/propertyresolver/indexer-ander.html
2831                webgpu/propertyresolver/indexer-getter.html
2832                webgpu/propertyresolver/indexer-setter-abstract-lvalue-3-levels.html
2833                webgpu/propertyresolver/indexer-setter-abstract-lvalue.html
2834                webgpu/propertyresolver/indexer-setter-lvalue.html
2835                webgpu/propertyresolver/indexer-setter.html
2836                webgpu/propertyresolver/setter-abstract-lvalue-3-levels.html
2837                webgpu/propertyresolver/setter-abstract-lvalue.html
2838                webgpu/propertyresolver/setter-lvalue.html
2839
2840         * Modules/webgpu/WHLSL/AST/WHLSLAddressSpace.h:
2841         (WebCore::WHLSL::AST::toString):
2842         * Modules/webgpu/WHLSL/AST/WHLSLEntryPointType.h:
2843         (WebCore::WHLSL::AST::toString):
2844         * Modules/webgpu/WHLSL/AST/WHLSLIndexExpression.h:
2845         (WebCore::WHLSL::AST::IndexExpression::takeIndex):
2846         * Modules/webgpu/WHLSL/AST/WHLSLReferenceType.h:
2847         * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp:
2848         (WebCore::WHLSL::Metal::writeNativeFunction):
2849         (WebCore::WHLSL::Metal::convertAddressSpace): Deleted.
2850         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
2851         (WebCore::WHLSL::checkOperatorOverload):
2852         (WebCore::WHLSL::Checker::finishVisiting):
2853         (WebCore::WHLSL::Checker::visit):
2854         * Modules/webgpu/WHLSL/WHLSLInferTypes.h:
2855         * Modules/webgpu/WHLSL/WHLSLPropertyResolver.cpp:
2856         (WebCore::WHLSL::PropertyResolver::visit):
2857         (WebCore::WHLSL::setterCall):
2858         (WebCore::WHLSL::getterCall):
2859         (WebCore::WHLSL::modify):
2860         (WebCore::WHLSL::PropertyResolver::simplifyRightValue):
2861         (WebCore::WHLSL::LeftValueSimplifier::finishVisiting):
2862         (WebCore::WHLSL::LeftValueSimplifier::visit):
2863         * Modules/webgpu/WHLSL/WHLSLStandardLibrary.txt:
2864         * Modules/webgpu/WHLSL/WHLSLSynthesizeStructureAccessors.cpp:
2865         (WebCore::WHLSL::synthesizeStructureAccessors):
2866
2867 2019-06-05  Robin Morisset  <rmorisset@apple.com>
2868
2869         [WHLSL] Parsing and lexing the standard library is slow
2870         https://bugs.webkit.org/show_bug.cgi?id=192890
2871         <rdar://problem/50746335>
2872
2873         Reviewed by Myles Maxfield.
2874
2875         The main idea is to avoid backtracking by instead peeking at the next token (and occasionally at the one after that).
2876         This implies a few things:
2877         - We can replace the stack of tokens by a trivial ring buffer of size 2 (holding the next token and the one after, or WTF::nullopt if we are at the end of the file).
2878         - We now have "completeFooExpression" functions, to avoid having to reparse the prefix of some expression, if we find half-way through what it is.
2879
2880         I also fixed the following parser bug:
2881         - https://bugs.webkit.org/show_bug.cgi?id=198305 [WHLSL] Multiple variables with initializers in a declaration statement crashes the compiler
2882             which was due to a mistake I made in the grammar
2883
2884         Finally I added two new macros: CONSUME_TYPE and PARSE to eliminate about 500 lines of error propagation boilerplate.
2885
2886         There are still lots of ways of improving the parser and lexer, such as:
2887         - finishing the conversion of tokens in the lexer, not bothering with allocating string views
2888         - make two special tokens Invalid and EOF, to remove the overhead of Optional
2889         - make peekTypes and consumeTypes use templates to avoid constructing a Vector and calling find on it.
2890         - Turn the entire lexer into a proper automata, not going through the same characters again and again (this is certainly the largest win by far)
2891         - Remove the last few pieces of backtracking from the parser.
2892
2893         The current patch is already enough to make parsing the full standard library (something like 85k lines) approximately 260ms.
2894         This is still longer than I would like, but nowhere near the bottleneck any longer because of some other parts of the compiler.
2895
2896         * Modules/webgpu/WHLSL/WHLSLLexer.h:
2897         (WebCore::WHLSL::Lexer::Lexer):
2898         (WebCore::WHLSL::Lexer::consumeToken):
2899         (WebCore::WHLSL::Lexer::peek):
2900         (WebCore::WHLSL::Lexer::peekFurther):
2901         (WebCore::WHLSL::Lexer::state const):
2902         (WebCore::WHLSL::Lexer::setState):
2903         (WebCore::WHLSL::Lexer::unconsumeToken): Deleted.
2904         * Modules/webgpu/WHLSL/WHLSLParser.cpp:
2905         (WebCore::WHLSL::Parser::parse):
2906         (WebCore::WHLSL::Parser::peek):
2907         (WebCore::WHLSL::Parser::peekTypes):
2908         (WebCore::WHLSL::Parser::tryType):
2909         (WebCore::WHLSL::Parser::tryTypes):
2910         (WebCore::WHLSL::Parser::consumeTypes):
2911         (WebCore::WHLSL::Parser::parseConstantExpression):
2912         (WebCore::WHLSL::Parser::parseTypeArgument):
2913         (WebCore::WHLSL::Parser::parseTypeArguments):
2914         (WebCore::WHLSL::Parser::parseTypeSuffixAbbreviated):
2915         (WebCore::WHLSL::Parser::parseTypeSuffixNonAbbreviated):
2916         (WebCore::WHLSL::Parser::parseType):
2917         (WebCore::WHLSL::Parser::parseTypeDefinition):
2918         (WebCore::WHLSL::Parser::parseResourceSemantic):
2919         (WebCore::WHLSL::Parser::parseSpecializationConstantSemantic):
2920         (WebCore::WHLSL::Parser::parseStageInOutSemantic):
2921         (WebCore::WHLSL::Parser::parseSemantic):
2922         (WebCore::WHLSL::Parser::parseQualifiers):
2923         (WebCore::WHLSL::Parser::parseStructureElement):
2924         (WebCore::WHLSL::Parser::parseStructureDefinition):
2925         (WebCore::WHLSL::Parser::parseEnumerationDefinition):
2926         (WebCore::WHLSL::Parser::parseEnumerationMember):
2927         (WebCore::WHLSL::Parser::parseNativeTypeDeclaration):
2928         (WebCore::WHLSL::Parser::parseNumThreadsFunctionAttribute):
2929         (WebCore::WHLSL::Parser::parseAttributeBlock):
2930         (WebCore::WHLSL::Parser::parseParameter):
2931         (WebCore::WHLSL::Parser::parseParameters):
2932         (WebCore::WHLSL::Parser::parseFunctionDefinition):
2933         (WebCore::WHLSL::Parser::parseComputeFunctionDeclaration):
2934         (WebCore::WHLSL::Parser::parseVertexFragmentFunctionDeclaration):
2935         (WebCore::WHLSL::Parser::parseRegularFunctionDeclaration):
2936         (WebCore::WHLSL::Parser::parseOperatorFunctionDeclaration):
2937         (WebCore::WHLSL::Parser::parseFunctionDeclaration):
2938         (WebCore::WHLSL::Parser::parseNativeFunctionDeclaration):
2939         (WebCore::WHLSL::Parser::parseBlock):
2940         (WebCore::WHLSL::Parser::parseBlockBody):
2941         (WebCore::WHLSL::Parser::parseIfStatement):
2942         (WebCore::WHLSL::Parser::parseSwitchStatement):
2943         (WebCore::WHLSL::Parser::parseSwitchCase):
2944         (WebCore::WHLSL::Parser::parseForLoop):
2945         (WebCore::WHLSL::Parser::parseWhileLoop):
2946         (WebCore::WHLSL::Parser::parseDoWhileLoop):
2947         (WebCore::WHLSL::Parser::parseVariableDeclaration):
2948         (WebCore::WHLSL::Parser::parseVariableDeclarations):
2949         (WebCore::WHLSL::Parser::parseStatement):
2950         (WebCore::WHLSL::Parser::parseEffectfulExpression):
2951         (WebCore::WHLSL::Parser::parseEffectfulAssignment):
2952         (WebCore::WHLSL::Parser::parseExpression):
2953         (WebCore::WHLSL::Parser::parseTernaryConditional): Deleted.
2954         (WebCore::WHLSL::Parser::completeTernaryConditional):
2955         (WebCore::WHLSL::Parser::parseAssignment): Deleted.
2956         (WebCore::WHLSL::Parser::completeAssignment):
2957         (WebCore::WHLSL::Parser::parsePossibleTernaryConditional):
2958         (WebCore::WHLSL::Parser::parsePossibleLogicalBinaryOperation):
2959         (WebCore::WHLSL::Parser::completePossibleLogicalBinaryOperation):
2960         (WebCore::WHLSL::Parser::parsePossibleRelationalBinaryOperation):
2961         (WebCore::WHLSL::Parser::completePossibleRelationalBinaryOperation):
2962         (WebCore::WHLSL::Parser::parsePossibleShift):
2963         (WebCore::WHLSL::Parser::completePossibleShift):
2964         (WebCore::WHLSL::Parser::parsePossibleAdd):
2965         (WebCore::WHLSL::Parser::completePossibleAdd):
2966         (WebCore::WHLSL::Parser::parsePossibleMultiply):
2967         (WebCore::WHLSL::Parser::completePossibleMultiply):
2968         (WebCore::WHLSL::Parser::parsePossiblePrefix):
2969         (WebCore::WHLSL::Parser::parsePossibleSuffix):
2970         (WebCore::WHLSL::Parser::parseCallExpression):
2971         (WebCore::WHLSL::Parser::parseTerm):
2972         (WebCore::WHLSL::Parser::parseAddressSpaceType): Deleted.
2973         (WebCore::WHLSL::Parser::parseNonAddressSpaceType): Deleted.
2974         (WebCore::WHLSL::Parser::parseEntryPointFunctionDeclaration): Deleted.
2975         (WebCore::WHLSL::Parser::parseEffectfulPrefix): Deleted.
2976         (WebCore::WHLSL::Parser::parseEffectfulSuffix): Deleted.
2977         * Modules/webgpu/WHLSL/WHLSLParser.h:
2978         (WebCore::WHLSL::Parser::Error::dump const):
2979
2980 2019-06-05  Alex Christensen  <achristensen@webkit.org>
2981
2982         Revert part of r246126
2983         https://bugs.webkit.org/show_bug.cgi?id=197132
2984
2985         * platform/ios/WebItemProviderPasteboard.h:
2986         This change broke an internal build, so I'm reverting it.
2987
2988 2019-06-05  Daniel Bates  <dabates@apple.com>
2989
2990         [CSP] Data URLs should inherit their CSP policy
2991         https://bugs.webkit.org/show_bug.cgi?id=198572
2992         <rdar://problem/50660927>
2993
2994         Reviewed by Brent Fulgham.
2995
2996         As per <https://w3c.github.io/webappsec-csp/#security-inherit-csp> (Editor's Draft, 28 February 2019) data
2997         URLs should inherit their CSP policy from their parent (if they have one).
2998
2999         Test: http/tests/security/contentSecurityPolicy/subframe-with-data-url-inheritance.html
3000
3001         * dom/Document.cpp:
3002         (WebCore::Document::shouldInheritContentSecurityPolicyFromOwner const):
3003
3004 2019-06-05  Saam Barati  <sbarati@apple.com>
3005
3006         Unreviewed. Follow up fix after r246115.
3007         I changed the code to assert that we don't have duplicate native
3008         functions. It turns out we do. I will fix that here, then add
3009         back the assert. https://bugs.webkit.org/show_bug.cgi?id=198580
3010
3011         * Modules/webgpu/WHLSL/WHLSLCheckDuplicateFunctions.cpp:
3012         (WebCore::WHLSL::checkDuplicateFunctions):
3013
3014 2019-06-05  Alex Christensen  <achristensen@webkit.org>
3015
3016         Progress towards resurrecting Mac CMake build
3017         https://bugs.webkit.org/show_bug.cgi?id=197132
3018
3019         Reviewed by Don Olmstead.
3020
3021         * CMakeLists.txt:
3022         * PlatformMac.cmake:
3023         * platform/cocoa/ContentFilterUnblockHandlerCocoa.mm:
3024
3025 == Rolled over to ChangeLog-2019-06-05 ==