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